summaryrefslogtreecommitdiff
path: root/indexing/glo+idxtex/idxgen.c
blob: d80efd3d27c752afc6e99c4594740f7b891f9603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
/* #module    IdxGen    "3-001"
 ***********************************************************************
 *                                                                     *
 * The software was developed at the Monsanto Company and is provided  *
 * "as-is".  Monsanto Company and the auther disclaim all warranties   *
 * on the software, including without limitation, all implied warran-  *
 * ties of merchantabilitiy and fitness.                               *
 *                                                                     *
 * This software does not contain any technical data or information    *
 * that is proprietary in nature.  It may be copied, modified, and     *
 * distributed on a non-profit basis and with the inclusion of this    *
 * notice.                                                             *
 *                                                                     *
 ***********************************************************************
 */

/*
 * Module Name:	IdxGen
 *
 * Author:	R L Aurbach	CR&DS MIS Group    28-Apr-1986
 *
 * Function:
 *	Generate the text file used to actually generate the index text.
 *
 * Modification History:
 *
 * Version     Initials	   Date		Description
 * ------------------------------------------------------------------------
 * 1-001	RLA	28-Apr-1986	Original Code
 * 1-002	RLA	03-May-1986	Add support for page-no highlighting
 * 1-003	RLA	14-Jun-1986	Add support for the /TOC qualifier
 * 2-004	RLA	10-Apr-1987	Enhance the visual appearance of the
 *					  index and add support of a master 
 *					  index.
 * 2-005	RLA	11-Apr-1987	Fix spacing around each new group by
 *					  defining the \indexhead macro.
 * 2-006	RLA	14-Apr-1987	Support new page-no highlight option.
 * 2-007	RLA	16-Apr-1987	Add support for cross references.
 * 2-008	RLA	20-Apr-1987	Final formatting enhancements
 * 3-001	F.H.	17-May-1991	converted to portable C
 */

/*
 * Module IdxGen - Module-Wide Data Description Section
 *
 * Include Files:
 */
#ifdef MSDOS
#include <stdlib.h>
#include <io.h>
#define F_OK		0	/* access(): File exists */
#else
#include <sys/file.h>
extern char *sprintf();
#endif
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "IdxDef.h"
/*
 * Module Definitions:
 */
#define	    TRUE	1
#define	    FALSE	0
/*
 * Global Declarations:
 */
/*
 * Static Declarations:
 */
#ifdef MSDOS
void idx_generate(FILE *file, int toc_flag, int mst_flag);
void idx_preamble(FILE *file, int toc_flag, int mst_flag);
void idx_new_group(char *test_char, TREE_PTR node, FILE *file);
void idx_write(TREE_PTR node, char *intro_str, FILE *file, int mst_flag);
void idx_postamble(FILE *file);
#else
void idx_generate();
void idx_preamble();
void idx_new_group();
void idx_write();
void idx_postamble();
#endif
/*
 * External References:
 */
#ifdef MSDOS
extern void idx_build_range(TREE_PTR node);
#else
extern void idx_build_range();
#endif
extern TREE_PTR root;
/*
 * Functions Called:
 */
/*
 * Function Idx_Generate - Documentation Section
 *
 * Discussion:
 *	Generate the output file containing the appropriate LaTeX command lines
 *	to generate the index.
 *
 * Calling Synopsis:
 *	Call Idx_Generate (file, toc_flag, mst_flag)
 *
 * Inputs:
 *	file	    ->	is the file descriptor for the current output file.
 *			It is a pointer to FILE.
 *
 *	toc_flag    ->	is a flag indicating what kind of treatment should be
 *			applied to for table-of-contents processing.  It is an
 *			integer, passed by value.  Values are:
 *			    IDX_K_NONE	  - Do nothing.
 *			    IDX_K_ARTICLE - Add a section-oriented toc entry
 *			    IDX_K_REPORT  - Add a chapter-oriented toc entry
 *
 *	mst_flag    ->	is a flag which specifies whether a master index is
 *			being generated.  Volume labels are printed for the
 *			master index.
 *
 * Outputs:
 *	none
 *
 * Return Value:
 *	none
 *
 * Global Data:
 *	The Index Tree is used read-only.
 *
 * Files Used:
 *	The current output file is written.
 *
 * Assumed Entry State:
 *	The output file pointed to by the file variable is open.
 *
 * Normal Exit State:
 *	Output is written to the file.
 *
 * Error Conditions:
 *	Errors are ignored, in the sense that they don't generate output.
 *
 * Algorithm:
 *	A. Write pre-amble information.
 *	B. For each item in the primary list,
 *	    1. If the first letter of the entry changed,
 *		a. Output special formatting information.
 *	    2. Process the information for this item.
 *	    3. For each subitem,
 *		a. Process information for this subitem.
 *		b. For each subsubitem,
 *		    1. Process information for this subsubitem.
 *	C. Write post-amble information.
 *
 * Special Notes:
 *	none
 */
