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