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