/*
 * Function Idx_Generate - Code Section
 */
void idx_generate (file, toc_flag, mst_flag)
     FILE   *file;
     int    toc_flag;
     int    mst_flag;
{
/*
 * Local Declarations
 */
  TREE_PTR  node_1;
  TREE_PTR  node_2;
  TREE_PTR  node_3;
  char	    first_letter;    
  int	    item_count = 0;
  int	    subitem_count = 0;
  int	    subsubitem_count = 0;
/*
 * Module Body
 */ 
/* Write the pre-amble.	*/
  idx_preamble(file, toc_flag, mst_flag);
  node_1 = root;
  first_letter = '+';
/* For each node of the primary tree, */
  while (node_1 != 0) {
    idx_new_group(&first_letter, node_1, file);
    idx_write (node_1, "\\item", file, mst_flag);
    item_count++;
    node_2 = node_1->subhead;
    while (node_2 != 0) {
      idx_write (node_2, "\\subitem", file, mst_flag);
      subitem_count++;
      node_3 = node_2->subhead;
      while (node_3 != 0) {
	idx_write (node_3, "\\subsubitem", file, mst_flag);
	subsubitem_count++;
	node_3 = node_3->link;
      }
      node_2 = node_2->link;
    }
    node_1 = node_1->link;
  }
/* Report the total counts of entries. */
  (void)printf("\nIndex processing statistics:\n");
  (void)printf("    Items:        %d\n",   item_count);
  (void)printf("    Subitems:     %d\n",   subitem_count);
  (void)printf("    Subsubitems:  %d\n\n", subsubitem_count); 
/* Write the post-amble	*/
  idx_postamble(file);
}

/*
 * Function Idx_PreAmble - Documentation Section
 *
 * Discussion:
 *	Write the pre-amble information to the output file.
 *
 * Calling Synopsis:
 *	Call Idx_PreAmble (file, toc_flag)
 *
 * Inputs:
 *	file	    ->	is the file descriptor for the output file.
 *
 *	toc_flag    ->	is a flag used to indicate what treatment should be
 *			performed for table-of-contents processing.  It is
 *			an integer passed by value.  Values are:
 *			    IDX_K_NONE     - Do nothing.
 *			    IDX_K_ARTICLE  - Add a section-oriented toc entry.
 *			    IDX_K_REPORT   - Add a chapter-oriented toc entry.
 *
 * Outputs:
 *	none
 *
 * Return Value:
 *	none
 *
 * Global Data:
 *	non
 *
 * Files Used:
 *	The file described by "file" is written.
 *
 * Assumed Entry State:
 *	none
 *
 * Normal Exit State:
 *	none
 *
 * Error Conditions:
 *	none
 *
 * Algorithm:
 *	A. Write pre-amble information.
 *
 * Special Notes:
 *	none
 */
/*
 * Function Idx_PreAmble - Code Section
 */
