3 Copyright (C) 1994-2007 Frans Slothouber, Jacco van Weert, Petteri Kettunen,
4 Bernd Koesling, Thomas Aglassinger, Anthon Pang, Stefan Kost, David Druffner,
5 Sasha Vasko, Kai Hofmann, Thierry Pierron, Friedrich Haase, and Gergely Budai.
7 This file is part of ROBODoc
9 ROBODoc is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 /****h* ROBODoc/Generator
28 * This contains routines to generate the documentation from the
29 * headers collected from the source code. It contains
30 * functionality common for all document types (HTML, RTF etc).
31 * The specifics are handled in the modules for each of the several
34 * The behaviour of many of the functions in this module are
35 * modified by the global output_mode.
37 * The general call sequence is as follows:
38 * RB_Generate_Documentation
39 * +> RB_Generate_SingleDoc
42 * +> Generate_Item_Line
45 * o Confusing use of doctype and output mode.
47 * Might be a good idea to replace all the switch statements with
50 * switch (output_mode)
53 * RB_HTML_Generate_Doc_Start(dest_doc, src_name, name, toc);
56 * RB_LaTeX_Generate_Doc_Start(dest_doc, src_name, name, toc);
59 * RB_RTF_Generate_Doc_Start(dest_doc, src_name, name, toc);
62 * RB_ASCII_Generate_Doc_Start(dest_doc, src_name, name, toc);
65 * RB_TROFF_Generate_Doc_Start(dest_doc, src_name, name, toc);
71 * (*rb_generate_doc_start)(dest_doc, src_name, name, toc);
73 * were the function pointers are initialized at program start based
76 * $Id: generator.c,v 1.106 2007/07/10 19:13:51 gumpu Exp $
91 #include "generator.h"
95 #include "roboconfig.h"
98 #include "html_generator.h"
99 #include "latex_generator.h"
100 #include "xmldocbook_generator.h"
101 #include "rtf_generator.h"
102 #include "troff_generator.h"
103 #include "ascii_generator.h"
104 #include "test_generator.h"
106 /* TODO This should not be here.... */
107 #include "analyser.h"
114 /* Module functions */
115 // static void RB_Generate_Empty_Item( FILE * dest_doc );
117 static void Generate_Item_Line(
122 struct RB_header *fnames );
126 static void Generate_Index(
127 struct RB_Document *document );
129 static void Generate_Header(
131 struct RB_Document *document,
132 struct RB_header *header,
135 static void Generate_Begin_Paragraph(
137 static void Generate_End_Paragraph(
139 static void Format_Line(
142 static void Generate_Begin_Preformatted(
145 static void Generate_End_Preformatted(
147 static void Generate_Begin_List_Item(
149 static void Generate_End_List_Item(
151 static void Generate_Begin_List(
153 static void Generate_End_List(
155 static void Pipe_Line(
159 static char piping = FALSE;
162 /* TODO Documentation */
163 void RB_Generate_False_Link(
167 switch ( output_mode )
170 RB_TEST_Generate_False_Link( dest_doc, name );
173 RB_XMLDB_Generate_False_Link( dest_doc, name );
176 RB_HTML_Generate_False_Link( dest_doc, name );
179 RB_LaTeX_Generate_False_Link( dest_doc, name );
182 RB_RTF_Generate_False_Link( dest_doc, name );
185 RB_ASCII_Generate_False_Link( dest_doc, name );
188 RB_TROFF_Generate_False_Link( dest_doc, name );
196 /****f* Generator/RB_Generate_Item_Begin
198 * Generate the begin of an item. This should switch to some
199 * preformatted output mode, similar to HTML's <PRE>.
202 void RB_Generate_Item_Begin(
207 * dest_doc -- file to be written to
208 * output_mode -- global with the current output mode
212 switch ( output_mode )
215 RB_TEST_Generate_Item_Begin( dest_doc );
218 RB_XMLDB_Generate_Item_Begin( dest_doc );
221 RB_HTML_Generate_Item_Begin( dest_doc, name );
224 RB_LaTeX_Generate_Item_Begin( dest_doc );
227 RB_RTF_Generate_Item_Begin( dest_doc );
230 RB_ASCII_Generate_Item_Begin( dest_doc );
244 /****f* Generator/Generate_Label
246 * Generate a label that can be used for a link.
247 * For instance in HTML this is <a name="label">
255 * * dest_doc -- file to be written to
256 * * name -- the label's name.
257 * * output_mode -- global with the current output mode
261 switch ( output_mode )
264 RB_TEST_Generate_Label( dest_doc, name );
267 RB_XMLDB_Generate_Label( dest_doc, name );
270 RB_HTML_Generate_Label( dest_doc, name );
273 /* lowtexx 21.09.2005 11:33 */
274 RB_LaTeX_Generate_Label( dest_doc, name );
277 RB_RTF_Generate_Label( dest_doc, name );
294 /****f* Generator/RB_Generate_Item_End
296 * Generate the end of an item. This should switch back from the
297 * preformatted mode. So in HTML it generates the </PRE> of a <PRE>
300 * * dest_doc -- file to be written to
301 * * output_mode -- global with the current output mode
305 void RB_Generate_Item_End(
309 switch ( output_mode )
312 RB_TEST_Generate_Item_End( dest_doc );
315 RB_XMLDB_Generate_Item_End( dest_doc );
318 RB_HTML_Generate_Item_End( dest_doc, name );
321 if ( piping == TRUE )
323 fprintf( dest_doc, "\\begin{verbatim}\n" );
326 RB_LaTeX_Generate_Item_End( dest_doc );
329 RB_RTF_Generate_Item_End( dest_doc );
332 RB_ASCII_Generate_Item_End( dest_doc );
335 /* Doesn't apply */ break;
347 /****f Generator/RB_Get_Len_Extension
349 * Compute the length of the filename extension for
350 * the current document type.
354 size_t RB_Get_Len_Extension(
359 size = strlen( extension );
360 if ( *extension != '.' )
365 /****f* Generator/RB_Add_Extension
367 * Add an extension to the filename base based on on the current
370 * * doctype -- output mode
371 * * name -- the name of the file without extension and with
372 * enough room left to add the extension.
374 * name -- the name of the file including the extension.
378 void RB_Add_Extension(
382 if ( *extension != '.' )
384 strcat( name, extension );
389 /*x**f Generator/RB_Default_Len_Extension
391 * Returns default extension for
392 * the current document type.
396 char *RB_Get_Default_Extension(
397 T_RB_DocType doctype )
399 char *extension = NULL;
404 extension = RB_TEST_Get_Default_Extension( );
407 extension = RB_XMLDB_Get_Default_Extension( );
410 extension = RB_HTML_Get_Default_Extension( );
413 extension = RB_LaTeX_Get_Default_Extension( );
416 extension = RB_RTF_Get_Default_Extension( );
419 extension = RB_ASCII_Get_Default_Extension( );
422 extension = RB_TROFF_Get_Default_Extension( );
432 /****f* Generator/RB_Generate_BeginSection
434 * Generate a section of level depth in the current output mode.
435 * This is used for the --sections option. Where each header is
436 * placed in a section based on the header hierarchy.
438 * * dest_doc -- the destination file.
439 * * doctype -- document type
440 * * depth -- the level of the section
441 * * name -- the name of the section
442 * * header -- pointer to the header structure
443 * * output_mode -- global with the current output mode.
447 void RB_Generate_BeginSection(
451 struct RB_header *header )
453 switch ( output_mode )
456 RB_TEST_Generate_BeginSection( dest_doc, depth, name );
459 RB_XMLDB_Generate_BeginSection( dest_doc, depth, name );
462 RB_HTML_Generate_BeginSection( dest_doc, depth, name, header );
465 RB_LaTeX_Generate_BeginSection( dest_doc, depth, name, header );
468 RB_RTF_Generate_BeginSection( dest_doc, depth, name );
471 /* RB_TROFF_Generate_BeginSection( dest_doc, depth, name ); */
474 RB_ASCII_Generate_BeginSection( dest_doc, depth, name, header );
485 /****f* Generator/RB_Generate_EndSection
487 * Generate the end of a section base on the current output mode.
488 * The functions is used for the --section option.
489 * It closes a section in the current output mode.
491 * * dest_doc -- the destination file.
493 * * depth -- the level of the section
494 * * name -- the name of the section
495 * * output_mode -- global with the current output mode.
499 void RB_Generate_EndSection(
504 switch ( output_mode )
507 RB_TEST_Generate_EndSection( dest_doc, depth, name );
510 RB_XMLDB_Generate_EndSection( dest_doc, depth, name );
513 RB_HTML_Generate_EndSection( dest_doc, depth, name );
516 RB_LaTeX_Generate_EndSection( dest_doc, depth, name );
519 RB_RTF_Generate_EndSection( dest_doc, depth, name );
525 RB_HTML_Generate_EndSection( dest_doc, depth, name );
537 /****f* Generator/RB_Generate_Index_Entry
539 * Generate an entry for an auto generated index. This works only
540 * for output modes that support this, LaTeX for instance. This
541 * has nothting to do with the master index.
544 void RB_Generate_Index_Entry(
546 T_RB_DocType doctype,
547 struct RB_header *header )
550 * * dest_doc -- the destination file.
551 * * header -- pointer to the header the index entry is for.
552 * * output_mode -- global with the current output mode.
568 RB_LaTeX_Generate_Index_Entry( dest_doc, header );
574 /* No index available */
577 /* No index available */
588 /****f* Generator/RB_Generate_TOC_2
590 * Create a Table of Contents based on the headers found in
591 * _all_ source files. There is also a function to create
592 * a table of contents based on the headers found in a single
593 * source file RB_Generate_TOC_1
596 void RB_Generate_TOC_2(
598 struct RB_header **headers,
600 struct RB_Part *owner,
604 * * dest_doc -- the destination file.
605 * * headers -- an array of pointers to all the headers.
606 * * count -- the number of pointers in the array.
607 * * output_mode -- global with the current output mode.
608 * * owner -- The owner of the TOC. Only the headers that are owned
609 * by this owner are included in the TOC. Can be NULL,
610 * in which case all headers are included.
614 switch ( output_mode )
623 RB_HTML_Generate_TOC_2( dest_doc, headers, count, owner, dest_name );
626 /* LaTeX has it's own mechanism for creating
627 * a table of content */
630 RB_RTF_Generate_TOC_2( dest_doc, headers, count );
633 /* TODO: No TOC in ASCII mode */
645 /****f* Generator/RB_Generate_Doc_Start
647 * RB_Generate_Doc_Start -- Generate document header.
650 void RB_Generate_Doc_Start(
651 struct RB_Document *document,
660 * Generates for depending on the output_mode the text that
661 * will be at the start of a document.
662 * Including the table of contents.
664 * o dest_doc - pointer to the file to which the output will
666 * o src_name - the name of the source file or directory.
667 * o name - the name of this file.
668 * o output_mode - global variable that indicates the output
670 * o toc - generate table of contens
672 * RB_Generate_Doc_End
676 switch ( output_mode )
679 RB_TEST_Generate_Doc_Start( dest_doc, src_name, title, toc );
682 RB_XMLDB_Generate_Doc_Start( document, dest_doc, charset );
685 RB_HTML_Generate_Doc_Start( dest_doc, src_name, title, dest_name,
689 RB_LaTeX_Generate_Doc_Start( dest_doc, src_name, title, charset );
692 RB_RTF_Generate_Doc_Start( dest_doc, src_name, title, toc );
695 RB_ASCII_Generate_Doc_Start( dest_doc, src_name, title, toc );
709 /****f* Generator/RB_Generate_Doc_End
711 * RB_Generate_Doc_End -- generate document trailer.
714 void RB_Generate_Doc_End(
720 * Generates for depending on the output_mode the text that
721 * will be at the end of a document.
723 * o dest_doc - pointer to the file to which the output will
725 * o name - the name of this file.
726 * o output_mode - global variable that indicates the output
729 * Doesn't do anything with its arguments, but that might
730 * change in the future.
735 switch ( output_mode )
738 RB_TEST_Generate_Doc_End( dest_doc, name );
741 RB_XMLDB_Generate_Doc_End( dest_doc, name );
744 RB_HTML_Generate_Doc_End( dest_doc, name, src_name );
747 RB_LaTeX_Generate_Doc_End( dest_doc, name );
750 RB_RTF_Generate_Doc_End( dest_doc, name );
766 /****f* Generator/RB_Generate_Header_Start [3.0h]
768 * RB_Generate_Header_Start -- generate header start text.
771 FILE *RB_Generate_Header_Start(
773 struct RB_header *cur_header )
776 * Generates depending on the output_mode the text that
777 * will be at the end of each header.
779 * o dest_doc - pointer to the file to which the output will
781 * o cur_header - pointer to a RB_header structure.
783 * RB_Generate_Header_End
787 switch ( output_mode )
790 RB_TEST_Generate_Header_Start( dest_doc, cur_header );
793 RB_XMLDB_Generate_Header_Start( dest_doc, cur_header );
796 RB_HTML_Generate_Header_Start( dest_doc, cur_header );
799 RB_LaTeX_Generate_Header_Start( dest_doc, cur_header );
802 RB_RTF_Generate_Header_Start( dest_doc, cur_header );
805 RB_ASCII_Generate_Header_Start( dest_doc, cur_header );
808 dest_doc = RB_TROFF_Generate_Header_Start( dest_doc, cur_header );
820 /****f* Generator/RB_Generate_Header_End [3.0h]
822 * RB_Generate_Header_End
825 void RB_Generate_Header_End(
827 struct RB_header *cur_header )
830 * Generates for depending on the output_mode the text that
831 * will be at the end of a header.
832 * This function is used if the option --section is _not_
835 * o dest_doc - pointer to the file to which the output will
837 * o cur_header - pointer to a RB_header structure.
839 * RB_Generate_Header_Start, RB_Generate_EndSection,
840 * RB_Generate_BeginSection
844 switch ( output_mode )
845 { /* switch by *koessi */
847 RB_TEST_Generate_Header_End( dest_doc, cur_header );
850 RB_XMLDB_Generate_Header_End( dest_doc, cur_header );
853 RB_HTML_Generate_Header_End( dest_doc, cur_header );
856 RB_LaTeX_Generate_Header_End( dest_doc, cur_header );
859 RB_RTF_Generate_Header_End( dest_doc, cur_header );
862 RB_ASCII_Generate_Header_End( dest_doc, cur_header );
865 RB_TROFF_Generate_Header_End( dest_doc, cur_header );
876 /****f* Generator/Generate_Item_Name [2.01]
878 * Generate_Item_Name -- fast&easy
881 void Generate_Item_Name(
886 * write the item's name to the doc
888 * o FILE* dest_doc -- destination file
889 * o int item_type -- the type of item
893 * uses globals: output_mode
897 char *name = configuration.items.names[item_type];
899 switch ( output_mode )
902 RB_TEST_Generate_Item_Name( dest_doc, name );
905 RB_XMLDB_Generate_Item_Name( dest_doc, name );
908 RB_HTML_Generate_Item_Name( dest_doc, name );
911 RB_LaTeX_Generate_Item_Name( dest_doc, name );
914 RB_RTF_Generate_Item_Name( dest_doc, name );
917 RB_ASCII_Generate_Item_Name( dest_doc, name );
920 RB_TROFF_Generate_Item_Name( dest_doc, name, item_type );
932 void Generate_Begin_Content(
935 switch ( output_mode )
938 HTML_Generate_Begin_Content( dest_doc );
945 void Generate_End_Content(
948 switch ( output_mode )
951 HTML_Generate_End_Content( dest_doc );
958 void Generate_Begin_Navigation(
961 switch ( output_mode )
964 HTML_Generate_Begin_Navigation( dest_doc );
972 void Generate_End_Navigation(
975 switch ( output_mode )
978 HTML_Generate_End_Navigation( dest_doc );
986 void Generate_IndexMenu(
989 struct RB_Document *document )
991 switch ( output_mode )
994 RB_HTML_Generate_IndexMenu( dest_doc, filename, document, NULL );
1002 void Generate_Begin_Extra(
1005 switch ( output_mode )
1008 HTML_Generate_Begin_Extra( dest_doc );
1015 void Generate_End_Extra(
1018 switch ( output_mode )
1021 HTML_Generate_End_Extra( dest_doc );
1033 /* TODO Documentation */
1034 void RB_Generate_Nav_Bar(
1035 struct RB_Document *document,
1037 struct RB_header *current_header )
1039 switch ( output_mode )
1046 if ( course_of_action.do_one_file_per_header )
1052 RB_HTML_Generate_Nav_Bar( document, current_doc, current_header );
1072 /* TODO Documentation */
1081 switch ( output_mode )
1089 RB_HTML_Generate_Extra( dest_doc, item_type, cur_char,
1102 res = RB_TROFF_Generate_Extra( dest_doc, item_type, cur_char );
1114 /****f* Generator/RB_Name_Headers
1116 * Give all headers a unique name. This makes sure that if
1117 * two headers have the same name linking to one of the headers
1121 void RB_Name_Headers(
1122 struct RB_header **headers,
1127 #define MAX_UNIQUE_ID_LENGTH 80
1130 char id[MAX_UNIQUE_ID_LENGTH + 1];
1132 RB_Say( "Assigning headers a unique name.\n", SAY_DEBUG );
1133 for ( i = 0; i < count; ++i )
1135 struct RB_header *header;
1137 header = headers[i];
1138 sprintf( id, "robo%d", i );
1139 header->unique_name = RB_StrDup( id );
1145 /****f* Generator/RB_Sort_Items
1147 * Sort the items in all the headers according to the order
1148 * specified in the 'item order' block in the robodoc.rc
1152 static void RB_Sort_Items(
1153 struct RB_header **headers,
1159 int n_order = configuration.item_order.number;
1165 int max_number_of_items = 0;
1166 struct RB_Item **items = NULL;
1167 struct RB_Item **items_sorted = NULL;
1169 RB_Say( "Sorting items in %d headers.\n", SAY_DEBUG, header_count );
1171 /* Compute the maximum number of items in any given header */
1172 for ( j = 0; j < header_count; ++j )
1174 struct RB_header *header;
1175 struct RB_Item *item;
1178 header = headers[j];
1179 for ( item = header->items; item; item = item->next )
1184 if ( item_count > max_number_of_items )
1186 max_number_of_items = item_count;
1189 /* Allocate an array for the items, this makes it easier to
1192 RB_Say( "Largest header has %d items.\n", SAY_DEBUG,
1193 max_number_of_items );
1195 if ( max_number_of_items == 0 )
1197 /* No items in any of the headers, do nothing */
1201 items = calloc( max_number_of_items, sizeof( struct RB_Item * ) );
1203 calloc( max_number_of_items, sizeof( struct RB_Item * ) );
1206 for ( j = 0; j < header_count; ++j )
1208 struct RB_header *header = NULL;
1209 struct RB_Item *item = NULL;
1211 int sorted_item_index = 0;
1214 header = headers[j];
1216 /* Copy item pointers to array */
1217 for ( item = header->items; item;
1218 item = item->next, ++item_index )
1220 items[item_index] = item;
1221 items_sorted[item_index] = item;
1223 item_count = item_index;
1225 if ( item_count == 0 )
1227 /* No items in this header, do nothing. */
1231 assert( item_count <= max_number_of_items );
1233 /* First copy the items in the order that is defined in
1234 * item_order[] to sorted_items[] */
1235 sorted_item_index = 0;
1236 for ( i = 0; i < n_order; ++i )
1238 for ( item_index = 0; item_index < item_count;
1241 if ( items[item_index] )
1244 ( configuration.items.
1245 names[items[item_index]->type],
1246 configuration.item_order.names[i] ) ==
1249 /* copy to items_sorted */
1250 items_sorted[sorted_item_index] =
1252 ++sorted_item_index;
1253 items[item_index] = NULL;
1258 /* Then copy the remaining items to items_sorted[] */
1259 for ( item_index = 0; item_index < item_count;
1262 if ( items[item_index] )
1264 /* copy to items_sorted */
1265 items_sorted[sorted_item_index] =
1267 ++sorted_item_index;
1268 items[item_index] = NULL;
1272 assert( sorted_item_index == item_count );
1274 /* Now copy the items in items_sorted[] back into the linked list in
1276 if ( item_count > 1 )
1278 /* Chain all the items */
1279 for ( item_index = 0; item_index < item_count - 1;
1282 items_sorted[item_index]->next =
1283 items_sorted[item_index + 1];
1287 assert( item_count > 0 );
1288 items_sorted[item_count - 1]->next = NULL;
1289 /* now link the first item to the header. */
1290 header->items = items_sorted[0];
1294 free( items_sorted );
1299 RB_Say( "Done sorting items in %d headers.\n", SAY_DEBUG, header_count );
1305 /****f* Generator/RB_Generate_Documentation
1307 * Generate the documentation for all the information contained in a
1308 * RB_Document structure.
1311 void RB_Generate_Documentation(
1312 struct RB_Document *document )
1315 * document -- pointer to the RB_Document structure.
1319 RB_SetCurrentFile( NULL );
1323 if ( document->actions.do_singledoc )
1325 RB_Generate_SingleDoc( document );
1327 else if ( document->actions.do_multidoc )
1329 RB_Generate_MultiDoc( document );
1331 else if ( document->actions.do_singlefile )
1333 RB_Generate_SingleDoc( document );
1339 /****f* Generator/RB_Generate_MultiDoc
1341 * Create documentation by creating a file for each
1342 * individual source file that was scanned.
1345 void RB_Generate_MultiDoc(
1346 struct RB_Document *document )
1349 * document -- pointer to the RB_Document structure.
1353 struct RB_Part *i_part;
1354 FILE *document_file = NULL;
1356 RB_Document_Determine_DocFilePaths( document );
1357 RB_Document_Create_DocFilePaths( document );
1358 if ( document->actions.do_one_file_per_header )
1360 RB_Document_Split_Parts( document );
1362 RB_Document_Determine_DocFileNames( document );
1363 RB_Document_Collect_Headers( document );
1364 if ( document->actions.do_nosort )
1370 RB_Document_Sort_Headers( document );
1372 RB_Document_Link_Headers( document );
1373 RB_Fill_Header_Filename( document );
1374 RB_Name_Headers( document->headers, document->no_headers );
1375 RB_Sort_Items( document->headers, document->no_headers );
1376 RB_CollectLinks( document, document->headers, document->no_headers );
1377 if ( output_mode == HTML )
1379 RB_Create_CSS( document );
1383 for ( i_part = document->parts; i_part != NULL; i_part = i_part->next )
1386 char *srcname = Get_Fullname( i_part->filename );
1387 char *docname = RB_Get_FullDocname( i_part->filename );
1389 /* Nothing found in this part, do not generate it */
1390 if ( i_part->headers == 0 )
1394 if ( output_mode != TROFF )
1396 document_file = RB_Open_Documentation( i_part );
1397 RB_Generate_Doc_Start( document,
1398 document_file, srcname, srcname, 1,
1399 docname, document->charset );
1401 Generate_Begin_Navigation( document_file );
1402 if ( document->actions.do_one_file_per_header )
1404 RB_HTML_Generate_Nav_Bar_One_File_Per_Header( document,
1411 Generate_IndexMenu( document_file, docname, document );
1413 Generate_End_Navigation( document_file );
1415 Generate_Begin_Content( document_file );
1417 if ( ( document->actions.do_toc ) && document->no_headers )
1419 RB_Generate_TOC_2( document_file,
1420 document->headers, document->no_headers,
1423 RB_Generate_Part( document_file, document, i_part );
1424 Generate_End_Content( document_file );
1426 RB_Generate_Doc_End( document_file, docname, srcname );
1427 fclose( document_file );
1431 RB_Generate_Part( document_file, document, i_part );
1435 if ( document->actions.do_index )
1437 Generate_Index( document );
1446 /****f* Generator/RB_Generate_SingleDoc
1448 * Create documentation by creating a single file for all individual
1449 * source file that were scanned.
1451 * This function is called when the option --singledoc is used.
1452 * Based on whether the option --sections is used this function then
1453 * calls RB_Generate_Sections or RB_Generate_Part
1456 void RB_Generate_SingleDoc(
1457 struct RB_Document *document )
1460 * document -- pointer to the RB_Document structure.
1464 FILE *document_file;
1465 struct RB_Part *i_part;
1467 RB_Document_Collect_Headers( document );
1468 if ( document->actions.do_nosort )
1474 RB_Document_Sort_Headers( document );
1476 RB_Document_Link_Headers( document );
1477 RB_Fill_Header_Filename( document );
1478 RB_Name_Headers( document->headers, document->no_headers );
1479 RB_Sort_Items( document->headers, document->no_headers );
1480 RB_CollectLinks( document, document->headers, document->no_headers );
1482 for ( i_part = document->parts; i_part != NULL; i_part = i_part->next )
1484 RB_Set_FullDocname( i_part->filename, document->singledoc_name );
1487 if ( output_mode == HTML )
1489 RB_Create_CSS( document );
1492 document_file = RB_Open_SingleDocumentation( document );
1493 assert( document->parts->filename->name );
1496 RB_Generate_Doc_Start( document,
1498 document->srcroot->name,
1499 document->singledoc_name, 1,
1500 document->singledoc_name, document->charset );
1502 if ( ( document->actions.do_toc ) && document->no_headers )
1504 RB_Generate_TOC_2( document_file,
1505 document->headers, document->no_headers, NULL,
1506 document->parts->filename->name );
1508 if ( document->actions.do_sections )
1510 RB_Generate_Sections( document_file, document );
1514 for ( i_part = document->parts;
1515 i_part != NULL; i_part = i_part->next )
1517 RB_Generate_Part( document_file, document, i_part );
1521 RB_Generate_Doc_End( document_file, "singledoc",
1522 document->srcroot->name );
1523 fclose( document_file );
1531 /****f* Generator/RB_Generate_Sections
1533 * Creates the documentation for all headers found in all source
1534 * files. The order in which they are generated depends on the
1535 * header hierarchy. First the top level header's documentation
1536 * is generated then, the documentation for all it's childern, then
1537 * the next top level header's documentation is generated.
1538 * This is a recursive proces.
1539 * The idea is to create something like:
1543 * 1.2.1 Child's child1
1548 void RB_Generate_Sections(
1549 FILE *document_file,
1550 struct RB_Document *document )
1553 * o document_file -- destination file.
1554 * o document -- pointer to the RB_Document structure.
1560 struct RB_header *header;
1562 depth = document->first_section_level;
1564 RB_Say( "Generating Sections\n", SAY_INFO );
1565 for ( i = 0; i < document->no_headers; ++i )
1567 header = ( document->headers )[i];
1568 if ( header->parent )
1570 /* This will be in one of the subsections */
1574 RB_Generate_Section( document_file, header, document, depth );
1583 /****f* Generator/RB_Generate_Section
1585 * Generate the documentation for a header and all
1588 * o document_file -- destination file
1589 * o parent -- the parent of the header for which the documentation
1590 * is to be generated.
1591 * o document -- pointer to the RB_Document structure.
1592 * o depth -- level of sectioning ( 1 1.1 1.1.1 etc)
1595 void RB_Generate_Section(
1596 FILE *document_file,
1597 struct RB_header *parent,
1598 struct RB_Document *document,
1602 * This is a recursive function.
1604 * RB_Generate_Sections
1609 struct RB_header *header;
1612 // We pass either modulename/name or just the name
1613 if ( course_of_action.do_sectionnameonly )
1615 headername = parent->function_name;
1619 headername = parent->name;
1622 switch ( output_mode )
1626 RB_Generate_BeginSection( document_file, depth, headername,
1628 /* Docbook output does not like the labels to be
1629 * generated before the <section> part
1631 Generate_Label( document_file, parent->unique_name );
1632 Generate_Label( document_file, parent->name );
1635 /* lowtexx 21.09.2005 11:37 */
1638 RB_Generate_BeginSection( document_file, depth, headername,
1640 /* We have to start section before labeling in latex */
1641 Generate_Label( document_file, parent->unique_name );
1642 Generate_Label( document_file, parent->name );
1648 Generate_Label( document_file, parent->unique_name );
1649 Generate_Label( document_file, parent->name );
1650 RB_Generate_BeginSection( document_file, depth, headername,
1656 RB_Generate_Nav_Bar( document, document_file, parent );
1657 RB_Generate_Index_Entry( document_file, document->doctype, parent );
1658 Generate_Header( document_file, document, parent, "dummy" );
1659 for ( i = 0; i < document->no_headers; ++i )
1661 header = ( document->headers )[i];
1662 if ( header->parent == parent )
1664 RB_Generate_Section( document_file, header, document, depth + 1 );
1671 RB_Generate_EndSection( document_file, depth, parent->name );
1678 /****f* Generator/RB_Generate_Part
1680 * Generate the documention for all the headers found in a single
1684 void RB_Generate_Part(
1685 FILE *document_file,
1686 struct RB_Document *document,
1687 struct RB_Part *part )
1690 * * document_file -- The file were it stored.
1691 * * document -- All the documentation.
1692 * * part -- pointer to a RB_Part that contains all the headers found
1693 * in a single source file.
1697 struct RB_header *i_header;
1698 char *docname = NULL;
1699 char *srcname = Get_Fullname( part->filename );
1701 RB_Say( "generating documentation for file \"%s\"\n", SAY_INFO, srcname );
1702 if ( document->actions.do_singledoc )
1704 docname = document->singledoc_name;
1706 else if ( document->actions.do_multidoc )
1708 docname = RB_Get_FullDocname( part->filename );
1710 else if ( document->actions.do_singlefile )
1712 docname = document->singledoc_name;
1719 if ( output_mode == TROFF )
1721 RB_TROFF_Set_Param( document->compress, document->section );
1725 for ( i_header = part->headers; i_header; i_header = i_header->next )
1727 RB_Say( "generating documentation for header \"%s\"\n", SAY_INFO,
1729 document_file = RB_Generate_Header_Start( document_file, i_header );
1730 RB_Generate_Nav_Bar( document, document_file, i_header );
1731 RB_Generate_Index_Entry( document_file, document->doctype, i_header );
1732 Generate_Header( document_file, document, i_header, docname );
1733 RB_Generate_Header_End( document_file, i_header );
1740 /****f* Generator/RB_Get_DOT_Type
1742 * Returns the type of the DOT file for the given output mode
1745 char *RB_Get_DOT_Type(
1748 switch ( output_mode )
1751 return DOT_HTML_TYPE;
1755 return DOT_LATEX_TYPE;
1768 /****f* Generator/RB_Generate_DOT_Image_Link
1770 * Generates the image link for the created dot graphics
1773 void RB_Generate_DOT_Image_Link(
1778 switch ( output_mode )
1781 fprintf( f, "<img src=\"%s%d.%s\">\n", DOT_GRAPH_NAME, dot_nr,
1787 char str[TEMP_BUF_SIZE];
1789 // First we need to convert graph to PDF
1790 // (maybe the user is using pdflatex)
1791 #if defined(RB_MSVC)
1792 sprintf( str, "%s %s%d.%s", EPSTOPDF_NAME,
1793 DOT_GRAPH_NAME, dot_nr, dot_type );
1795 snprintf( str, sizeof( str ), "%s %s%d.%s", EPSTOPDF_NAME,
1796 DOT_GRAPH_NAME, dot_nr, dot_type );
1800 fprintf( f, "\\includegraphics{%s%d}\n", DOT_GRAPH_NAME, dot_nr );
1811 /****f* Generator/Generate_Item
1814 static void Generate_Item(
1816 struct RB_Document *document,
1817 struct RB_header *header,
1818 struct RB_Item *cur_item,
1822 * Generate the documentation for a single item.
1826 static int dot_nr = 1;
1828 char *dot_type = NULL;
1829 FILE *tool = NULL; // Pipe handler to the tool we use
1830 enum ItemType item_type = cur_item->type;
1831 char *name = configuration.items.names[item_type];
1834 Generate_Item_Name( f, item_type );
1835 RB_Generate_Item_Begin( f, name );
1836 for ( line_nr = 0; line_nr < cur_item->no_lines; ++line_nr )
1838 struct RB_Item_Line *item_line = cur_item->lines[line_nr];
1839 char *line = item_line->line;
1842 if ( !Works_Like_SourceItem( item_type ) &&
1843 ( item_line->kind == ITEM_LINE_PLAIN ) )
1845 Format_Line( f, item_line->format );
1846 Generate_Item_Line( f, line, item_type, docname, header );
1849 else if ( item_line->kind == ITEM_LINE_END )
1851 Format_Line( f, item_line->format );
1854 else if ( !Works_Like_SourceItem( item_type ) &&
1855 ( item_line->kind == ITEM_LINE_PIPE ) )
1857 Format_Line( f, item_line->format );
1858 if ( item_line->pipe_mode == output_mode )
1860 Pipe_Line( f, line );
1864 else if ( !Works_Like_SourceItem( item_type ) &&
1865 ( item_line->kind == ITEM_LINE_TOOL_START ) )
1867 Format_Line( f, item_line->format );
1870 RB_Change_To_Docdir( document );
1872 // Open pipe to tool
1873 tool = Open_Pipe( line );
1875 // Get back to working dir
1876 RB_Change_Back_To_CWD( );
1878 // Tool (or DOT) body
1879 else if ( !Works_Like_SourceItem( item_type ) &&
1880 ( item_line->kind == ITEM_LINE_TOOL_BODY ) )
1884 fprintf( tool, "%s\n", line );
1888 else if ( !Works_Like_SourceItem( item_type ) &&
1889 ( item_line->kind == ITEM_LINE_TOOL_END ) )
1896 else if ( !Works_Like_SourceItem( item_type ) &&
1897 ( item_line->kind == ITEM_LINE_DOT_START ) )
1899 Format_Line( f, item_line->format );
1901 // Get DOT file type
1902 dot_type = RB_Get_DOT_Type( );
1906 char pipe_str[TEMP_BUF_SIZE];
1909 RB_Change_To_Docdir( document );
1910 #if defined(RB_MSVC)
1912 "%s -T%s -o%s%d.%s", dot_name,
1913 dot_type, DOT_GRAPH_NAME, dot_nr, dot_type );
1915 snprintf( pipe_str, sizeof( pipe_str ),
1916 "%s -T%s -o%s%d.%s", dot_name,
1917 dot_type, DOT_GRAPH_NAME, dot_nr, dot_type );
1919 tool = Open_Pipe( pipe_str );
1923 else if ( !Works_Like_SourceItem( item_type ) &&
1924 ( item_line->kind == ITEM_LINE_DOT_END ) )
1932 // Generate link to image
1933 RB_Generate_DOT_Image_Link( f, dot_nr, dot_type );
1935 // Get back to working dir
1936 RB_Change_Back_To_CWD( );
1938 // Increment dot file number
1943 else if ( !Works_Like_SourceItem( item_type ) &&
1944 ( item_line->kind == ITEM_LINE_DOT_FILE ) )
1946 Format_Line( f, item_line->format );
1948 // Get DOT file type
1949 dot_type = RB_Get_DOT_Type( );
1953 char str[TEMP_BUF_SIZE];
1956 RB_Change_To_Docdir( document );
1958 #if defined(RB_MSVC)
1960 "%s -T%s \"%s/%s\" -o%s%d.%s", dot_name,
1961 dot_type, RB_Get_Saved_CWD( ), line,
1962 DOT_GRAPH_NAME, dot_nr, dot_type );
1964 snprintf( str, sizeof( str ),
1965 "%s -T%s \"%s/%s\" -o%s%d.%s", dot_name,
1966 dot_type, RB_Get_Saved_CWD( ), line,
1967 DOT_GRAPH_NAME, dot_nr, dot_type );
1971 // Generate link to image
1972 RB_Generate_DOT_Image_Link( f, dot_nr, dot_type );
1974 // Get back to working dir
1975 RB_Change_Back_To_CWD( );
1977 // Increment dot file number
1982 else if ( !Works_Like_SourceItem( item_type ) &&
1983 ( item_line->kind == ITEM_LINE_EXEC ) )
1985 Format_Line( f, item_line->format );
1988 RB_Change_To_Docdir( document );
1993 // Get back to working dir
1994 RB_Change_Back_To_CWD( );
1997 else if ( Works_Like_SourceItem( item_type ) )
1999 Format_Line( f, item_line->format );
2000 Generate_Item_Line( f, line, item_type, docname, header );
2004 /* This item line is ignored */
2007 RB_Generate_Item_End( f, name );
2013 /****f* Generator/Generate_Header
2015 * Generate the documentation for all the items found in
2016 * a header except for any items specified in
2017 * configuration.ignore_items.
2020 static void Generate_Header(
2022 struct RB_Document *document,
2023 struct RB_header *header,
2027 * * f -- destination file
2028 * * header -- header to be searched.
2029 * * srcname -- name of the source file the header was found in.
2030 * * document -- name of the documentation file.
2032 * This skips the first item body if the first item name was
2033 * not correctly spelled.
2037 struct RB_Item *cur_item;
2039 for ( cur_item = header->items; cur_item; cur_item = cur_item->next )
2041 enum ItemType item_type = cur_item->type;
2042 char *name = configuration.items.names[item_type];
2044 if ( Is_Ignore_Item( name ) )
2046 /* User does not want this item */
2048 else if ( Works_Like_SourceItem( item_type )
2049 && ( course_of_action.do_nosource ) )
2051 /* User does not want source items */
2055 Generate_Item( f, document, header, cur_item, docname );
2063 static void Pipe_Line(
2067 char *cur_char = arg_line;
2069 for ( ; *cur_char && ( *cur_char == ' ' || *cur_char == '\t' );
2072 fputc( *cur_char, dest_doc );
2074 fprintf( dest_doc, "%s%s", cur_char,
2075 ( output_mode == RTF ? "\\line" : "\n" ) );
2079 static void Format_Line(
2083 if ( format & RBILA_END_LIST_ITEM )
2085 Generate_End_List_Item( dest_doc );
2087 if ( format & RBILA_END_LIST )
2089 Generate_End_List( dest_doc );
2091 if ( format & RBILA_END_PRE )
2093 Generate_End_Preformatted( dest_doc );
2095 if ( format & RBILA_BEGIN_PARAGRAPH )
2097 Generate_Begin_Paragraph( dest_doc );
2099 if ( format & RBILA_END_PARAGRAPH )
2101 Generate_End_Paragraph( dest_doc );
2103 if ( format & RBILA_BEGIN_PRE )
2105 Generate_Begin_Preformatted( dest_doc,
2106 ( format & RBILA_BEGIN_SOURCE ) );
2108 if ( format & RBILA_BEGIN_LIST )
2110 Generate_Begin_List( dest_doc );
2112 if ( format & RBILA_BEGIN_LIST_ITEM )
2114 Generate_Begin_List_Item( dest_doc );
2120 static void Generate_Begin_List_Item(
2123 switch ( output_mode )
2126 TEST_Generate_Begin_List_Item( dest_doc );
2129 XMLDB_Generate_Begin_List_Item( dest_doc );
2132 HTML_Generate_Begin_List_Item( dest_doc );
2135 LaTeX_Generate_Begin_List_Item( dest_doc );
2140 TROFF_Generate_Begin_List_Item( dest_doc );
2152 static void Generate_End_List_Item(
2155 switch ( output_mode )
2158 TEST_Generate_End_List_Item( dest_doc );
2161 XMLDB_Generate_End_List_Item( dest_doc );
2164 HTML_Generate_End_List_Item( dest_doc );
2167 LaTeX_Generate_End_List_Item( dest_doc );
2172 TROFF_Generate_End_List_Item( dest_doc );
2184 static void Generate_Begin_List(
2187 switch ( output_mode )
2190 TEST_Generate_Begin_List( dest_doc );
2193 XMLDB_Generate_Begin_List( dest_doc );
2196 HTML_Generate_Begin_List( dest_doc );
2199 LaTeX_Generate_Begin_List( dest_doc );
2213 /* TODO FS Document */
2215 static void Generate_End_List(
2218 switch ( output_mode )
2221 TEST_Generate_End_List( dest_doc );
2224 XMLDB_Generate_End_List( dest_doc );
2227 HTML_Generate_End_List( dest_doc );
2230 LaTeX_Generate_End_List( dest_doc );
2245 /* TODO FS Document */
2247 static void Generate_Begin_Preformatted(
2251 switch ( output_mode )
2254 TEST_Generate_Begin_Preformatted( dest_doc );
2257 XMLDB_Generate_Begin_Preformatted( dest_doc );
2260 HTML_Generate_Begin_Preformatted( dest_doc, source );
2263 LaTeX_Generate_Begin_Preformatted( dest_doc );
2268 TROFF_Generate_Begin_Preformatted( dest_doc );
2279 /* TODO FS Document */
2280 static void Generate_End_Preformatted(
2283 switch ( output_mode )
2286 TEST_Generate_End_Preformatted( dest_doc );
2289 XMLDB_Generate_End_Preformatted( dest_doc );
2292 HTML_Generate_End_Preformatted( dest_doc );
2295 LaTeX_Generate_End_Preformatted( dest_doc );
2300 TROFF_Generate_End_Preformatted( dest_doc );
2311 /* TODO FS Document */
2312 static void Generate_End_Paragraph(
2315 switch ( output_mode )
2318 TEST_Generate_End_Paragraph( dest_doc );
2321 XMLDB_Generate_End_Paragraph( dest_doc );
2324 HTML_Generate_End_Paragraph( dest_doc );
2327 LaTeX_Generate_End_Paragraph( dest_doc );
2332 TROFF_Generate_End_Paragraph( dest_doc );
2343 /* TODO FS Document */
2344 static void Generate_Begin_Paragraph(
2347 switch ( output_mode )
2350 TEST_Generate_Begin_Paragraph( dest_doc );
2353 XMLDB_Generate_Begin_Paragraph( dest_doc );
2356 HTML_Generate_Begin_Paragraph( dest_doc );
2359 LaTeX_Generate_Begin_Paragraph( dest_doc );
2364 TROFF_Generate_Begin_Paragraph( dest_doc );
2376 /*x**f* Generator/RB_Generate_Empty_Item
2378 * Generate documentation for an item with an empty body.
2380 * dest_doc -- destination file.
2382 * TODO Documentation
2385 static void RB_Generate_Empty_Item(
2388 switch ( output_mode )
2395 RB_HTML_Generate_Empty_Item( dest_doc );
2398 RB_LaTeX_Generate_Empty_Item( dest_doc );
2401 RB_RTF_Generate_Empty_Item( dest_doc );
2406 RB_ASCII_Generate_Empty_Item( dest_doc );
2417 static void Generate_Item_Line(
2422 struct RB_header *fnames )
2424 char *cur_char = line;
2425 char *object_name = NULL;
2426 char *label_name = NULL;
2427 char *file_name = NULL;
2430 { SKIP_ALPHANUM, SKIP_SPACE, SEARCH_LINK_START_WORD, SEARCH_LINK }
2433 for ( ; *cur_char; cur_char++ )
2437 /* This is a little statemachine to switch searching for
2438 * links on and off. A link can be found for a word
2439 * or for a word combined with some punctuation
2440 * characters. A word is a string of alpha numeric
2441 * characters (including a '_'), say FunctionAA_10_B
2442 * All other characters are punctuation characters.
2443 * We do not want links to start in the middle of a word,
2444 * but they can start after or on a punctuation character.
2445 * So for a link can start at
2452 /* Move to the next state based on current character. */
2456 /* In this state we try to skip of a string of space
2457 * characters until we find something else.
2460 if ( utf8_ispunct( c ) )
2462 /* we were in the process of skipping spaces,
2463 * but now we found a non-space character.
2464 * This might be the begin of a link, so
2465 * switch to the search link state.
2467 state = SEARCH_LINK;
2469 else if ( utf8_isalnum( c ) || ( c == '_' ) )
2471 state = SEARCH_LINK_START_WORD;
2475 /* Links can only start with a none space character,
2476 * so if the current charater is a space, we skip it.
2482 /* In this state we skipping a string of alpha
2483 * numeric charaters after that the first
2484 * character in this string did not result in a
2488 if ( utf8_isspace( c ) )
2490 /* We found the end of the string, so we go
2491 * back to the space skipping state
2495 else if ( utf8_ispunct( c ) && ( c != '_' ) )
2497 /* We found a puntuation character, this end
2498 * the string of alpha numeric character, but
2499 * can be the begin of a new link, so we
2500 * switch to the seach link state.
2502 state = SEARCH_LINK;
2506 /* We stay in this state */
2510 case SEARCH_LINK_START_WORD:
2511 /* In this state we are at the start of a string
2512 * of alpha numeric characters.
2515 if ( utf8_isalnum( c ) || ( c == '_' ) )
2517 /* We are not at the second character of
2518 * a string of alpha numeric characters,
2519 * we can stop searching for links, as a
2520 * link can only start at the begin of
2523 state = SKIP_ALPHANUM;
2525 else if ( utf8_ispunct( c ) && ( c != '_' ) )
2527 state = SEARCH_LINK;
2529 else if ( utf8_isspace( c ) )
2541 /* In this state we search for links. We stop
2542 * searching if we encounter a space because this
2543 * marks end of the word,
2545 if ( utf8_isalnum( c ) || ( c == '_' ) )
2547 /* We are at the start of a word.
2549 state = SEARCH_LINK_START_WORD;
2551 else if ( utf8_isspace( c ) )
2557 /* We stay in this state */
2566 if ( ( ( state == SEARCH_LINK ) ||
2567 ( state == SEARCH_LINK_START_WORD ) ) &&
2568 Find_Link( cur_char, &object_name, &label_name, &file_name ) )
2570 /* We found a link, so we can stop searching for one
2575 if ( object_name && fnames->no_names > 0 )
2577 extern char *function_name(
2581 for ( i = 0; i < fnames->no_names; i++ )
2584 function_name( fnames->names[i] ) ) == 0 )
2586 if ( i < fnames->no_names )
2588 RB_Generate_False_Link( dest_doc, object_name );
2589 cur_char += strlen( object_name ) - 1;
2593 Generate_Link( dest_doc, docname,
2594 file_name, label_name, object_name );
2595 cur_char += strlen( object_name ) - 1;
2606 RB_HTML_Extra( dest_doc, item_type, cur_char,
2607 ( cur_char == line ) ? 0 : *( cur_char - 1 ) );
2615 /* convert from signed to unsigned */
2616 unsigned char c2 = *cur_char;
2618 Generate_Char( dest_doc, c2 );
2623 /* TODO Move to the RTF_Generator */
2624 switch ( output_mode )
2627 fprintf( dest_doc, "\\line" );
2631 RB_TROFF_Start_New_Line( dest_doc );
2635 // Check for source line comment endings
2636 RB_HTML_Generate_Line_Comment_End( dest_doc );
2649 /* For all modes we add a newline. */
2650 fputc( '\n', dest_doc );
2655 /****f* Generator/Generate_Link
2657 * Generate a link to another headers documentation.
2665 char *function_name )
2668 * * dest_doc -- the output file
2669 * * docname -- the name of the output file
2670 * * file_name -- the name of the file that contains the link's body
2671 * * label_name -- the label for the link
2672 * * function_name -- the name that is shown for the link in the
2678 switch ( output_mode )
2681 RB_TEST_Generate_Link( dest_doc, docname, file_name, label_name,
2685 RB_XMLDB_Generate_Link( dest_doc, docname, file_name, label_name,
2689 RB_HTML_Generate_Link( dest_doc, docname, file_name, label_name,
2690 function_name, NULL );
2693 RB_RTF_Generate_Link( dest_doc, docname, file_name, label_name,
2697 RB_LaTeX_Generate_String( dest_doc, function_name );
2698 /* lowtexx 21.09.2005 11:43 */
2699 /* generate a simple link here */
2700 RB_LaTeX_Generate_Link( dest_doc, docname, file_name, label_name,
2707 fprintf( dest_doc, "%s", function_name );
2714 /****f* Generator/Generate_Char
2716 * Generate a single character in the current output mode.
2717 * The individual generators will make sure that special
2718 * characters are escaped.
2726 * * dest_doc -- destination file.
2727 * * cur_char -- character to be generated.
2731 switch ( output_mode )
2734 RB_TEST_Generate_Char( dest_doc, cur_char );
2737 RB_XMLDB_Generate_Char( dest_doc, cur_char );
2740 RB_HTML_Generate_Char( dest_doc, cur_char );
2743 RB_LaTeX_Generate_Char( dest_doc, cur_char );
2746 RB_RTF_Generate_Char( dest_doc, cur_char );
2749 RB_TROFF_Generate_Char( dest_doc, cur_char );
2752 RB_ASCII_Generate_Char( dest_doc, cur_char );
2761 /****f* Generator/RB_Get_SubIndex_FileName
2763 * Get the name of the master index file for a specific
2767 char *RB_Get_SubIndex_FileName(
2770 struct RB_HeaderType *header_type )
2773 * * docroot -- the path to the documentation directory.
2774 * * extension -- the extension for the file
2775 * * header_type -- the header type
2777 * a pointer to a freshly allocated string.
2779 * Has too many parameters.
2788 l = strlen( docroot );
2790 l += RB_Get_Len_Extension( extension );
2791 l += strlen( docroot );
2792 l += strlen( header_type->fileName );
2794 filename = ( char * ) malloc( l + 2 );
2798 strcat( filename, docroot );
2799 strcat( filename, header_type->fileName );
2800 RB_Add_Extension( extension, filename );
2808 /****f* Generator/Generate_Index
2810 * Generate_Index -- generate index file based on xref files.
2813 static void Generate_Index(
2814 struct RB_Document *document )
2817 * Create a master index file. It contains pointers to the
2818 * documentation generated for each source file, as well as all
2819 * "objects" found in the source files.
2823 switch ( output_mode )
2830 RB_HTML_Generate_Index( document );
2833 /* RB_LaTeX_Generate_Index(dest, source); */
2834 /* Latex has a index by default */