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;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
57 /* Limits of integral types. */
59 #define INT8_MIN (-128)
62 #define INT16_MIN (-32767-1)
65 #define INT32_MIN (-2147483647-1)
68 #define INT8_MAX (127)
71 #define INT16_MAX (32767)
74 #define INT32_MAX (2147483647)
77 #define UINT8_MAX (255U)
80 #define UINT16_MAX (65535U)
83 #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. */
145 /* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
149 #define YY_BUF_SIZE 32768
151 #define YY_BUF_SIZE 16384
152 #endif /* __ia64__ */
155 /* The state buf must be large enough to hold one state per character in the main buffer.
157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
160 #define YY_TYPEDEF_YY_BUFFER_STATE
161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
166 extern FILE *yyin, *yyout;
168 #define EOB_ACT_CONTINUE_SCAN 0
169 #define EOB_ACT_END_OF_FILE 1
170 #define EOB_ACT_LAST_MATCH 2
172 #define YY_LESS_LINENO(n)
174 /* Return all but the first "n" matched characters back to the input stream. */
178 /* Undo effects of setting up yytext. */ \
179 int yyless_macro_arg = (n); \
180 YY_LESS_LINENO(yyless_macro_arg);\
181 *yy_cp = (yy_hold_char); \
182 YY_RESTORE_YY_MORE_OFFSET \
183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
184 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
188 #define unput(c) yyunput( c, (yytext_ptr) )
190 #ifndef YY_TYPEDEF_YY_SIZE_T
191 #define YY_TYPEDEF_YY_SIZE_T
192 typedef size_t yy_size_t;
195 #ifndef YY_STRUCT_YY_BUFFER_STATE
196 #define YY_STRUCT_YY_BUFFER_STATE
197 struct yy_buffer_state
201 char *yy_ch_buf; /* input buffer */
202 char *yy_buf_pos; /* current position in input buffer */
204 /* Size of input buffer in bytes, not including room for EOB
207 yy_size_t yy_buf_size;
209 /* Number of characters read into yy_ch_buf, not including EOB
214 /* Whether we "own" the buffer - i.e., we know we created it,
215 * and can realloc() it to grow it, and should free() it to
218 int yy_is_our_buffer;
220 /* Whether this is an "interactive" input source; if so, and
221 * if we're using stdio for input, then we want to use getc()
222 * instead of fread(), to make sure we stop fetching input after
225 int yy_is_interactive;
227 /* Whether we're considered to be at the beginning of a line.
228 * If so, '^' rules will be active on the next match, otherwise
233 int yy_bs_lineno; /**< The line count. */
234 int yy_bs_column; /**< The column count. */
236 /* Whether to try to fill the input buffer when we reach the
241 int yy_buffer_status;
243 #define YY_BUFFER_NEW 0
244 #define YY_BUFFER_NORMAL 1
245 /* When an EOF's been seen but there's still some text to process
246 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
247 * shouldn't try reading from the input source any more. We might
248 * still have a bunch of tokens to match, though, because of
249 * possible backing-up.
251 * When we actually see the EOF, we change the status to "new"
252 * (via yyrestart()), so that the user can continue scanning by
253 * just pointing yyin at a new input file.
255 #define YY_BUFFER_EOF_PENDING 2
258 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
260 /* Stack of input buffers. */
261 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
262 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
263 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
265 /* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
269 * Returns the top of the stack, or NULL.
271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
275 /* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
280 /* yy_hold_char holds the character lost when yytext is formed. */
281 static char yy_hold_char;
282 static int yy_n_chars; /* number of characters read into yy_ch_buf */
285 /* Points to current character in buffer. */
286 static char *yy_c_buf_p = (char *) 0;
287 static int yy_init = 0; /* whether we need to initialize */
288 static int yy_start = 0; /* start state number */
290 /* Flag which is used to allow yywrap()'s to do buffer switches
291 * instead of setting up a fresh yyin. A bit of a hack ...
293 static int yy_did_buffer_switch_on_eof;
295 void yyrestart (FILE *input_file );
296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
298 void yy_delete_buffer (YY_BUFFER_STATE b );
299 void yy_flush_buffer (YY_BUFFER_STATE b );
300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301 void yypop_buffer_state (void );
303 static void yyensure_buffer_stack (void );
304 static void yy_load_buffer_state (void );
305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
309 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
310 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
311 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
313 void *yyalloc (yy_size_t );
314 void *yyrealloc (void *,yy_size_t );
315 void yyfree (void * );
317 #define yy_new_buffer yy_create_buffer
319 #define yy_set_interactive(is_interactive) \
321 if ( ! YY_CURRENT_BUFFER ){ \
322 yyensure_buffer_stack (); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
329 #define yy_set_bol(at_bol) \
331 if ( ! YY_CURRENT_BUFFER ){\
332 yyensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 yy_create_buffer(yyin,YY_BUF_SIZE ); \
336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
341 typedef unsigned char YY_CHAR;
343 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
345 typedef int yy_state_type;
352 #define yytext_ptr yytext
354 static yy_state_type yy_get_previous_state (void );
355 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
356 static int yy_get_next_buffer (void );
357 static void yy_fatal_error (yyconst char msg[] );
359 /* Done after the current pattern has been matched and before the
360 * corresponding action - sets up yytext.
362 #define YY_DO_BEFORE_ACTION \
363 (yytext_ptr) = yy_bp; \
364 yyleng = (size_t) (yy_cp - yy_bp); \
365 (yy_hold_char) = *yy_cp; \
367 (yy_c_buf_p) = yy_cp;
369 #define YY_NUM_RULES 8
370 #define YY_END_OF_BUFFER 9
371 /* This struct is not used in this scanner,
372 but its presence is necessary. */
375 flex_int32_t yy_verify;
378 static yyconst flex_int16_t yy_acclist[25] =
380 9, 7, 8, 3, 7, 8, 6, 8, 7, 8,
381 4, 7, 8, 2, 7, 8, 5, 7, 8, 3,
385 static yyconst flex_int16_t yy_accept[19] =
387 1, 1, 1, 2, 4, 7, 9, 11, 14, 17,
388 20, 21, 21, 22, 23, 24, 25, 25
391 static yyconst flex_int32_t yy_ec[256] =
393 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
394 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 6, 6, 6,
398 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
399 1, 1, 1, 1, 7, 7, 7, 7, 7, 7,
400 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
401 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
402 1, 1, 1, 1, 7, 1, 7, 7, 7, 7,
404 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
405 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
406 7, 7, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 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,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 static yyconst flex_int32_t yy_meta[8] =
428 static yyconst flex_int16_t yy_base[21] =
430 0, 0, 20, 21, 17, 21, 0, 0, 12, 0,
431 13, 5, 0, 6, 0, 21, 21, 9, 13, 7
434 static yyconst flex_int16_t yy_def[21] =
436 17, 1, 17, 17, 17, 17, 18, 19, 17, 20,
437 17, 18, 19, 17, 20, 17, 0, 17, 17, 17
440 static yyconst flex_int16_t yy_nxt[29] =
442 4, 5, 6, 7, 8, 9, 10, 16, 16, 12,
443 15, 14, 12, 13, 11, 13, 13, 14, 11, 17,
444 3, 17, 17, 17, 17, 17, 17, 17
447 static yyconst flex_int16_t yy_chk[29] =
449 1, 1, 1, 1, 1, 1, 1, 12, 12, 18,
450 20, 14, 18, 19, 11, 19, 19, 9, 5, 3,
451 17, 17, 17, 17, 17, 17, 17, 17
454 extern int yy_flex_debug;
455 int yy_flex_debug = 0;
457 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
458 static char *yy_full_match;
462 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
463 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
468 #define yymore() yymore_used_but_not_detected
469 #define YY_MORE_ADJ 0
470 #define YY_RESTORE_YY_MORE_OFFSET
472 #line 1 "./ircd_lexer.l"
474 * ircd_lexer.l: A lexical scanner for ircd config files.
475 * This is part of ircu, an Internet Relay Chat server.
476 * The contents of this file are Copyright(C) 2001 by Andrew Miller, the
477 * ircd-hybrid team and the ircu team.
478 * This program is free software; you can redistribute it and/or modify
479 * it under the terms of the GNU General Public License as published by
480 * the Free Software Foundation; either version 2 of the License, or
481 * (at your option) any later version.
483 * This program is distributed in the hope that it will be useful,
484 * but WITHOUT ANY WARRANTY; without even the implied warranty of
485 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
486 * GNU General Public License for more details.
488 * You should have received a copy of the GNU General Public License
489 * along with this program; if not, write to the Free Software
490 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
492 * $Id: ircd_lexer.l 1851 2007-11-30 22:10:04Z klmitch $
494 #line 24 "./ircd_lexer.l"
502 #include "ircd_alloc.h"
503 #include "ircd_string.h"
509 static struct lexer_token {
513 #define TOKEN(NAME) { #NAME, NAME }
588 { "administrator", ADMIN },
589 { "apass_opmode", TPRIV_APASS_OPMODE },
590 { "auto", AUTOCONNECT },
592 { "badchan", TPRIV_BADCHAN },
593 { "chan_limit", TPRIV_CHAN_LIMIT },
594 { "deop_lchan", TPRIV_DEOP_LCHAN },
595 { "die", TPRIV_DIE },
596 { "display", TPRIV_DISPLAY },
598 { "force_local_opmode", TPRIV_FORCE_LOCAL_OPMODE },
599 { "force_opmode", TPRIV_FORCE_OPMODE },
601 { "gigabytes", GBYTES },
602 { "gline", TPRIV_GLINE },
603 #ifdef OLD_OGN_IRCU_COMPAT
604 { "hide_channels", TPRIV_UMODE_NOCHAN },
605 { "hide_idletime", TPRIV_UMODE_NOIDLE },
607 { "umode_nochan", TPRIV_UMODE_NOCHAN },
608 { "umode_noidle", TPRIV_UMODE_NOIDLE },
609 { "extra_hide_idletime", TPRIV_HIDE_IDLETIME },
610 #ifndef OLD_OGN_IRCU_COMPAT
611 { "hide_idletime", TPRIV_HIDE_IDLETIME },
613 { "ipv4", TOK_IPV4 },
614 { "ipv6", TOK_IPV6 },
616 { "kilobytes", KBYTES },
617 { "list_chan", TPRIV_LIST_CHAN },
618 { "local_badchan", TPRIV_LOCAL_BADCHAN },
619 { "local_gline", TPRIV_LOCAL_GLINE },
620 { "local_jupe", TPRIV_LOCAL_JUPE },
621 { "local_kill", TPRIV_LOCAL_KILL },
622 { "local_opmode", TPRIV_LOCAL_OPMODE },
623 { "maxchans", MAXCHANS },
625 { "megabytes", MBYTES },
626 { "mode_lchan", TPRIV_MODE_LCHAN },
627 { "more_flood", TPRIV_HALFFLOOD },
628 { "noamsg_override", TPRIV_NOAMSG_OVERRIDE },
629 { "operator", OPER },
630 { "opmode", TPRIV_OPMODE },
631 { "password", PASS },
632 { "propagate", TPRIV_PROPAGATE },
633 { "realname", REAL },
634 { "rehash", TPRIV_REHASH },
635 { "restart", TPRIV_RESTART },
636 { "see_chan", TPRIV_SEE_CHAN },
637 { "see_idletime", TPRIV_SEE_IDLETIME },
638 { "see_opers", TPRIV_SEE_OPERS },
639 { "set", TPRIV_SET },
640 { "show_all_invis", TPRIV_SHOW_ALL_INVIS },
641 { "show_invis", TPRIV_SHOW_INVIS },
642 #ifdef OLD_OGN_IRCU_COMPAT
643 { "targetchange", TPRIV_UNLIMITED_TARGET },
645 { "unlimited_targets", TPRIV_UNLIMITED_TARGET },
647 { "terabytes", TBYTES },
648 { "umode_chserv", TPRIV_UMODE_CHSERV },
649 { "umode_xtraop", TPRIV_UMODE_XTRAOP },
650 { "umode_netserv", TPRIV_UMODE_NETSERV },
651 { "umode_overridecc", TPRIV_UMODE_OVERRIDECC },
652 { "unlimit_query", TPRIV_UNLIMIT_QUERY },
653 { "unlimited_flood", TPRIV_FLOOD },
654 { "walk_lchan", TPRIV_WALK_LCHAN },
655 { "wide_gline", TPRIV_WIDE_GLINE },
656 { "whox", TPRIV_WHOX },
662 token_compare(const void *pa, const void *pb)
664 const struct lexer_token *ta = pa;
665 const struct lexer_token *tb = pb;
668 while (ta->string[ii] && (ToLower(ta->string[ii]) == ToLower(tb->string[ii])))
670 res = ToLower(tb->string[ii]) - ToLower(ta->string[ii]);
677 for (ntokens = 0; tokens[ntokens].string; ++ntokens) ;
678 qsort(tokens, ntokens, sizeof(tokens[0]), token_compare);
682 find_token(char *token)
684 struct lexer_token *tok;
687 tok = bsearch(&token, tokens, ntokens, sizeof(tokens[0]), token_compare);
688 return tok ? tok->value : 0;
691 static FBFILE *lexer_input;
694 #define YY_INPUT(buf, res, size) res = (fbgets(buf, size, lexer_input) ? strlen(buf) : 0)
699 lexer_input = fbopen(configfile, "r");
700 if (lexer_input == NULL)
702 #ifdef YY_FATAL_ERROR
703 YY_FATAL_ERROR("Could not open the configuration file.");
705 fprintf(stderr, "Could not open the configuration file.");
716 void deinit_lexer(void)
718 if (lexer_input != NULL)
720 fbclose(lexer_input);
735 #ifndef YY_NO_UNISTD_H
736 /* Special case for "unistd.h", since it is non-ANSI. We include it way
737 * down here because we want the user's section 1 to have been scanned first.
738 * The user has a chance to override it with an option.
743 #ifndef YY_EXTRA_TYPE
744 #define YY_EXTRA_TYPE void *
747 static int yy_init_globals (void );
749 /* Accessor methods to globals.
750 These are made visible to non-reentrant scanners for convenience. */
752 int yylex_destroy (void );
754 int yyget_debug (void );
756 void yyset_debug (int debug_flag );
758 YY_EXTRA_TYPE yyget_extra (void );
760 void yyset_extra (YY_EXTRA_TYPE user_defined );
762 FILE *yyget_in (void );
764 void yyset_in (FILE * in_str );
766 FILE *yyget_out (void );
768 void yyset_out (FILE * out_str );
770 int yyget_leng (void );
772 char *yyget_text (void );
774 int yyget_lineno (void );
776 void yyset_lineno (int line_number );
778 /* Macros after this point can all be overridden by user definitions in
782 #ifndef YY_SKIP_YYWRAP
784 extern "C" int yywrap (void );
786 extern int yywrap (void );
790 static void yyunput (int c,char *buf_ptr );
793 static void yy_flex_strncpy (char *,yyconst char *,int );
796 #ifdef YY_NEED_STRLEN
797 static int yy_flex_strlen (yyconst char * );
803 static int yyinput (void );
805 static int input (void );
810 /* Amount of stuff to slurp up with each read. */
811 #ifndef YY_READ_BUF_SIZE
813 /* On IA-64, the buffer size is 16k, not 8k */
814 #define YY_READ_BUF_SIZE 16384
816 #define YY_READ_BUF_SIZE 8192
817 #endif /* __ia64__ */
820 /* Copy whatever the last rule matched to the standard output. */
822 /* This used to be an fputs(), but since the string might contain NUL's,
823 * we now use fwrite().
825 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
828 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
829 * is returned in "result".
832 #define YY_INPUT(buf,result,max_size) \
833 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
837 for ( n = 0; n < max_size && \
838 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
841 buf[n++] = (char) c; \
842 if ( c == EOF && ferror( yyin ) ) \
843 YY_FATAL_ERROR( "input in flex scanner failed" ); \
849 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
851 if( errno != EINTR) \
853 YY_FATAL_ERROR( "input in flex scanner failed" ); \
864 /* No semi-colon after return; correct usage is to write "yyterminate();" -
865 * we don't want an extra ';' after the "return" because that will cause
866 * some compilers to complain about unreachable statements.
869 #define yyterminate() return YY_NULL
872 /* Number of entries by which start-condition stack grows. */
873 #ifndef YY_START_STACK_INCR
874 #define YY_START_STACK_INCR 25
877 /* Report a fatal error. */
878 #ifndef YY_FATAL_ERROR
879 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
882 /* end tables serialization structures and prototypes */
884 /* Default declaration of generated scanner - a define so the user can
885 * easily add parameters.
888 #define YY_DECL_IS_OURS 1
890 extern int yylex (void);
892 #define YY_DECL int yylex (void)
893 #endif /* !YY_DECL */
895 /* Code executed at the beginning of each rule, after yytext and yyleng
898 #ifndef YY_USER_ACTION
899 #define YY_USER_ACTION
902 /* Code executed at the end of each rule. */
904 #define YY_BREAK break;
907 #define YY_RULE_SETUP \
910 /** The main scanner function which does all the work.
914 register yy_state_type yy_current_state;
915 register char *yy_cp, *yy_bp;
918 #line 266 "./ircd_lexer.l"
931 /* Create the reject buffer large enough to save one state per allowed character. */
932 if ( ! (yy_state_buf) )
933 (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE );
934 if ( ! (yy_state_buf) )
935 YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
938 (yy_start) = 1; /* first start state */
946 if ( ! YY_CURRENT_BUFFER ) {
947 yyensure_buffer_stack ();
948 YY_CURRENT_BUFFER_LVALUE =
949 yy_create_buffer(yyin,YY_BUF_SIZE );
952 yy_load_buffer_state( );
955 while ( 1 ) /* loops until end-of-file is reached */
957 yy_cp = (yy_c_buf_p);
959 /* Support of yytext. */
960 *yy_cp = (yy_hold_char);
962 /* yy_bp points to the position in yy_ch_buf of the start of
967 yy_current_state = (yy_start);
969 (yy_state_ptr) = (yy_state_buf);
970 *(yy_state_ptr)++ = yy_current_state;
975 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
976 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
978 yy_current_state = (int) yy_def[yy_current_state];
979 if ( yy_current_state >= 18 )
980 yy_c = yy_meta[(unsigned int) yy_c];
982 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
983 *(yy_state_ptr)++ = yy_current_state;
986 while ( yy_base[yy_current_state] != 21 );
989 yy_current_state = *--(yy_state_ptr);
990 (yy_lp) = yy_accept[yy_current_state];
991 find_rule: /* we branch to this label when backing up */
992 for ( ; ; ) /* until we find what rule we matched */
994 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
996 yy_act = yy_acclist[(yy_lp)];
998 (yy_full_match) = yy_cp;
1003 yy_current_state = *--(yy_state_ptr);
1004 (yy_lp) = yy_accept[yy_current_state];
1007 YY_DO_BEFORE_ACTION;
1009 do_action: /* This label is used only to access EOF actions. */
1012 { /* beginning of action switch */
1014 /* rule 1 can match eol */
1016 #line 268 "./ircd_lexer.l"
1017 {yytext[yyleng-1] = 0; DupString(yylval.text, yytext+1); return QSTRING;}
1021 #line 269 "./ircd_lexer.l"
1022 {yylval.num = strtoul(yytext, NULL, 10); return NUMBER;}
1026 #line 270 "./ircd_lexer.l"
1031 #line 271 "./ircd_lexer.l"
1036 #line 273 "./ircd_lexer.l"
1037 { int res = find_token(yytext); if (res) return res; else REJECT; }
1040 /* rule 6 can match eol */
1042 #line 274 "./ircd_lexer.l"
1047 #line 275 "./ircd_lexer.l"
1052 #line 276 "./ircd_lexer.l"
1055 #line 1056 "lex.yy.c"
1056 case YY_STATE_EOF(INITIAL):
1059 case YY_END_OF_BUFFER:
1061 /* Amount of text matched not including the EOB char. */
1062 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1064 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1065 *yy_cp = (yy_hold_char);
1066 YY_RESTORE_YY_MORE_OFFSET
1068 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1070 /* We're scanning a new file or input source. It's
1071 * possible that this happened because the user
1072 * just pointed yyin at a new source and called
1073 * yylex(). If so, then we have to assure
1074 * consistency between YY_CURRENT_BUFFER and our
1075 * globals. Here is the right place to do so, because
1076 * this is the first action (other than possibly a
1077 * back-up) that will match for the new input source.
1079 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1080 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1081 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1084 /* Note that here we test for yy_c_buf_p "<=" to the position
1085 * of the first EOB in the buffer, since yy_c_buf_p will
1086 * already have been incremented past the NUL character
1087 * (since all states make transitions on EOB to the
1088 * end-of-buffer state). Contrast this with the test
1091 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1092 { /* This was really a NUL. */
1093 yy_state_type yy_next_state;
1095 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1097 yy_current_state = yy_get_previous_state( );
1099 /* Okay, we're now positioned to make the NUL
1100 * transition. We couldn't have
1101 * yy_get_previous_state() go ahead and do it
1102 * for us because it doesn't know how to deal
1103 * with the possibility of jamming (and we don't
1104 * want to build jamming into it because then it
1105 * will run more slowly).
1108 yy_next_state = yy_try_NUL_trans( yy_current_state );
1110 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1112 if ( yy_next_state )
1114 /* Consume the NUL. */
1115 yy_cp = ++(yy_c_buf_p);
1116 yy_current_state = yy_next_state;
1122 yy_cp = (yy_c_buf_p);
1123 goto yy_find_action;
1127 else switch ( yy_get_next_buffer( ) )
1129 case EOB_ACT_END_OF_FILE:
1131 (yy_did_buffer_switch_on_eof) = 0;
1135 /* Note: because we've taken care in
1136 * yy_get_next_buffer() to have set up
1137 * yytext, we can now set up
1138 * yy_c_buf_p so that if some total
1139 * hoser (like flex itself) wants to
1140 * call the scanner after we return the
1141 * YY_NULL, it'll still work - another
1142 * YY_NULL will get returned.
1144 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1146 yy_act = YY_STATE_EOF(YY_START);
1152 if ( ! (yy_did_buffer_switch_on_eof) )
1158 case EOB_ACT_CONTINUE_SCAN:
1160 (yytext_ptr) + yy_amount_of_matched_text;
1162 yy_current_state = yy_get_previous_state( );
1164 yy_cp = (yy_c_buf_p);
1165 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1168 case EOB_ACT_LAST_MATCH:
1170 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1172 yy_current_state = yy_get_previous_state( );
1174 yy_cp = (yy_c_buf_p);
1175 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1176 goto yy_find_action;
1183 "fatal flex scanner internal error--no action found" );
1184 } /* end of action switch */
1185 } /* end of scanning one token */
1186 } /* end of yylex */
1188 /* yy_get_next_buffer - try to read in a new buffer
1190 * Returns a code representing an action:
1191 * EOB_ACT_LAST_MATCH -
1192 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1193 * EOB_ACT_END_OF_FILE - end of file
1195 static int yy_get_next_buffer (void)
1197 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1198 register char *source = (yytext_ptr);
1199 register int number_to_move, i;
1202 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1204 "fatal flex scanner internal error--end of buffer missed" );
1206 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1207 { /* Don't try to fill the buffer, so this is an EOF. */
1208 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1210 /* We matched a single character, the EOB, so
1211 * treat this as a final EOF.
1213 return EOB_ACT_END_OF_FILE;
1218 /* We matched some text prior to the EOB, first
1221 return EOB_ACT_LAST_MATCH;
1225 /* Try to read more data. */
1227 /* First move last chars to start of buffer. */
1228 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1230 for ( i = 0; i < number_to_move; ++i )
1231 *(dest++) = *(source++);
1233 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1234 /* don't do the read, it's not guaranteed to return an EOF,
1237 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1242 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1244 while ( num_to_read <= 0 )
1245 { /* Not enough room in the buffer - grow it. */
1248 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1252 if ( num_to_read > YY_READ_BUF_SIZE )
1253 num_to_read = YY_READ_BUF_SIZE;
1255 /* Read in more data. */
1256 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1257 (yy_n_chars), (size_t) num_to_read );
1259 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1262 if ( (yy_n_chars) == 0 )
1264 if ( number_to_move == YY_MORE_ADJ )
1266 ret_val = EOB_ACT_END_OF_FILE;
1272 ret_val = EOB_ACT_LAST_MATCH;
1273 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1274 YY_BUFFER_EOF_PENDING;
1279 ret_val = EOB_ACT_CONTINUE_SCAN;
1281 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1282 /* Extend the array by 50%, plus the number we really need. */
1283 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1284 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1285 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1286 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1289 (yy_n_chars) += number_to_move;
1290 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1291 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1293 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1298 /* yy_get_previous_state - get the state just before the EOB char was reached */
1300 static yy_state_type yy_get_previous_state (void)
1302 register yy_state_type yy_current_state;
1303 register char *yy_cp;
1305 yy_current_state = (yy_start);
1307 (yy_state_ptr) = (yy_state_buf);
1308 *(yy_state_ptr)++ = yy_current_state;
1310 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1312 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1313 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1315 yy_current_state = (int) yy_def[yy_current_state];
1316 if ( yy_current_state >= 18 )
1317 yy_c = yy_meta[(unsigned int) yy_c];
1319 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1320 *(yy_state_ptr)++ = yy_current_state;
1323 return yy_current_state;
1326 /* yy_try_NUL_trans - try to make a transition on the NUL character
1329 * next_state = yy_try_NUL_trans( current_state );
1331 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1333 register int yy_is_jam;
1335 register YY_CHAR yy_c = 1;
1336 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1338 yy_current_state = (int) yy_def[yy_current_state];
1339 if ( yy_current_state >= 18 )
1340 yy_c = yy_meta[(unsigned int) yy_c];
1342 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1343 yy_is_jam = (yy_current_state == 17);
1345 *(yy_state_ptr)++ = yy_current_state;
1347 return yy_is_jam ? 0 : yy_current_state;
1350 static void yyunput (int c, register char * yy_bp )
1352 register char *yy_cp;
1354 yy_cp = (yy_c_buf_p);
1356 /* undo effects of setting up yytext */
1357 *yy_cp = (yy_hold_char);
1359 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1360 { /* need to shift things up to make room */
1361 /* +2 for EOB chars. */
1362 register int number_to_move = (yy_n_chars) + 2;
1363 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1364 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1365 register char *source =
1366 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1368 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1369 *--dest = *--source;
1371 yy_cp += (int) (dest - source);
1372 yy_bp += (int) (dest - source);
1373 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1374 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1376 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1377 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1380 *--yy_cp = (char) c;
1382 (yytext_ptr) = yy_bp;
1383 (yy_hold_char) = *yy_cp;
1384 (yy_c_buf_p) = yy_cp;
1389 static int yyinput (void)
1391 static int input (void)
1397 *(yy_c_buf_p) = (yy_hold_char);
1399 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1401 /* yy_c_buf_p now points to the character we want to return.
1402 * If this occurs *before* the EOB characters, then it's a
1403 * valid NUL; if not, then we've hit the end of the buffer.
1405 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1406 /* This was really a NUL. */
1407 *(yy_c_buf_p) = '\0';
1410 { /* need more input */
1411 int offset = (yy_c_buf_p) - (yytext_ptr);
1414 switch ( yy_get_next_buffer( ) )
1416 case EOB_ACT_LAST_MATCH:
1417 /* This happens because yy_g_n_b()
1418 * sees that we've accumulated a
1419 * token and flags that we need to
1420 * try matching the token before
1421 * proceeding. But for input(),
1422 * there's no matching to consider.
1423 * So convert the EOB_ACT_LAST_MATCH
1424 * to EOB_ACT_END_OF_FILE.
1427 /* Reset buffer status. */
1432 case EOB_ACT_END_OF_FILE:
1437 if ( ! (yy_did_buffer_switch_on_eof) )
1446 case EOB_ACT_CONTINUE_SCAN:
1447 (yy_c_buf_p) = (yytext_ptr) + offset;
1453 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1454 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1455 (yy_hold_char) = *++(yy_c_buf_p);
1459 #endif /* ifndef YY_NO_INPUT */
1461 /** Immediately switch to a different input stream.
1462 * @param input_file A readable stream.
1464 * @note This function does not reset the start condition to @c INITIAL .
1466 void yyrestart (FILE * input_file )
1469 if ( ! YY_CURRENT_BUFFER ){
1470 yyensure_buffer_stack ();
1471 YY_CURRENT_BUFFER_LVALUE =
1472 yy_create_buffer(yyin,YY_BUF_SIZE );
1475 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1476 yy_load_buffer_state( );
1479 /** Switch to a different input buffer.
1480 * @param new_buffer The new input buffer.
1483 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1486 /* TODO. We should be able to replace this entire function body
1488 * yypop_buffer_state();
1489 * yypush_buffer_state(new_buffer);
1491 yyensure_buffer_stack ();
1492 if ( YY_CURRENT_BUFFER == new_buffer )
1495 if ( YY_CURRENT_BUFFER )
1497 /* Flush out information for old buffer. */
1498 *(yy_c_buf_p) = (yy_hold_char);
1499 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1500 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1503 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1504 yy_load_buffer_state( );
1506 /* We don't actually know whether we did this switch during
1507 * EOF (yywrap()) processing, but the only time this flag
1508 * is looked at is after yywrap() is called, so it's safe
1509 * to go ahead and always set it.
1511 (yy_did_buffer_switch_on_eof) = 1;
1514 static void yy_load_buffer_state (void)
1516 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1517 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1518 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1519 (yy_hold_char) = *(yy_c_buf_p);
1522 /** Allocate and initialize an input buffer state.
1523 * @param file A readable stream.
1524 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1526 * @return the allocated buffer state.
1528 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1532 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1534 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1536 b->yy_buf_size = size;
1538 /* yy_ch_buf has to be 2 characters longer than the size given because
1539 * we need to put in 2 end-of-buffer characters.
1541 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1542 if ( ! b->yy_ch_buf )
1543 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1545 b->yy_is_our_buffer = 1;
1547 yy_init_buffer(b,file );
1552 /** Destroy the buffer.
1553 * @param b a buffer created with yy_create_buffer()
1556 void yy_delete_buffer (YY_BUFFER_STATE b )
1562 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1563 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1565 if ( b->yy_is_our_buffer )
1566 yyfree((void *) b->yy_ch_buf );
1568 yyfree((void *) b );
1572 extern int isatty (int );
1573 #endif /* __cplusplus */
1575 /* Initializes or reinitializes a buffer.
1576 * This function is sometimes called more than once on the same buffer,
1577 * such as during a yyrestart() or at EOF.
1579 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1584 yy_flush_buffer(b );
1586 b->yy_input_file = file;
1587 b->yy_fill_buffer = 1;
1589 /* If b is the current buffer, then yy_init_buffer was _probably_
1590 * called from yyrestart() or through yy_get_next_buffer.
1591 * In that case, we don't want to reset the lineno or column.
1593 if (b != YY_CURRENT_BUFFER){
1594 b->yy_bs_lineno = 1;
1595 b->yy_bs_column = 0;
1598 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1603 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1604 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1607 void yy_flush_buffer (YY_BUFFER_STATE b )
1614 /* We always need two end-of-buffer characters. The first causes
1615 * a transition to the end-of-buffer state. The second causes
1616 * a jam in that state.
1618 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1619 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1621 b->yy_buf_pos = &b->yy_ch_buf[0];
1624 b->yy_buffer_status = YY_BUFFER_NEW;
1626 if ( b == YY_CURRENT_BUFFER )
1627 yy_load_buffer_state( );
1630 /** Pushes the new state onto the stack. The new state becomes
1631 * the current state. This function will allocate the stack
1633 * @param new_buffer The new state.
1636 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1638 if (new_buffer == NULL)
1641 yyensure_buffer_stack();
1643 /* This block is copied from yy_switch_to_buffer. */
1644 if ( YY_CURRENT_BUFFER )
1646 /* Flush out information for old buffer. */
1647 *(yy_c_buf_p) = (yy_hold_char);
1648 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1649 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1652 /* Only push if top exists. Otherwise, replace top. */
1653 if (YY_CURRENT_BUFFER)
1654 (yy_buffer_stack_top)++;
1655 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1657 /* copied from yy_switch_to_buffer. */
1658 yy_load_buffer_state( );
1659 (yy_did_buffer_switch_on_eof) = 1;
1662 /** Removes and deletes the top of the stack, if present.
1663 * The next element becomes the new top.
1666 void yypop_buffer_state (void)
1668 if (!YY_CURRENT_BUFFER)
1671 yy_delete_buffer(YY_CURRENT_BUFFER );
1672 YY_CURRENT_BUFFER_LVALUE = NULL;
1673 if ((yy_buffer_stack_top) > 0)
1674 --(yy_buffer_stack_top);
1676 if (YY_CURRENT_BUFFER) {
1677 yy_load_buffer_state( );
1678 (yy_did_buffer_switch_on_eof) = 1;
1682 /* Allocates the stack if it does not exist.
1683 * Guarantees space for at least one push.
1685 static void yyensure_buffer_stack (void)
1689 if (!(yy_buffer_stack)) {
1691 /* First allocation is just for 2 elements, since we don't know if this
1692 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1693 * immediate realloc on the next call.
1696 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1697 (num_to_alloc * sizeof(struct yy_buffer_state*)
1699 if ( ! (yy_buffer_stack) )
1700 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1702 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1704 (yy_buffer_stack_max) = num_to_alloc;
1705 (yy_buffer_stack_top) = 0;
1709 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1711 /* Increase the buffer to prepare for a possible push. */
1712 int grow_size = 8 /* arbitrary grow size */;
1714 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1715 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1717 num_to_alloc * sizeof(struct yy_buffer_state*)
1719 if ( ! (yy_buffer_stack) )
1720 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1722 /* zero only the new slots.*/
1723 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1724 (yy_buffer_stack_max) = num_to_alloc;
1728 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1729 * @param base the character buffer
1730 * @param size the size in bytes of the character buffer
1732 * @return the newly allocated buffer state object.
1734 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1739 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1740 base[size-1] != YY_END_OF_BUFFER_CHAR )
1741 /* They forgot to leave room for the EOB's. */
1744 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1746 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1748 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1749 b->yy_buf_pos = b->yy_ch_buf = base;
1750 b->yy_is_our_buffer = 0;
1751 b->yy_input_file = 0;
1752 b->yy_n_chars = b->yy_buf_size;
1753 b->yy_is_interactive = 0;
1755 b->yy_fill_buffer = 0;
1756 b->yy_buffer_status = YY_BUFFER_NEW;
1758 yy_switch_to_buffer(b );
1763 /** Setup the input buffer state to scan a string. The next call to yylex() will
1764 * scan from a @e copy of @a str.
1765 * @param yystr a NUL-terminated string to scan
1767 * @return the newly allocated buffer state object.
1768 * @note If you want to scan bytes that may contain NUL values, then use
1769 * yy_scan_bytes() instead.
1771 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1774 return yy_scan_bytes(yystr,strlen(yystr) );
1777 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1778 * scan from a @e copy of @a bytes.
1779 * @param yybytes the byte buffer to scan
1780 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1782 * @return the newly allocated buffer state object.
1784 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1791 /* Get memory for full buffer, including space for trailing EOB's. */
1792 n = _yybytes_len + 2;
1793 buf = (char *) yyalloc(n );
1795 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1797 for ( i = 0; i < _yybytes_len; ++i )
1798 buf[i] = yybytes[i];
1800 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1802 b = yy_scan_buffer(buf,n );
1804 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1806 /* It's okay to grow etc. this buffer, and we should throw it
1807 * away when we're done.
1809 b->yy_is_our_buffer = 1;
1814 #ifndef YY_EXIT_FAILURE
1815 #define YY_EXIT_FAILURE 2
1818 static void yy_fatal_error (yyconst char* msg )
1820 (void) fprintf( stderr, "%s\n", msg );
1821 exit( YY_EXIT_FAILURE );
1824 /* Redefine yyless() so it works in section 3 code. */
1830 /* Undo effects of setting up yytext. */ \
1831 int yyless_macro_arg = (n); \
1832 YY_LESS_LINENO(yyless_macro_arg);\
1833 yytext[yyleng] = (yy_hold_char); \
1834 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1835 (yy_hold_char) = *(yy_c_buf_p); \
1836 *(yy_c_buf_p) = '\0'; \
1837 yyleng = yyless_macro_arg; \
1841 /* Accessor methods (get/set functions) to struct members. */
1843 /** Get the current line number.
1846 int yyget_lineno (void)
1852 /** Get the input stream.
1855 FILE *yyget_in (void)
1860 /** Get the output stream.
1863 FILE *yyget_out (void)
1868 /** Get the length of the current token.
1871 int yyget_leng (void)
1876 /** Get the current token.
1880 char *yyget_text (void)
1885 /** Set the current line number.
1886 * @param line_number
1889 void yyset_lineno (int line_number )
1892 yylineno = line_number;
1895 /** Set the input stream. This does not discard the current
1897 * @param in_str A readable stream.
1899 * @see yy_switch_to_buffer
1901 void yyset_in (FILE * in_str )
1906 void yyset_out (FILE * out_str )
1911 int yyget_debug (void)
1913 return yy_flex_debug;
1916 void yyset_debug (int bdebug )
1918 yy_flex_debug = bdebug ;
1921 static int yy_init_globals (void)
1923 /* Initialization is the same as for the non-reentrant scanner.
1924 * This function is called from yylex_destroy(), so don't allocate here.
1927 (yy_buffer_stack) = 0;
1928 (yy_buffer_stack_top) = 0;
1929 (yy_buffer_stack_max) = 0;
1930 (yy_c_buf_p) = (char *) 0;
1936 (yy_full_match) = 0;
1939 /* Defined in main.c */
1948 /* For future reference: Set errno on error, since we are called by
1954 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1955 int yylex_destroy (void)
1958 /* Pop the buffer stack, destroying each element. */
1959 while(YY_CURRENT_BUFFER){
1960 yy_delete_buffer(YY_CURRENT_BUFFER );
1961 YY_CURRENT_BUFFER_LVALUE = NULL;
1962 yypop_buffer_state();
1965 /* Destroy the stack itself. */
1966 yyfree((yy_buffer_stack) );
1967 (yy_buffer_stack) = NULL;
1969 yyfree ( (yy_state_buf) );
1970 (yy_state_buf) = NULL;
1972 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1973 * yylex() is called, initialization will occur. */
1980 * Internal utility routines.
1984 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1987 for ( i = 0; i < n; ++i )
1992 #ifdef YY_NEED_STRLEN
1993 static int yy_flex_strlen (yyconst char * s )
1996 for ( n = 0; s[n]; ++n )
2003 void *yyalloc (yy_size_t size )
2005 return (void *) malloc( size );
2008 void *yyrealloc (void * ptr, yy_size_t size )
2010 /* The cast to (char *) in the following accommodates both
2011 * implementations that use char* generic pointers, and those
2012 * that use void* generic pointers. It works with the latter
2013 * because both ANSI C and C++ allow castless assignment from
2014 * any pointer type to void*, and deal with argument conversions
2015 * as though doing an assignment.
2017 return (void *) realloc( (char *) ptr, size );
2020 void yyfree (void * ptr )
2022 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2025 #define YYTABLES_NAME "yytables"
2027 #line 276 "./ircd_lexer.l"