Remove Unixware and openserver support
[oweals/cde.git] / cde / programs / dthelp / parser / pass1 / helptag / help.if
1 /*   Copyright (c) 1986, 1987, 1988, 1989, 1990 Hewlett-Packard Co. */
2 /* Interface definition for HP Tag/TeX translator */
3
4 /* Things to watch out for:
5
6    1.  Index processing.  Notice for a number of tags (<BOOK> for example),
7        there is specific code when the tag is in <IDX>:
8          <START-CODE * IDX>, etc.
9        Many tags don't have empty <* IDX> string-code processing, to save
10        on executable size.  Therefore, when you add string-code processing
11        to a tag, make sure you add empty string-code for <* IDX>.
12    2.  Index processing for <COMPUTER>, <CURSOR>, <USER>.  They all have
13        hardcoded default values for their parameters to save on program
14        size (otherwise we have to uncomment parameter code).  This is not
15        a problem since parameters is unimplemented.  Need to watch out for
16        this when we do implement.
17 */
18
19 <!ENTITY MINUS SDATA "-">
20 <!ENTITY PM SDATA '[plusmn]'>               /* ISOnum  */
21 <!ENTITY DIV SDATA '[divide]'>              /* ISOnum  */
22 <!ENTITY TIMES SDATA '[times ]'>            /* ISOnum  */
23 <!ENTITY LEQ SDATA '[le    ]'>              /* ISOtech */
24 <!ENTITY GEQ SDATA '[ge    ]'>              /* ISOtech */
25 <!ENTITY NEQ SDATA '[ne    ]'>              /* ISOtech */
26 <!ENTITY COPY SDATA '[copy  ]'>             /* ISOnum  */
27 <!ENTITY REG SDATA '[reg   ]'>              /* ISOnum  */
28 <!ENTITY TM SDATA '[trade ]'>               /* ISOnum  */
29 <!ENTITY ELLIPSIS SDATA '[hellip]'>         /* ISOpub  */
30 <!ENTITY VELLIPSIS SDATA '[vellip]'>        /* ISOpub  */
31 <!ENTITY PELLIPSIS SDATA "....">  /* ellipsis followed by a period? */
32 <!ENTITY A.M. SDATA "a.m.">
33 <!ENTITY P.M. SDATA "p.m.">
34 <!ENTITY MINUTES SDATA '[prime ]'>          /* ISOtech */
35 <!ENTITY SECONDS SDATA '[Prime ]'>          /* ISOtech */
36 <!ENTITY DEG SDATA '[deg   ]'>              /* ISOnum  */
37 <!ENTITY SQUOTE SDATA "`">
38 <!ENTITY DQUOTE SDATA '"'>
39 <!ENTITY ENDASH SDATA "-">
40 <!ENTITY EMDASH SDATA '[mdash ]'>           /* ISOpub  */
41 <!ENTITY VBLANK SDATA "_">
42 <!ENTITY CENTS SDATA '[cent  ]'>            /* ISOnum  */
43 <!ENTITY STERLING SDATA '[pound ]'>         /* ISOnum  */
44 <!ENTITY M-D- PI "">
45 <!ENTITY SPACE SDATA " ">
46 <!ENTITY SIGSPACE SDATA "& ">
47 <!ENTITY SIGDASH SDATA "&-">
48 <!ENTITY MICRO SDATA '[micro ]'>            /* ISOnum  */
49 <!ENTITY OHM SDATA '[ohm   ]'>              /* ISOnum  */
50 <!ENTITY UP SDATA '[uarr  ]'>               /* ISOnum  */
51 <!ENTITY DOWN SDATA '[darr  ]'>             /* ISOnum  */
52 <!ENTITY LEFT SDATA '[larr  ]'>             /* ISOnum  */
53 <!ENTITY RIGHT SDATA '[rarr  ]'>            /* ISOnum  */
54 <!ENTITY HOME SDATA "home key">
55 <!ENTITY BACK SDATA "\<--">
56 <!ENTITY DATE SDATA CODE>
57      time_t nseconds;
58      struct tm *timefoo;
59      int maxsize = 20;
60      char s[20];
61
62      nseconds = time(NULL);
63      timefoo = localtime(&nseconds);
64      strftime(s, maxsize, "%x", timefoo);
65      fprintf(outfile, "%s\n", s);
66 <\CODE>
67 <!ENTITY TIME SDATA CODE>
68      time_t nseconds;
69      struct tm *timefoo;
70      int maxsize = 20;
71      char s[20];
72
73      nseconds = time(NULL);
74      timefoo = localtime(&nseconds);
75      strftime(s, maxsize, "%X", timefoo);
76      fprintf(outfile, "%s\n", s);
77 <\CODE>
78 <!ENTITY HALFSPACE SDATA " ">
79 <!ENTITY M-SPECCHAR SDATA "Special characters">
80
81 /* Code entities for toggling debugging traces */
82 <!ENTITY m-aopt PI CODE>
83   m_malftrace = (LOGICAL) ! m_malftrace ;
84   <\CODE>
85
86 <!ENTITY m-copt PI CODE>
87   m_chtrace = (LOGICAL) ! m_chtrace ;
88   <\CODE>
89
90 <!ENTITY m-dopt PI CODE>
91   m_cdtrace = (LOGICAL) ! m_cdtrace ;
92   <\CODE>
93
94 <!ENTITY m-hopt PI CODE>
95   m_heapchk = (LOGICAL) ! m_heapchk ;
96   <\CODE>
97
98 <!ENTITY m-oopt PI CODE>
99   tracetostd = (LOGICAL) ! tracetostd ;
100   <\CODE>
101
102 <!ENTITY m-sopt PI CODE>
103   m_scantrace = (LOGICAL) ! m_scantrace ;
104   <\CODE>
105
106 <!ENTITY m-topt PI CODE>
107   m_tagtrace = (LOGICAL) ! m_tagtrace ;
108   <\CODE>
109
110 /* Code entities for MARKUP and HP Tag versions */
111 <!ENTITY m-markup-ver SDATA CODE>
112   {
113   M_WCHAR *wc_1, *wc_2;
114
115   wc_1 = MakeWideCharString(M_VERSION);
116   wc_2 = MakeWideCharString("m-markup-ver");
117   m_piaction(wc_1, wc_2, M_SDATA) ;
118   m_free(wc_1,"wide character string");
119   m_free(wc_2,"wide character string");
120   }
121   <\CODE>
122
123 <!ENTITY m-tagver SDATA CODE>
124   {
125   M_WCHAR *wc_1, *wc_2;
126
127   wc_1 = MakeWideCharString(version);
128   wc_2 = MakeWideCharString("m-tagver");
129   m_piaction(wc_1, wc_2, M_SDATA) ;
130   m_free(wc_1,"wide character string");
131   m_free(wc_2,"wide character string");
132   }
133   <\CODE>
134
135 <!ENTITY m-machine SDATA CODE>
136 #if defined(MSDOS)
137   m_piaction("VECTRA", "m-machine", M_SDATA) ;
138 #else
139 #if defined(hpux)
140   {
141   M_WCHAR *wc_1, *wc_2;
142
143   wc_1 = MakeWideCharString("HPUX");
144   wc_2 = MakeWideCharString("m-machine");
145   m_piaction(wc_1, wc_2, M_SDATA) ;
146   m_free(wc_1,"wide character string");
147   m_free(wc_2,"wide character string");
148   }
149 #else
150 #if defined(_AIX)
151   {
152   M_WCHAR *wc_1, *wc_2;
153
154   wc_1 = MakeWideCharString("AIX");
155   wc_2 = MakeWideCharString("m-machine");
156   m_piaction(wc_1, wc_2, M_SDATA) ;
157   m_free(wc_1,"wide character string");
158   m_free(wc_2,"wide character string");
159   }
160 #else
161 #if defined(sun)
162   {
163   M_WCHAR *wc_1, *wc_2;
164
165   wc_1 = MakeWideCharString("SUN");
166   wc_2 = MakeWideCharString("m-machine");
167   m_piaction(wc_1, wc_2, M_SDATA) ;
168   m_free(wc_1,"wide character string");
169   m_free(wc_2,"wide character string");
170   }
171 #else
172 #if defined(__osf__)
173   {
174   M_WCHAR *wc_1, *wc_2;
175
176   wc_1 = MakeWideCharString("OSF1");
177   wc_2 = MakeWideCharString("m-machine");
178   m_piaction(wc_1, wc_2, M_SDATA) ;
179   m_free(wc_1,"wide character string");
180   m_free(wc_2,"wide character string");
181   }
182 #else
183   m_piaction("UNDEFINED MACHINE",
184              "m-machine",
185              M_SDATA) ;
186 #endif
187 #endif
188 #endif
189 #endif
190 #endif
191   <\CODE>
192
193 <SIGN-ON>CDE HelpTag Formatting System. - Version B.00.00  (DTD Version A.01.23)
194 <GLOBAL-DEFINE>
195 #define DEFINE
196 #include "global.h"
197 #include "htag.tss"
198 static char ident1[]="@(#)CDE Help Tag Parser";
199 static char ident2[]="@(#)Version Number: B.00.00";
200 static char ident3[]="@(#) (c) Copyright 1993, 1994 Hewlett-Packard Company";
201 static char ident4[]="@(#) (c) Copyright 1993, 1994 International Business Machines Corp.";
202 static char ident5[]="@(#) (c) Copyright 1993, 1994 Sun Microsystems, Inc.";
203 static char ident6[]="@(#) (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.";
204
205
206 <GLOBAL-DECLARE>
207 #include "global.h"
208 #include "htag.tss"
209
210 <START-CODE>
211   SEARCH *new ;
212   char *p ;
213   char *q ;
214
215   /* Pick version number out of sign-on message */
216   if (p = strstr(m_signon, VERSION)) {
217     p += strlen(VERSION) + 1 ;
218     for (q = p ; *q && *q != '\n'; q++) ;
219     if (*q == '\n') {
220       version = (char *) m_malloc(q - p + 1, "version") ;
221       *q = M_EOS ;
222       strcpy(version, p) ;
223       *q = '\n' ;
224       }
225     }
226
227   fbasename();
228
229   options(FALSE) ;
230   if (m_errexit && stoponerror) m_exit(m_errexit) ;
231
232   if (indir) {
233     new = (SEARCH *) m_malloc(sizeof(SEARCH), "search path") ;
234     new->directory = indir ;
235     new->next = path ;
236     path = new ;
237     }
238
239 <END-CODE>
240   int i;
241   prebye = ftell(outfile) ;
242   dumpxref() ;
243   if (glossary) checkgloss() ;
244
245   /* warn if we have forward xrefs */
246   if (have_forward_xrefs) {
247        m_exit(77);
248   }
249
250 <TEXT-CODE>
251     outchar(m_textchar, outfile) ;
252
253 <PI-CODE>
254    outpi(m_enttype, m_pi, m_entname) ;
255
256
257 <ELEMENT ABBREV>
258   <PARAM>
259     where = WHERE (QTOC = TOC,
260                    QFOOTER = FOOTER,
261                    QBOTH = BOTH) ;
262   <START-CODE CHAPHEAD RSUB>
263     fputs(" ABBREV=\"", outfile);
264   <START-CODE CHAPHEAD RSECT>
265     fabbrev = (LOGICAL)
266               (! m_wcmbupstrcmp(where, QFOOTER) ||
267                ! m_wcmbupstrcmp(where, QBOTH)) ;
268     if (fabbrev) {
269       newhline = 0 ;
270       }
271     fputs(" ABBREV=\"", outfile);
272   <START-CODE CHAPHEAD MSGSUB, CHAPHEAD PROCEDURE>
273     fputs(" ABBREV=\"", outfile);
274   <START-CODE CAPTION>
275     savhd = FALSE;
276     tooutput = TRUE;
277     fputs(" ABBREV=\"", outfile);
278   <START-CODE CHAPHEAD CHAPTER, CHAPHEAD MESSAGE,
279               CHAPHEAD TEST, CHAPHEAD S1, CHAPHEAD S2, CHAPHEAD S3,
280               CHAPHEAD S4, CHAPHEAD S5, CHAPHEAD S6, CHAPHEAD S7,
281               CHAPHEAD S8, CHAPHEAD S9, CHAPHEAD HOMETOPIC>
282     fabbrev = (LOGICAL)
283               (! m_wcmbupstrcmp(where, QFOOTER) ||
284                ! m_wcmbupstrcmp(where, QBOTH)) ;
285     if (fabbrev) {
286       newhline = 0 ;
287      }
288     fputs(" ABBREV=\"", outfile);
289   <START-CODE>
290     M_WCHAR *wc_stago, *wc_tagc;
291
292     wc_stago = MakeWideCharString(m_stago);
293     wc_tagc  = MakeWideCharString(m_tagc);
294     
295     fabbrev = (LOGICAL)
296               (! m_wcmbupstrcmp(where, QFOOTER) ||
297                ! m_wcmbupstrcmp(where, QBOTH)) ;
298     if (fabbrev) {
299       newhline = 0 ;
300     }
301     m_err2("Unimplemented %sABBREV%s reached", wc_stago, wc_tagc);
302     m_free(wc_stago,"wide character string");
303     m_free(wc_tagc,"wide character string");
304   <END-CODE>
305     fabbrev = FALSE ;
306     fputs("\"", outfile);
307
308
309 <ELEMENT ABSTRACT>
310   <START-CODE>
311     static char abstract[] = "-ABSTRACT";
312     char id[SDLNAMESIZ+sizeof(abstract)];
313
314     hadabstract = TRUE;
315     needabstracthead = TRUE;
316     sprintf(id, "%s%s", sdlReservedName, abstract);
317     mb_starthelpnode("_ABSTRACT", id, 0);
318   <END-CODE>
319     CloseVirpage();
320   <TEXT-CODE>
321      outchar(m_textchar, outfile);
322
323 <ELEMENT ACRO>
324   <START-CODE>
325     mb_strcode("<KEY CLASS=\"ACRO\">", outfile) ;
326     if (echo) {
327       mb_echohead(m_stago);
328       echohead(m_parent(0)) ;
329       mb_echohead(m_net);
330       }
331   <END-CODE>
332     mb_strcode("</KEY>", outfile) ;
333     if (echo) mb_echohead(m_net) ;
334
335   <START-CODE * IDX>
336   <END-CODE * IDX>
337   <END-CODE * EXAMPLESEG, * IMAGE>
338     POPFONT ;
339   <TEXT-CODE * IDX>
340     indexchar(m_textchar) ;
341   <TEXT-CODE>
342     outchar(wc_toupper(m_textchar), outfile) ;
343
344 <ELEMENT ANNOTATION>
345   <START-CODE>
346     if (!firstAnnot)
347         {
348         exLineNum++;
349         }
350     firstAnnot = FALSE;
351
352     savhd    = TRUE;
353     hderr    = FALSE;
354     tooutput = FALSE;
355     mb_strcode("<HEAD CLASS=\"ANNOTATION\" TYPE=\"DYNAMIC\" SSI=\"ANNOT-",
356                outfile);
357     mb_strcode(stackex ? "STACK\">" : "SIDE\">", outfile);
358   <END-CODE>
359     mb_strcode("</HEAD>", outfile);
360     savehead[svheadlen] = '\0';
361     savhd    = FALSE;
362     tooutput = TRUE;
363
364 <ELEMENT BOOK>
365   <START-CODE>
366     mb_strcode("<KEY CLASS=\"BOOK\">", outfile) ;
367     if (echo) {
368       mb_echohead(m_stago) ;
369       echohead(m_parent(0)) ;
370       mb_echohead(m_net) ;
371       }
372   <END-CODE>
373     mb_strcode("</KEY>", outfile) ;
374     if (echo) mb_echohead(m_net) ;
375
376   <START-CODE * IDX>
377   <END-CODE * IDX>
378   <TEXT-CODE * IDX>
379     indexchar(m_textchar) ;
380
381 <ELEMENT CAPTION>
382   <START-CODE FIGURE>
383     figcaption = TRUE ;
384     newhline = 0 ;
385     savhd = TRUE ;
386     hderr = FALSE ;
387     svheadlen = 0 ;
388     tooutput = FALSE;
389     if (ftonumber)
390         fputs("<SUBHEAD TYPE=\"LINED\" SSI=\"CAPTION-NUMBERED\"", outfile);
391     else
392         fprintf(outfile,
393                 "<HEAD TYPE=\"LINED\" CLASS=\"CAPTION\" SSI=\"CAPTION%s\"",
394                 capposition);
395   <END-CODE FIGURE>
396     char *mb_savehead;
397
398     savehead[svheadlen] = M_EOS ;
399     savhd = FALSE ;
400     tooutput = TRUE;
401     mb_strcode(">", outfile);
402     strcode(savehead, outfile);
403     if (ftonumber)
404         fputs("</SUBHEAD>", outfile);
405     ftonumber = 0;
406
407 <ELEMENT CAUTION>
408   <START-CODE>
409     StartNCW("CAUTION");
410
411 <ELEMENT CDISPLAY>
412   <PARAM>
413         file = ENTITY ;    
414         startrow = STARTROW  ;
415         endrow = ENDROW  ;
416         clip = CLIP ;
417         margin = MARGIN ;
418
419 <ELEMENT CHAPHEAD>
420   <START-CODE MESSAGE>
421     emsghead = USERHEAD ;
422 /* Node headings */
423   <END-CODE CHAPTER, RSECT,  S1, S2, S3, S4, S5, S6, S7,
424             S8, S9, TEST, HOMETOPIC, MESSAGE>
425     endhead() ;
426     mb_strcode(">", outfile);
427     strcode(savehead, outfile);
428     chksnb();
429 /* Non node headings */
430   <END-CODE RSUB, MSGSUB, PROCEDURE>
431     endhead() ;
432     mb_strcode(">", outfile);
433     strcode(savehead, outfile);
434     fputs("</HEAD>\n", outfile);
435 /* Non node headings */
436   <END-CODE OTHERHEAD>
437     endhead() ;
438     fputs("</HEAD>\n", outfile);
439
440 <ELEMENT CHAPTER>
441   <PARAM>
442     id = ID ;
443     number = NUMBER ;
444     include = INCLUDE  ;
445     exclude = EXCLUDE  ;
446   <START-CODE>
447     M_WCHAR *wc_chapter;
448
449     wc_chapter = MakeWideCharString("CHAPTER");
450
451     assert_hometopic_exists();
452     chapstart(id) ;
453     thisnodelevel = 2;
454     starthelpnode(wc_chapter, id, thisnodelevel);
455     m_free(wc_chapter, "wide character string");
456   <END-CODE>
457     CloseVirpage();
458     rseqend() ;
459     thisnodelevel = 0;
460
461 <ELEMENT CIRCLE>
462   <TEXT-CODE>
463     if (echo) mb_echohead("((") ;
464     mb_strcode("(", outfile) ;
465     outchar (m_textchar, outfile) ;
466     mb_strcode(")", outfile) ;
467     if (echo) mb_echohead("))") ;
468   <START-CODE * IDX>
469   <END-CODE * IDX>
470   <TEXT-CODE * IDX>
471     indexchar('(');
472     indexchar(m_textchar) ;
473     indexchar(')');
474
475 <ELEMENT COMPUTER>
476   <START-CODE>
477     mb_strcode("<KEY CLASS=\"MACH-OUT\">", outfile) ;
478     if (echo) mb_echohead("``") ;
479   <END-CODE>
480     POPFONT ;
481     mb_strcode("</KEY>", outfile) ;
482     if (echo) mb_echohead("''") ;
483   <TEXT-CODE>
484      esoutchar(m_textchar) ;
485   <TEXT-CODE * IMAGE>
486      exoutchar(m_textchar) ;
487   <TEXT-CODE * EXAMPLESEG>
488      exoutchar(m_textchar) ;
489
490   <START-CODE * IDX>
491   <END-CODE * IDX>
492   <TEXT-CODE * IDX>
493     indexchar(m_textchar) ;
494
495 <ELEMENT COPYRIGHT>
496   <START-CODE>
497     static char copyright[] = "-COPYRIGHT";
498     char id[SDLNAMESIZ+sizeof(copyright)];
499
500     sprintf(id, "%s%s", sdlReservedName, copyright);
501     mb_starthelpnode("_COPYRIGHT", id, 0);
502     /* No Head.  Let author have a clean slate. */
503   <END-CODE>
504     CloseVirpage();
505
506 <ELEMENT CURSOR>
507   <START-CODE>
508     if (echo) {
509       mb_echohead(m_stago) ;
510       echohead(m_parent(0)) ;
511       mb_echohead(m_net) ;
512       }
513   <END-CODE>
514     if (echo) mb_echohead(m_net) ;
515   <TEXT-CODE>
516     esoutchar(m_textchar) ;
517   <TEXT-CODE * EXAMPLESEG>
518     exoutchar(m_textchar) ;
519
520   <START-CODE * IDX>
521   <END-CODE * IDX>
522   <TEXT-CODE * IDX>
523     indexchar(m_textchar) ;
524
525 <ELEMENT DEFINITION>
526
527 <ELEMENT DESCRIP>
528
529 <ELEMENT DTERM>
530   <START-CODE>
531     termp = term;
532     tooutput = FALSE;
533   <END-CODE>
534     tooutput = TRUE;
535     *termp = M_EOS ;
536     /* trim possible (perhaps) last space */
537     if (termp - term > 1 && *(termp-1) == ' ') {
538          *(termp-1) = M_EOS;
539     }
540     if (!(lastTermId = (int) m_lookfortrie(term, &gtree)))
541         {
542         lastTermId = NextId();
543         m_ntrtrie(term, &gtree, (void *) -lastTermId);
544         }
545     else
546         if (lastTermId > 0)
547             {
548             if (!m_resettrie(&gtree, term, (void *) -lastTermId))
549                 {
550                 m_error("Internal error. Can't reset glossary trie") ;
551                 m_exit(TRUE) ;
552                 }
553             }
554         else
555             lastTermId = -lastTermId;
556
557   <TEXT-CODE>
558     termchar(m_textchar) ;
559   <PI-CODE>
560     termpi(m_enttype, m_pi, m_entname) ;
561
562 <ELEMENT EMPH>
563   <START-CODE>
564     mb_strcode("<KEY CLASS=\"EMPH\">", outfile) ;
565     if (echo) mb_echohead("!!") ;
566   <END-CODE>
567     mb_strcode("</KEY>", outfile) ;
568     if (echo) mb_echohead("!!") ;
569
570   <START-CODE * IDX>
571   <END-CODE * IDX>
572   <TEXT-CODE * IDX>
573     indexchar(m_textchar) ;
574
575 <ELEMENT ESC>
576   <START-CODE * IDX>
577   <END-CODE * IDX>
578   <TEXT-CODE * IDX>
579     indexchar(m_textchar) ;
580   <TEXT-CODE>
581     static M_WCHAR ch[2];
582
583     ch[0] = m_textchar;
584     strcode(ch, outfile);
585   <START-CODE>
586     if (echo) {
587       mb_echohead(m_stago) ;
588       echohead(m_parent(0)) ;
589       mb_echohead(m_net) ;
590       }
591   <END-CODE>
592     if (echo) mb_echohead(m_net) ;
593
594 <ELEMENT EX>
595   <PARAM>
596     type = TYPE (QCOMPUTER = COMPUTER,
597                  QDISPLAY  = DISPLAY) ;
598     position = POSITION (QLEFT = LEFT,
599                          QINDENT = INDENT,
600                          QCENTER = CENTER) ;
601     notes = NOTES (QSIDE = SIDE,
602                    QSTACK = STACK) ;
603     width = WIDTH ;
604     lines = LINES (QNUMBER = NUMBER,
605                    QNONUMBER = NONUMBER) ;
606     textsize = TEXTSIZE (QNORMAL = NORMAL,
607                          QSMALLER = SMALLER,
608                          QSMALLEST = SMALLEST) ;
609   <START-CODE>
610     StartEx(notes, lines, textsize);
611   <END-CODE>
612     EndEx();
613     tonumexlines = FALSE;
614     fputs(saveex, outfile);
615     fputs("</BLOCK>\n", outfile);
616     inBlock = FALSE;
617   <TEXT-CODE>
618     outchar(m_textchar, outfile) ;
619
620 <ELEMENT EXAMPLESEG>
621   <START-CODE>
622     if (exLineNum > 1)
623         EndEx();
624     inSdlP     = TRUE;
625     savex      = TRUE;
626     tooutput   = FALSE;
627     saveexseg  = mb_malloc(1);
628     svexseglen = 1;
629     svheadlen  = 0; /* we save any <annotation> text in "savehead" */
630   <END-CODE>
631     savex = FALSE;
632     tooutput = TRUE;
633   <TEXT-CODE>
634     exoutchar(m_textchar);
635
636 <ELEMENT EXPLAIN>
637   <START-CODE>
638     PushForm(NULL, "EXPLAIN", NULL);
639
640 <ELEMENT FIGURE>
641   <PARAM>
642     number = NUMBER ;
643     tonumber = TONUMBER (QNUMBER = NUMBER,
644                          QNONUMBER = NONUMBER) ;
645     id = ID ;
646     file = ENTITY ;
647     figpos = FIGPOS (QLEFT = LEFT,
648                      QCENTER = CENTER,
649                      QRIGHT = RIGHT) ;
650     cappos = CAPPOS (QLEFT = LEFT,
651                      QCENTER = CENTER,
652                      QRIGHT = RIGHT) ;
653     oldtype = OLDTYPE (QART = ART,
654                        QPCL = PCL,
655                        QTIFF = TIFF,
656                        QLISTING = LISTING,
657                        QTEXT = TEXT) ;
658     xwidth = WIDTH (QFULL = FULL,
659                    QTEXT = TEXT,
660                    QCURRENT = CURRENT) ;
661     xdepth = HEIGHT (QNATURAL = NATURAL) ;
662     xhadjust = HADJUST ;
663     xvadjust = VADJUST ;
664     border = BORDER (QTOP = TOP,
665                      QBOTTOM = BOTTOM,
666                      QBOX = BOX,
667                      QSCREEN = SCREEN,
668                      QNOBOX = NOBOX) ;
669     type = TYPE  (QART = ART,
670                   QPCL = PCL,
671                   QTIFF = TIFF,
672                   QTIF = TIF,
673                   QLISTING = LISTING,
674                   QTEXT = TEXT,
675                   QHPGL = HPGL,
676                   QHPG = HPG);
677     xmagnify = MAGNIFY (QFIT = FIT) ;
678     video = VIDEO (QINVERSE = INVERSE,
679                    QNOINVERSE = NOINVERSE) ;
680     strip = STRIP (QSTRIP = STRIP,
681                    QNOSTRIP = NOSTRIP) ;
682     mirror = MIRROR (QMIRROR = MIRROR) ;
683     margin = MARGIN ;
684     clip = CLIP ;
685     penwidth = PENWIDTH ;
686     snap = SNAP (QSNAP = SNAP,
687                  QNOSNAP = NOSNAP) ;
688     autoscale = AUTOSCALE (QAUTOSCALE = AUTOSCALE,
689                            QNOAUTOSCALE = NOAUTOSCALE) ;
690     plottype = PLOTTYPE ;
691     callout = CALLOUT ;
692     textsize = TEXTSIZE (QNORMAL = NORMAL,
693                          QSMALLER = SMALLER,
694                          QSMALLEST = SMALLEST) ;
695     ghyperlink = GHYPERLINK  ;
696     glinktype = GLINKTYPE (QJUMP = JUMP,
697                            QJUMPNEWVIEW = JUMPNEWVIEW,
698                            QDEFINITION = DEFINITION,
699                            QEXECUTE = EXECUTE,
700                            QAPPDEFINED = APPDEFINED,
701                            QMAN = MAN) ;
702     gdescription = GDESCRIPTION  ;
703   <START-CODE>
704      figure(number,
705             tonumber,
706             id,
707             file,
708             figpos,
709             cappos,
710             ghyperlink,
711             glinktype,
712             gdescription);
713   <END-CODE>
714     if (ftonumber | (svheadlen != 0))
715         {
716         fputs("</HEAD>", outfile);
717         ftonumber = 0;
718         }
719     fputs("\n</REFITEM>\n</SNREF>", outfile);
720     if (ghyperlink)
721         {
722         fputs("</LINK>\n", outfile);
723         }
724     inSdlP = FALSE;
725     fputs("</P>\n", outfile);
726
727 <ELEMENT FOOTNOTE>
728   /* When implementing, check conditionals of <FOOTNOTE> in <P>    */
729   <TEXT-CODE * EXAMPLESEG, * IMAGE>
730     outchar(m_textchar, outfile) ;
731   <END-CODE>
732     footnoteno++;
733     POPFONT; 
734
735 <ELEMENT FRONTSUB>
736   <PARAM>
737     include = INCLUDE  ;
738     exclude = EXCLUDE  ;
739 <START-CODE>
740    PushForm(NULL, NULL, NULL);
741
742 <ELEMENT GLOSSARY>
743   <START-CODE>
744     char *string = 
745       GetDefaultHeaderString("GlossaryElementDefaultHeadingString",
746                              M_SDATA,
747                              "Glossary");
748     static char glossary_string[] = "-GLOSSARY";
749     char id[SDLNAMESIZ+sizeof(glossary_string)];
750
751     thisnodelevel = 2;
752     sprintf(id, "%s%s", sdlReservedName, glossary_string);
753     mb_starthelpnode("_GLOSSARY", id, thisnodelevel);
754     if (strlen(string) + 1 > sizeof(chapstring)) {
755       m_error("Program error: exceeded chapstring") ;
756       m_exit(TRUE) ;
757       }
758     snprintf(chapstring, sizeof(chapstring), "%s", string) ;
759     fputs("\nGlossary\n", stderr) ;
760     glossary = TRUE ;
761     fprintf(outfile, "<HEAD SSI=\"CHAPHEAD\">%s</HEAD>\n", string);
762     m_free(string, "default header string return");
763   <END-CODE>
764     CloseVirpage();
765     thisnodelevel = 0;
766
767 <ELEMENT GRAPHIC>
768   <PARAM>
769     id = ID ;
770     file = ENTITY ;
771 <START-CODE>
772     unsigned char etype, wheredef ;
773      /* Code from figstart */
774   if (id) {
775     mbstowcs(xrefstring, "\\<xref graphic>", 400);
776     xstrlen = w_strlen(xrefstring) ;
777     m_getline(&xrffile, &xrfline) ;
778     if (xrffile == NULL) {
779          /* set to primary input source */
780          xrffile = inputname;
781     }
782     setid(id,
783           TRUE,
784           FALSE,
785           inchapter,
786           chapstring,
787           xrffile,
788           xrfline,
789           FALSE) ;
790
791     }
792   /* initialize some stuff first:
793      - file is the entity name,
794      - f_file is the content of the entity,
795        used only if f_content nonNULL
796      - f_content is f_file with the relative pathname, initialized to NULL,
797      - f_contqual is fully qualified f_file, assigned ONLY IF
798        f_content nonNULL
799   */
800   file_ent = FALSE ;
801   f_content = NULL ;
802   f_contqual[0] = M_EOS ;
803
804   /* check ENTITY and determine the figure type  */
805   if (file) {
806     m_lookent(file, &etype, &f_file, &wheredef) ;
807     if (etype != M_SYSTEM) {
808       M_WCHAR *wc_stago, *wc_tagc, *wc_entsystem, *wc_entkw;
809
810       wc_stago     = MakeWideCharString(m_stago);
811       wc_tagc      = MakeWideCharString(m_tagc);
812       wc_entsystem = MakeWideCharString(m_entsystem);
813       wc_entkw     = MakeWideCharString(m_entkw);
814       m_err6("%s not a %s %s, as required for the ENTITY parameter of %s%s%s",
815              file,
816              wc_entsystem,
817              wc_entkw,
818              wc_stago,
819              m_parent(0),
820              wc_tagc) ;
821       m_free(wc_stago,"wide character string");
822       m_free(wc_tagc,"wide character string");
823       m_free(wc_entsystem,"wide character string");
824       m_free(wc_entkw,"wide character string");
825       }
826     else {
827       file_ent = TRUE ;
828       f_content = searchforfile(f_file) ;
829       if (f_content) {
830         if (getqualified(f_contqual, f_content)) {
831           /* unsuccessful qual */
832           if (w_strlen(f_content) < FNAMELEN)
833             w_strcpy(f_contqual, f_content) ;
834           else {
835             m_err1("Internal error. File name too long: %s", f_content) ;
836             m_exit(m_errexit) ;
837             }
838           }
839         }
840       else {
841         m_err2("Can't find file %s (declared in entity %s)", f_file, file) ;
842         }
843       }
844     }
845
846     {
847     char *mb_content, snb_id[32];
848     char buffer[BIGBUF];
849     static M_WCHAR empty[1];
850     empty[0] = M_EOS;
851
852     if (!f_content) f_content = empty;
853
854     mb_content = MakeMByteString(f_content);
855     sprintf(snb_id, "%s%d", sdlReservedName, NextId());
856     mb_strcode("<SNREF", outfile);
857     if (id)
858         {
859         char *mb_id;
860
861         mb_id = MakeMByteString(id);
862         sprintf(buffer, " ID=\"%s\"", mb_id);
863         mb_strcode(buffer, outfile);
864         m_free(mb_id,"multi-byte string");
865         }
866     sprintf(buffer,
867             ">\n<REFITEM RID=\"%s\" CLASS=\"IN-LINE\"></REFITEM>\n</SNREF>",
868             snb_id);
869     mb_strcode(buffer, outfile);
870     AddToSNB(snb_id, mb_content);
871     m_free(mb_content,"multi-byte string");
872     }
873
874 <ELEMENT HEAD>
875 /* Accent headings */
876   <START-CODE NOTE, CAUTION, WARNING>
877     notehead = TRUE ;
878     newhline = 0 ;
879     fputs("<HEAD TYPE=\"LINED\" SSI=\"NCW\">", outfile);
880 /* Other headings */
881   <START-CODE LABLIST, IMAGE, LIST, EX, P>
882     char *ssi;
883
884     ssi = MakeMByteString(m_parent(1));
885     newhline = 0 ;
886     fprintf(outfile, "<HEAD TYPE=\"LINED\" SSI=\"%s\">", ssi);
887     m_free(ssi, "multi-byte string");
888 /* Node headings */
889   <START-CODE CHAPHEAD CHAPTER, 
890               CHAPHEAD RSECT, CHAPHEAD S1, CHAPHEAD S2, CHAPHEAD S3,
891               CHAPHEAD S4, CHAPHEAD S5, CHAPHEAD S6, CHAPHEAD S7,
892               CHAPHEAD S8, CHAPHEAD S9, CHAPHEAD TEST,
893               CHAPHEAD HOMETOPIC, CHAPHEAD MESSAGE
894               >
895     char *ssi;
896
897     ssi = MakeMByteString(m_parent(1));
898     newhline = 0 ;
899     echo = TRUE ;
900     savhd = TRUE ;
901     hderr = FALSE ;
902     svheadlen = 0 ;
903     savesnb = mb_malloc(1);
904     *savesnb = '\0';
905     tooutput = FALSE;
906     fprintf(outfile, "<HEAD TYPE=\"LINED\" SSI=\"%s\"", ssi);
907     m_free(ssi, "multi-byte string");
908 /* Non node headings */
909   <START-CODE CHAPHEAD RSUB, CHAPHEAD MSGSUB>
910     char *ssi;
911
912     ssi = MakeMByteString(m_parent(1));
913     newhline = 0 ;
914     echo = TRUE ;
915     savhd = TRUE ;
916     hderr = FALSE ;
917     svheadlen = 0 ;
918     tooutput = FALSE;
919     fprintf(outfile, "<HEAD TYPE=\"LINED\" SSI=\"%s\"", ssi);
920     m_free(ssi, "multi-byte string");
921 /* Non node headings */
922   <START-CODE CHAPHEAD PROCEDURE>
923     newhline = 0 ;
924     echo = TRUE ;
925     savhd = TRUE ;
926     hderr = FALSE ;
927     svheadlen = 0 ;
928     tooutput = FALSE;
929     fputs("<HEAD TYPE=\"LINED\" SSI=\"PROCEDURE\"", outfile);
930 /* Non node headings */
931   <START-CODE OTHERHEAD>
932     char *ssi;
933
934     ssi = MakeMByteString(m_parent(1));
935     newhline = 0 ;
936     echo = TRUE ;
937     savhd = TRUE ;
938     hderr = FALSE ;
939     svheadlen = 0 ;
940     fprintf(outfile, "<HEAD TYPE=\"LINED\" SSI=\"%s\">", ssi);
941     m_free(ssi, "multi-byte string");
942 /* Other headings */ 
943   <START-CODE CHAPHEAD>
944      M_WCHAR *wc_stago, *wc_tagc;
945
946      wc_stago = MakeWideCharString(m_stago);
947      wc_tagc  = MakeWideCharString(m_tagc);
948      m_err2("Unimplemented %sCHAPHEAD%s reached", wc_stago, wc_tagc);
949      m_free(wc_stago,"wide character string");
950      m_free(wc_tagc,"wide character string");
951 /* Non-node headings */
952   <START-CODE FRONTSUB>
953     char *ssi;
954
955     ssi = MakeMByteString(m_parent(1));
956     echo = TRUE ;
957     newhline = 0 ;
958     fprintf(outfile, "<HEAD TYPE=\"LINED\" SSI=\"%s\">", ssi);
959     m_free(ssi, "multi-byte string");
960 /* Non-node headings */
961   <START-CODE ABSTRACT>
962     echo = TRUE ;
963     newhline = 0 ;
964     needabstracthead = FALSE;
965     fputs("<HEAD TYPE=\"LINED\" SSI=\"ABSTRACT\">", outfile);
966 /* Node headings */
967   <START-CODE OTHERFRONT>
968     had_an_otherfront_head = TRUE;
969     newhline = 0 ;
970     echo = TRUE ;
971     savhd = TRUE ;
972     hderr = FALSE ;
973     svheadlen = 0 ;
974     fputs("<HEAD TYPE=\"LINED\" SSI=\"METAINFO\">", outfile);
975 /* Other headings.*/
976   <START-CODE SYNTAX>
977 /* Other headings (mixed content) */
978   <END-CODE  P, IMAGE>
979     endhead();
980     fputs("</HEAD>", outfile);
981 /* Accent and Other headings (no mixed content) */
982   <END-CODE LABLIST, LIST, EX, NOTE, CAUTION, WARNING>
983     fputs("</HEAD>\n", outfile);
984 /* Non node headings */
985   <END-CODE ABSTRACT, FRONTSUB, MESSAGE>
986     echo = FALSE ;
987     chksnb();
988 /* Node headings */
989   <END-CODE CHAPHEAD CHAPTER,
990             CHAPHEAD RSECT,  CHAPHEAD S1, CHAPHEAD S2, CHAPHEAD S3,
991             CHAPHEAD S4, CHAPHEAD S5, CHAPHEAD S6, CHAPHEAD S7,
992             CHAPHEAD S8, CHAPHEAD S9, CHAPHEAD TEST,
993             CHAPHEAD HOMETOPIC, CHAPHEAD MESSAGE>
994     echo = FALSE;
995     savhd = FALSE;
996     savehead[svheadlen] = '\0';
997     tooutput = TRUE;
998 /* Non node headings */
999   <END-CODE CHAPHEAD RSUB, CHAPHEAD MSGSUB, CHAPHEAD PROCEDURE>
1000     echo = FALSE;
1001     savhd = FALSE;
1002     savehead[svheadlen] = '\0';
1003     tooutput = TRUE;
1004 /* Non node headings */
1005   <END-CODE OTHERHEAD>
1006     endhead() ;
1007     fputs("</HEAD>\n", outfile);
1008 /* Node headings. */
1009   <END-CODE OTHERFRONT>
1010     endhead() ;
1011     chksnb();
1012 /* Other headings. */
1013   <END-CODE SYNTAX>
1014   <END-CODE>
1015     fputs("</HEAD>", outfile);
1016 <TEXT-CODE IMAGE>
1017     outchar(m_textchar, outfile) ;
1018
1019 <ELEMENT HELPVOLUME>
1020   <PARAM>
1021     author = AUTHOR  ;
1022     language = LANGUAGE (QENGLISH = ENGLISH,
1023                          QNORWEGIAN = NORWEGIAN,
1024                          QSWEDISH = SWEDISH,
1025                          QDANISH = DANISH,
1026                          QFINNISH = FINNISH,
1027                          QDUTCH = DUTCH,
1028                          QFRENCH = FRENCH,
1029                          QGERMAN = GERMAN,
1030                          QITALIAN = ITALIAN,
1031                          QSPANISH = SPANISH)  ;
1032     idxvol = IDXVOL  ;
1033     status = STATUS  ;
1034   <START-CODE>
1035     char   hostname[BIGBUF];
1036     char **tossline = toss;
1037     char  *mb_language, *mb_charset;
1038     long   timeStamp;
1039
1040     ModifyEntities(); /* convert SDATA [......] to <spc name="[......]"> */
1041
1042     if (!getenv("_DTHELPTAG_NO_UNIQUE_ID"))
1043         {
1044         hostname[sizeof(hostname)-1] = '\0';
1045         gethostname(hostname, sizeof(hostname)-1);
1046
1047         docId = mb_malloc(strlen(hostname)+1);
1048         strcpy(docId, hostname);
1049
1050         timeStamp = time(0);
1051         }
1052     else
1053         {
1054         docId = "test";
1055         timeStamp = 0;
1056         }
1057
1058
1059     thisnodelevel = 0;
1060     fprintf(outfile,
1061             "<SDLDOC %s=\"%s\" %s=\"%s\" %s=\"%ld\" %s=\"%s-%s\"",
1062             "PUB-ID",
1063             pubId,
1064             "DOC-ID",
1065             docId,
1066             "TIMESTMP",
1067             timeStamp,
1068             "FIRST-PAGE",
1069             sdlReservedName,
1070             "HOMETOPIC");
1071     if (helplang)
1072         {
1073         mb_language = MakeMByteString(helplang);
1074         fprintf(outfile, " %s=\"%s\"", "LANGUAGE", mb_language);
1075         mb_free(&mb_language);
1076         }
1077     if (helpcharset)
1078         {
1079         mb_charset = MakeMByteString(helpcharset);
1080         fprintf(outfile, " %s=\"%s\"", "CHARSET", mb_charset);
1081         mb_free(&mb_charset);
1082         }
1083     fprintf(outfile, " %s=\"%s\">\n", "SDLDTD", "1.1.1");
1084     fprintf(outfile, "<VSTRUCT DOC-ID=\"%s\">\n", docId);
1085     fputs("<LOIDS>\n</LOIDS>\n", outfile);
1086     IncludeToss();
1087     fputs("</VSTRUCT>\n", outfile);
1088     snbstart = ftell(outfile);
1089   <END-CODE>
1090     assert_hometopic_exists();
1091     fputs("</SDLDOC>\n", outfile);
1092
1093 <ELEMENT HLINE>
1094   <START-CODE ABBREV>
1095     if (fabbrev) {
1096         if (newhline++) {
1097              fputs("&\n", outfile);
1098         }
1099       }
1100   <START-CODE CAPTION FIGURE>
1101     if (newhline++) 
1102       mb_shstring("\n",
1103                &svheadlen,
1104                (sizeof(savehead) / sizeof(M_WCHAR)),
1105                savehead,
1106                "Too many characters in head or caption",
1107                &hderr) ;
1108   <START-CODE HEAD CHAPHEAD, HEAD OTHERFRONT>
1109     if (newhline++) {
1110       fputs("  ", stderr) ;
1111       mb_strcode("\n", outfile) ;
1112       if (savid) shchar(' ',
1113                         &xstrlen,
1114                         (sizeof(xrefstring) / sizeof(M_WCHAR)),
1115                         xrefstring,
1116                         idstring,
1117                         "Too many characters in corresponding cross-reference",
1118                         &iderr) ;
1119       shchar(' ',
1120              &svheadlen,
1121              (sizeof(savehead) / sizeof(M_WCHAR)),
1122              savehead,
1123              svhdstring,
1124              "Too many characters in head or caption", 
1125              &hderr) ;
1126       }
1127   <START-CODE TITLE>
1128      if (newhline++) {
1129           fputs("\n", outfile) ;
1130      }
1131   <START-CODE HEAD P, HEAD IMAGE, HEAD LIST, HEAD LABLIST, HEAD EX, 
1132               HEAD SYNTAX>
1133     if (newhline++) fputc('\n', outfile) ;
1134   <END-CODE HEAD CHAPHEAD, 
1135             HEAD FRONTSUB, 
1136             HEAD OTHERFRONT,
1137             HEAD OTHERHEAD>
1138     putc('\n', stderr) ;
1139   <END-CODE HEAD ABSTRACT>
1140     putc('\n', stderr) ;
1141   <END-CODE>
1142
1143 <ELEMENT HOMETOPIC>
1144   <START-CODE>
1145     static char hometopic[] = "-HOMETOPIC";
1146     char id[SDLNAMESIZ+sizeof(hometopic)];
1147
1148     sprintf(id, "%s%s", sdlReservedName, hometopic);
1149     mb_starthelpnode("_HOMETOPIC", id, 1);
1150     nohometopic = FALSE;
1151   <END-CODE>
1152     CloseVirpage();
1153
1154 <ELEMENT HSEP>
1155   <PARAM>
1156     rule = RULE (QNORULE = NORULE,
1157                  QRULE = RULE,
1158                  QBLANK = BLANK) ;
1159
1160 <ELEMENT IDSECTION>
1161
1162 <ELEMENT IDX>
1163   <PARAM>
1164     main = MAIN ;
1165     range = RANGE (QBEGIN = BEGIN,
1166                    QEND = END) ;
1167   <START-CODE>
1168     print[0] = '\0';
1169     subprint[0] = '\0';
1170     sort[0] = '\0';
1171     subsort[0] = '\0';
1172   <END-CODE>
1173      /* ignore <idx end>'s in cache creek */
1174     if (!range || (range && m_wcmbupstrcmp(range, QEND)) )
1175         { /* sort field */
1176         char *mb_print, *mb_nospace1, *mb_nospace2, id[32];
1177         M_WCHAR *pwc, wnl, wsp;
1178
1179         mbtowc(&wnl, "\n", 1);
1180         mbtowc(&wsp, " ", 1);
1181
1182         pwc = print;
1183         while (pwc = w_strchr(pwc, wnl))
1184             *pwc = wsp;
1185         mb_print = MakeMByteString(print);
1186         if (w_strlen(sort) > 0)
1187             { /* use sort[] */
1188             char *mb_sort;
1189
1190             pwc = sort;
1191             while (pwc = w_strchr(pwc, wnl))
1192                 *pwc = wsp;
1193             mb_sort = MakeMByteString(sort);
1194             if (w_strlen(subsort) > 0 || w_strlen(subprint) > 0)
1195                 {
1196                 /* append subsort or subprint */
1197                 char *mb_sub;
1198                 M_WCHAR *pwcSub;
1199
1200                 pwcSub = (w_strlen(subsort) > 0) ? subsort : subprint;
1201                 pwc = pwcSub;
1202                 while (pwc = w_strchr(pwc, wnl))
1203                     *pwc = wsp;
1204                 mb_sub = MakeMByteString(pwcSub);
1205
1206                 /* strip trailing spaces */
1207                 mb_nospace1 = mb_sort;
1208                 while (*mb_nospace1++); --mb_nospace1; /* end of string */
1209                 while (*--mb_nospace1 == ' ') *mb_nospace1 = '\0';
1210                 mb_nospace2 = mb_sub;
1211                 while (*mb_nospace2++); --mb_nospace2; /* end of string */
1212                 while (*--mb_nospace2 == ' ') *mb_nospace2 = '\0';
1213
1214                 /* strip leading spaces */
1215                 mb_nospace1 = mb_sort;
1216                 while (*mb_nospace1++ == ' '); --mb_nospace1;
1217                 mb_nospace2 = mb_sub;
1218                 while (*mb_nospace2++ == ' '); --mb_nospace2;
1219
1220                 fprintf(indexfp, "%s, %s", mb_nospace1, mb_nospace2);
1221                 m_free(mb_sub,"multi-byte string");
1222                 }
1223             else
1224                 { /* plain sort */
1225                 /* strip trailing spaces */
1226                 mb_nospace1 = mb_sort;
1227                 while (*mb_nospace1++); --mb_nospace1; /* end of string */
1228                 while (*--mb_nospace1 == ' ') *mb_nospace1 = '\0';
1229
1230                 /* strip leading spaces */
1231                 mb_nospace1 = mb_sort;
1232                 while (*mb_nospace1++ == ' '); --mb_nospace1;
1233
1234                 fprintf(indexfp, "%s", mb_nospace1);
1235                 }
1236             m_free(mb_sort,"multi-byte string");
1237             }
1238         else
1239             { /* use print field */
1240             if (w_strlen(subsort) > 0 || w_strlen(subprint) > 0)
1241                 {
1242                 /* append subsort or subprint */
1243                 char *mb_sub;
1244                 M_WCHAR *pwcSub;
1245
1246                 pwcSub = (w_strlen(subsort) > 0) ? subsort : subprint;
1247                 pwc = pwcSub;
1248                 while (pwc = w_strchr(pwc, wnl))
1249                     *pwc = wsp;
1250                 mb_sub = MakeMByteString(pwcSub);
1251
1252                 /* strip trailing spaces */
1253                 mb_nospace1 = mb_print;
1254                 while (*mb_nospace1++); --mb_nospace1; /* end of string */
1255                 while (*--mb_nospace1 == ' ') *mb_nospace1 = '\0';
1256                 mb_nospace2 = mb_sub;
1257                 while (*mb_nospace2++); --mb_nospace2; /* end of string */
1258                 while (*--mb_nospace2 == ' ') *mb_nospace2 = '\0';
1259
1260                 /* strip leading spaces */
1261                 mb_nospace1 = mb_print;
1262                 while (*mb_nospace1++ == ' '); --mb_nospace1;
1263                 mb_nospace2 = mb_sub;
1264                 while (*mb_nospace2++ == ' '); --mb_nospace2;
1265
1266                 fprintf(indexfp, "%s, %s", mb_nospace1, mb_nospace2);
1267                 m_free(mb_sub,"multi-byte string");
1268                 }
1269             else
1270                 { /* plain print */
1271                 /* strip trailing spaces */
1272                 mb_nospace1 = mb_print;
1273                 while (*mb_nospace1++); --mb_nospace1; /* end of string */
1274                 while (*--mb_nospace1 == ' ') *mb_nospace1 = '\0';
1275
1276                 /* strip leading spaces */
1277                 mb_nospace1 = mb_print;
1278                 while (*mb_nospace1++ == ' '); --mb_nospace1;
1279
1280                 fprintf(indexfp, "%s", mb_nospace1);
1281                 }
1282             }
1283         putc('\036' /* ascii record separator */, indexfp);
1284
1285         /* print field */
1286         if (w_strlen(subprint) > 0)
1287             {
1288             char *mb_subprint;
1289
1290             pwc = subprint;
1291             while (pwc = w_strchr(pwc, wnl))
1292                 *pwc = wsp;
1293             mb_subprint = MakeMByteString(subprint);
1294
1295             /* strip trailing spaces */
1296             mb_nospace1 = mb_print;
1297             while (*mb_nospace1++); --mb_nospace1; /* end of string */
1298             while (*--mb_nospace1 == ' ') *mb_nospace1 = '\0';
1299             mb_nospace2 = mb_subprint;
1300             while (*mb_nospace2++); --mb_nospace2; /* end of string */
1301             while (*--mb_nospace2 == ' ') *mb_nospace2 = '\0';
1302
1303             /* strip leading spaces */
1304             mb_nospace1 = mb_print;
1305             while (*mb_nospace1++ == ' '); --mb_nospace1;
1306             mb_nospace2 = mb_subprint;
1307             while (*mb_nospace2++ == ' '); --mb_nospace2;
1308
1309             fprintf(indexfp, "%s, %s", mb_nospace1, mb_nospace2);
1310             m_free(mb_subprint,"multi-byte string");
1311             }
1312         else
1313             {
1314             /* strip trailing spaces */
1315             mb_nospace1 = mb_print;
1316             while (*mb_nospace1++); --mb_nospace1; /* end of string */
1317             while (*--mb_nospace1 == ' ') *mb_nospace1 = '\0';
1318
1319             /* strip leading spaces */
1320             mb_nospace1 = mb_print;
1321             while (*mb_nospace1++ == ' '); --mb_nospace1;
1322
1323             fprintf(indexfp, "%s", mb_nospace1);
1324             }
1325         m_free(mb_print,"multi-byte string");
1326         putc('\036' /* ascii record separator */, indexfp);
1327
1328         /* id field */
1329         if (inSdlP)
1330             {
1331             if (inParText)
1332                 {
1333                 sprintf(id, "%s%d", sdlReservedName, NextId());
1334                 fprintf(outfile, "<ANCHOR ID=\"%s\">", id);
1335                 fputs(id, indexfp);
1336                 fputs("\n", indexfp);
1337                 }
1338             else
1339                 {
1340                 if (!parTextId)
1341                     parTextId = NextId();
1342                 sprintf(id, "%s%d", sdlReservedName, parTextId);
1343                 fputs(id, indexfp);
1344                 fputs("\n", indexfp);
1345                 }
1346             }
1347         else if (*nodeid)
1348             {
1349             char *mb_nodeid;
1350
1351             mb_nodeid = MakeMByteString(nodeid);
1352             fputs(mb_nodeid, indexfp);
1353             fputs("\n", indexfp);
1354             m_free(mb_nodeid,"multi-byte string");
1355             }
1356         else
1357             fprintf(indexfp, "%s-HOMETOPIC\n", sdlReservedName);
1358         }
1359   <TEXT-CODE>
1360     indexchar(m_textchar) ;
1361
1362 <ELEMENT IMAGE>
1363   <PARAM>
1364     indent = INDENT ;
1365     id = ID;
1366     gentity = GENTITY  ;
1367     gposition = GPOSITION (QLEFT = LEFT,
1368                            QRIGHT = RIGHT) ;
1369     ghyperlink = GHYPERLINK  ;
1370     glinktype = GLINKTYPE (QJUMP = JUMP,
1371                            QJUMPNEWVIEW = JUMPNEWVIEW,
1372                            QDEFINITION = DEFINITION,
1373                            QEXECUTE = EXECUTE,
1374                            QAPPDEFINED = APPDEFINED,
1375                            QMAN = MAN) ;
1376     gdescription = GDESCRIPTION  ;
1377   /*
1378     <C variable> = NUMBER ;
1379   */
1380   <START-CODE>
1381     indentp = indent;
1382     imagegentityp = gentity;
1383     imagegpositionp = gposition;
1384     imageghyperlinkp = ghyperlink;
1385     imageglinktypep = glinktype;
1386     imagegdescription = gdescription;
1387
1388     if (!inBlock)
1389         StartBlock(NULL, NULL, NULL);
1390
1391     inSdlP = TRUE;
1392     fputs("<P TYPE=\"LITERAL\"", outfile);
1393     if (id) {
1394       if (imageId)
1395           m_free(imageId,"multi-byte string");
1396       imageId = MakeMByteString(id);
1397       fprintf(outfile, " ID=\"%s\"", imageId);
1398       savid = checkid(id);
1399     }
1400     fputs(" SSI=\"IMAGE", outfile);
1401     if (indentp)
1402         {
1403         fputs("-INDENT", outfile);
1404         }
1405     fputs("\">", outfile);
1406   <END-CODE>
1407     inSdlP = FALSE;
1408     fputs("</P>\n", outfile);
1409   <TEXT-CODE>
1410     imoutchar(m_textchar) ;
1411
1412 <ELEMENT IMAGETEXT>
1413   <START-CODE>
1414      M_WCHAR *wc_image;
1415
1416      wc_image = MakeWideCharString("IMAGE");
1417      handle_link_and_graphic(wc_image,
1418                              imagegentityp,
1419                              imagegpositionp,
1420                              imageghyperlinkp,
1421                              imageglinktypep,
1422                              imagegdescription);
1423      m_free(wc_image,"wide character string");
1424
1425 <ELEMENT INDEXPRIMARY>
1426   <START-CODE>
1427     idxsavlen = 0; 
1428     didsort = FALSE;
1429   <END-CODE>
1430     /* capture saved term unless <sort> got it already */
1431     if (! didsort) {
1432          idxsav[idxsavlen] = M_EOS;
1433          w_strcpy(print, idxsav);
1434         
1435     }
1436     else { /* save the sort field */
1437          idxsav[idxsavlen] = M_EOS;
1438          w_strcpy(sort, idxsav);
1439     }
1440
1441 <ELEMENT INDEXSUB>
1442   <START-CODE>
1443     idxsavlen = 0; 
1444     didsubsort = FALSE;
1445   <END-CODE>
1446     /* capture saved term unless <sort> got it already */
1447     if (! didsubsort) {
1448          idxsav[idxsavlen] = M_EOS;
1449          w_strcpy(subprint, idxsav);
1450     }
1451     else { /* save the sort field */
1452          idxsav[idxsavlen] = M_EOS;
1453          w_strcpy(subsort, idxsav);
1454     }
1455
1456
1457 <ELEMENT INPUT.....>
1458   <START-CODE>
1459     if (echo) mb_echohead("``") ;
1460   <TEXT-CODE>
1461   <END-CODE>
1462     if (echo) mb_echohead("''") ;
1463
1464 <ELEMENT ITEM>
1465   <PARAM>
1466     id = ID ;
1467   <START-CODE LIST>
1468     if (lastlist->lastlist->type == PLAIN) {
1469       leaderok = TRUE ;   /* allow <LEADER> only in <LIST PLAIN> */
1470       }
1471     Item(id) ;
1472   <END-CODE LIST>
1473     leaderok = FALSE ;
1474
1475 <ELEMENT KEYCAP>
1476   <START-CODE>
1477     /* also does special handling for calculator--supers/subs */
1478     /*handles super and subs in keys */
1479     mb_strcode("<KEY CLASS=\"MACH-CONT\">", outfile) ;
1480     if (echo) mb_echohead("[[") ;
1481   <END-CODE>
1482     mb_strcode("</KEY>", outfile) ;
1483     if (echo) mb_echohead("]]") ;
1484   <TEXT-CODE>
1485      esoutchar(m_textchar) ;
1486
1487   <START-CODE * IDX>
1488     indexchar('[');
1489   <END-CODE * IDX>
1490     indexchar(']');
1491   <TEXT-CODE * IDX>
1492     indexchar(m_textchar) ;
1493
1494 <ELEMENT KEYS>
1495
1496 <ELEMENT LABEL>
1497   <START-CODE>
1498     char *first, *loose, *wrap;
1499
1500     first = "";
1501     if (listitems[list].firstitem)
1502         {
1503         first = "FIRST-";
1504         if (needFData)
1505             {
1506             fputs("<FDATA>\n", outfile);
1507             needFData = FALSE;
1508             }
1509         }
1510     loose = lablisttight[list] ? "TIGHT" : "LOOSE";
1511     wrap  = (listitems[list].longlabel == WRAP) ? "" : " TYPE=\"LINED\"";
1512     labelid[list] = NextId();
1513     fprintf(outfile,
1514             "<BLOCK ID=\"%s%d\" CLASS=\"ITEM\" SSI=\"%s%s-LABEL\">\n",
1515             sdlReservedName,
1516             labelid[list],
1517             first,
1518             loose);
1519     fprintf(outfile, "<P%s>", wrap);
1520   <END-CODE>
1521     char *first, *loose;
1522     char  ssi[BIGBUF], labelId[BIGBUF];
1523
1524     fputs("</P>\n</BLOCK>\n", outfile);
1525
1526     first = "";
1527     if (listitems[list].firstitem)
1528         {
1529         first = "FIRST-";
1530         listitems[list].firstitem = FALSE;
1531         }
1532     loose = lablisttight[list] ? "TIGHT" : "LOOSE";
1533     sprintf(ssi, "%s%s", first, loose);
1534
1535     sprintf(labelId, "%s%d", sdlReservedName, labelid[list]);
1536
1537     PushForm2("ITEM", ssi, labelId, NULL);
1538
1539 <ELEMENT LABH>
1540   <START-CODE>
1541     if (listitems[list].firstitem)
1542         {
1543         listitems[list].firstitem = FALSE;
1544         }
1545     labhid[list] = NextId();
1546     if (needFData)
1547         {
1548         fputs("<FDATA>\n", outfile);
1549         needFData = FALSE;
1550         }
1551     fprintf(outfile,
1552             "<BLOCK ID=\"%s%d\" CLASS=\"ITEM\" SSI=\"LABH-%s\">\n",
1553             sdlReservedName,
1554             labhid[list],
1555             lablisttight[list] ? "TIGHT" : "LOOSE");
1556     fputs("<P TYPE=\"LINED\">", outfile);
1557   <END-CODE>
1558     fputs("</P>\n</BLOCK>\n", outfile);
1559
1560 <ELEMENT LABHTEXT>
1561   <START-CODE>
1562     labhtextid[list] = NextId();
1563     fprintf(outfile,
1564             "<BLOCK ID=\"%s%d\" CLASS=\"ITEM\" SSI=\"LABHTEXT-%s\">\n",
1565             sdlReservedName,
1566             labhtextid[list],
1567             lablisttight[list] ? "TIGHT" : "LOOSE");
1568     fputs("<P TYPE=\"LINED\">", outfile);
1569   <END-CODE>
1570     char labh_id[SDLNAMESIZ + 10], labhtext_id[SDLNAMESIZ + 10];
1571
1572     fputs("</P>\n</BLOCK>\n", outfile);
1573
1574     strcpy(labh_id, sdlReservedName);
1575     m_itoa(labhid[list], labh_id + SDLNAMESIZ - 1);
1576     strcpy(labhtext_id, sdlReservedName);
1577     m_itoa(labhtextid[list], labhtext_id + SDLNAMESIZ - 1);
1578     Add2ToRowVec(&formStackTop->vecLen,
1579                  &formStackTop->rowVec,
1580                  labh_id,
1581                  labhtext_id);
1582
1583 <ELEMENT LABHEADS>
1584
1585 <ELEMENT LABLIST>
1586   <PARAM>
1587     longlabel = LONGLABEL (QWRAP = WRAP,
1588                            QNOWRAP = NOWRAP) ;
1589     width = WIDTH ;
1590     spacing = SPACING (QTIGHT = TIGHT,
1591                        QLOOSE = LOOSE) ;
1592   <START-CODE>
1593     StartLabList(spacing, longlabel);
1594   <END-CODE>
1595     PopForm2();
1596     list--;
1597
1598 <ELEMENT LEADER>
1599   <PARAM>
1600     type = TYPE (QSPACE = SPACE,
1601                  QDOTS = DOTS) ;
1602   <START-CODE>
1603     if (leaderok==TRUE)
1604         {
1605         if (! m_wcmbupstrcmp(type, QDOTS))
1606             {
1607             }
1608         else if (! m_wcmbupstrcmp(type, QSPACE))
1609             {
1610             }
1611         else
1612             {
1613             M_WCHAR *wc_stago, *wc_tagc;
1614
1615             wc_stago = MakeWideCharString(m_stago);
1616             wc_tagc  = MakeWideCharString(m_tagc);
1617             m_err2("Internal error: element %sLEADER%s in tex.if",
1618                    wc_stago,
1619                    wc_tagc) ;
1620             m_free(wc_stago,"wide character string");
1621             m_free(wc_tagc,"wide character string");
1622             }
1623         }
1624     else
1625         {
1626         M_WCHAR *wc_stago, *wc_tagc;
1627
1628         wc_stago = MakeWideCharString(m_stago);
1629         wc_tagc  = MakeWideCharString(m_tagc);
1630         m_err4("%sLEADER%s only allowed in %sLIST PLAIN%s",
1631                wc_stago,
1632                wc_tagc,
1633                wc_stago,
1634                wc_tagc) ;
1635         m_free(wc_stago,"wide character string");
1636         m_free(wc_tagc,"wide character string");
1637         }
1638
1639 <ELEMENT LINENO>
1640   <PARAM>
1641     id = ID ;
1642   <START-CODE>
1643     char mb_xrefstring[400];
1644
1645     if (! tonumexlines) 
1646       m_error(
1647     "Preparing cross-reference to a line in an example without line numbers"
1648       ) ;
1649     sprintf(mb_xrefstring, "%d", exLineNum) ;
1650     mbstowcs(xrefstring, mb_xrefstring, 400);
1651     xstrlen = w_strlen(xrefstring) ;
1652     m_getline(&xrffile, &xrfline) ;
1653     if (xrffile == NULL) {
1654            /* set to primary input */
1655            xrffile = inputname;
1656     }
1657     setid(id,
1658           TRUE,
1659           FALSE,
1660           inchapter,
1661           chapstring,
1662           xrffile,
1663           xrfline,
1664           TRUE) ;
1665     {
1666     char *mb_id, buffer[BIGBUF];
1667
1668     mb_id = MakeMByteString(id);
1669     sprintf(buffer, "<ANCHOR ID=\"%s\">", mb_id);
1670     mb_strcode(buffer, outfile);
1671     m_free(mb_id,"multi-byte string");
1672     }
1673
1674 <ELEMENT LINK>
1675   <PARAM>
1676      hyperlink = HYPERLINK  ;
1677      type = TYPE (QJUMP = JUMP,
1678                   QJUMPNEWVIEW = JUMPNEWVIEW,
1679                   QDEFINITION = DEFINITION,
1680                   QEXECUTE = EXECUTE,
1681                   QAPPDEFINED = APPDEFINED,
1682                   QMAN = MAN) ;
1683      description = DESCRIPTION  ;
1684   <START-CODE>
1685      HandleLink(hyperlink, type, description);
1686   <END-CODE>
1687      /* reset link type to default.  This is braindead, but enough.
1688
1689         E.g.,
1690
1691            <link foo DEFINITION><XREF bar><\link> 
1692
1693         will do the right thing (remember that xref turns to an implicit link).
1694         Right_thing => xref becomes definition link.
1695
1696         However, in
1697
1698            <link foo DEFINITION> <link fub> Test <\link> <xref bar> <\link>
1699
1700         the xref will think that is supposed to become a link of type jump,
1701         not definition.  This case is odd, so we won't worry about it.
1702      */
1703      global_linktype = 0; 
1704      mb_strcode("</LINK>", outfile);
1705
1706 <ELEMENT LIST>
1707   <PARAM>
1708     type = TYPE (QORDER = ORDER,
1709                  QBULLET = BULLET,
1710                  QPLAIN = PLAIN,
1711                  QMILSPEC = MILSPEC,
1712                  QCHECK = CHECK) ;
1713     order = ORDERTYPE (QUALPHA = UALPHA,
1714                        QLALPHA = LALPHA,
1715                        QARABIC = ARABIC,
1716                        QUROMAN = UROMAN,
1717                        QLROMAN = LROMAN) ;
1718     spacing = SPACING (QTIGHT = TIGHT,
1719                        QLOOSE = LOOSE) ;
1720     cont = CONTINUE ;
1721   <START-CODE>
1722     StartList(type, order, spacing, cont) ;
1723   <END-CODE>
1724     EndList();
1725
1726 <ELEMENT LOCATION>
1727   <PARAM>
1728     id = ID  ;
1729   <START-CODE>
1730     if (id)
1731         {
1732         char *mb_id;
1733         char buffer[BIGBUF];
1734
1735         mb_id = MakeMByteString(id);
1736         sprintf(buffer, "<ANCHOR ID=\"%s\">", mb_id);
1737         mb_strcode(buffer, outfile);
1738         m_free(mb_id,"multi-byte string");
1739
1740         savid = checkid(id);
1741         }
1742   <END-CODE>
1743     if (savid)
1744         {
1745         mb_shchar(M_EOS,
1746                   &xstrlen,
1747                   (sizeof(xrefstring) / sizeof(M_WCHAR)),
1748                   xrefstring,
1749                   idstring,
1750                   "Too many characters in corresponding cross-reference",
1751                   &iderr);
1752         setid(savid,
1753               TRUE,
1754               TRUE,
1755               inchapter,
1756               chapstring,
1757               xrffile,
1758               xrfline,
1759               TRUE);
1760         }
1761
1762 <ELEMENT MEMO>
1763   <TEXT-CODE>
1764     if (memo && inSdlP)
1765         {
1766         if (m_textchar == '"')
1767             { /* handle funny quote in memo bug */
1768             }
1769         else
1770             {
1771             outchar(m_textchar, outfile);
1772             }
1773         }
1774   <PI-CODE>
1775     /* could need to handle calculator context sensitive entities
1776      * here if needed to reduce tex macro count 
1777      */
1778     if (memo)
1779         {
1780         outpi(m_enttype, m_pi, m_entname) ;
1781         }
1782
1783 <ELEMENT MESSAGE>
1784   <PARAM>
1785     include = INCLUDE  ;
1786     exclude = EXCLUDE  ;
1787   <START-CODE>
1788     thisnodelevel = 2;
1789     mb_starthelpnode("MESSAGE", "", thisnodelevel);
1790     chapst = FALSE ;
1791     fprintf(stderr, "\nMessages.\n") ;
1792     emsghead = DEFHEAD ;
1793   <END-CODE>
1794     CloseVirpage();
1795     thisnodelevel = 0;
1796
1797 <ELEMENT METAINFO>
1798
1799 <ELEMENT MSG>
1800   <START-CODE>
1801     PushForm(NULL, "MSG", NULL);
1802     checkmsghead() ;
1803   <END-CODE>
1804     PopForm();
1805
1806 <ELEMENT MSGNUM>
1807   <START-CODE>
1808     fputs("<HEAD SSI=\"MSGNUM\">", outfile);
1809   <END-CODE>
1810     fputs("</HEAD>\n", outfile);
1811
1812 <ELEMENT MSGSUB>
1813   <PARAM>
1814     include = INCLUDE  ;
1815     exclude = EXCLUDE  ;
1816   <START-CODE>
1817     PushForm(NULL, NULL, NULL);
1818     checkmsghead() ;
1819     chapst = TRUE ;
1820     savid = checkid(NULL) ; /* hook for possible future ID */
1821     iderr = FALSE ;
1822   <END-CODE>
1823     PopForm();
1824
1825 <ELEMENT MSGTEXT>
1826   <START-CODE>
1827     inSdlP = TRUE;
1828     StartBlock(NULL, "MSGTEXT", NULL);
1829     fputs("<P>", outfile);
1830   <END-CODE>
1831     inSdlP = FALSE;
1832     fputs("</P>\n", outfile);
1833
1834 <ELEMENT NEED>
1835   <PARAM>
1836     type = TYPE (QBEGIN = BEGIN,
1837                  QEND = END,
1838                  QTOGETHER = TOGETHER) ;
1839     depth = AMOUNT ;
1840
1841 <ELEMENT NEWLINE>
1842   <START-CODE>
1843       fputs("&\n", outfile) ;
1844   <START-CODE * ABSTRACT>
1845       fputs("&\n", outfile) ;
1846
1847 <ELEMENT NEWPAGE>
1848
1849 <ELEMENT NOTE>
1850   <START-CODE>
1851     StartNCW("NOTE");
1852
1853 <ELEMENT NUMBER>
1854   <START-CODE * IDX>
1855   <END-CODE * IDX>
1856   <TEXT-CODE * IDX>
1857     indexchar(m_textchar) ;
1858
1859   <TEXT-CODE * EXAMPLESEG, * IMAGE>
1860     outchar(m_textchar, outfile) ;
1861
1862 <ELEMENT OPTBLOCK>
1863   <START-CODE>
1864     synelcnt = 0;
1865     fputs("[", outfile);
1866   <END-CODE>
1867     fputs("]", outfile);
1868
1869
1870 <ELEMENT OTHERFRONT>
1871   <PARAM>
1872     id = ID  ;
1873     include = INCLUDE  ;
1874     exclude = EXCLUDE  ;
1875   <START-CODE>
1876      char    *mb_id;
1877
1878      if (!id)
1879          mb_id = NULL;
1880      else
1881          mb_id = MakeMByteString(id);
1882      mb_starthelpnode("METAINFO", mb_id, 0);
1883      if (mb_id)
1884          m_free(mb_id, "multi-byte string");
1885      had_an_otherfront_head = FALSE;
1886      savid = checkid(id) ;
1887      iderr = FALSE ;
1888   <END-CODE>
1889     CloseVirpage();
1890      if (id && !had_an_otherfront_head) {
1891         m_errline("You must use a <HEAD> tag after <OTHERFRONT>\n");
1892      }
1893
1894 <ELEMENT OTHERHEAD>
1895   <START-CODE>
1896     PushForm(NULL, "OTHERHEAD", NULL);
1897   <END-CODE>
1898     PopFormMaybe();
1899
1900 <ELEMENT OUTPUT....>
1901   <START-CODE>
1902     if (echo) mb_echohead("``") ;
1903   <TEXT-CODE>
1904   <END-CODE>
1905     if (echo) mb_echohead("''") ;
1906
1907 <ELEMENT P>
1908   <PARAM>
1909     indent = INDENT ;
1910     id = ID;
1911     gentity = GENTITY  ;
1912     gposition = GPOSITION (QLEFT = LEFT,
1913                            QRIGHT = RIGHT) ;
1914     ghyperlink = GHYPERLINK  ;
1915     glinktype = GLINKTYPE (QJUMP = JUMP,
1916                            QJUMPNEWVIEW = JUMPNEWVIEW,
1917                            QDEFINITION = DEFINITION,
1918                            QEXECUTE = EXECUTE,
1919                            QAPPDEFINED = APPDEFINED,
1920                            QMAN = MAN) ;
1921     gdescription = GDESCRIPTION  ;
1922   <START-CODE>
1923     paragraph(indent,
1924               id,
1925               gentity,
1926               gposition,
1927               ghyperlink,
1928               glinktype,
1929               gdescription);
1930   <END-CODE>
1931     inSdlP = FALSE;
1932     fputs("\n</P>\n", outfile);
1933
1934 <ELEMENT PARM>
1935   <START-CODE>
1936     if (echo) {
1937       mb_echohead(m_stago) ;
1938       echohead(m_parent(0)) ;
1939       mb_echohead(m_net) ; /* '|' */
1940       }
1941   <END-CODE>
1942     if (echo) mb_echohead(m_net) ; /* '|' */
1943
1944   <START-CODE * IDX>
1945     /* We perhaps should allow <parm> to be used in <idx>.
1946        Since we are now dependent on LaserROM, we just can't
1947        add it in (as an inclusion exception to idx). 
1948        So, we take out the code that would inplement it and
1949        give an error message. */
1950
1951     M_WCHAR *wc_stago, *wc_tagc;
1952
1953     wc_stago = MakeWideCharString(m_stago);
1954     wc_tagc  = MakeWideCharString(m_tagc);
1955     m_err4("%sPARM%s not allowed in %sIDX%s.",
1956            wc_stago,
1957            wc_tagc,
1958            wc_stago,
1959            wc_tagc);
1960     m_free(wc_stago,"wide character string");
1961     m_free(wc_tagc,"wide character string");
1962   <END-CODE * IDX>
1963   <TEXT-CODE * IDX>
1964     indexchar(m_textchar) ;
1965   <START-CODE * CHAPHEAD>
1966     M_WCHAR *wc_stago, *wc_tagc;
1967
1968     wc_stago = MakeWideCharString(m_stago);
1969     wc_tagc  = MakeWideCharString(m_tagc);
1970     m_err2("%sPARM%s not allowed in headings.", wc_stago, wc_tagc);
1971     m_free(wc_stago,"wide character string");
1972     m_free(wc_tagc,"wide character string");
1973   <END-CODE * CHAPHEAD>
1974
1975   <END-CODE * EXAMPLESEG, * IMAGE>
1976     POPFONT ;
1977
1978 <ELEMENT PARTEXT>
1979   <START-CODE INDEXPRIMARY, INDEXSUB, * ABBREV>
1980   <START-CODE P>
1981     savid = NULL; /* in case there was no head */
1982     inParText++;
1983     if (tooutput)
1984         EmitSavedAnchors();
1985   <START-CODE>
1986     inParText++;
1987     if (tooutput)
1988         EmitSavedAnchors();
1989   <END-CODE INDEXPRIMARY, INDEXSUB, * ABBREV>
1990   <END-CODE>
1991     --inParText;
1992
1993 <ELEMENT PROCEDURE>
1994   <START-CODE>
1995     PushForm("TEXT", "PROCEDURE", NULL);
1996   <END-CODE>
1997     PopFormMaybe();
1998   
1999 <ELEMENT QUOTE>
2000   <START-CODE * ABBREV>
2001     mb_strcode("``", outfile) ;
2002     if (echo) putc('"', stderr) ;
2003   <START-CODE>
2004     mb_strcode("<KEY CLASS=\"QUOTE\" SSI=\"OPEN\"></KEY>", outfile) ;
2005     if (echo) putc('"', stderr) ;
2006   <END-CODE * ABBREV>
2007     mb_strcode("''", outfile) ;
2008     if (echo) putc('"', stderr) ;
2009   <END-CODE>
2010     mb_strcode("<KEY CLASS=\"QUOTE\" SSI=\"CLOSE\"></KEY>", outfile) ;
2011     if (echo) putc('"', stderr) ;
2012
2013   <START-CODE * IDX>
2014     indexchar('\"') ;
2015   <END-CODE * IDX>
2016     indexchar('\"') ;
2017   <TEXT-CODE * IDX>
2018     indexchar(m_textchar) ;
2019
2020 <ELEMENT REFERENCES>
2021
2022 <ELEMENT REQBLOCK>
2023   <START-CODE>
2024     synelcnt = 0;
2025     fputs("{", outfile);
2026   <END-CODE>
2027     fputs("}", outfile);
2028
2029 <ELEMENT RSECT>
2030   <PARAM>
2031     id = ID ;
2032     pagebreak = PAGEBREAK (QNEWPAGE = NEWPAGE,
2033                            QSAMEPAGE = SAMEPAGE) ;
2034     include = INCLUDE  ;
2035     exclude = EXCLUDE  ;
2036   <START-CODE>
2037     M_WCHAR *wc_rsect, *wc_helpvolume;
2038
2039     wc_rsect      = MakeWideCharString("RSECT");
2040     wc_helpvolume = MakeWideCharString("HELPVOLUME");
2041
2042
2043     assert_hometopic_exists();
2044     if (!rsectseq) thisnodelevel = thisnodelevel + 1;
2045     if (w_strcmp(m_parent(1), wc_helpvolume) != 0)
2046         {
2047         CloseVirpage();
2048         starthelpnode(wc_rsect, id, thisnodelevel);
2049         }
2050     else
2051         starthelpnode(wc_rsect, id, 2);
2052     m_free(wc_rsect, "wide character string");
2053     m_free(wc_helpvolume, "wide character string");
2054     rsectstart(id) ;
2055   <END-CODE>
2056     M_WCHAR *wc_helpvolume;
2057
2058     wc_helpvolume = MakeWideCharString("HELPVOLUME");
2059     if (w_strcmp(m_parent(1), wc_helpvolume) == 0)
2060         CloseVirpage();
2061     m_free(wc_helpvolume, "wide character string");
2062
2063 <ELEMENT RSUB>
2064   <PARAM>
2065     include = INCLUDE  ;
2066     exclude = EXCLUDE  ;
2067   <START-CODE>
2068     PushForm(NULL, NULL, NULL);
2069   <START-CODE * S2>
2070     PushForm(NULL, NULL, NULL);
2071   <END-CODE>
2072     PopFormMaybe();
2073
2074 <ELEMENT S1>
2075   <PARAM>
2076     id = ID ;
2077     include = INCLUDE  ;
2078     exclude = EXCLUDE  ;
2079   <START-CODE HELPVOLUME>
2080     M_WCHAR *wc_s1;
2081
2082     wc_s1 = MakeWideCharString("S1");
2083
2084     assert_hometopic_exists();
2085     thisnodelevel = 2;
2086     starthelpnode(wc_s1, id, thisnodelevel);
2087     m_free(wc_s1, "wide character string");
2088     rsectseq = FALSE ;
2089     chapst = TRUE ;
2090     savid = checkid(id) ;
2091     iderr = FALSE ;
2092   <START-CODE>
2093     M_WCHAR *wc_s1;
2094
2095     wc_s1 = MakeWideCharString("S1");
2096
2097     assert_hometopic_exists();
2098     thisnodelevel++;
2099     CloseVirpage();
2100     starthelpnode(wc_s1, id, thisnodelevel);
2101     m_free(wc_s1, "wide character string");
2102     rsectseq = FALSE ;
2103     chapst = TRUE ;
2104     savid = checkid(id) ;
2105     iderr = FALSE ;
2106   <END-CODE HELPVOLUME>
2107     CloseVirpage();
2108     rseqend() ;
2109     thisnodelevel = 0;
2110   <END-CODE>
2111     rseqend() ;
2112     --thisnodelevel;
2113
2114 <ELEMENT S2>
2115   <PARAM>
2116     id = ID ;
2117     include = INCLUDE  ;
2118     exclude = EXCLUDE  ;
2119   <START-CODE>
2120     M_WCHAR *wc_s2;
2121
2122     wc_s2 = MakeWideCharString("S2");
2123
2124     thisnodelevel++;
2125     CloseVirpage();
2126     starthelpnode(wc_s2, id, thisnodelevel);
2127     m_free(wc_s2, "wide character string");
2128     rsectseq = FALSE ;
2129     savid = checkid(id) ;
2130     iderr = FALSE ;
2131   <END-CODE>
2132     rseqend() ;
2133     --thisnodelevel;
2134
2135 <ELEMENT S3>
2136   <PARAM>
2137     id = ID ;
2138     include = INCLUDE  ;
2139     exclude = EXCLUDE  ;
2140   <START-CODE>
2141     M_WCHAR *wc_s3;
2142
2143     wc_s3 = MakeWideCharString("S3");
2144
2145     thisnodelevel++;
2146     CloseVirpage();
2147     starthelpnode(wc_s3, id, thisnodelevel);
2148     m_free(wc_s3, "wide character string");
2149     rsectseq = FALSE ;
2150     savid = checkid(id) ;
2151     iderr = FALSE ;
2152   <END-CODE>
2153     rseqend() ;
2154     --thisnodelevel;
2155
2156 <ELEMENT S4>
2157   <PARAM>
2158     id = ID ;
2159     include = INCLUDE  ;
2160     exclude = EXCLUDE  ;
2161   <START-CODE>
2162     M_WCHAR *wc_s4;
2163
2164     wc_s4 = MakeWideCharString("S4");
2165
2166     thisnodelevel++;
2167     CloseVirpage();
2168     starthelpnode(wc_s4, id, thisnodelevel);
2169     m_free(wc_s4, "wide character string");
2170     rsectseq = FALSE ;
2171     savid = checkid(id) ;
2172     iderr = FALSE ;
2173   <END-CODE>
2174     rseqend() ;
2175     --thisnodelevel;
2176
2177 <ELEMENT S5>
2178   <PARAM>
2179     id = ID ;
2180     include = INCLUDE  ;
2181     exclude = EXCLUDE  ;
2182   <START-CODE>
2183     M_WCHAR *wc_s5;
2184
2185     wc_s5 = MakeWideCharString("S5");
2186
2187     thisnodelevel++;
2188     CloseVirpage();
2189     starthelpnode(wc_s5, id, thisnodelevel);
2190     m_free(wc_s5, "wide character string");
2191     rsectseq = FALSE ;
2192     savid = checkid(id) ;
2193     iderr = FALSE ;
2194   <END-CODE>
2195     rseqend() ;
2196     --thisnodelevel;
2197
2198 <ELEMENT S6>
2199   <PARAM>
2200     id = ID ;
2201     include = INCLUDE  ;
2202     exclude = EXCLUDE  ;
2203   <START-CODE>
2204     M_WCHAR *wc_s6;
2205
2206     wc_s6 = MakeWideCharString("S6");
2207
2208     thisnodelevel++;
2209     CloseVirpage();
2210     starthelpnode(wc_s6, id, thisnodelevel);
2211     m_free(wc_s6, "wide character string");
2212     rsectseq = FALSE ;
2213     savid = checkid(id) ;
2214     iderr = FALSE ;
2215   <END-CODE>
2216     rseqend() ;
2217     --thisnodelevel;
2218
2219 <ELEMENT S7>
2220   <PARAM>
2221     id = ID ;
2222     include = INCLUDE  ;
2223     exclude = EXCLUDE  ;
2224   <START-CODE>
2225     M_WCHAR *wc_s7;
2226
2227     wc_s7 = MakeWideCharString("S7");
2228
2229     thisnodelevel++;
2230     CloseVirpage();
2231     starthelpnode(wc_s7, id, thisnodelevel);
2232     m_free(wc_s7, "wide character string");
2233     rsectseq = FALSE ;
2234     savid = checkid(id) ;
2235     iderr = FALSE ;
2236   <END-CODE>
2237     rseqend() ;
2238     --thisnodelevel;
2239
2240 <ELEMENT S8>
2241   <PARAM>
2242     id = ID ;
2243     include = INCLUDE  ;
2244     exclude = EXCLUDE  ;
2245   <START-CODE>
2246     M_WCHAR *wc_s8;
2247
2248     wc_s8 = MakeWideCharString("S8");
2249
2250     thisnodelevel++;
2251     CloseVirpage();
2252     starthelpnode(wc_s8, id, thisnodelevel);
2253     m_free(wc_s8, "wide character string");
2254     rsectseq = FALSE ;
2255     savid = checkid(id) ;
2256     iderr = FALSE ;
2257   <END-CODE>
2258     rseqend() ;
2259     --thisnodelevel;
2260
2261 <ELEMENT S9>
2262   <PARAM>
2263     id = ID ;
2264     include = INCLUDE  ;
2265     exclude = EXCLUDE  ;
2266   <START-CODE>
2267     M_WCHAR *wc_s9;
2268
2269     wc_s9 = MakeWideCharString("S9");
2270
2271     thisnodelevel++;
2272     CloseVirpage();
2273     starthelpnode(wc_s9, id, thisnodelevel);
2274     m_free(wc_s9, "wide character string");
2275     rsectseq = FALSE ;
2276     savid = checkid(id) ;
2277     iderr = FALSE ;
2278   <END-CODE>
2279     rseqend() ;
2280     --thisnodelevel;
2281
2282 <ELEMENT SORT>
2283   <START-CODE INDEXPRIMARY>
2284      didsort = TRUE;
2285      idxsav[idxsavlen] = M_EOS;
2286      w_strcpy(print, idxsav);
2287      idxsavlen = 0;
2288   <END-CODE INDEXPRIMARY>
2289      idxsav[idxsavlen] = M_EOS;
2290      w_strcpy(sort, idxsav);
2291   <START-CODE INDEXSUB>
2292      didsubsort = TRUE;
2293      idxsav[idxsavlen] = M_EOS;
2294      w_strcpy(subprint, idxsav);
2295      idxsavlen = 0;
2296   <END-CODE INDEXSUB>
2297      idxsav[idxsavlen] = M_EOS;
2298      w_strcpy(subsort, idxsav);
2299   <START-CODE>
2300   <END-CODE>
2301
2302 <ELEMENT SUB>
2303   <START-CODE * IDX>
2304   <START-CODE>
2305     mb_strcode("<KEY CLASS=\"UDEFKEY\" SSI=\"SUB\">", outfile);
2306     mb_strcode("<SPHRASE CLASS=\"SUB\">", outfile);
2307     if (echo) mb_echohead("__") ;
2308   <END-CODE * IDX>
2309   <END-CODE>
2310     mb_strcode("</SPHRASE></KEY>", outfile);
2311     if (echo) mb_echohead("__") ;
2312   <TEXT-CODE * COMPUTER>
2313      outchar(m_textchar, outfile) ;
2314   <TEXT-CODE * IDX>
2315     indexchar(m_textchar) ;
2316   <TEXT-CODE * IMAGE>
2317     outchar(m_textchar, outfile) ;
2318
2319 <ELEMENT SUPER>
2320   <START-CODE * IDX>
2321   <START-CODE>
2322     mb_strcode("<KEY CLASS=\"UDEFKEY\" SSI=\"SUPER\">", outfile);
2323     mb_strcode("<SPHRASE CLASS=\"SUPER\">", outfile);
2324     if (echo) mb_echohead("^^") ;
2325   <END-CODE * IDX>
2326   <END-CODE>
2327     mb_strcode("</SPHRASE></KEY>", outfile);
2328     if (echo) mb_echohead("^^") ;
2329   <TEXT-CODE * COMPUTER>
2330      outchar(m_textchar, outfile) ;
2331   <TEXT-CODE * IDX>
2332     indexchar(m_textchar) ;
2333   <TEXT-CODE * IMAGE>
2334      outchar(m_textchar, outfile) ;
2335
2336 <ELEMENT SYNEL>
2337   <START-CODE OPTBLOCK, REQBLOCK>
2338     if (synelcnt++) {
2339         fputs("\n", outfile);
2340     }
2341   <END-CODE OPTBLOCK, REQBLOCK>
2342   <END-CODE>
2343     fputs("\n", outfile);
2344   <TEXT-CODE>
2345      outchar(m_textchar, outfile) ;
2346
2347 <ELEMENT SYNTAX>
2348   <START-CODE>
2349     inSdlP = TRUE;
2350     if (!inBlock)
2351         StartBlock(NULL, NULL, NULL);
2352     fprintf(outfile, "<P TYPE=\"LITERAL\" SSI=\"SYNTAX\">");
2353   <END-CODE>
2354     inSdlP = FALSE;
2355     fputs("</P>\n", outfile);
2356   <TEXT-CODE>
2357     outchar(m_textchar, outfile) ;
2358
2359 <ELEMENT TERM>
2360   <PARAM>
2361     base = BASE ;
2362     gloss = GLOSS (QGLOSS = GLOSS,
2363                    QNOGLOSS = NOGLOSS) ;
2364   <START-CODE>
2365     termp = term ;
2366     wsterm = FALSE ;
2367     tooutput = FALSE;
2368     if (echo) mb_echohead("++") ;
2369   <END-CODE * GLOSSARY>
2370     endterm(base, gloss, "current"); /* don't use definition window for link */
2371   <END-CODE>
2372     endterm(base, gloss, "popup");   /* use definition window for link       */
2373   <TEXT-CODE>
2374     termchar(m_textchar) ;
2375   <PI-CODE>
2376     termpi(m_enttype, m_pi, m_entname) ;
2377      
2378 <ELEMENT TEST>
2379   <PARAM>
2380     id = ID ;
2381     include = INCLUDE  ;
2382     exclude = EXCLUDE  ;
2383   <START-CODE>
2384     M_WCHAR *wc_test;
2385
2386     wc_test = MakeWideCharString("TEST");
2387
2388     thisnodelevel++;
2389     starthelpnode(wc_test, id, thisnodelevel);
2390     m_free(wc_test, "wide character string");
2391     rsectseq = FALSE ;
2392     chapst = TRUE ;
2393     savid = checkid(id) ;
2394     iderr = FALSE ;
2395   <END-CODE>
2396     CloseVirpage();
2397     rseqend() ;
2398     --thisnodelevel;
2399
2400 <ELEMENT TEXT>
2401   <START-CODE NOTE>
2402     StartNCWtext("NOTE",
2403                  "NoteElementDefaultIconFile",
2404                  "NoteElementDefaultHeadingString");
2405   <START-CODE CAUTION>
2406     StartNCWtext("CAUTION",
2407                  "CautionElementDefaultIconFile",
2408                  "CautionElementDefaultHeadingString");
2409   <START-CODE WARNING>
2410     StartNCWtext("WARNING",
2411                  "WarningElementDefaultIconFile",
2412                  "WarningElementDefaultHeadingString");
2413   <START-CODE MESSAGE>
2414     PushForm(NULL, "MESSAGE", NULL);
2415     checkmsghead() ;
2416   <START-CODE MSGSUB>
2417     PushForm(NULL, "MSGSUB", NULL);
2418   <START-CODE ABSTRACT>
2419      if (needabstracthead)
2420          {
2421          fputs("<HEAD SSI=\"CHAPHEAD\">", outfile);
2422          chksnb();
2423          needabstracthead = FALSE;
2424          }
2425   <START-CODE DEFINITION>
2426     M_WCHAR *p ;
2427     char     id[SDLNAMESIZ+10];
2428
2429     sprintf(id, "%s%d", sdlReservedName, lastTermId);
2430     PushForm(NULL, NULL, id);
2431     StartBlock(NULL, "TERM", NULL);
2432     mb_strcode("<P SSI=\"P\">", outfile);
2433     strcode(term, outfile);
2434     mb_strcode("</P>\n", outfile);
2435     PushForm(NULL, "DEFINITION", NULL);
2436   <START-CODE>
2437   <END-CODE DEFINITION>
2438     PopForm(); PopForm();
2439   <END-CODE>
2440     if (formStackBase && (formStackTop >= formStackBase))
2441         {
2442         if (formStackTop->vecLen == 1)
2443             StartBlock(NULL, NULL, NULL);
2444         PopForm();
2445         }
2446     else if (inBlock)
2447         {
2448         fputs("</BLOCK>\n", outfile);
2449         inBlock = FALSE;
2450         }
2451
2452 <ELEMENT TITLE>
2453   <START-CODE>
2454     fputs("<HEAD TYPE=\"LINED\" SSI=\"TITLE\">", outfile);
2455     hadtitle = TRUE;
2456     newhline = 0 ;
2457     savhd = TRUE ;
2458     hderr = FALSE ;
2459     svheadlen = 0 ;
2460   <END-CODE>
2461     char *mb_savehead, *ssi;
2462     static char title_string[] = "-TITLE";
2463     char id[SDLNAMESIZ+sizeof(title_string)];
2464
2465     if (hderr)
2466         {
2467         m_error("Error collecting title characters.");
2468         }
2469     savhd = FALSE ;
2470
2471     fputs("</HEAD>\n", outfile);
2472
2473     sprintf(id, "%s%s", sdlReservedName, title_string);
2474     mb_starthelpnode("_TITLE", id, 0);
2475
2476     ssi = MakeMByteString(m_parent(1));
2477     fprintf(outfile, "<HEAD TYPE=\"LINED\" SSI=\"%s\">", ssi);
2478     savehead[svheadlen] = M_EOS ;
2479     mb_savehead = MakeMByteString(savehead);
2480     fputs(mb_savehead, outfile);
2481     m_free(mb_savehead,"multi-byte string");
2482     m_free(ssi,"multi-byte string");
2483     fputs("</HEAD>\n", outfile);
2484     CloseVirpage();
2485
2486     savedtitle = (M_WCHAR *) m_malloc(w_strlen(savehead) + 1, "saved title");
2487     w_strcpy(savedtitle, savehead);
2488
2489 <ELEMENT USER>
2490   <START-CODE>
2491     if (echo) {
2492       mb_echohead(m_stago) ;
2493       echohead(m_parent(0)) ;
2494       mb_echohead(m_net) ;
2495       }
2496     mb_strcode("<KEY CLASS=\"MACH-IN\">", outfile) ;
2497   <TEXT-CODE>
2498     esoutchar(m_textchar) ;
2499   <END-CODE>
2500     if (echo) mb_echohead(m_net) ;
2501     mb_strcode("</KEY>", outfile) ;
2502   <TEXT-CODE * EXAMPLESEG>
2503     exoutchar(m_textchar) ;
2504
2505   <START-CODE * IDX>
2506   <END-CODE * IDX>
2507   <TEXT-CODE * IDX>
2508     indexchar(m_textchar) ;
2509
2510 <ELEMENT VAR>
2511   <START-CODE>
2512     mb_strcode("<KEY CLASS=\"NAME\">", outfile) ;
2513     if (echo) mb_echohead("%%") ;
2514   <END-CODE>
2515     mb_strcode("</KEY>", outfile) ;
2516     if (echo) mb_echohead("%%") ;
2517
2518   <START-CODE * IDX>
2519   <END-CODE * IDX>
2520   <TEXT-CODE * IDX>
2521     indexchar(m_textchar) ;
2522
2523   <END-CODE * EXAMPLESEG, * IMAGE, * SYNEL>
2524     POPFONT ;
2525     mb_strcode("</KEY>", outfile) ;
2526
2527   /* added to fix calculator computer chars */
2528   <TEXT-CODE * SYNEL> 
2529     if (m_textchar == M_SPACE) fputs("\\ ", outfile) ;
2530     else outchar(m_textchar, outfile) ;
2531
2532 <ELEMENT VEX>
2533   <PARAM>
2534     type = TYPE (QCOMPUTER = COMPUTER,
2535                  QDISPLAY  = DISPLAY) ;
2536     position = POSITION (QLEFT = LEFT,
2537                          QINDENT = INDENT,
2538                          QCENTER = CENTER) ;
2539     textsize = TEXTSIZE (QNORMAL = NORMAL,
2540                          QSMALLER = SMALLER,
2541                          QSMALLEST = SMALLEST) ;
2542   <START-CODE>
2543     int   tsize;
2544     char *ssi;
2545
2546     inSdlP = TRUE;
2547     StartBlock(NULL, "EX", NULL);
2548     tsize = vextextsize(textsize);
2549     if (tsize == SMALLEST)
2550         ssi = "SMLST";
2551     else if (tsize == SMALLER)
2552         ssi = "SMLR";
2553     else
2554         ssi = "NML";
2555     fprintf(outfile, "<P TYPE=\"LITERAL\" SSI=\"EX-%s\">", ssi);
2556   <END-CODE>
2557     inSdlP = FALSE;
2558     fputs("</P>\n", outfile);
2559     fputs("</BLOCK>\n", outfile);
2560     inBlock = FALSE;
2561   <TEXT-CODE>
2562     vexoutchar(m_textchar) ;
2563
2564 <ELEMENT WARNING>
2565   <START-CODE>
2566     StartNCW("WARNING");
2567
2568 <ELEMENT XREF>
2569 /* Cross-referencing that allows forward references is inherently a two-pass
2570 process.  However, this interface assumes a two-pass process.  MARKUP
2571 provides the first pass and TeX the second.  MARKUP can therefore define
2572 a TeX macro for every cross-reference and write a file of definitions of
2573 these macros that is read at the beginning of the TeX pass.  In fact,
2574 information about cross-references is stored in a trie by MARKUP.  Data is
2575 entered into this structure both when a cross-reference is defined (with
2576 an id parameter on a chapter, figure, etc.) and when it is used (with the
2577 xref element).  At the end of the manual, the file xref.tex is written
2578 with definitions of macros corresponding to all cross-references defined
2579 or accessed.  In addition, the file xreftbl is written to save this
2580 information in a form that can be read to initialize the trie the next
2581 time the manual is processed.  Saving cross-reference information across
2582 runs of MARKUP allows a manual to be processed a chapter at a time without
2583 invalidating interchapter references.  The file xreftbl should be
2584 deleted before final processing, however, to verify that no cross-references
2585 remain to an id that existed at one time and was deleted.  Such an id could
2586 remain in the cross-reference table indefinitely.
2587 */
2588   <PARAM>
2589     id = ID ;
2590   <START-CODE * IDX>
2591   <TEXT-CODE * IDX>
2592     indexchar(m_textchar) ;
2593   <START-CODE>
2594     xrefexpand(id) ;