void idx_preamble (file, toc_flag, mst_flag)
     FILE   *file;
     int    toc_flag;
     int    mst_flag;
{
/*
 * Local Declarations
 */
/*
 * Module Body
 *
 * Define the \indexhead macro:
 *  \indexhead{BEFORESKIP}{AFTERSKIP}{HEADING} ==
 *	BEGIN
 *	    \par
 *	    IF @nobreak = TRUE
 *		THEN \everypar == null
 *		ELSE \addpenalty{\@secpanalty}
 *		     \addvspace{BEFORESKIP}	
 *	    FI
 *	    \begingroup
 *		\sl HEADING\par
 *	    \endgroup
 *	    \@xsect{AFTERSKIP}
 *	END
 */
  if (mst_flag)
    {
      (void)fprintf(file,"\\def\\indexname{\\masterindexname}\n");
	}
  (void)fprintf (file, "\\makeatletter\n");
  (void)fprintf (file, "\\def\\indexhead#1#2#3{\\par\\if@nobreak \\everypar{}\\else\n");
  (void)fprintf (file, "  \\addpenalty{\\@secpenalty}\\addvspace{#1}\\fi\n");
  (void)fprintf (file, "  \\begingroup \\large\\bf \\hfil #3 \\hfil\\par \\endgroup\n");
  (void)fprintf (file, "  \\@xsect{#2}}\n");
  (void)fprintf (file, "\\makeatother\n");
/*
 * Define the \indexindent macro:
 *  \indexindent == 
 *	\par \hangindent 50pt \hspace*{40pt}
 */
  (void)fprintf (file, "\\def\\indexindent{\\par\\hangindent 50pt\\hspace*{40pt}}\n");
/* Start the index */
  (void)fprintf (file, "\\begin{theindex} \\raggedright\n");
  if (toc_flag == IDX_K_NONE) 
    {
      if (mst_flag)
	{
	(void)fprintf(file, "\\typeout{Master Index.}\n");
         return;
      }
        return;
    }
  if (toc_flag == IDX_K_ARTICLE)
    {
      if (mst_flag)
	{
	  (void)fprintf (file,"\\addcontentsline{toc}{section}{\\masterindexname}\\typeout{Master Index.}\n");
	}
    else
      {    
(void)fprintf (file,"\\addcontentsline{toc}{section}{\\indexname}\\typeout{Index.}\n");
    }
 }
  if (toc_flag == IDX_K_REPORT)
    {
      if (mst_flag)
       (void)fprintf (file,"\\addcontentsline{toc}{chapter}{\\masterindexname}\\typeout{Index.}\n");
    else
    (void)fprintf (file,"\\addcontentsline{toc}{chapter}{\\indexname}\\typeout{Index.}\n");
    }
  (void)printf("\nA Table of Contents entry will be made for the Index.\n");
}

/*
 * Function Idx_New_Group - Documentation Section
 *
 * Discussion:
 *	Handle special processing at the boundaries between index entries 
 *	which begin with different letters.
 *
 * Calling Synopsis:
 *	Call Idx_New_Group (test_char, node, file)
 *
 * Inputs:
 *	test_char	    ->	is the character which is the first character
 *				of the current group. Passed by reference.
 *
 *	node		    ->	is the TREE_PTR for the current node.
 *
 *	file		    ->	is a file pointer for the output file.
 *
 * Outputs:
 *	test_char	    ->	if a new group is declared, the test character
 *				is updated.
 *
 * Return Value:
 *	none
 *
 * Global Data:
 *	The Index Tree is read.
 *
 * Files Used:
 *	If a new group is declared, records are written to the output file.
 *
 * Assumed Entry State:
 *	none
 *
 * Normal Exit State:
 *	none
 *
 * Error Conditions:
 *	none
 *
 * Algorithm:
 *	A. Current_Char is the first character of the Spell String of the
 *	   current node, or a space if the first character is not a letter.
 *	B. If Current_Char != Test_Char,
 *	    1. Generate commands.
 *	    2. Test_Char = Current_Char.
 *
 * Special Notes:
 *	none
 */
/*
 * Function Idx_New_Group - Code Section
 */
void idx_new_group (test_char, node, file)
     char    	*test_char;
     TREE_PTR	node;
     FILE    	*file;
{
/*
 * Local Declarations
 */ 
  char    current_char = ' ';
/*
 * Module Body
 */
  if ((strlen(node->spell)) > 0)
    current_char = node->spell[0];
  if (isalpha(current_char) == 0) current_char = ' ';
  if ((current_char > 'a') && (current_char < 'z'))
    current_char -= 32;
  if (*test_char != current_char) {
    if (current_char == ' ')
      (void)fprintf (file,
		     "\\indexhead{2em}{1em}{--- \\symbolsname ---}\n");
    else
      (void)fprintf (file, "\\indexhead{2em}{1em}{--- %c ---}\n",
		     current_char);
    *test_char = current_char;
  }
}

