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