4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
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
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
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
;
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
;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
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
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
125 #define BEGIN (yy_start) = 1 + 2 *
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
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
144 #define YY_BUF_SIZE 16384
147 /* The state buf must be large enough to hold one state per character in the main buffer.
149 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152 #define YY_TYPEDEF_YY_BUFFER_STATE
153 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
156 #ifndef YY_TYPEDEF_YY_SIZE_T
157 #define YY_TYPEDEF_YY_SIZE_T
158 typedef size_t yy_size_t
;
161 extern yy_size_t yyleng
;
163 extern FILE *yyin
, *yyout
;
165 #define EOB_ACT_CONTINUE_SCAN 0
166 #define EOB_ACT_END_OF_FILE 1
167 #define EOB_ACT_LAST_MATCH 2
169 #define YY_LESS_LINENO(n)
171 /* Return all but the first "n" matched characters back to the input stream. */
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 */ \
185 #define unput(c) yyunput( c, (yytext_ptr) )
187 #ifndef YY_STRUCT_YY_BUFFER_STATE
188 #define YY_STRUCT_YY_BUFFER_STATE
189 struct yy_buffer_state
193 char *yy_ch_buf
; /* input buffer */
194 char *yy_buf_pos
; /* current position in input buffer */
196 /* Size of input buffer in bytes, not including room for EOB
199 yy_size_t yy_buf_size
;
201 /* Number of characters read into yy_ch_buf, not including EOB
204 yy_size_t yy_n_chars
;
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
210 int yy_is_our_buffer
;
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
217 int yy_is_interactive
;
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
225 int yy_bs_lineno
; /**< The line count. */
226 int yy_bs_column
; /**< The column count. */
228 /* Whether to try to fill the input buffer when we reach the
233 int yy_buffer_status
;
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.
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.
247 #define YY_BUFFER_EOF_PENDING 2
250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
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. */
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
261 * Returns the top of the stack, or NULL.
263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
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.
270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
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 */
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 */
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 ...
285 static int yy_did_buffer_switch_on_eof
;
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 );
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
);
299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
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
);
305 void *yyalloc (yy_size_t
);
306 void *yyrealloc (void *,yy_size_t
);
307 void yyfree (void * );
309 #define yy_new_buffer yy_create_buffer
311 #define yy_set_interactive(is_interactive) \
313 if ( ! YY_CURRENT_BUFFER ){ \
314 yyensure_buffer_stack (); \
315 YY_CURRENT_BUFFER_LVALUE = \
316 yy_create_buffer(yyin,YY_BUF_SIZE ); \
318 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321 #define yy_set_bol(at_bol) \
323 if ( ! YY_CURRENT_BUFFER ){\
324 yyensure_buffer_stack (); \
325 YY_CURRENT_BUFFER_LVALUE = \
326 yy_create_buffer(yyin,YY_BUF_SIZE ); \
328 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333 /* Begin user sect3 */
336 #define YY_SKIP_YYWRAP
338 typedef unsigned char YY_CHAR
;
340 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
342 typedef int yy_state_type
;
349 #define yytext_ptr yytext
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
[] );
356 /* Done after the current pattern has been matched and before the
357 * corresponding action - sets up yytext.
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; \
365 (yy_c_buf_p) = yy_cp;
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. */
373 flex_int32_t yy_verify
;
376 static yyconst flex_int16_t yy_accept
[47] =
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,
385 static yyconst flex_int32_t yy_ec
[256] =
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,
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,
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,
417 static yyconst flex_int32_t yy_meta
[34] =
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,
425 static yyconst flex_int16_t yy_base
[54] =
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,
435 static yyconst flex_int16_t yy_def
[54] =
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,
445 static yyconst flex_int16_t yy_nxt
[138] =
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,
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
464 static yyconst flex_int16_t yy_chk
[138] =
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,
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
483 static yy_state_type yy_last_accepting_state
;
484 static char *yy_last_accepting_cpos
;
486 extern int yy_flex_debug
;
487 int yy_flex_debug
= 0;
489 /* The intent behind this definition is that it'll catch
490 * any uses of REJECT which flex missed.
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
499 #line 1 "ircd_lexer.l"
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.
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.
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
517 #line 26 "ircd_lexer.l"
518 #include <sys/types.h>
519 #include <sys/stat.h>
521 #include <netinet/in.h>
527 #define WE_ARE_MEMORY_C
530 #include "ircd_defs.h"
537 #include "ircd_parser.h"
541 #define MAX_INCLUDE_DEPTH 10
543 YY_BUFFER_STATE include_stack
[MAX_INCLUDE_DEPTH
];
544 int include_stack_ptr
=0;
548 void hashcomment(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
;
555 FILE *inc_fbfile_in
[MAX_INCLUDE_DEPTH
];
561 #define YY_FATAL_ERROR(msg) conf_yy_fatal_error(msg)
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"
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.
578 #ifndef YY_EXTRA_TYPE
579 #define YY_EXTRA_TYPE void *
582 static int yy_init_globals (void );
584 /* Accessor methods to globals.
585 These are made visible to non-reentrant scanners for convenience. */
587 int yylex_destroy (void );
589 int yyget_debug (void );
591 void yyset_debug (int debug_flag
);
593 YY_EXTRA_TYPE
yyget_extra (void );
595 void yyset_extra (YY_EXTRA_TYPE user_defined
);
597 FILE *yyget_in (void );
599 void yyset_in (FILE * in_str
);
601 FILE *yyget_out (void );
603 void yyset_out (FILE * out_str
);
605 yy_size_t
yyget_leng (void );
607 char *yyget_text (void );
609 int yyget_lineno (void );
611 void yyset_lineno (int line_number
);
613 /* Macros after this point can all be overridden by user definitions in
617 #ifndef YY_SKIP_YYWRAP
619 extern "C" int yywrap (void );
621 extern int yywrap (void );
626 static void yy_flex_strncpy (char *,yyconst
char *,int );
629 #ifdef YY_NEED_STRLEN
630 static int yy_flex_strlen (yyconst
char * );
636 static int yyinput (void );
638 static int input (void );
643 /* Amount of stuff to slurp up with each read. */
644 #ifndef YY_READ_BUF_SIZE
645 #define YY_READ_BUF_SIZE 8192
648 /* Copy whatever the last rule matched to the standard output. */
650 /* This used to be an fputs(), but since the string might contain NUL's,
651 * we now use fwrite().
653 #define ECHO fwrite( yytext, yyleng, 1, yyout )
656 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
657 * is returned in "result".
660 #define YY_INPUT(buf,result,max_size) \
661 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
665 for ( n = 0; n < max_size && \
666 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
669 buf[n++] = (char) c; \
670 if ( c == EOF && ferror( yyin ) ) \
671 YY_FATAL_ERROR( "input in flex scanner failed" ); \
677 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
679 if( errno != EINTR) \
681 YY_FATAL_ERROR( "input in flex scanner failed" ); \
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.
697 #define yyterminate() return YY_NULL
700 /* Number of entries by which start-condition stack grows. */
701 #ifndef YY_START_STACK_INCR
702 #define YY_START_STACK_INCR 25
705 /* Report a fatal error. */
706 #ifndef YY_FATAL_ERROR
707 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
710 /* end tables serialization structures and prototypes */
712 /* Default declaration of generated scanner - a define so the user can
713 * easily add parameters.
716 #define YY_DECL_IS_OURS 1
718 extern int yylex (void);
720 #define YY_DECL int yylex (void)
721 #endif /* !YY_DECL */
723 /* Code executed at the beginning of each rule, after yytext and yyleng
726 #ifndef YY_USER_ACTION
727 #define YY_USER_ACTION
730 /* Code executed at the end of each rule. */
732 #define YY_BREAK break;
735 #define YY_RULE_SETUP \
738 /** The main scanner function which does all the work.
742 register yy_state_type yy_current_state
;
743 register char *yy_cp
, *yy_bp
;
746 #line 83 "ircd_lexer.l"
748 #line 751 "ircd_lexer.c"
759 (yy_start
) = 1; /* first start state */
767 if ( ! YY_CURRENT_BUFFER
) {
768 yyensure_buffer_stack ();
769 YY_CURRENT_BUFFER_LVALUE
=
770 yy_create_buffer(yyin
,YY_BUF_SIZE
);
773 yy_load_buffer_state( );
776 while ( 1 ) /* loops until end-of-file is reached */
779 if ( (yy_more_flag
) )
781 (yy_more_len
) = (yy_c_buf_p
) - (yytext_ptr
);
784 yy_cp
= (yy_c_buf_p
);
786 /* Support of yytext. */
787 *yy_cp
= (yy_hold_char
);
789 /* yy_bp points to the position in yy_ch_buf of the start of
794 yy_current_state
= (yy_start
);
798 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
799 if ( yy_accept
[yy_current_state
] )
801 (yy_last_accepting_state
) = yy_current_state
;
802 (yy_last_accepting_cpos
) = yy_cp
;
804 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
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
];
810 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
813 while ( yy_base
[yy_current_state
] != 104 );
816 yy_act
= yy_accept
[yy_current_state
];
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
];
826 do_action
: /* This label is used only to access EOF actions. */
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
);
839 #line 84 "ircd_lexer.l"
844 #line 85 "ircd_lexer.l"
848 /* rule 3 can match eol */
850 #line 86 "ircd_lexer.l"
851 { strcpy(linebuf
, yytext
+1); lineno
++; yyless(1); }
855 #line 88 "ircd_lexer.l"
860 #line 89 "ircd_lexer.l"
865 #line 91 "ircd_lexer.l"
866 { yylval
.number
= atoi(yytext
); return NUMBER
; }
869 /* rule 7 can match eol */
871 #line 93 "ircd_lexer.l"
873 if(yytext
[yyleng
-2] == '\\')
875 yyless(yyleng
-1); /* return last quote */
876 yymore(); /* append next string */
880 strcpy(yylval
.string
, yytext
+ 1);
881 if(yylval
.string
[yyleng
-2] != '"')
882 ilog(L_MAIN
, "Unterminated character string");
886 yylval
.string
[yyleng
-2] = '\0'; /* remove close
890 for (j
=i
=0 ;yylval
.string
[i
] != '\0'; i
++,j
++)
892 if (yylval
.string
[i
] != '\\')
894 yylval
.string
[j
] = yylval
.string
[i
];
899 if (yylval
.string
[i
] == '\0') /* XXX
905 "Unterminated character string");
908 yylval
.string
[j
] = yylval
.string
[i
];
911 yylval
.string
[j
] = '\0';
919 #line 139 "ircd_lexer.l"
920 { return LOADMODULE
; }
924 #line 140 "ircd_lexer.l"
926 strcpy(yylval
.string
, yytext
);
927 yylval
.string
[yyleng
] = '\0';
933 #line 146 "ircd_lexer.l"
938 #line 147 "ircd_lexer.l"
939 { return yytext
[0]; }
941 case YY_STATE_EOF(INITIAL
):
942 #line 148 "ircd_lexer.l"
943 { if (ieof()) yyterminate(); }
947 #line 149 "ircd_lexer.l"
950 #line 953 "ircd_lexer.c"
952 case YY_END_OF_BUFFER
:
954 /* Amount of text matched not including the EOB char. */
955 int yy_amount_of_matched_text
= (int) (yy_cp
- (yytext_ptr
)) - 1;
957 /* Undo the effects of YY_DO_BEFORE_ACTION. */
958 *yy_cp
= (yy_hold_char
);
959 YY_RESTORE_YY_MORE_OFFSET
961 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
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.
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
;
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
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
;
988 (yy_c_buf_p
) = (yytext_ptr
) + yy_amount_of_matched_text
;
990 yy_current_state
= yy_get_previous_state( );
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).
1001 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1003 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1005 if ( yy_next_state
)
1007 /* Consume the NUL. */
1008 yy_cp
= ++(yy_c_buf_p
);
1009 yy_current_state
= yy_next_state
;
1015 yy_cp
= (yy_c_buf_p
);
1016 goto yy_find_action
;
1020 else switch ( yy_get_next_buffer( ) )
1022 case EOB_ACT_END_OF_FILE
:
1024 (yy_did_buffer_switch_on_eof
) = 0;
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.
1037 (yy_c_buf_p
) = (yytext_ptr
) + YY_MORE_ADJ
;
1039 yy_act
= YY_STATE_EOF(YY_START
);
1045 if ( ! (yy_did_buffer_switch_on_eof
) )
1051 case EOB_ACT_CONTINUE_SCAN
:
1053 (yytext_ptr
) + yy_amount_of_matched_text
;
1055 yy_current_state
= yy_get_previous_state( );
1057 yy_cp
= (yy_c_buf_p
);
1058 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1061 case EOB_ACT_LAST_MATCH
:
1063 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)];
1065 yy_current_state
= yy_get_previous_state( );
1067 yy_cp
= (yy_c_buf_p
);
1068 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1069 goto yy_find_action
;
1076 "fatal flex scanner internal error--no action found" );
1077 } /* end of action switch */
1078 } /* end of scanning one token */
1079 } /* end of yylex */
1081 /* yy_get_next_buffer - try to read in a new buffer
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
1088 static int yy_get_next_buffer (void)
1090 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1091 register char *source
= (yytext_ptr
);
1092 register int number_to_move
, i
;
1095 if ( (yy_c_buf_p
) > &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] )
1097 "fatal flex scanner internal error--end of buffer missed" );
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 )
1103 /* We matched a single character, the EOB, so
1104 * treat this as a final EOF.
1106 return EOB_ACT_END_OF_FILE
;
1111 /* We matched some text prior to the EOB, first
1114 return EOB_ACT_LAST_MATCH
;
1118 /* Try to read more data. */
1120 /* First move last chars to start of buffer. */
1121 number_to_move
= (int) ((yy_c_buf_p
) - (yytext_ptr
)) - 1;
1123 for ( i
= 0; i
< number_to_move
; ++i
)
1124 *(dest
++) = *(source
++);
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,
1130 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
) = 0;
1134 yy_size_t num_to_read
=
1135 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1137 while ( num_to_read
<= 0 )
1138 { /* Not enough room in the buffer - grow it. */
1140 /* just a shorter name for the current buffer */
1141 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1143 int yy_c_buf_p_offset
=
1144 (int) ((yy_c_buf_p
) - b
->yy_ch_buf
);
1146 if ( b
->yy_is_our_buffer
)
1148 yy_size_t new_size
= b
->yy_buf_size
* 2;
1150 if ( new_size
<= 0 )
1151 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1153 b
->yy_buf_size
*= 2;
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 );
1160 /* Can't grow it, we don't own it. */
1163 if ( ! b
->yy_ch_buf
)
1165 "fatal error - scanner input buffer overflow" );
1167 (yy_c_buf_p
) = &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1169 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1174 if ( num_to_read
> YY_READ_BUF_SIZE
)
1175 num_to_read
= YY_READ_BUF_SIZE
;
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
);
1181 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1184 if ( (yy_n_chars
) == 0 )
1186 if ( number_to_move
== YY_MORE_ADJ
)
1188 ret_val
= EOB_ACT_END_OF_FILE
;
1194 ret_val
= EOB_ACT_LAST_MATCH
;
1195 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1196 YY_BUFFER_EOF_PENDING
;
1201 ret_val
= EOB_ACT_CONTINUE_SCAN
;
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()" );
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
;
1215 (yytext_ptr
) = &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1220 /* yy_get_previous_state - get the state just before the EOB char was reached */
1222 static yy_state_type
yy_get_previous_state (void)
1224 register yy_state_type yy_current_state
;
1225 register char *yy_cp
;
1227 yy_current_state
= (yy_start
);
1229 for ( yy_cp
= (yytext_ptr
) + YY_MORE_ADJ
; yy_cp
< (yy_c_buf_p
); ++yy_cp
)
1231 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1232 if ( yy_accept
[yy_current_state
] )
1234 (yy_last_accepting_state
) = yy_current_state
;
1235 (yy_last_accepting_cpos
) = yy_cp
;
1237 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
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
];
1243 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1246 return yy_current_state
;
1249 /* yy_try_NUL_trans - try to make a transition on the NUL character
1252 * next_state = yy_try_NUL_trans( current_state );
1254 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
)
1256 register int yy_is_jam
;
1257 register char *yy_cp
= (yy_c_buf_p
);
1259 register YY_CHAR yy_c
= 1;
1260 if ( yy_accept
[yy_current_state
] )
1262 (yy_last_accepting_state
) = yy_current_state
;
1263 (yy_last_accepting_cpos
) = yy_cp
;
1265 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
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
];
1271 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1272 yy_is_jam
= (yy_current_state
== 46);
1274 return yy_is_jam
? 0 : yy_current_state
;
1279 static int yyinput (void)
1281 static int input (void)
1287 *(yy_c_buf_p
) = (yy_hold_char
);
1289 if ( *(yy_c_buf_p
) == YY_END_OF_BUFFER_CHAR
)
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.
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';
1300 { /* need more input */
1301 yy_size_t offset
= (yy_c_buf_p
) - (yytext_ptr
);
1304 switch ( yy_get_next_buffer( ) )
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.
1317 /* Reset buffer status. */
1322 case EOB_ACT_END_OF_FILE
:
1327 if ( ! (yy_did_buffer_switch_on_eof
) )
1336 case EOB_ACT_CONTINUE_SCAN
:
1337 (yy_c_buf_p
) = (yytext_ptr
) + offset
;
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
);
1349 #endif /* ifndef YY_NO_INPUT */
1351 /** Immediately switch to a different input stream.
1352 * @param input_file A readable stream.
1354 * @note This function does not reset the start condition to @c INITIAL .
1356 void yyrestart (FILE * input_file
)
1359 if ( ! YY_CURRENT_BUFFER
){
1360 yyensure_buffer_stack ();
1361 YY_CURRENT_BUFFER_LVALUE
=
1362 yy_create_buffer(yyin
,YY_BUF_SIZE
);
1365 yy_init_buffer(YY_CURRENT_BUFFER
,input_file
);
1366 yy_load_buffer_state( );
1369 /** Switch to a different input buffer.
1370 * @param new_buffer The new input buffer.
1373 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
)
1376 /* TODO. We should be able to replace this entire function body
1378 * yypop_buffer_state();
1379 * yypush_buffer_state(new_buffer);
1381 yyensure_buffer_stack ();
1382 if ( YY_CURRENT_BUFFER
== new_buffer
)
1385 if ( YY_CURRENT_BUFFER
)
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
);
1393 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1394 yy_load_buffer_state( );
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.
1401 (yy_did_buffer_switch_on_eof
) = 1;
1404 static void yy_load_buffer_state (void)
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
);
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.
1416 * @return the allocated buffer state.
1418 YY_BUFFER_STATE
yy_create_buffer (FILE * file
, int size
)
1422 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) );
1424 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1426 b
->yy_buf_size
= size
;
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.
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()" );
1435 b
->yy_is_our_buffer
= 1;
1437 yy_init_buffer(b
,file
);
1442 /** Destroy the buffer.
1443 * @param b a buffer created with yy_create_buffer()
1446 void yy_delete_buffer (YY_BUFFER_STATE b
)
1452 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1453 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1455 if ( b
->yy_is_our_buffer
)
1456 yyfree((void *) b
->yy_ch_buf
);
1458 yyfree((void *) b
);
1462 extern int isatty (int );
1463 #endif /* __cplusplus */
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.
1469 static void yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
)
1474 yy_flush_buffer(b
);
1476 b
->yy_input_file
= file
;
1477 b
->yy_fill_buffer
= 1;
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.
1483 if (b
!= YY_CURRENT_BUFFER
){
1484 b
->yy_bs_lineno
= 1;
1485 b
->yy_bs_column
= 0;
1488 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
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.
1497 void yy_flush_buffer (YY_BUFFER_STATE b
)
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.
1508 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1509 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1511 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1514 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1516 if ( b
== YY_CURRENT_BUFFER
)
1517 yy_load_buffer_state( );
1520 /** Pushes the new state onto the stack. The new state becomes
1521 * the current state. This function will allocate the stack
1523 * @param new_buffer The new state.
1526 void yypush_buffer_state (YY_BUFFER_STATE new_buffer
)
1528 if (new_buffer
== NULL
)
1531 yyensure_buffer_stack();
1533 /* This block is copied from yy_switch_to_buffer. */
1534 if ( YY_CURRENT_BUFFER
)
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
);
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
;
1547 /* copied from yy_switch_to_buffer. */
1548 yy_load_buffer_state( );
1549 (yy_did_buffer_switch_on_eof
) = 1;
1552 /** Removes and deletes the top of the stack, if present.
1553 * The next element becomes the new top.
1556 void yypop_buffer_state (void)
1558 if (!YY_CURRENT_BUFFER
)
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
);
1566 if (YY_CURRENT_BUFFER
) {
1567 yy_load_buffer_state( );
1568 (yy_did_buffer_switch_on_eof
) = 1;
1572 /* Allocates the stack if it does not exist.
1573 * Guarantees space for at least one push.
1575 static void yyensure_buffer_stack (void)
1577 yy_size_t num_to_alloc
;
1579 if (!(yy_buffer_stack
)) {
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.
1586 (yy_buffer_stack
) = (struct yy_buffer_state
**)yyalloc
1587 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1589 if ( ! (yy_buffer_stack
) )
1590 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1592 memset((yy_buffer_stack
), 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1594 (yy_buffer_stack_max
) = num_to_alloc
;
1595 (yy_buffer_stack_top
) = 0;
1599 if ((yy_buffer_stack_top
) >= ((yy_buffer_stack_max
)) - 1){
1601 /* Increase the buffer to prepare for a possible push. */
1602 int grow_size
= 8 /* arbitrary grow size */;
1604 num_to_alloc
= (yy_buffer_stack_max
) + grow_size
;
1605 (yy_buffer_stack
) = (struct yy_buffer_state
**)yyrealloc
1607 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1609 if ( ! (yy_buffer_stack
) )
1610 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
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
;
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
1622 * @return the newly allocated buffer state object.
1624 YY_BUFFER_STATE
yy_scan_buffer (char * base
, yy_size_t size
)
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. */
1634 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) );
1636 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
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;
1645 b
->yy_fill_buffer
= 0;
1646 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1648 yy_switch_to_buffer(b
);
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
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.
1661 YY_BUFFER_STATE
yy_scan_string (yyconst
char * yystr
)
1664 return yy_scan_bytes(yystr
,strlen(yystr
) );
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.
1672 * @return the newly allocated buffer state object.
1674 YY_BUFFER_STATE
yy_scan_bytes (yyconst
char * yybytes
, yy_size_t _yybytes_len
)
1680 /* Get memory for full buffer, including space for trailing EOB's. */
1681 n
= _yybytes_len
+ 2;
1682 buf
= (char *) yyalloc(n
);
1684 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1686 for ( i
= 0; i
< _yybytes_len
; ++i
)
1687 buf
[i
] = yybytes
[i
];
1689 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1691 b
= yy_scan_buffer(buf
,n
);
1693 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1695 /* It's okay to grow etc. this buffer, and we should throw it
1696 * away when we're done.
1698 b
->yy_is_our_buffer
= 1;
1703 #ifndef YY_EXIT_FAILURE
1704 #define YY_EXIT_FAILURE 2
1707 static void yy_fatal_error (yyconst
char* msg
)
1709 (void) fprintf( stderr
, "%s\n", msg
);
1710 exit( YY_EXIT_FAILURE
);
1713 /* Redefine yyless() so it works in section 3 code. */
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; \
1730 /* Accessor methods (get/set functions) to struct members. */
1732 /** Get the current line number.
1735 int yyget_lineno (void)
1741 /** Get the input stream.
1744 FILE *yyget_in (void)
1749 /** Get the output stream.
1752 FILE *yyget_out (void)
1757 /** Get the length of the current token.
1760 yy_size_t
yyget_leng (void)
1765 /** Get the current token.
1769 char *yyget_text (void)
1774 /** Set the current line number.
1775 * @param line_number
1778 void yyset_lineno (int line_number
)
1781 yylineno
= line_number
;
1784 /** Set the input stream. This does not discard the current
1786 * @param in_str A readable stream.
1788 * @see yy_switch_to_buffer
1790 void yyset_in (FILE * in_str
)
1795 void yyset_out (FILE * out_str
)
1800 int yyget_debug (void)
1802 return yy_flex_debug
;
1805 void yyset_debug (int bdebug
)
1807 yy_flex_debug
= bdebug
;
1810 static int yy_init_globals (void)
1812 /* Initialization is the same as for the non-reentrant scanner.
1813 * This function is called from yylex_destroy(), so don't allocate here.
1816 (yy_buffer_stack
) = 0;
1817 (yy_buffer_stack_top
) = 0;
1818 (yy_buffer_stack_max
) = 0;
1819 (yy_c_buf_p
) = (char *) 0;
1823 /* Defined in main.c */
1832 /* For future reference: Set errno on error, since we are called by
1838 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1839 int yylex_destroy (void)
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();
1849 /* Destroy the stack itself. */
1850 yyfree((yy_buffer_stack
) );
1851 (yy_buffer_stack
) = NULL
;
1853 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1854 * yylex() is called, initialization will occur. */
1861 * Internal utility routines.
1865 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
)
1868 for ( i
= 0; i
< n
; ++i
)
1873 #ifdef YY_NEED_STRLEN
1874 static int yy_flex_strlen (yyconst
char * s
)
1877 for ( n
= 0; s
[n
]; ++n
)
1884 void *yyalloc (yy_size_t size
)
1886 return (void *) malloc( size
);
1889 void *yyrealloc (void * ptr
, yy_size_t size
)
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.
1898 return (void *) realloc( (char *) ptr
, size
);
1901 void yyfree (void * ptr
)
1903 free( (char *) ptr
); /* see yyrealloc() for (char *) cast */
1906 #define YYTABLES_NAME "yytables"
1908 #line 149 "ircd_lexer.l"
1912 /* C-comment ignoring routine -kre*/
1917 /* log(L_NOTICE, "got comment"); */
1920 while ((c
= input()) != '*' && c
!= EOF
)
1921 if (c
== '\n') ++lineno
;
1924 while ((c
= input()) == '*');
1927 if (c
== '\n') ++lineno
;
1931 YY_FATAL_ERROR("EOF in comment");
1932 /* XXX hack alert this disables
1933 * the stupid unused function warning
1936 yy_fatal_error("EOF in comment");
1945 if ((c
= strchr(yytext
, '<')) == NULL
)
1946 *strchr(c
= strchr(yytext
, '"') + 1, '"') = 0;
1948 *strchr(++c
, '>') = 0;
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
);
1955 FILE *tmp_fbfile_in
;
1957 tmp_fbfile_in
= fopen(c
, "r");
1959 if (tmp_fbfile_in
== NULL
)
1961 /* if its not found in PREFIX, look in ETCPATH */
1962 char fnamebuf
[IRCD_BUFSIZE
];
1964 snprintf(fnamebuf
, sizeof(fnamebuf
), "%s/%s", ETCPATH
, c
);
1965 tmp_fbfile_in
= fopen(fnamebuf
, "r");
1967 /* wasnt found there either.. error. */
1968 if(tmp_fbfile_in
== NULL
)
1970 conf_report_error("Include %s: %s.", c
, strerror(errno
));
1974 lineno_stack
[include_stack_ptr
] = lineno
;
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
));
1987 if (include_stack_ptr
)
1988 fclose(conf_fbfile_in
);
1989 if (--include_stack_ptr
< 0)
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;
1998 yy_delete_buffer(YY_CURRENT_BUFFER
);
1999 lineno
= lineno_stack
[include_stack_ptr
];
2000 conf_fbfile_in
= inc_fbfile_in
[include_stack_ptr
];
2002 if(include_stack_ptr
)
2003 current_file
= conffile_stack
[include_stack_ptr
];
2005 current_file
= conffilebuf
;
2007 yy_switch_to_buffer(include_stack
[include_stack_ptr
]);
2011 /* #-comment style, look for #include */
2012 #define INCLUDE "#include"
2014 void hashcomment(void)
2016 if (strlen(yytext
) < sizeof(INCLUDE
) - 1)
2019 if (!strncasecmp(yytext
, INCLUDE
, sizeof(INCLUDE
) - 1))
2020 yyerror("You probably meant '.include', skipping");