/*
 * Function Idx_Write - Documentation Section
 *
 * Discussion:
 *	Write the basic text line for the current entry.
 *
 * Calling Synopsis:
 *	Call Idx_Write (node, intro_str, file, mst_flag)
 *
 * Inputs:
 *	node	    ->	TREE_PTR of the node whose data is to be reported.
 *
 *	intro_str   ->	introductory character string, ASCIZ passed by ref.
 *
 *	file	    ->	file pointer for output file.
 *
 *	mst_flag    ->	flag indicates if a master index is being generated.
 *
 * Outputs:
 *	none
 *
 * Return Value:
 *	none
 *
 * Global Data:
 *	none
 *
 * Files Used:
 *	The output file is written.
 *
 * Assumed Entry State:
 *	none
 *
 * Normal Exit State:
 *	none
 *
 * Error Conditions:
 *	none
 *
 * Algorithm:
 *	A. Print the first part of the string, containing the item.
 *	B. If there is at least one page number specified,
 *	    1. Print the first page number (which is formatted specially).
 *	    2. For all remaining page numbers,
 *		a. Print them.
 *	C. If there is at least one cross reference specified,
 *	    1. Print the "see" or "see also" line.
 *	    2. For all cross references,
 *		a. Print them.
 *	D. Print the record trailer. 
 *
 * Special Notes:
 *	When printing page numbers, allow for page-no highlighting.  The
 *	highlight code is specified in the pgnode list element.  Recognized
 *	values are:
 *	    IDX_K_NONE	    - No highlighting
 *	    IDX_K_UNDERLINE - Underline the page number
 *	    IDX_K_ITALIC    - Italicize the page number
 *	    IDX_K_BOLD	    - Boldface the page number
 *	    IDX_K_FOLLOW    - ff follows the page number
 */
/*
 * Function Idx_Write - Code Section
 */
