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