ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/src/conf/lex.yy.c
Revision: 89
Committed: Thu Oct 6 21:22:58 2005 UTC (20 years, 9 months ago) by adx
Content type: text/x-csrc
File size: 47989 byte(s)
Log Message:
- added dynamically extensible conf parser (compiles ok); enough to start
  modularising general{} -> general.c, auth{} -> auth.c and so on.

File Contents

# User Rev Content
1 adx 89 /* A lexical scanner generated by flex */
2    
3     /* Scanner skeleton version:
4     * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
5     * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.8 2004/01/06 19:03:44 nectar Exp $
6     */
7    
8     #if defined(__FreeBSD__)
9     #include <sys/cdefs.h>
10     #else
11     #define __unused
12     #endif
13    
14     #define FLEX_SCANNER
15     #define YY_FLEX_MAJOR_VERSION 2
16     #define YY_FLEX_MINOR_VERSION 5
17    
18     #include <stdio.h>
19    
20    
21     /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
22     #ifdef c_plusplus
23     #ifndef __cplusplus
24     #define __cplusplus
25     #endif
26     #endif
27    
28    
29     #ifdef __cplusplus
30    
31     #include <stdlib.h>
32     #include <unistd.h>
33    
34     /* Use prototypes in function declarations. */
35     #define YY_USE_PROTOS
36    
37     /* The "const" storage-class-modifier is valid. */
38     #define YY_USE_CONST
39    
40     #else /* ! __cplusplus */
41    
42     #if __STDC__
43    
44     #define YY_USE_PROTOS
45     #define YY_USE_CONST
46    
47     #endif /* __STDC__ */
48     #endif /* ! __cplusplus */
49    
50     #ifdef __TURBOC__
51     #pragma warn -rch
52     #pragma warn -use
53     #include <io.h>
54     #include <stdlib.h>
55     #define YY_USE_CONST
56     #define YY_USE_PROTOS
57     #endif
58    
59     #ifdef YY_USE_CONST
60     #define yyconst const
61     #else
62     #define yyconst
63     #endif
64    
65    
66     #ifdef YY_USE_PROTOS
67     #define YY_PROTO(proto) proto
68     #else
69     #define YY_PROTO(proto) ()
70     #endif
71    
72     /* Returned upon end-of-file. */
73     #define YY_NULL 0
74    
75     /* Promotes a possibly negative, possibly signed char to an unsigned
76     * integer for use as an array index. If the signed char is negative,
77     * we want to instead treat it as an 8-bit unsigned char, hence the
78     * double cast.
79     */
80     #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
81    
82     /* Enter a start condition. This macro really ought to take a parameter,
83     * but we do it the disgusting crufty way forced on us by the ()-less
84     * definition of BEGIN.
85     */
86     #define BEGIN yy_start = 1 + 2 *
87    
88     /* Translate the current start state into a value that can be later handed
89     * to BEGIN to return to the state. The YYSTATE alias is for lex
90     * compatibility.
91     */
92     #define YY_START ((yy_start - 1) / 2)
93     #define YYSTATE YY_START
94    
95     /* Action number for EOF rule of a given start state. */
96     #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
97    
98     /* Special action meaning "start processing a new file". */
99     #define YY_NEW_FILE yyrestart( yyin )
100    
101     #define YY_END_OF_BUFFER_CHAR 0
102    
103     /* Size of default input buffer. */
104     #define YY_BUF_SIZE 16384
105    
106     typedef struct yy_buffer_state *YY_BUFFER_STATE;
107    
108     extern int yyleng;
109     extern FILE *yyin, *yyout;
110    
111     #define EOB_ACT_CONTINUE_SCAN 0
112     #define EOB_ACT_END_OF_FILE 1
113     #define EOB_ACT_LAST_MATCH 2
114    
115     /* The funky do-while in the following #define is used to turn the definition
116     * int a single C statement (which needs a semi-colon terminator). This
117     * avoids problems with code like:
118     *
119     * if ( condition_holds )
120     * yyless( 5 );
121     * else
122     * do_something_else();
123     *
124     * Prior to using the do-while the compiler would get upset at the
125     * "else" because it interpreted the "if" statement as being all
126     * done when it reached the ';' after the yyless() call.
127     */
128    
129     /* Return all but the first 'n' matched characters back to the input stream. */
130    
131     #define yyless(n) \
132     do \
133     { \
134     /* Undo effects of setting up yytext. */ \
135     *yy_cp = yy_hold_char; \
136     YY_RESTORE_YY_MORE_OFFSET \
137     yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
138     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
139     } \
140     while ( 0 )
141    
142     #define unput(c) yyunput( c, yytext_ptr )
143    
144     /* The following is because we cannot portably get our hands on size_t
145     * (without autoconf's help, which isn't available because we want
146     * flex-generated scanners to compile on their own).
147     */
148     typedef unsigned int yy_size_t;
149    
150    
151     struct yy_buffer_state
152     {
153     FILE *yy_input_file;
154    
155     char *yy_ch_buf; /* input buffer */
156     char *yy_buf_pos; /* current position in input buffer */
157    
158     /* Size of input buffer in bytes, not including room for EOB
159     * characters.
160     */
161     yy_size_t yy_buf_size;
162    
163     /* Number of characters read into yy_ch_buf, not including EOB
164     * characters.
165     */
166     int yy_n_chars;
167    
168     /* Whether we "own" the buffer - i.e., we know we created it,
169     * and can realloc() it to grow it, and should free() it to
170     * delete it.
171     */
172     int yy_is_our_buffer;
173    
174     /* Whether this is an "interactive" input source; if so, and
175     * if we're using stdio for input, then we want to use getc()
176     * instead of fread(), to make sure we stop fetching input after
177     * each newline.
178     */
179     int yy_is_interactive;
180    
181     /* Whether we're considered to be at the beginning of a line.
182     * If so, '^' rules will be active on the next match, otherwise
183     * not.
184     */
185     int yy_at_bol;
186    
187     /* Whether to try to fill the input buffer when we reach the
188     * end of it.
189     */
190     int yy_fill_buffer;
191    
192     int yy_buffer_status;
193     #define YY_BUFFER_NEW 0
194     #define YY_BUFFER_NORMAL 1
195     /* When an EOF's been seen but there's still some text to process
196     * then we mark the buffer as YY_EOF_PENDING, to indicate that we
197     * shouldn't try reading from the input source any more. We might
198     * still have a bunch of tokens to match, though, because of
199     * possible backing-up.
200     *
201     * When we actually see the EOF, we change the status to "new"
202     * (via yyrestart()), so that the user can continue scanning by
203     * just pointing yyin at a new input file.
204     */
205     #define YY_BUFFER_EOF_PENDING 2
206     };
207    
208     static YY_BUFFER_STATE yy_current_buffer = 0;
209    
210     /* We provide macros for accessing buffer states in case in the
211     * future we want to put the buffer states in a more general
212     * "scanner state".
213     */
214     #define YY_CURRENT_BUFFER yy_current_buffer
215    
216    
217     /* yy_hold_char holds the character lost when yytext is formed. */
218     static char yy_hold_char;
219    
220     static int yy_n_chars; /* number of characters read into yy_ch_buf */
221    
222    
223     int yyleng;
224    
225     /* Points to current character in buffer. */
226     static char *yy_c_buf_p = (char *) 0;
227     static int yy_init = 1; /* whether we need to initialize */
228     static int yy_start = 0; /* start state number */
229    
230     /* Flag which is used to allow yywrap()'s to do buffer switches
231     * instead of setting up a fresh yyin. A bit of a hack ...
232     */
233     static int yy_did_buffer_switch_on_eof;
234    
235     void yyrestart YY_PROTO(( FILE *input_file ));
236    
237     void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
238     void yy_load_buffer_state YY_PROTO(( void ));
239     YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
240     void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
241     void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
242     void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
243     #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
244    
245     YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
246     YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
247     YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
248    
249     static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
250     static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) __unused;
251     static void yy_flex_free YY_PROTO(( void * ));
252    
253     #define yy_new_buffer yy_create_buffer
254    
255     #define yy_set_interactive(is_interactive) \
256     { \
257     if ( ! yy_current_buffer ) \
258     yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259     yy_current_buffer->yy_is_interactive = is_interactive; \
260     }
261    
262     #define yy_set_bol(at_bol) \
263     { \
264     if ( ! yy_current_buffer ) \
265     yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
266     yy_current_buffer->yy_at_bol = at_bol; \
267     }
268    
269     #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
270    
271    
272     #define yywrap() 1
273     #define YY_SKIP_YYWRAP
274     typedef unsigned char YY_CHAR;
275     FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
276     typedef int yy_state_type;
277     extern char *yytext;
278     #define yytext_ptr yytext
279    
280     static yy_state_type yy_get_previous_state YY_PROTO(( void ));
281     static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
282     static int yy_get_next_buffer YY_PROTO(( void ));
283     static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
284    
285     /* Done after the current pattern has been matched and before the
286     * corresponding action - sets up yytext.
287     */
288     #define YY_DO_BEFORE_ACTION \
289     yytext_ptr = yy_bp; \
290     yyleng = (int) (yy_cp - yy_bp); \
291     yy_hold_char = *yy_cp; \
292     *yy_cp = '\0'; \
293     yy_c_buf_p = yy_cp;
294    
295     #define YY_NUM_RULES 48
296     #define YY_END_OF_BUFFER 49
297     static yyconst short int yy_accept[116] =
298     { 0,
299     4, 4, 49, 47, 4, 3, 47, 5, 47, 47,
300     6, 46, 8, 11, 46, 15, 46, 28, 46, 46,
301     36, 46, 42, 46, 4, 3, 0, 7, 5, 0,
302     2, 6, 46, 46, 46, 46, 46, 18, 46, 23,
303     46, 46, 33, 46, 35, 46, 46, 46, 46, 0,
304     46, 12, 46, 46, 46, 46, 46, 46, 29, 34,
305     37, 46, 46, 45, 0, 9, 13, 46, 16, 46,
306     46, 46, 46, 30, 46, 46, 38, 41, 43, 0,
307     10, 14, 17, 19, 46, 24, 46, 46, 46, 44,
308     0, 20, 46, 25, 46, 31, 39, 0, 46, 46,
309    
310     32, 40, 0, 21, 26, 0, 0, 0, 22, 27,
311     0, 1, 0, 1, 0
312     } ;
313    
314     static yyconst int yy_ec[256] =
315     { 0,
316     1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
317     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
319     1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
320     1, 6, 1, 1, 1, 7, 8, 9, 9, 9,
321     9, 9, 9, 9, 9, 9, 9, 1, 1, 10,
322     1, 11, 1, 1, 13, 14, 15, 16, 17, 18,
323     19, 20, 21, 12, 22, 23, 24, 25, 26, 12,
324     12, 27, 28, 29, 30, 12, 31, 12, 32, 12,
325     1, 1, 1, 1, 12, 1, 13, 14, 15, 16,
326    
327     17, 18, 19, 20, 21, 12, 22, 23, 24, 25,
328     26, 12, 12, 27, 28, 29, 30, 12, 31, 12,
329     32, 12, 1, 1, 1, 1, 1, 1, 1, 1,
330     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337    
338     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343     1, 1, 1, 1, 1
344     } ;
345    
346     static yyconst int yy_meta[33] =
347     { 0,
348     1, 1, 2, 1, 1, 1, 1, 1, 3, 1,
349     1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
350     3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
351     3, 3
352     } ;
353    
354     static yyconst short int yy_base[122] =
355     { 0,
356     0, 0, 139, 140, 136, 0, 133, 0, 115, 129,
357     125, 0, 101, 119, 118, 104, 19, 20, 103, 17,
358     111, 100, 109, 108, 122, 0, 119, 140, 0, 97,
359     140, 112, 0, 91, 87, 95, 87, 84, 92, 82,
360     94, 87, 0, 93, 0, 95, 79, 91, 79, 91,
361     88, 76, 75, 75, 72, 74, 70, 85, 8, 0,
362     17, 80, 74, 0, 72, 66, 0, 76, 64, 74,
363     76, 72, 74, 0, 58, 61, 0, 0, 57, 54,
364     0, 0, 0, 55, 50, 53, 48, 62, 62, 0,
365     61, 0, 47, 0, 46, 46, 45, 55, 54, 52,
366    
367     0, 0, 42, 38, 35, 45, 53, 43, 0, 0,
368     49, 47, 39, 37, 140, 55, 58, 61, 36, 64,
369     67
370     } ;
371    
372     static yyconst short int yy_def[122] =
373     { 0,
374     115, 1, 115, 115, 115, 116, 117, 118, 115, 115,
375     115, 119, 119, 119, 119, 119, 119, 119, 119, 119,
376     119, 119, 119, 119, 115, 116, 117, 115, 118, 115,
377     115, 115, 119, 119, 119, 119, 119, 119, 119, 119,
378     119, 119, 119, 119, 119, 119, 119, 119, 119, 115,
379     119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
380     119, 119, 119, 119, 115, 119, 119, 119, 119, 119,
381     119, 119, 119, 119, 119, 119, 119, 119, 119, 115,
382     119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
383     115, 119, 119, 119, 119, 119, 119, 115, 119, 119,
384    
385     119, 119, 115, 119, 119, 115, 120, 121, 119, 119,
386     120, 120, 121, 121, 0, 115, 115, 115, 115, 115,
387     115
388     } ;
389    
390     static yyconst short int yy_nxt[173] =
391     { 0,
392     4, 5, 6, 7, 8, 4, 9, 10, 11, 4,
393     4, 12, 12, 13, 12, 14, 12, 15, 12, 16,
394     12, 17, 12, 18, 19, 20, 12, 21, 22, 12,
395     23, 24, 38, 40, 44, 74, 41, 75, 33, 39,
396     42, 45, 76, 106, 77, 107, 106, 114, 107, 114,
397     112, 108, 112, 114, 108, 26, 112, 26, 27, 27,
398     27, 29, 110, 29, 111, 109, 111, 113, 105, 113,
399     104, 103, 102, 101, 100, 99, 98, 97, 96, 95,
400     94, 93, 92, 91, 90, 89, 88, 87, 86, 85,
401     84, 83, 82, 81, 80, 79, 78, 73, 72, 71,
402    
403     70, 69, 68, 67, 66, 65, 64, 63, 62, 61,
404     60, 59, 58, 57, 56, 55, 54, 53, 52, 51,
405     32, 50, 28, 25, 49, 48, 47, 46, 43, 37,
406     36, 35, 34, 32, 31, 30, 28, 25, 115, 3,
407     115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
408     115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
409     115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
410     115, 115
411     } ;
412    
413     static yyconst short int yy_chk[173] =
414     { 0,
415     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417     1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418     1, 1, 17, 18, 20, 59, 18, 59, 119, 17,
419     18, 20, 61, 103, 61, 103, 106, 114, 106, 113,
420     112, 103, 111, 108, 106, 116, 107, 116, 117, 117,
421     117, 118, 105, 118, 120, 104, 120, 121, 100, 121,
422     99, 98, 97, 96, 95, 93, 91, 89, 88, 87,
423     86, 85, 84, 80, 79, 76, 75, 73, 72, 71,
424     70, 69, 68, 66, 65, 63, 62, 58, 57, 56,
425    
426     55, 54, 53, 52, 51, 50, 49, 48, 47, 46,
427     44, 42, 41, 40, 39, 38, 37, 36, 35, 34,
428     32, 30, 27, 25, 24, 23, 22, 21, 19, 16,
429     15, 14, 13, 11, 10, 9, 7, 5, 3, 115,
430     115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
431     115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
432     115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
433     115, 115
434     } ;
435    
436     static yy_state_type yy_last_accepting_state;
437     static char *yy_last_accepting_cpos;
438    
439     /* The intent behind this definition is that it'll catch
440     * any uses of REJECT which flex missed.
441     */
442     #define REJECT reject_used_but_not_detected
443     #define yymore() yymore_used_but_not_detected
444     #define YY_MORE_ADJ 0
445     #define YY_RESTORE_YY_MORE_OFFSET
446     char *yytext;
447     #line 1 "lexer.l"
448     #define INITIAL 0
449     /*
450     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
451     * lexer.l: A set of rules for flex.
452     *
453     * Copyright (C) 2003 by Piotr Nizynski, Advanced IRC Services Project
454     * Copyright (C) 2005 by the Hybrid Development Team.
455     *
456     * This program is free software; you can redistribute it and/or modify
457     * it under the terms of the GNU General Public License as published by
458     * the Free Software Foundation; either version 2 of the License, or
459     * (at your option) any later version.
460     *
461     * This program is distributed in the hope that it will be useful,
462     * but WITHOUT ANY WARRANTY; without even the implied warranty of
463     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
464     * GNU General Public License for more details.
465     *
466     * You should have received a copy of the GNU General Public License
467     * along with this program; if not, write to the Free Software
468     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
469     * USA
470     *
471     * $Id: conf_lexer.l,v 1.5 2003/10/14 16:18:56 adx Exp $
472     */
473     #define YY_NO_UNPUT 1
474     #line 31 "lexer.l"
475    
476     #include "stdinc.h"
477     #include "conf.h"
478     #include "y.tab.h"
479    
480     struct ConfParserContext conf_curctx;
481     char conf_linebuf[CONF_BUFSIZE];
482     int conf_include_sptr = 0;
483    
484     #undef YY_INPUT
485     #define YY_INPUT(buf, res, siz) res = conf_yy_input(buf, siz)
486     /* flex's default is to print a message and exit(0) */
487     #define YY_FATAL_ERROR(msg) conf_yy_fatal_error(msg)
488    
489     #define MAX_INCLUDE_DEPTH 10
490    
491     YY_BUFFER_STATE conf_include_yystack[MAX_INCLUDE_DEPTH];
492     struct ConfParserContext conf_include_ctxstack[MAX_INCLUDE_DEPTH];
493    
494     static void conf_include(void);
495     static int conf_eof(void);
496     static int conf_yy_fatal_error(const char *msg)
497     {
498     return(0);
499     }
500    
501     #line 502 "lex.yy.c"
502    
503     /* Macros after this point can all be overridden by user definitions in
504     * section 1.
505     */
506    
507     #ifndef YY_SKIP_YYWRAP
508     #ifdef __cplusplus
509     extern "C" int yywrap YY_PROTO(( void ));
510     #else
511     extern int yywrap YY_PROTO(( void ));
512     #endif
513     #endif
514    
515     #ifndef YY_NO_UNPUT
516     static void yyunput YY_PROTO(( int c, char *buf_ptr ));
517     #endif
518    
519     #ifndef yytext_ptr
520     static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
521     #endif
522    
523     #ifdef YY_NEED_STRLEN
524     static int yy_flex_strlen YY_PROTO(( yyconst char * ));
525     #endif
526    
527     #ifndef YY_NO_INPUT
528     #ifdef __cplusplus
529     static int yyinput YY_PROTO(( void ));
530     #else
531     static int input YY_PROTO(( void ));
532     #endif
533     #endif
534    
535     #if YY_STACK_USED
536     static int yy_start_stack_ptr = 0;
537     static int yy_start_stack_depth = 0;
538     static int *yy_start_stack = 0;
539     #ifndef YY_NO_PUSH_STATE
540     static void yy_push_state YY_PROTO(( int new_state ));
541     #endif
542     #ifndef YY_NO_POP_STATE
543     static void yy_pop_state YY_PROTO(( void ));
544     #endif
545     #ifndef YY_NO_TOP_STATE
546     static int yy_top_state YY_PROTO(( void ));
547     #endif
548    
549     #else
550     #define YY_NO_PUSH_STATE 1
551     #define YY_NO_POP_STATE 1
552     #define YY_NO_TOP_STATE 1
553     #endif
554    
555     #ifdef YY_MALLOC_DECL
556     YY_MALLOC_DECL
557     #else
558     #if __STDC__
559     #ifndef __cplusplus
560     #include <stdlib.h>
561     #endif
562     #else
563     /* Just try to get by without declaring the routines. This will fail
564     * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
565     * or sizeof(void*) != sizeof(int).
566     */
567     #endif
568     #endif
569    
570     /* Amount of stuff to slurp up with each read. */
571     #ifndef YY_READ_BUF_SIZE
572     #define YY_READ_BUF_SIZE 8192
573     #endif
574    
575     /* Copy whatever the last rule matched to the standard output. */
576    
577     #ifndef ECHO
578     /* This used to be an fputs(), but since the string might contain NUL's,
579     * we now use fwrite().
580     */
581     #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
582     #endif
583    
584     /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
585     * is returned in "result".
586     */
587     #ifndef YY_INPUT
588     #define YY_INPUT(buf,result,max_size) \
589     if ( yy_current_buffer->yy_is_interactive ) \
590     { \
591     int c = '*', n; \
592     for ( n = 0; n < max_size && \
593     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
594     buf[n] = (char) c; \
595     if ( c == '\n' ) \
596     buf[n++] = (char) c; \
597     if ( c == EOF && ferror( yyin ) ) \
598     YY_FATAL_ERROR( "input in flex scanner failed" ); \
599     result = n; \
600     } \
601     else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
602     && ferror( yyin ) ) \
603     YY_FATAL_ERROR( "input in flex scanner failed" );
604     #endif
605    
606     /* No semi-colon after return; correct usage is to write "yyterminate();" -
607     * we don't want an extra ';' after the "return" because that will cause
608     * some compilers to complain about unreachable statements.
609     */
610     #ifndef yyterminate
611     #define yyterminate() return YY_NULL
612     #endif
613    
614     /* Number of entries by which start-condition stack grows. */
615     #ifndef YY_START_STACK_INCR
616     #define YY_START_STACK_INCR 25
617     #endif
618    
619     /* Report a fatal error. */
620     #ifndef YY_FATAL_ERROR
621     #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
622     #endif
623    
624     /* Default declaration of generated scanner - a define so the user can
625     * easily add parameters.
626     */
627     #ifndef YY_DECL
628     #define YY_DECL int yylex YY_PROTO(( void ))
629     #endif
630    
631     /* Code executed at the beginning of each rule, after yytext and yyleng
632     * have been set up.
633     */
634     #ifndef YY_USER_ACTION
635     #define YY_USER_ACTION
636     #endif
637    
638     /* Code executed at the end of each rule. */
639     #ifndef YY_BREAK
640     #define YY_BREAK break;
641     #endif
642    
643     #define YY_RULE_SETUP \
644     YY_USER_ACTION
645    
646     YY_DECL
647     {
648     register yy_state_type yy_current_state;
649     register char *yy_cp, *yy_bp;
650     register int yy_act;
651    
652     #line 64 "lexer.l"
653    
654    
655     #line 656 "lex.yy.c"
656    
657     if ( yy_init )
658     {
659     yy_init = 0;
660    
661     #ifdef YY_USER_INIT
662     YY_USER_INIT;
663     #endif
664    
665     if ( ! yy_start )
666     yy_start = 1; /* first start state */
667    
668     if ( ! yyin )
669     yyin = stdin;
670    
671     if ( ! yyout )
672     yyout = stdout;
673    
674     if ( ! yy_current_buffer )
675     yy_current_buffer =
676     yy_create_buffer( yyin, YY_BUF_SIZE );
677    
678     yy_load_buffer_state();
679     }
680    
681     while ( 1 ) /* loops until end-of-file is reached */
682     {
683     yy_cp = yy_c_buf_p;
684    
685     /* Support of yytext. */
686     *yy_cp = yy_hold_char;
687    
688     /* yy_bp points to the position in yy_ch_buf of the start of
689     * the current run.
690     */
691     yy_bp = yy_cp;
692    
693     yy_current_state = yy_start;
694     yy_match:
695     do
696     {
697     register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
698     if ( yy_accept[yy_current_state] )
699     {
700     yy_last_accepting_state = yy_current_state;
701     yy_last_accepting_cpos = yy_cp;
702     }
703     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
704     {
705     yy_current_state = (int) yy_def[yy_current_state];
706     if ( yy_current_state >= 116 )
707     yy_c = yy_meta[(unsigned int) yy_c];
708     }
709     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
710     ++yy_cp;
711     }
712     while ( yy_base[yy_current_state] != 140 );
713    
714     yy_find_action:
715     yy_act = yy_accept[yy_current_state];
716     if ( yy_act == 0 )
717     { /* have to back up */
718     yy_cp = yy_last_accepting_cpos;
719     yy_current_state = yy_last_accepting_state;
720     yy_act = yy_accept[yy_current_state];
721     }
722    
723     YY_DO_BEFORE_ACTION;
724    
725    
726     do_action: /* This label is used only to access EOF actions. */
727    
728    
729     switch ( yy_act )
730     { /* beginning of action switch */
731     case 0: /* must back up */
732     /* undo the effects of YY_DO_BEFORE_ACTION */
733     *yy_cp = yy_hold_char;
734     yy_cp = yy_last_accepting_cpos;
735     yy_current_state = yy_last_accepting_state;
736     goto yy_find_action;
737    
738     case 1:
739     YY_RULE_SETUP
740     #line 66 "lexer.l"
741     { conf_include(); }
742     YY_BREAK
743     case 2:
744     YY_RULE_SETUP
745     #line 67 "lexer.l"
746     {
747     int c;
748    
749     while (1)
750     {
751     while ((c = input()) != '*' && c != EOF)
752     if (c == '\n')
753     {
754     conf_curctx.lineno++;
755     conf_linebuf[0] = '\0';
756     }
757     while (c == '*')
758     c = input();
759     if (c == '/')
760     break;
761     if (c == EOF)
762     {
763     yyerror("EOF in comment");
764     break;
765     }
766     }
767     }
768     YY_BREAK
769     case 3:
770     YY_RULE_SETUP
771     #line 89 "lexer.l"
772     {
773     conf_curctx.lineno++;
774     strlcpy(conf_linebuf, yytext + 1, CONF_BUFSIZE);
775     yyless(1);
776     }
777     YY_BREAK
778     case 4:
779     YY_RULE_SETUP
780     #line 94 "lexer.l"
781     ;
782     YY_BREAK
783     case 5:
784     YY_RULE_SETUP
785     #line 95 "lexer.l"
786     {
787     if (!strncasecmp(yytext, "#include", 8))
788     yyerror("You probably meant '.include', ignoring");
789     }
790     YY_BREAK
791     case 6:
792     YY_RULE_SETUP
793     #line 99 "lexer.l"
794     { yylval.number = atoi(yytext); return NUMBER; }
795     YY_BREAK
796     case 7:
797     YY_RULE_SETUP
798     #line 100 "lexer.l"
799     {
800     yytext[yyleng - 1] = '\0';
801     yylval.string = yytext + 1;
802     return QSTRING;
803     }
804     YY_BREAK
805     case 8:
806     YY_RULE_SETUP
807     #line 105 "lexer.l"
808     { return BYTES; }
809     YY_BREAK
810     case 9:
811     YY_RULE_SETUP
812     #line 106 "lexer.l"
813     { return BYTES; }
814     YY_BREAK
815     case 10:
816     YY_RULE_SETUP
817     #line 107 "lexer.l"
818     { return BYTES; }
819     YY_BREAK
820     case 11:
821     YY_RULE_SETUP
822     #line 108 "lexer.l"
823     { return DAYS; }
824     YY_BREAK
825     case 12:
826     YY_RULE_SETUP
827     #line 109 "lexer.l"
828     { return DAYS; }
829     YY_BREAK
830     case 13:
831     YY_RULE_SETUP
832     #line 110 "lexer.l"
833     { return DAYS; }
834     YY_BREAK
835     case 14:
836     YY_RULE_SETUP
837     #line 111 "lexer.l"
838     { yylval.number = 0; return BOOL; }
839     YY_BREAK
840     case 15:
841     YY_RULE_SETUP
842     #line 112 "lexer.l"
843     { return HOURS; }
844     YY_BREAK
845     case 16:
846     YY_RULE_SETUP
847     #line 113 "lexer.l"
848     { return HOURS; }
849     YY_BREAK
850     case 17:
851     YY_RULE_SETUP
852     #line 114 "lexer.l"
853     { return HOURS; }
854     YY_BREAK
855     case 18:
856     YY_RULE_SETUP
857     #line 115 "lexer.l"
858     { return KBYTES; }
859     YY_BREAK
860     case 19:
861     YY_RULE_SETUP
862     #line 116 "lexer.l"
863     { return KBYTES; }
864     YY_BREAK
865     case 20:
866     YY_RULE_SETUP
867     #line 117 "lexer.l"
868     { return KBYTES; }
869     YY_BREAK
870     case 21:
871     YY_RULE_SETUP
872     #line 118 "lexer.l"
873     { return KBYTES; }
874     YY_BREAK
875     case 22:
876     YY_RULE_SETUP
877     #line 119 "lexer.l"
878     { return KBYTES; }
879     YY_BREAK
880     case 23:
881     YY_RULE_SETUP
882     #line 120 "lexer.l"
883     { return MBYTES; }
884     YY_BREAK
885     case 24:
886     YY_RULE_SETUP
887     #line 121 "lexer.l"
888     { return MBYTES; }
889     YY_BREAK
890     case 25:
891     YY_RULE_SETUP
892     #line 122 "lexer.l"
893     { return MBYTES; }
894     YY_BREAK
895     case 26:
896     YY_RULE_SETUP
897     #line 123 "lexer.l"
898     { return MBYTES; }
899     YY_BREAK
900     case 27:
901     YY_RULE_SETUP
902     #line 124 "lexer.l"
903     { return MBYTES; }
904     YY_BREAK
905     case 28:
906     YY_RULE_SETUP
907     #line 125 "lexer.l"
908     { return MINUTES; }
909     YY_BREAK
910     case 29:
911     YY_RULE_SETUP
912     #line 126 "lexer.l"
913     { return MINUTES; }
914     YY_BREAK
915     case 30:
916     YY_RULE_SETUP
917     #line 127 "lexer.l"
918     { return MINUTES; }
919     YY_BREAK
920     case 31:
921     YY_RULE_SETUP
922     #line 128 "lexer.l"
923     { return MINUTES; }
924     YY_BREAK
925     case 32:
926     YY_RULE_SETUP
927     #line 129 "lexer.l"
928     { return MINUTES; }
929     YY_BREAK
930     case 33:
931     YY_RULE_SETUP
932     #line 130 "lexer.l"
933     { yylval.number = 0; return BOOL; }
934     YY_BREAK
935     case 34:
936     YY_RULE_SETUP
937     #line 131 "lexer.l"
938     { yylval.number = 0; return BOOL; }
939     YY_BREAK
940     case 35:
941     YY_RULE_SETUP
942     #line 132 "lexer.l"
943     { yylval.number = 1; return BOOL; }
944     YY_BREAK
945     case 36:
946     YY_RULE_SETUP
947     #line 133 "lexer.l"
948     { return SECONDS; }
949     YY_BREAK
950     case 37:
951     YY_RULE_SETUP
952     #line 134 "lexer.l"
953     { return SECONDS; }
954     YY_BREAK
955     case 38:
956     YY_RULE_SETUP
957     #line 135 "lexer.l"
958     { return SECONDS; }
959     YY_BREAK
960     case 39:
961     YY_RULE_SETUP
962     #line 136 "lexer.l"
963     { return SECONDS; }
964     YY_BREAK
965     case 40:
966     YY_RULE_SETUP
967     #line 137 "lexer.l"
968     { return SECONDS; }
969     YY_BREAK
970     case 41:
971     YY_RULE_SETUP
972     #line 138 "lexer.l"
973     { yylval.number = 1; return BOOL; }
974     YY_BREAK
975     case 42:
976     YY_RULE_SETUP
977     #line 139 "lexer.l"
978     { return WEEKS; }
979     YY_BREAK
980     case 43:
981     YY_RULE_SETUP
982     #line 140 "lexer.l"
983     { return WEEKS; }
984     YY_BREAK
985     case 44:
986     YY_RULE_SETUP
987     #line 141 "lexer.l"
988     { return WEEKS; }
989     YY_BREAK
990     case 45:
991     YY_RULE_SETUP
992     #line 142 "lexer.l"
993     { yylval.number = 1; return BOOL; }
994     YY_BREAK
995     case 46:
996     YY_RULE_SETUP
997     #line 143 "lexer.l"
998     { yylval.string = yytext; return IDENTIFIER; }
999     YY_BREAK
1000     case 47:
1001     YY_RULE_SETUP
1002     #line 144 "lexer.l"
1003     { return yytext[0]; }
1004     YY_BREAK
1005     case YY_STATE_EOF(INITIAL):
1006     #line 145 "lexer.l"
1007     { if (conf_eof()) yyterminate(); }
1008     YY_BREAK
1009     case 48:
1010     YY_RULE_SETUP
1011     #line 147 "lexer.l"
1012     ECHO;
1013     YY_BREAK
1014     #line 1015 "lex.yy.c"
1015    
1016     case YY_END_OF_BUFFER:
1017     {
1018     /* Amount of text matched not including the EOB char. */
1019     int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1020    
1021     /* Undo the effects of YY_DO_BEFORE_ACTION. */
1022     *yy_cp = yy_hold_char;
1023     YY_RESTORE_YY_MORE_OFFSET
1024    
1025     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1026     {
1027     /* We're scanning a new file or input source. It's
1028     * possible that this happened because the user
1029     * just pointed yyin at a new source and called
1030     * yylex(). If so, then we have to assure
1031     * consistency between yy_current_buffer and our
1032     * globals. Here is the right place to do so, because
1033     * this is the first action (other than possibly a
1034     * back-up) that will match for the new input source.
1035     */
1036     yy_n_chars = yy_current_buffer->yy_n_chars;
1037     yy_current_buffer->yy_input_file = yyin;
1038     yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1039     }
1040    
1041     /* Note that here we test for yy_c_buf_p "<=" to the position
1042     * of the first EOB in the buffer, since yy_c_buf_p will
1043     * already have been incremented past the NUL character
1044     * (since all states make transitions on EOB to the
1045     * end-of-buffer state). Contrast this with the test
1046     * in input().
1047     */
1048     if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1049     { /* This was really a NUL. */
1050     yy_state_type yy_next_state;
1051    
1052     yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1053    
1054     yy_current_state = yy_get_previous_state();
1055    
1056     /* Okay, we're now positioned to make the NUL
1057     * transition. We couldn't have
1058     * yy_get_previous_state() go ahead and do it
1059     * for us because it doesn't know how to deal
1060     * with the possibility of jamming (and we don't
1061     * want to build jamming into it because then it
1062     * will run more slowly).
1063     */
1064    
1065     yy_next_state = yy_try_NUL_trans( yy_current_state );
1066    
1067     yy_bp = yytext_ptr + YY_MORE_ADJ;
1068    
1069     if ( yy_next_state )
1070     {
1071     /* Consume the NUL. */
1072     yy_cp = ++yy_c_buf_p;
1073     yy_current_state = yy_next_state;
1074     goto yy_match;
1075     }
1076    
1077     else
1078     {
1079     yy_cp = yy_c_buf_p;
1080     goto yy_find_action;
1081     }
1082     }
1083    
1084     else switch ( yy_get_next_buffer() )
1085     {
1086     case EOB_ACT_END_OF_FILE:
1087     {
1088     yy_did_buffer_switch_on_eof = 0;
1089    
1090     if ( yywrap() )
1091     {
1092     /* Note: because we've taken care in
1093     * yy_get_next_buffer() to have set up
1094     * yytext, we can now set up
1095     * yy_c_buf_p so that if some total
1096     * hoser (like flex itself) wants to
1097     * call the scanner after we return the
1098     * YY_NULL, it'll still work - another
1099     * YY_NULL will get returned.
1100     */
1101     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1102    
1103     yy_act = YY_STATE_EOF(YY_START);
1104     goto do_action;
1105     }
1106    
1107     else
1108     {
1109     if ( ! yy_did_buffer_switch_on_eof )
1110     YY_NEW_FILE;
1111     }
1112     break;
1113     }
1114    
1115     case EOB_ACT_CONTINUE_SCAN:
1116     yy_c_buf_p =
1117     yytext_ptr + yy_amount_of_matched_text;
1118    
1119     yy_current_state = yy_get_previous_state();
1120    
1121     yy_cp = yy_c_buf_p;
1122     yy_bp = yytext_ptr + YY_MORE_ADJ;
1123     goto yy_match;
1124    
1125     case EOB_ACT_LAST_MATCH:
1126     yy_c_buf_p =
1127     &yy_current_buffer->yy_ch_buf[yy_n_chars];
1128    
1129     yy_current_state = yy_get_previous_state();
1130    
1131     yy_cp = yy_c_buf_p;
1132     yy_bp = yytext_ptr + YY_MORE_ADJ;
1133     goto yy_find_action;
1134     }
1135     break;
1136     }
1137    
1138     default:
1139     YY_FATAL_ERROR(
1140     "fatal flex scanner internal error--no action found" );
1141     } /* end of action switch */
1142     } /* end of scanning one token */
1143     } /* end of yylex */
1144    
1145    
1146     /* yy_get_next_buffer - try to read in a new buffer
1147     *
1148     * Returns a code representing an action:
1149     * EOB_ACT_LAST_MATCH -
1150     * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1151     * EOB_ACT_END_OF_FILE - end of file
1152     */
1153    
1154     static int yy_get_next_buffer()
1155     {
1156     register char *dest = yy_current_buffer->yy_ch_buf;
1157     register char *source = yytext_ptr;
1158     register int number_to_move, i;
1159     int ret_val;
1160    
1161     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1162     YY_FATAL_ERROR(
1163     "fatal flex scanner internal error--end of buffer missed" );
1164    
1165     if ( yy_current_buffer->yy_fill_buffer == 0 )
1166     { /* Don't try to fill the buffer, so this is an EOF. */
1167     if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1168     {
1169     /* We matched a single character, the EOB, so
1170     * treat this as a final EOF.
1171     */
1172     return EOB_ACT_END_OF_FILE;
1173     }
1174    
1175     else
1176     {
1177     /* We matched some text prior to the EOB, first
1178     * process it.
1179     */
1180     return EOB_ACT_LAST_MATCH;
1181     }
1182     }
1183    
1184     /* Try to read more data. */
1185    
1186     /* First move last chars to start of buffer. */
1187     number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1188    
1189     for ( i = 0; i < number_to_move; ++i )
1190     *(dest++) = *(source++);
1191    
1192     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1193     /* don't do the read, it's not guaranteed to return an EOF,
1194     * just force an EOF
1195     */
1196     yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1197    
1198     else
1199     {
1200     int num_to_read =
1201     yy_current_buffer->yy_buf_size - number_to_move - 1;
1202    
1203     while ( num_to_read <= 0 )
1204     { /* Not enough room in the buffer - grow it. */
1205     #ifdef YY_USES_REJECT
1206     YY_FATAL_ERROR(
1207     "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1208     #else
1209    
1210     /* just a shorter name for the current buffer */
1211     YY_BUFFER_STATE b = yy_current_buffer;
1212    
1213     int yy_c_buf_p_offset =
1214     (int) (yy_c_buf_p - b->yy_ch_buf);
1215    
1216     if ( b->yy_is_our_buffer )
1217     {
1218     int new_size = b->yy_buf_size * 2;
1219    
1220     if ( new_size <= 0 )
1221     b->yy_buf_size += b->yy_buf_size / 8;
1222     else
1223     b->yy_buf_size *= 2;
1224    
1225     b->yy_ch_buf = (char *)
1226     /* Include room in for 2 EOB chars. */
1227     yy_flex_realloc( (void *) b->yy_ch_buf,
1228     b->yy_buf_size + 2 );
1229     }
1230     else
1231     /* Can't grow it, we don't own it. */
1232     b->yy_ch_buf = 0;
1233    
1234     if ( ! b->yy_ch_buf )
1235     YY_FATAL_ERROR(
1236     "fatal error - scanner input buffer overflow" );
1237    
1238     yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1239    
1240     num_to_read = yy_current_buffer->yy_buf_size -
1241     number_to_move - 1;
1242     #endif
1243     }
1244    
1245     if ( num_to_read > YY_READ_BUF_SIZE )
1246     num_to_read = YY_READ_BUF_SIZE;
1247    
1248     /* Read in more data. */
1249     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1250     yy_n_chars, num_to_read );
1251    
1252     yy_current_buffer->yy_n_chars = yy_n_chars;
1253     }
1254    
1255     if ( yy_n_chars == 0 )
1256     {
1257     if ( number_to_move == YY_MORE_ADJ )
1258     {
1259     ret_val = EOB_ACT_END_OF_FILE;
1260     yyrestart( yyin );
1261     }
1262    
1263     else
1264     {
1265     ret_val = EOB_ACT_LAST_MATCH;
1266     yy_current_buffer->yy_buffer_status =
1267     YY_BUFFER_EOF_PENDING;
1268     }
1269     }
1270    
1271     else
1272     ret_val = EOB_ACT_CONTINUE_SCAN;
1273    
1274     yy_n_chars += number_to_move;
1275     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1276     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1277    
1278     yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1279    
1280     return ret_val;
1281     }
1282    
1283    
1284     /* yy_get_previous_state - get the state just before the EOB char was reached */
1285    
1286     static yy_state_type yy_get_previous_state()
1287     {
1288     register yy_state_type yy_current_state;
1289     register char *yy_cp;
1290    
1291     yy_current_state = yy_start;
1292    
1293     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1294     {
1295     register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1296     if ( yy_accept[yy_current_state] )
1297     {
1298     yy_last_accepting_state = yy_current_state;
1299     yy_last_accepting_cpos = yy_cp;
1300     }
1301     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1302     {
1303     yy_current_state = (int) yy_def[yy_current_state];
1304     if ( yy_current_state >= 116 )
1305     yy_c = yy_meta[(unsigned int) yy_c];
1306     }
1307     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1308     }
1309    
1310     return yy_current_state;
1311     }
1312    
1313    
1314     /* yy_try_NUL_trans - try to make a transition on the NUL character
1315     *
1316     * synopsis
1317     * next_state = yy_try_NUL_trans( current_state );
1318     */
1319    
1320     #ifdef YY_USE_PROTOS
1321     static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1322     #else
1323     static yy_state_type yy_try_NUL_trans( yy_current_state )
1324     yy_state_type yy_current_state;
1325     #endif
1326     {
1327     register int yy_is_jam;
1328     register char *yy_cp = yy_c_buf_p;
1329    
1330     register YY_CHAR yy_c = 1;
1331     if ( yy_accept[yy_current_state] )
1332     {
1333     yy_last_accepting_state = yy_current_state;
1334     yy_last_accepting_cpos = yy_cp;
1335     }
1336     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1337     {
1338     yy_current_state = (int) yy_def[yy_current_state];
1339     if ( yy_current_state >= 116 )
1340     yy_c = yy_meta[(unsigned int) yy_c];
1341     }
1342     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1343     yy_is_jam = (yy_current_state == 115);
1344    
1345     return yy_is_jam ? 0 : yy_current_state;
1346     }
1347    
1348    
1349     #ifndef YY_NO_UNPUT
1350     #ifdef YY_USE_PROTOS
1351     static void yyunput( int c, register char *yy_bp )
1352     #else
1353     static void yyunput( c, yy_bp )
1354     int c;
1355     register char *yy_bp;
1356     #endif
1357     {
1358     register char *yy_cp = yy_c_buf_p;
1359    
1360     /* undo effects of setting up yytext */
1361     *yy_cp = yy_hold_char;
1362    
1363     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1364     { /* need to shift things up to make room */
1365     /* +2 for EOB chars. */
1366     register int number_to_move = yy_n_chars + 2;
1367     register char *dest = &yy_current_buffer->yy_ch_buf[
1368     yy_current_buffer->yy_buf_size + 2];
1369     register char *source =
1370     &yy_current_buffer->yy_ch_buf[number_to_move];
1371    
1372     while ( source > yy_current_buffer->yy_ch_buf )
1373     *--dest = *--source;
1374    
1375     yy_cp += (int) (dest - source);
1376     yy_bp += (int) (dest - source);
1377     yy_current_buffer->yy_n_chars =
1378     yy_n_chars = yy_current_buffer->yy_buf_size;
1379    
1380     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1381     YY_FATAL_ERROR( "flex scanner push-back overflow" );
1382     }
1383    
1384     *--yy_cp = (char) c;
1385    
1386    
1387     yytext_ptr = yy_bp;
1388     yy_hold_char = *yy_cp;
1389     yy_c_buf_p = yy_cp;
1390     }
1391     #endif /* ifndef YY_NO_UNPUT */
1392    
1393    
1394     #ifdef __cplusplus
1395     static int yyinput()
1396     #else
1397     static int input()
1398     #endif
1399     {
1400     int c;
1401    
1402     *yy_c_buf_p = yy_hold_char;
1403    
1404     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1405     {
1406     /* yy_c_buf_p now points to the character we want to return.
1407     * If this occurs *before* the EOB characters, then it's a
1408     * valid NUL; if not, then we've hit the end of the buffer.
1409     */
1410     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1411     /* This was really a NUL. */
1412     *yy_c_buf_p = '\0';
1413    
1414     else
1415     { /* need more input */
1416     int offset = yy_c_buf_p - yytext_ptr;
1417     ++yy_c_buf_p;
1418    
1419     switch ( yy_get_next_buffer() )
1420     {
1421     case EOB_ACT_LAST_MATCH:
1422     /* This happens because yy_g_n_b()
1423     * sees that we've accumulated a
1424     * token and flags that we need to
1425     * try matching the token before
1426     * proceeding. But for input(),
1427     * there's no matching to consider.
1428     * So convert the EOB_ACT_LAST_MATCH
1429     * to EOB_ACT_END_OF_FILE.
1430     */
1431    
1432     /* Reset buffer status. */
1433     yyrestart( yyin );
1434    
1435     /* fall through */
1436    
1437     case EOB_ACT_END_OF_FILE:
1438     {
1439     if ( yywrap() )
1440     return EOF;
1441    
1442     if ( ! yy_did_buffer_switch_on_eof )
1443     YY_NEW_FILE;
1444     #ifdef __cplusplus
1445     return yyinput();
1446     #else
1447     return input();
1448     #endif
1449     }
1450    
1451     case EOB_ACT_CONTINUE_SCAN:
1452     yy_c_buf_p = yytext_ptr + offset;
1453     break;
1454     }
1455     }
1456     }
1457    
1458     c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1459     *yy_c_buf_p = '\0'; /* preserve yytext */
1460     yy_hold_char = *++yy_c_buf_p;
1461    
1462    
1463     return c;
1464     }
1465    
1466    
1467     #ifdef YY_USE_PROTOS
1468     void yyrestart( FILE *input_file )
1469     #else
1470     void yyrestart( input_file )
1471     FILE *input_file;
1472     #endif
1473     {
1474     if ( ! yy_current_buffer )
1475     yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1476    
1477     yy_init_buffer( yy_current_buffer, input_file );
1478     yy_load_buffer_state();
1479     }
1480    
1481    
1482     #ifdef YY_USE_PROTOS
1483     void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1484     #else
1485     void yy_switch_to_buffer( new_buffer )
1486     YY_BUFFER_STATE new_buffer;
1487     #endif
1488     {
1489     if ( yy_current_buffer == new_buffer )
1490     return;
1491    
1492     if ( yy_current_buffer )
1493     {
1494     /* Flush out information for old buffer. */
1495     *yy_c_buf_p = yy_hold_char;
1496     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1497     yy_current_buffer->yy_n_chars = yy_n_chars;
1498     }
1499    
1500     yy_current_buffer = new_buffer;
1501     yy_load_buffer_state();
1502    
1503     /* We don't actually know whether we did this switch during
1504     * EOF (yywrap()) processing, but the only time this flag
1505     * is looked at is after yywrap() is called, so it's safe
1506     * to go ahead and always set it.
1507     */
1508     yy_did_buffer_switch_on_eof = 1;
1509     }
1510    
1511    
1512     #ifdef YY_USE_PROTOS
1513     void yy_load_buffer_state( void )
1514     #else
1515     void yy_load_buffer_state()
1516     #endif
1517     {
1518     yy_n_chars = yy_current_buffer->yy_n_chars;
1519     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1520     yyin = yy_current_buffer->yy_input_file;
1521     yy_hold_char = *yy_c_buf_p;
1522     }
1523    
1524    
1525     #ifdef YY_USE_PROTOS
1526     YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1527     #else
1528     YY_BUFFER_STATE yy_create_buffer( file, size )
1529     FILE *file;
1530     int size;
1531     #endif
1532     {
1533     YY_BUFFER_STATE b;
1534    
1535     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1536     if ( ! b )
1537     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1538    
1539     b->yy_buf_size = size;
1540    
1541     /* yy_ch_buf has to be 2 characters longer than the size given because
1542     * we need to put in 2 end-of-buffer characters.
1543     */
1544     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1545     if ( ! b->yy_ch_buf )
1546     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1547    
1548     b->yy_is_our_buffer = 1;
1549    
1550     yy_init_buffer( b, file );
1551    
1552     return b;
1553     }
1554    
1555    
1556     #ifdef YY_USE_PROTOS
1557     void yy_delete_buffer( YY_BUFFER_STATE b )
1558     #else
1559     void yy_delete_buffer( b )
1560     YY_BUFFER_STATE b;
1561     #endif
1562     {
1563     if ( ! b )
1564     return;
1565    
1566     if ( b == yy_current_buffer )
1567     yy_current_buffer = (YY_BUFFER_STATE) 0;
1568    
1569     if ( b->yy_is_our_buffer )
1570     yy_flex_free( (void *) b->yy_ch_buf );
1571    
1572     yy_flex_free( (void *) b );
1573     }
1574    
1575    
1576     #ifndef YY_ALWAYS_INTERACTIVE
1577     #ifndef YY_NEVER_INTERACTIVE
1578     extern int isatty YY_PROTO(( int ));
1579     #endif
1580     #endif
1581    
1582     #ifdef YY_USE_PROTOS
1583     void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1584     #else
1585     void yy_init_buffer( b, file )
1586     YY_BUFFER_STATE b;
1587     FILE *file;
1588     #endif
1589    
1590    
1591     {
1592     yy_flush_buffer( b );
1593    
1594     b->yy_input_file = file;
1595     b->yy_fill_buffer = 1;
1596    
1597     #if YY_ALWAYS_INTERACTIVE
1598     b->yy_is_interactive = 1;
1599     #else
1600     #if YY_NEVER_INTERACTIVE
1601     b->yy_is_interactive = 0;
1602     #else
1603     b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1604     #endif
1605     #endif
1606     }
1607    
1608    
1609     #ifdef YY_USE_PROTOS
1610     void yy_flush_buffer( YY_BUFFER_STATE b )
1611     #else
1612     void yy_flush_buffer( b )
1613     YY_BUFFER_STATE b;
1614     #endif
1615    
1616     {
1617     if ( ! b )
1618     return;
1619    
1620     b->yy_n_chars = 0;
1621    
1622     /* We always need two end-of-buffer characters. The first causes
1623     * a transition to the end-of-buffer state. The second causes
1624     * a jam in that state.
1625     */
1626     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1627     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1628    
1629     b->yy_buf_pos = &b->yy_ch_buf[0];
1630    
1631     b->yy_at_bol = 1;
1632     b->yy_buffer_status = YY_BUFFER_NEW;
1633    
1634     if ( b == yy_current_buffer )
1635     yy_load_buffer_state();
1636     }
1637    
1638    
1639     #ifndef YY_NO_SCAN_BUFFER
1640     #ifdef YY_USE_PROTOS
1641     YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1642     #else
1643     YY_BUFFER_STATE yy_scan_buffer( base, size )
1644     char *base;
1645     yy_size_t size;
1646     #endif
1647     {
1648     YY_BUFFER_STATE b;
1649    
1650     if ( size < 2 ||
1651     base[size-2] != YY_END_OF_BUFFER_CHAR ||
1652     base[size-1] != YY_END_OF_BUFFER_CHAR )
1653     /* They forgot to leave room for the EOB's. */
1654     return 0;
1655    
1656     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1657     if ( ! b )
1658     YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1659    
1660     b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1661     b->yy_buf_pos = b->yy_ch_buf = base;
1662     b->yy_is_our_buffer = 0;
1663     b->yy_input_file = 0;
1664     b->yy_n_chars = b->yy_buf_size;
1665     b->yy_is_interactive = 0;
1666     b->yy_at_bol = 1;
1667     b->yy_fill_buffer = 0;
1668     b->yy_buffer_status = YY_BUFFER_NEW;
1669    
1670     yy_switch_to_buffer( b );
1671    
1672     return b;
1673     }
1674     #endif
1675    
1676    
1677     #ifndef YY_NO_SCAN_STRING
1678     #ifdef YY_USE_PROTOS
1679     YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1680     #else
1681     YY_BUFFER_STATE yy_scan_string( yy_str )
1682     yyconst char *yy_str;
1683     #endif
1684     {
1685     int len;
1686     for ( len = 0; yy_str[len]; ++len )
1687     ;
1688    
1689     return yy_scan_bytes( yy_str, len );
1690     }
1691     #endif
1692    
1693    
1694     #ifndef YY_NO_SCAN_BYTES
1695     #ifdef YY_USE_PROTOS
1696     YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1697     #else
1698     YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1699     yyconst char *bytes;
1700     int len;
1701     #endif
1702     {
1703     YY_BUFFER_STATE b;
1704     char *buf;
1705     yy_size_t n;
1706     int i;
1707    
1708     /* Get memory for full buffer, including space for trailing EOB's. */
1709     n = len + 2;
1710     buf = (char *) yy_flex_alloc( n );
1711     if ( ! buf )
1712     YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1713    
1714     for ( i = 0; i < len; ++i )
1715     buf[i] = bytes[i];
1716    
1717     buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1718    
1719     b = yy_scan_buffer( buf, n );
1720     if ( ! b )
1721     YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1722    
1723     /* It's okay to grow etc. this buffer, and we should throw it
1724     * away when we're done.
1725     */
1726     b->yy_is_our_buffer = 1;
1727    
1728     return b;
1729     }
1730     #endif
1731    
1732    
1733     #ifndef YY_NO_PUSH_STATE
1734     #ifdef YY_USE_PROTOS
1735     static void yy_push_state( int new_state )
1736     #else
1737     static void yy_push_state( new_state )
1738     int new_state;
1739     #endif
1740     {
1741     if ( yy_start_stack_ptr >= yy_start_stack_depth )
1742     {
1743     yy_size_t new_size;
1744    
1745     yy_start_stack_depth += YY_START_STACK_INCR;
1746     new_size = yy_start_stack_depth * sizeof( int );
1747    
1748     if ( ! yy_start_stack )
1749     yy_start_stack = (int *) yy_flex_alloc( new_size );
1750    
1751     else
1752     yy_start_stack = (int *) yy_flex_realloc(
1753     (void *) yy_start_stack, new_size );
1754    
1755     if ( ! yy_start_stack )
1756     YY_FATAL_ERROR(
1757     "out of memory expanding start-condition stack" );
1758     }
1759    
1760     yy_start_stack[yy_start_stack_ptr++] = YY_START;
1761    
1762     BEGIN(new_state);
1763     }
1764     #endif
1765    
1766    
1767     #ifndef YY_NO_POP_STATE
1768     static void yy_pop_state()
1769     {
1770     if ( --yy_start_stack_ptr < 0 )
1771     YY_FATAL_ERROR( "start-condition stack underflow" );
1772    
1773     BEGIN(yy_start_stack[yy_start_stack_ptr]);
1774     }
1775     #endif
1776    
1777    
1778     #ifndef YY_NO_TOP_STATE
1779     static int yy_top_state()
1780     {
1781     return yy_start_stack[yy_start_stack_ptr - 1];
1782     }
1783     #endif
1784    
1785     #ifndef YY_EXIT_FAILURE
1786     #define YY_EXIT_FAILURE 2
1787     #endif
1788    
1789     #ifdef YY_USE_PROTOS
1790     static void yy_fatal_error( yyconst char msg[] )
1791     #else
1792     static void yy_fatal_error( msg )
1793     char msg[];
1794     #endif
1795     {
1796     (void) fprintf( stderr, "%s\n", msg );
1797     exit( YY_EXIT_FAILURE );
1798     }
1799    
1800    
1801    
1802     /* Redefine yyless() so it works in section 3 code. */
1803    
1804     #undef yyless
1805     #define yyless(n) \
1806     do \
1807     { \
1808     /* Undo effects of setting up yytext. */ \
1809     yytext[yyleng] = yy_hold_char; \
1810     yy_c_buf_p = yytext + n; \
1811     yy_hold_char = *yy_c_buf_p; \
1812     *yy_c_buf_p = '\0'; \
1813     yyleng = n; \
1814     } \
1815     while ( 0 )
1816    
1817    
1818     /* Internal utility routines. */
1819    
1820     #ifndef yytext_ptr
1821     #ifdef YY_USE_PROTOS
1822     static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1823     #else
1824     static void yy_flex_strncpy( s1, s2, n )
1825     char *s1;
1826     yyconst char *s2;
1827     int n;
1828     #endif
1829     {
1830     register int i;
1831     for ( i = 0; i < n; ++i )
1832     s1[i] = s2[i];
1833     }
1834     #endif
1835    
1836     #ifdef YY_NEED_STRLEN
1837     #ifdef YY_USE_PROTOS
1838     static int yy_flex_strlen( yyconst char *s )
1839     #else
1840     static int yy_flex_strlen( s )
1841     yyconst char *s;
1842     #endif
1843     {
1844     register int n;
1845     for ( n = 0; s[n]; ++n )
1846     ;
1847    
1848     return n;
1849     }
1850     #endif
1851    
1852    
1853     #ifdef YY_USE_PROTOS
1854     static void *yy_flex_alloc( yy_size_t size )
1855     #else
1856     static void *yy_flex_alloc( size )
1857     yy_size_t size;
1858     #endif
1859     {
1860     return (void *) malloc( size );
1861     }
1862    
1863     #ifdef YY_USE_PROTOS
1864     static void *yy_flex_realloc( void *ptr, yy_size_t size )
1865     #else
1866     static void *yy_flex_realloc( ptr, size )
1867     void *ptr;
1868     yy_size_t size;
1869     #endif
1870     {
1871     /* The cast to (char *) in the following accommodates both
1872     * implementations that use char* generic pointers, and those
1873     * that use void* generic pointers. It works with the latter
1874     * because both ANSI C and C++ allow castless assignment from
1875     * any pointer type to void*, and deal with argument conversions
1876     * as though doing an assignment.
1877     */
1878     return (void *) realloc( (char *) ptr, size );
1879     }
1880    
1881     #ifdef YY_USE_PROTOS
1882     static void yy_flex_free( void *ptr )
1883     #else
1884     static void yy_flex_free( ptr )
1885     void *ptr;
1886     #endif
1887     {
1888     free( ptr );
1889     }
1890    
1891     #if YY_MAIN
1892     int main()
1893     {
1894     yylex();
1895     return 0;
1896     }
1897     #endif
1898     #line 147 "lexer.l"
1899    
1900    
1901     /*
1902     * conf_include()
1903     *
1904     * Enters a new configuration file.
1905     *
1906     * inputs: none
1907     * output: none
1908     */
1909     static void
1910     conf_include(void)
1911     {
1912     char *fname, *buf;
1913     FBFILE *f;
1914    
1915     if (conf_include_sptr == MAX_INCLUDE_DEPTH)
1916     {
1917     yyerror("includes nested too deep");
1918     return;
1919     }
1920    
1921     if ((fname = strchr(yytext, '"')) == NULL)
1922     *strchr(fname = strchr(yytext, '<') + 1, '>') = '\0';
1923     else
1924     *strchr(++fname, '"') = '\0';
1925    
1926     if (fname[0] == '/')
1927     f = fbopen(fname, "r");
1928     else
1929     {
1930     buf = MyMalloc(strlen(ETCPATH) + 1 + strlen(fname) + 1);
1931     sprintf(buf, "%s/%s", ETCPATH, fname);
1932     f = fbopen(buf, "r");
1933     MyFree(buf);
1934     }
1935    
1936     if (f == NULL)
1937     {
1938     yyerror("cannot open file to include");
1939     return;
1940     }
1941    
1942     /* save current state */
1943     memcpy(&conf_include_ctxstack[conf_include_sptr], &conf_curctx,
1944     sizeof(struct ConfParserContext));
1945     conf_include_yystack[conf_include_sptr++] = YY_CURRENT_BUFFER;
1946    
1947     /* switch lexer context */
1948     conf_linebuf[0] = '\0';
1949     conf_curctx.f = f;
1950     DupString(conf_curctx.filename, fname);
1951     conf_curctx.lineno = 1;
1952     yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
1953     }
1954    
1955     /*
1956     * conf_eof()
1957     *
1958     * Ends processing of a configuration file.
1959     *
1960     * inputs: none
1961     * output: 1 if the parser should be exited, 0 otherwise
1962     */
1963     static int
1964     conf_eof(void)
1965     {
1966     if (conf_include_sptr == 0)
1967     return 1;
1968    
1969     /* destroy current buffer */
1970     yy_delete_buffer(YY_CURRENT_BUFFER);
1971     fbclose(conf_curctx.f);
1972    
1973     /* restore old context */
1974     conf_linebuf[0] = '\0';
1975     memcpy(&conf_curctx, &conf_include_ctxstack[--conf_include_sptr],
1976     sizeof(struct ConfParserContext));
1977     yy_switch_to_buffer(conf_include_yystack[conf_include_sptr]);
1978    
1979     return 0;
1980     yy_fatal_error(NULL); /* use it somewhere to avoid the warning */
1981     }