7b619d119e039e7b33b1f1e7860dd5578a4151b1
[oweals/cde.git] / cde / programs / dthelp / parser / canon1 / helptag / global.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $TOG: global.h /main/4 1998/04/06 13:17:51 mgreess $ */
24 /* Copyright (c) 1988, 1989 Hewlett-Packard Co. */
25 /* Global definitions for HP Tag/TeX translator */
26 /*   When changing this file, check "grphpar.h" for conflicts */
27
28 #if defined(DEFINE)
29 #define EXTERN
30 #define INIT(a) = a
31 #else
32 #define EXTERN extern
33 #define INIT(a)
34 #endif
35
36 #include <malloc.h>
37 #include <string.h>
38 #include <time.h>
39 #if defined(MSDOS)
40 #include <io.h>
41 #include <stdlib.h>
42 #include <process.h>
43 #include <direct.h>
44 #endif
45 #include <ctype.h>
46
47 #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) || defined(__osf__) || defined(linux)
48 #include <unistd.h>
49 #include <locale.h>
50 #include <fcntl.h>
51 #endif
52
53 #define MAXHEADLINES 3
54 #define FNAMELEN 513
55 #define BIGBUF 1024
56
57
58 /* substitute for m_ctupper; we don't cast x into (int), thereby
59    avoiding any problems of high order bit.  This is in response
60    to "Entity no allowed in ART" messages by cupertino.  However,
61    this more of a loose deduction, and really needs confirmation.  */
62 #define ctupper(x) (m_ctarray[x].upper)
63
64
65 /* Must be in same order as values in optkey, adjust NUMOPTIONS if changed*/
66 #define DRAFT         1
67 #define FINAL         2
68 #define MEMO          3
69 #define NOMEMO        4
70 #define SEARCHKEY     5
71 #define CLEARSEARCH   6
72 #define LONGFILES     7
73 #define LONGFILE      8
74 #define LONG          9
75 #define SHORTFILES   10
76 #define SHORTFILE    11
77 #define SHORT        12
78 #define CHARSET      13
79 #define ONERROR      14
80
81 #if defined(FUTURE_FEATURE)
82 #define GRAPHICS     15
83 #define NOGRAPHICS   16
84 #define REV          17
85 #define NOREV        18
86 #endif /* FUTURE_FEATURE */
87
88 #define NUMOPTIONS 14
89
90 EXTERN int optval INIT(M_NULLVAL) ;
91
92 EXTERN char *optkey[NUMOPTIONS]
93 #if defined(DEFINE)
94   = {
95       "draft",
96       "final",
97       "memo",
98       "nomemo",
99       "search",
100       "clearsearch",
101       "longfiles",
102       "longfile",
103       "long",
104       "shortfiles",
105       "shortfile",
106       "short",
107       "charset",
108       "onerror",
109
110 #if defined(FUTURE_FEATURE)
111       "graphics",
112       "nographics",
113       "rev",
114       "norev",
115 #endif /* FUTURE_FEATURE */
116       }
117 #endif
118   ;
119
120 /* Processing options */
121 EXTERN LOGICAL final INIT(FALSE) ;
122 EXTERN LOGICAL memo INIT(FALSE) ;
123 EXTERN int rebuild INIT(FALSE) ;
124
125 EXTERN LOGICAL stoponerror INIT(TRUE) ;
126
127 #if defined(FUTURE_FEATURE)
128 EXTERN LOGICAL prntrevs INIT(FALSE) ;
129 #endif /* FUTURE_FEATURE */
130
131 /* variables for index sorting and tagging in the scripts */
132        /* we create a child directory for processing the index, so as not
133           to clobber any files with the same base name.  However, this will
134           affect search paths that are relative; those that are relative
135           need to have parent level prepended.  This is done only when
136           "parentsrch" is set to TRUE; done only when we process indexes.  */
137 EXTERN LOGICAL parentsrch INIT(FALSE) ;
138 EXTERN char *idxfile INIT(NULL) ; /* index file name only */
139 EXTERN char *idxpath INIT(NULL) ; /* index file name w/path */
140 EXTERN char *idxbase INIT(NULL) ; /* index base name only */
141
142 /* TeX counter for chapter number */
143 #define FRONTCOUNT 0
144 #define APPCOUNT 1000
145 #define TOCCOUNT 2000
146 #define MSGCOUNT 3000
147 #define BIBCOUNT 4000
148 #define GLOSSCOUNT 5000
149 #define INDEXCOUNT 6000
150
151 /* Flag for filelist vs. Tag to SDL translator */
152 EXTERN LOGICAL filelist INIT(FALSE) ;
153
154 EXTERN M_WCHAR *helpcharset INIT(NULL);
155 EXTERN M_WCHAR *helplang    INIT(NULL);
156 EXTERN char    *docId INIT("SDL-RESERVED0");
157 EXTERN char    sdlReservedName[] INIT("SDL-RESERVED");
158 #define SDLNAMESIZ sizeof("SDL-RESERVED")
159 EXTERN char    *pubId INIT("CDE 1.0");
160
161 /* Working directory, input directory, installation directory,
162    and search paths */
163 EXTERN LOGICAL defaultext ;
164 EXTERN M_WCHAR *inputname;    /* pointer to name of main input file */
165 EXTERN char *base ;
166 EXTERN char *baseext ;
167 EXTERN char *nodirbase ;
168 EXTERN char *work INIT("") ;
169 EXTERN char *indir INIT(NULL) ;
170 EXTERN char *install INIT(NULL) ;
171 typedef struct search SEARCH ;
172 struct search {
173   char *directory ;
174   SEARCH *next ;
175   } ;
176 EXTERN SEARCH *path INIT(NULL) ;
177 EXTERN SEARCH **endpath INIT(&path) ;
178 EXTERN char dirsep
179 #if defined(MSDOS)
180 INIT('\\')
181 #else
182 #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__) || defined(__osf__) || defined(linux)
183 INIT('/')
184 #else
185 ****define directory separator here****
186 #endif
187 #endif
188   ;
189
190 #if defined(hpux) || defined(_AIX) || defined(sun) || defined(USL) || defined(__uxp__)|| defined(__osf__) || defined(linux)
191 #define CSEP '/'
192 #define SSEP "/"
193 #else
194 #if defined(MSDOS)
195 #define CSEP '\\'
196 #define SSEP "\\"
197 #else
198 ****define directory separator here****
199 #endif
200 #endif
201
202 /* Location in .TEX file of two \wlog messages */
203 EXTERN long wlog ;
204
205 /* True if have encountered idx or idxsyn */
206 EXTERN LOGICAL have_index INIT(FALSE) ; 
207 EXTERN long idxupdate INIT(0L) ; /* file/seek pointer for make facility */
208
209 /* True within a sequence of rsect's */
210 EXTERN LOGICAL rsectseq INIT(FALSE) ;
211
212 /* True if this manual has a glossary */
213 EXTERN LOGICAL glossary INIT(FALSE) ;
214
215 /* True while processing a note if a head was encountered */
216 EXTERN LOGICAL notehead ;
217
218 /* File address for "Generated TeX file complete" message */
219 EXTERN long texcomplete ;
220
221 /* File pointer for cross-reference file */
222 EXTERN FILE *xrf ;
223
224 /* global link type pointer, used in xref to match latest link type */
225 EXTERN int global_linktype INIT (0);
226
227 /* pointers to image parameters for use in imagetext */
228 EXTERN M_WCHAR *indentp;
229 EXTERN M_WCHAR *imagegentityp;
230 EXTERN M_WCHAR *imagegpositionp;
231 EXTERN M_WCHAR *imageghyperlinkp;
232 EXTERN M_WCHAR *imageglinktypep;
233 EXTERN M_WCHAR *imagegdescription;
234
235 /* stuff used to build a list of SDL <block> element so we can restart
236  * a block with the previous "class" and "ssi" attributes so
237  * formatting will be correct.
238 */
239 typedef struct _block  BLOCK;
240 typedef BLOCK         *PBLOCK;
241 struct _block {
242     char   *pclass;
243     char   *pssi;
244     PBLOCK  pprev;
245 } block, *pblock;
246 PBLOCK blockinfo INIT(NULL);
247
248 LOGICAL inParText INIT(FALSE);
249 LOGICAL inSdlP    INIT(FALSE);
250
251 /* Save these ids and reuse them on the current virpage.
252  * We need two of each (except for the first) so we can alternate to
253  * avoid <form> thinking it is supposed to span them.  The bullet id
254  * indexes will flip back and forth between 0 and 1 to pick an id.
255 */
256 int bulletId[2], looseBulletId[2], firstBulletId, firstLooseBulletId;
257 int bulletIdIndex INIT(1);
258 int looseBulletIdIndex INIT(1);
259
260 /* indent for p, image, ex, vex, based on plain list */
261 #define LISTFIRSTINDENT 2
262 #define LISTITEMINDENT  2
263 #define LEFTINDENT (LISTFIRSTINDENT + LISTITEMINDENT)
264 /* save the textsize to emit it on the <p> tag; this allows us to have
265  * a single ssi= for the "ex" <block> and modify the text size individually 
266  * in the "ex" <p>
267 */
268 EXTERN int exTextSize;
269
270 #define ORDEREDLISTFIRSTINDENT 1
271 #define ORDEREDLISTITEMINDENT  3
272 #define ORDEREDLEFTINDENT (ORDEREDLISTFIRSTINDENT + ORDEREDLISTITEMINDENT)
273
274 /* File offset after preamble, and before \bye.  Used to determine 
275    whether content found in the document */
276 EXTERN long postpreamble INIT(0L) ;
277 EXTERN long prebye INIT(0L) ;
278 EXTERN LOGICAL filefound INIT(FALSE) ;
279
280 /* Chapter or appendix number */
281 EXTERN int part INIT(0) ;
282 EXTERN int chapter INIT(0) ;
283 EXTERN int chapinc INIT(0) ;
284 EXTERN char chapstring[15] INIT("0") ;
285
286 #define NODEID_LENGTH 204
287 /* name of current node */
288 EXTERN M_WCHAR nodeid[NODEID_LENGTH+1];  
289 /* Node level variables */
290 EXTERN int thisnodelevel INIT(0);
291 /* Offset of node from beginning of file */
292 EXTERN long int nodeoffset INIT(0);
293 EXTERN M_WCHAR *savehelpfilename INIT(NULL);
294 /* flag for omitting first newline in topic map file */
295 EXTERN LOGICAL nohometopic INIT(TRUE);
296 EXTERN int     parTextId   INIT(0);
297 EXTERN long     topicoffset INIT(0L);
298 EXTERN int      htfileno INIT(1);
299 /* The first tag in the front section should trigger the node */
300 EXTERN LOGICAL have_a_frontnode INIT(FALSE);
301 EXTERN char *helpbase INIT(NULL);
302 EXTERN char *helpext;
303 /* small buffer for scratch work */
304 EXTERN char helptmpbuf[2] INIT("0");
305
306 /* Should we use these BASENAME_LIMIT on the size of file names? */
307 LOGICAL usingshortnames INIT(FALSE);
308 /* Limit on how long the basename can be for a .ht file */
309 #define BASENAME_LIMIT 6
310 /* limit on how many additional character are allowed before the ext */
311 /* (How many chapter numbers    foo``12''.ht */
312 #define PRE_EXTENSION_LIMIT 2
313
314 EXTERN FILE *snbfp;
315 EXTERN FILE *indexfp;
316
317 /* Whether have processed anything in chapter or appendix */
318 EXTERN LOGICAL chapst INIT(FALSE) ; 
319
320 /* TRUE for chapter, FALSE for appendix */
321 EXTERN LOGICAL inchapter INIT(TRUE) ;
322
323 /* Figure number within this chapter or appendix */
324 EXTERN int figno ;
325
326 /* Options on a particular figure */
327 EXTERN int ftype, fborder, ftonumber, fvideo, fstrip, fsnap, fautoscale,
328            fmaxlistrows ;
329
330 /* Place to hold <snb> entries until after a <virpage><head>, if any,
331  * is seen.  Also, an integer value of the offset into the file to the
332  * point immediately after either <virpage> or <virpage><head> - the
333  * place to put the <snb>.
334 */
335 EXTERN char *savesnb  INIT(NULL);
336 EXTERN int   snbstart INIT(0);
337
338 /* Table number within this chapter or appendix */
339 EXTERN int tableno ;
340
341 /* footnote number */
342 EXTERN int footnoteno INIT(0);
343
344 EXTERN FILE *outfile ;
345
346 /* True if a figure or table has a caption */
347 EXTERN LOGICAL figcaption ;
348 EXTERN LOGICAL tabcaption ;
349 EXTERN char   *capposition; /* left/center/right position of the caption */
350
351 EXTERN LOGICAL had_an_otherfront_head INIT(FALSE);
352
353 /* contains current m_textchar, used to see if we need to issue an italic
354    correction.  Issue italic correction everywhere except after commas
355    and periods.  */
356 EXTERN M_WCHAR cur_char INIT(' ') ;
357
358 /* Special characters */
359 #define O_BR  '{'
360 #define C_BR  '}'
361 #define ESCAPE 27
362
363 /* Error Message section */
364 EXTERN LOGICAL emsghead INIT(FALSE) ;
365 /* emsghead has three possible values:
366      DEFHEAD  : use default error message title
367      USERHEAD : user specified
368      FALSE    : do not process head (assume define is not equal to
369                                DEFHEAD or USERHEAD)
370 */
371 #define DEFHEAD  2
372 #define USERHEAD 3
373
374 /* declarations for the <form> stack */
375 typedef struct forminfo FORMINFO;
376 struct forminfo {
377   char *rowVec;
378   int   vecLen;
379   };
380 EXTERN FORMINFO *formStackBase INIT(NULL);
381 EXTERN FORMINFO *formStackTop  INIT(NULL);
382 EXTERN FORMINFO *formStackMax  INIT(NULL);
383
384 /* flag that we have output an SDL <block> for <partext> */
385 EXTERN LOGICAL inBlock INIT(FALSE);
386
387 /* flag that we need to output an <fdata> for a <form> */
388 EXTERN LOGICAL needFData INIT(FALSE);
389
390 /* Figure stuff */
391 #define FIGDEFWH "3in"
392 #define MAXNORMROWS 55
393 #define MAXSMALROWS 75
394 #define MAXTINYROWS 100
395 #define MAXPENS 8  /* when changing, check prfigpenwidths() ! */
396 #define MAXPENWIDTH 1864680    /* approx 1cm in scaled points */
397
398 EXTERN LOGICAL fignote ;
399 EXTERN int fignotePtr, in_graphic, nlines, blank_middle ;
400 EXTERN unsigned long ncolumns, max_columns, res_index, xx, ri ;
401 EXTERN LOGICAL file_ent ;
402 EXTERN M_WCHAR *f_content ;
403 EXTERN M_WCHAR f_contqual[FNAMELEN] ;
404 EXTERN M_WCHAR *f_file ;
405
406 /* callouts -- entfile and lineno */
407 EXTERN M_WCHAR *figinpath ;
408 EXTERN int figline INIT(0) ;
409
410 /* -- callouts -- */
411 #define BYTE       unsigned char
412 #define NEWPT      0
413 #define NEWGROUP   1
414 #define NEWLINE    2
415 #define NEWCALLOUT 3
416
417 typedef struct tagFPOINT {
418 float   x,y;
419 } FPOINT ;
420
421 typedef struct tagPwT {
422 FPOINT  coord;
423 char    ew[2],
424         ns[2],
425         lcr[2];
426 } PTWTXT ;
427
428 #define AN_desc         3
429 #define AN_nsew         60
430 #define AN_text         12
431 #define AN_isbros               16
432 #define AN_hasbros      32
433 #define AN_sf1                  64
434 #define AN_sf2                  128
435 #define SH_desc         0
436 #define SH_nsew         2
437 #define SH_text         2
438 #define SH_isbros               4
439 #define SH_hasbros      5
440 #define SH_sf1                  6
441 #define SH_sf2                  7
442
443 #define UNPK(c,an,sh)   ((c&an)>>sh)
444
445 EXTERN FILE *calfile ;
446 EXTERN int maxct;
447 EXTERN LOGICAL okcallout ;
448 /* -- end callout -- */
449
450 EXTERN FILE *pclfile ;
451
452 #define VERSION "Version"
453 EXTERN char *version INIT(NULL) ;
454
455 EXTERN char texdone[] INIT("TeX run completed successfully.") ;
456
457 /* Code for standard library function "access" */
458 #define READABLE 04
459
460 /* Allowable units on dimensions */
461 #define SPperPT 65536.0
462 #define PTperIN 72.27
463 #define CMperIN 2.54
464 #define MMperIN 25.4
465 #define PTperPC 12.0
466 EXTERN char *dimarray[5] 
467 #if defined(DEFINE)
468  = {  "in",
469       "cm",
470       "mm",
471       "pc",
472       "pt" }
473 #endif
474  ;
475
476 /* misc */
477 EXTERN int newhline INIT(0) ;
478 EXTERN int synelcnt INIT(0);
479
480 /* Cross-Reference Declarations */
481 /* do we have foreward references? */
482 EXTERN LOGICAL have_forward_xrefs INIT(FALSE);
483 EXTERN M_WCHAR *xrffile ;    /* Save file and line number for error messages */
484 EXTERN int xrfline INIT(0) ;  /* --used to store into structure "xref"   */
485 EXTERN M_TRIE xtree ;
486 struct xref {
487     M_WCHAR *textptr ;       /* Pointer to expansion of xref */
488     LOGICAL defined ;     /* Whether the xref has been defined */
489     LOGICAL wheredef ;    /* Whether defined in this pass or a previous one */
490     LOGICAL retrieved ;   /* Whether the value has been used */
491     LOGICAL csensitive ;  /* Whether the value is chapter sensitive */
492     LOGICAL xrefable;     /* can this be xref'd to legally? */
493     char *chapstring ;    /* Number of chapter or appendix where it occurs */
494     LOGICAL inchapter ;   /* Whether in chapter or appendix */
495     M_WCHAR *file ;      /* File and line # where first referred to or  */
496     int line ;            /*   first defined for error reports   */
497     } ;
498   /* Value of one particular cross-reference */
499 EXTERN M_WCHAR xrefstring[400] ;
500 EXTERN int xstrlen INIT(0) ;
501   /* Pointer to the id */
502 EXTERN M_WCHAR *savid ;
503 EXTERN LOGICAL  iderr ;
504 EXTERN char *imageId INIT(NULL); /* "image" id saved for "imagetext" */
505
506 /* Save head for page header in rsect and table of contents string*/
507 EXTERN M_WCHAR savehead[400] ;
508 EXTERN M_WCHAR savetabcap[400] ;
509 EXTERN int     svheadlen ;
510 EXTERN int     svtclen ;
511 EXTERN LOGICAL savhd ;
512 EXTERN LOGICAL savtc ;
513 EXTERN LOGICAL hderr ;
514 EXTERN LOGICAL echo ;
515 EXTERN LOGICAL tooutput INIT(TRUE) ;
516
517 /* Save example until we see an annotation (which will behave like a head */
518 EXTERN char    *saveex;
519 EXTERN int      svexlen;
520 EXTERN char    *saveexseg;
521 EXTERN int      svexseglen;
522 EXTERN LOGICAL  savex;
523 EXTERN LOGICAL  stackex;
524
525 /* Glossary Declarations */
526 EXTERN M_TRIE gtree ;
527 #define MAXTERM 200
528 EXTERN M_WCHAR term[MAXTERM + 1] ;
529 EXTERN M_WCHAR *termp ;
530 EXTERN LOGICAL wsterm ;
531 EXTERN int     lastTermId;
532
533 EXTERN LOGICAL  firstAnnot;
534 EXTERN int      exLineNum;
535 EXTERN LOGICAL  tonumexlines;
536 EXTERN int      oldExLineNum;
537
538 /* Saved document title */
539 EXTERN M_WCHAR *savedtitle;
540
541 /* tell whether .hmi should have generic info put into it */
542 EXTERN LOGICAL hadtitle INIT(FALSE);
543 EXTERN LOGICAL hadabstract INIT(FALSE);
544
545 /* emit an empty abstract title if no head specified */
546 EXTERN LOGICAL needabstracthead INIT(FALSE);
547      
548 /* Numeric codes corresponding to keyword parameter values */
549
550 #define FIXED 1
551 #define FLOAT 2
552
553 #define SIDE 1
554 #define STACK 2
555
556 #define COMPUTER 1
557 #define DISPLAY  2
558
559 /* Note that the definition of BOX was chosen so that the border
560 parameter on both figure and table could use it, even though these
561 parameters do not share all possible values */
562 #define BOX 1
563 #define TOP 2
564 #define BOTTOM 3
565 #define NOBORDER 4
566 #define SCREEN 5
567 #define NOBOX 2
568
569 #define ART 1
570 #define PCL 2
571 #define TIFF 3
572 #define LISTING 4
573 #define TEXT 5
574 #define HPGL 7
575
576 /* IMPORTANT: "FIG..." values should not be          */
577 /*             changed (eg. see proc "checkmargin")  */
578 #define FIGTOP    0
579 #define FIGRIGHT  1
580 #define FIGBOTTOM 2
581 #define FIGLEFT   3
582 #define NFIGSIDES 4
583
584 #define WRAP 1
585 #define NOWRAP 2
586
587 /* text size macros */
588 #define NORMAL 1
589 #define SMALLER 2
590 #define SMALLEST 3
591
592 #define NUMBER 1
593 #define NONUMBER 2
594
595 #define LEFT 1
596 #define INDENT 2
597 #define CENTER 3
598 #define RIGHT 4
599
600 #define TIGHT 1
601 #define LOOSE 2
602
603 #define NORULE 1
604 #define HEADRULE 2
605 #define GRID 3
606
607 #define ORDER 0
608 #define BULLET 1
609 #define PLAIN 2
610 #define MILSPEC 3
611 #define LABEL 4
612 #define CHECK 5
613
614 #define UROMAN 0
615 #define UALPHA 1
616 #define ARABIC 2
617 #define LALPHA 3
618 #define LROMAN 4
619
620 #define DOTPUNCT 0
621 #define PARENPUNCT 1
622
623 #define NEWPAGE 0
624 #define SAMEPAGE 1
625
626 #define GLOSS 1
627 #define NOGLOSS 2
628
629 #define INVERSE 1
630 #define NOINVERSE 2
631
632 #define STRIP 1
633 #define NOSTRIP 2
634
635 #define DPENWDVAL 1
636
637 #define SNAP 1
638 #define NOSNAP 2
639
640 #define AUTOSCALE 1
641 #define NOAUTOSCALE 2
642
643 /* the values for these elements are significant...they are used to set
644  * TeX register values which are later tested by  macros
645  */
646 #define COMMAND 1
647 #define KEYS2 2
648
649 /* the values for these elements are significant...they are used to set
650  * TeX register values which are later tested by  macros
651  */
652 #define TWO 2
653 #define FOUR 4
654 #define EIGHT 8
655 #define OTHER 0
656
657 /* values for ctable tracking */
658 EXTERN int ctbltype;
659 EXTERN int ctbldisplines;
660 EXTERN int ctblgraphics;
661
662 /* Declarations for lists */
663 #define MAXLISTLEV 8
664 /* FIRST  => first paragraph in list item.  The one following the label.
665    FOLLOW => immediately after a figure, note, caution, warning, ex or vex
666    INSIDE => at least one previous paragraph
667 */
668 enum ParagraphListLocation {FIRST, FOLLOW, INSIDE};
669 EXTERN LOGICAL firstPInBlock; /* give the first para a different ssi= */
670
671 EXTERN LOGICAL lablisttight[MAXLISTLEV];
672 EXTERN int labhid[MAXLISTLEV];
673 EXTERN int labhtextid[MAXLISTLEV];
674 EXTERN int labelid[MAXLISTLEV];
675 EXTERN int labeltextid[MAXLISTLEV];
676 EXTERN int list INIT(0) ;
677 typedef struct contchain CONTCHAIN ;
678 struct contchain {
679   long where ;
680   CONTCHAIN *next ;
681   } ;
682 typedef struct list LIST ;
683 struct list {
684   int type ;
685   int order ;
686   int count ;
687   int space ;
688   unsigned char punct ;
689   unsigned char started ;
690   unsigned char where ; 
691   LIST *lastlist ;
692   CONTCHAIN *chain ; 
693   } ;
694 EXTERN LIST outlist 
695 #if defined(DEFINE)
696   = {0, 0, 0, 0, DOTPUNCT, FALSE, FIRST, NULL, NULL}
697 #endif
698   ;
699 EXTERN LIST *lastlist INIT(&outlist) ;
700 EXTERN int bulcount INIT(0) ;
701
702 typedef struct rowvec ROWVEC;
703 struct rowvec {
704   unsigned char firstitem;
705   unsigned char longlabel;
706   };
707 EXTERN ROWVEC listitems[MAXLISTLEV+1];
708
709 /* save area for index processing */
710 EXTERN M_WCHAR idxsav[400] ;
711 /* Sort form of an index term */
712 EXTERN M_WCHAR sort[400] ;
713 /* Sort form of an index sub term */
714 EXTERN M_WCHAR subsort[400] ;
715 /* print form of index term */
716 EXTERN M_WCHAR print[400] ;
717 /* print form of index sub term */
718 EXTERN M_WCHAR subprint[400] ;
719 EXTERN int idxsavlen ;
720 EXTERN LOGICAL didsort ;
721 EXTERN LOGICAL didsubsort ;
722
723 /* Strings for constructing error messages */
724 EXTERN char firstused[] INIT("'%s' first used in line %d") ;
725 EXTERN char undef[] INIT("Undefined cross-reference %s (") ;
726 EXTERN char infile[] INIT("file %s, ") ;
727 EXTERN char online[] INIT("line %d)\n") ;
728 EXTERN char offile[] INIT(" of file: %s") ;
729 /* Whitemenu supported only in calculator, issue message only once */
730 EXTERN LOGICAL wmenu_err INIT(FALSE) ;
731
732 /* For index entries */
733 #define IDXSTRT1 {}
734 #define IDXSTRT2 {}
735 #define IDXSTRT IDXSTRT1 IDXSTRT2
736
737 #define IDXEND1 {}
738 #define IDXEND2 {}
739 #define IDXEND3 {}
740 #define IDXEND IDXEND1 IDXEND2 IDXEND3
741
742 /* Absorb consecutive <CR>'s, because TeX gets confused by them */
743 EXTERN LOGICAL multi_cr_flag INIT(FALSE);
744
745 /* Direct debugging trace output to stdout or outfile */
746 EXTERN LOGICAL tracetostd INIT(FALSE) ;
747
748 /* Function prototypes */
749 #include "fproto.h"
750
751 /* Declarations for handling special characters */
752 #include "roman8.h"
753
754 /* Declarations for handling special characters for calculators*/
755 EXTERN char ccoutbuf[128] ;
756
757 /* Character conversion tables */
758 #include "charconv.h"