SUNRPC: Remove the BKL from the callback functions
[linux-2.6/cjktty.git] / scripts / kconfig / lex.zconf.c_shipped
blob6a61cee4a32c39ca6931b191e93b6a6313689331
2 #line 3 "scripts/kconfig/lex.zconf.c"
4 #define  YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 33
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
16 /* First, we deal with  platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
24 /* end standard C headers. */
26 /* flex integer type definitions */
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36  * if you want the limit (max/min) macros for int types. 
37  */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t; 
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56 #endif /* ! C99 */
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN               (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN              (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN              (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX               (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX              (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX              (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX              (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX             (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX             (4294967295U)
85 #endif
87 #endif /* ! FLEXINT_H */
89 #ifdef __cplusplus
91 /* The "const" storage-class-modifier is valid. */
92 #define YY_USE_CONST
94 #else   /* ! __cplusplus */
96 #if __STDC__
98 #define YY_USE_CONST
100 #endif  /* __STDC__ */
101 #endif  /* ! __cplusplus */
103 #ifdef YY_USE_CONST
104 #define yyconst const
105 #else
106 #define yyconst
107 #endif
109 /* Returned upon end-of-file. */
110 #define YY_NULL 0
112 /* Promotes a possibly negative, possibly signed char to an unsigned
113  * integer for use as an array index.  If the signed char is negative,
114  * we want to instead treat it as an 8-bit unsigned char, hence the
115  * double cast.
116  */
117 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119 /* Enter a start condition.  This macro really ought to take a parameter,
120  * but we do it the disgusting crufty way forced on us by the ()-less
121  * definition of BEGIN.
122  */
123 #define BEGIN (yy_start) = 1 + 2 *
125 /* Translate the current start state into a value that can be later handed
126  * to BEGIN to return to the state.  The YYSTATE alias is for lex
127  * compatibility.
128  */
129 #define YY_START (((yy_start) - 1) / 2)
130 #define YYSTATE YY_START
132 /* Action number for EOF rule of a given start state. */
133 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135 /* Special action meaning "start processing a new file". */
136 #define YY_NEW_FILE zconfrestart(zconfin  )
138 #define YY_END_OF_BUFFER_CHAR 0
140 /* Size of default input buffer. */
141 #ifndef YY_BUF_SIZE
142 #define YY_BUF_SIZE 16384
143 #endif
145 /* The state buf must be large enough to hold one state per character in the main buffer.
146  */
147 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
150 #define YY_TYPEDEF_YY_BUFFER_STATE
151 typedef struct yy_buffer_state *YY_BUFFER_STATE;
152 #endif
154 extern int zconfleng;
156 extern FILE *zconfin, *zconfout;
158 #define EOB_ACT_CONTINUE_SCAN 0
159 #define EOB_ACT_END_OF_FILE 1
160 #define EOB_ACT_LAST_MATCH 2
162     #define YY_LESS_LINENO(n)
163     
164 /* Return all but the first "n" matched characters back to the input stream. */
165 #define yyless(n) \
166         do \
167                 { \
168                 /* Undo effects of setting up zconftext. */ \
169         int yyless_macro_arg = (n); \
170         YY_LESS_LINENO(yyless_macro_arg);\
171                 *yy_cp = (yy_hold_char); \
172                 YY_RESTORE_YY_MORE_OFFSET \
173                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
174                 YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
175                 } \
176         while ( 0 )
178 #define unput(c) yyunput( c, (yytext_ptr)  )
180 /* The following is because we cannot portably get our hands on size_t
181  * (without autoconf's help, which isn't available because we want
182  * flex-generated scanners to compile on their own).
183  */
185 #ifndef YY_TYPEDEF_YY_SIZE_T
186 #define YY_TYPEDEF_YY_SIZE_T
187 typedef unsigned int yy_size_t;
188 #endif
190 #ifndef YY_STRUCT_YY_BUFFER_STATE
191 #define YY_STRUCT_YY_BUFFER_STATE
192 struct yy_buffer_state
193         {
194         FILE *yy_input_file;
196         char *yy_ch_buf;                /* input buffer */
197         char *yy_buf_pos;               /* current position in input buffer */
199         /* Size of input buffer in bytes, not including room for EOB
200          * characters.
201          */
202         yy_size_t yy_buf_size;
204         /* Number of characters read into yy_ch_buf, not including EOB
205          * characters.
206          */
207         int yy_n_chars;
209         /* Whether we "own" the buffer - i.e., we know we created it,
210          * and can realloc() it to grow it, and should free() it to
211          * delete it.
212          */
213         int yy_is_our_buffer;
215         /* Whether this is an "interactive" input source; if so, and
216          * if we're using stdio for input, then we want to use getc()
217          * instead of fread(), to make sure we stop fetching input after
218          * each newline.
219          */
220         int yy_is_interactive;
222         /* Whether we're considered to be at the beginning of a line.
223          * If so, '^' rules will be active on the next match, otherwise
224          * not.
225          */
226         int yy_at_bol;
228     int yy_bs_lineno; /**< The line count. */
229     int yy_bs_column; /**< The column count. */
230     
231         /* Whether to try to fill the input buffer when we reach the
232          * end of it.
233          */
234         int yy_fill_buffer;
236         int yy_buffer_status;
238 #define YY_BUFFER_NEW 0
239 #define YY_BUFFER_NORMAL 1
240         /* When an EOF's been seen but there's still some text to process
241          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
242          * shouldn't try reading from the input source any more.  We might
243          * still have a bunch of tokens to match, though, because of
244          * possible backing-up.
245          *
246          * When we actually see the EOF, we change the status to "new"
247          * (via zconfrestart()), so that the user can continue scanning by
248          * just pointing zconfin at a new input file.
249          */
250 #define YY_BUFFER_EOF_PENDING 2
252         };
253 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
255 /* Stack of input buffers. */
256 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
257 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
258 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
260 /* We provide macros for accessing buffer states in case in the
261  * future we want to put the buffer states in a more general
262  * "scanner state".
264  * Returns the top of the stack, or NULL.
265  */
266 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
267                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
268                           : NULL)
270 /* Same as previous macro, but useful when we know that the buffer stack is not
271  * NULL or when we need an lvalue. For internal use only.
272  */
273 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275 /* yy_hold_char holds the character lost when zconftext is formed. */
276 static char yy_hold_char;
277 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
278 int zconfleng;
280 /* Points to current character in buffer. */
281 static char *yy_c_buf_p = (char *) 0;
282 static int yy_init = 0;         /* whether we need to initialize */
283 static int yy_start = 0;        /* start state number */
285 /* Flag which is used to allow zconfwrap()'s to do buffer switches
286  * instead of setting up a fresh zconfin.  A bit of a hack ...
287  */
288 static int yy_did_buffer_switch_on_eof;
290 void zconfrestart (FILE *input_file  );
291 void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
292 YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size  );
293 void zconf_delete_buffer (YY_BUFFER_STATE b  );
294 void zconf_flush_buffer (YY_BUFFER_STATE b  );
295 void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer  );
296 void zconfpop_buffer_state (void );
298 static void zconfensure_buffer_stack (void );
299 static void zconf_load_buffer_state (void );
300 static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file  );
302 #define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
304 YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size  );
305 YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str  );
306 YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len  );
308 void *zconfalloc (yy_size_t  );
309 void *zconfrealloc (void *,yy_size_t  );
310 void zconffree (void *  );
312 #define yy_new_buffer zconf_create_buffer
314 #define yy_set_interactive(is_interactive) \
315         { \
316         if ( ! YY_CURRENT_BUFFER ){ \
317         zconfensure_buffer_stack (); \
318                 YY_CURRENT_BUFFER_LVALUE =    \
319             zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
320         } \
321         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
322         }
324 #define yy_set_bol(at_bol) \
325         { \
326         if ( ! YY_CURRENT_BUFFER ){\
327         zconfensure_buffer_stack (); \
328                 YY_CURRENT_BUFFER_LVALUE =    \
329             zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
330         } \
331         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
332         }
334 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336 /* Begin user sect3 */
338 #define zconfwrap() 1
339 #define YY_SKIP_YYWRAP
341 typedef unsigned char YY_CHAR;
343 FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
345 typedef int yy_state_type;
347 extern int zconflineno;
349 int zconflineno = 1;
351 extern char *zconftext;
352 #define yytext_ptr zconftext
353 static yyconst flex_int16_t yy_nxt[][17] =
354     {
355     {
356         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
357         0,    0,    0,    0,    0,    0,    0
358     },
360     {
361        11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
362        12,   12,   12,   12,   12,   12,   12
363     },
365     {
366        11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
367        12,   12,   12,   12,   12,   12,   12
368     },
370     {
371        11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
372        16,   16,   16,   18,   16,   16,   16
373     },
375     {
376        11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
377        16,   16,   16,   18,   16,   16,   16
379     },
381     {
382        11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
383        19,   19,   19,   19,   19,   19,   19
384     },
386     {
387        11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
388        19,   19,   19,   19,   19,   19,   19
389     },
391     {
392        11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
393        22,   22,   22,   22,   22,   25,   22
394     },
396     {
397        11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
398        22,   22,   22,   22,   22,   25,   22
399     },
401     {
402        11,   26,   26,   27,   28,   29,   30,   31,   29,   32,
403        33,   34,   35,   35,   36,   37,   38
405     },
407     {
408        11,   26,   26,   27,   28,   29,   30,   31,   29,   32,
409        33,   34,   35,   35,   36,   37,   38
410     },
412     {
413       -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,
414       -11,  -11,  -11,  -11,  -11,  -11,  -11
415     },
417     {
418        11,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
419       -12,  -12,  -12,  -12,  -12,  -12,  -12
420     },
422     {
423        11,  -13,   39,   40,  -13,  -13,   41,  -13,  -13,  -13,
424       -13,  -13,  -13,  -13,  -13,  -13,  -13
425     },
427     {
428        11,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
429       -14,  -14,  -14,  -14,  -14,  -14,  -14
431     },
433     {
434        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
435        42,   42,   42,   42,   42,   42,   42
436     },
438     {
439        11,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
440       -16,  -16,  -16,  -16,  -16,  -16,  -16
441     },
443     {
444        11,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
445       -17,  -17,  -17,  -17,  -17,  -17,  -17
446     },
448     {
449        11,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
450       -18,  -18,  -18,   44,  -18,  -18,  -18
451     },
453     {
454        11,   45,   45,  -19,   45,   45,   45,   45,   45,   45,
455        45,   45,   45,   45,   45,   45,   45
457     },
459     {
460        11,  -20,   46,   47,  -20,  -20,  -20,  -20,  -20,  -20,
461       -20,  -20,  -20,  -20,  -20,  -20,  -20
462     },
464     {
465        11,   48,  -21,  -21,   48,   48,   48,   48,   48,   48,
466        48,   48,   48,   48,   48,   48,   48
467     },
469     {
470        11,   49,   49,   50,   49,  -22,   49,   49,  -22,   49,
471        49,   49,   49,   49,   49,  -22,   49
472     },
474     {
475        11,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
476       -23,  -23,  -23,  -23,  -23,  -23,  -23
477     },
479     {
480        11,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
481       -24,  -24,  -24,  -24,  -24,  -24,  -24
483     },
485     {
486        11,   51,   51,   52,   51,   51,   51,   51,   51,   51,
487        51,   51,   51,   51,   51,   51,   51
488     },
490     {
491        11,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
492       -26,  -26,  -26,  -26,  -26,  -26,  -26
493     },
495     {
496        11,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,
497       -27,  -27,  -27,  -27,  -27,  -27,  -27
498     },
500     {
501        11,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,
502       -28,  -28,  -28,  -28,   53,  -28,  -28
503     },
505     {
506        11,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
507       -29,  -29,  -29,  -29,  -29,  -29,  -29
509     },
511     {
512        11,   54,   54,  -30,   54,   54,   54,   54,   54,   54,
513        54,   54,   54,   54,   54,   54,   54
514     },
516     {
517        11,  -31,  -31,  -31,  -31,  -31,  -31,   55,  -31,  -31,
518       -31,  -31,  -31,  -31,  -31,  -31,  -31
519     },
521     {
522        11,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
523       -32,  -32,  -32,  -32,  -32,  -32,  -32
524     },
526     {
527        11,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
528       -33,  -33,  -33,  -33,  -33,  -33,  -33
529     },
531     {
532        11,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
533       -34,   56,   57,   57,  -34,  -34,  -34
535     },
537     {
538        11,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
539       -35,   57,   57,   57,  -35,  -35,  -35
540     },
542     {
543        11,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
544       -36,  -36,  -36,  -36,  -36,  -36,  -36
545     },
547     {
548        11,  -37,  -37,   58,  -37,  -37,  -37,  -37,  -37,  -37,
549       -37,  -37,  -37,  -37,  -37,  -37,  -37
550     },
552     {
553        11,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
554       -38,  -38,  -38,  -38,  -38,  -38,   59
555     },
557     {
558        11,  -39,   39,   40,  -39,  -39,   41,  -39,  -39,  -39,
559       -39,  -39,  -39,  -39,  -39,  -39,  -39
561     },
563     {
564        11,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
565       -40,  -40,  -40,  -40,  -40,  -40,  -40
566     },
568     {
569        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
570        42,   42,   42,   42,   42,   42,   42
571     },
573     {
574        11,   42,   42,   43,   42,   42,   42,   42,   42,   42,
575        42,   42,   42,   42,   42,   42,   42
576     },
578     {
579        11,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
580       -43,  -43,  -43,  -43,  -43,  -43,  -43
581     },
583     {
584        11,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
585       -44,  -44,  -44,   44,  -44,  -44,  -44
587     },
589     {
590        11,   45,   45,  -45,   45,   45,   45,   45,   45,   45,
591        45,   45,   45,   45,   45,   45,   45
592     },
594     {
595        11,  -46,   46,   47,  -46,  -46,  -46,  -46,  -46,  -46,
596       -46,  -46,  -46,  -46,  -46,  -46,  -46
597     },
599     {
600        11,   48,  -47,  -47,   48,   48,   48,   48,   48,   48,
601        48,   48,   48,   48,   48,   48,   48
602     },
604     {
605        11,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
606       -48,  -48,  -48,  -48,  -48,  -48,  -48
607     },
609     {
610        11,   49,   49,   50,   49,  -49,   49,   49,  -49,   49,
611        49,   49,   49,   49,   49,  -49,   49
613     },
615     {
616        11,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
617       -50,  -50,  -50,  -50,  -50,  -50,  -50
618     },
620     {
621        11,  -51,  -51,   52,  -51,  -51,  -51,  -51,  -51,  -51,
622       -51,  -51,  -51,  -51,  -51,  -51,  -51
623     },
625     {
626        11,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
627       -52,  -52,  -52,  -52,  -52,  -52,  -52
628     },
630     {
631        11,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
632       -53,  -53,  -53,  -53,  -53,  -53,  -53
633     },
635     {
636        11,   54,   54,  -54,   54,   54,   54,   54,   54,   54,
637        54,   54,   54,   54,   54,   54,   54
639     },
641     {
642        11,  -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,
643       -55,  -55,  -55,  -55,  -55,  -55,  -55
644     },
646     {
647        11,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
648       -56,   60,   57,   57,  -56,  -56,  -56
649     },
651     {
652        11,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
653       -57,   57,   57,   57,  -57,  -57,  -57
654     },
656     {
657        11,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,
658       -58,  -58,  -58,  -58,  -58,  -58,  -58
659     },
661     {
662        11,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,
663       -59,  -59,  -59,  -59,  -59,  -59,  -59
665     },
667     {
668        11,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,
669       -60,   57,   57,   57,  -60,  -60,  -60
670     },
672     } ;
674 static yy_state_type yy_get_previous_state (void );
675 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
676 static int yy_get_next_buffer (void );
677 static void yy_fatal_error (yyconst char msg[]  );
679 /* Done after the current pattern has been matched and before the
680  * corresponding action - sets up zconftext.
681  */
682 #define YY_DO_BEFORE_ACTION \
683         (yytext_ptr) = yy_bp; \
684         zconfleng = (size_t) (yy_cp - yy_bp); \
685         (yy_hold_char) = *yy_cp; \
686         *yy_cp = '\0'; \
687         (yy_c_buf_p) = yy_cp;
689 #define YY_NUM_RULES 33
690 #define YY_END_OF_BUFFER 34
691 /* This struct is not used in this scanner,
692    but its presence is necessary. */
693 struct yy_trans_info
694         {
695         flex_int32_t yy_verify;
696         flex_int32_t yy_nxt;
697         };
698 static yyconst flex_int16_t yy_accept[61] =
699     {   0,
700         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
701        34,    5,    4,    2,    3,    7,    8,    6,   32,   29,
702        31,   24,   28,   27,   26,   22,   17,   13,   16,   20,
703        22,   11,   12,   19,   19,   14,   22,   22,    4,    2,
704         3,    3,    1,    6,   32,   29,   31,   30,   24,   23,
705        26,   25,   15,   20,    9,   19,   19,   21,   10,   18
706     } ;
708 static yyconst flex_int32_t yy_ec[256] =
709     {   0,
710         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
711         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
712         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
713         1,    2,    4,    5,    6,    1,    1,    7,    8,    9,
714        10,    1,    1,    1,   11,   12,   12,   13,   13,   13,
715        13,   13,   13,   13,   13,   13,   13,    1,    1,    1,
716        14,    1,    1,    1,   13,   13,   13,   13,   13,   13,
717        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
718        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
719         1,   15,    1,    1,   13,    1,   13,   13,   13,   13,
721        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
722        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
723        13,   13,    1,   16,    1,    1,    1,    1,    1,    1,
724         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
725         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
726         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
727         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
728         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
729         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
730         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
732         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
733         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
734         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
735         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
736         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
737         1,    1,    1,    1,    1
738     } ;
740 extern int zconf_flex_debug;
741 int zconf_flex_debug = 0;
743 /* The intent behind this definition is that it'll catch
744  * any uses of REJECT which flex missed.
745  */
746 #define REJECT reject_used_but_not_detected
747 #define yymore() yymore_used_but_not_detected
748 #define YY_MORE_ADJ 0
749 #define YY_RESTORE_YY_MORE_OFFSET
750 char *zconftext;
753  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
754  * Released under the terms of the GNU GPL v2.0.
755  */
757 #include <limits.h>
758 #include <stdio.h>
759 #include <stdlib.h>
760 #include <string.h>
761 #include <unistd.h>
763 #define LKC_DIRECT_LINK
764 #include "lkc.h"
766 #define START_STRSIZE   16
768 static struct {
769         struct file *file;
770         int lineno;
771 } current_pos;
773 static char *text;
774 static int text_size, text_asize;
776 struct buffer {
777         struct buffer *parent;
778         YY_BUFFER_STATE state;
781 struct buffer *current_buf;
783 static int last_ts, first_ts;
785 static void zconf_endhelp(void);
786 static void zconf_endfile(void);
788 void new_string(void)
790         text = malloc(START_STRSIZE);
791         text_asize = START_STRSIZE;
792         text_size = 0;
793         *text = 0;
796 void append_string(const char *str, int size)
798         int new_size = text_size + size + 1;
799         if (new_size > text_asize) {
800                 new_size += START_STRSIZE - 1;
801                 new_size &= -START_STRSIZE;
802                 text = realloc(text, new_size);
803                 text_asize = new_size;
804         }
805         memcpy(text + text_size, str, size);
806         text_size += size;
807         text[text_size] = 0;
810 void alloc_string(const char *str, int size)
812         text = malloc(size + 1);
813         memcpy(text, str, size);
814         text[size] = 0;
817 #define INITIAL 0
818 #define COMMAND 1
819 #define HELP 2
820 #define STRING 3
821 #define PARAM 4
823 #ifndef YY_NO_UNISTD_H
824 /* Special case for "unistd.h", since it is non-ANSI. We include it way
825  * down here because we want the user's section 1 to have been scanned first.
826  * The user has a chance to override it with an option.
827  */
828 #include <unistd.h>
829 #endif
831 #ifndef YY_EXTRA_TYPE
832 #define YY_EXTRA_TYPE void *
833 #endif
835 static int yy_init_globals (void );
837 /* Macros after this point can all be overridden by user definitions in
838  * section 1.
839  */
841 #ifndef YY_SKIP_YYWRAP
842 #ifdef __cplusplus
843 extern "C" int zconfwrap (void );
844 #else
845 extern int zconfwrap (void );
846 #endif
847 #endif
849     static void yyunput (int c,char *buf_ptr  );
850     
851 #ifndef yytext_ptr
852 static void yy_flex_strncpy (char *,yyconst char *,int );
853 #endif
855 #ifdef YY_NEED_STRLEN
856 static int yy_flex_strlen (yyconst char * );
857 #endif
859 #ifndef YY_NO_INPUT
861 #ifdef __cplusplus
862 static int yyinput (void );
863 #else
864 static int input (void );
865 #endif
867 #endif
869 /* Amount of stuff to slurp up with each read. */
870 #ifndef YY_READ_BUF_SIZE
871 #define YY_READ_BUF_SIZE 8192
872 #endif
874 /* Copy whatever the last rule matched to the standard output. */
875 #ifndef ECHO
876 /* This used to be an fputs(), but since the string might contain NUL's,
877  * we now use fwrite().
878  */
879 #define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
880 #endif
882 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
883  * is returned in "result".
884  */
885 #ifndef YY_INPUT
886 #define YY_INPUT(buf,result,max_size) \
887         errno=0; \
888         while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
889         { \
890                 if( errno != EINTR) \
891                 { \
892                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
893                         break; \
894                 } \
895                 errno=0; \
896                 clearerr(zconfin); \
897         }\
900 #endif
902 /* No semi-colon after return; correct usage is to write "yyterminate();" -
903  * we don't want an extra ';' after the "return" because that will cause
904  * some compilers to complain about unreachable statements.
905  */
906 #ifndef yyterminate
907 #define yyterminate() return YY_NULL
908 #endif
910 /* Number of entries by which start-condition stack grows. */
911 #ifndef YY_START_STACK_INCR
912 #define YY_START_STACK_INCR 25
913 #endif
915 /* Report a fatal error. */
916 #ifndef YY_FATAL_ERROR
917 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
918 #endif
920 /* end tables serialization structures and prototypes */
922 /* Default declaration of generated scanner - a define so the user can
923  * easily add parameters.
924  */
925 #ifndef YY_DECL
926 #define YY_DECL_IS_OURS 1
928 extern int zconflex (void);
930 #define YY_DECL int zconflex (void)
931 #endif /* !YY_DECL */
933 /* Code executed at the beginning of each rule, after zconftext and zconfleng
934  * have been set up.
935  */
936 #ifndef YY_USER_ACTION
937 #define YY_USER_ACTION
938 #endif
940 /* Code executed at the end of each rule. */
941 #ifndef YY_BREAK
942 #define YY_BREAK break;
943 #endif
945 #define YY_RULE_SETUP \
946         YY_USER_ACTION
948 /** The main scanner function which does all the work.
949  */
950 YY_DECL
952         register yy_state_type yy_current_state;
953         register char *yy_cp, *yy_bp;
954         register int yy_act;
955     
956         int str = 0;
957         int ts, i;
959         if ( !(yy_init) )
960                 {
961                 (yy_init) = 1;
963 #ifdef YY_USER_INIT
964                 YY_USER_INIT;
965 #endif
967                 if ( ! (yy_start) )
968                         (yy_start) = 1; /* first start state */
970                 if ( ! zconfin )
971                         zconfin = stdin;
973                 if ( ! zconfout )
974                         zconfout = stdout;
976                 if ( ! YY_CURRENT_BUFFER ) {
977                         zconfensure_buffer_stack ();
978                         YY_CURRENT_BUFFER_LVALUE =
979                                 zconf_create_buffer(zconfin,YY_BUF_SIZE );
980                 }
982                 zconf_load_buffer_state( );
983                 }
985         while ( 1 )             /* loops until end-of-file is reached */
986                 {
987                 yy_cp = (yy_c_buf_p);
989                 /* Support of zconftext. */
990                 *yy_cp = (yy_hold_char);
992                 /* yy_bp points to the position in yy_ch_buf of the start of
993                  * the current run.
994                  */
995                 yy_bp = yy_cp;
997                 yy_current_state = (yy_start);
998 yy_match:
999                 while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)]  ]) > 0 )
1000                         ++yy_cp;
1002                 yy_current_state = -yy_current_state;
1004 yy_find_action:
1005                 yy_act = yy_accept[yy_current_state];
1007                 YY_DO_BEFORE_ACTION;
1009 do_action:      /* This label is used only to access EOF actions. */
1011                 switch ( yy_act )
1012         { /* beginning of action switch */
1013 case 1:
1014 /* rule 1 can match eol */
1015 case 2:
1016 /* rule 2 can match eol */
1017 YY_RULE_SETUP
1019         current_file->lineno++;
1020         return T_EOL;
1022         YY_BREAK
1023 case 3:
1024 YY_RULE_SETUP
1026         YY_BREAK
1027 case 4:
1028 YY_RULE_SETUP
1030         BEGIN(COMMAND);
1032         YY_BREAK
1033 case 5:
1034 YY_RULE_SETUP
1036         unput(zconftext[0]);
1037         BEGIN(COMMAND);
1039         YY_BREAK
1041 case 6:
1042 YY_RULE_SETUP
1044                 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1045                 BEGIN(PARAM);
1046                 current_pos.file = current_file;
1047                 current_pos.lineno = current_file->lineno;
1048                 if (id && id->flags & TF_COMMAND) {
1049                         zconflval.id = id;
1050                         return id->token;
1051                 }
1052                 alloc_string(zconftext, zconfleng);
1053                 zconflval.string = text;
1054                 return T_WORD;
1055         }
1056         YY_BREAK
1057 case 7:
1058 YY_RULE_SETUP
1060         YY_BREAK
1061 case 8:
1062 /* rule 8 can match eol */
1063 YY_RULE_SETUP
1065                 BEGIN(INITIAL);
1066                 current_file->lineno++;
1067                 return T_EOL;
1068         }
1069         YY_BREAK
1071 case 9:
1072 YY_RULE_SETUP
1073 return T_AND;
1074         YY_BREAK
1075 case 10:
1076 YY_RULE_SETUP
1077 return T_OR;
1078         YY_BREAK
1079 case 11:
1080 YY_RULE_SETUP
1081 return T_OPEN_PAREN;
1082         YY_BREAK
1083 case 12:
1084 YY_RULE_SETUP
1085 return T_CLOSE_PAREN;
1086         YY_BREAK
1087 case 13:
1088 YY_RULE_SETUP
1089 return T_NOT;
1090         YY_BREAK
1091 case 14:
1092 YY_RULE_SETUP
1093 return T_EQUAL;
1094         YY_BREAK
1095 case 15:
1096 YY_RULE_SETUP
1097 return T_UNEQUAL;
1098         YY_BREAK
1099 case 16:
1100 YY_RULE_SETUP
1102                 str = zconftext[0];
1103                 new_string();
1104                 BEGIN(STRING);
1105         }
1106         YY_BREAK
1107 case 17:
1108 /* rule 17 can match eol */
1109 YY_RULE_SETUP
1110 BEGIN(INITIAL); current_file->lineno++; return T_EOL;
1111         YY_BREAK
1112 case 18:
1113 YY_RULE_SETUP
1114 /* ignore */
1115         YY_BREAK
1116 case 19:
1117 YY_RULE_SETUP
1119                 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1120                 if (id && id->flags & TF_PARAM) {
1121                         zconflval.id = id;
1122                         return id->token;
1123                 }
1124                 alloc_string(zconftext, zconfleng);
1125                 zconflval.string = text;
1126                 return T_WORD;
1127         }
1128         YY_BREAK
1129 case 20:
1130 YY_RULE_SETUP
1131 /* comment */
1132         YY_BREAK
1133 case 21:
1134 /* rule 21 can match eol */
1135 YY_RULE_SETUP
1136 current_file->lineno++;
1137         YY_BREAK
1138 case 22:
1139 YY_RULE_SETUP
1141         YY_BREAK
1142 case YY_STATE_EOF(PARAM):
1144                 BEGIN(INITIAL);
1145         }
1146         YY_BREAK
1148 case 23:
1149 /* rule 23 can match eol */
1150 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1151 (yy_c_buf_p) = yy_cp -= 1;
1152 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1153 YY_RULE_SETUP
1155                 append_string(zconftext, zconfleng);
1156                 zconflval.string = text;
1157                 return T_WORD_QUOTE;
1158         }
1159         YY_BREAK
1160 case 24:
1161 YY_RULE_SETUP
1163                 append_string(zconftext, zconfleng);
1164         }
1165         YY_BREAK
1166 case 25:
1167 /* rule 25 can match eol */
1168 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1169 (yy_c_buf_p) = yy_cp -= 1;
1170 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1171 YY_RULE_SETUP
1173                 append_string(zconftext + 1, zconfleng - 1);
1174                 zconflval.string = text;
1175                 return T_WORD_QUOTE;
1176         }
1177         YY_BREAK
1178 case 26:
1179 YY_RULE_SETUP
1181                 append_string(zconftext + 1, zconfleng - 1);
1182         }
1183         YY_BREAK
1184 case 27:
1185 YY_RULE_SETUP
1187                 if (str == zconftext[0]) {
1188                         BEGIN(PARAM);
1189                         zconflval.string = text;
1190                         return T_WORD_QUOTE;
1191                 } else
1192                         append_string(zconftext, 1);
1193         }
1194         YY_BREAK
1195 case 28:
1196 /* rule 28 can match eol */
1197 YY_RULE_SETUP
1199                 printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
1200                 current_file->lineno++;
1201                 BEGIN(INITIAL);
1202                 return T_EOL;
1203         }
1204         YY_BREAK
1205 case YY_STATE_EOF(STRING):
1207                 BEGIN(INITIAL);
1208         }
1209         YY_BREAK
1211 case 29:
1212 YY_RULE_SETUP
1214                 ts = 0;
1215                 for (i = 0; i < zconfleng; i++) {
1216                         if (zconftext[i] == '\t')
1217                                 ts = (ts & ~7) + 8;
1218                         else
1219                                 ts++;
1220                 }
1221                 last_ts = ts;
1222                 if (first_ts) {
1223                         if (ts < first_ts) {
1224                                 zconf_endhelp();
1225                                 return T_HELPTEXT;
1226                         }
1227                         ts -= first_ts;
1228                         while (ts > 8) {
1229                                 append_string("        ", 8);
1230                                 ts -= 8;
1231                         }
1232                         append_string("        ", ts);
1233                 }
1234         }
1235         YY_BREAK
1236 case 30:
1237 /* rule 30 can match eol */
1238 *yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
1239 (yy_c_buf_p) = yy_cp -= 1;
1240 YY_DO_BEFORE_ACTION; /* set up zconftext again */
1241 YY_RULE_SETUP
1243                 current_file->lineno++;
1244                 zconf_endhelp();
1245                 return T_HELPTEXT;
1246         }
1247         YY_BREAK
1248 case 31:
1249 /* rule 31 can match eol */
1250 YY_RULE_SETUP
1252                 current_file->lineno++;
1253                 append_string("\n", 1);
1254         }
1255         YY_BREAK
1256 case 32:
1257 YY_RULE_SETUP
1259                 while (zconfleng) {
1260                         if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t'))
1261                                 break;
1262                         zconfleng--;
1263                 }
1264                 append_string(zconftext, zconfleng);
1265                 if (!first_ts)
1266                         first_ts = last_ts;
1267         }
1268         YY_BREAK
1269 case YY_STATE_EOF(HELP):
1271                 zconf_endhelp();
1272                 return T_HELPTEXT;
1273         }
1274         YY_BREAK
1276 case YY_STATE_EOF(INITIAL):
1277 case YY_STATE_EOF(COMMAND):
1279         if (current_file) {
1280                 zconf_endfile();
1281                 return T_EOL;
1282         }
1283         fclose(zconfin);
1284         yyterminate();
1286         YY_BREAK
1287 case 33:
1288 YY_RULE_SETUP
1289 YY_FATAL_ERROR( "flex scanner jammed" );
1290         YY_BREAK
1292         case YY_END_OF_BUFFER:
1293                 {
1294                 /* Amount of text matched not including the EOB char. */
1295                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1297                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1298                 *yy_cp = (yy_hold_char);
1299                 YY_RESTORE_YY_MORE_OFFSET
1301                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1302                         {
1303                         /* We're scanning a new file or input source.  It's
1304                          * possible that this happened because the user
1305                          * just pointed zconfin at a new source and called
1306                          * zconflex().  If so, then we have to assure
1307                          * consistency between YY_CURRENT_BUFFER and our
1308                          * globals.  Here is the right place to do so, because
1309                          * this is the first action (other than possibly a
1310                          * back-up) that will match for the new input source.
1311                          */
1312                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1313                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
1314                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1315                         }
1317                 /* Note that here we test for yy_c_buf_p "<=" to the position
1318                  * of the first EOB in the buffer, since yy_c_buf_p will
1319                  * already have been incremented past the NUL character
1320                  * (since all states make transitions on EOB to the
1321                  * end-of-buffer state).  Contrast this with the test
1322                  * in input().
1323                  */
1324                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1325                         { /* This was really a NUL. */
1326                         yy_state_type yy_next_state;
1328                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1330                         yy_current_state = yy_get_previous_state(  );
1332                         /* Okay, we're now positioned to make the NUL
1333                          * transition.  We couldn't have
1334                          * yy_get_previous_state() go ahead and do it
1335                          * for us because it doesn't know how to deal
1336                          * with the possibility of jamming (and we don't
1337                          * want to build jamming into it because then it
1338                          * will run more slowly).
1339                          */
1341                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1343                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1345                         if ( yy_next_state )
1346                                 {
1347                                 /* Consume the NUL. */
1348                                 yy_cp = ++(yy_c_buf_p);
1349                                 yy_current_state = yy_next_state;
1350                                 goto yy_match;
1351                                 }
1353                         else
1354                                 {
1355                                 yy_cp = (yy_c_buf_p);
1356                                 goto yy_find_action;
1357                                 }
1358                         }
1360                 else switch ( yy_get_next_buffer(  ) )
1361                         {
1362                         case EOB_ACT_END_OF_FILE:
1363                                 {
1364                                 (yy_did_buffer_switch_on_eof) = 0;
1366                                 if ( zconfwrap( ) )
1367                                         {
1368                                         /* Note: because we've taken care in
1369                                          * yy_get_next_buffer() to have set up
1370                                          * zconftext, we can now set up
1371                                          * yy_c_buf_p so that if some total
1372                                          * hoser (like flex itself) wants to
1373                                          * call the scanner after we return the
1374                                          * YY_NULL, it'll still work - another
1375                                          * YY_NULL will get returned.
1376                                          */
1377                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1379                                         yy_act = YY_STATE_EOF(YY_START);
1380                                         goto do_action;
1381                                         }
1383                                 else
1384                                         {
1385                                         if ( ! (yy_did_buffer_switch_on_eof) )
1386                                                 YY_NEW_FILE;
1387                                         }
1388                                 break;
1389                                 }
1391                         case EOB_ACT_CONTINUE_SCAN:
1392                                 (yy_c_buf_p) =
1393                                         (yytext_ptr) + yy_amount_of_matched_text;
1395                                 yy_current_state = yy_get_previous_state(  );
1397                                 yy_cp = (yy_c_buf_p);
1398                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1399                                 goto yy_match;
1401                         case EOB_ACT_LAST_MATCH:
1402                                 (yy_c_buf_p) =
1403                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1405                                 yy_current_state = yy_get_previous_state(  );
1407                                 yy_cp = (yy_c_buf_p);
1408                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1409                                 goto yy_find_action;
1410                         }
1411                 break;
1412                 }
1414         default:
1415                 YY_FATAL_ERROR(
1416                         "fatal flex scanner internal error--no action found" );
1417         } /* end of action switch */
1418                 } /* end of scanning one token */
1419 } /* end of zconflex */
1421 /* yy_get_next_buffer - try to read in a new buffer
1423  * Returns a code representing an action:
1424  *      EOB_ACT_LAST_MATCH -
1425  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1426  *      EOB_ACT_END_OF_FILE - end of file
1427  */
1428 static int yy_get_next_buffer (void)
1430         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1431         register char *source = (yytext_ptr);
1432         register int number_to_move, i;
1433         int ret_val;
1435         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1436                 YY_FATAL_ERROR(
1437                 "fatal flex scanner internal error--end of buffer missed" );
1439         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1440                 { /* Don't try to fill the buffer, so this is an EOF. */
1441                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1442                         {
1443                         /* We matched a single character, the EOB, so
1444                          * treat this as a final EOF.
1445                          */
1446                         return EOB_ACT_END_OF_FILE;
1447                         }
1449                 else
1450                         {
1451                         /* We matched some text prior to the EOB, first
1452                          * process it.
1453                          */
1454                         return EOB_ACT_LAST_MATCH;
1455                         }
1456                 }
1458         /* Try to read more data. */
1460         /* First move last chars to start of buffer. */
1461         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1463         for ( i = 0; i < number_to_move; ++i )
1464                 *(dest++) = *(source++);
1466         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1467                 /* don't do the read, it's not guaranteed to return an EOF,
1468                  * just force an EOF
1469                  */
1470                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1472         else
1473                 {
1474                         int num_to_read =
1475                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1477                 while ( num_to_read <= 0 )
1478                         { /* Not enough room in the buffer - grow it. */
1480                         /* just a shorter name for the current buffer */
1481                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1483                         int yy_c_buf_p_offset =
1484                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1486                         if ( b->yy_is_our_buffer )
1487                                 {
1488                                 int new_size = b->yy_buf_size * 2;
1490                                 if ( new_size <= 0 )
1491                                         b->yy_buf_size += b->yy_buf_size / 8;
1492                                 else
1493                                         b->yy_buf_size *= 2;
1495                                 b->yy_ch_buf = (char *)
1496                                         /* Include room in for 2 EOB chars. */
1497                                         zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1498                                 }
1499                         else
1500                                 /* Can't grow it, we don't own it. */
1501                                 b->yy_ch_buf = 0;
1503                         if ( ! b->yy_ch_buf )
1504                                 YY_FATAL_ERROR(
1505                                 "fatal error - scanner input buffer overflow" );
1507                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1509                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1510                                                 number_to_move - 1;
1512                         }
1514                 if ( num_to_read > YY_READ_BUF_SIZE )
1515                         num_to_read = YY_READ_BUF_SIZE;
1517                 /* Read in more data. */
1518                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1519                         (yy_n_chars), (size_t) num_to_read );
1521                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1522                 }
1524         if ( (yy_n_chars) == 0 )
1525                 {
1526                 if ( number_to_move == YY_MORE_ADJ )
1527                         {
1528                         ret_val = EOB_ACT_END_OF_FILE;
1529                         zconfrestart(zconfin  );
1530                         }
1532                 else
1533                         {
1534                         ret_val = EOB_ACT_LAST_MATCH;
1535                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1536                                 YY_BUFFER_EOF_PENDING;
1537                         }
1538                 }
1540         else
1541                 ret_val = EOB_ACT_CONTINUE_SCAN;
1543         (yy_n_chars) += number_to_move;
1544         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1545         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1547         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1549         return ret_val;
1552 /* yy_get_previous_state - get the state just before the EOB char was reached */
1554     static yy_state_type yy_get_previous_state (void)
1556         register yy_state_type yy_current_state;
1557         register char *yy_cp;
1558     
1559         yy_current_state = (yy_start);
1561         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1562                 {
1563                 yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
1564                 }
1566         return yy_current_state;
1569 /* yy_try_NUL_trans - try to make a transition on the NUL character
1571  * synopsis
1572  *      next_state = yy_try_NUL_trans( current_state );
1573  */
1574     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1576         register int yy_is_jam;
1577     
1578         yy_current_state = yy_nxt[yy_current_state][1];
1579         yy_is_jam = (yy_current_state <= 0);
1581         return yy_is_jam ? 0 : yy_current_state;
1584     static void yyunput (int c, register char * yy_bp )
1586         register char *yy_cp;
1587     
1588     yy_cp = (yy_c_buf_p);
1590         /* undo effects of setting up zconftext */
1591         *yy_cp = (yy_hold_char);
1593         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1594                 { /* need to shift things up to make room */
1595                 /* +2 for EOB chars. */
1596                 register int number_to_move = (yy_n_chars) + 2;
1597                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1598                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1599                 register char *source =
1600                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1602                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1603                         *--dest = *--source;
1605                 yy_cp += (int) (dest - source);
1606                 yy_bp += (int) (dest - source);
1607                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1608                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1610                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1611                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1612                 }
1614         *--yy_cp = (char) c;
1616         (yytext_ptr) = yy_bp;
1617         (yy_hold_char) = *yy_cp;
1618         (yy_c_buf_p) = yy_cp;
1621 #ifndef YY_NO_INPUT
1622 #ifdef __cplusplus
1623     static int yyinput (void)
1624 #else
1625     static int input  (void)
1626 #endif
1629         int c;
1630     
1631         *(yy_c_buf_p) = (yy_hold_char);
1633         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1634                 {
1635                 /* yy_c_buf_p now points to the character we want to return.
1636                  * If this occurs *before* the EOB characters, then it's a
1637                  * valid NUL; if not, then we've hit the end of the buffer.
1638                  */
1639                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1640                         /* This was really a NUL. */
1641                         *(yy_c_buf_p) = '\0';
1643                 else
1644                         { /* need more input */
1645                         int offset = (yy_c_buf_p) - (yytext_ptr);
1646                         ++(yy_c_buf_p);
1648                         switch ( yy_get_next_buffer(  ) )
1649                                 {
1650                                 case EOB_ACT_LAST_MATCH:
1651                                         /* This happens because yy_g_n_b()
1652                                          * sees that we've accumulated a
1653                                          * token and flags that we need to
1654                                          * try matching the token before
1655                                          * proceeding.  But for input(),
1656                                          * there's no matching to consider.
1657                                          * So convert the EOB_ACT_LAST_MATCH
1658                                          * to EOB_ACT_END_OF_FILE.
1659                                          */
1661                                         /* Reset buffer status. */
1662                                         zconfrestart(zconfin );
1664                                         /*FALLTHROUGH*/
1666                                 case EOB_ACT_END_OF_FILE:
1667                                         {
1668                                         if ( zconfwrap( ) )
1669                                                 return EOF;
1671                                         if ( ! (yy_did_buffer_switch_on_eof) )
1672                                                 YY_NEW_FILE;
1673 #ifdef __cplusplus
1674                                         return yyinput();
1675 #else
1676                                         return input();
1677 #endif
1678                                         }
1680                                 case EOB_ACT_CONTINUE_SCAN:
1681                                         (yy_c_buf_p) = (yytext_ptr) + offset;
1682                                         break;
1683                                 }
1684                         }
1685                 }
1687         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1688         *(yy_c_buf_p) = '\0';   /* preserve zconftext */
1689         (yy_hold_char) = *++(yy_c_buf_p);
1691         return c;
1693 #endif  /* ifndef YY_NO_INPUT */
1695 /** Immediately switch to a different input stream.
1696  * @param input_file A readable stream.
1697  * 
1698  * @note This function does not reset the start condition to @c INITIAL .
1699  */
1700     void zconfrestart  (FILE * input_file )
1702     
1703         if ( ! YY_CURRENT_BUFFER ){
1704         zconfensure_buffer_stack ();
1705                 YY_CURRENT_BUFFER_LVALUE =
1706             zconf_create_buffer(zconfin,YY_BUF_SIZE );
1707         }
1709         zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
1710         zconf_load_buffer_state( );
1713 /** Switch to a different input buffer.
1714  * @param new_buffer The new input buffer.
1715  * 
1716  */
1717     void zconf_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1719     
1720         /* TODO. We should be able to replace this entire function body
1721          * with
1722          *              zconfpop_buffer_state();
1723          *              zconfpush_buffer_state(new_buffer);
1724      */
1725         zconfensure_buffer_stack ();
1726         if ( YY_CURRENT_BUFFER == new_buffer )
1727                 return;
1729         if ( YY_CURRENT_BUFFER )
1730                 {
1731                 /* Flush out information for old buffer. */
1732                 *(yy_c_buf_p) = (yy_hold_char);
1733                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1734                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1735                 }
1737         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1738         zconf_load_buffer_state( );
1740         /* We don't actually know whether we did this switch during
1741          * EOF (zconfwrap()) processing, but the only time this flag
1742          * is looked at is after zconfwrap() is called, so it's safe
1743          * to go ahead and always set it.
1744          */
1745         (yy_did_buffer_switch_on_eof) = 1;
1748 static void zconf_load_buffer_state  (void)
1750         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1751         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1752         zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1753         (yy_hold_char) = *(yy_c_buf_p);
1756 /** Allocate and initialize an input buffer state.
1757  * @param file A readable stream.
1758  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1759  * 
1760  * @return the allocated buffer state.
1761  */
1762     YY_BUFFER_STATE zconf_create_buffer  (FILE * file, int  size )
1764         YY_BUFFER_STATE b;
1765     
1766         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
1767         if ( ! b )
1768                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1770         b->yy_buf_size = size;
1772         /* yy_ch_buf has to be 2 characters longer than the size given because
1773          * we need to put in 2 end-of-buffer characters.
1774          */
1775         b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2  );
1776         if ( ! b->yy_ch_buf )
1777                 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
1779         b->yy_is_our_buffer = 1;
1781         zconf_init_buffer(b,file );
1783         return b;
1786 /** Destroy the buffer.
1787  * @param b a buffer created with zconf_create_buffer()
1788  * 
1789  */
1790     void zconf_delete_buffer (YY_BUFFER_STATE  b )
1792     
1793         if ( ! b )
1794                 return;
1796         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1797                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1799         if ( b->yy_is_our_buffer )
1800                 zconffree((void *) b->yy_ch_buf  );
1802         zconffree((void *) b  );
1805 /* Initializes or reinitializes a buffer.
1806  * This function is sometimes called more than once on the same buffer,
1807  * such as during a zconfrestart() or at EOF.
1808  */
1809     static void zconf_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1812         int oerrno = errno;
1813     
1814         zconf_flush_buffer(b );
1816         b->yy_input_file = file;
1817         b->yy_fill_buffer = 1;
1819     /* If b is the current buffer, then zconf_init_buffer was _probably_
1820      * called from zconfrestart() or through yy_get_next_buffer.
1821      * In that case, we don't want to reset the lineno or column.
1822      */
1823     if (b != YY_CURRENT_BUFFER){
1824         b->yy_bs_lineno = 1;
1825         b->yy_bs_column = 0;
1826     }
1828         b->yy_is_interactive = 0;
1829     
1830         errno = oerrno;
1833 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1834  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1835  * 
1836  */
1837     void zconf_flush_buffer (YY_BUFFER_STATE  b )
1839         if ( ! b )
1840                 return;
1842         b->yy_n_chars = 0;
1844         /* We always need two end-of-buffer characters.  The first causes
1845          * a transition to the end-of-buffer state.  The second causes
1846          * a jam in that state.
1847          */
1848         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1849         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1851         b->yy_buf_pos = &b->yy_ch_buf[0];
1853         b->yy_at_bol = 1;
1854         b->yy_buffer_status = YY_BUFFER_NEW;
1856         if ( b == YY_CURRENT_BUFFER )
1857                 zconf_load_buffer_state( );
1860 /** Pushes the new state onto the stack. The new state becomes
1861  *  the current state. This function will allocate the stack
1862  *  if necessary.
1863  *  @param new_buffer The new state.
1864  *  
1865  */
1866 void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
1868         if (new_buffer == NULL)
1869                 return;
1871         zconfensure_buffer_stack();
1873         /* This block is copied from zconf_switch_to_buffer. */
1874         if ( YY_CURRENT_BUFFER )
1875                 {
1876                 /* Flush out information for old buffer. */
1877                 *(yy_c_buf_p) = (yy_hold_char);
1878                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1879                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1880                 }
1882         /* Only push if top exists. Otherwise, replace top. */
1883         if (YY_CURRENT_BUFFER)
1884                 (yy_buffer_stack_top)++;
1885         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1887         /* copied from zconf_switch_to_buffer. */
1888         zconf_load_buffer_state( );
1889         (yy_did_buffer_switch_on_eof) = 1;
1892 /** Removes and deletes the top of the stack, if present.
1893  *  The next element becomes the new top.
1894  *  
1895  */
1896 void zconfpop_buffer_state (void)
1898         if (!YY_CURRENT_BUFFER)
1899                 return;
1901         zconf_delete_buffer(YY_CURRENT_BUFFER );
1902         YY_CURRENT_BUFFER_LVALUE = NULL;
1903         if ((yy_buffer_stack_top) > 0)
1904                 --(yy_buffer_stack_top);
1906         if (YY_CURRENT_BUFFER) {
1907                 zconf_load_buffer_state( );
1908                 (yy_did_buffer_switch_on_eof) = 1;
1909         }
1912 /* Allocates the stack if it does not exist.
1913  *  Guarantees space for at least one push.
1914  */
1915 static void zconfensure_buffer_stack (void)
1917         int num_to_alloc;
1918     
1919         if (!(yy_buffer_stack)) {
1921                 /* First allocation is just for 2 elements, since we don't know if this
1922                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1923                  * immediate realloc on the next call.
1924          */
1925                 num_to_alloc = 1;
1926                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
1927                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1928                                                                 );
1929                 
1930                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1931                                 
1932                 (yy_buffer_stack_max) = num_to_alloc;
1933                 (yy_buffer_stack_top) = 0;
1934                 return;
1935         }
1937         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1939                 /* Increase the buffer to prepare for a possible push. */
1940                 int grow_size = 8 /* arbitrary grow size */;
1942                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1943                 (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
1944                                                                 ((yy_buffer_stack),
1945                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1946                                                                 );
1948                 /* zero only the new slots.*/
1949                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1950                 (yy_buffer_stack_max) = num_to_alloc;
1951         }
1954 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1955  * @param base the character buffer
1956  * @param size the size in bytes of the character buffer
1957  * 
1958  * @return the newly allocated buffer state object. 
1959  */
1960 YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
1962         YY_BUFFER_STATE b;
1963     
1964         if ( size < 2 ||
1965              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1966              base[size-1] != YY_END_OF_BUFFER_CHAR )
1967                 /* They forgot to leave room for the EOB's. */
1968                 return 0;
1970         b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
1971         if ( ! b )
1972                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
1974         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1975         b->yy_buf_pos = b->yy_ch_buf = base;
1976         b->yy_is_our_buffer = 0;
1977         b->yy_input_file = 0;
1978         b->yy_n_chars = b->yy_buf_size;
1979         b->yy_is_interactive = 0;
1980         b->yy_at_bol = 1;
1981         b->yy_fill_buffer = 0;
1982         b->yy_buffer_status = YY_BUFFER_NEW;
1984         zconf_switch_to_buffer(b  );
1986         return b;
1989 /** Setup the input buffer state to scan a string. The next call to zconflex() will
1990  * scan from a @e copy of @a str.
1991  * @param yystr a NUL-terminated string to scan
1992  * 
1993  * @return the newly allocated buffer state object.
1994  * @note If you want to scan bytes that may contain NUL values, then use
1995  *       zconf_scan_bytes() instead.
1996  */
1997 YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
1999     
2000         return zconf_scan_bytes(yystr,strlen(yystr) );
2003 /** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
2004  * scan from a @e copy of @a bytes.
2005  * @param bytes the byte buffer to scan
2006  * @param len the number of bytes in the buffer pointed to by @a bytes.
2007  * 
2008  * @return the newly allocated buffer state object.
2009  */
2010 YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2012         YY_BUFFER_STATE b;
2013         char *buf;
2014         yy_size_t n;
2015         int i;
2016     
2017         /* Get memory for full buffer, including space for trailing EOB's. */
2018         n = _yybytes_len + 2;
2019         buf = (char *) zconfalloc(n  );
2020         if ( ! buf )
2021                 YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
2023         for ( i = 0; i < _yybytes_len; ++i )
2024                 buf[i] = yybytes[i];
2026         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2028         b = zconf_scan_buffer(buf,n );
2029         if ( ! b )
2030                 YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
2032         /* It's okay to grow etc. this buffer, and we should throw it
2033          * away when we're done.
2034          */
2035         b->yy_is_our_buffer = 1;
2037         return b;
2040 #ifndef YY_EXIT_FAILURE
2041 #define YY_EXIT_FAILURE 2
2042 #endif
2044 static void yy_fatal_error (yyconst char* msg )
2046         (void) fprintf( stderr, "%s\n", msg );
2047         exit( YY_EXIT_FAILURE );
2050 /* Redefine yyless() so it works in section 3 code. */
2052 #undef yyless
2053 #define yyless(n) \
2054         do \
2055                 { \
2056                 /* Undo effects of setting up zconftext. */ \
2057         int yyless_macro_arg = (n); \
2058         YY_LESS_LINENO(yyless_macro_arg);\
2059                 zconftext[zconfleng] = (yy_hold_char); \
2060                 (yy_c_buf_p) = zconftext + yyless_macro_arg; \
2061                 (yy_hold_char) = *(yy_c_buf_p); \
2062                 *(yy_c_buf_p) = '\0'; \
2063                 zconfleng = yyless_macro_arg; \
2064                 } \
2065         while ( 0 )
2067 /* Accessor  methods (get/set functions) to struct members. */
2069 /** Get the current line number.
2070  * 
2071  */
2072 int zconfget_lineno  (void)
2074         
2075     return zconflineno;
2078 /** Get the input stream.
2079  * 
2080  */
2081 FILE *zconfget_in  (void)
2083         return zconfin;
2086 /** Get the output stream.
2087  * 
2088  */
2089 FILE *zconfget_out  (void)
2091         return zconfout;
2094 /** Get the length of the current token.
2095  * 
2096  */
2097 int zconfget_leng  (void)
2099         return zconfleng;
2102 /** Get the current token.
2103  * 
2104  */
2106 char *zconfget_text  (void)
2108         return zconftext;
2111 /** Set the current line number.
2112  * @param line_number
2113  * 
2114  */
2115 void zconfset_lineno (int  line_number )
2117     
2118     zconflineno = line_number;
2121 /** Set the input stream. This does not discard the current
2122  * input buffer.
2123  * @param in_str A readable stream.
2124  * 
2125  * @see zconf_switch_to_buffer
2126  */
2127 void zconfset_in (FILE *  in_str )
2129         zconfin = in_str ;
2132 void zconfset_out (FILE *  out_str )
2134         zconfout = out_str ;
2137 int zconfget_debug  (void)
2139         return zconf_flex_debug;
2142 void zconfset_debug (int  bdebug )
2144         zconf_flex_debug = bdebug ;
2147 static int yy_init_globals (void)
2149         /* Initialization is the same as for the non-reentrant scanner.
2150      * This function is called from zconflex_destroy(), so don't allocate here.
2151      */
2153     (yy_buffer_stack) = 0;
2154     (yy_buffer_stack_top) = 0;
2155     (yy_buffer_stack_max) = 0;
2156     (yy_c_buf_p) = (char *) 0;
2157     (yy_init) = 0;
2158     (yy_start) = 0;
2160 /* Defined in main.c */
2161 #ifdef YY_STDINIT
2162     zconfin = stdin;
2163     zconfout = stdout;
2164 #else
2165     zconfin = (FILE *) 0;
2166     zconfout = (FILE *) 0;
2167 #endif
2169     /* For future reference: Set errno on error, since we are called by
2170      * zconflex_init()
2171      */
2172     return 0;
2175 /* zconflex_destroy is for both reentrant and non-reentrant scanners. */
2176 int zconflex_destroy  (void)
2178     
2179     /* Pop the buffer stack, destroying each element. */
2180         while(YY_CURRENT_BUFFER){
2181                 zconf_delete_buffer(YY_CURRENT_BUFFER  );
2182                 YY_CURRENT_BUFFER_LVALUE = NULL;
2183                 zconfpop_buffer_state();
2184         }
2186         /* Destroy the stack itself. */
2187         zconffree((yy_buffer_stack) );
2188         (yy_buffer_stack) = NULL;
2190     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2191      * zconflex() is called, initialization will occur. */
2192     yy_init_globals( );
2194     return 0;
2198  * Internal utility routines.
2199  */
2201 #ifndef yytext_ptr
2202 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2204         register int i;
2205         for ( i = 0; i < n; ++i )
2206                 s1[i] = s2[i];
2208 #endif
2210 #ifdef YY_NEED_STRLEN
2211 static int yy_flex_strlen (yyconst char * s )
2213         register int n;
2214         for ( n = 0; s[n]; ++n )
2215                 ;
2217         return n;
2219 #endif
2221 void *zconfalloc (yy_size_t  size )
2223         return (void *) malloc( size );
2226 void *zconfrealloc  (void * ptr, yy_size_t  size )
2228         /* The cast to (char *) in the following accommodates both
2229          * implementations that use char* generic pointers, and those
2230          * that use void* generic pointers.  It works with the latter
2231          * because both ANSI C and C++ allow castless assignment from
2232          * any pointer type to void*, and deal with argument conversions
2233          * as though doing an assignment.
2234          */
2235         return (void *) realloc( (char *) ptr, size );
2238 void zconffree (void * ptr )
2240         free( (char *) ptr );   /* see zconfrealloc() for (char *) cast */
2243 #define YYTABLES_NAME "yytables"
2245 void zconf_starthelp(void)
2247         new_string();
2248         last_ts = first_ts = 0;
2249         BEGIN(HELP);
2252 static void zconf_endhelp(void)
2254         zconflval.string = text;
2255         BEGIN(INITIAL);
2259  * Try to open specified file with following names:
2260  * ./name
2261  * $(srctree)/name
2262  * The latter is used when srctree is separate from objtree
2263  * when compiling the kernel.
2264  * Return NULL if file is not found.
2265  */
2266 FILE *zconf_fopen(const char *name)
2268         char *env, fullname[PATH_MAX+1];
2269         FILE *f;
2271         f = fopen(name, "r");
2272         if (!f && name != NULL && name[0] != '/') {
2273                 env = getenv(SRCTREE);
2274                 if (env) {
2275                         sprintf(fullname, "%s/%s", env, name);
2276                         f = fopen(fullname, "r");
2277                 }
2278         }
2279         return f;
2282 void zconf_initscan(const char *name)
2284         zconfin = zconf_fopen(name);
2285         if (!zconfin) {
2286                 printf("can't find file %s\n", name);
2287                 exit(1);
2288         }
2290         current_buf = malloc(sizeof(*current_buf));
2291         memset(current_buf, 0, sizeof(*current_buf));
2293         current_file = file_lookup(name);
2294         current_file->lineno = 1;
2295         current_file->flags = FILE_BUSY;
2298 void zconf_nextfile(const char *name)
2300         struct file *file = file_lookup(name);
2301         struct buffer *buf = malloc(sizeof(*buf));
2302         memset(buf, 0, sizeof(*buf));
2304         current_buf->state = YY_CURRENT_BUFFER;
2305         zconfin = zconf_fopen(name);
2306         if (!zconfin) {
2307                 printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
2308                 exit(1);
2309         }
2310         zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
2311         buf->parent = current_buf;
2312         current_buf = buf;
2314         if (file->flags & FILE_BUSY) {
2315                 printf("recursive scan (%s)?\n", name);
2316                 exit(1);
2317         }
2318         if (file->flags & FILE_SCANNED) {
2319                 printf("file %s already scanned?\n", name);
2320                 exit(1);
2321         }
2322         file->flags |= FILE_BUSY;
2323         file->lineno = 1;
2324         file->parent = current_file;
2325         current_file = file;
2328 static void zconf_endfile(void)
2330         struct buffer *parent;
2332         current_file->flags |= FILE_SCANNED;
2333         current_file->flags &= ~FILE_BUSY;
2334         current_file = current_file->parent;
2336         parent = current_buf->parent;
2337         if (parent) {
2338                 fclose(zconfin);
2339                 zconf_delete_buffer(YY_CURRENT_BUFFER);
2340                 zconf_switch_to_buffer(parent->state);
2341         }
2342         free(current_buf);
2343         current_buf = parent;
2346 int zconf_lineno(void)
2348         return current_pos.lineno;
2351 char *zconf_curname(void)
2353         return current_pos.file ? current_pos.file->name : "<none>";