1 /*        BEGIN INCLUDE FILE comp_text.incl.pl1    */
  2 
  3 /* format: style2,ind2,ll79,dclind4,idind15,comcol41,linecom */
  4 
  5      dcl 1 tblkdata                     /* data for allocated text blocks */
  6                         aligned based (shared.tblkdata_ptr),
  7            2 block,                     /* block pool */
  8              3 count    fixed bin,
  9              3 ptr      (500) ptr,      /* block pointers */
 10                                         /* block state flags */
 11              3 free     (500) bit (1) unal,
 12            2 line_area,                 /* line area pool */
 13              3 count    fixed bin,
 14              3 ptr      (500) ptr,      /* area pointers */
 15                                         /* area state flags */
 16              3 free     (500) bit (1) unal,
 17            2 text_area,                 /* text area pool */
 18              3 count    fixed bin,
 19              3 ptr      (500) ptr,      /* area pointers */
 20                                         /* area state flags */
 21              3 free     (500) bit (1) unal,
 22              3 string_area_count
 23                         fixed bin;      /* line areas */
 24      dcl LINE_AREA_SIZE fixed bin static options (constant) init (24);
 25      dcl line_area_ptr  ptr init (null);
 26      dcl 1 line_area    aligned based (line_area_ptr),
 27            2 next       ptr,            /* forward thread */
 28            2 prev       ptr,            /* backward thread */
 29            2 count      fixed bin,      /* number of lines allocated */
 30            2 ndx        fixed bin,      /* index of current line */
 31            2 pndx       fixed bin,      /* area pool index */
 32            2 linptr     (LINE_AREA_SIZE) ptr;
 33                                         /* text areas */
 34      dcl TEXT_AREA_SIZE fixed bin static options (constant) init (6);
 35      dcl text_area_ptr  ptr init (null);
 36      dcl 1 text_area    aligned based (text_area_ptr),
 37            2 next       ptr,            /* forward thread */
 38            2 count      fixed bin,      /* number of areas allocated */
 39            2 ndx        fixed bin,      /* index of current strarea */
 40            2 pndx       fixed bin,      /* area pool index */
 41            2 strareaptr (TEXT_AREA_SIZE) ptr;
 42                                         /* text string area */
 43      dcl string_area    (256) fixed bin based;
 44      dcl txtstrptr      ptr;            /* current text string */
 45      dcl txtstr         char (1020) var based (txtstrptr);
 46 
 47      dcl TEXT_VERSION   fixed bin static options (constant) init (9);
 48                                         /* general text block */
 49      dcl 1 text         aligned based (shared.blkptr),
 50            2 version    fixed bin,      /* version of structure */
 51            2 blkndx     fixed bin,      /* block data index */
 52            2 blktype    char (2),       /* block type code */
 53                                         /* dynamic block control stuff */
 54            2 hdr        aligned like text_header,
 55                                         /* text read from input file */
 56            2 input      aligned like text_entry,
 57            2 input_line char (1020) var,/* input buffer */
 58            2 line_area,
 59              3 first    ptr,            /* head of line area thread */
 60              3 cur      ptr,            /* current line area */
 61            2 next_text  ptr,            /* next text string */
 62                                         /* text formatting parameters */
 63            2 parms      aligned like default_parms,
 64            2 text_area,
 65              3 first    ptr,            /* head of text area thread */
 66              3 cur      ptr;            /* current text area */
 67                                         /* an empty text block line */
 68      dcl 1 text_entry   aligned based (const.text_entry_ptr),
 69            2 sws,                       /* unaligned switches, etc. */
 70              3 art      bit (1) unal,   /* line has artwork */
 71              3 cbar,                    /* change bar flags */
 72                4 add    bit (1) unal,   /* text addition flag */
 73                4 del    bit (1) unal,   /* text deletion flag */
 74                4 mod    bit (1) unal,   /* text modification flag */
 75              3 default  bit (1) unal,   /* 1 = default case as needed */
 76              3 DVctl    bit (1) unal,   /* 1 = line is a device ctl string */
 77              3 embedded bit (1) unal,   /* 1 = line has an embedded control */
 78              3 end_keep bit (1) unal,   /* 1= line ends a keep */
 79              3 fnt_chng bit (1) unal,   /* 1 = text is a font change string */
 80              3 footref  bit (1) unal,   /* 1 = line has a footnote reference */
 81              3 hanging  bit (1) unal,   /* 1 = a hanging undent */
 82              3 keep     bit (1) unal,   /* 1 = unsplittable line */
 83              3 no_trim  bit (1) unal,   /* 1 = untrimmable white line */
 84              3 oflo     bit (1) unal,   /* line causes overflow */
 85              3 punct    bit (1) unal,   /* 1 = line ends with punctuation */
 86              3 quad     bit (6) unal,   /* text alignment flags */
 87              3 space_added              /* 1= line has added space */
 88                         bit (1) unal,
 89              3 spcl,                    /* special entry - not output text */
 90                4 file   bit (1) unal,   /* 1= output to special file */
 91                4 blk_splt               /* 1= action at block split time */
 92                         bit (1) unal,
 93                4 page_mkup              /* 1= action at page makeup time */
 94                         bit (1) unal,
 95              3 table    bit (1) unal,   /* 1= line is a table entry */
 96              3 tblspc   bit (1) unal,   /* 1= WS fill for table mode */
 97              3 title    bit (1) unal,   /* 1= line is a <title> */
 98              3 unspnct  bit (1) unal,   /* 1= underscore punctuation */
 99              3 unstop   bit (1) unal,   /* 1= line is/ends with UNSTOP */