void idx_write (node, intro_str, file, mst_flag)
     TREE_PTR   node;
     char       *intro_str;
     FILE       *file;
     int	mst_flag;
{
/*
 * Local Declarations
 */
  char		string[256];
  int		length;
  PGNODE_PTR	pgnode;
  int		highlight;
  char          *old_vol;
/*
 * Module Body
 */
  length = strlen(intro_str) + strlen(node->item) + 1;
  (void)sprintf(string,"%s{%s",intro_str,node->item);
  if (node->pghead != 0) {
    idx_build_range(node);
    pgnode = node->pghead;
    if (mst_flag) {
      (void)sprintf(&string[length], 
		    "}\\indexindent{$\\bullet$ {\\sl %s}, ",
		    pgnode->vol);
      length += strlen(pgnode->vol)
	+ strlen("}\\indexindent{$\\bullet$ {\\sl }, ");
      old_vol = pgnode->vol;
    }
    else {
      (void)sprintf (&string[length], ", ");
      length += 2;
    }
    highlight = pgnode->highlight;
    switch (highlight) {
    case IDX_K_UNDERLINE :
      (void)sprintf (&string[length], 
		     "\\mbox{\\rm\\underline{%s}}",
		     pgnode->page_dsc);
      length += strlen(pgnode->page_dsc)
	+ strlen("\\mbox{\\rm\\underline{}}");
      break;
    case IDX_K_ITALIC :
      (void)sprintf (&string[length], "\\mbox{\\em %s}", 
		     pgnode->page_dsc);
      length += strlen(pgnode->page_dsc)
	+ strlen("\\mbox{\\em }");
      break;
    case IDX_K_BOLD :
      (void)sprintf (&string[length], "\\mbox{\\bf %s}", 
		     pgnode->page_dsc);
      length += strlen(pgnode->page_dsc)
	+ strlen("\\mbox{\\bf }");
      break;
    case IDX_K_FOLLOW :
      (void)sprintf (&string[length], "\\mbox{\\rm %s\\sf ff}",
		     pgnode->page_dsc);
      length += strlen(pgnode->page_dsc)
	+ strlen("\\mbox{\\rm \\sf ff}");
      break;
    default :
      (void)sprintf (&string[length], "\\mbox{\\rm %s}", 
		     pgnode->page_dsc);
      length += strlen(pgnode->page_dsc)
	+ strlen("\\mbox{\\rm }");
      break;
    }
    while ((pgnode = pgnode->link) != 0) {
      if (length > 62) {
	(void)fprintf (file, "%s%%\n", string);
	length = 0;
      }
      if (mst_flag) {
	if ((strcmp(old_vol,pgnode->vol)) != 0) {
	  (void)sprintf (&string[length], 
			 "}\\indexindent{$\\bullet$ {\\sl %s} ",
			 pgnode->vol);
	  length += strlen(pgnode->vol)
	    + strlen("}\\indexindent{$\\bullet$ {\\sl } ");
	  old_vol = pgnode->vol;
	}	
	else {
	  (void)sprintf (&string[length], ", ");
	  length += 2;
	}
      }
      else {
	(void)sprintf (&string[length], ", ");
	length += 2;
      }
      highlight = pgnode->highlight;
      switch (highlight) {
      case IDX_K_UNDERLINE :
	(void)sprintf (&string[length], 
		       "\\mbox{\\rm\\underline{%s}}", 
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("\\mbox{\\rm\\underline{}}");
	break;
      case IDX_K_ITALIC :
	(void)sprintf (&string[length], "\\mbox{\\em %s}", 
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("\\mbox{\\em ");
	break;
      case IDX_K_BOLD :
	(void)sprintf(&string[length], "\\mbox{\\bf %s}", 
		      pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("\\mbox{\\bf ");
	break;
      case IDX_K_FOLLOW :
	(void)sprintf(&string[length],
		       "\\mbox{\\rm %s\\sf ff}",
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("\\mbox{\\rm \\sf ff}");
	break;
      default :
	(void)sprintf (&string[length], "\\mbox{\\rm %s}", 
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("\\mbox{\\rm }");
	break;
      }
    }
  }
  if (node->seehead != 0) {
    pgnode = node->seehead;
    if (mst_flag) {
      if (node->pghead == 0)
	(void)fprintf (file, "%s}\n\\indexindent{\\em \\seename", string);
      else
	(void)fprintf (file, "%s}\n\\indexindent{\\em \\alsoname",
		       string);
    }
    else {
      if (node->pghead == 0)
	(void)fprintf (file, "%s, {\\em \\seename}\n", string);
      else
	(void)fprintf (file, "%s; {\\em \\alsoname}\n", string);
    }
    length = 0;
    while (pgnode != 0)	{
      if (length > 62) {
	(void)fprintf (file, "%s%%\n", string);
	length = 0;
      }
      highlight = pgnode->highlight;
      switch(highlight) {
      case IDX_K_UNDERLINE :
	(void)sprintf (&string[length],
		       "}\\indexindent{\\ $\\bullet$ \\rm\\underline{%s}",
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("}\\indexindent{\\ $\\bullet$ \\rm\\underline{}");
	break;
      case IDX_K_ITALIC :
	(void)sprintf (&string[length],
		       "}\\indexindent{\\ $\\bullet$ {\\em %s}",
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("}\\indexindent{\\ $\\bullet$ {\\em }");
	break;
      case IDX_K_BOLD :
	(void)sprintf (&string[length],
		       "}\\indexindent{\\ $\\bullet$ {\\bf %s}",
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("}\\indexindent{\\ $\\bullet$ {\\bf }");
	break;
      default :
	(void)sprintf (&string[length], 
		       "}\\indexindent{\\ $\\bullet$ {\\rm %s}",
		       pgnode->page_dsc);
	length += strlen(pgnode->page_dsc)
	  + strlen("}\\indexindent{\\ $\\bullet$ {\\rm }");
	break;
      }
      pgnode=pgnode->link;
    }
  }
  (void)fprintf (file, "%s}\n", string);
}

/*
 * Function Idx_PostAmble - Documentation Sectionm
 *
 * Discussion:
 *	Write the lines which occur at the end of the file.
 *
 * Calling Synopsis:
 *	Call Idx_PostAmble (file);
 *
 * Inputs:
 *	file	    ->	is the file pointer for the output file.*
 *
 * Outputs:r
 *	none 
 *
 * Return Value:
 *	none
 *
 * Global Data:
 *	none
 *
 * Files Used:
 *	Output file is written.
 *
 * Assumed Entry State: 
 *	none 
 *
 * Normal Exit State: 
 *	none 
 *
 * Error Conditions:
 *	none 
 *
 * Algorithm: 
 *	A. Write the end-matter.
 *
 * Special Notes:
 *	none
 */
/*
 * Function Idx_PostAmble - Code Section
 */
void idx_postamble (file)
     FILE *file;
{
/*
 * Local Declarationst
 */
/*
 * Module Body
 */
  (void)fprintf (file, "\\end{theindex}\n");
}