Pristine Ack-5.5
[Ack-5.5.git] / modules / src / em_code / insert.h
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
7 /* $Id: insert.h,v 1.6 1994/06/24 11:11:18 ceriel Exp $ */
8
9 #include <system.h>
10 #include <local.h>
11
12 #if BIGMACHINE
13 #define INCORE  /* mechanism implemented incore */
14 #endif
15
16 typedef struct partofpart {
17         struct partofpart       *pp_next;
18         char                    pp_type;
19 #define TEXT    0
20 #define INSERT  1
21         union {
22                 struct {
23                         long    ppu_begin, ppu_end;
24                 } ppu_s;
25                 int     ppu_id;
26         } pp_u;
27 #define pp_begin        pp_u.ppu_s.ppu_begin
28 #define pp_end          pp_u.ppu_s.ppu_end
29 #define pp_id           pp_u.ppu_id
30 } PartOfPart;
31
32 typedef struct part {
33         struct part     *p_next;        /* next part in hash chain */
34         char            p_flags;
35 #define BUSY    1
36         PartOfPart      *p_parts;       /* chunks of this part */
37         struct part     *p_prevpart;    /* implements stack of active parts */
38         int             p_id;           /* id of this part */
39 } Part;
40
41 #define TABSIZ  32
42
43 extern int
44         C_ontmpfile, C_sequential;
45 extern Part
46         *C_curr_part;
47 #ifdef INCORE
48 extern char
49         *C_current_out, *C_BASE;
50 #define C_opp C_current_out
51 #else
52 extern long
53         C_current_out;
54 extern char     *C_opp;
55 #define C_BASE 0
56 #endif
57 extern int (*C_outpart)(), (*C_swtout)(), (*C_swttmp)();
58
59 extern File     *C_ofp;
60
61 #ifndef INCORE
62 extern File     *C_tfr;
63 extern char     *C_tmpfile;
64 #endif
65
66 extern char     *C_top;
67 extern char     *C_ibuf;
68
69 #define put(c)  if (C_opp == C_top) C_flush(); *C_opp++ = (c)
70