1 /****h* Autodoc/ROBODoc [3.2]
3 * ROBODoc -- AutoDoc formatter
5 * Copyright (C) 1994-2000 Frans Slothouber and Jacco van Weert.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * ROBODoc is intended to be a replacement for the original AutoDocs
23 * program. ROBODoc will extract the procedure comment headers
24 * from a source file, and put them into a separate documentation file.
25 * There are five different file output formats:
27 * HTML (HyperText Markup Langauge) -- mainly used on the Internet;
28 * thus the files can be viewed with a normal HTML viewer/browser
29 * AmigaGuide -- this format can be viewed by AmigaGuide (Amiga only)
30 * LaTeX - as input to LaTeX to produce .dvi files
31 * RTF (Rich Text Format) -- as input to the Help compiler (Windows only)
32 * For further information read the documentation in the archive.
34 * Frans Slothouber: <fslothouber@acm.org>.
35 * Source code and additional extensions from version 2.0 and up.
37 * Petteri Kettunen: <petterik@iki.fi>
38 * Bug fixes, FOLD, C features.
40 * Jacco van Weert: <weertj@xs4all.nl>
41 * Original idea and program.
43 * Bernd Koesling: <KOESSI@CHESSY.aworld.de>
44 * Bug fixes, functional improvements, code cleanup.
46 * Anthon Pang: <apang@mindlink.net>
47 * RTF support, Bug fixes.
49 * Thomas Aglassinger: <agi@sbox.tu-graz.ac.at>
50 * Fixes and cleanup of HTML-output
54 * MODIFICATION HISTORY
55 * Modifications by Jacco van Weert.
56 * 19-Jan-95 - v0.8: First test beta-version
57 * 26-Jan-95 - v0.92: 2nd test beta-version
58 * 2-Feb-95 - v0.93: Mungwall hit, solved.
59 * When item headers, are also available
60 * in body then parts are duplicated solved.
61 * Mar-95 - v1.0a: Final version
62 * 2-Apr-95 - v1.0b: Bug fixes
63 * Procedure header search bug solved.
64 * Print 'created procedure' text
65 * 20-Apr-95 - v1.1a: INTERNALONLY option added.
66 * Sort problem solved.
67 * Modifications by FNC Slothouber.
68 * 10-May-1995 - v2.0a * Program completely rewritten
69 * * added SOURCE item and LaTeX output.
70 * * added TAB converter.
71 * 11-May-1995 - v2.0b * Accepts headers that start with
72 * any sequence of non-spaces.
73 * RoboDoc should work with any
74 * type of programming language now.
75 * 12-May-1995 - v2.0c * Bug fixes.
76 * 15-May-1995 - v2.0d * New Defaults file.
77 * * Added Verbose option.
78 * 24-May-1995 - v2.0e * Fixed a bug that cause the
79 * CleanUp Routine to lock up.
80 * * Improved the HTML output,
81 * should work faster now.
82 * Modifications by Koessi
83 * 01-Aug-1995 - v2.0? * more robust parsing, less enforcer-hits
84 * * removed self-referencing links !
85 * * remarked most changes with *koessi*
86 * * added GoldEd-foldmarks
87 * * compiled successfully with SAS-C 6.3
88 * 07-Aug-1995 - * automated foldmarks "\***"
89 * ! GoldEd's foldmarks == RoboDoc marker !
90 * * quoted source parsing enhanced
91 * 08-Aug-1995 - * a lot of while instead of for
92 * * a lot of switch() instead of ifelse
94 * * RB_Say, RB_Panic now useable like printf()
95 * new formats for nearly all output-strings
96 * * char *whoami is global copy of argv[0]
97 * * BOLD <- MAKE_LARGE && AMIGAGUIDE
98 * * succesfully compiled&tested on HPUX
100 * * optimized listfunctions
101 * * encapsulated header- and link-
102 * allocating and freeing
103 * * RB_Find_Function_Name() replaced
105 * Modifications by FNC Slothouber.
107 * o New scanner that searches for a set default markers
108 * that define what is a comment or what is not and that
109 * define what or what is not a header/end marker.
110 * o Added Beast Support
111 * 27-Aug-1995 - v3.0b
112 * o Fixed a bug with the defaults file
113 * o Improved search algorithm RoboDoc is now 5.8 times faster.
114 * 06-Sep-1995 - v3.0c
116 * 08-Oct-1995 - v3.0d
118 * 04-Feb-1996 - v3.0e
119 * o fixed the problem with the TOC that included links to headers that
120 * were not selected. (i.e internal)
121 * Modifications by apang
122 * 08-Mar-1996 - v3.0f
123 * o Cleaner build for Borland C++ 4.52
124 * o Added more markers (C++, Pascal, Modula-2, COBOL)
125 * o Added more item types/names
126 * o Added #defines for the preamble (COMMENT_ROBODOC and
128 * o BLANK_HEADER for detection of asterisk'd lines
129 * o RB_Say() the GENERIC header warning instead of using printf()
130 * o Indents SOURCE body in output
131 * o ASCII respects the TOC flag; removed extraneous newline after
132 * formfeed (so it's more like AutoDoc)
133 * o HTML output fixed to handle '<', '>', and '&'
134 * o LaTeX attributes and '%' handling added; fancied up the output a bit
135 * o RTF support added
136 * o Changed some fprintf()'s to fputc()'s for potentially lower overhead
137 * o Fixed line eater bug
138 * o More general fix to the TOC problem of including internal links
139 * when it wasn't selected
140 * Modifications by FNC Slothouber.
141 * 01-April-1996 - v3.0h
142 * o Added ';' to > and < so lynx also recognizes them.
143 * o Fancied up the HTML output.
144 * 10-July-1996 - v3.0i
145 * o Bug Fix, Both the options INTERNAL and INTERNALONLY did not
147 * Modifications by agi
148 * 15-Dec-1997 - v3.0j
149 * o cleaned the HTML-output, so it now conforms to the DTD for HTML-3.2
150 * o TOC now is an ordered list (<OL> and <LI>)
151 * o added "<!DOCTYPE..>"
152 * o added quotes to values of some HTML-attributes
153 * o more compatible implementation of the SGML-comment containing
154 * copyright-info replaced all occurrences of <B><PRE>.. by <PRE><B>
155 * o replaced <H2/3> by <H1/2>
156 * o fixed two minor warnings reported by gcc -Wall
157 * Modifications by FNC Slothouber.
158 * 14-Aug-1998 - v3.0k * Tcl/Tk '#' handling added;
159 * Feb-1999 - v3.0l * Added function to reverse the header list.
160 * Modifications by Petteri Kettunen
162 * o Changed background color to white
163 * o Changed size of Table of Contents title. (H3 instead of H1)
164 * o The reverse function also reversed the sorted header list,
166 * Modifications by Petteri Kettunen
167 * August 1999 - v3.0m+
168 * o Support for folding in SOURCE items, HTML only.
170 * o Added options FOLD and C
171 * Modifications by FNC Slothouber.
173 * o More documentation and a more informative usage() function.
175 * o robodoc -c prints licence
176 * o removed a number of Source items from the documentation to reduce
177 * the size of the robodoc.c.html file... no fun for people
178 * to download a >100k file.
179 * o removed the warning about not using a robodoc default file.
180 * o indent -orig -i2 -nbc -ncdb -bad -bap
181 * o Fixed the warnings.
182 * o Fixed some occurrences of (evil cast)malloc (thou shalt not
184 * o ROBODoc now returns EXIT_FAILURE or EXIT_SUCCESS, as defined
186 * o Fixed a memory leak in RB_Analyse_Document()
188 * o <A NAME="source code file name"> is generated at the beginning of
189 * each document. A mention of the source code name in another
190 * document creates a link to this name (provided you use xrefs).
191 * o Moved most #defines and enums to robodoc.h
192 * o Made ROBODoc more forgiving in reading the xrefs file. Empty
193 * lines are allowed and also spaces at the end of a file name.
194 * Nov 1999 - v3.1c -- From patches that I received from Stefan Kost
195 * o renamed BEAST METHODS -> METHODS
196 * o renamed BEAST ATTRIBUTES -> ATTRIBUTES
197 * o added new items useful for object oriented programming; some of
198 * these items are already used in os3.1 autodocs
199 * TAGS, COMMANDS, DERIVED FROM, DERIVED BY, USES,
200 * CHILDREN, USED BY, PARENTS, USAGE, PURPOSE
201 * o commented the item names
202 * o changed item-type enums to end all with _ITEM
203 * o changed RB_Find_Link to accept names ending with '...'
204 * o changed copyright comment to be a style-guide conform version string.
205 * o changed RB_VER[] to be a style-guide conform version string
206 * o changed AMIGA into _AMIGA, because the first one does not exists,
207 * when compiling with NOANSI on SAS C/C++
209 * o added new header types for, classes, methods, variables,
210 * functions, strutures and constants. (Idea of Stefan Kost)
211 * o added a command to create a master index file that contains
212 * sorted pointers to all classes, methods, variables,
213 * functions, strutures and constants.
215 * o added markers for HTML.
216 * o modified the RB_Find_Link() function to also words that include
217 * "::". This is used for C++ methods.
218 * o added a RB_Function_Name() function that correctly extracts the
219 * function name (or the name of any other object that is documented)
220 * from the header name. The old code used RB_FilePart which failed
221 * on C++ method names.
222 * o Fixed a core-dumping bug in RB_Set_Doc_Base()
224 * o added RB_TimeStamp() to include time stamps in the documentation.
225 * o Documentation is now generated in LaTeX2e format.
226 * o added '|****' as begin marker, '|' as remark marker and '|***' as
227 * end marker for GNU assembler support.
228 * o ran ident on all source. Using the GNU standard now.
229 * o Added new fold markers provided by Petteri
231 * o Using automake and autoconf.
232 * o Added fixes to folding code Petteri.
233 * o Added markers for FORTAN 90
235 * o Added patch from Simo Muinonen: This solved the following
237 * When e.g. a field of a structured C variable (with an
238 * underscore in its name) is referred to using the
239 * point notation (e.g. "g_Status.tpstat"), the variable
240 * name is not recognized as a separate keyword. This
241 * can also happen when a keyword is in a comment at the
242 * end of a sentence with an immediately following ".".
243 * o Fixed the "stuctures" type in the master index file.
244 * o Added mailto: support provided by Guillaume Etorre.
246 * o Added option SINGLEDOC
247 * For LaTeX output this generates documentation without
248 * the start and end headers. This way the generated file
249 * can be included in a master file.
250 * o Added master index file for LaTeX output. The documentation
251 * gathered from several source files can now be included into
253 * o Added the option NOSOURCE. With this option the SOURCE item
254 * is not included in the documentation.
255 * o Added the TITLE option. This allows to set the title for
256 * the master index file.
257 * o Made the search for headermarkers case insensitve.
260 * o Fixed a bug that caused links of the type
261 * "someword/anotherword," to be ignored, while
262 * "someword/anotherword" was recognized.
264 * o Labels with identical names are now numbered.
266 * o The source file is opened "rb" this I hope will
267 * make it possible to use Robodoc under windows.
268 * (Thanks to Carlo Caminati)
271 * Has been succesfully compiled:
272 * On an Amiga with SAS/C, DICE C and gcc (Amiga 1200)
273 * On a Sun Sparc Station with gcc (under SunOS 4.1)
274 * On a Dec Alpha Station
275 * Under HP/UX on a HP9000/800
277 * On a Linux box with gcc, Slackware, Redhat, and Debian 2.1.
279 * - HTML output is not Lynx friendly -- attributes are applied
280 * to leading white space =P ... solution: fix Lynx >=)
281 * - Can't get the escape character for @ to work in
283 * - Horrible use of feof() and fgets()
285 * Catch them in a jar and send them to fslothouber@acm.org
286 * Latest version can be found on
287 * http://robodoc.sourceforge.net
288 * http://www.xs4all.nl/~rfsber/Robo/
289 * http://freshmeat.net/
303 #include "analyser.h"
304 #include "generator.h"
307 char RB_VER[] = "\0$VER: robodoc " VERSION " " __AMIGADATE__ " (c) by Maverick Software Development 1994-2001";
309 char RB_VER[] = "$VER: robodoc " VERSION " (" __DATE__ ") (c) by Maverick Software Development 1994-2001";
313 /****v* ROBODoc/source
315 * source -- source code file.
317 * Pointer to the file with source code.
319 * This is a global. It is however only used by main() and
320 * RB_Close_The_Shop(). All other functions are passed a copy.
322 * It is a global so that the file can be closed by
323 * RB_Close_The_Shop() when the program exits (normally or
330 /****v* ROBODoc/documentation
332 * documentation -- documentation file.
334 * Pointer to the file that will contain the documentation extracted
335 * from the source code.
337 * This is a global. It is however only used by main() and
338 * RB_Close_The_Shop(). All other functions are passed a copy.
340 * It is a global so that the file can be closed by
341 * RB_Close_The_Shop() when the program exits (normally or
346 FILE *documentation = NULL;
349 /****v* ROBODoc/document_title
351 * documentat_title -- title for the documentation.
353 * Used as the title for master index files or for latex documentation.
357 char *document_title = NULL;
359 /****v* ROBODoc/output_mode [2.0]
361 * output_mode -- the mode of output
363 * Controls which type of output will be generated.
367 int output_mode = ASCII;
372 /****v* ROBODoc/course_of_action [2.0]
376 * Global Variable that defines the course of action.
380 int course_of_action = DO_MAKE_DOCUMENT;
385 /****v* ROBODoc/line_buffer [2.0]
387 * line_buffer -- global line buffer
389 * Temporary storage area for lines
390 * that are read from an input file.
394 char line_buffer[MAX_LINE_LEN];
399 /****v* ROBODoc/line_number [2.0]
401 * line_number -- global line counter
403 * Keeps track of the number of lines that are read from the source file.
414 /****v* ROBODoc/use [3.0h]
416 * use -- usage string
418 * Inform the user how to use ROBODoc.
425 "ROBODoc Version " VERSION ", autodocs formatter ($Revision$)\n"
426 "(c) 1994-2001 Frans Slothouber and Jacco van Weert\n"
427 "robodoc comes with ABSOLUTELY NO WARRANTY.\n"
428 "This is free software, and you are welcome to redistribute it\n"
429 "under certain conditions; type `robodoc -c' for details.\n"
432 " robodoc <source file> <documentation file> [options]\n"
434 " robodoc <xrefs file> <master index file> INDEX [options]\n"
436 "You can use one or more of the following options:\n"
437 " GENXREF <xref file> - to generate an xref file.\n"
438 " XREF <xrefs file> - if you want to use xref files to create\n"
440 " INDEX - create a master index file.\n"
441 " TABSIZE <nr_sp> - convert each TAB to nr_sp of spaces.\n"
442 " TOC - a table of contents will be generated.\n"
443 " SORT - the headers will be sorted.\n"
444 " -v - tell robodoc to tell you all about it.\n"
445 " INTERNAL - headers marked internal will also be included.\n"
446 " INTERNALONLY - only headers marked internal will be included.\n"
447 " FOLD - enable folding if HTML output is selected.\n"
448 " C - Use ANSI C grammar in source items (test, HTML only).\n"
449 "The type of output is selected with one of the following switches:\n"
450 " ASCII, GUIDE, HTML, LATEX, or RTF\n"
451 "If no type is specified ASCII is used.\n"
452 "The following abbreviations are also allowed:\n"
453 " TOC = -t XREF = -x SORT = -s INTERNAL = -i \n"
454 " GENXREF = -g INTERNALONLY = -io TABSIZE = -ts\n"
456 " robodoc simulator.c simulator.html HTML -v TOC SORT\n"
457 "Authors/Contributors: Frans Slothouber <fslothouber@acm.org>,"
458 " Jacco van Weert,\n"
459 " Petteri Kettunen, Bernd Koesling, Thomas Aglassinger, Anthon Pang, and\n"
461 "For more information, and the lastest version:\n"
462 " http://www.xs4all.nl/~rfsber/Robo/index.html\n"
463 " Send bug reports to <fslothouber@acm.org>.\n";
468 /****v* ROBODoc/copying [3.1]
470 * copying -- licence information
472 * inform the user how to copy me
480 " Distributed under the GNU GENERAL PUBLIC LICENSE\n"
481 " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"
482 " See the source archive for a copy of the complete licence\n"
483 " If you do not have it you can get it from\n"
484 " http://freshmeat.net/appindex/1999/08/30/936003795.html\n";
487 /* Global variables */
489 char *whoami = NULL; /* me,myself&i */
491 char doc_base[1024]; /* PetteriK */
494 /****f* ROBODoc/RB_Set_Doc_Base
496 * RB_Set_Doc_Base -- get file name without extension.
501 RB_Set_Doc_Base (char *path)
505 while (path[ptr] != '\0')
507 if (path[ptr] == '.')
515 strncpy (doc_base, path, n);
519 strcpy (doc_base, path);
521 RB_Say ("doc_base is \"%s\"\n", doc_base);
527 /****f* ROBODoc/main [2.0d]
529 * main -- Entry point of ROBODoc
531 * main (int argc, char **argv)
533 * Get and parse the arguments.
534 * Analyse document and generate the documentation.
539 main (int argc, char **argv)
541 char *file_with_xrefs, *output_file_for_xrefs;
543 whoami = argv[0]; /* global me,myself&i */
550 if (strcmp (argv[1], "-c") == 0)
552 printf ("%s", copying);
561 RB_Analyse_Arguments (argc, argv, &file_with_xrefs,
562 &output_file_for_xrefs);
564 RB_Say ("Analysing Defaults File\n");
565 RB_Analyse_Defaults_File ();
567 RB_Say ("trying to open source file \"%s\"\n", argv[1]);
568 if ((source = fopen (argv[1], "rb")) != NULL)
570 if (!(course_of_action & DO_INDEX))
572 RB_Say ("analysing source file \"%s\"\n", argv[1]);
573 RB_Analyse_Document (source);
574 RB_Number_Duplicate_Headers();
576 if (course_of_action & DO_SORT)
578 RB_Say ("sorting headers\n");
585 if ((course_of_action & DO_USE_XREFS) && file_with_xrefs)
587 if ((xreffiles_file = fopen (file_with_xrefs, "r")) != NULL)
589 RB_Analyse_Xrefs (xreffiles_file);
593 RB_Panic ("can't open file with xref files \"%s\"\n",
600 if ((xreffiles_file = fopen (argv[1], "r")) != NULL)
602 RB_Analyse_Xrefs (xreffiles_file);
606 RB_Panic ("can't open file with xref files \"%s\"\n",
610 if (course_of_action & DO_MAKE_DOCUMENT)
612 RB_Say ("trying to open destination file \"%s\"\n", argv[2]);
613 if ((documentation = fopen (argv[2], "w")) != NULL)
615 RB_Say ("generating documentation\n");
616 RB_Set_Doc_Base (argv[2]);
617 RB_Generate_Documentation (documentation,
618 RB_FilePart (argv[1]),
619 RB_FilePart (argv[2]));
620 fclose (documentation);
621 documentation = NULL;
624 RB_Panic ("can't open destination file \"%s\"\n", argv[2]);
626 else if ((course_of_action & DO_MAKE_XREFS)
627 && output_file_for_xrefs)
629 RB_Say ("trying to open xref destination file \"%s\"\n",
630 output_file_for_xrefs);
631 if ((documentation = fopen (output_file_for_xrefs, "w")) != NULL)
633 RB_Say ("generating xref destination file \"%s\"\n",
634 output_file_for_xrefs);
635 RB_Generate_xrefs (documentation, argv[1], argv[2]);
636 fclose (documentation);
637 documentation = NULL;
640 RB_Panic ("can't open xref destination file \"%s\"\n",
641 output_file_for_xrefs);
643 else if (course_of_action & DO_INDEX)
645 if ((documentation = fopen (argv[2], "w")) != NULL)
647 RB_Generate_Index (documentation, argv[1]);
648 fclose (documentation);
649 documentation = NULL;
653 RB_Panic ("can't open destination file \"%s\"\n", argv[2]);
658 RB_Panic ("can't open source file \"%s\"\n", argv[1]);
661 RB_Close_The_Shop ();
670 /****f* ROBODoc/RB_Analyse_Arguments [3.0h]
672 * RB_Analyse_Arguments
674 * RB_Analyse_Arguments (argc, argv, file_with_xrefs,
675 * output_file_for_xrefs)
676 * RB_Analyse_Arguments (int, char **, char **, char **)
678 * Get and parse the arguments. This is a quite complex function.
679 * It assumes that the first and second parameter are the
680 * name of the source file and name of the documentation file
681 * respectively. They are therefore skipped.
682 * May modifie: output_mode, course_of_action, file_with_xrefs,
683 * output_file_for_xrefs, document_title.
688 RB_Analyse_Arguments (int argc, char **argv,
689 char **file_with_xrefs,
690 char **output_file_for_xrefs)
695 for (parameter_nr = argc - 3, parameter = argv + 3;
697 parameter++, parameter_nr--)
700 if (!RB_Str_Case_Cmp (*parameter, "HTML"))
702 else if (!RB_Str_Case_Cmp (*parameter, "GUIDE"))
703 output_mode = AMIGAGUIDE;
704 else if (!RB_Str_Case_Cmp (*parameter, "LATEX"))
706 else if (!RB_Str_Case_Cmp (*parameter, "ASCII"))
708 else if (!RB_Str_Case_Cmp (*parameter, "RTF"))
710 else if (!RB_Str_Case_Cmp (*parameter, "FOLD"))
711 extra_flags |= FOLD; /* PetteriK */
712 else if (!RB_Str_Case_Cmp (*parameter, "C"))
713 extra_flags |= C_MODE; /* PetteriK */
714 else if (!RB_Str_Case_Cmp (*parameter, "SORT") ||
715 !RB_Str_Case_Cmp (*parameter, "-S"))
716 course_of_action |= DO_SORT;
717 else if (!RB_Str_Case_Cmp (*parameter, "INDEX"))
719 course_of_action |= DO_INDEX;
720 course_of_action &= ~DO_MAKE_DOCUMENT;
722 else if (!RB_Str_Case_Cmp (*parameter, "INTERNAL") ||
723 !RB_Str_Case_Cmp (*parameter, "-I"))
724 course_of_action |= DO_INCLUDE_INTERNAL;
725 else if (!RB_Str_Case_Cmp (*parameter, "SINGLEDOC"))
726 course_of_action |= DO_SINGLEDOC;
727 else if (!RB_Str_Case_Cmp (*parameter, "NOSOURCE"))
728 course_of_action |= DO_NOSOURCE;
729 else if (!RB_Str_Case_Cmp (*parameter, "INTERNALONLY") ||
730 !RB_Str_Case_Cmp (*parameter, "-IO"))
731 course_of_action |= DO_INTERNAL_ONLY;
732 else if (!RB_Str_Case_Cmp (*parameter, "TOC") ||
733 !RB_Str_Case_Cmp (*parameter, "-T"))
734 course_of_action |= DO_TOC;
735 else if (!RB_Str_Case_Cmp (*parameter, "-V"))
736 course_of_action |= DO_TELL;
737 else if (!RB_Str_Case_Cmp (*parameter, "TITLE"))
742 document_title = *parameter;
743 RB_Say ("TITLE=\"%s\"\n", *document_title);
746 RB_Panic ("you must specify a title with the TITLE option\n");
748 else if (!RB_Str_Case_Cmp (*parameter, "XREF") ||
749 !RB_Str_Case_Cmp (*parameter, "-X"))
754 *file_with_xrefs = *parameter;
755 RB_Say ("XREF=\"%s\"\n", *file_with_xrefs);
756 course_of_action |= DO_USE_XREFS;
759 RB_Panic ("you must specify a xref file with the XREF option\n");
761 else if (!RB_Str_Case_Cmp (*parameter, "TABSIZE") ||
762 !RB_Str_Case_Cmp (*parameter, "-TS"))
767 tab_size = atoi (*parameter);
771 RB_Panic ("you must specify the number of spaces with the"
772 " TABSIZE option\n");
775 else if (!RB_Str_Case_Cmp (*parameter, "GENXREF") ||
776 !RB_Str_Case_Cmp (*parameter, "-G"))
781 *output_file_for_xrefs = *parameter;
782 RB_Say ("GENXREF=\"%s\"\n", *output_file_for_xrefs);
783 course_of_action |= DO_MAKE_XREFS;
784 course_of_action &= ~DO_MAKE_DOCUMENT;
787 RB_Panic ("you must specify a xref file with the GENXREF option\n");
791 RB_Panic ("unknown option %s\n", *parameter);
794 if ((course_of_action & DO_USE_XREFS) &&
795 (output_mode == ASCII) &&
796 !(course_of_action & DO_INDEX))
798 printf ("%s: WARNING, you can not use xrefs when you generate\n"
799 "\t\tdocumentation in ASCII [discarding switch]\n",
801 course_of_action &= ~DO_USE_XREFS;
803 if (course_of_action & DO_INDEX)
805 if ((output_mode != LATEX) && (output_mode != HTML)) {
806 RB_Panic ("you can only use the INDEX option in combination with LATEX or HTML\n");
815 /****i* ROBODoc/RB_Close_The_Shop [3.0b]
817 * RB_Close_The_Shop -- free resources.
819 * void RB_Close_The_Shop ()
821 * Frees all resources used by robodoc.
823 * RB_Free_Header(), RB_Free_Link()
828 RB_Close_The_Shop (void)
830 struct RB_header *cur_header, *tmp_header;
831 struct RB_link *cur_link, *tmp_link;
836 fclose (documentation);
838 fclose (xreffiles_file);
842 for (cur_header = first_header; cur_header;)
844 tmp_header = cur_header->next_header;
845 RB_Free_Header (cur_header);
846 cur_header = tmp_header;
849 for (cur_link = first_link; cur_link;)
851 tmp_link = cur_link->next_link;
852 RB_Free_Link (cur_link);