100              3 unstrt   bit (1) unal,   /* 1= line is/ends with UNSTART */
101              3 unswrds  bit (1) unal,   /* 1= underscore words only */
102              3 white    bit (1) unal,   /* 1= line is white space */
103              3 und_prot bit (1) unal,   /* 1= undent is protected */
104              3 MBZ      bit (4) unal,
105            2 art_start  fixed bin unal, /* start of art string in line */
106            2 art_len    fixed bin unal, /* length of art string in line */
107            2 cbar_level                 /* change level for cbars */
108                         char (1) aligned,
109            2 cur,                       /* current scanning data for line */
110              3 chrct    fixed bin,      /* count of chars scanned */
111              3 gaps     fixed bin,      /* gap count */
112              3 width    fixed bin (31), /* width of font chars */
113              3 min      fixed bin (31), /* width of min spbnds */
114              3 avg      fixed bin (31), /* width of avg spbnds */
115              3 max      fixed bin (31), /* width of max spbnds */
116              3 font     like fntstk_entry,
117            2 depth      fixed bin (31), /* page depth for line */
118                                         /* font at start of line */
119            2 font       like fntstk_entry,
120            2 index      fixed bin (21), /* char index for line scanning */
121            2 info,                      /* stuff created during line input */
122              3 fileno   fixed bin,      /* input file index */
123              3 lineno   fixed bin,      /* input file line number */
124              3 lineno0  fixed bin,      /* call_box0 line number */
125            2 linespace  fixed bin (31), /* linespace value for the line */
126            2 lmarg      fixed bin (31), /* adjusted left margin position */
127            2 mod_len    fixed bin,      /* length of modified text */
128            2 mod_start  fixed bin,      /* index for start of modified text */
129            2 net        fixed bin (31), /* net line width for filling */
130            2 ptr        ptr,            /* pointer to the actual text */
131            2 rmarg      fixed bin (31), /* adjusted right margin position */
132            2 spcl_iocbp ptr,            /* iocb ptr for spcl line */
133            2 sym_delim  char (1) unal,  /* symbol delimiter for this line */
134            2 tblcol     fixed bin,      /* column for table entries */
135            2 title_delim
136                         char (1) unal,  /* title delimiter if a <title> */
137            2 title_index
138                         fixed bin,      /* <title> block index for line */
139            2 width      fixed bin (31), /* width of text */
140            2 ftn,                       /* footnote info for line */
141              3 ct       fixed bin,      /* number of footnote refs */
142              3 used     fixed bin (31), /* space used */
143              3 e        (40),           /* limit is arbitrary */
144                4 blkndx fixed bin unal, /* block index of footnote - if this
145                                            value is 0, then .frf was used */
146                4 refno  fixed bin unal; /* reference number */
147 
148      dcl (
149          quadi          init ("40"b3),  /* set to the inside margin */
150          quado          init ("20"b3),  /* set to the outside margin */
151          quadl          init ("10"b3),  /* set left */
152          quadc          init ("04"b3),  /* set centered */
153          quadr          init ("02"b3),  /* set right */
154          just           init ("01"b3)   /* justified */
155          )              bit (6) static options (constant);
156                                         /* control line structure */
157      dcl 1 ctl          aligned like text_entry based (const.ctl_ptr);
158      dcl ctl_line       char (1020) var based (ctl.ptr);
159 
160      dcl txtlinptr      ptr;            /* the current text line */
161      dcl 1 txtlin       aligned like text_entry based (txtlinptr);
162                                         /* empty text header structure */
163      dcl 1 text_header  aligned based (const.text_header_ptr),
164            2 sws,                       /* control switches */
165              3 art      bit (1) unal,   /* block has artwork */
166              3 dfrftn   bit (1) unal,   /* block is a deferred footnote */
167              3 modified bit (1) unal,   /* block contains modified lines */
168              3 no_trim  bit (1) unal,   /* 1 = dont trim WS block */
169              3 oflo_ftn bit (1) unal,   /* overflow footnote */
170              3 tblblk   bit (1) unal,   /* a table block */
171              3 unref    bit (1) unal,   /* block is an unreffed footnote */
172              3 white    bit (1) unal,   /* block is a white space block */
173              3 picture  bit (1) unal,   /* picture block */
174              3 orphan   bit (1) unal,   /* 1= footnote is an orphan */
175              3 MBZ      bit (26) unal,
176            2 art_count  fixed bin unal, /* to count input art lines */
177            2 blkptr     ptr,            /* pointer to suspended block */
178            2 cap_size   fixed bin unal, /* line count of text caption */
179            2 cap_used   fixed bin (31), /* size of text caption */
180            2 colno      fixed bin unal, /* column owning the block */
181            2 count      fixed bin unal, /* line count for block */
182            2 eqn_line_count
183                         fixed bin unal, /* counter for equation lines */
184            2 first_text fixed bin unal, /* OBSOLETE */
185            2 ftn,                       /* footnotes */
186              3 ct       fixed bin,      /* count */
187              3 usd      fixed bin (31), /* space used */
188              3 blkndx   (40) fixed bin, /* footnote block index values */
189            2 head_size  fixed bin,      /* line count of text header */
190            2 head_used  fixed bin (31), /* size of text header */
191            2 index      fixed bin unal, /* block index of next output line */
192            2 keep_count fixed bin unal, /* to count input keep lines */
193            2 last_line  fixed bin,      /* last text line in column */
194            2 mx_ttl_ndx fixed bin,      /* max title index value in block */
195            2 name       char (32) var,  /* block name, if any */
196            2 nofill_count               /* to count nofill lines */
197                         fixed bin,
198            2 parms_ptr  ptr,            /* parms for suspended block */
199            2 refer      fixed bin,      /* inter-block reference */
200            2 refer_index                /* OBSOLETE */
201                         fixed bin,      /* a reference */
202            2 split      fixed bin,      /* split point for balancing */
203            2 trl_ws     fixed bin (31), /* trailing WS */
204            2 used       fixed bin (31); /* page space used by a column/block */
205                                         /* text formatting parameters */
206      dcl 1 text_parms   aligned like default_parms
207                         based (const.text_parms_ptr);
208 
209      dcl 1 current_parms
210                         aligned like default_parms
211                         based (const.current_parms_ptr);
212 
213      dcl 1 default_parms
214                         aligned based (const.default_parms_ptr),
215            2 sws,                       /* control switches */
216              3 quad     bit (6) unal,   /* text alignment mode */
217              3 art      bit (1) unal,   /* 1 = block countains artwork */
218              3 cbar,                    /* change bar flags */
219                4 add    bit (1) unal,   /* text addition flag */
220                4 del    bit (1) unal,   /* text deletion flag for next line */
221                4 mod    bit (1) unal,   /* text modification flag */
222              3 fill_mode
223                         bit (1) unal,   /* 1 = fill mode ON */
224              3 footnote bit (1) unal,   /* block is a footnote */
225              3 hfc      bit (1) unal,   /* OBSOLETE */
226              3 htab_mode
227                         bit (1) unal,   /* 1 = horizontal tab mode ON */
228              3 keep     bit (1) unal,   /* keep mode */
229              3 page     bit (1) unal,   /* block belongs to page, not text */
230              3 title_mode
231                         bit (1) unal,   /* 0 = plain text, 1 = <title>s OK */
232              3 MBZ      bit (19) unal,
233            2 ftrptr     ptr,            /* text caption block */
234            2 cbar_level                 /* change level for cbars */
235                         char (1) aligned,
236            2 hdrptr     ptr,            /* text header block */
237            2 left,                      /* left margin data */
238              3 indent   fixed bin (31),
239              3 undent   fixed bin (31),
240            2 linespace  fixed bin (31), /* line spacing value */
241            2 measure    fixed bin (31), /* line space for text */
242                                         /* right margin data */
243            2 right      like default_parms.left,
244            2 fntstk,                    /* stack of last 20 font changes */
245              3 index    fixed bin,      /* which one in use */
246                                         /* entry(0) is the default */
247              3 entry    (0:19) like fntstk_entry;
248 
249      dcl hfcblk_ptr     ptr;
250      dcl 1 hfcblk       aligned like text based (hfcblk_ptr);
251 
252 /*        END INCLUDE FILE comp_text.incl.pl1     */