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/>.
25 /****h* ROBODoc/Configuration
27 * Functions to access the ROBODoc configuration and configuration
28 * file (robodoc.rc) or the file specified with the --rc option.
30 * The robodoc.rc file consists of a number of blocks. Each
31 * block starts with a line of the form
35 * This is followed by a number of lines of data. Each line starts
36 * with at least one space followed by the actual data.
38 * This module parses this data and stores it in the global
42 * Is missing a lot of documentation.
44 * You can not use RB_Say() in this module since the --tell flag
45 * won't be parsed until after this module has finished.
48 * $Id: roboconfig.c,v 1.55 2007/07/10 19:13:52 gumpu Exp $
56 #include "headertypes.h"
58 #include "roboconfig.h"
60 #include "optioncheck.h"
67 /****v* Configuration/default_item_names
69 * Defines the names of items that ROBODoc recognized as
70 * items by default if none are specified in the
75 static char *default_item_names[] = {
76 "SOURCE", /* source code inclusion */
77 "NAME", /* Item name + short description */
78 "COPYRIGHT", /* who own the copyright : "(c) <year>-<year> by <company/person>" */
79 "SYNOPSIS", "USAGE", /* how to use it */
80 "FUNCTION", "DESCRIPTION", "PURPOSE", /* what does it */
81 "AUTHOR", /* who wrote it */
82 "CREATION DATE", /* when did the work start */
83 "MODIFICATION HISTORY", "HISTORY", /* who done what changes when */
84 "INPUTS", "ARGUMENTS", "OPTIONS", "PARAMETERS", "SWITCHES", /* what can we feed into it */
85 "OUTPUT", "SIDE EFFECTS", /* what output will be made */
86 "RESULT", "RETURN VALUE", /* what do we get returned */
87 "EXAMPLE", /* a clear example of the items use */
88 "NOTES", /* any annotations */
89 "DIAGNOSTICS", /* diagnostical output */
90 "WARNINGS", "ERRORS", /* warning & error-messages */
91 "BUGS", /* known bugs */
92 "TODO", "IDEAS", /* what to implement next & ideas */
93 "PORTABILITY", /* where does it come from, where will it work */
94 "SEE ALSO", /* references */
95 "METHODS", "NEW METHODS", /* oop methods */
96 "ATTRIBUTES", "NEW ATTRIBUTES", /* oop attributes */
97 "TAGS", /* tagitem description */
98 "COMMANDS", /* command description */
99 "DERIVED FROM", /* oop super class */
100 "DERIVED BY", /* oop sub class */
101 "USES", "CHILDREN", /* what modules are used by this one */
102 "USED BY", "PARENTS", /* which modules do use this */
103 NULL, /* don't delete, so we can count how many there are... */
108 static char *default_remark_begin_markers[] = {
116 static char *default_remark_end_markers[] = {
124 /****v* Configuration/c_keywords
126 * The default C keywords.
130 static char *c_keywords[] = {
166 // Some preprocessor directives
178 NULL, /* don't delete, so we can count how many there are... */
182 #define C_LINE_COMMENT "//"
183 #define C_BLOCK_COMMENT_START "/*"
184 #define C_BLOCK_COMMENT_END "*/"
189 // Default header separation character
190 static char *default_header_separate_chars[] = {
196 // Default header ignore character (to include remarks, version data, etc...)
197 static char *default_header_ignore_chars[] = {
203 /* Maximum length of a line in the configuration file */
204 #define BUFFER_LENGTH 2048
207 /****v* Configuration/configuration
209 * This global stores all the configuration parameters specified on
210 * the command line and in the robodoc.rc file.
214 struct RB_Configuration configuration;
219 static T_Block_Kind BlockKind(
221 static T_Line_Kind ConfigLineKind(
223 static void SecondScan(
225 static void Alloc_Parameters(
226 struct Parameters *parameters,
228 static void AddParameter(
230 struct Parameters *parameters );
231 static void GetParameters(
233 struct Parameters *parameters );
234 static void Install_Custom_HeaderTypes(
236 static void Complement_Remark_Markers(
238 static void ComplementItemNames(
240 static void ComplementHeaderMarkers(
246 /****v* Configuration/keywords_hash_mask
248 * Mask for keyword hash function.
249 * This mask reduces the hash value for the actual hash table size.
250 * Also the size of the hash table can be derived from this mask:
251 * hash table size = keywords_hash_mask + 1
254 static unsigned int keywords_hash_mask;
258 /****v* Configuration/keywords_hash
260 * This is the hash table for the keywords.
261 * See keywords_hash_s.
264 static struct keywords_hash_s **keywords_hash;
268 /****f* Configuration/allocate_keywords_hash_table
270 * Allocates space for the keyword hash table.
272 * The size of the table depends on the number of keywords rounded up to the
276 void allocate_keywords_hash_table(
284 // Calculate hash table size (powers of two)
285 for ( keywords_hash_mask = 2;
286 keywords_hash_mask < configuration.keywords.number;
287 keywords_hash_mask <<= 1 );
288 keywords_hash_mask -= 1;
290 // Allocate space for hash table
291 keywords_hash = RB_malloc( ( keywords_hash_mask + 1 ) *
292 sizeof( struct keywords_hash_s * ) );
295 for ( i = 0; i <= keywords_hash_mask; i++ )
297 keywords_hash[i] = NULL;
303 /****f* Configuration/Hash_Keyword
305 * Calculate the hash value for a string
307 * The hash value is based on the CRC32 hash function. It is then reduced by
308 * an AND operation to the actual size of the hash table.
311 unsigned long Hash_Keyword(
316 * - keyword -- The keyword string
317 * - len -- The length of the keyword string
319 * The hash value for the keyword.
323 // Generate hash value
324 return RB_crc32( ( unsigned char * ) keyword, len,
325 len ) & keywords_hash_mask;
331 /****f* Configuration/add_to_keywords_hash_table
333 * Add a keyword to the hash table
336 void add_to_keywords_hash_table(
340 * keyword -- The keyword string
344 struct keywords_hash_s *tmp, **curr;
347 // Allocate space for new entry in hash table
348 tmp = RB_malloc( sizeof( struct keywords_hash_s ) );
350 tmp->keyword = keyword;
353 // Calculate hash value
354 hash = Hash_Keyword( keyword, strlen( keyword ) );
356 // Seek to last element in hash table row
357 for ( curr = &( keywords_hash[hash] ); *curr;
358 curr = &( ( *curr )->next ) );
360 // Insert entry into hash table
367 /****f* Configuration/Find_Keyword
369 * Find a keyword in the hash table
377 * - keyword -- The keyword string
378 * - len -- The length of the keyword string
380 * - pointer to the found keyword string in hash table or
381 * - NULL if the keyword is not found
386 struct keywords_hash_s *curr;
388 // Calculate hash value
389 hash = Hash_Keyword( keyword, len );
391 // Seek through hash table row
392 for ( curr = keywords_hash[hash]; curr; curr = curr->next )
394 // Check for keyword in row element
395 if ( !strncmp( keyword, curr->keyword, len ) )
398 return curr->keyword;
409 /****f* Configuration/add_keywords_to_hash_table
411 * Initalize hash table and add all keywords from configuration.keywords
415 void add_keywords_to_hash_table(
420 // If nothing to add, exit
421 if ( !configuration.keywords.number )
424 // Make some allocations
426 allocate_keywords_hash_table( );
428 // Add keywords to hash table
429 for ( i = 0; i < configuration.keywords.number; i++ )
431 add_to_keywords_hash_table( configuration.keywords.names[i] );
438 /* TODO Documentation */
439 static void AllocOptions(
445 Alloc_Parameters( &( configuration.options ), argc );
446 for ( i = 0; i < argc; ++i )
448 AddParameter( argv[i], &( configuration.options ) );
453 /* TODO Documentation */
462 if ( Stat_Path( 'e', rcname ) && Stat_Path( 'f', rcname ) )
464 return RB_StrDup( rcname );
468 if ( strchr( rcname, ':' ) || strchr( rcname, '/' ) )
470 /* The rc names is a proper path, and not just a filename,
471 * we stop searching */
475 s = getenv( "HOME" );
478 if ( ( s = getenv( "HOMEDRIVE" ) )
479 && ( s2 = getenv( "HOMEPATH" ) ) )
481 /* HOMEDRIVE includes backslash */
483 ( char * ) malloc( sizeof( char ) *
484 ( strlen( s ) + strlen( s2 ) + 1 +
485 1 + strlen( rcname ) ) );
486 sprintf( path, "%s%s%c%s", s, s2, '\\', rcname );
496 ( char * ) malloc( sizeof( char ) *
497 ( strlen( s ) + 1 + 1 +
498 strlen( rcname ) ) );
499 sprintf( path, "%s%c%s", s, '/', rcname );
502 if ( path && Stat_Path( 'e', path ) && Stat_Path( 'f', path ) )
511 "/share/doc/robodoc/";
513 "/usr/local/robodoc/";
522 ( char * ) malloc( sizeof( char ) *
523 ( strlen( sitespecific ) + 1 +
524 strlen( rcname ) ) );
525 sprintf( path, "%s%s", sitespecific, rcname );
527 /* default failed -- try site-specific config file */
528 if ( Stat_Path( 'e', path ) && Stat_Path( 'f', path ) )
530 /* site-specific file can be stat'ed */
545 /****f* Configuration/ReadConfiguration
547 * Read the robodoc configuration file, and create
548 * a RB_Configuration structure.
552 char *ReadConfiguration(
558 * o argc -- the arg count as received by main()
559 * o argv -- the arg valules as received by main()
560 * o filename -- an optional filename. If none is given,
561 * "robodoc.rc" is used.
563 * An initialized configuration (a global).
572 path = Get_rc( filename );
575 f = fopen( path, "r" );
579 /* It should open as the user claimed it exists somewhere */
580 RB_Panic( "Can't open %s\n", filename );
585 /* Try the default rc file */
586 path = Get_rc( "robodoc.rc" );
589 f = fopen( path, "r" );
593 AllocOptions( argc, argv );
594 Alloc_Parameters( &( configuration.items ), 10 );
595 Alloc_Parameters( &( configuration.ignore_items ), 10 );
596 Alloc_Parameters( &( configuration.source_items ), 10 );
597 Alloc_Parameters( &( configuration.preformatted_items ), 10 );
598 Alloc_Parameters( &( configuration.format_items ), 10 );
599 Alloc_Parameters( &( configuration.item_order ), 10 );
601 Alloc_Parameters( &( configuration.custom_headertypes ), 10 );
602 Alloc_Parameters( &( configuration.ignore_files ), 10 );
603 Alloc_Parameters( &( configuration.accept_files ), 10 );
604 Alloc_Parameters( &( configuration.header_markers ), 10 );
605 Alloc_Parameters( &( configuration.remark_markers ), 10 );
606 Alloc_Parameters( &( configuration.end_markers ), 10 );
607 Alloc_Parameters( &( configuration.remark_begin_markers ), 10 );
608 Alloc_Parameters( &( configuration.remark_end_markers ), 10 );
609 Alloc_Parameters( &( configuration.keywords ), 10 );
610 Alloc_Parameters( &( configuration.source_line_comments ), 10 );
611 Alloc_Parameters( &( configuration.header_ignore_chars ), 10 );
612 Alloc_Parameters( &( configuration.header_separate_chars ), 10 );
621 /* No .rc file found. That's OK */
623 ComplementItemNames( );
624 ComplementHeaderMarkers( );
625 Complement_Remark_Markers( );
626 Install_Custom_HeaderTypes( );
628 // Make keywords hash table (if necessarry)
629 add_keywords_to_hash_table( );
631 assert( configuration.items.number );
639 /* TODO Documentation */
640 static void Complement_Remark_Markers(
645 if ( configuration.remark_begin_markers.number )
647 /* The user specified his own remark_begin_markers */
651 for ( i = 0; default_remark_begin_markers[i]; ++i )
653 AddParameter( default_remark_begin_markers[i],
654 &( configuration.remark_begin_markers ) );
658 if ( configuration.remark_end_markers.number )
660 /* The user specified his own remark_end_markers */
664 for ( i = 0; default_remark_end_markers[i]; ++i )
666 AddParameter( default_remark_end_markers[i],
667 &( configuration.remark_end_markers ) );
673 /****f* Configuration/Find_Parameter_Exact
675 * Checks for the existence of a given configuration parameter
676 * (exact string match)
679 char *Find_Parameter_Exact(
680 struct Parameters *params,
685 // we are looking for an exact match
686 for ( i = 0; i < params->number; i++ )
688 if ( !strcmp( params->names[i], paramname ) )
691 return params->names[i];
695 // parameter not found
701 /****f* Configuration/Find_Parameter_Partial
703 * Checks for the existence of a given configuration parameter
704 * (partial string match)
707 char *Find_Parameter_Partial(
708 struct Parameters *params,
713 // we are looking for a not exact match
714 for ( i = 0; i < params->number; i++ )
717 ( params->names[i], paramname, strlen( params->names[i] ) ) )
720 return params->names[i];
724 // parameter not found
731 /****f* Configuration/Find_Parameter_Char
733 * Checks for the existence of a given configuration parameter
737 char *Find_Parameter_Char(
738 struct Parameters *params,
743 for ( i = 0; i < params->number; i++ )
745 if ( params->names[i][0] == param )
748 return params->names[i];
752 // parameter not found
759 /****f* Configuration/Install_C_Syntax
761 * Install default C keywords and comments
764 void Install_C_Syntax(
769 // Check if we can install our default C keywords
770 if ( !configuration.keywords.number )
772 for ( i = 0; c_keywords[i]; i++ )
774 AddParameter( c_keywords[i], &( configuration.keywords ) );
777 // Make keywords hash table (if necessarry)
778 add_keywords_to_hash_table( );
781 // Make sure that C line comment is present
782 if ( Find_Parameter_Exact
783 ( &( configuration.source_line_comments ), C_LINE_COMMENT ) == NULL )
785 AddParameter( C_LINE_COMMENT,
786 &( configuration.source_line_comments ) );
790 // Make sure that C block comment start is present
791 if ( Find_Parameter_Exact
792 ( &( configuration.remark_begin_markers ),
793 C_BLOCK_COMMENT_START ) == NULL )
795 AddParameter( C_BLOCK_COMMENT_START,
796 &( configuration.remark_begin_markers ) );
799 // Make sure that C block comment end is present
800 if ( Find_Parameter_Exact
801 ( &( configuration.remark_end_markers ),
802 C_BLOCK_COMMENT_END ) == NULL )
804 AddParameter( C_BLOCK_COMMENT_END,
805 &( configuration.remark_end_markers ) );
814 /* TODO Documentation */
815 static void ComplementHeaderMarkers(
820 if ( configuration.header_markers.number )
822 /* The user specified his own header_markers */
826 for ( i = 0; header_markers[i]; ++i )
828 AddParameter( header_markers[i],
829 &( configuration.header_markers ) );
833 if ( configuration.remark_markers.number )
835 /* The user specified his own remark_markers */
839 for ( i = 0; remark_markers[i]; ++i )
841 AddParameter( remark_markers[i],
842 &( configuration.remark_markers ) );
846 if ( configuration.end_markers.number )
848 /* The user specified his own end_markers */
852 for ( i = 0; end_markers[i]; ++i )
854 AddParameter( end_markers[i], &( configuration.end_markers ) );
858 if ( configuration.header_separate_chars.number )
860 /* The user specified his own header_separate_chars */
864 for ( i = 0; default_header_separate_chars[i]; ++i )
866 AddParameter( default_header_separate_chars[i],
867 &( configuration.header_separate_chars ) );
871 if ( configuration.header_ignore_chars.number )
873 /* The user specified his own header_ignore_chars */
877 for ( i = 0; default_header_ignore_chars[i]; ++i )
879 AddParameter( default_header_ignore_chars[i],
880 &( configuration.header_ignore_chars ) );
887 /****if* Config/ConfigLineKind
889 * Deterimine the kind of line we a currently processing.
893 static T_Line_Kind ConfigLineKind(
897 * line -- the current line.
903 T_Line_Kind kind = CFL_UNKNOWN;
907 kind = CFL_EMPTYLINE;
909 else if ( *line == '#' )
913 else if ( utf8_isspace( *line ) )
915 char *cur_char = line;
917 for ( ; *cur_char && utf8_isspace( *cur_char ); ++cur_char )
921 if ( *cur_char == '\0' )
923 kind = CFL_EMPTYLINE;
927 /* There is atleast one non-space character */
928 kind = CFL_PARAMETER;
941 static T_Block_Kind BlockKind(
944 T_Block_Kind section_kind = SK_UNKNOWN;
946 if ( strcmp( line, "items:" ) == 0 )
948 section_kind = SK_ITEMS;
950 else if ( strcmp( line, "options:" ) == 0 )
952 section_kind = SK_OPTIONS;
954 else if ( strcmp( line, "extensions:" ) == 0 )
957 ( "Warning: the 'extensions:' block is obsolete, use 'ignore files:' instead\n" );
959 else if ( strcmp( line, "ignore items:" ) == 0 )
961 section_kind = SK_IGNOREITEMS;
963 else if ( strcmp( line, "source items:" ) == 0 )
965 section_kind = SK_SOURCE_ITEMS;
967 else if ( strcmp( line, "headertypes:" ) == 0 )
969 section_kind = SK_HEADERTYPES;
971 else if ( strcmp( line, "ignore files:" ) == 0 )
973 section_kind = SK_IGNORE_FILES;
975 else if ( strcmp( line, "accept files:" ) == 0 )
977 section_kind = SK_ACCEPT_FILES;
979 else if ( strcmp( line, "header markers:" ) == 0 )
981 section_kind = SK_HEADER_MARKERS;
983 else if ( strcmp( line, "remark markers:" ) == 0 )
985 section_kind = SK_REMARK_MARKERS;
987 else if ( strcmp( line, "end markers:" ) == 0 )
989 section_kind = SK_END_MARKERS;
991 else if ( strcmp( line, "remark begin markers:" ) == 0 )
993 section_kind = SK_REMARK_BEGIN_MARKERS;
995 else if ( strcmp( line, "remark end markers:" ) == 0 )
997 section_kind = SK_REMARK_END_MARKERS;
999 else if ( strcmp( line, "keywords:" ) == 0 )
1001 section_kind = SK_KEYWORDS;
1003 else if ( strcmp( line, "source line comments:" ) == 0 )
1005 section_kind = SK_SOURCE_LINE_COMMENTS;
1007 else if ( strcmp( line, "header ignore characters:" ) == 0 )
1009 section_kind = SK_HEADER_IGNORE_CHARS;
1011 else if ( strcmp( line, "header separate characters:" ) == 0 )
1013 section_kind = SK_HEADER_SEPARATE_CHARS;
1015 else if ( strcmp( line, "preformatted items:" ) == 0 )
1017 section_kind = SK_PREFORMATTED_ITEMS;
1019 else if ( strcmp( line, "format items:" ) == 0 )
1021 section_kind = SK_FORMAT_ITEMS;
1023 else if ( strcmp( line, "item order:" ) == 0 )
1025 section_kind = SK_ITEM_ORDER;
1029 RB_Panic( "unknown block kind \"%s\"\n", line );
1031 return section_kind;
1035 static void Install_Custom_HeaderTypes(
1039 struct Parameters headertype;
1040 unsigned int priority = 0;
1042 // Install custom header types
1043 for ( i = 0; i < configuration.custom_headertypes.number; i++ )
1045 // Allocate some default space for parameters
1046 Alloc_Parameters( &headertype, 10 );
1047 // Break current line into parameters
1048 GetParameters( configuration.custom_headertypes.names[i],
1051 // Check how many parameters do we have
1052 switch ( headertype.number )
1054 // 3 parameters -> no priority specified, assign default
1059 // 4 parameters -> priority specified, convert it
1061 priority = atoi( headertype.names[3] );
1064 // Any more or less parameters are illegal
1066 RB_Panic( "Error near header type: '%s'\n"
1067 "You must have either 3 or 4 parameters there !\n",
1068 headertype.names[0] );
1071 // Check if type character is legal
1072 if ( strlen( headertype.names[0] ) > 1 )
1074 RB_Panic( "Error near header type: '%s'\n"
1075 "Type character can only be one character long !\n",
1076 headertype.names[0] );
1079 // Add custom header type
1080 RB_AddHeaderType( headertype.names[0][0], headertype.names[1],
1081 headertype.names[2], priority );
1083 // Free temporary space
1084 free( headertype.names );
1090 static void Alloc_Parameters(
1091 struct Parameters *parameters,
1094 parameters->size = size;
1095 parameters->number = 0;
1096 parameters->names = calloc( size, sizeof( char * ) );
1100 /* TODO Documentation */
1101 static void AddParameter(
1103 struct Parameters *parameters )
1105 parameters->names[parameters->number] = RB_StrDup( name );
1106 parameters->number++;
1107 if ( parameters->number >= parameters->size )
1109 parameters->size *= 2;
1111 realloc( parameters->names, parameters->size * sizeof( char * ) );
1116 /****f* Configuration/GetParameters
1118 * Parse a line of text and store the individual words in
1119 * a Parameters structure. Words are seperated by spaces,
1120 * the exception are words surrounded by quotes. So:
1121 * aap noot mies "back to the future"
1122 * contains four words.
1124 * o line -- the line of text.
1125 * o parameters -- the set of parameters
1129 static void GetParameters(
1131 struct Parameters *parameters )
1134 int n = strlen( line );
1136 /* Remove any spaces at the end of the line */
1137 for ( i = n - 1; i >= 0 && utf8_isspace( line[i] ); --i )
1142 assert( i > 0 ); /* If i <= 0 then the line was empty
1143 and that cannot be, because this
1144 is supposed to be a parameter */
1146 /* Skip any white space at the begin of the line. */
1148 for ( i = 0; i < n && utf8_isspace( line[i] ); ++i )
1155 for ( i = 0; i < n; /* empty */ )
1159 if ( line[i] == '"' )
1161 /* It is quoted string, fetch everything until
1163 ++name; /* skip the double quote */
1164 for ( ++i; ( i < n ) && ( line[i] != '"' ); ++i )
1170 RB_Panic( "Missing quote in your .rc file in line:\n %s\n",
1175 #if defined(__APPLE__)
1176 /* hacked because of error when compiling on Mac OS X */
1177 assert( line[i] == 34 );
1179 assert( line[i] == '"' );
1182 AddParameter( name, parameters );
1187 /* a single word, find the next space */
1188 for ( ; ( i < n ) && !utf8_isspace( line[i] ); ++i )
1196 AddParameter( name, parameters );
1198 /* Is there anything left? */
1201 /* skip any spaces until the next parameter */
1202 ++i; /* first skip the nul character */
1205 for ( i = 0; ( i < n ) && utf8_isspace( line[i] ); ++i )
1220 struct Parameters *parameters )
1223 int n = strlen( line );
1225 /* Remove any spaces at the end of the line */
1226 for ( i = n - 1; i >= 0 && utf8_isspace( line[i] ); --i )
1230 assert( i > 0 ); /* If i <= 0 then the line was empty
1231 and that cannot be, because this
1232 is supposed to be a parameter */
1233 /* Skip any white space at the begin of the line. */
1235 for ( i = 0; i < n && utf8_isspace( line[i] ); ++i )
1241 AddParameter( line, parameters );
1247 void Free_Configuration(
1250 /* TODO Deallocate custom_headertypes */
1256 static void ComplementItemNames(
1259 if ( configuration.items.number )
1261 char *first_item = configuration.items.names[0];
1263 /* The SOURCE item is always included, and should be the
1265 configuration.items.names[0] = RB_StrDup( "SOURCE" );
1266 AddParameter( first_item, &( configuration.items ) );
1271 /* No item names were defined, so we use the default ones */
1274 for ( ; default_item_names[i]; ++i )
1276 AddParameter( default_item_names[i], &( configuration.items ) );
1282 /* TODO Documentation */
1285 static void SecondScan(
1288 char *myConfLine = NULL;
1289 int readConfChars = 0;
1290 T_Block_Kind section_kind = SK_UNKNOWN;
1291 T_Line_Kind line_kind = CFL_UNKNOWN;
1293 while ( !feof( f ) )
1297 myConfLine = RB_ReadWholeLine( f, line_buffer, &readConfChars );
1298 RB_StripCR( myConfLine );
1299 line_kind = ConfigLineKind( myConfLine );
1300 switch ( line_kind )
1303 case CFL_EMPTYLINE: /* fall through */
1307 section_kind = BlockKind( myConfLine );
1311 switch ( section_kind )
1314 GetParameter( myConfLine, &( configuration.items ) );
1317 GetParameters( myConfLine, &( configuration.options ) );
1319 case SK_IGNOREITEMS:
1320 GetParameter( myConfLine,
1321 &( configuration.ignore_items ) );
1323 case SK_SOURCE_ITEMS:
1324 GetParameter( myConfLine,
1325 &( configuration.source_items ) );
1327 case SK_HEADERTYPES:
1328 // Store all complete lines, they will be broken down later
1329 // in Install_Custom_HeaderTypes()
1330 GetParameter( myConfLine,
1331 &( configuration.custom_headertypes ) );
1333 case SK_IGNORE_FILES:
1334 GetParameters( myConfLine,
1335 &( configuration.ignore_files ) );
1337 case SK_ACCEPT_FILES:
1338 GetParameters( myConfLine,
1339 &( configuration.accept_files ) );
1341 case SK_HEADER_MARKERS:
1342 GetParameter( myConfLine,
1343 &( configuration.header_markers ) );
1345 case SK_REMARK_MARKERS:
1346 GetParameter( myConfLine,
1347 &( configuration.remark_markers ) );
1349 case SK_END_MARKERS:
1350 GetParameter( myConfLine,
1351 &( configuration.end_markers ) );
1353 case SK_REMARK_END_MARKERS:
1354 GetParameter( myConfLine,
1355 &( configuration.remark_end_markers ) );
1357 case SK_REMARK_BEGIN_MARKERS:
1358 GetParameter( myConfLine,
1359 &( configuration.remark_begin_markers ) );
1362 GetParameter( myConfLine, &( configuration.keywords ) );
1364 case SK_SOURCE_LINE_COMMENTS:
1365 GetParameter( myConfLine,
1366 &( configuration.source_line_comments ) );
1368 case SK_HEADER_IGNORE_CHARS:
1369 GetParameter( myConfLine,
1370 &( configuration.header_ignore_chars ) );
1372 case SK_HEADER_SEPARATE_CHARS:
1373 GetParameter( myConfLine,
1374 &( configuration.header_separate_chars ) );
1376 case SK_PREFORMATTED_ITEMS:
1377 GetParameter( myConfLine,
1378 &( configuration.preformatted_items ) );
1380 case SK_FORMAT_ITEMS:
1381 GetParameter( myConfLine,
1382 &( configuration.format_items ) );
1385 GetParameter( myConfLine,
1386 &( configuration.item_order ) );