Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/config.cpp

Source at commit 1322 created 12 years 8 months ago.
By meklort, Add doxygen to utils folder
1
2#line 3 "<stdout>"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define yy_create_buffer configYY_create_buffer
9#define yy_delete_buffer configYY_delete_buffer
10#define yy_flex_debug configYY_flex_debug
11#define yy_init_buffer configYY_init_buffer
12#define yy_flush_buffer configYY_flush_buffer
13#define yy_load_buffer_state configYY_load_buffer_state
14#define yy_switch_to_buffer configYY_switch_to_buffer
15#define yyin configYYin
16#define yyleng configYYleng
17#define yylex configYYlex
18#define yylineno configYYlineno
19#define yyout configYYout
20#define yyrestart configYYrestart
21#define yytext configYYtext
22#define yywrap configYYwrap
23#define yyalloc configYYalloc
24#define yyrealloc configYYrealloc
25#define yyfree configYYfree
26
27#define FLEX_SCANNER
28#define YY_FLEX_MAJOR_VERSION 2
29#define YY_FLEX_MINOR_VERSION 5
30#define YY_FLEX_SUBMINOR_VERSION 35
31#if YY_FLEX_SUBMINOR_VERSION > 0
32#define FLEX_BETA
33#endif
34
35/* First, we deal with platform-specific or compiler-specific issues. */
36
37/* begin standard C headers. */
38#include <stdio.h>
39#include <string.h>
40#include <errno.h>
41#include <stdlib.h>
42
43/* end standard C headers. */
44
45/* flex integer type definitions */
46
47#ifndef FLEXINT_H
48#define FLEXINT_H
49
50/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
56 */
57#ifndef __STDC_LIMIT_MACROS
58#define __STDC_LIMIT_MACROS 1
59#endif
60
61#include <inttypes.h>
62typedef int8_t flex_int8_t;
63typedef uint8_t flex_uint8_t;
64typedef int16_t flex_int16_t;
65typedef uint16_t flex_uint16_t;
66typedef int32_t flex_int32_t;
67typedef uint32_t flex_uint32_t;
68#else
69typedef signed char flex_int8_t;
70typedef short int flex_int16_t;
71typedef int flex_int32_t;
72typedef unsigned char flex_uint8_t;
73typedef unsigned short int flex_uint16_t;
74typedef unsigned int flex_uint32_t;
75#endif /* ! C99 */
76
77/* Limits of integral types. */
78#ifndef INT8_MIN
79#define INT8_MIN (-128)
80#endif
81#ifndef INT16_MIN
82#define INT16_MIN (-32767-1)
83#endif
84#ifndef INT32_MIN
85#define INT32_MIN (-2147483647-1)
86#endif
87#ifndef INT8_MAX
88#define INT8_MAX (127)
89#endif
90#ifndef INT16_MAX
91#define INT16_MAX (32767)
92#endif
93#ifndef INT32_MAX
94#define INT32_MAX (2147483647)
95#endif
96#ifndef UINT8_MAX
97#define UINT8_MAX (255U)
98#endif
99#ifndef UINT16_MAX
100#define UINT16_MAX (65535U)
101#endif
102#ifndef UINT32_MAX
103#define UINT32_MAX (4294967295U)
104#endif
105
106#endif /* ! FLEXINT_H */
107
108#ifdef __cplusplus
109
110/* The "const" storage-class-modifier is valid. */
111#define YY_USE_CONST
112
113#else/* ! __cplusplus */
114
115/* C99 requires __STDC__ to be defined as 1. */
116#if defined (__STDC__)
117
118#define YY_USE_CONST
119
120#endif/* defined (__STDC__) */
121#endif/* ! __cplusplus */
122
123#ifdef YY_USE_CONST
124#define yyconst const
125#else
126#define yyconst
127#endif
128
129/* Returned upon end-of-file. */
130#define YY_NULL 0
131
132/* Promotes a possibly negative, possibly signed char to an unsigned
133 * integer for use as an array index. If the signed char is negative,
134 * we want to instead treat it as an 8-bit unsigned char, hence the
135 * double cast.
136 */
137#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
138
139/* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
142 */
143#define BEGIN (yy_start) = 1 + 2 *
144
145/* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
147 * compatibility.
148 */
149#define YY_START (((yy_start) - 1) / 2)
150#define YYSTATE YY_START
151
152/* Action number for EOF rule of a given start state. */
153#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155/* Special action meaning "start processing a new file". */
156#define YY_NEW_FILE configYYrestart(configYYin )
157
158#define YY_END_OF_BUFFER_CHAR 0
159
160/* Size of default input buffer. */
161#ifndef YY_BUF_SIZE
162#define YY_BUF_SIZE 16384
163#endif
164
165/* The state buf must be large enough to hold one state per character in the main buffer.
166 */
167#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168
169#ifndef YY_TYPEDEF_YY_BUFFER_STATE
170#define YY_TYPEDEF_YY_BUFFER_STATE
171typedef struct yy_buffer_state *YY_BUFFER_STATE;
172#endif
173
174#ifndef YY_TYPEDEF_YY_SIZE_T
175#define YY_TYPEDEF_YY_SIZE_T
176typedef size_t yy_size_t;
177#endif
178
179extern yy_size_t configYYleng;
180
181extern FILE *configYYin, *configYYout;
182
183#define EOB_ACT_CONTINUE_SCAN 0
184#define EOB_ACT_END_OF_FILE 1
185#define EOB_ACT_LAST_MATCH 2
186
187 #define YY_LESS_LINENO(n)
188
189/* Return all but the first "n" matched characters back to the input stream. */
190#define yyless(n) \
191do \
192{ \
193/* Undo effects of setting up configYYtext. */ \
194 int yyless_macro_arg = (n); \
195 YY_LESS_LINENO(yyless_macro_arg);\
196*yy_cp = (yy_hold_char); \
197YY_RESTORE_YY_MORE_OFFSET \
198(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
199YY_DO_BEFORE_ACTION; /* set up configYYtext again */ \
200} \
201while ( 0 )
202
203#define unput(c) yyunput( c, (yytext_ptr) )
204
205#ifndef YY_STRUCT_YY_BUFFER_STATE
206#define YY_STRUCT_YY_BUFFER_STATE
207struct yy_buffer_state
208{
209FILE *yy_input_file;
210
211char *yy_ch_buf;/* input buffer */
212char *yy_buf_pos;/* current position in input buffer */
213
214/* Size of input buffer in bytes, not including room for EOB
215 * characters.
216 */
217yy_size_t yy_buf_size;
218
219/* Number of characters read into yy_ch_buf, not including EOB
220 * characters.
221 */
222yy_size_t yy_n_chars;
223
224/* Whether we "own" the buffer - i.e., we know we created it,
225 * and can realloc() it to grow it, and should free() it to
226 * delete it.
227 */
228int yy_is_our_buffer;
229
230/* Whether this is an "interactive" input source; if so, and
231 * if we're using stdio for input, then we want to use getc()
232 * instead of fread(), to make sure we stop fetching input after
233 * each newline.
234 */
235int yy_is_interactive;
236
237/* Whether we're considered to be at the beginning of a line.
238 * If so, '^' rules will be active on the next match, otherwise
239 * not.
240 */
241int yy_at_bol;
242
243 int yy_bs_lineno; /**< The line count. */
244 int yy_bs_column; /**< The column count. */
245
246/* Whether to try to fill the input buffer when we reach the
247 * end of it.
248 */
249int yy_fill_buffer;
250
251int yy_buffer_status;
252
253#define YY_BUFFER_NEW 0
254#define YY_BUFFER_NORMAL 1
255/* When an EOF's been seen but there's still some text to process
256 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257 * shouldn't try reading from the input source any more. We might
258 * still have a bunch of tokens to match, though, because of
259 * possible backing-up.
260 *
261 * When we actually see the EOF, we change the status to "new"
262 * (via configYYrestart()), so that the user can continue scanning by
263 * just pointing configYYin at a new input file.
264 */
265#define YY_BUFFER_EOF_PENDING 2
266
267};
268#endif /* !YY_STRUCT_YY_BUFFER_STATE */
269
270/* Stack of input buffers. */
271static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
272static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
273static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
274
275/* We provide macros for accessing buffer states in case in the
276 * future we want to put the buffer states in a more general
277 * "scanner state".
278 *
279 * Returns the top of the stack, or NULL.
280 */
281#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
283 : NULL)
284
285/* Same as previous macro, but useful when we know that the buffer stack is not
286 * NULL or when we need an lvalue. For internal use only.
287 */
288#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
289
290/* yy_hold_char holds the character lost when configYYtext is formed. */
291static char yy_hold_char;
292static yy_size_t yy_n_chars;/* number of characters read into yy_ch_buf */
293yy_size_t configYYleng;
294
295/* Points to current character in buffer. */
296static char *yy_c_buf_p = (char *) 0;
297static int yy_init = 0;/* whether we need to initialize */
298static int yy_start = 0;/* start state number */
299
300/* Flag which is used to allow configYYwrap()'s to do buffer switches
301 * instead of setting up a fresh configYYin. A bit of a hack ...
302 */
303static int yy_did_buffer_switch_on_eof;
304
305void configYYrestart (FILE *input_file );
306void configYY_switch_to_buffer (YY_BUFFER_STATE new_buffer );
307YY_BUFFER_STATE configYY_create_buffer (FILE *file,int size );
308void configYY_delete_buffer (YY_BUFFER_STATE b );
309void configYY_flush_buffer (YY_BUFFER_STATE b );
310void configYYpush_buffer_state (YY_BUFFER_STATE new_buffer );
311void configYYpop_buffer_state (void );
312
313static void configYYensure_buffer_stack (void );
314static void configYY_load_buffer_state (void );
315static void configYY_init_buffer (YY_BUFFER_STATE b,FILE *file );
316
317#define YY_FLUSH_BUFFER configYY_flush_buffer(YY_CURRENT_BUFFER )
318
319YY_BUFFER_STATE configYY_scan_buffer (char *base,yy_size_t size );
320YY_BUFFER_STATE configYY_scan_string (yyconst char *yy_str );
321YY_BUFFER_STATE configYY_scan_bytes (yyconst char *bytes,yy_size_t len );
322
323void *configYYalloc (yy_size_t );
324void *configYYrealloc (void *,yy_size_t );
325void configYYfree (void * );
326
327#define yy_new_buffer configYY_create_buffer
328
329#define yy_set_interactive(is_interactive) \
330{ \
331if ( ! YY_CURRENT_BUFFER ){ \
332 configYYensure_buffer_stack (); \
333YY_CURRENT_BUFFER_LVALUE = \
334 configYY_create_buffer(configYYin,YY_BUF_SIZE ); \
335} \
336YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
337}
338
339#define yy_set_bol(at_bol) \
340{ \
341if ( ! YY_CURRENT_BUFFER ){\
342 configYYensure_buffer_stack (); \
343YY_CURRENT_BUFFER_LVALUE = \
344 configYY_create_buffer(configYYin,YY_BUF_SIZE ); \
345} \
346YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
347}
348
349#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
350
351/* Begin user sect3 */
352
353#define configYYwrap(n) 1
354#define YY_SKIP_YYWRAP
355
356typedef unsigned char YY_CHAR;
357
358FILE *configYYin = (FILE *) 0, *configYYout = (FILE *) 0;
359
360typedef int yy_state_type;
361
362extern int configYYlineno;
363
364int configYYlineno = 1;
365
366extern char *configYYtext;
367#define yytext_ptr configYYtext
368
369static yy_state_type yy_get_previous_state (void );
370static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
371static int yy_get_next_buffer (void );
372static void yy_fatal_error (yyconst char msg[] );
373
374/* Done after the current pattern has been matched and before the
375 * corresponding action - sets up configYYtext.
376 */
377#define YY_DO_BEFORE_ACTION \
378(yytext_ptr) = yy_bp; \
379configYYleng = (size_t) (yy_cp - yy_bp); \
380(yy_hold_char) = *yy_cp; \
381*yy_cp = '\0'; \
382(yy_c_buf_p) = yy_cp;
383
384#define YY_NUM_RULES 24
385#define YY_END_OF_BUFFER 25
386/* This struct is not used in this scanner,
387 but its presence is necessary. */
388struct yy_trans_info
389{
390flex_int32_t yy_verify;
391flex_int32_t yy_nxt;
392};
393static yyconst flex_int16_t yy_accept[100] =
394 { 0,
395 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
396 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
397 25, 22, 23, 22, 22, 2, 8, 22, 8, 19,
398 22, 9, 13, 12, 2, 12, 12, 17, 18, 11,
399 10, 18, 18, 16, 14, 14, 16, 16, 7, 22,
400 7, 7, 0, 21, 0, 8, 0, 0, 0, 8,
401 3, 0, 20, 12, 12, 17, 18, 11, 18, 15,
402 7, 0, 7, 0, 0, 4, 12, 18, 7, 7,
403 1, 0, 1, 1, 1, 0, 0, 0, 0, 0,
404 6, 0, 0, 0, 0, 0, 0, 5, 0
405
406 } ;
407
408static yyconst flex_int32_t yy_ec[256] =
409 { 0,
410 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
411 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
414 1, 1, 7, 1, 1, 1, 1, 8, 9, 9,
415 9, 9, 9, 9, 9, 9, 9, 1, 1, 1,
416 10, 1, 1, 11, 12, 13, 14, 15, 16, 13,
417 13, 17, 18, 13, 13, 19, 13, 20, 13, 21,
418 13, 13, 13, 22, 23, 13, 13, 13, 13, 13,
419 1, 24, 1, 1, 25, 1, 13, 13, 13, 26,
420
421 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
422 13, 13, 13, 13, 13, 13, 13, 13, 13, 27,
423 13, 13, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1
438 } ;
439
440static yyconst flex_int32_t yy_meta[29] =
441 { 0,
442 1, 2, 3, 4, 3, 5, 6, 7, 7, 6,
443 1, 8, 8, 8, 8, 8, 8, 8, 8, 8,
444 8, 8, 8, 1, 7, 8, 8, 1
445 } ;
446
447static yyconst flex_int16_t yy_base[112] =
448 { 0,
449 0, 1, 29, 0, 55, 56, 82, 108, 135, 162,
450 190, 0, 217, 244, 58, 65, 66, 68, 271, 298,
451 145, 408, 408, 3, 117, 408, 0, 125, 6, 408,
452 7, 408, 408, 0, 0, 15, 115, 0, 0, 133,
453 408, 18, 107, 408, 408, 408, 62, 106, 0, 0,
454 70, 104, 73, 408, 122, 0, 109, 93, 118, 95,
455 408, 105, 408, 0, 118, 0, 0, 123, 116, 408,
456 0, 117, 113, 94, 105, 408, 92, 91, 408, 90,
457 408, 82, 0, 0, 0, 75, 66, 62, 102, 13,
458 408, 41, 48, 5, 9, 89, 113, 408, 408, 326,
459
460 334, 342, 350, 358, 360, 367, 375, 4, 383, 391,
461 399
462 } ;
463
464static yyconst flex_int16_t yy_def[112] =
465 { 0,
466 100, 100, 99, 3, 100, 100, 100, 100, 101, 101,
467 99, 11, 102, 102, 103, 103, 100, 100, 104, 104,
468 99, 99, 99, 99, 99, 99, 105, 99, 106, 99,
469 99, 99, 99, 107, 107, 107, 107, 108, 109, 99,
470 99, 109, 109, 99, 99, 99, 99, 99, 110, 111,
471 110, 110, 99, 99, 99, 105, 99, 99, 99, 106,
472 99, 99, 99, 107, 107, 108, 109, 99, 109, 99,
473 110, 111, 110, 99, 99, 99, 107, 109, 99, 110,
474 99, 99, 107, 109, 110, 99, 99, 99, 99, 99,
475 99, 99, 99, 99, 99, 99, 99, 99, 0, 99,
476
477 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
478 99
479 } ;
480
481static yyconst flex_int16_t yy_nxt[437] =
482 { 0,
483 99, 99, 23, 23, 53, 54, 53, 58, 62, 63,
484 62, 66, 59, 99, 90, 61, 53, 54, 53, 53,
485 54, 53, 91, 24, 24, 96, 95, 25, 25, 22,
486 22, 23, 22, 22, 26, 22, 27, 27, 22, 28,
487 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
488 29, 29, 24, 29, 29, 29, 25, 30, 30, 94,
489 45, 93, 46, 53, 54, 53, 70, 45, 23, 46,
490 23, 53, 54, 53, 53, 54, 53, 89, 31, 31,
491 88, 47, 25, 25, 32, 48, 33, 26, 47, 24,
492 97, 24, 48, 25, 58, 25, 58, 87, 98, 59,
493
494 86, 59, 61, 90, 61, 24, 62, 63, 62, 25,
495 32, 91, 33, 26, 97, 85, 84, 83, 82, 81,
496 80, 79, 98, 78, 68, 77, 92, 76, 75, 74,
497 73, 24, 55, 69, 68, 25, 22, 32, 22, 33,
498 35, 65, 57, 55, 99, 99, 99, 99, 99, 99,
499 99, 99, 99, 99, 99, 99, 99, 99, 36, 99,
500 99, 99, 37, 22, 32, 22, 33, 35, 99, 99,
501 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
502 99, 99, 99, 99, 99, 36, 99, 99, 99, 37,
503 22, 22, 32, 22, 22, 26, 22, 22, 22, 22,
504
505 22, 38, 38, 38, 38, 38, 38, 38, 38, 38,
506 38, 38, 38, 24, 22, 38, 38, 25, 40, 41,
507 22, 33, 26, 99, 99, 99, 99, 99, 99, 99,
508 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
509 42, 99, 99, 99, 43, 40, 41, 22, 33, 26,
510 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
511 99, 99, 99, 99, 99, 99, 99, 42, 99, 99,
512 99, 43, 22, 23, 22, 50, 99, 99, 99, 99,
513 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
514 99, 99, 99, 99, 51, 99, 99, 99, 52, 22,
515
516 23, 22, 50, 99, 99, 99, 99, 99, 99, 99,
517 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
518 99, 51, 99, 99, 99, 52, 22, 22, 22, 22,
519 22, 22, 22, 22, 34, 34, 34, 34, 34, 34,
520 34, 34, 39, 39, 39, 39, 39, 39, 39, 39,
521 44, 44, 44, 44, 44, 44, 44, 44, 49, 49,
522 49, 49, 49, 49, 49, 49, 56, 56, 60, 99,
523 99, 99, 60, 60, 60, 64, 99, 99, 99, 64,
524 64, 64, 64, 67, 99, 99, 99, 99, 67, 67,
525 67, 71, 99, 99, 99, 71, 71, 71, 71, 72,
526
527 72, 99, 72, 72, 72, 72, 72, 21, 99, 99,
528 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
529 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
530 99, 99, 99, 99, 99, 99
531 } ;
532
533static yyconst flex_int16_t yy_chk[437] =
534 { 0,
535 0, 0, 1, 2, 24, 24, 24, 29, 31, 31,
536 31, 108, 29, 0, 90, 29, 36, 36, 36, 42,
537 42, 42, 90, 1, 2, 95, 94, 1, 2, 3,
538 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
539 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
540 3, 3, 3, 3, 3, 3, 3, 5, 6, 93,
541 15, 92, 15, 47, 47, 47, 47, 16, 17, 16,
542 18, 51, 51, 51, 53, 53, 53, 88, 5, 6,
543 87, 15, 5, 6, 7, 15, 7, 7, 16, 17,
544 96, 18, 16, 17, 58, 18, 60, 86, 96, 58,
545
546 82, 60, 58, 89, 60, 7, 62, 62, 62, 7,
547 8, 89, 8, 8, 97, 80, 78, 77, 75, 74,
548 73, 72, 97, 69, 68, 65, 89, 59, 57, 55,
549 52, 8, 48, 43, 40, 8, 9, 9, 9, 9,
550 9, 37, 28, 25, 21, 0, 0, 0, 0, 0,
551 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,
552 0, 0, 9, 10, 10, 10, 10, 10, 0, 0,
553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
554 0, 0, 0, 0, 0, 10, 0, 0, 0, 10,
555 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
556
557 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
558 11, 11, 11, 11, 11, 11, 11, 11, 13, 13,
559 13, 13, 13, 0, 0, 0, 0, 0, 0, 0,
560 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
561 13, 0, 0, 0, 13, 14, 14, 14, 14, 14,
562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
563 0, 0, 0, 0, 0, 0, 0, 14, 0, 0,
564 0, 14, 19, 19, 19, 19, 0, 0, 0, 0,
565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
566 0, 0, 0, 0, 19, 0, 0, 0, 19, 20,
567
568 20, 20, 20, 0, 0, 0, 0, 0, 0, 0,
569 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
570 0, 20, 0, 0, 0, 20, 100, 100, 100, 100,
571 100, 100, 100, 100, 101, 101, 101, 101, 101, 101,
572 101, 101, 102, 102, 102, 102, 102, 102, 102, 102,
573 103, 103, 103, 103, 103, 103, 103, 103, 104, 104,
574 104, 104, 104, 104, 104, 104, 105, 105, 106, 0,
575 0, 0, 106, 106, 106, 107, 0, 0, 0, 107,
576 107, 107, 107, 109, 0, 0, 0, 0, 109, 109,
577 109, 110, 0, 0, 0, 110, 110, 110, 110, 111,
578
579 111, 0, 111, 111, 111, 111, 111, 99, 99, 99,
580 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
581 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
582 99, 99, 99, 99, 99, 99
583 } ;
584
585static yy_state_type yy_last_accepting_state;
586static char *yy_last_accepting_cpos;
587
588extern int configYY_flex_debug;
589int configYY_flex_debug = 0;
590
591/* The intent behind this definition is that it'll catch
592 * any uses of REJECT which flex missed.
593 */
594#define REJECT reject_used_but_not_detected
595#define yymore() yymore_used_but_not_detected
596#define YY_MORE_ADJ 0
597#define YY_RESTORE_YY_MORE_OFFSET
598char *configYYtext;
599#line 1 "config.l"
600/******************************************************************************
601 *
602 * $Id: config_templ.l,v 1.8 2001/01/01 10:15:16 root Exp $
603 *
604 * Copyright (C) 1997-2011 by Dimitri van Heesch.
605 *
606 * Permission to use, copy, modify, and distribute this software and its
607 * documentation under the terms of the GNU General Public License is hereby
608 * granted. No representations are made about the suitability of this software
609 * for any purpose. It is provided "as is" without express or implied warranty.
610 * See the GNU General Public License for more details.
611 *
612 */
613#line 16 "config.l"
614
615/*
616 *includes
617 */
618#include <stdio.h>
619#include <stdlib.h>
620#include <assert.h>
621#include <ctype.h>
622#include <stdarg.h>
623#include <errno.h>
624
625#include <qfileinfo.h>
626#include <qdir.h>
627#include <qtextstream.h>
628#include <qregexp.h>
629#include <qstack.h>
630#include <qglobal.h>
631
632#include "config.h"
633#include "version.h"
634#include "portable.h"
635#include "util.h"
636
637#include "lang_cfg.h"
638#include "configoptions.h"
639
640#undef Config_getString
641#undef Config_getInt
642#undef Config_getList
643#undef Config_getEnum
644#undef Config_getBool
645
646// use in-class definitions
647#define Config_getString(val) getString(__FILE__,__LINE__,val)
648#define Config_getInt(val) getInt(__FILE__,__LINE__,val)
649#define Config_getList(val) getList(__FILE__,__LINE__,val)
650#define Config_getEnum(val) getEnum(__FILE__,__LINE__,val)
651#define Config_getBool(val) getBool(__FILE__,__LINE__,val)
652
653void config_err(const char *fmt, ...)
654{
655 va_list args;
656 va_start(args, fmt);
657 vfprintf(stderr, fmt, args);
658 va_end(args);
659}
660void config_warn(const char *fmt, ...)
661{
662 va_list args;
663 va_start(args, fmt);
664 vfprintf(stderr, fmt, args);
665 va_end(args);
666}
667
668static QCString configStringRecode(
669 const QCString &str,
670 const char *fromEncoding,
671 const char *toEncoding);
672
673#define MAX_INCLUDE_DEPTH 10
674#define YY_NEVER_INTERACTIVE 1
675
676/* -----------------------------------------------------------------
677 */
678QCString ConfigOption::convertToComment(const QCString &s)
679{
680 QCString result;
681 if (s.isEmpty()) return result;
682 else
683 {
684 QCString tmp=s.stripWhiteSpace();
685 char *p=tmp.data();
686 char c;
687 result+="#";
688 if (*p && *p!='\n')
689 result+=" ";
690 while ((c=*p++))
691 {
692 if (c=='\n')
693 {
694 result+="\n#";
695 if (*p && *p!='\n')
696 result+=" ";
697 }
698 else result+=c;
699 }
700 result+='\n';
701 }
702 return result;
703}
704
705void ConfigOption::writeBoolValue(FTextStream &t,bool v)
706{
707 t << " ";
708 if (v) t << "YES"; else t << "NO";
709}
710
711void ConfigOption::writeIntValue(FTextStream &t,int i)
712{
713 t << " " << i;
714}
715
716void ConfigOption::writeStringValue(FTextStream &t,QCString &s)
717{
718 char c;
719 bool needsEscaping=FALSE;
720 // convert the string back to it original encoding
721 QCString se = configStringRecode(s,"UTF-8",m_encoding);
722 const char *p=se.data();
723 if (p)
724 {
725 t << " ";
726 while ((c=*p++)!=0 && !needsEscaping)
727 needsEscaping = (c==' ' || c=='\n' || c=='\t' || c=='"' || c=='#');
728 if (needsEscaping)
729 {
730 t << "\"";
731 p=se.data();
732 while (*p)
733 {
734if (*p==' ' && *(p+1)=='\0') break; // skip inserted space at the end
735if (*p=='"') t << "\\"; // escape quotes
736t << *p++;
737 }
738 t << "\"";
739 }
740 else
741 {
742 t << se;
743 }
744 }
745}
746
747void ConfigOption::writeStringList(FTextStream &t,QStrList &l)
748{
749 const char *p = l.first();
750 bool first=TRUE;
751 while (p)
752 {
753 QCString s=p;
754 if (!first)
755 t << " ";
756 first=FALSE;
757 writeStringValue(t,s);
758 p = l.next();
759 if (p) t << " \\" << endl;
760 }
761}
762
763/* -----------------------------------------------------------------
764 */
765
766Config *Config::m_instance = 0;
767
768void ConfigInt::convertStrToVal()
769{
770 if (!m_valueString.isEmpty())
771 {
772 bool ok;
773 int val = m_valueString.toInt(&ok);
774 if (!ok || val<m_minVal || val>m_maxVal)
775 {
776 config_warn("warning: argument `%s' for option %s is not a valid number in the range [%d..%d]!\n"
777 "Using the default: %d!\n",m_valueString.data(),m_name.data(),m_minVal,m_maxVal,m_value);
778 }
779 m_value=val;
780 }
781}
782
783void ConfigBool::convertStrToVal()
784{
785 QCString val = m_valueString.stripWhiteSpace().lower();
786 if (!val.isEmpty())
787 {
788 if (val=="yes" || val=="true" || val=="1" || val=="all")
789 {
790 m_value=TRUE;
791 }
792 else if (val=="no" || val=="false" || val=="0" || val=="none")
793 {
794 m_value=FALSE;
795 }
796 else
797 {
798 config_warn("warning: argument `%s' for option %s is not a valid boolean value\n"
799 "Using the default: %s!\n",m_valueString.data(),m_name.data(),m_value?"YES":"NO");
800 }
801 }
802}
803
804QCString &Config::getString(const char *fileName,int num,const char *name) const
805{
806 ConfigOption *opt = m_dict->find(name);
807 if (opt==0)
808 {
809 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
810 exit(1);
811 }
812 else if (opt->kind()!=ConfigOption::O_String)
813 {
814 config_err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
815 exit(1);
816 }
817 return *((ConfigString *)opt)->valueRef();
818}
819
820QStrList &Config::getList(const char *fileName,int num,const char *name) const
821{
822 ConfigOption *opt = m_dict->find(name);
823 if (opt==0)
824 {
825 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
826 exit(1);
827 }
828 else if (opt->kind()!=ConfigOption::O_List)
829 {
830 config_err("%d<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
831 exit(1);
832 }
833 return *((ConfigList *)opt)->valueRef();
834}
835
836QCString &Config::getEnum(const char *fileName,int num,const char *name) const
837{
838 ConfigOption *opt = m_dict->find(name);
839 if (opt==0)
840 {
841 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
842 exit(1);
843 }
844 else if (opt->kind()!=ConfigOption::O_Enum)
845 {
846 config_err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
847 exit(1);
848 }
849 return *((ConfigEnum *)opt)->valueRef();
850}
851
852int &Config::getInt(const char *fileName,int num,const char *name) const
853{
854 ConfigOption *opt = m_dict->find(name);
855 if (opt==0)
856 {
857 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
858 exit(1);
859 }
860 else if (opt->kind()!=ConfigOption::O_Int)
861 {
862 config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
863 exit(1);
864 }
865 return *((ConfigInt *)opt)->valueRef();
866}
867
868bool &Config::getBool(const char *fileName,int num,const char *name) const
869{
870 ConfigOption *opt = m_dict->find(name);
871 if (opt==0)
872 {
873 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
874 exit(1);
875 }
876 else if (opt->kind()!=ConfigOption::O_Bool)
877 {
878 config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
879 exit(1);
880 }
881 return *((ConfigBool *)opt)->valueRef();
882}
883
884/* -----------------------------------------------------------------
885 */
886
887void ConfigInt::writeXML(FTextStream& t)
888{
889 t << " <option type='int' "
890 "id='" << convertToXML(name()) << "' "
891 "docs='\n" << convertToXML(docs()) << "' "
892 "minval='" << m_minVal << "' "
893 "maxval='" << m_maxVal << "' "
894 "defval='" << m_defValue << "'";
895 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
896 t << "/>" << endl;
897}
898
899void ConfigBool::writeXML(FTextStream& t)
900{
901 t << " <option type='bool' "
902 "id='" << convertToXML(name()) << "' "
903 "docs='\n" << convertToXML(docs()) << "' "
904 "defval='" << m_defValue << "'";
905 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
906 t << "/>" << endl;
907}
908
909void ConfigString::writeXML(FTextStream& t)
910{
911 QString format;
912 switch (m_widgetType)
913 {
914 case String: format="string"; break;
915 case File: format="file"; break;
916 case Dir: format="dir"; break;
917 }
918 t << " <option type='string' "
919 "id='" << convertToXML(name()) << "' "
920 "format='" << format << "' "
921 "docs='\n" << convertToXML(docs()) << "' "
922 "defval='" << convertToXML(m_defValue) << "'";
923 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
924 t << "/>" << endl;
925}
926
927void ConfigEnum::writeXML(FTextStream &t)
928{
929 t << " <option type='enum' "
930 "id='" << convertToXML(name()) << "' "
931 "defval='" << convertToXML(m_defValue) << "' "
932 "docs='\n" << convertToXML(docs()) << "'";
933 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
934 t << ">" << endl;
935
936 char *enumVal = m_valueRange.first();
937 while (enumVal)
938 {
939 t << " <value name='" << convertToXML(enumVal) << "'/>" << endl;
940 enumVal = m_valueRange.next();
941 }
942
943 t << " </option>" << endl;
944}
945
946void ConfigList::writeXML(FTextStream &t)
947{
948 QString format;
949 switch (m_widgetType)
950 {
951 case String: format="string"; break;
952 case File: format="file"; break;
953 case Dir: format="dir"; break;
954 case FileAndDir: format="filedir"; break;
955 }
956 t << " <option type='list' "
957 "id='" << convertToXML(name()) << "' "
958 "format='" << format << "' "
959 "docs='\n" << convertToXML(docs()) << "'";
960 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
961 t << ">" << endl;
962 char *enumVal = m_value.first();
963 while (enumVal)
964 {
965 t << " <value name='" << convertToXML(enumVal) << "'/>" << endl;
966 enumVal = m_value.next();
967 }
968
969 t << " </option>" << endl;
970}
971
972void ConfigObsolete::writeXML(FTextStream &t)
973{
974 t << " <option type='obsolete' "
975 "id='" << convertToXML(name()) << "'/>" << endl;
976}
977
978
979/* -----------------------------------------------------------------
980 *
981 *static variables
982 */
983
984struct ConfigFileState
985{
986 int lineNr;
987 FILE *filePtr;
988 YY_BUFFER_STATE oldState;
989 YY_BUFFER_STATE newState;
990 QCString fileName;
991};
992
993static const char *inputString;
994static int inputPosition;
995static int yyLineNr;
996static QCString yyFileName;
997static QCString tmpString;
998static QCString *s=0;
999static bool *b=0;
1000static QStrList *l=0;
1001static int lastState;
1002static QCString elemStr;
1003static QCString includeName;
1004static QStrList includePathList;
1005static QStack<ConfigFileState> includeStack;
1006static int includeDepth;
1007
1008static QCString tabSizeString;
1009static QCString maxInitLinesString;
1010static QCString colsInAlphaIndexString;
1011static QCString enumValuesPerLineString;
1012static QCString treeViewWidthString;
1013static QCString maxDotGraphWidthString;
1014static QCString maxDotGraphHeightString;
1015static QCString encoding;
1016
1017static Config *config;
1018
1019/* -----------------------------------------------------------------
1020 */
1021#undefYY_INPUT
1022#defineYY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
1023
1024static int yyread(char *buf,int max_size)
1025{
1026 // no file included
1027 if (includeStack.isEmpty())
1028 {
1029 int c=0;
1030if (inputString==0) return c;
1031while( c < max_size && inputString[inputPosition] )
1032{
1033 *buf = inputString[inputPosition++] ;
1034 c++; buf++;
1035 }
1036return c;
1037 }
1038 else
1039 {
1040 //assert(includeStack.current()->newState==YY_CURRENT_BUFFER);
1041return (int)fread(buf,1,max_size,includeStack.current()->filePtr);
1042 }
1043}
1044
1045
1046static QCString configStringRecode(
1047 const QCString &str,
1048 const char *fromEncoding,
1049 const char *toEncoding)
1050{
1051 QCString inputEncoding = fromEncoding;
1052 QCString outputEncoding = toEncoding;
1053 if (inputEncoding.isEmpty() || outputEncoding.isEmpty() || inputEncoding==outputEncoding) return str;
1054 int inputSize=str.length();
1055 size_t outputSize=inputSize*4+1;
1056 QCString output(outputSize);
1057 void *cd = portable_iconv_open(outputEncoding,inputEncoding);
1058 if (cd==(void *)(-1))
1059 {
1060 fprintf(stderr,"error: unsupported character conversion: '%s'->'%s'\n",
1061 inputEncoding.data(),outputEncoding.data());
1062 exit(1);
1063 }
1064 size_t iLeft=inputSize;
1065 size_t oLeft=outputSize;
1066 const char *inputPtr = str.data();
1067 char *outputPtr = output.data();
1068 if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
1069 {
1070 outputSize-=oLeft;
1071 output.resize(outputSize+1);
1072 output.at(outputSize)='\0';
1073 //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data());
1074 }
1075 else
1076 {
1077 fprintf(stderr,"error: failed to translate characters from %s to %s: %s\n",
1078 inputEncoding.data(),outputEncoding.data(),strerror(errno));
1079 exit(1);
1080 }
1081 portable_iconv_close(cd);
1082 return output;
1083}
1084
1085static void checkEncoding()
1086{
1087 ConfigString *option = (ConfigString*)config->get("DOXYFILE_ENCODING");
1088 encoding = *option->valueRef();
1089}
1090
1091static FILE *tryPath(const char *path,const char *fileName)
1092{
1093 QCString absName=(path ? (QCString)path+"/"+fileName : (QCString)fileName);
1094 QFileInfo fi(absName);
1095 if (fi.exists() && fi.isFile())
1096 {
1097 FILE *f=portable_fopen(absName,"r");
1098 if (!f) config_err("error: could not open file %s for reading\n",absName.data());
1099 return f;
1100 }
1101 return 0;
1102}
1103
1104static void substEnvVarsInStrList(QStrList &sl);
1105static void substEnvVarsInString(QCString &s);
1106
1107static bool isAbsolute(const char * fileName)
1108{
1109# ifdef _WIN32
1110 if (isalpha (fileName [0]) && fileName[1] == ':')
1111 fileName += 2;
1112# endif
1113 char const fst = fileName [0];
1114 if (fst == '/') {
1115 return true;
1116 }
1117# ifdef _WIN32
1118 if (fst == '\\')
1119 return true;
1120# endif
1121 return false;
1122}
1123
1124static FILE *findFile(const char *fileName)
1125{
1126 if(isAbsolute(fileName))
1127 return tryPath(NULL, fileName);
1128 substEnvVarsInStrList(includePathList);
1129 char *s=includePathList.first();
1130 while (s) // try each of the include paths
1131 {
1132 FILE *f = tryPath(s,fileName);
1133 if (f) return f;
1134 s=includePathList.next();
1135 }
1136 // try cwd if includePathList fails
1137 return tryPath(".",fileName);
1138}
1139
1140static void readIncludeFile(const char *incName)
1141{
1142 if (includeDepth==MAX_INCLUDE_DEPTH) {
1143 config_err("error: maximum include depth (%d) reached, %s is not included. Aborting...\n",
1144MAX_INCLUDE_DEPTH,incName);
1145 exit(1);
1146 }
1147
1148 QCString inc = incName;
1149 substEnvVarsInString(inc);
1150 inc = inc.stripWhiteSpace();
1151 uint incLen = inc.length();
1152 if (inc.at(0)=='"' && inc.at(incLen-1)=='"') // strip quotes
1153 {
1154 inc=inc.mid(1,incLen-2);
1155 }
1156
1157 FILE *f;
1158
1159 if ((f=findFile(inc))) // see if the include file can be found
1160 {
1161 // For debugging
1162#if SHOW_INCLUDES
1163 for (i=0;i<includeStack.count();i++) msg(" ");
1164 msg("@INCLUDE = %s: parsing...\n",inc.data());
1165#endif
1166
1167 // store the state of the old file
1168 ConfigFileState *fs=new ConfigFileState;
1169 fs->oldState=YY_CURRENT_BUFFER;
1170 fs->lineNr=yyLineNr;
1171 fs->fileName=yyFileName;
1172 fs->filePtr=f;
1173 // push the state on the stack
1174 includeStack.push(fs);
1175 // set the scanner to the include file
1176 configYY_switch_to_buffer(configYY_create_buffer(f,YY_BUF_SIZE));
1177 fs->newState=YY_CURRENT_BUFFER;
1178 yyFileName=inc;
1179 includeDepth++;
1180 }
1181 else
1182 {
1183 config_err("error: @INCLUDE = %s: not found!\n",inc.data());
1184 exit(1);
1185 }
1186}
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198#line 1199 "<stdout>"
1199
1200#define INITIAL 0
1201#define Start 1
1202#define SkipComment 2
1203#define SkipInvalid 3
1204#define GetString 4
1205#define GetBool 5
1206#define GetStrList 6
1207#define GetQuotedString 7
1208#define GetEnvVar 8
1209#define Include 9
1210
1211#ifndef YY_NO_UNISTD_H
1212/* Special case for "unistd.h", since it is non-ANSI. We include it way
1213 * down here because we want the user's section 1 to have been scanned first.
1214 * The user has a chance to override it with an option.
1215 */
1216#include <unistd.h>
1217#endif
1218
1219#ifndef YY_EXTRA_TYPE
1220#define YY_EXTRA_TYPE void *
1221#endif
1222
1223static int yy_init_globals (void );
1224
1225/* Accessor methods to globals.
1226 These are made visible to non-reentrant scanners for convenience. */
1227
1228int configYYlex_destroy (void );
1229
1230int configYYget_debug (void );
1231
1232void configYYset_debug (int debug_flag );
1233
1234YY_EXTRA_TYPE configYYget_extra (void );
1235
1236void configYYset_extra (YY_EXTRA_TYPE user_defined );
1237
1238FILE *configYYget_in (void );
1239
1240void configYYset_in (FILE * in_str );
1241
1242FILE *configYYget_out (void );
1243
1244void configYYset_out (FILE * out_str );
1245
1246yy_size_t configYYget_leng (void );
1247
1248char *configYYget_text (void );
1249
1250int configYYget_lineno (void );
1251
1252void configYYset_lineno (int line_number );
1253
1254/* Macros after this point can all be overridden by user definitions in
1255 * section 1.
1256 */
1257
1258#ifndef YY_SKIP_YYWRAP
1259#ifdef __cplusplus
1260extern "C" int configYYwrap (void );
1261#else
1262extern int configYYwrap (void );
1263#endif
1264#endif
1265
1266#ifndef yytext_ptr
1267static void yy_flex_strncpy (char *,yyconst char *,int );
1268#endif
1269
1270#ifdef YY_NEED_STRLEN
1271static int yy_flex_strlen (yyconst char * );
1272#endif
1273
1274#ifndef YY_NO_INPUT
1275
1276#ifdef __cplusplus
1277static int yyinput (void );
1278#else
1279static int input (void );
1280#endif
1281
1282#endif
1283
1284/* Amount of stuff to slurp up with each read. */
1285#ifndef YY_READ_BUF_SIZE
1286#define YY_READ_BUF_SIZE 8192
1287#endif
1288
1289/* Copy whatever the last rule matched to the standard output. */
1290#ifndef ECHO
1291/* This used to be an fputs(), but since the string might contain NUL's,
1292 * we now use fwrite().
1293 */
1294#define ECHO fwrite( configYYtext, configYYleng, 1, configYYout )
1295#endif
1296
1297/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1298 * is returned in "result".
1299 */
1300#ifndef YY_INPUT
1301#define YY_INPUT(buf,result,max_size) \
1302if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1303{ \
1304int c = '*'; \
1305yy_size_t n; \
1306for ( n = 0; n < max_size && \
1307 (c = getc( configYYin )) != EOF && c != '\n'; ++n ) \
1308buf[n] = (char) c; \
1309if ( c == '\n' ) \
1310buf[n++] = (char) c; \
1311if ( c == EOF && ferror( configYYin ) ) \
1312YY_FATAL_ERROR( "input in flex scanner failed" ); \
1313result = n; \
1314} \
1315else \
1316{ \
1317errno=0; \
1318while ( (result = fread(buf, 1, max_size, configYYin))==0 && ferror(configYYin)) \
1319{ \
1320if( errno != EINTR) \
1321{ \
1322YY_FATAL_ERROR( "input in flex scanner failed" ); \
1323break; \
1324} \
1325errno=0; \
1326clearerr(configYYin); \
1327} \
1328}\
1329\
1330
1331#endif
1332
1333/* No semi-colon after return; correct usage is to write "yyterminate();" -
1334 * we don't want an extra ';' after the "return" because that will cause
1335 * some compilers to complain about unreachable statements.
1336 */
1337#ifndef yyterminate
1338#define yyterminate() return YY_NULL
1339#endif
1340
1341/* Number of entries by which start-condition stack grows. */
1342#ifndef YY_START_STACK_INCR
1343#define YY_START_STACK_INCR 25
1344#endif
1345
1346/* Report a fatal error. */
1347#ifndef YY_FATAL_ERROR
1348#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1349#endif
1350
1351/* end tables serialization structures and prototypes */
1352
1353/* Default declaration of generated scanner - a define so the user can
1354 * easily add parameters.
1355 */
1356#ifndef YY_DECL
1357#define YY_DECL_IS_OURS 1
1358
1359extern int configYYlex (void);
1360
1361#define YY_DECL int configYYlex (void)
1362#endif /* !YY_DECL */
1363
1364/* Code executed at the beginning of each rule, after configYYtext and configYYleng
1365 * have been set up.
1366 */
1367#ifndef YY_USER_ACTION
1368#define YY_USER_ACTION
1369#endif
1370
1371/* Code executed at the end of each rule. */
1372#ifndef YY_BREAK
1373#define YY_BREAK break;
1374#endif
1375
1376#define YY_RULE_SETUP \
1377YY_USER_ACTION
1378
1379/** The main scanner function which does all the work.
1380 */
1381YY_DECL
1382{
1383register yy_state_type yy_current_state;
1384register char *yy_cp, *yy_bp;
1385register int yy_act;
1386
1387#line 606 "config.l"
1388
1389
1390#line 1391 "<stdout>"
1391
1392if ( !(yy_init) )
1393{
1394(yy_init) = 1;
1395
1396#ifdef YY_USER_INIT
1397YY_USER_INIT;
1398#endif
1399
1400if ( ! (yy_start) )
1401(yy_start) = 1;/* first start state */
1402
1403if ( ! configYYin )
1404configYYin = stdin;
1405
1406if ( ! configYYout )
1407configYYout = stdout;
1408
1409if ( ! YY_CURRENT_BUFFER ) {
1410configYYensure_buffer_stack ();
1411YY_CURRENT_BUFFER_LVALUE =
1412configYY_create_buffer(configYYin,YY_BUF_SIZE );
1413}
1414
1415configYY_load_buffer_state( );
1416}
1417
1418while ( 1 )/* loops until end-of-file is reached */
1419{
1420yy_cp = (yy_c_buf_p);
1421
1422/* Support of configYYtext. */
1423*yy_cp = (yy_hold_char);
1424
1425/* yy_bp points to the position in yy_ch_buf of the start of
1426 * the current run.
1427 */
1428yy_bp = yy_cp;
1429
1430yy_current_state = (yy_start);
1431yy_match:
1432do
1433{
1434register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1435if ( yy_accept[yy_current_state] )
1436{
1437(yy_last_accepting_state) = yy_current_state;
1438(yy_last_accepting_cpos) = yy_cp;
1439}
1440while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1441{
1442yy_current_state = (int) yy_def[yy_current_state];
1443if ( yy_current_state >= 100 )
1444yy_c = yy_meta[(unsigned int) yy_c];
1445}
1446yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1447++yy_cp;
1448}
1449while ( yy_base[yy_current_state] != 408 );
1450
1451yy_find_action:
1452yy_act = yy_accept[yy_current_state];
1453if ( yy_act == 0 )
1454{ /* have to back up */
1455yy_cp = (yy_last_accepting_cpos);
1456yy_current_state = (yy_last_accepting_state);
1457yy_act = yy_accept[yy_current_state];
1458}
1459
1460YY_DO_BEFORE_ACTION;
1461
1462do_action:/* This label is used only to access EOF actions. */
1463
1464switch ( yy_act )
1465{ /* beginning of action switch */
1466case 0: /* must back up */
1467/* undo the effects of YY_DO_BEFORE_ACTION */
1468*yy_cp = (yy_hold_char);
1469yy_cp = (yy_last_accepting_cpos);
1470yy_current_state = (yy_last_accepting_state);
1471goto yy_find_action;
1472
1473case 1:
1474YY_RULE_SETUP
1475#line 608 "config.l"
1476
1477YY_BREAK
1478case 2:
1479YY_RULE_SETUP
1480#line 609 "config.l"
1481{ BEGIN(SkipComment); }
1482YY_BREAK
1483case 3:
1484YY_RULE_SETUP
1485#line 610 "config.l"
1486{ QCString cmd=configYYtext;
1487 cmd=cmd.left(cmd.length()-1).stripWhiteSpace();
1488 ConfigOption *option = config->get(cmd);
1489 if (option==0) // oops not known
1490 {
1491 config_err("warning: ignoring unsupported tag `%s' at line %d, file %s\n",
1492 configYYtext,yyLineNr,yyFileName.data());
1493 BEGIN(SkipInvalid);
1494 }
1495 else // known tag
1496 {
1497 option->setEncoding(encoding);
1498 switch(option->kind())
1499 {
1500 case ConfigOption::O_Info:
1501 // shouldn't get here!
1502 BEGIN(SkipInvalid);
1503 break;
1504 case ConfigOption::O_List:
1505 l = ((ConfigList *)option)->valueRef();
1506 l->clear();
1507 elemStr="";
1508 BEGIN(GetStrList);
1509 break;
1510 case ConfigOption::O_Enum:
1511 s = ((ConfigEnum *)option)->valueRef();
1512 s->resize(0);
1513 BEGIN(GetString);
1514 break;
1515 case ConfigOption::O_String:
1516 s = ((ConfigString *)option)->valueRef();
1517 s->resize(0);
1518 BEGIN(GetString);
1519 break;
1520 case ConfigOption::O_Int:
1521 s = ((ConfigInt *)option)->valueStringRef();
1522 s->resize(0);
1523 BEGIN(GetString);
1524 break;
1525 case ConfigOption::O_Bool:
1526 s = ((ConfigBool *)option)->valueStringRef();
1527 s->resize(0);
1528 BEGIN(GetString);
1529 break;
1530 case ConfigOption::O_Obsolete:
1531 config_err("warning: Tag `%s' at line %d of file %s has become obsolete.\n"
1532 "To avoid this warning please update your configuration "
1533 "file using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
1534 BEGIN(SkipInvalid);
1535 break;
1536 }
1537 }
1538}
1539YY_BREAK
1540case 4:
1541YY_RULE_SETUP
1542#line 663 "config.l"
1543{ QCString cmd=configYYtext;
1544 cmd=cmd.left(cmd.length()-2).stripWhiteSpace();
1545 ConfigOption *option = config->get(cmd);
1546 if (option==0) // oops not known
1547 {
1548 config_err("warning: ignoring unsupported tag `%s' at line %d, file %s\n",
1549configYYtext,yyLineNr,yyFileName.data());
1550 BEGIN(SkipInvalid);
1551 }
1552 else // known tag
1553 {
1554 switch(option->kind())
1555 {
1556 case ConfigOption::O_Info:
1557 // shouldn't get here!
1558 BEGIN(SkipInvalid);
1559break;
1560 case ConfigOption::O_List:
1561 l = ((ConfigList *)option)->valueRef();
1562elemStr="";
1563 BEGIN(GetStrList);
1564 break;
1565 case ConfigOption::O_Enum:
1566 case ConfigOption::O_String:
1567 case ConfigOption::O_Int:
1568 case ConfigOption::O_Bool:
1569 config_err("warning: operator += not supported for `%s'. Ignoring line at line %d, file %s\n",
1570 configYYtext,yyLineNr,yyFileName.data());
1571 BEGIN(SkipInvalid);
1572break;
1573 case ConfigOption::O_Obsolete:
1574 config_err("warning: Tag `%s' at line %d of file %s has become obsolete.\n"
1575 "To avoid this warning please update your configuration "
1576 "file using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
1577 BEGIN(SkipInvalid);
1578 break;
1579 }
1580 }
1581}
1582YY_BREAK
1583case 5:
1584YY_RULE_SETUP
1585#line 702 "config.l"
1586{ BEGIN(GetStrList); l=&includePathList; l->clear(); elemStr=""; }
1587YY_BREAK
1588/* include a config file */
1589case 6:
1590YY_RULE_SETUP
1591#line 704 "config.l"
1592{ BEGIN(Include);}
1593YY_BREAK
1594case 7:
1595YY_RULE_SETUP
1596#line 705 "config.l"
1597{
1598 readIncludeFile(configStringRecode(configYYtext,encoding,"UTF-8"));
1599 BEGIN(Start);
1600}
1601YY_BREAK
1602case YY_STATE_EOF(INITIAL):
1603case YY_STATE_EOF(Start):
1604case YY_STATE_EOF(SkipComment):
1605case YY_STATE_EOF(SkipInvalid):
1606case YY_STATE_EOF(GetString):
1607case YY_STATE_EOF(GetBool):
1608case YY_STATE_EOF(GetStrList):
1609case YY_STATE_EOF(GetQuotedString):
1610case YY_STATE_EOF(GetEnvVar):
1611case YY_STATE_EOF(Include):
1612#line 709 "config.l"
1613{
1614 //printf("End of include file\n");
1615 //printf("Include stack depth=%d\n",g_includeStack.count());
1616 if (includeStack.isEmpty())
1617 {
1618 //printf("Terminating scanner!\n");
1619 yyterminate();
1620 }
1621 else
1622 {
1623 ConfigFileState *fs=includeStack.pop();
1624 fclose(fs->filePtr);
1625 YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
1626 configYY_switch_to_buffer(fs->oldState );
1627 configYY_delete_buffer(oldBuf );
1628 yyLineNr=fs->lineNr;
1629 yyFileName=fs->fileName;
1630 delete fs; fs=0;
1631 includeDepth--;
1632 }
1633 }
1634YY_BREAK
1635case 8:
1636YY_RULE_SETUP
1637#line 731 "config.l"
1638{ config_err("warning: ignoring unknown tag `%s' at line %d, file %s\n",configYYtext,yyLineNr,yyFileName.data()); }
1639YY_BREAK
1640case 9:
1641/* rule 9 can match eol */
1642YY_RULE_SETUP
1643#line 732 "config.l"
1644{ yyLineNr++; BEGIN(Start); }
1645YY_BREAK
1646case 10:
1647/* rule 10 can match eol */
1648YY_RULE_SETUP
1649#line 733 "config.l"
1650{
1651 yyLineNr++;
1652 if (!elemStr.isEmpty())
1653 {
1654 //printf("elemStr1=`%s'\n",elemStr.data());
1655 l->append(elemStr);
1656 }
1657 BEGIN(Start);
1658}
1659YY_BREAK
1660case 11:
1661YY_RULE_SETUP
1662#line 742 "config.l"
1663{
1664 if (!elemStr.isEmpty())
1665 {
1666 //printf("elemStr2=`%s'\n",elemStr.data());
1667 l->append(elemStr);
1668 }
1669 elemStr.resize(0);
1670 }
1671YY_BREAK
1672case 12:
1673YY_RULE_SETUP
1674#line 750 "config.l"
1675{ (*s)+=configStringRecode(configYYtext,encoding,"UTF-8");
1676 checkEncoding();
1677 }
1678YY_BREAK
1679case 13:
1680YY_RULE_SETUP
1681#line 753 "config.l"
1682{ lastState=YY_START;
1683 BEGIN(GetQuotedString);
1684 tmpString.resize(0);
1685}
1686YY_BREAK
1687case 14:
1688/* rule 14 can match eol */
1689YY_RULE_SETUP
1690#line 757 "config.l"
1691{
1692 // we add a bogus space to signal that the string was quoted. This space will be stripped later on.
1693 tmpString+=" ";
1694 //printf("Quoted String = `%s'\n",tmpString.data());
1695 if (lastState==GetString)
1696 {
1697 (*s)+=configStringRecode(tmpString,encoding,"UTF-8");
1698 checkEncoding();
1699 }
1700 else
1701 {
1702 elemStr+=configStringRecode(tmpString,encoding,"UTF-8");
1703 }
1704 if (*configYYtext=='\n')
1705 {
1706 config_err("warning: Missing end quote (\") on line %d, file %s\n",yyLineNr,yyFileName.data());
1707 yyLineNr++;
1708 }
1709 BEGIN(lastState);
1710 }
1711YY_BREAK
1712case 15:
1713YY_RULE_SETUP
1714#line 777 "config.l"
1715{
1716 tmpString+='"';
1717 }
1718YY_BREAK
1719case 16:
1720YY_RULE_SETUP
1721#line 780 "config.l"
1722{ tmpString+=*configYYtext; }
1723YY_BREAK
1724case 17:
1725YY_RULE_SETUP
1726#line 781 "config.l"
1727{
1728 QCString bs=configYYtext;
1729 bs=bs.upper();
1730 if (bs=="YES" || bs=="1")
1731 *b=TRUE;
1732 else if (bs=="NO" || bs=="0")
1733 *b=FALSE;
1734 else
1735 {
1736 *b=FALSE;
1737 config_warn("warning: Invalid value `%s' for "
1738 "boolean tag in line %d, file %s; use YES or NO\n",
1739 bs.data(),yyLineNr,yyFileName.data());
1740 }
1741}
1742YY_BREAK
1743case 18:
1744YY_RULE_SETUP
1745#line 796 "config.l"
1746{
1747 elemStr+=configStringRecode(configYYtext,encoding,"UTF-8");
1748 }
1749YY_BREAK
1750case 19:
1751/* rule 19 can match eol */
1752YY_RULE_SETUP
1753#line 799 "config.l"
1754{ yyLineNr++; BEGIN(Start); }
1755YY_BREAK
1756case 20:
1757/* rule 20 can match eol */
1758YY_RULE_SETUP
1759#line 800 "config.l"
1760{ yyLineNr++; BEGIN(Start); }
1761YY_BREAK
1762case 21:
1763/* rule 21 can match eol */
1764YY_RULE_SETUP
1765#line 801 "config.l"
1766{ yyLineNr++; }
1767YY_BREAK
1768case 22:
1769YY_RULE_SETUP
1770#line 802 "config.l"
1771
1772YY_BREAK
1773case 23:
1774/* rule 23 can match eol */
1775YY_RULE_SETUP
1776#line 803 "config.l"
1777{ yyLineNr++ ; }
1778YY_BREAK
1779case 24:
1780YY_RULE_SETUP
1781#line 805 "config.l"
1782ECHO;
1783YY_BREAK
1784#line 1785 "<stdout>"
1785
1786case YY_END_OF_BUFFER:
1787{
1788/* Amount of text matched not including the EOB char. */
1789int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1790
1791/* Undo the effects of YY_DO_BEFORE_ACTION. */
1792*yy_cp = (yy_hold_char);
1793YY_RESTORE_YY_MORE_OFFSET
1794
1795if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1796{
1797/* We're scanning a new file or input source. It's
1798 * possible that this happened because the user
1799 * just pointed configYYin at a new source and called
1800 * configYYlex(). If so, then we have to assure
1801 * consistency between YY_CURRENT_BUFFER and our
1802 * globals. Here is the right place to do so, because
1803 * this is the first action (other than possibly a
1804 * back-up) that will match for the new input source.
1805 */
1806(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1807YY_CURRENT_BUFFER_LVALUE->yy_input_file = configYYin;
1808YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1809}
1810
1811/* Note that here we test for yy_c_buf_p "<=" to the position
1812 * of the first EOB in the buffer, since yy_c_buf_p will
1813 * already have been incremented past the NUL character
1814 * (since all states make transitions on EOB to the
1815 * end-of-buffer state). Contrast this with the test
1816 * in input().
1817 */
1818if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1819{ /* This was really a NUL. */
1820yy_state_type yy_next_state;
1821
1822(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1823
1824yy_current_state = yy_get_previous_state( );
1825
1826/* Okay, we're now positioned to make the NUL
1827 * transition. We couldn't have
1828 * yy_get_previous_state() go ahead and do it
1829 * for us because it doesn't know how to deal
1830 * with the possibility of jamming (and we don't
1831 * want to build jamming into it because then it
1832 * will run more slowly).
1833 */
1834
1835yy_next_state = yy_try_NUL_trans( yy_current_state );
1836
1837yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1838
1839if ( yy_next_state )
1840{
1841/* Consume the NUL. */
1842yy_cp = ++(yy_c_buf_p);
1843yy_current_state = yy_next_state;
1844goto yy_match;
1845}
1846
1847else
1848{
1849yy_cp = (yy_c_buf_p);
1850goto yy_find_action;
1851}
1852}
1853
1854else switch ( yy_get_next_buffer( ) )
1855{
1856case EOB_ACT_END_OF_FILE:
1857{
1858(yy_did_buffer_switch_on_eof) = 0;
1859
1860if ( configYYwrap( ) )
1861{
1862/* Note: because we've taken care in
1863 * yy_get_next_buffer() to have set up
1864 * configYYtext, we can now set up
1865 * yy_c_buf_p so that if some total
1866 * hoser (like flex itself) wants to
1867 * call the scanner after we return the
1868 * YY_NULL, it'll still work - another
1869 * YY_NULL will get returned.
1870 */
1871(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1872
1873yy_act = YY_STATE_EOF(YY_START);
1874goto do_action;
1875}
1876
1877else
1878{
1879if ( ! (yy_did_buffer_switch_on_eof) )
1880YY_NEW_FILE;
1881}
1882break;
1883}
1884
1885case EOB_ACT_CONTINUE_SCAN:
1886(yy_c_buf_p) =
1887(yytext_ptr) + yy_amount_of_matched_text;
1888
1889yy_current_state = yy_get_previous_state( );
1890
1891yy_cp = (yy_c_buf_p);
1892yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1893goto yy_match;
1894
1895case EOB_ACT_LAST_MATCH:
1896(yy_c_buf_p) =
1897&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1898
1899yy_current_state = yy_get_previous_state( );
1900
1901yy_cp = (yy_c_buf_p);
1902yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1903goto yy_find_action;
1904}
1905break;
1906}
1907
1908default:
1909YY_FATAL_ERROR(
1910"fatal flex scanner internal error--no action found" );
1911} /* end of action switch */
1912} /* end of scanning one token */
1913} /* end of configYYlex */
1914
1915/* yy_get_next_buffer - try to read in a new buffer
1916 *
1917 * Returns a code representing an action:
1918 *EOB_ACT_LAST_MATCH -
1919 *EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1920 *EOB_ACT_END_OF_FILE - end of file
1921 */
1922static int yy_get_next_buffer (void)
1923{
1924 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1925register char *source = (yytext_ptr);
1926register int number_to_move, i;
1927int ret_val;
1928
1929if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1930YY_FATAL_ERROR(
1931"fatal flex scanner internal error--end of buffer missed" );
1932
1933if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1934{ /* Don't try to fill the buffer, so this is an EOF. */
1935if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1936{
1937/* We matched a single character, the EOB, so
1938 * treat this as a final EOF.
1939 */
1940return EOB_ACT_END_OF_FILE;
1941}
1942
1943else
1944{
1945/* We matched some text prior to the EOB, first
1946 * process it.
1947 */
1948return EOB_ACT_LAST_MATCH;
1949}
1950}
1951
1952/* Try to read more data. */
1953
1954/* First move last chars to start of buffer. */
1955number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1956
1957for ( i = 0; i < number_to_move; ++i )
1958*(dest++) = *(source++);
1959
1960if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1961/* don't do the read, it's not guaranteed to return an EOF,
1962 * just force an EOF
1963 */
1964YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1965
1966else
1967{
1968yy_size_t num_to_read =
1969YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1970
1971while ( num_to_read <= 0 )
1972{ /* Not enough room in the buffer - grow it. */
1973
1974/* just a shorter name for the current buffer */
1975YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1976
1977int yy_c_buf_p_offset =
1978(int) ((yy_c_buf_p) - b->yy_ch_buf);
1979
1980if ( b->yy_is_our_buffer )
1981{
1982yy_size_t new_size = b->yy_buf_size * 2;
1983
1984if ( new_size <= 0 )
1985b->yy_buf_size += b->yy_buf_size / 8;
1986else
1987b->yy_buf_size *= 2;
1988
1989b->yy_ch_buf = (char *)
1990/* Include room in for 2 EOB chars. */
1991configYYrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1992}
1993else
1994/* Can't grow it, we don't own it. */
1995b->yy_ch_buf = 0;
1996
1997if ( ! b->yy_ch_buf )
1998YY_FATAL_ERROR(
1999"fatal error - scanner input buffer overflow" );
2000
2001(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2002
2003num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2004number_to_move - 1;
2005
2006}
2007
2008if ( num_to_read > YY_READ_BUF_SIZE )
2009num_to_read = YY_READ_BUF_SIZE;
2010
2011/* Read in more data. */
2012YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2013(yy_n_chars), num_to_read );
2014
2015YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2016}
2017
2018if ( (yy_n_chars) == 0 )
2019{
2020if ( number_to_move == YY_MORE_ADJ )
2021{
2022ret_val = EOB_ACT_END_OF_FILE;
2023configYYrestart(configYYin );
2024}
2025
2026else
2027{
2028ret_val = EOB_ACT_LAST_MATCH;
2029YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2030YY_BUFFER_EOF_PENDING;
2031}
2032}
2033
2034else
2035ret_val = EOB_ACT_CONTINUE_SCAN;
2036
2037if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2038/* Extend the array by 50%, plus the number we really need. */
2039yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2040YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) configYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
2041if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2042YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2043}
2044
2045(yy_n_chars) += number_to_move;
2046YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2047YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2048
2049(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2050
2051return ret_val;
2052}
2053
2054/* yy_get_previous_state - get the state just before the EOB char was reached */
2055
2056 static yy_state_type yy_get_previous_state (void)
2057{
2058register yy_state_type yy_current_state;
2059register char *yy_cp;
2060
2061yy_current_state = (yy_start);
2062
2063for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2064{
2065register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 28);
2066if ( yy_accept[yy_current_state] )
2067{
2068(yy_last_accepting_state) = yy_current_state;
2069(yy_last_accepting_cpos) = yy_cp;
2070}
2071while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2072{
2073yy_current_state = (int) yy_def[yy_current_state];
2074if ( yy_current_state >= 100 )
2075yy_c = yy_meta[(unsigned int) yy_c];
2076}
2077yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2078}
2079
2080return yy_current_state;
2081}
2082
2083/* yy_try_NUL_trans - try to make a transition on the NUL character
2084 *
2085 * synopsis
2086 *next_state = yy_try_NUL_trans( current_state );
2087 */
2088 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2089{
2090register int yy_is_jam;
2091 register char *yy_cp = (yy_c_buf_p);
2092
2093register YY_CHAR yy_c = 28;
2094if ( yy_accept[yy_current_state] )
2095{
2096(yy_last_accepting_state) = yy_current_state;
2097(yy_last_accepting_cpos) = yy_cp;
2098}
2099while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2100{
2101yy_current_state = (int) yy_def[yy_current_state];
2102if ( yy_current_state >= 100 )
2103yy_c = yy_meta[(unsigned int) yy_c];
2104}
2105yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2106yy_is_jam = (yy_current_state == 99);
2107
2108return yy_is_jam ? 0 : yy_current_state;
2109}
2110
2111#ifndef YY_NO_INPUT
2112#ifdef __cplusplus
2113 static int yyinput (void)
2114#else
2115 static int input (void)
2116#endif
2117
2118{
2119int c;
2120
2121*(yy_c_buf_p) = (yy_hold_char);
2122
2123if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2124{
2125/* yy_c_buf_p now points to the character we want to return.
2126 * If this occurs *before* the EOB characters, then it's a
2127 * valid NUL; if not, then we've hit the end of the buffer.
2128 */
2129if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2130/* This was really a NUL. */
2131*(yy_c_buf_p) = '\0';
2132
2133else
2134{ /* need more input */
2135yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
2136++(yy_c_buf_p);
2137
2138switch ( yy_get_next_buffer( ) )
2139{
2140case EOB_ACT_LAST_MATCH:
2141/* This happens because yy_g_n_b()
2142 * sees that we've accumulated a
2143 * token and flags that we need to
2144 * try matching the token before
2145 * proceeding. But for input(),
2146 * there's no matching to consider.
2147 * So convert the EOB_ACT_LAST_MATCH
2148 * to EOB_ACT_END_OF_FILE.
2149 */
2150
2151/* Reset buffer status. */
2152configYYrestart(configYYin );
2153
2154/*FALLTHROUGH*/
2155
2156case EOB_ACT_END_OF_FILE:
2157{
2158if ( configYYwrap( ) )
2159return 0;
2160
2161if ( ! (yy_did_buffer_switch_on_eof) )
2162YY_NEW_FILE;
2163#ifdef __cplusplus
2164return yyinput();
2165#else
2166return input();
2167#endif
2168}
2169
2170case EOB_ACT_CONTINUE_SCAN:
2171(yy_c_buf_p) = (yytext_ptr) + offset;
2172break;
2173}
2174}
2175}
2176
2177c = *(unsigned char *) (yy_c_buf_p);/* cast for 8-bit char's */
2178*(yy_c_buf_p) = '\0';/* preserve configYYtext */
2179(yy_hold_char) = *++(yy_c_buf_p);
2180
2181return c;
2182}
2183#endif/* ifndef YY_NO_INPUT */
2184
2185/** Immediately switch to a different input stream.
2186 * @param input_file A readable stream.
2187 *
2188 * @note This function does not reset the start condition to @c INITIAL .
2189 */
2190 void configYYrestart (FILE * input_file )
2191{
2192
2193if ( ! YY_CURRENT_BUFFER ){
2194 configYYensure_buffer_stack ();
2195YY_CURRENT_BUFFER_LVALUE =
2196 configYY_create_buffer(configYYin,YY_BUF_SIZE );
2197}
2198
2199configYY_init_buffer(YY_CURRENT_BUFFER,input_file );
2200configYY_load_buffer_state( );
2201}
2202
2203/** Switch to a different input buffer.
2204 * @param new_buffer The new input buffer.
2205 *
2206 */
2207 void configYY_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2208{
2209
2210/* TODO. We should be able to replace this entire function body
2211 * with
2212 *configYYpop_buffer_state();
2213 *configYYpush_buffer_state(new_buffer);
2214 */
2215configYYensure_buffer_stack ();
2216if ( YY_CURRENT_BUFFER == new_buffer )
2217return;
2218
2219if ( YY_CURRENT_BUFFER )
2220{
2221/* Flush out information for old buffer. */
2222*(yy_c_buf_p) = (yy_hold_char);
2223YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2224YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2225}
2226
2227YY_CURRENT_BUFFER_LVALUE = new_buffer;
2228configYY_load_buffer_state( );
2229
2230/* We don't actually know whether we did this switch during
2231 * EOF (configYYwrap()) processing, but the only time this flag
2232 * is looked at is after configYYwrap() is called, so it's safe
2233 * to go ahead and always set it.
2234 */
2235(yy_did_buffer_switch_on_eof) = 1;
2236}
2237
2238static void configYY_load_buffer_state (void)
2239{
2240 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2241(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2242configYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2243(yy_hold_char) = *(yy_c_buf_p);
2244}
2245
2246/** Allocate and initialize an input buffer state.
2247 * @param file A readable stream.
2248 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2249 *
2250 * @return the allocated buffer state.
2251 */
2252 YY_BUFFER_STATE configYY_create_buffer (FILE * file, int size )
2253{
2254YY_BUFFER_STATE b;
2255
2256b = (YY_BUFFER_STATE) configYYalloc(sizeof( struct yy_buffer_state ) );
2257if ( ! b )
2258YY_FATAL_ERROR( "out of dynamic memory in configYY_create_buffer()" );
2259
2260b->yy_buf_size = size;
2261
2262/* yy_ch_buf has to be 2 characters longer than the size given because
2263 * we need to put in 2 end-of-buffer characters.
2264 */
2265b->yy_ch_buf = (char *) configYYalloc(b->yy_buf_size + 2 );
2266if ( ! b->yy_ch_buf )
2267YY_FATAL_ERROR( "out of dynamic memory in configYY_create_buffer()" );
2268
2269b->yy_is_our_buffer = 1;
2270
2271configYY_init_buffer(b,file );
2272
2273return b;
2274}
2275
2276/** Destroy the buffer.
2277 * @param b a buffer created with configYY_create_buffer()
2278 *
2279 */
2280 void configYY_delete_buffer (YY_BUFFER_STATE b )
2281{
2282
2283if ( ! b )
2284return;
2285
2286if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2287YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2288
2289if ( b->yy_is_our_buffer )
2290configYYfree((void *) b->yy_ch_buf );
2291
2292configYYfree((void *) b );
2293}
2294
2295#ifndef __cplusplus
2296extern int isatty (int );
2297#endif /* __cplusplus */
2298
2299/* Initializes or reinitializes a buffer.
2300 * This function is sometimes called more than once on the same buffer,
2301 * such as during a configYYrestart() or at EOF.
2302 */
2303 static void configYY_init_buffer (YY_BUFFER_STATE b, FILE * file )
2304
2305{
2306int oerrno = errno;
2307
2308configYY_flush_buffer(b );
2309
2310b->yy_input_file = file;
2311b->yy_fill_buffer = 1;
2312
2313 /* If b is the current buffer, then configYY_init_buffer was _probably_
2314 * called from configYYrestart() or through yy_get_next_buffer.
2315 * In that case, we don't want to reset the lineno or column.
2316 */
2317 if (b != YY_CURRENT_BUFFER){
2318 b->yy_bs_lineno = 1;
2319 b->yy_bs_column = 0;
2320 }
2321
2322 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2323
2324errno = oerrno;
2325}
2326
2327/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2328 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2329 *
2330 */
2331 void configYY_flush_buffer (YY_BUFFER_STATE b )
2332{
2333 if ( ! b )
2334return;
2335
2336b->yy_n_chars = 0;
2337
2338/* We always need two end-of-buffer characters. The first causes
2339 * a transition to the end-of-buffer state. The second causes
2340 * a jam in that state.
2341 */
2342b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2343b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2344
2345b->yy_buf_pos = &b->yy_ch_buf[0];
2346
2347b->yy_at_bol = 1;
2348b->yy_buffer_status = YY_BUFFER_NEW;
2349
2350if ( b == YY_CURRENT_BUFFER )
2351configYY_load_buffer_state( );
2352}
2353
2354/** Pushes the new state onto the stack. The new state becomes
2355 * the current state. This function will allocate the stack
2356 * if necessary.
2357 * @param new_buffer The new state.
2358 *
2359 */
2360void configYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
2361{
2362 if (new_buffer == NULL)
2363return;
2364
2365configYYensure_buffer_stack();
2366
2367/* This block is copied from configYY_switch_to_buffer. */
2368if ( YY_CURRENT_BUFFER )
2369{
2370/* Flush out information for old buffer. */
2371*(yy_c_buf_p) = (yy_hold_char);
2372YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2373YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2374}
2375
2376/* Only push if top exists. Otherwise, replace top. */
2377if (YY_CURRENT_BUFFER)
2378(yy_buffer_stack_top)++;
2379YY_CURRENT_BUFFER_LVALUE = new_buffer;
2380
2381/* copied from configYY_switch_to_buffer. */
2382configYY_load_buffer_state( );
2383(yy_did_buffer_switch_on_eof) = 1;
2384}
2385
2386/** Removes and deletes the top of the stack, if present.
2387 * The next element becomes the new top.
2388 *
2389 */
2390void configYYpop_buffer_state (void)
2391{
2392 if (!YY_CURRENT_BUFFER)
2393return;
2394
2395configYY_delete_buffer(YY_CURRENT_BUFFER );
2396YY_CURRENT_BUFFER_LVALUE = NULL;
2397if ((yy_buffer_stack_top) > 0)
2398--(yy_buffer_stack_top);
2399
2400if (YY_CURRENT_BUFFER) {
2401configYY_load_buffer_state( );
2402(yy_did_buffer_switch_on_eof) = 1;
2403}
2404}
2405
2406/* Allocates the stack if it does not exist.
2407 * Guarantees space for at least one push.
2408 */
2409static void configYYensure_buffer_stack (void)
2410{
2411yy_size_t num_to_alloc;
2412
2413if (!(yy_buffer_stack)) {
2414
2415/* First allocation is just for 2 elements, since we don't know if this
2416 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2417 * immediate realloc on the next call.
2418 */
2419num_to_alloc = 1;
2420(yy_buffer_stack) = (struct yy_buffer_state**)configYYalloc
2421(num_to_alloc * sizeof(struct yy_buffer_state*)
2422);
2423if ( ! (yy_buffer_stack) )
2424YY_FATAL_ERROR( "out of dynamic memory in configYYensure_buffer_stack()" );
2425
2426memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2427
2428(yy_buffer_stack_max) = num_to_alloc;
2429(yy_buffer_stack_top) = 0;
2430return;
2431}
2432
2433if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2434
2435/* Increase the buffer to prepare for a possible push. */
2436int grow_size = 8 /* arbitrary grow size */;
2437
2438num_to_alloc = (yy_buffer_stack_max) + grow_size;
2439(yy_buffer_stack) = (struct yy_buffer_state**)configYYrealloc
2440((yy_buffer_stack),
2441num_to_alloc * sizeof(struct yy_buffer_state*)
2442);
2443if ( ! (yy_buffer_stack) )
2444YY_FATAL_ERROR( "out of dynamic memory in configYYensure_buffer_stack()" );
2445
2446/* zero only the new slots.*/
2447memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2448(yy_buffer_stack_max) = num_to_alloc;
2449}
2450}
2451
2452/** Setup the input buffer state to scan directly from a user-specified character buffer.
2453 * @param base the character buffer
2454 * @param size the size in bytes of the character buffer
2455 *
2456 * @return the newly allocated buffer state object.
2457 */
2458YY_BUFFER_STATE configYY_scan_buffer (char * base, yy_size_t size )
2459{
2460YY_BUFFER_STATE b;
2461
2462if ( size < 2 ||
2463 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2464 base[size-1] != YY_END_OF_BUFFER_CHAR )
2465/* They forgot to leave room for the EOB's. */
2466return 0;
2467
2468b = (YY_BUFFER_STATE) configYYalloc(sizeof( struct yy_buffer_state ) );
2469if ( ! b )
2470YY_FATAL_ERROR( "out of dynamic memory in configYY_scan_buffer()" );
2471
2472b->yy_buf_size = size - 2;/* "- 2" to take care of EOB's */
2473b->yy_buf_pos = b->yy_ch_buf = base;
2474b->yy_is_our_buffer = 0;
2475b->yy_input_file = 0;
2476b->yy_n_chars = b->yy_buf_size;
2477b->yy_is_interactive = 0;
2478b->yy_at_bol = 1;
2479b->yy_fill_buffer = 0;
2480b->yy_buffer_status = YY_BUFFER_NEW;
2481
2482configYY_switch_to_buffer(b );
2483
2484return b;
2485}
2486
2487/** Setup the input buffer state to scan a string. The next call to configYYlex() will
2488 * scan from a @e copy of @a str.
2489 * @param yystr a NUL-terminated string to scan
2490 *
2491 * @return the newly allocated buffer state object.
2492 * @note If you want to scan bytes that may contain NUL values, then use
2493 * configYY_scan_bytes() instead.
2494 */
2495YY_BUFFER_STATE configYY_scan_string (yyconst char * yystr )
2496{
2497
2498return configYY_scan_bytes(yystr,strlen(yystr) );
2499}
2500
2501/** Setup the input buffer state to scan the given bytes. The next call to configYYlex() will
2502 * scan from a @e copy of @a bytes.
2503 * @param bytes the byte buffer to scan
2504 * @param len the number of bytes in the buffer pointed to by @a bytes.
2505 *
2506 * @return the newly allocated buffer state object.
2507 */
2508YY_BUFFER_STATE configYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
2509{
2510YY_BUFFER_STATE b;
2511char *buf;
2512yy_size_t n, i;
2513
2514/* Get memory for full buffer, including space for trailing EOB's. */
2515n = _yybytes_len + 2;
2516buf = (char *) configYYalloc(n );
2517if ( ! buf )
2518YY_FATAL_ERROR( "out of dynamic memory in configYY_scan_bytes()" );
2519
2520for ( i = 0; i < _yybytes_len; ++i )
2521buf[i] = yybytes[i];
2522
2523buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2524
2525b = configYY_scan_buffer(buf,n );
2526if ( ! b )
2527YY_FATAL_ERROR( "bad buffer in configYY_scan_bytes()" );
2528
2529/* It's okay to grow etc. this buffer, and we should throw it
2530 * away when we're done.
2531 */
2532b->yy_is_our_buffer = 1;
2533
2534return b;
2535}
2536
2537#ifndef YY_EXIT_FAILURE
2538#define YY_EXIT_FAILURE 2
2539#endif
2540
2541static void yy_fatal_error (yyconst char* msg )
2542{
2543 (void) fprintf( stderr, "%s\n", msg );
2544exit( YY_EXIT_FAILURE );
2545}
2546
2547/* Redefine yyless() so it works in section 3 code. */
2548
2549#undef yyless
2550#define yyless(n) \
2551do \
2552{ \
2553/* Undo effects of setting up configYYtext. */ \
2554 int yyless_macro_arg = (n); \
2555 YY_LESS_LINENO(yyless_macro_arg);\
2556configYYtext[configYYleng] = (yy_hold_char); \
2557(yy_c_buf_p) = configYYtext + yyless_macro_arg; \
2558(yy_hold_char) = *(yy_c_buf_p); \
2559*(yy_c_buf_p) = '\0'; \
2560configYYleng = yyless_macro_arg; \
2561} \
2562while ( 0 )
2563
2564/* Accessor methods (get/set functions) to struct members. */
2565
2566/** Get the current line number.
2567 *
2568 */
2569int configYYget_lineno (void)
2570{
2571
2572 return configYYlineno;
2573}
2574
2575/** Get the input stream.
2576 *
2577 */
2578FILE *configYYget_in (void)
2579{
2580 return configYYin;
2581}
2582
2583/** Get the output stream.
2584 *
2585 */
2586FILE *configYYget_out (void)
2587{
2588 return configYYout;
2589}
2590
2591/** Get the length of the current token.
2592 *
2593 */
2594yy_size_t configYYget_leng (void)
2595{
2596 return configYYleng;
2597}
2598
2599/** Get the current token.
2600 *
2601 */
2602
2603char *configYYget_text (void)
2604{
2605 return configYYtext;
2606}
2607
2608/** Set the current line number.
2609 * @param line_number
2610 *
2611 */
2612void configYYset_lineno (int line_number )
2613{
2614
2615 configYYlineno = line_number;
2616}
2617
2618/** Set the input stream. This does not discard the current
2619 * input buffer.
2620 * @param in_str A readable stream.
2621 *
2622 * @see configYY_switch_to_buffer
2623 */
2624void configYYset_in (FILE * in_str )
2625{
2626 configYYin = in_str ;
2627}
2628
2629void configYYset_out (FILE * out_str )
2630{
2631 configYYout = out_str ;
2632}
2633
2634int configYYget_debug (void)
2635{
2636 return configYY_flex_debug;
2637}
2638
2639void configYYset_debug (int bdebug )
2640{
2641 configYY_flex_debug = bdebug ;
2642}
2643
2644static int yy_init_globals (void)
2645{
2646 /* Initialization is the same as for the non-reentrant scanner.
2647 * This function is called from configYYlex_destroy(), so don't allocate here.
2648 */
2649
2650 (yy_buffer_stack) = 0;
2651 (yy_buffer_stack_top) = 0;
2652 (yy_buffer_stack_max) = 0;
2653 (yy_c_buf_p) = (char *) 0;
2654 (yy_init) = 0;
2655 (yy_start) = 0;
2656
2657/* Defined in main.c */
2658#ifdef YY_STDINIT
2659 configYYin = stdin;
2660 configYYout = stdout;
2661#else
2662 configYYin = (FILE *) 0;
2663 configYYout = (FILE *) 0;
2664#endif
2665
2666 /* For future reference: Set errno on error, since we are called by
2667 * configYYlex_init()
2668 */
2669 return 0;
2670}
2671
2672/* configYYlex_destroy is for both reentrant and non-reentrant scanners. */
2673int configYYlex_destroy (void)
2674{
2675
2676 /* Pop the buffer stack, destroying each element. */
2677while(YY_CURRENT_BUFFER){
2678configYY_delete_buffer(YY_CURRENT_BUFFER );
2679YY_CURRENT_BUFFER_LVALUE = NULL;
2680configYYpop_buffer_state();
2681}
2682
2683/* Destroy the stack itself. */
2684configYYfree((yy_buffer_stack) );
2685(yy_buffer_stack) = NULL;
2686
2687 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2688 * configYYlex() is called, initialization will occur. */
2689 yy_init_globals( );
2690
2691 return 0;
2692}
2693
2694/*
2695 * Internal utility routines.
2696 */
2697
2698#ifndef yytext_ptr
2699static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2700{
2701register int i;
2702for ( i = 0; i < n; ++i )
2703s1[i] = s2[i];
2704}
2705#endif
2706
2707#ifdef YY_NEED_STRLEN
2708static int yy_flex_strlen (yyconst char * s )
2709{
2710register int n;
2711for ( n = 0; s[n]; ++n )
2712;
2713
2714return n;
2715}
2716#endif
2717
2718void *configYYalloc (yy_size_t size )
2719{
2720return (void *) malloc( size );
2721}
2722
2723void *configYYrealloc (void * ptr, yy_size_t size )
2724{
2725/* The cast to (char *) in the following accommodates both
2726 * implementations that use char* generic pointers, and those
2727 * that use void* generic pointers. It works with the latter
2728 * because both ANSI C and C++ allow castless assignment from
2729 * any pointer type to void*, and deal with argument conversions
2730 * as though doing an assignment.
2731 */
2732return (void *) realloc( (char *) ptr, size );
2733}
2734
2735void configYYfree (void * ptr )
2736{
2737free( (char *) ptr );/* see configYYrealloc() for (char *) cast */
2738}
2739
2740#define YYTABLES_NAME "yytables"
2741
2742#line 805 "config.l"
2743
2744
2745
2746/*@ ----------------------------------------------------------------------------
2747 */
2748
2749void Config::writeTemplate(FTextStream &t,bool sl,bool upd)
2750{
2751 t << "# Doxyfile " << versionString << endl << endl;
2752 if (!sl)
2753 {
2754 t << "# This file describes the settings to be used by the documentation system\n";
2755 t << "# doxygen (www.doxygen.org) for a project.\n";
2756 t << "#\n";
2757 t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
2758 t << "# The format is:\n";
2759 t << "# TAG = value [value, ...]\n";
2760 t << "# For lists items can also be appended using:\n";
2761 t << "# TAG += value [value, ...]\n";
2762 t << "# Values that contain spaces should be placed between quotes (\" \").\n";
2763 }
2764 ConfigOption *option = m_options->first();
2765 while (option)
2766 {
2767 option->writeTemplate(t,sl,upd);
2768 option = m_options->next();
2769 }
2770}
2771
2772void Config::writeXML(FTextStream &t)
2773{
2774 t << "<doxygenconfig>" << endl;
2775 bool first=TRUE;
2776 ConfigOption *option = m_options->first();
2777 while (option)
2778 {
2779 if (option->kind()==ConfigOption::O_Info)
2780 {
2781 if (!first) t << " </group>" << endl;
2782 t << " <group name='" << option->name() << "' "
2783 "docs='" << option->docs() << "'>" << endl;
2784 first=FALSE;
2785 }
2786 else
2787 {
2788 option->writeXML(t);
2789 }
2790 option = m_options->next();
2791 }
2792 option = m_obsolete->first();
2793 while (option)
2794 {
2795 option->writeXML(t);
2796 option = m_obsolete->next();
2797 }
2798 if (!first) t << " </group>" << endl;
2799 t << "</doxygenconfig>" << endl;
2800}
2801
2802void Config::convertStrToVal()
2803{
2804 ConfigOption *option = m_options->first();
2805 while (option)
2806 {
2807 option->convertStrToVal();
2808 option = m_options->next();
2809 }
2810}
2811
2812static void substEnvVarsInString(QCString &s)
2813{
2814 static QRegExp re("\\$\\([a-z_A-Z0-9]+\\)");
2815 if (s.isEmpty()) return;
2816 int p=0;
2817 int i,l;
2818 //printf("substEnvVarInString(%s) start\n",s.data());
2819 while ((i=re.match(s,p,&l))!=-1)
2820 {
2821 //printf("Found environment var s.mid(%d,%d)=`%s'\n",i+2,l-3,s.mid(i+2,l-3).data());
2822 QCString env=portable_getenv(s.mid(i+2,l-3));
2823 substEnvVarsInString(env); // recursively expand variables if needed.
2824 s = s.left(i)+env+s.right(s.length()-i-l);
2825 p=i+env.length(); // next time start at the end of the expanded string
2826 }
2827 s=s.stripWhiteSpace(); // to strip the bogus space that was added when an argument
2828 // has quotes
2829 //printf("substEnvVarInString(%s) end\n",s.data());
2830}
2831
2832static void substEnvVarsInStrList(QStrList &sl)
2833{
2834 char *s = sl.first();
2835 while (s)
2836 {
2837 QCString result(s);
2838 // an argument with quotes will have an extra space at the end, so wasQuoted will be TRUE.
2839 bool wasQuoted = (result.find(' ')!=-1) || (result.find('\t')!=-1);
2840 // here we strip the quote again
2841 substEnvVarsInString(result);
2842
2843 //printf("Result %s was quoted=%d\n",result.data(),wasQuoted);
2844
2845 if (!wasQuoted) /* as a result of the expansion, a single string
2846 may have expanded into a list, which we'll
2847 add to sl. If the orginal string already
2848 contained multiple elements no further
2849 splitting is done to allow quoted items with spaces! */
2850 {
2851 int l=result.length();
2852 int i,p=0;
2853 // skip spaces
2854 // search for a "word"
2855 for (i=0;i<l;i++)
2856 {
2857char c=0;
2858// skip until start of new word
2859while (i<l && ((c=result.at(i))==' ' || c=='\t')) i++;
2860p=i; // p marks the start index of the word
2861// skip until end of a word
2862while (i<l && ((c=result.at(i))!=' ' && c!='\t' && c!='"')) i++;
2863if (i<l) // not at the end of the string
2864{
2865 if (c=='"') // word within quotes
2866 {
2867 p=i+1;
2868 for (i++;i<l;i++)
2869 {
2870 c=result.at(i);
2871 if (c=='"') // end quote
2872 {
2873// replace the string in the list and go to the next item.
2874sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
2875sl.next(); // current item is now the old item
2876p=i+1;
2877break;
2878 }
2879 else if (c=='\\') // skip escaped stuff
2880 {
2881i++;
2882 }
2883 }
2884 }
2885 else if (c==' ' || c=='\t') // separator
2886 {
2887 // replace the string in the list and go to the next item.
2888 sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
2889 sl.next(); // current item is now the old item
2890 p=i+1;
2891 }
2892}
2893 }
2894 if (p!=l) // add the leftover as a string
2895 {
2896// replace the string in the list and go to the next item.
2897sl.insert(sl.at(),result.right(l-p)); // insert new item before current item.
2898sl.next(); // current item is now the old item
2899 }
2900 }
2901 else // just goto the next element in the list
2902 {
2903 sl.insert(sl.at(),result);
2904 sl.next();
2905 }
2906 // remove the old unexpanded string from the list
2907 int i=sl.at();
2908 sl.remove(); // current item index changes if the last element is removed.
2909 if (sl.at()==i) // not last item
2910s = sl.current();
2911 else // just removed last item
2912s = 0;
2913 }
2914}
2915
2916void ConfigString::substEnvVars()
2917{
2918 substEnvVarsInString(m_value);
2919}
2920
2921void ConfigList::substEnvVars()
2922{
2923 substEnvVarsInStrList(m_value);
2924}
2925
2926void ConfigBool::substEnvVars()
2927{
2928 substEnvVarsInString(m_valueString);
2929}
2930
2931void ConfigInt::substEnvVars()
2932{
2933 substEnvVarsInString(m_valueString);
2934}
2935
2936void ConfigEnum::substEnvVars()
2937{
2938 substEnvVarsInString(m_value);
2939}
2940
2941void Config::substituteEnvironmentVars()
2942{
2943 ConfigOption *option = m_options->first();
2944 while (option)
2945 {
2946 option->substEnvVars();
2947 option = m_options->next();
2948 }
2949}
2950
2951static void cleanUpPaths(QStrList &str)
2952{
2953 char *sfp = str.first();
2954 while (sfp)
2955 {
2956 register char *p = sfp;
2957 if (p)
2958 {
2959 char c;
2960 while ((c=*p))
2961 {
2962if (c=='\\') *p='/';
2963p++;
2964 }
2965 }
2966 QCString path = sfp;
2967 if ((path.at(0)!='/' && (path.length()<=2 || path.at(1)!=':')) ||
2968path.at(path.length()-1)!='/'
2969 )
2970 {
2971 QFileInfo fi(path);
2972 if (fi.exists() && fi.isDir())
2973 {
2974int i = str.at();
2975str.remove();
2976if (str.at()==i) // did not remove last item
2977 str.insert(i,fi.absFilePath()+"/");
2978else
2979 str.append(fi.absFilePath()+"/");
2980 }
2981 }
2982 sfp = str.next();
2983 }
2984}
2985
2986void Config::check()
2987{
2988 //if (!projectName.isEmpty())
2989 //{
2990 // projectName[0]=toupper(projectName[0]);
2991 //}
2992
2993 QCString &warnFormat = Config_getString("WARN_FORMAT");
2994 if (warnFormat.stripWhiteSpace().isEmpty())
2995 {
2996 warnFormat="$file:$line $text";
2997 }
2998 else
2999 {
3000 if (warnFormat.find("$file")==-1)
3001 {
3002 config_err("warning: warning format does not contain a $file tag!\n");
3003 }
3004 if (warnFormat.find("$line")==-1)
3005 {
3006 config_err("warning: warning format does not contain a $line tag!\n");
3007 }
3008 if (warnFormat.find("$text")==-1)
3009 {
3010 config_err("warning: warning format foes not contain a $text tag!\n");
3011 }
3012 }
3013
3014 QCString &manExtension = Config_getString("MAN_EXTENSION");
3015
3016 // set default man page extension if non is given by the user
3017 if (manExtension.isEmpty())
3018 {
3019 manExtension=".3";
3020 }
3021
3022 QCString &paperType = Config_getEnum("PAPER_TYPE");
3023 paperType=paperType.lower().stripWhiteSpace();
3024 if (paperType.isEmpty())
3025 {
3026 paperType = "a4";
3027 }
3028 if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" &&
3029 paperType!="legal" && paperType!="executive")
3030 {
3031 config_err("error: Unknown page type specified");
3032 }
3033
3034 QCString &outputLanguage=Config_getEnum("OUTPUT_LANGUAGE");
3035 outputLanguage=outputLanguage.stripWhiteSpace();
3036 if (outputLanguage.isEmpty())
3037 {
3038 outputLanguage = "English";
3039 }
3040
3041 QCString &htmlFileExtension=Config_getString("HTML_FILE_EXTENSION");
3042 htmlFileExtension=htmlFileExtension.stripWhiteSpace();
3043 if (htmlFileExtension.isEmpty())
3044 {
3045 htmlFileExtension = ".html";
3046 }
3047
3048 // expand the relative stripFromPath values
3049 QStrList &stripFromPath = Config_getList("STRIP_FROM_PATH");
3050 char *sfp = stripFromPath.first();
3051 if (sfp==0) // by default use the current path
3052 {
3053 stripFromPath.append(QDir::currentDirPath()+"/");
3054 }
3055 else
3056 {
3057 cleanUpPaths(stripFromPath);
3058 }
3059
3060 // expand the relative stripFromPath values
3061 QStrList &stripFromIncPath = Config_getList("STRIP_FROM_INC_PATH");
3062 cleanUpPaths(stripFromIncPath);
3063
3064 // Test to see if HTML header is valid
3065 QCString &headerFile = Config_getString("HTML_HEADER");
3066 if (!headerFile.isEmpty())
3067 {
3068 QFileInfo fi(headerFile);
3069 if (!fi.exists())
3070 {
3071 config_err("error: tag HTML_HEADER: header file `%s' "
3072 "does not exist\n",headerFile.data());
3073 exit(1);
3074 }
3075 }
3076 // Test to see if HTML footer is valid
3077 QCString &footerFile = Config_getString("HTML_FOOTER");
3078 if (!footerFile.isEmpty())
3079 {
3080 QFileInfo fi(footerFile);
3081 if (!fi.exists())
3082 {
3083 config_err("error: tag HTML_FOOTER: footer file `%s' "
3084 "does not exist\n",footerFile.data());
3085 exit(1);
3086 }
3087 }
3088 // Test to see if LaTeX header is valid
3089 QCString &latexHeaderFile = Config_getString("LATEX_HEADER");
3090 if (!latexHeaderFile.isEmpty())
3091 {
3092 QFileInfo fi(latexHeaderFile);
3093 if (!fi.exists())
3094 {
3095 config_err("error: tag LATEX_HEADER: header file `%s' "
3096 "does not exist\n",latexHeaderFile.data());
3097 exit(1);
3098 }
3099 }
3100 // check include path
3101 QStrList &includePath = Config_getList("INCLUDE_PATH");
3102 char *s=includePath.first();
3103 while (s)
3104 {
3105 QFileInfo fi(s);
3106 if (!fi.exists()) config_err("warning: tag INCLUDE_PATH: include path `%s' "
3107 "does not exist\n",s);
3108 s=includePath.next();
3109 }
3110
3111 // check aliases
3112 QStrList &aliasList = Config_getList("ALIASES");
3113 s=aliasList.first();
3114 while (s)
3115 {
3116 QRegExp re1("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*="); // alias without argument
3117 QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]*}[ \t]*="); // alias with argument
3118 QCString alias=s;
3119 alias=alias.stripWhiteSpace();
3120 if (alias.find(re1)!=0 && alias.find(re2)!=0)
3121 {
3122 config_err("Illegal alias format `%s'. Use \"name=value\" or \"name(n)=value\", where n is the number of arguments\n",
3123 alias.data());
3124 }
3125 s=aliasList.next();
3126 }
3127
3128 // check if GENERATE_TREEVIEW and GENERATE_HTMLHELP are both enabled
3129 if (Config_getBool("GENERATE_TREEVIEW") && Config_getBool("GENERATE_HTMLHELP"))
3130 {
3131 config_err("When enabling GENERATE_HTMLHELP the tree view (GENERATE_TREEVIEW) should be disabled. I'll do it for you.\n");
3132 Config_getBool("GENERATE_TREEVIEW")=FALSE;
3133 }
3134 if (Config_getBool("SEARCHENGINE") && Config_getBool("GENERATE_HTMLHELP"))
3135 {
3136 config_err("When enabling GENERATE_HTMLHELP the search engine (SEARCHENGINE) should be disabled. I'll do it for you.\n");
3137 Config_getBool("SEARCHENGINE")=FALSE;
3138 }
3139
3140 // check if SEPARATE_MEMBER_PAGES and INLINE_GROUPED_CLASSES are both enabled
3141 if (Config_getBool("SEPARATE_MEMBER_PAGES") && Config_getBool("INLINE_GROUPED_CLASSES"))
3142 {
3143 config_err("When enabling INLINE_GROUPED_CLASSES the SEPARATE_MEMBER_PAGES option should be disabled. I'll do it for you.\n");
3144 Config_getBool("SEPARATE_MEMBER_PAGES")=FALSE;
3145 }
3146
3147 // check dot image format
3148 QCString &dotImageFormat=Config_getEnum("DOT_IMAGE_FORMAT");
3149 dotImageFormat=dotImageFormat.stripWhiteSpace();
3150 if (dotImageFormat.isEmpty())
3151 {
3152 dotImageFormat = "png";
3153 }
3154 //else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg")
3155 //{
3156 // config_err("Invalid value for DOT_IMAGE_FORMAT: `%s'. Using the default.\n",dotImageFormat.data());
3157 // dotImageFormat = "png";
3158 //}
3159
3160
3161 // check dot path
3162 QCString &dotPath = Config_getString("DOT_PATH");
3163 if (!dotPath.isEmpty())
3164 {
3165 QFileInfo dp(dotPath+"/dot"+portable_commandExtension());
3166 if (!dp.exists() || !dp.isFile())
3167 {
3168 config_err("warning: the dot tool could not be found at %s\n",dotPath.data());
3169 dotPath="";
3170 }
3171 else
3172 {
3173 dotPath=dp.dirPath(TRUE)+"/";
3174#if defined(_WIN32) // convert slashes
3175 uint i=0,l=dotPath.length();
3176 for (i=0;i<l;i++) if (dotPath.at(i)=='/') dotPath.at(i)='\\';
3177#endif
3178 }
3179 }
3180 else // make sure the string is empty but not null!
3181 {
3182 dotPath="";
3183 }
3184
3185 // check mscgen path
3186 QCString &mscgenPath = Config_getString("MSCGEN_PATH");
3187 if (!mscgenPath.isEmpty())
3188 {
3189 QFileInfo dp(mscgenPath+"/mscgen"+portable_commandExtension());
3190 if (!dp.exists() || !dp.isFile())
3191 {
3192 config_err("warning: the mscgen tool could not be found at %s\n",mscgenPath.data());
3193 mscgenPath="";
3194 }
3195 else
3196 {
3197 mscgenPath=dp.dirPath(TRUE)+"/";
3198#if defined(_WIN32) // convert slashes
3199 uint i=0,l=mscgenPath.length();
3200 for (i=0;i<l;i++) if (mscgenPath.at(i)=='/') mscgenPath.at(i)='\\';
3201#endif
3202 }
3203 }
3204 else // make sure the string is empty but not null!
3205 {
3206 mscgenPath="";
3207 }
3208
3209
3210 // check input
3211 QStrList &inputSources=Config_getList("INPUT");
3212 if (inputSources.count()==0)
3213 {
3214 // use current dir as the default
3215 inputSources.append(QDir::currentDirPath());
3216 }
3217 else
3218 {
3219 s=inputSources.first();
3220 while (s)
3221 {
3222 QFileInfo fi(s);
3223 if (!fi.exists())
3224 {
3225config_err("warning: tag INPUT: input source `%s' does not exist\n",s);
3226 }
3227 s=inputSources.next();
3228 }
3229 }
3230
3231 // add default pattern if needed
3232 QStrList &filePatternList = Config_getList("FILE_PATTERNS");
3233 if (filePatternList.isEmpty())
3234 {
3235 filePatternList.append("*.c");
3236 filePatternList.append("*.cc");
3237 filePatternList.append("*.cxx");
3238 filePatternList.append("*.cpp");
3239 filePatternList.append("*.c++");
3240 filePatternList.append("*.d");
3241 filePatternList.append("*.java");
3242 filePatternList.append("*.ii");
3243 filePatternList.append("*.ixx");
3244 filePatternList.append("*.ipp");
3245 filePatternList.append("*.i++");
3246 filePatternList.append("*.inl");
3247 filePatternList.append("*.h");
3248 filePatternList.append("*.hh");
3249 filePatternList.append("*.hxx");
3250 filePatternList.append("*.hpp");
3251 filePatternList.append("*.h++");
3252 filePatternList.append("*.idl");
3253 filePatternList.append("*.odl");
3254 filePatternList.append("*.cs");
3255 filePatternList.append("*.php");
3256 filePatternList.append("*.php3");
3257 filePatternList.append("*.inc");
3258 filePatternList.append("*.m");
3259 filePatternList.append("*.mm");
3260 filePatternList.append("*.dox");
3261 filePatternList.append("*.py");
3262 filePatternList.append("*.f90");
3263 filePatternList.append("*.f");
3264 filePatternList.append("*.for");
3265 filePatternList.append("*.vhd");
3266 filePatternList.append("*.vhdl");
3267 if (portable_fileSystemIsCaseSensitive())
3268 {
3269 // unix => case sensitive match => also include useful uppercase versions
3270 filePatternList.append("*.C");
3271 filePatternList.append("*.CC");
3272 filePatternList.append("*.C++");
3273 filePatternList.append("*.II");
3274 filePatternList.append("*.I++");
3275 filePatternList.append("*.H");
3276 filePatternList.append("*.HH");
3277 filePatternList.append("*.H++");
3278 filePatternList.append("*.CS");
3279 filePatternList.append("*.PHP");
3280 filePatternList.append("*.PHP3");
3281 filePatternList.append("*.M");
3282 filePatternList.append("*.MM");
3283 filePatternList.append("*.PY");
3284 filePatternList.append("*.F90");
3285 filePatternList.append("*.F");
3286 filePatternList.append("*.VHD");
3287 filePatternList.append("*.VHDL");
3288 }
3289 }
3290
3291 // add default pattern if needed
3292 QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS");
3293 if (examplePatternList.isEmpty())
3294 {
3295 examplePatternList.append("*");
3296 }
3297
3298 // if no output format is enabled, warn the user
3299 if (!Config_getBool("GENERATE_HTML") &&
3300 !Config_getBool("GENERATE_LATEX") &&
3301 !Config_getBool("GENERATE_MAN") &&
3302 !Config_getBool("GENERATE_RTF") &&
3303 !Config_getBool("GENERATE_XML") &&
3304 !Config_getBool("GENERATE_PERLMOD") &&
3305 !Config_getBool("GENERATE_RTF") &&
3306 !Config_getBool("GENERATE_AUTOGEN_DEF") &&
3307 Config_getString("GENERATE_TAGFILE").isEmpty()
3308 )
3309 {
3310 config_err("warning: No output formats selected! Set at least one of the main GENERATE_* options to YES.\n");
3311 }
3312
3313 // check HTMLHELP creation requirements
3314 if (!Config_getBool("GENERATE_HTML") &&
3315 Config_getBool("GENERATE_HTMLHELP"))
3316 {
3317 config_err("warning: GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n");
3318 }
3319
3320 // check QHP creation requirements
3321 if (Config_getBool("GENERATE_QHP"))
3322 {
3323 if (Config_getString("QHP_NAMESPACE").isEmpty())
3324 {
3325 config_err("error: GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Using 'org.doxygen.doc' as default!.\n");
3326 Config_getString("QHP_NAMESPACE")="org.doxygen.doc";
3327 }
3328
3329 if (Config_getString("QHP_VIRTUAL_FOLDER").isEmpty())
3330 {
3331 config_err("error: GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n");
3332 Config_getString("QHP_VIRTUAL_FOLDER")="doc";
3333 }
3334 }
3335
3336 if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO"))
3337 {
3338 // don't show inline info for Java output, since Java has no inline
3339 // concept.
3340 Config_getBool("INLINE_INFO")=FALSE;
3341 }
3342
3343 int &depth = Config_getInt("MAX_DOT_GRAPH_DEPTH");
3344 if (depth==0)
3345 {
3346 depth=1000;
3347 }
3348
3349 int &hue = Config_getInt("HTML_COLORSTYLE_HUE");
3350 if (hue<0)
3351 {
3352 hue=0;
3353 }
3354 else if (hue>=360)
3355 {
3356 hue=hue%360;
3357 }
3358
3359 int &sat = Config_getInt("HTML_COLORSTYLE_SAT");
3360 if (sat<0)
3361 {
3362 sat=0;
3363 }
3364 else if (sat>255)
3365 {
3366 sat=255;
3367 }
3368 int &gamma = Config_getInt("HTML_COLORSTYLE_GAMMA");
3369 if (gamma<40)
3370 {
3371 gamma=40;
3372 }
3373 else if (gamma>240)
3374 {
3375 gamma=240;
3376 }
3377
3378
3379 // add default words if needed
3380 QStrList &annotationFromBrief = Config_getList("ABBREVIATE_BRIEF");
3381 if (annotationFromBrief.isEmpty())
3382 {
3383 annotationFromBrief.append("The $name class");
3384 annotationFromBrief.append("The $name widget");
3385 annotationFromBrief.append("The $name file");
3386 annotationFromBrief.append("is");
3387 annotationFromBrief.append("provides");
3388 annotationFromBrief.append("specifies");
3389 annotationFromBrief.append("contains");
3390 annotationFromBrief.append("represents");
3391 annotationFromBrief.append("a");
3392 annotationFromBrief.append("an");
3393 annotationFromBrief.append("the");
3394 }
3395
3396 // some default settings for vhdl
3397 if (Config_getBool("OPTIMIZE_OUTPUT_VHDL") &&
3398 (Config_getBool("INLINE_INHERITED_MEMB") ||
3399 Config_getBool("INHERIT_DOCS") ||
3400 !Config_getBool("HIDE_SCOPE_NAMES") ||
3401 !Config_getBool("EXTRACT_PRIVATE")
3402 )
3403 )
3404 {
3405 bool b1 = Config_getBool("INLINE_INHERITED_MEMB");
3406 bool b2 = Config_getBool("INHERIT_DOCS");
3407 bool b3 = Config_getBool("HIDE_SCOPE_NAMES");
3408 bool b4 = Config_getBool("EXTRACT_PRIVATE");
3409 const char *s1,*s2,*s3,*s4;
3410 if (b1) s1=" INLINDE_INHERITED_MEMB = NO (was YES)\n"; else s1="";
3411 if (b2) s2=" INHERIT_DOCS = NO (was YES)\n"; else s2="";
3412 if (!b3) s3=" HIDE_SCOPE_NAMES = YES (was NO)\n"; else s3="";
3413 if (!b4) s4=" EXTRACT_PRIVATE = YES (was NO)\n"; else s4="";
3414
3415 config_err("warning: enabling OPTIMIZE_OUTPUT_VHDL assumes the following settings:\n"
3416 "%s%s%s%s",s1,s2,s3,s4
3417 );
3418
3419 Config_getBool("INLINE_INHERITED_MEMB") = FALSE;
3420 Config_getBool("INHERIT_DOCS") = FALSE;
3421 Config_getBool("HIDE_SCOPE_NAMES") = TRUE;
3422 Config_getBool("EXTRACT_PRIVATE") = TRUE;
3423 }
3424
3425}
3426
3427void Config::init()
3428{
3429 ConfigOption *option = m_options->first();
3430 while (option)
3431 {
3432 option->init();
3433 option = m_options->next();
3434 }
3435}
3436
3437void Config::create()
3438{
3439 if (m_initialized) return;
3440 m_initialized = TRUE;
3441 addConfigOptions(this);
3442}
3443
3444static QCString configFileToString(const char *name)
3445{
3446 if (name==0 || name[0]==0) return 0;
3447 QFile f;
3448
3449 bool fileOpened=FALSE;
3450 if (name[0]=='-' && name[1]==0) // read from stdin
3451 {
3452 fileOpened=f.open(IO_ReadOnly,stdin);
3453 if (fileOpened)
3454 {
3455 const int bSize=4096;
3456 QCString contents(bSize);
3457 int totalSize=0;
3458 int size;
3459 while ((size=f.readBlock(contents.data()+totalSize,bSize))==bSize)
3460 {
3461 totalSize+=bSize;
3462 contents.resize(totalSize+bSize);
3463 }
3464 totalSize+=size+2;
3465 contents.resize(totalSize);
3466 contents.at(totalSize-2)='\n'; // to help the scanner
3467 contents.at(totalSize-1)='\0';
3468 return contents;
3469 }
3470 }
3471 else // read from file
3472 {
3473 QFileInfo fi(name);
3474 if (!fi.exists() || !fi.isFile())
3475 {
3476 config_err("error: file `%s' not found\n",name);
3477 return "";
3478 }
3479 f.setName(name);
3480 fileOpened=f.open(IO_ReadOnly);
3481 if (fileOpened)
3482 {
3483 int fsize=f.size();
3484 QCString contents(fsize+2);
3485 f.readBlock(contents.data(),fsize);
3486 f.close();
3487 if (fsize==0 || contents[fsize-1]=='\n')
3488contents[fsize]='\0';
3489 else
3490contents[fsize]='\n'; // to help the scanner
3491 contents[fsize+1]='\0';
3492 return contents;
3493 }
3494 }
3495 if (!fileOpened)
3496 {
3497 config_err("error: cannot open file `%s' for reading\n",name);
3498 }
3499 return "";
3500}
3501
3502bool Config::parseString(const char *fn,const char *str)
3503{
3504 config = Config::instance();
3505 inputString = str;
3506 inputPosition = 0;
3507 yyFileName = fn;
3508 yyLineNr = 1;
3509 includeStack.setAutoDelete(TRUE);
3510 includeStack.clear();
3511 includeDepth = 0;
3512 configYYrestart( configYYin );
3513 BEGIN( Start );
3514 configYYlex();
3515 inputString = 0;
3516 return TRUE;
3517}
3518
3519bool Config::parse(const char *fn)
3520{
3521 encoding = "UTF-8";
3522 return parseString(fn,configFileToString(fn));
3523}
3524
3525extern "C" { // some bogus code to keep the compiler happy
3526 //int configYYwrap() { return 1 ; }
3527}
3528
3529

Archive Download this file

Revision: 1322