insert.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Structures used for the C_insertpart, C_beginpart, and C_endpart
  2. mechanism. Each part consists of a list of chunks. Each chunk is
  3. either another part, or a piece of text limited by a begin- and an
  4. end-pointer.
  5. */
  6. /* $Id$ */
  7. #include <system.h>
  8. #include <local.h>
  9. #if BIGMACHINE
  10. #define INCORE /* mechanism implemented incore */
  11. #endif
  12. typedef struct partofpart {
  13. struct partofpart *pp_next;
  14. char pp_type;
  15. #define TEXT 0
  16. #define INSERT 1
  17. union {
  18. struct {
  19. long ppu_begin, ppu_end;
  20. } ppu_s;
  21. int ppu_id;
  22. } pp_u;
  23. #define pp_begin pp_u.ppu_s.ppu_begin
  24. #define pp_end pp_u.ppu_s.ppu_end
  25. #define pp_id pp_u.ppu_id
  26. } PartOfPart;
  27. typedef struct part {
  28. struct part *p_next; /* next part in hash chain */
  29. char p_flags;
  30. #define BUSY 1
  31. PartOfPart *p_parts; /* chunks of this part */
  32. struct part *p_prevpart; /* implements stack of active parts */
  33. int p_id; /* id of this part */
  34. } Part;
  35. #define TABSIZ 32
  36. extern int
  37. C_ontmpfile, C_sequential;
  38. extern Part
  39. *C_curr_part;
  40. #ifdef INCORE
  41. extern char
  42. *C_current_out, *C_BASE;
  43. #define C_opp C_current_out
  44. #else
  45. extern long
  46. C_current_out;
  47. extern char *C_opp;
  48. #define C_BASE 0
  49. #endif
  50. extern int (*C_outpart)(), (*C_swtout)(), (*C_swttmp)();
  51. extern File *C_ofp;
  52. #ifndef INCORE
  53. extern File *C_tfr;
  54. extern char *C_tmpfile;
  55. #endif
  56. extern char *C_top;
  57. extern char *C_ibuf;
  58. #define put(c) if (C_opp == C_top) C_flush(); *C_opp++ = (c)