1 #line 2 "libxlu_disk_l.c"
2 #line 31 "libxlu_disk_l.l"
3 #include "libxl_osdeps.h" /* must come before any other headers */
4
5
6
7 #line 8 "libxlu_disk_l.c"
8
9 #define YY_INT_ALIGNED short int
10
11 /* A lexical scanner generated by flex */
12
13 #define FLEX_SCANNER
14 #define YY_FLEX_MAJOR_VERSION 2
15 #define YY_FLEX_MINOR_VERSION 5
16 #define YY_FLEX_SUBMINOR_VERSION 39
17 #if YY_FLEX_SUBMINOR_VERSION > 0
18 #define FLEX_BETA
19 #endif
20
21 /* First, we deal with platform-specific or compiler-specific issues. */
22
23 /* begin standard C headers. */
24 #include <stdio.h>
25 #include <string.h>
26 #include <errno.h>
27 #include <stdlib.h>
28
29 /* end standard C headers. */
30
31 /* flex integer type definitions */
32
33 #ifndef FLEXINT_H
34 #define FLEXINT_H
35
36 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
37
38 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
39
40 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
41 * if you want the limit (max/min) macros for int types.
42 */
43 #ifndef __STDC_LIMIT_MACROS
44 #define __STDC_LIMIT_MACROS 1
45 #endif
46
47 #include <inttypes.h>
48 typedef int8_t flex_int8_t;
49 typedef uint8_t flex_uint8_t;
50 typedef int16_t flex_int16_t;
51 typedef uint16_t flex_uint16_t;
52 typedef int32_t flex_int32_t;
53 typedef uint32_t flex_uint32_t;
54 #else
55 typedef signed char flex_int8_t;
56 typedef short int flex_int16_t;
57 typedef int flex_int32_t;
58 typedef unsigned char flex_uint8_t;
59 typedef unsigned short int flex_uint16_t;
60 typedef unsigned int flex_uint32_t;
61
62 /* Limits of integral types. */
63 #ifndef INT8_MIN
64 #define INT8_MIN (-128)
65 #endif
66 #ifndef INT16_MIN
67 #define INT16_MIN (-32767-1)
68 #endif
69 #ifndef INT32_MIN
70 #define INT32_MIN (-2147483647-1)
71 #endif
72 #ifndef INT8_MAX
73 #define INT8_MAX (127)
74 #endif
75 #ifndef INT16_MAX
76 #define INT16_MAX (32767)
77 #endif
78 #ifndef INT32_MAX
79 #define INT32_MAX (2147483647)
80 #endif
81 #ifndef UINT8_MAX
82 #define UINT8_MAX (255U)
83 #endif
84 #ifndef UINT16_MAX
85 #define UINT16_MAX (65535U)
86 #endif
87 #ifndef UINT32_MAX
88 #define UINT32_MAX (4294967295U)
89 #endif
90
91 #endif /* ! C99 */
92
93 #endif /* ! FLEXINT_H */
94
95 #ifdef __cplusplus
96
97 /* The "const" storage-class-modifier is valid. */
98 #define YY_USE_CONST
99
100 #else /* ! __cplusplus */
101
102 /* C99 requires __STDC__ to be defined as 1. */
103 #if defined (__STDC__)
104
105 #define YY_USE_CONST
106
107 #endif /* defined (__STDC__) */
108 #endif /* ! __cplusplus */
109
110 #ifdef YY_USE_CONST
111 #define yyconst const
112 #else
113 #define yyconst
114 #endif
115
116 /* Returned upon end-of-file. */
117 #define YY_NULL 0
118
119 /* Promotes a possibly negative, possibly signed char to an unsigned
120 * integer for use as an array index. If the signed char is negative,
121 * we want to instead treat it as an 8-bit unsigned char, hence the
122 * double cast.
123 */
124 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
125
126 /* An opaque pointer. */
127 #ifndef YY_TYPEDEF_YY_SCANNER_T
128 #define YY_TYPEDEF_YY_SCANNER_T
129 typedef void* yyscan_t;
130 #endif
131
132 /* For convenience, these vars (plus the bison vars far below)
133 are macros in the reentrant scanner. */
134 #define yyin yyg->yyin_r
135 #define yyout yyg->yyout_r
136 #define yyextra yyg->yyextra_r
137 #define yyleng yyg->yyleng_r
138 #define yytext yyg->yytext_r
139 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
140 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
141 #define yy_flex_debug yyg->yy_flex_debug_r
142
143 /* Enter a start condition. This macro really ought to take a parameter,
144 * but we do it the disgusting crufty way forced on us by the ()-less
145 * definition of BEGIN.
146 */
147 #define BEGIN yyg->yy_start = 1 + 2 *
148
149 /* Translate the current start state into a value that can be later handed
150 * to BEGIN to return to the state. The YYSTATE alias is for lex
151 * compatibility.
152 */
153 #define YY_START ((yyg->yy_start - 1) / 2)
154 #define YYSTATE YY_START
155
156 /* Action number for EOF rule of a given start state. */
157 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
158
159 /* Special action meaning "start processing a new file". */
160 #define YY_NEW_FILE xlu__disk_yyrestart(yyin ,yyscanner )
161
162 #define YY_END_OF_BUFFER_CHAR 0
163
164 /* Size of default input buffer. */
165 #ifndef YY_BUF_SIZE
166 #ifdef __ia64__
167 /* On IA-64, the buffer size is 16k, not 8k.
168 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
169 * Ditto for the __ia64__ case accordingly.
170 */
171 #define YY_BUF_SIZE 32768
172 #else
173 #define YY_BUF_SIZE 16384
174 #endif /* __ia64__ */
175 #endif
176
177 /* The state buf must be large enough to hold one state per character in the main buffer.
178 */
179 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
180
181 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
182 #define YY_TYPEDEF_YY_BUFFER_STATE
183 typedef struct yy_buffer_state *YY_BUFFER_STATE;
184 #endif
185
186 #ifndef YY_TYPEDEF_YY_SIZE_T
187 #define YY_TYPEDEF_YY_SIZE_T
188 typedef size_t yy_size_t;
189 #endif
190
191 #define EOB_ACT_CONTINUE_SCAN 0
192 #define EOB_ACT_END_OF_FILE 1
193 #define EOB_ACT_LAST_MATCH 2
194
195 #define YY_LESS_LINENO(n)
196 #define YY_LINENO_REWIND_TO(ptr)
197
198 /* Return all but the first "n" matched characters back to the input stream. */
199 #define yyless(n) \
200 do \
201 { \
202 /* Undo effects of setting up yytext. */ \
203 int yyless_macro_arg = (n); \
204 YY_LESS_LINENO(yyless_macro_arg);\
205 *yy_cp = yyg->yy_hold_char; \
206 YY_RESTORE_YY_MORE_OFFSET \
207 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
208 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
209 } \
210 while ( 0 )
211
212 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
213
214 #ifndef YY_STRUCT_YY_BUFFER_STATE
215 #define YY_STRUCT_YY_BUFFER_STATE
216 struct yy_buffer_state
217 {
218 FILE *yy_input_file;
219
220 char *yy_ch_buf; /* input buffer */
221 char *yy_buf_pos; /* current position in input buffer */
222
223 /* Size of input buffer in bytes, not including room for EOB
224 * characters.
225 */
226 yy_size_t yy_buf_size;
227
228 /* Number of characters read into yy_ch_buf, not including EOB
229 * characters.
230 */
231 yy_size_t yy_n_chars;
232
233 /* Whether we "own" the buffer - i.e., we know we created it,
234 * and can realloc() it to grow it, and should free() it to
235 * delete it.
236 */
237 int yy_is_our_buffer;
238
239 /* Whether this is an "interactive" input source; if so, and
240 * if we're using stdio for input, then we want to use getc()
241 * instead of fread(), to make sure we stop fetching input after
242 * each newline.
243 */
244 int yy_is_interactive;
245
246 /* Whether we're considered to be at the beginning of a line.
247 * If so, '^' rules will be active on the next match, otherwise
248 * not.
249 */
250 int yy_at_bol;
251
252 int yy_bs_lineno; /**< The line count. */
253 int yy_bs_column; /**< The column count. */
254
255 /* Whether to try to fill the input buffer when we reach the
256 * end of it.
257 */
258 int yy_fill_buffer;
259
260 int yy_buffer_status;
261
262 #define YY_BUFFER_NEW 0
263 #define YY_BUFFER_NORMAL 1
264 /* When an EOF's been seen but there's still some text to process
265 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
266 * shouldn't try reading from the input source any more. We might
267 * still have a bunch of tokens to match, though, because of
268 * possible backing-up.
269 *
270 * When we actually see the EOF, we change the status to "new"
271 * (via xlu__disk_yyrestart()), so that the user can continue scanning by
272 * just pointing yyin at a new input file.
273 */
274 #define YY_BUFFER_EOF_PENDING 2
275
276 };
277 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
278
279 /* We provide macros for accessing buffer states in case in the
280 * future we want to put the buffer states in a more general
281 * "scanner state".
282 *
283 * Returns the top of the stack, or NULL.
284 */
285 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
286 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
287 : NULL)
288
289 /* Same as previous macro, but useful when we know that the buffer stack is not
290 * NULL or when we need an lvalue. For internal use only.
291 */
292 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
293
294 void xlu__disk_yyrestart (FILE *input_file ,yyscan_t yyscanner );
295 void xlu__disk_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
296 YY_BUFFER_STATE xlu__disk_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
297 void xlu__disk_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
298 void xlu__disk_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
299 void xlu__disk_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
300 void xlu__disk_yypop_buffer_state (yyscan_t yyscanner );
301
302 static void xlu__disk_yyensure_buffer_stack (yyscan_t yyscanner );
303 static void xlu__disk_yy_load_buffer_state (yyscan_t yyscanner );
304 static void xlu__disk_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
305
306 #define YY_FLUSH_BUFFER xlu__disk_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
307
308 YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
309 YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
310 YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
311
312 void *xlu__disk_yyalloc (yy_size_t ,yyscan_t yyscanner );
313 void *xlu__disk_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
314 void xlu__disk_yyfree (void * ,yyscan_t yyscanner );
315
316 #define yy_new_buffer xlu__disk_yy_create_buffer
317
318 #define yy_set_interactive(is_interactive) \
319 { \
320 if ( ! YY_CURRENT_BUFFER ){ \
321 xlu__disk_yyensure_buffer_stack (yyscanner); \
322 YY_CURRENT_BUFFER_LVALUE = \
323 xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
324 } \
325 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
326 }
327
328 #define yy_set_bol(at_bol) \
329 { \
330 if ( ! YY_CURRENT_BUFFER ){\
331 xlu__disk_yyensure_buffer_stack (yyscanner); \
332 YY_CURRENT_BUFFER_LVALUE = \
333 xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
334 } \
335 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
336 }
337
338 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
339
340 #define xlu__disk_yywrap(yyscanner) 1
341 #define YY_SKIP_YYWRAP
342
343 typedef unsigned char YY_CHAR;
344
345 typedef int yy_state_type;
346
347 #define yytext_ptr yytext_r
348
349 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
350 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
351 static int yy_get_next_buffer (yyscan_t yyscanner );
352 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
353
354 /* Done after the current pattern has been matched and before the
355 * corresponding action - sets up yytext.
356 */
357 #define YY_DO_BEFORE_ACTION \
358 yyg->yytext_ptr = yy_bp; \
359 yyg->yytext_ptr -= yyg->yy_more_len; \
360 yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
361 yyg->yy_hold_char = *yy_cp; \
362 *yy_cp = '\0'; \
363 yyg->yy_c_buf_p = yy_cp;
364
365 #define YY_NUM_RULES 36
366 #define YY_END_OF_BUFFER 37
367 /* This struct is not used in this scanner,
368 but its presence is necessary. */
369 struct yy_trans_info
370 {
371 flex_int32_t yy_verify;
372 flex_int32_t yy_nxt;
373 };
374 static yyconst flex_int16_t yy_acclist[575] =
375 { 0,
376 35, 35, 37, 33, 34, 36, 8193, 33, 34, 36,
377 16385, 8193, 33, 36,16385, 33, 34, 36, 34, 36,
378 33, 34, 36, 33, 34, 36, 33, 34, 36, 33,
379 34, 36, 33, 34, 36, 33, 34, 36, 33, 34,
380 36, 33, 34, 36, 33, 34, 36, 33, 34, 36,
381 33, 34, 36, 33, 34, 36, 33, 34, 36, 33,
382 34, 36, 33, 34, 36, 33, 34, 36, 35, 36,
383 36, 33, 33, 8193, 33, 8193, 33,16385, 8193, 33,
384 8193, 33, 33, 8224, 33,16416, 33, 33, 33, 33,
385 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
386
387 33, 33, 33, 33, 33, 33, 33, 33, 33, 35,
388 8193, 33, 8193, 33, 8193, 8224, 33, 8224, 33, 8224,
389 23, 33, 33, 33, 33, 33, 33, 33, 33, 33,
390 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
391 33, 33, 33, 33, 33, 8224, 33, 8224, 33, 8224,
392 23, 33, 33, 28, 8224, 33,16416, 33, 33, 15,
393 33, 33, 33, 33, 33, 33, 33, 33, 33, 8217,
394 8224, 33,16409,16416, 33, 33, 31, 8224, 33,16416,
395 33, 8216, 8224, 33,16408,16416, 33, 33, 8219, 8224,
396 33,16411,16416, 33, 33, 33, 33, 33, 28, 8224,
397
398 33, 28, 8224, 33, 28, 33, 28, 8224, 33, 3,
399 33, 15, 33, 33, 33, 33, 33, 30, 8224, 33,
400 16416, 33, 33, 33, 8217, 8224, 33, 8217, 8224, 33,
401 8217, 33, 8217, 8224, 33, 33, 31, 8224, 33, 31,
402 8224, 33, 31, 33, 31, 8224, 8216, 8224, 33, 8216,
403 8224, 33, 8216, 33, 8216, 8224, 33, 8219, 8224, 33,
404 8219, 8224, 33, 8219, 33, 8219, 8224, 33, 33, 10,
405 33, 33, 28, 8224, 33, 28, 8224, 33, 28, 8224,
406 28, 33, 28, 33, 3, 33, 33, 33, 33, 33,
407 33, 33, 30, 8224, 33, 30, 8224, 33, 30, 33,
408
409 30, 8224, 33, 33, 29, 8224, 33,16416, 8217, 8224,
410 33, 8217, 8224, 33, 8217, 8224, 8217, 33, 8217, 33,
411 33, 31, 8224, 33, 31, 8224, 33, 31, 8224, 31,
412 33, 31, 8216, 8224, 33, 8216, 8224, 33, 8216, 8224,
413 8216, 33, 8216, 33, 8219, 8224, 33, 8219, 8224, 33,
414 8219, 8224, 8219, 33, 8219, 33, 33, 10, 23, 10,
415 7, 33, 33, 33, 33, 33, 33, 33, 13, 33,
416 30, 8224, 33, 30, 8224, 33, 30, 8224, 30, 33,
417 30, 2, 33, 29, 8224, 33, 29, 8224, 33, 29,
418 33, 29, 8224, 16, 33, 33, 11, 33, 22, 10,
419
420 10, 23, 7, 23, 7, 33, 8, 33, 33, 33,
421 33, 6, 33, 13, 33, 2, 23, 2, 33, 29,
422 8224, 33, 29, 8224, 33, 29, 8224, 29, 33, 29,
423 16, 33, 33, 11, 23, 11, 26, 8224, 33,16416,
424 22, 23, 22, 7, 7, 23, 33, 8, 23, 8,
425 33, 33, 33, 33, 6, 23, 6, 6, 23, 6,
426 23, 33, 2, 2, 23, 33, 33, 11, 11, 23,
427 26, 8224, 33, 26, 8224, 33, 26, 33, 26, 8224,
428 22, 23, 33, 8, 8, 23, 33, 33, 17, 18,
429 6, 6, 23, 6, 6, 33, 33, 14, 33, 26,
430
431 8224, 33, 26, 8224, 33, 26, 8224, 26, 33, 26,
432 33, 33, 33, 17, 23, 17, 18, 23, 18, 6,
433 6, 33, 33, 14, 33, 20, 9, 19, 17, 17,
434 23, 18, 18, 23, 6, 5, 6, 33, 21, 20,
435 23, 20, 9, 23, 9, 19, 23, 19, 4, 6,
436 5, 6, 33, 21, 23, 21, 20, 20, 23, 9,
437 9, 23, 19, 19, 23, 4, 6, 12, 33, 21,
438 21, 23, 12, 33
439 } ;
440
441 static yyconst flex_int16_t yy_accept[356] =
442 { 0,
443 1, 1, 1, 2, 3, 4, 7, 12, 16, 19,
444 21, 24, 27, 30, 33, 36, 39, 42, 45, 48,
445 51, 54, 57, 60, 63, 66, 69, 71, 72, 73,
446 74, 76, 79, 81, 82, 83, 84, 87, 87, 88,
447 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
448 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
449 109, 110, 111, 113, 115, 116, 118, 120, 121, 122,
450 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
451 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
452 143, 144, 145, 146, 148, 150, 151, 152, 153, 154,
453
454 158, 159, 160, 162, 163, 164, 165, 166, 167, 168,
455 169, 170, 175, 176, 177, 181, 182, 187, 188, 189,
456 194, 195, 196, 197, 198, 199, 202, 205, 207, 209,
457 210, 212, 214, 215, 216, 217, 218, 222, 223, 224,
458 225, 228, 231, 233, 235, 236, 237, 240, 243, 245,
459 247, 250, 253, 255, 257, 258, 261, 264, 266, 268,
460 269, 270, 271, 272, 273, 276, 279, 281, 283, 284,
461 285, 287, 288, 289, 290, 291, 292, 293, 296, 299,
462 301, 303, 304, 305, 309, 312, 315, 317, 319, 320,
463 321, 322, 325, 328, 330, 332, 333, 336, 339, 341,
464
465 343, 344, 345, 348, 351, 353, 355, 356, 357, 358,
466 360, 361, 362, 363, 364, 365, 366, 367, 368, 369,
467 371, 374, 377, 379, 381, 382, 383, 384, 387, 390,
468 392, 394, 396, 397, 398, 399, 400, 401, 403, 405,
469 406, 407, 408, 409, 410, 411, 412, 413, 414, 416,
470 418, 419, 420, 423, 426, 428, 430, 431, 433, 434,
471 436, 437, 441, 443, 444, 445, 447, 448, 450, 451,
472 452, 453, 454, 455, 457, 458, 460, 462, 463, 464,
473 466, 467, 468, 469, 471, 474, 477, 479, 481, 483,
474 484, 485, 487, 488, 489, 490, 491, 492, 494, 495,
475
476 496, 497, 498, 500, 503, 506, 508, 510, 511, 512,
477 513, 514, 516, 517, 519, 520, 521, 522, 523, 524,
478 526, 527, 528, 529, 530, 532, 533, 535, 536, 538,
479 539, 540, 542, 543, 545, 546, 548, 549, 551, 553,
480 554, 556, 557, 558, 560, 561, 563, 564, 566, 568,
481 570, 571, 573, 575, 575
482 } ;
483
484 static yyconst flex_int32_t yy_ec[256] =
485 { 0,
486 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
487 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
488 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
489 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
490 1, 1, 1, 4, 5, 1, 1, 6, 6, 7,
491 6, 6, 6, 6, 6, 6, 6, 8, 1, 1,
492 9, 1, 1, 1, 1, 1, 1, 1, 1, 1,
493 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
494 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
495 1, 1, 1, 1, 1, 1, 10, 11, 12, 13,
496
497 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
498 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
499 34, 19, 1, 1, 1, 1, 1, 1, 1, 1,
500 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
501 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
502 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
503 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
504 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
507
508 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
509 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
510 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
511 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
512 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
513 1, 1, 1, 1, 1
514 } ;
515
516 static yyconst flex_int32_t yy_meta[35] =
517 { 0,
518 1, 1, 2, 3, 1, 1, 1, 1, 4, 1,
519 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
520 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
521 1, 1, 1, 1
522 } ;
523
524 static yyconst flex_int16_t yy_base[424] =
525 { 0,
526 0, 0, 901, 900, 902, 897, 33, 36, 905, 905,
527 45, 63, 31, 42, 51, 52, 890, 33, 65, 67,
528 69, 70, 889, 71, 888, 75, 0, 905, 893, 905,
529 91, 94, 0, 0, 103, 886, 112, 0, 89, 98,
530 113, 92, 114, 99, 100, 48, 121, 116, 119, 74,
531 124, 129, 123, 135, 132, 133, 137, 134, 138, 139,
532 141, 0, 155, 0, 0, 164, 0, 0, 849, 142,
533 152, 164, 140, 161, 165, 166, 167, 168, 169, 173,
534 174, 178, 176, 180, 184, 208, 189, 183, 192, 195,
535 215, 191, 193, 223, 0, 0, 905, 208, 204, 236,
536
537 219, 209, 238, 196, 237, 831, 242, 815, 241, 224,
538 243, 261, 244, 259, 277, 266, 286, 250, 288, 298,
539 249, 283, 274, 282, 294, 308, 0, 310, 0, 295,
540 305, 905, 308, 306, 313, 314, 342, 319, 316, 320,
541 331, 0, 349, 0, 342, 344, 356, 0, 358, 0,
542 365, 0, 367, 0, 354, 375, 0, 377, 0, 363,
543 356, 809, 327, 322, 384, 0, 0, 0, 0, 379,
544 905, 382, 384, 386, 390, 372, 392, 403, 0, 410,
545 0, 407, 413, 423, 426, 0, 0, 0, 0, 409,
546 424, 435, 0, 0, 0, 0, 437, 0, 0, 0,
547
548 0, 433, 444, 0, 0, 0, 0, 391, 440, 781,
549 905, 769, 439, 445, 444, 447, 449, 454, 453, 399,
550 464, 0, 0, 0, 0, 757, 465, 476, 0, 478,
551 0, 479, 476, 753, 462, 490, 749, 905, 745, 905,
552 483, 737, 424, 485, 487, 490, 500, 493, 905, 729,
553 905, 502, 518, 0, 0, 0, 0, 905, 498, 721,
554 905, 527, 713, 0, 705, 905, 495, 697, 905, 365,
555 521, 528, 530, 685, 905, 534, 540, 540, 657, 905,
556 537, 542, 650, 905, 553, 0, 557, 0, 0, 551,
557 641, 905, 558, 557, 633, 614, 613, 905, 547, 555,
558
559 563, 565, 569, 584, 0, 0, 0, 0, 583, 570,
560 585, 612, 905, 601, 905, 522, 580, 589, 594, 905,
561 600, 585, 563, 520, 905, 514, 905, 586, 486, 597,
562 480, 441, 905, 416, 905, 345, 905, 334, 905, 601,
563 254, 905, 242, 905, 200, 905, 151, 905, 905, 607,
564 86, 905, 905, 905, 620, 624, 627, 631, 635, 639,
565 643, 647, 651, 655, 659, 663, 667, 671, 675, 679,
566 683, 687, 691, 695, 699, 703, 707, 711, 715, 719,
567 723, 727, 731, 735, 739, 743, 747, 751, 755, 759,
568 763, 767, 771, 775, 779, 783, 787, 791, 795, 799,
569
570 803, 807, 811, 815, 819, 823, 827, 831, 835, 839,
571 843, 847, 851, 855, 859, 863, 867, 871, 875, 879,
572 883, 887, 891
573 } ;
574
575 static yyconst flex_int16_t yy_def[424] =
576 { 0,
577 354, 1, 355, 355, 354, 356, 357, 357, 354, 354,
578 358, 358, 12, 12, 12, 12, 12, 12, 12, 12,
579 12, 12, 12, 12, 12, 12, 359, 354, 356, 354,
580 360, 357, 361, 361, 362, 12, 356, 363, 12, 12,
581 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
582 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
583 12, 359, 360, 361, 361, 364, 365, 365, 354, 12,
584 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
585 12, 12, 12, 12, 12, 362, 12, 12, 12, 12,
586 12, 12, 12, 364, 365, 365, 354, 12, 12, 366,
587
588 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
589 12, 367, 86, 86, 368, 12, 369, 12, 12, 370,
590 12, 12, 12, 12, 12, 371, 372, 366, 372, 12,
591 12, 354, 86, 12, 12, 12, 373, 12, 12, 12,
592 374, 375, 367, 375, 86, 86, 376, 377, 368, 377,
593 378, 379, 369, 379, 12, 380, 381, 370, 381, 12,
594 12, 382, 12, 12, 371, 372, 372, 383, 383, 12,
595 354, 86, 86, 86, 12, 12, 12, 384, 385, 373,
596 385, 12, 12, 386, 374, 375, 375, 387, 387, 86,
597 86, 376, 377, 377, 388, 388, 378, 379, 379, 389,
598
599 389, 12, 380, 381, 381, 390, 390, 12, 12, 391,
600 354, 392, 86, 12, 86, 86, 86, 12, 86, 12,
601 384, 385, 385, 393, 393, 394, 86, 395, 396, 386,
602 396, 86, 86, 397, 12, 398, 391, 354, 399, 354,
603 86, 400, 12, 86, 86, 86, 401, 86, 354, 402,
604 354, 86, 395, 396, 396, 403, 403, 354, 86, 404,
605 354, 405, 406, 406, 399, 354, 86, 407, 354, 12,
606 86, 86, 86, 408, 354, 408, 408, 86, 402, 354,
607 86, 86, 404, 354, 409, 410, 405, 410, 406, 86,
608 407, 354, 12, 86, 411, 412, 408, 354, 408, 408,
609
610 86, 86, 86, 409, 410, 410, 413, 413, 86, 12,
611 86, 414, 354, 415, 354, 408, 408, 86, 86, 354,
612 416, 417, 418, 414, 354, 415, 354, 408, 408, 86,
613 419, 420, 354, 421, 354, 422, 354, 408, 354, 86,
614 423, 354, 420, 354, 421, 354, 422, 354, 354, 86,
615 423, 354, 354, 0, 354, 354, 354, 354, 354, 354,
616 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
617 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
618 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
619 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
620
621 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
622 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
623 354, 354, 354
624 } ;
625
626 static yyconst flex_int16_t yy_nxt[940] =
627 { 0,
628 6, 7, 8, 9, 6, 6, 6, 6, 10, 11,
629 12, 13, 14, 15, 16, 17, 18, 19, 17, 17,
630 17, 17, 20, 17, 21, 22, 23, 24, 25, 17,
631 26, 17, 17, 17, 32, 32, 33, 32, 32, 33,
632 36, 34, 36, 42, 34, 29, 29, 29, 30, 35,
633 50, 36, 37, 38, 43, 44, 39, 36, 79, 45,
634 36, 36, 40, 29, 29, 29, 30, 35, 46, 48,
635 37, 38, 41, 47, 36, 49, 36, 53, 36, 36,
636 36, 56, 58, 36, 36, 55, 82, 60, 51, 342,
637 54, 61, 52, 29, 64, 32, 32, 33, 36, 65,
638
639 70, 36, 34, 29, 29, 29, 30, 36, 36, 36,
640 29, 38, 66, 66, 66, 67, 66, 71, 74, 66,
641 68, 72, 36, 36, 73, 36, 77, 78, 36, 76,
642 36, 53, 36, 36, 75, 85, 80, 83, 36, 86,
643 84, 36, 36, 36, 36, 81, 36, 36, 36, 36,
644 36, 36, 93, 89, 337, 98, 88, 29, 64, 101,
645 90, 36, 91, 65, 92, 87, 29, 95, 89, 99,
646 36, 100, 96, 36, 36, 36, 36, 36, 36, 106,
647 105, 85, 36, 36, 102, 36, 107, 36, 103, 36,
648 109, 112, 36, 36, 104, 108, 115, 110, 36, 117,
649
650 36, 36, 36, 335, 36, 36, 122, 111, 29, 29,
651 29, 30, 118, 36, 116, 29, 38, 36, 36, 113,
652 114, 119, 120, 123, 36, 29, 95, 121, 36, 134,
653 131, 96, 130, 36, 125, 124, 126, 126, 66, 127,
654 126, 132, 133, 126, 129, 333, 36, 36, 135, 137,
655 36, 36, 36, 140, 139, 35, 35, 352, 36, 36,
656 85, 141, 141, 66, 142, 141, 160, 145, 141, 144,
657 35, 35, 89, 117, 155, 36, 146, 147, 147, 66,
658 148, 147, 162, 36, 147, 150, 151, 151, 66, 152,
659 151, 36, 36, 151, 154, 120, 161, 36, 156, 156,
660
661 66, 157, 156, 36, 36, 156, 159, 164, 171, 163,
662 29, 166, 29, 168, 36, 36, 167, 170, 169, 35,
663 35, 172, 36, 36, 173, 36, 213, 184, 36, 36,
664 175, 36, 174, 29, 186, 212, 36, 349, 183, 187,
665 177, 176, 178, 178, 66, 179, 178, 182, 348, 178,
666 181, 29, 188, 35, 35, 35, 35, 189, 29, 193,
667 29, 195, 190, 36, 194, 36, 196, 29, 198, 29,
668 200, 191, 36, 199, 36, 201, 219, 29, 204, 29,
669 206, 36, 202, 205, 209, 207, 29, 166, 36, 293,
670 208, 214, 167, 35, 35, 35, 35, 35, 35, 36,
671
672 36, 36, 249, 218, 220, 29, 222, 216, 36, 217,
673 235, 223, 29, 224, 215, 226, 36, 227, 225, 346,
674 35, 35, 36, 228, 228, 66, 229, 228, 29, 186,
675 228, 231, 232, 36, 187, 233, 35, 29, 193, 29,
676 198, 234, 36, 194, 344, 199, 29, 204, 236, 36,
677 35, 241, 205, 242, 36, 35, 35, 270, 35, 35,
678 35, 35, 247, 36, 35, 35, 29, 222, 244, 262,
679 248, 36, 223, 243, 245, 246, 35, 252, 29, 254,
680 29, 256, 258, 342, 255, 259, 257, 35, 35, 339,
681 35, 35, 69, 264, 35, 35, 35, 35, 35, 35,
682
683 267, 35, 35, 275, 35, 35, 35, 35, 271, 35,
684 35, 276, 277, 35, 35, 272, 278, 315, 273, 281,
685 29, 254, 290, 313, 282, 275, 255, 285, 285, 66,
686 286, 285, 35, 35, 285, 288, 295, 298, 296, 35,
687 35, 35, 35, 298, 301, 328, 299, 294, 35, 35,
688 275, 35, 35, 35, 303, 29, 305, 300, 275, 29,
689 307, 306, 35, 35, 302, 308, 337, 36, 35, 35,
690 309, 310, 320, 316, 35, 35, 35, 35, 322, 36,
691 35, 35, 317, 275, 319, 311, 29, 305, 335, 275,
692 318, 321, 306, 323, 35, 35, 35, 35, 330, 329,
693
694 35, 35, 331, 333, 327, 35, 35, 338, 35, 35,
695 353, 340, 35, 35, 350, 325, 275, 315, 35, 35,
696 27, 27, 27, 27, 29, 29, 29, 31, 31, 31,
697 31, 36, 36, 36, 36, 62, 313, 62, 62, 63,
698 63, 63, 63, 65, 269, 65, 65, 35, 35, 35,
699 35, 69, 69, 261, 69, 94, 94, 94, 94, 96,
700 251, 96, 96, 128, 128, 128, 128, 143, 143, 143,
701 143, 149, 149, 149, 149, 153, 153, 153, 153, 158,
702 158, 158, 158, 165, 165, 165, 165, 167, 298, 167,
703 167, 180, 180, 180, 180, 185, 185, 185, 185, 187,
704
705 292, 187, 187, 192, 192, 192, 192, 194, 240, 194,
706 194, 197, 197, 197, 197, 199, 289, 199, 199, 203,
707 203, 203, 203, 205, 284, 205, 205, 210, 210, 210,
708 210, 169, 280, 169, 169, 221, 221, 221, 221, 223,
709 269, 223, 223, 230, 230, 230, 230, 189, 266, 189,
710 189, 196, 211, 196, 196, 201, 261, 201, 201, 207,
711 251, 207, 207, 237, 237, 237, 237, 239, 239, 239,
712 239, 225, 240, 225, 225, 250, 250, 250, 250, 253,
713 253, 253, 253, 255, 238, 255, 255, 260, 260, 260,
714 260, 263, 263, 263, 263, 265, 265, 265, 265, 268,
715
716 268, 268, 268, 274, 274, 274, 274, 279, 279, 279,
717 279, 257, 211, 257, 257, 283, 283, 283, 283, 287,
718 287, 287, 287, 264, 138, 264, 264, 291, 291, 291,
719 291, 297, 297, 297, 297, 304, 304, 304, 304, 306,
720 136, 306, 306, 312, 312, 312, 312, 314, 314, 314,
721 314, 308, 97, 308, 308, 324, 324, 324, 324, 326,
722 326, 326, 326, 332, 332, 332, 332, 334, 334, 334,
723 334, 336, 336, 336, 336, 341, 341, 341, 341, 343,
724 343, 343, 343, 345, 345, 345, 345, 347, 347, 347,
725 347, 351, 351, 351, 351, 36, 30, 59, 57, 36,
726
727 30, 354, 28, 28, 5, 354, 354, 354, 354, 354,
728 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
729 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
730 354, 354, 354, 354, 354, 354, 354, 354, 354
731 } ;
732
733 static yyconst flex_int16_t yy_chk[940] =
734 { 0,
735 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
736 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
737 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
738 1, 1, 1, 1, 7, 7, 7, 8, 8, 8,
739 13, 7, 18, 13, 8, 11, 11, 11, 11, 11,
740 18, 14, 11, 11, 13, 14, 11, 46, 46, 14,
741 15, 16, 11, 12, 12, 12, 12, 12, 14, 16,
742 12, 12, 12, 15, 19, 16, 20, 20, 21, 22,
743 24, 22, 24, 50, 26, 21, 50, 26, 19, 351,
744 20, 26, 19, 31, 31, 32, 32, 32, 39, 31,
745
746 39, 42, 32, 35, 35, 35, 35, 40, 44, 45,
747 35, 35, 37, 37, 37, 37, 37, 39, 42, 37,
748 37, 40, 41, 43, 41, 48, 45, 45, 49, 44,
749 47, 47, 53, 51, 43, 53, 48, 51, 52, 54,
750 52, 55, 56, 58, 54, 49, 57, 59, 60, 73,
751 61, 70, 60, 61, 347, 70, 56, 63, 63, 73,
752 58, 71, 59, 63, 59, 55, 66, 66, 57, 71,
753 74, 72, 66, 72, 75, 76, 77, 78, 79, 78,
754 77, 79, 80, 81, 74, 83, 80, 82, 75, 84,
755 82, 85, 88, 85, 76, 81, 87, 83, 87, 89,
756
757 92, 89, 93, 345, 90, 104, 92, 84, 86, 86,
758 86, 86, 90, 99, 88, 86, 86, 98, 102, 86,
759 86, 91, 91, 93, 91, 94, 94, 91, 101, 104,
760 102, 94, 101, 110, 99, 98, 100, 100, 100, 100,
761 100, 103, 103, 100, 100, 343, 105, 103, 105, 107,
762 109, 107, 111, 110, 109, 113, 113, 341, 121, 118,
763 111, 112, 112, 112, 112, 112, 121, 113, 112, 112,
764 114, 114, 116, 116, 118, 116, 114, 115, 115, 115,
765 115, 115, 123, 123, 115, 115, 117, 117, 117, 117,
766 117, 124, 122, 117, 117, 119, 122, 119, 120, 120,
767
768 120, 120, 120, 125, 130, 120, 120, 125, 131, 124,
769 126, 126, 128, 128, 131, 134, 126, 130, 128, 133,
770 133, 133, 135, 136, 133, 139, 164, 140, 138, 140,
771 134, 164, 133, 141, 141, 163, 163, 338, 139, 141,
772 136, 135, 137, 137, 137, 137, 137, 138, 336, 137,
773 137, 143, 143, 145, 145, 146, 146, 143, 147, 147,
774 149, 149, 145, 155, 147, 161, 149, 151, 151, 153,
775 153, 146, 160, 151, 270, 153, 176, 156, 156, 158,
776 158, 176, 155, 156, 161, 158, 165, 165, 170, 270,
777 160, 170, 165, 172, 172, 173, 173, 174, 174, 175,
778
779 208, 177, 220, 175, 177, 178, 178, 173, 220, 174,
780 208, 178, 180, 180, 172, 182, 182, 183, 180, 334,
781 190, 190, 183, 184, 184, 184, 184, 184, 185, 185,
782 184, 184, 190, 243, 185, 191, 191, 192, 192, 197,
783 197, 202, 202, 192, 332, 197, 203, 203, 209, 209,
784 213, 213, 203, 214, 214, 215, 215, 243, 216, 216,
785 217, 217, 218, 218, 219, 219, 221, 221, 215, 235,
786 219, 235, 221, 214, 216, 217, 227, 227, 228, 228,
787 230, 230, 232, 331, 228, 233, 230, 233, 233, 329,
788 232, 232, 236, 236, 241, 241, 244, 244, 245, 245,
789
790 241, 246, 246, 247, 248, 248, 267, 267, 244, 259,
791 259, 247, 247, 252, 252, 245, 248, 326, 246, 252,
792 253, 253, 267, 324, 259, 316, 253, 262, 262, 262,
793 262, 262, 271, 271, 262, 262, 272, 276, 273, 272,
794 272, 273, 273, 277, 278, 316, 276, 271, 281, 281,
795 299, 278, 278, 282, 282, 285, 285, 277, 300, 287,
796 287, 285, 290, 290, 281, 287, 323, 293, 294, 294,
797 290, 293, 303, 299, 301, 301, 302, 302, 310, 310,
798 303, 303, 300, 317, 302, 294, 304, 304, 322, 328,
799 301, 309, 304, 311, 309, 309, 311, 311, 318, 317,
800
801 318, 318, 319, 321, 314, 319, 319, 328, 330, 330,
802 350, 330, 340, 340, 340, 312, 297, 296, 350, 350,
803 355, 355, 355, 355, 356, 356, 356, 357, 357, 357,
804 357, 358, 358, 358, 358, 359, 295, 359, 359, 360,
805 360, 360, 360, 361, 291, 361, 361, 362, 362, 362,
806 362, 363, 363, 283, 363, 364, 364, 364, 364, 365,
807 279, 365, 365, 366, 366, 366, 366, 367, 367, 367,
808 367, 368, 368, 368, 368, 369, 369, 369, 369, 370,
809 370, 370, 370, 371, 371, 371, 371, 372, 274, 372,
810 372, 373, 373, 373, 373, 374, 374, 374, 374, 375,
811
812 268, 375, 375, 376, 376, 376, 376, 377, 265, 377,
813 377, 378, 378, 378, 378, 379, 263, 379, 379, 380,
814 380, 380, 380, 381, 260, 381, 381, 382, 382, 382,
815 382, 383, 250, 383, 383, 384, 384, 384, 384, 385,
816 242, 385, 385, 386, 386, 386, 386, 387, 239, 387,
817 387, 388, 237, 388, 388, 389, 234, 389, 389, 390,
818 226, 390, 390, 391, 391, 391, 391, 392, 392, 392,
819 392, 393, 212, 393, 393, 394, 394, 394, 394, 395,
820 395, 395, 395, 396, 210, 396, 396, 397, 397, 397,
821 397, 398, 398, 398, 398, 399, 399, 399, 399, 400,
822
823 400, 400, 400, 401, 401, 401, 401, 402, 402, 402,
824 402, 403, 162, 403, 403, 404, 404, 404, 404, 405,
825 405, 405, 405, 406, 108, 406, 406, 407, 407, 407,
826 407, 408, 408, 408, 408, 409, 409, 409, 409, 410,
827 106, 410, 410, 411, 411, 411, 411, 412, 412, 412,
828 412, 413, 69, 413, 413, 414, 414, 414, 414, 415,
829 415, 415, 415, 416, 416, 416, 416, 417, 417, 417,
830 417, 418, 418, 418, 418, 419, 419, 419, 419, 420,
831 420, 420, 420, 421, 421, 421, 421, 422, 422, 422,
832 422, 423, 423, 423, 423, 36, 29, 25, 23, 17,
833
834 6, 5, 4, 3, 354, 354, 354, 354, 354, 354,
835 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
836 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
837 354, 354, 354, 354, 354, 354, 354, 354, 354
838 } ;
839
840 #define YY_TRAILING_MASK 0x2000
841 #define YY_TRAILING_HEAD_MASK 0x4000
842 #define REJECT \
843 { \
844 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \
845 yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \
846 yyg->yy_lp = yyg->yy_full_lp; /* restore orig. accepting pos. */ \
847 yyg->yy_state_ptr = yyg->yy_full_state; /* restore orig. state */ \
848 yy_current_state = *yyg->yy_state_ptr; /* restore curr. state */ \
849 ++yyg->yy_lp; \
850 goto find_rule; \
851 }
852
853 #define yymore() (yyg->yy_more_flag = 1)
854 #define YY_MORE_ADJ yyg->yy_more_len
855 #define YY_RESTORE_YY_MORE_OFFSET
856 #line 1 "libxlu_disk_l.l"
857 /* -*- fundamental -*- */
858 /*
859 * libxlu_disk_l.l - parser for disk specification strings
860 *
861 * Copyright (C) 2011 Citrix Ltd.
862 * Author Ian Jackson <ian.jackson@eu.citrix.com>
863 *
864 * This program is free software; you can redistribute it and/or modify
865 * it under the terms of the GNU Lesser General Public License as published
866 * by the Free Software Foundation; version 2.1 only. with the special
867 * exception on linking described in file LICENSE.
868 *
869 * This program is distributed in the hope that it will be useful,
870 * but WITHOUT ANY WARRANTY; without even the implied warranty of
871 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
872 * GNU Lesser General Public License for more details.
873 */
874 /*
875 * Parsing the old xm/xend/xl-4.1 disk specs is a tricky problem,
876 * because the target string might in theory contain "," which is the
877 * delimiter we use for stripping off things on the RHS, and ":",
878 * which is the delimiter we use for stripping off things on the LHS.
879 *
880 * In this parser we do not support such target strings in the old
881 * syntax; if the target string has to contain "," or ":" the new
882 * syntax's "target=" should be used.
883 */
884
885 #line 35 "libxlu_disk_l.l"
886 #include "libxlu_disk_i.h"
887
888 #define YY_NO_INPUT
889
890 /* Some versions of flex have a bug (Fedora bugzilla 612465) which causes
891 * it to fail to declare these functions, which it defines. So declare
892 * them ourselves. Hopefully we won't have to simultaneously support
893 * a flex version which declares these differently somehow. */
894 int xlu__disk_yyget_column(yyscan_t yyscanner);
895 void xlu__disk_yyset_column(int column_no, yyscan_t yyscanner);
896
897
898 /*----- useful macros and functions used in actions -----
899 * we use macros in the actual rules to keep the actions short
900 * and particularly to avoid repeating boilerplate values such as
901 * DPC->disk, yytext, etc. */
902
903 /* Sets an enum, checking it hasn't already been set to a different value */
904 #define DSET(dpc,member,enumname,str,valname) do{ \
905 if (dpc->disk->member != LIBXL_DISK_##enumname##_UNKNOWN && \
906 dpc->disk->member != LIBXL_DISK_##enumname##_##valname) { \
907 xlu__disk_err(dpc, str, TOSTRING(member) " respecified"); \
908 } else { \
909 dpc->disk->member = LIBXL_DISK_##enumname##_##valname; \
910 } \
911 }while(0)
912
913 /* For actions whose patterns contain '=', finds the start of the value */
914 #define FROMEQUALS (strchr(yytext,'=')+1)
915
916 /* Chops the delimiter off, modifying yytext and yyleng. */
917 #define STRIP(delim) do{ \
918 if (yyleng>0 && yytext[yyleng-1]==(delim)) \
919 yytext[--yyleng] = 0; \
920 }while(0)
921
922 /* Sets a string value, checking it hasn't been set already. */
923 #define SAVESTRING(what,loc,val) do{ \
924 savestring(DPC, what " respecified", &DPC->disk->loc, (val)); \
925 }while(0)
savestring(DiskParseContext * dpc,const char * what_respecified,char ** update,const char * value)926 static void savestring(DiskParseContext *dpc, const char *what_respecified,
927 char **update, const char *value) {
928 if (*update) {
929 if (**update) { xlu__disk_err(dpc,value,what_respecified); return; }
930 free(*update); /* do not complain about overwriting empty strings */
931 }
932 *update = strdup(value);
933 }
934
935 #define DPC dpc /* our convention in lexer helper functions */
936
937 /* Sets ->readwrite from the string. This ought to be an enum, perhaps. */
setaccess(DiskParseContext * dpc,const char * str)938 static void setaccess(DiskParseContext *dpc, const char *str) {
939 if (!strcmp(str, "r") || !strcmp(str, "ro")) {
940 dpc->disk->readwrite = 0;
941 } else if (!strcmp(str, "rw") || !strcmp(str, "w") || !strcmp(str,"")) {
942 dpc->disk->readwrite = 1;
943 } else {
944 xlu__disk_err(dpc,str,"unknown value for access");
945 }
946 }
947
948 /* Sets ->format from the string. IDL should provide something for this. */
setformat(DiskParseContext * dpc,const char * str)949 static void setformat(DiskParseContext *dpc, const char *str) {
950 if (!strcmp(str,"")) DSET(dpc,format,FORMAT,str,RAW);
951 else if (!strcmp(str,"raw")) DSET(dpc,format,FORMAT,str,RAW);
952 else if (!strcmp(str,"qcow")) DSET(dpc,format,FORMAT,str,QCOW);
953 else if (!strcmp(str,"qcow2")) DSET(dpc,format,FORMAT,str,QCOW2);
954 else if (!strcmp(str,"vhd")) DSET(dpc,format,FORMAT,str,VHD);
955 else if (!strcmp(str,"empty")) DSET(dpc,format,FORMAT,str,EMPTY);
956 else if (!strcmp(str,"qed")) DSET(dpc,format,FORMAT,str,QED);
957 else xlu__disk_err(dpc,str,"unknown value for format");
958 }
959
960 /* Sets ->backend from the string. IDL should provide something for this. */
setbackendtype(DiskParseContext * dpc,const char * str)961 static void setbackendtype(DiskParseContext *dpc, const char *str) {
962 if ( !strcmp(str,"phy")) DSET(dpc,backend,BACKEND,str,PHY);
963 else if (!strcmp(str,"tap")) DSET(dpc,backend,BACKEND,str,TAP);
964 else if (!strcmp(str,"qdisk")) DSET(dpc,backend,BACKEND,str,QDISK);
965 else xlu__disk_err(dpc,str,"unknown value for backendtype");
966 }
967
968 /* Sets ->colo-port from the string. COLO need this. */
setcoloport(DiskParseContext * dpc,const char * str)969 static void setcoloport(DiskParseContext *dpc, const char *str) {
970 int port = atoi(str);
971 if (port) {
972 dpc->disk->colo_port = port;
973 } else {
974 xlu__disk_err(dpc,str,"unknown value for colo_port");
975 }
976 }
977
978 #define DEPRECATE(usewhatinstead) /* not currently reported */
979
980 /* Handles a vdev positional parameter which includes a devtype. */
vdev_and_devtype(DiskParseContext * dpc,char * str)981 static int vdev_and_devtype(DiskParseContext *dpc, char *str) {
982 /* returns 1 if it was <vdev>:<devtype>, 0 (doing nothing) otherwise */
983 char *colon = strrchr(str, ':');
984 if (!colon)
985 return 0;
986
987 DEPRECATE("use `devtype=...'");
988 *colon++ = 0;
989 SAVESTRING("vdev", vdev, str);
990
991 if (!strcmp(colon,"cdrom")) {
992 DPC->disk->is_cdrom = 1;
993 } else if (!strcmp(colon,"disk")) {
994 DPC->disk->is_cdrom = 0;
995 } else {
996 xlu__disk_err(DPC,colon,"unknown deprecated type");
997 }
998 return 1;
999 }
1000
1001 #undef DPC /* needs to be defined differently the actual lexer */
1002 #define DPC ((DiskParseContext*)yyextra)
1003
1004
1005 #line 1006 "libxlu_disk_l.c"
1006
1007 #define INITIAL 0
1008 #define LEXERR 1
1009
1010 #ifndef YY_NO_UNISTD_H
1011 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1012 * down here because we want the user's section 1 to have been scanned first.
1013 * The user has a chance to override it with an option.
1014 */
1015 #include <unistd.h>
1016 #endif
1017
1018 #ifndef YY_EXTRA_TYPE
1019 #define YY_EXTRA_TYPE void *
1020 #endif
1021
1022 /* Holds the entire state of the reentrant scanner. */
1023 struct yyguts_t
1024 {
1025
1026 /* User-defined. Not touched by flex. */
1027 YY_EXTRA_TYPE yyextra_r;
1028
1029 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1030 FILE *yyin_r, *yyout_r;
1031 size_t yy_buffer_stack_top; /**< index of top of stack. */
1032 size_t yy_buffer_stack_max; /**< capacity of stack. */
1033 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1034 char yy_hold_char;
1035 yy_size_t yy_n_chars;
1036 yy_size_t yyleng_r;
1037 char *yy_c_buf_p;
1038 int yy_init;
1039 int yy_start;
1040 int yy_did_buffer_switch_on_eof;
1041 int yy_start_stack_ptr;
1042 int yy_start_stack_depth;
1043 int *yy_start_stack;
1044 yy_state_type yy_last_accepting_state;
1045 char* yy_last_accepting_cpos;
1046
1047 int yylineno_r;
1048 int yy_flex_debug_r;
1049
1050 yy_state_type *yy_state_buf;
1051 yy_state_type *yy_state_ptr;
1052 char *yy_full_match;
1053 int yy_lp;
1054
1055 /* These are only needed for trailing context rules,
1056 * but there's no conditional variable for that yet. */
1057 int yy_looking_for_trail_begin;
1058 int yy_full_lp;
1059 int *yy_full_state;
1060
1061 char *yytext_r;
1062 int yy_more_flag;
1063 int yy_more_len;
1064
1065 }; /* end struct yyguts_t */
1066
1067 static int yy_init_globals (yyscan_t yyscanner );
1068
1069 int xlu__disk_yylex_init (yyscan_t* scanner);
1070
1071 int xlu__disk_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1072
1073 /* Accessor methods to globals.
1074 These are made visible to non-reentrant scanners for convenience. */
1075
1076 int xlu__disk_yylex_destroy (yyscan_t yyscanner );
1077
1078 int xlu__disk_yyget_debug (yyscan_t yyscanner );
1079
1080 void xlu__disk_yyset_debug (int debug_flag ,yyscan_t yyscanner );
1081
1082 YY_EXTRA_TYPE xlu__disk_yyget_extra (yyscan_t yyscanner );
1083
1084 void xlu__disk_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1085
1086 FILE *xlu__disk_yyget_in (yyscan_t yyscanner );
1087
1088 void xlu__disk_yyset_in (FILE * in_str ,yyscan_t yyscanner );
1089
1090 FILE *xlu__disk_yyget_out (yyscan_t yyscanner );
1091
1092 void xlu__disk_yyset_out (FILE * out_str ,yyscan_t yyscanner );
1093
1094 yy_size_t xlu__disk_yyget_leng (yyscan_t yyscanner );
1095
1096 char *xlu__disk_yyget_text (yyscan_t yyscanner );
1097
1098 int xlu__disk_yyget_lineno (yyscan_t yyscanner );
1099
1100 void xlu__disk_yyset_lineno (int line_number ,yyscan_t yyscanner );
1101
1102 int xlu__disk_yyget_column (yyscan_t yyscanner );
1103
1104 void xlu__disk_yyset_column (int column_no ,yyscan_t yyscanner );
1105
1106 /* Macros after this point can all be overridden by user definitions in
1107 * section 1.
1108 */
1109
1110 #ifndef YY_SKIP_YYWRAP
1111 #ifdef __cplusplus
1112 extern "C" int xlu__disk_yywrap (yyscan_t yyscanner );
1113 #else
1114 extern int xlu__disk_yywrap (yyscan_t yyscanner );
1115 #endif
1116 #endif
1117
1118 #ifndef yytext_ptr
1119 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1120 #endif
1121
1122 #ifdef YY_NEED_STRLEN
1123 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1124 #endif
1125
1126 #ifndef YY_NO_INPUT
1127
1128 #ifdef __cplusplus
1129 static int yyinput (yyscan_t yyscanner );
1130 #else
1131 static int input (yyscan_t yyscanner );
1132 #endif
1133
1134 #endif
1135
1136 /* Amount of stuff to slurp up with each read. */
1137 #ifndef YY_READ_BUF_SIZE
1138 #ifdef __ia64__
1139 /* On IA-64, the buffer size is 16k, not 8k */
1140 #define YY_READ_BUF_SIZE 16384
1141 #else
1142 #define YY_READ_BUF_SIZE 8192
1143 #endif /* __ia64__ */
1144 #endif
1145
1146 /* Copy whatever the last rule matched to the standard output. */
1147 #ifndef ECHO
1148 /* This used to be an fputs(), but since the string might contain NUL's,
1149 * we now use fwrite().
1150 */
1151 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1152 #endif
1153
1154 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1155 * is returned in "result".
1156 */
1157 #ifndef YY_INPUT
1158 #define YY_INPUT(buf,result,max_size) \
1159 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1160 { \
1161 int c = '*'; \
1162 int n; \
1163 for ( n = 0; n < max_size && \
1164 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1165 buf[n] = (char) c; \
1166 if ( c == '\n' ) \
1167 buf[n++] = (char) c; \
1168 if ( c == EOF && ferror( yyin ) ) \
1169 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1170 result = n; \
1171 } \
1172 else \
1173 { \
1174 errno=0; \
1175 while ( (result = fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1176 { \
1177 if( errno != EINTR) \
1178 { \
1179 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1180 break; \
1181 } \
1182 errno=0; \
1183 clearerr(yyin); \
1184 } \
1185 }\
1186 \
1187
1188 #endif
1189
1190 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1191 * we don't want an extra ';' after the "return" because that will cause
1192 * some compilers to complain about unreachable statements.
1193 */
1194 #ifndef yyterminate
1195 #define yyterminate() return YY_NULL
1196 #endif
1197
1198 /* Number of entries by which start-condition stack grows. */
1199 #ifndef YY_START_STACK_INCR
1200 #define YY_START_STACK_INCR 25
1201 #endif
1202
1203 /* Report a fatal error. */
1204 #ifndef YY_FATAL_ERROR
1205 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1206 #endif
1207
1208 /* end tables serialization structures and prototypes */
1209
1210 /* Default declaration of generated scanner - a define so the user can
1211 * easily add parameters.
1212 */
1213 #ifndef YY_DECL
1214 #define YY_DECL_IS_OURS 1
1215
1216 extern int xlu__disk_yylex (yyscan_t yyscanner);
1217
1218 #define YY_DECL int xlu__disk_yylex (yyscan_t yyscanner)
1219 #endif /* !YY_DECL */
1220
1221 /* Code executed at the beginning of each rule, after yytext and yyleng
1222 * have been set up.
1223 */
1224 #ifndef YY_USER_ACTION
1225 #define YY_USER_ACTION
1226 #endif
1227
1228 /* Code executed at the end of each rule. */
1229 #ifndef YY_BREAK
1230 #define YY_BREAK break;
1231 #endif
1232
1233 #define YY_RULE_SETUP \
1234 YY_USER_ACTION
1235
1236 /** The main scanner function which does all the work.
1237 */
1238 YY_DECL
1239 {
1240 register yy_state_type yy_current_state;
1241 register char *yy_cp, *yy_bp;
1242 register int yy_act;
1243 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1244
1245 if ( !yyg->yy_init )
1246 {
1247 yyg->yy_init = 1;
1248
1249 #ifdef YY_USER_INIT
1250 YY_USER_INIT;
1251 #endif
1252
1253 /* Create the reject buffer large enough to save one state per allowed character. */
1254 if ( ! yyg->yy_state_buf )
1255 yyg->yy_state_buf = (yy_state_type *)xlu__disk_yyalloc(YY_STATE_BUF_SIZE ,yyscanner);
1256 if ( ! yyg->yy_state_buf )
1257 YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yylex()" );
1258
1259 if ( ! yyg->yy_start )
1260 yyg->yy_start = 1; /* first start state */
1261
1262 if ( ! yyin )
1263 yyin = stdin;
1264
1265 if ( ! yyout )
1266 yyout = stdout;
1267
1268 if ( ! YY_CURRENT_BUFFER ) {
1269 xlu__disk_yyensure_buffer_stack (yyscanner);
1270 YY_CURRENT_BUFFER_LVALUE =
1271 xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1272 }
1273
1274 xlu__disk_yy_load_buffer_state(yyscanner );
1275 }
1276
1277 {
1278 #line 166 "libxlu_disk_l.l"
1279
1280
1281 /*----- the scanner rules which do the parsing -----*/
1282
1283 #line 1284 "libxlu_disk_l.c"
1284
1285 while ( 1 ) /* loops until end-of-file is reached */
1286 {
1287 yyg->yy_more_len = 0;
1288 if ( yyg->yy_more_flag )
1289 {
1290 yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
1291 yyg->yy_more_flag = 0;
1292 }
1293 yy_cp = yyg->yy_c_buf_p;
1294
1295 /* Support of yytext. */
1296 *yy_cp = yyg->yy_hold_char;
1297
1298 /* yy_bp points to the position in yy_ch_buf of the start of
1299 * the current run.
1300 */
1301 yy_bp = yy_cp;
1302
1303 yy_current_state = yyg->yy_start;
1304
1305 yyg->yy_state_ptr = yyg->yy_state_buf;
1306 *yyg->yy_state_ptr++ = yy_current_state;
1307
1308 yy_match:
1309 do
1310 {
1311 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1312 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1313 {
1314 yy_current_state = (int) yy_def[yy_current_state];
1315 if ( yy_current_state >= 355 )
1316 yy_c = yy_meta[(unsigned int) yy_c];
1317 }
1318 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1319 *yyg->yy_state_ptr++ = yy_current_state;
1320 ++yy_cp;
1321 }
1322 while ( yy_current_state != 354 );
1323
1324 yy_find_action:
1325 yy_current_state = *--yyg->yy_state_ptr;
1326 yyg->yy_lp = yy_accept[yy_current_state];
1327 find_rule: /* we branch to this label when backing up */
1328 for ( ; ; ) /* until we find what rule we matched */
1329 {
1330 if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] )
1331 {
1332 yy_act = yy_acclist[yyg->yy_lp];
1333 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1334 yyg->yy_looking_for_trail_begin )
1335 {
1336 if ( yy_act == yyg->yy_looking_for_trail_begin )
1337 {
1338 yyg->yy_looking_for_trail_begin = 0;
1339 yy_act &= ~YY_TRAILING_HEAD_MASK;
1340 break;
1341 }
1342 }
1343 else if ( yy_act & YY_TRAILING_MASK )
1344 {
1345 yyg->yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
1346 yyg->yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
1347 }
1348 else
1349 {
1350 yyg->yy_full_match = yy_cp;
1351 yyg->yy_full_state = yyg->yy_state_ptr;
1352 yyg->yy_full_lp = yyg->yy_lp;
1353 break;
1354 }
1355 ++yyg->yy_lp;
1356 goto find_rule;
1357 }
1358 --yy_cp;
1359 yy_current_state = *--yyg->yy_state_ptr;
1360 yyg->yy_lp = yy_accept[yy_current_state];
1361 }
1362
1363 YY_DO_BEFORE_ACTION;
1364
1365 do_action: /* This label is used only to access EOF actions. */
1366
1367 switch ( yy_act )
1368 { /* beginning of action switch */
1369 case 1:
1370 /* rule 1 can match eol */
1371 YY_RULE_SETUP
1372 #line 170 "libxlu_disk_l.l"
1373 { /* ignore whitespace before parameters */ }
1374 YY_BREAK
1375 /* ordinary parameters setting enums or strings */
1376 case 2:
1377 /* rule 2 can match eol */
1378 YY_RULE_SETUP
1379 #line 174 "libxlu_disk_l.l"
1380 { STRIP(','); setformat(DPC, FROMEQUALS); }
1381 YY_BREAK
1382 case 3:
1383 YY_RULE_SETUP
1384 #line 176 "libxlu_disk_l.l"
1385 { DPC->disk->is_cdrom = 1; }
1386 YY_BREAK
1387 case 4:
1388 YY_RULE_SETUP
1389 #line 177 "libxlu_disk_l.l"
1390 { DPC->disk->is_cdrom = 1; }
1391 YY_BREAK
1392 case 5:
1393 YY_RULE_SETUP
1394 #line 178 "libxlu_disk_l.l"
1395 { DPC->disk->is_cdrom = 0; }
1396 YY_BREAK
1397 case 6:
1398 /* rule 6 can match eol */
1399 YY_RULE_SETUP
1400 #line 179 "libxlu_disk_l.l"
1401 { xlu__disk_err(DPC,yytext,"unknown value for type"); }
1402 YY_BREAK
1403 case 7:
1404 /* rule 7 can match eol */
1405 YY_RULE_SETUP
1406 #line 181 "libxlu_disk_l.l"
1407 { STRIP(','); setaccess(DPC, FROMEQUALS); }
1408 YY_BREAK
1409 case 8:
1410 /* rule 8 can match eol */
1411 YY_RULE_SETUP
1412 #line 182 "libxlu_disk_l.l"
1413 { STRIP(','); SAVESTRING("backend", backend_domname, FROMEQUALS); }
1414 YY_BREAK
1415 case 9:
1416 /* rule 9 can match eol */
1417 YY_RULE_SETUP
1418 #line 183 "libxlu_disk_l.l"
1419 { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
1420 YY_BREAK
1421 case 10:
1422 /* rule 10 can match eol */
1423 YY_RULE_SETUP
1424 #line 185 "libxlu_disk_l.l"
1425 { STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
1426 YY_BREAK
1427 case 11:
1428 /* rule 11 can match eol */
1429 YY_RULE_SETUP
1430 #line 186 "libxlu_disk_l.l"
1431 { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
1432 YY_BREAK
1433 case 12:
1434 YY_RULE_SETUP
1435 #line 187 "libxlu_disk_l.l"
1436 { DPC->disk->direct_io_safe = 1; }
1437 YY_BREAK
1438 case 13:
1439 YY_RULE_SETUP
1440 #line 188 "libxlu_disk_l.l"
1441 { libxl_defbool_set(&DPC->disk->discard_enable, true); }
1442 YY_BREAK
1443 case 14:
1444 YY_RULE_SETUP
1445 #line 189 "libxlu_disk_l.l"
1446 { libxl_defbool_set(&DPC->disk->discard_enable, false); }
1447 YY_BREAK
1448 /* Note that the COLO configuration settings should be considered unstable.
1449 * They may change incompatibly in future versions of Xen. */
1450 case 15:
1451 YY_RULE_SETUP
1452 #line 192 "libxlu_disk_l.l"
1453 { libxl_defbool_set(&DPC->disk->colo_enable, true); }
1454 YY_BREAK
1455 case 16:
1456 YY_RULE_SETUP
1457 #line 193 "libxlu_disk_l.l"
1458 { libxl_defbool_set(&DPC->disk->colo_enable, false); }
1459 YY_BREAK
1460 case 17:
1461 /* rule 17 can match eol */
1462 YY_RULE_SETUP
1463 #line 194 "libxlu_disk_l.l"
1464 { STRIP(','); SAVESTRING("colo-host", colo_host, FROMEQUALS); }
1465 YY_BREAK
1466 case 18:
1467 /* rule 18 can match eol */
1468 YY_RULE_SETUP
1469 #line 195 "libxlu_disk_l.l"
1470 { STRIP(','); setcoloport(DPC, FROMEQUALS); }
1471 YY_BREAK
1472 case 19:
1473 /* rule 19 can match eol */
1474 YY_RULE_SETUP
1475 #line 196 "libxlu_disk_l.l"
1476 { STRIP(','); SAVESTRING("colo-export", colo_export, FROMEQUALS); }
1477 YY_BREAK
1478 case 20:
1479 /* rule 20 can match eol */
1480 YY_RULE_SETUP
1481 #line 197 "libxlu_disk_l.l"
1482 { STRIP(','); SAVESTRING("active-disk", active_disk, FROMEQUALS); }
1483 YY_BREAK
1484 case 21:
1485 /* rule 21 can match eol */
1486 YY_RULE_SETUP
1487 #line 198 "libxlu_disk_l.l"
1488 { STRIP(','); SAVESTRING("hidden-disk", hidden_disk, FROMEQUALS); }
1489 YY_BREAK
1490 /* the target magic parameter, eats the rest of the string */
1491 case 22:
1492 YY_RULE_SETUP
1493 #line 202 "libxlu_disk_l.l"
1494 { STRIP(','); SAVESTRING("target", pdev_path, FROMEQUALS); }
1495 YY_BREAK
1496 /* unknown parameters */
1497 case 23:
1498 /* rule 23 can match eol */
1499 YY_RULE_SETUP
1500 #line 206 "libxlu_disk_l.l"
1501 { xlu__disk_err(DPC,yytext,"unknown parameter"); }
1502 YY_BREAK
1503 /* deprecated prefixes */
1504 /* the "/.*" in these patterns ensures that they count as if they
1505 * matched the whole string, so these patterns take precedence */
1506 case 24:
1507 YY_RULE_SETUP
1508 #line 213 "libxlu_disk_l.l"
1509 {
1510 STRIP(':');
1511 DPC->had_depr_prefix=1; DEPRECATE("use `[format=]...,'");
1512 setformat(DPC, yytext);
1513 }
1514 YY_BREAK
1515 case 25:
1516 YY_RULE_SETUP
1517 #line 219 "libxlu_disk_l.l"
1518 {
1519 char *newscript;
1520 STRIP(':');
1521 DPC->had_depr_prefix=1; DEPRECATE("use `script=...'");
1522 if (asprintf(&newscript, "block-%s", yytext) < 0) {
1523 xlu__disk_err(DPC,yytext,"unable to format script");
1524 return 0;
1525 }
1526 savestring(DPC, "script respecified",
1527 &DPC->disk->script, newscript);
1528 free(newscript);
1529 }
1530 YY_BREAK
1531 case 26:
1532 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1533 yyg->yy_c_buf_p = yy_cp = yy_bp + 8;
1534 YY_DO_BEFORE_ACTION; /* set up yytext again */
1535 YY_RULE_SETUP
1536 #line 232 "libxlu_disk_l.l"
1537 { DPC->had_depr_prefix=1; DEPRECATE(0); }
1538 YY_BREAK
1539 case 27:
1540 YY_RULE_SETUP
1541 #line 233 "libxlu_disk_l.l"
1542 { DPC->had_depr_prefix=1; DEPRECATE(0); }
1543 YY_BREAK
1544 case 28:
1545 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1546 yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
1547 YY_DO_BEFORE_ACTION; /* set up yytext again */
1548 YY_RULE_SETUP
1549 #line 234 "libxlu_disk_l.l"
1550 { DPC->had_depr_prefix=1; DEPRECATE(0); }
1551 YY_BREAK
1552 case 29:
1553 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1554 yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
1555 YY_DO_BEFORE_ACTION; /* set up yytext again */
1556 YY_RULE_SETUP
1557 #line 235 "libxlu_disk_l.l"
1558 { DPC->had_depr_prefix=1; DEPRECATE(0); }
1559 YY_BREAK
1560 case 30:
1561 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1562 yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
1563 YY_DO_BEFORE_ACTION; /* set up yytext again */
1564 YY_RULE_SETUP
1565 #line 236 "libxlu_disk_l.l"
1566 { DPC->had_depr_prefix=1; DEPRECATE(0); }
1567 YY_BREAK
1568 case 31:
1569 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1570 yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
1571 YY_DO_BEFORE_ACTION; /* set up yytext again */
1572 YY_RULE_SETUP
1573 #line 237 "libxlu_disk_l.l"
1574 { DPC->had_depr_prefix=1; DEPRECATE(0); }
1575 YY_BREAK
1576 case 32:
1577 /* rule 32 can match eol */
1578 YY_RULE_SETUP
1579 #line 239 "libxlu_disk_l.l"
1580 {
1581 xlu__disk_err(DPC,yytext,"unknown deprecated disk prefix");
1582 return 0;
1583 }
1584 YY_BREAK
1585 /* positional parameters */
1586 case 33:
1587 /* rule 33 can match eol */
1588 YY_RULE_SETUP
1589 #line 246 "libxlu_disk_l.l"
1590 {
1591 STRIP(',');
1592
1593 if (DPC->err) {
1594 /* previous errors may just lead to subsequent ones */
1595 } else if (!DPC->disk->pdev_path) {
1596 SAVESTRING("target", pdev_path, yytext);
1597 } else if (!DPC->had_depr_prefix &&
1598 DPC->disk->format == LIBXL_DISK_FORMAT_UNKNOWN) {
1599 if (!*DPC->disk->pdev_path && vdev_and_devtype(DPC,yytext)) {
1600 DPC->disk->format = LIBXL_DISK_FORMAT_EMPTY;
1601 } else {
1602 setformat(DPC,yytext);
1603 }
1604 } else if (!DPC->disk->vdev) {
1605 if (!vdev_and_devtype(DPC,yytext))
1606 SAVESTRING("vdev", vdev, yytext);
1607 } else if (!DPC->access_set) {
1608 DPC->access_set = 1;
1609 setaccess(DPC,yytext);
1610 } else {
1611 xlu__disk_err(DPC,yytext,"too many positional parameters");
1612 return 0; /* don't print any more errors */
1613 }
1614 }
1615 YY_BREAK
1616 case 34:
1617 YY_RULE_SETUP
1618 #line 272 "libxlu_disk_l.l"
1619 {
1620 BEGIN(LEXERR);
1621 yymore();
1622 }
1623 YY_BREAK
1624 case 35:
1625 YY_RULE_SETUP
1626 #line 276 "libxlu_disk_l.l"
1627 {
1628 xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
1629 }
1630 YY_BREAK
1631 case 36:
1632 YY_RULE_SETUP
1633 #line 279 "libxlu_disk_l.l"
1634 YY_FATAL_ERROR( "flex scanner jammed" );
1635 YY_BREAK
1636 #line 1637 "libxlu_disk_l.c"
1637 case YY_STATE_EOF(INITIAL):
1638 case YY_STATE_EOF(LEXERR):
1639 yyterminate();
1640
1641 case YY_END_OF_BUFFER:
1642 {
1643 /* Amount of text matched not including the EOB char. */
1644 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1645
1646 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1647 *yy_cp = yyg->yy_hold_char;
1648 YY_RESTORE_YY_MORE_OFFSET
1649
1650 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1651 {
1652 /* We're scanning a new file or input source. It's
1653 * possible that this happened because the user
1654 * just pointed yyin at a new source and called
1655 * xlu__disk_yylex(). If so, then we have to assure
1656 * consistency between YY_CURRENT_BUFFER and our
1657 * globals. Here is the right place to do so, because
1658 * this is the first action (other than possibly a
1659 * back-up) that will match for the new input source.
1660 */
1661 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1662 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1663 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1664 }
1665
1666 /* Note that here we test for yy_c_buf_p "<=" to the position
1667 * of the first EOB in the buffer, since yy_c_buf_p will
1668 * already have been incremented past the NUL character
1669 * (since all states make transitions on EOB to the
1670 * end-of-buffer state). Contrast this with the test
1671 * in input().
1672 */
1673 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1674 { /* This was really a NUL. */
1675 yy_state_type yy_next_state;
1676
1677 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1678
1679 yy_current_state = yy_get_previous_state( yyscanner );
1680
1681 /* Okay, we're now positioned to make the NUL
1682 * transition. We couldn't have
1683 * yy_get_previous_state() go ahead and do it
1684 * for us because it doesn't know how to deal
1685 * with the possibility of jamming (and we don't
1686 * want to build jamming into it because then it
1687 * will run more slowly).
1688 */
1689
1690 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1691
1692 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1693
1694 if ( yy_next_state )
1695 {
1696 /* Consume the NUL. */
1697 yy_cp = ++yyg->yy_c_buf_p;
1698 yy_current_state = yy_next_state;
1699 goto yy_match;
1700 }
1701
1702 else
1703 {
1704 yy_cp = yyg->yy_c_buf_p;
1705 goto yy_find_action;
1706 }
1707 }
1708
1709 else switch ( yy_get_next_buffer( yyscanner ) )
1710 {
1711 case EOB_ACT_END_OF_FILE:
1712 {
1713 yyg->yy_did_buffer_switch_on_eof = 0;
1714
1715 if ( xlu__disk_yywrap(yyscanner ) )
1716 {
1717 /* Note: because we've taken care in
1718 * yy_get_next_buffer() to have set up
1719 * yytext, we can now set up
1720 * yy_c_buf_p so that if some total
1721 * hoser (like flex itself) wants to
1722 * call the scanner after we return the
1723 * YY_NULL, it'll still work - another
1724 * YY_NULL will get returned.
1725 */
1726 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1727
1728 yy_act = YY_STATE_EOF(YY_START);
1729 goto do_action;
1730 }
1731
1732 else
1733 {
1734 if ( ! yyg->yy_did_buffer_switch_on_eof )
1735 YY_NEW_FILE;
1736 }
1737 break;
1738 }
1739
1740 case EOB_ACT_CONTINUE_SCAN:
1741 yyg->yy_c_buf_p =
1742 yyg->yytext_ptr + yy_amount_of_matched_text;
1743
1744 yy_current_state = yy_get_previous_state( yyscanner );
1745
1746 yy_cp = yyg->yy_c_buf_p;
1747 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1748 goto yy_match;
1749
1750 case EOB_ACT_LAST_MATCH:
1751 yyg->yy_c_buf_p =
1752 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1753
1754 yy_current_state = yy_get_previous_state( yyscanner );
1755
1756 yy_cp = yyg->yy_c_buf_p;
1757 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1758 goto yy_find_action;
1759 }
1760 break;
1761 }
1762
1763 default:
1764 YY_FATAL_ERROR(
1765 "fatal flex scanner internal error--no action found" );
1766 } /* end of action switch */
1767 } /* end of scanning one token */
1768 } /* end of user's declarations */
1769 } /* end of xlu__disk_yylex */
1770
1771 /* yy_get_next_buffer - try to read in a new buffer
1772 *
1773 * Returns a code representing an action:
1774 * EOB_ACT_LAST_MATCH -
1775 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1776 * EOB_ACT_END_OF_FILE - end of file
1777 */
yy_get_next_buffer(yyscan_t yyscanner)1778 static int yy_get_next_buffer (yyscan_t yyscanner)
1779 {
1780 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1781 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1782 register char *source = yyg->yytext_ptr;
1783 register int number_to_move, i;
1784 int ret_val;
1785
1786 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1787 YY_FATAL_ERROR(
1788 "fatal flex scanner internal error--end of buffer missed" );
1789
1790 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1791 { /* Don't try to fill the buffer, so this is an EOF. */
1792 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1793 {
1794 /* We matched a single character, the EOB, so
1795 * treat this as a final EOF.
1796 */
1797 return EOB_ACT_END_OF_FILE;
1798 }
1799
1800 else
1801 {
1802 /* We matched some text prior to the EOB, first
1803 * process it.
1804 */
1805 return EOB_ACT_LAST_MATCH;
1806 }
1807 }
1808
1809 /* Try to read more data. */
1810
1811 /* First move last chars to start of buffer. */
1812 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1813
1814 for ( i = 0; i < number_to_move; ++i )
1815 *(dest++) = *(source++);
1816
1817 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1818 /* don't do the read, it's not guaranteed to return an EOF,
1819 * just force an EOF
1820 */
1821 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1822
1823 else
1824 {
1825 int num_to_read =
1826 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1827
1828 while ( num_to_read <= 0 )
1829 { /* Not enough room in the buffer - grow it. */
1830
1831 YY_FATAL_ERROR(
1832 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1833
1834 }
1835
1836 if ( num_to_read > YY_READ_BUF_SIZE )
1837 num_to_read = YY_READ_BUF_SIZE;
1838
1839 /* Read in more data. */
1840 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1841 yyg->yy_n_chars, num_to_read );
1842
1843 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1844 }
1845
1846 if ( yyg->yy_n_chars == 0 )
1847 {
1848 if ( number_to_move == YY_MORE_ADJ )
1849 {
1850 ret_val = EOB_ACT_END_OF_FILE;
1851 xlu__disk_yyrestart(yyin ,yyscanner);
1852 }
1853
1854 else
1855 {
1856 ret_val = EOB_ACT_LAST_MATCH;
1857 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1858 YY_BUFFER_EOF_PENDING;
1859 }
1860 }
1861
1862 else
1863 ret_val = EOB_ACT_CONTINUE_SCAN;
1864
1865 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1866 /* Extend the array by 50%, plus the number we really need. */
1867 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1868 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xlu__disk_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1869 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1870 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1871 }
1872
1873 yyg->yy_n_chars += number_to_move;
1874 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1875 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1876
1877 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1878
1879 return ret_val;
1880 }
1881
1882 /* yy_get_previous_state - get the state just before the EOB char was reached */
1883
yy_get_previous_state(yyscan_t yyscanner)1884 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1885 {
1886 register yy_state_type yy_current_state;
1887 register char *yy_cp;
1888 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1889
1890 yy_current_state = yyg->yy_start;
1891
1892 yyg->yy_state_ptr = yyg->yy_state_buf;
1893 *yyg->yy_state_ptr++ = yy_current_state;
1894
1895 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1896 {
1897 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1898 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1899 {
1900 yy_current_state = (int) yy_def[yy_current_state];
1901 if ( yy_current_state >= 355 )
1902 yy_c = yy_meta[(unsigned int) yy_c];
1903 }
1904 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1905 *yyg->yy_state_ptr++ = yy_current_state;
1906 }
1907
1908 return yy_current_state;
1909 }
1910
1911 /* yy_try_NUL_trans - try to make a transition on the NUL character
1912 *
1913 * synopsis
1914 * next_state = yy_try_NUL_trans( current_state );
1915 */
yy_try_NUL_trans(yy_state_type yy_current_state,yyscan_t yyscanner)1916 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1917 {
1918 register int yy_is_jam;
1919 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1920
1921 register YY_CHAR yy_c = 1;
1922 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1923 {
1924 yy_current_state = (int) yy_def[yy_current_state];
1925 if ( yy_current_state >= 355 )
1926 yy_c = yy_meta[(unsigned int) yy_c];
1927 }
1928 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1929 yy_is_jam = (yy_current_state == 354);
1930 if ( ! yy_is_jam )
1931 *yyg->yy_state_ptr++ = yy_current_state;
1932
1933 (void)yyg;
1934 return yy_is_jam ? 0 : yy_current_state;
1935 }
1936
1937 #ifndef YY_NO_INPUT
1938 #ifdef __cplusplus
yyinput(yyscan_t yyscanner)1939 static int yyinput (yyscan_t yyscanner)
1940 #else
1941 static int input (yyscan_t yyscanner)
1942 #endif
1943
1944 {
1945 int c;
1946 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1947
1948 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1949
1950 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1951 {
1952 /* yy_c_buf_p now points to the character we want to return.
1953 * If this occurs *before* the EOB characters, then it's a
1954 * valid NUL; if not, then we've hit the end of the buffer.
1955 */
1956 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1957 /* This was really a NUL. */
1958 *yyg->yy_c_buf_p = '\0';
1959
1960 else
1961 { /* need more input */
1962 yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1963 ++yyg->yy_c_buf_p;
1964
1965 switch ( yy_get_next_buffer( yyscanner ) )
1966 {
1967 case EOB_ACT_LAST_MATCH:
1968 /* This happens because yy_g_n_b()
1969 * sees that we've accumulated a
1970 * token and flags that we need to
1971 * try matching the token before
1972 * proceeding. But for input(),
1973 * there's no matching to consider.
1974 * So convert the EOB_ACT_LAST_MATCH
1975 * to EOB_ACT_END_OF_FILE.
1976 */
1977
1978 /* Reset buffer status. */
1979 xlu__disk_yyrestart(yyin ,yyscanner);
1980
1981 /*FALLTHROUGH*/
1982
1983 case EOB_ACT_END_OF_FILE:
1984 {
1985 if ( xlu__disk_yywrap(yyscanner ) )
1986 return EOF;
1987
1988 if ( ! yyg->yy_did_buffer_switch_on_eof )
1989 YY_NEW_FILE;
1990 #ifdef __cplusplus
1991 return yyinput(yyscanner);
1992 #else
1993 return input(yyscanner);
1994 #endif
1995 }
1996
1997 case EOB_ACT_CONTINUE_SCAN:
1998 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1999 break;
2000 }
2001 }
2002 }
2003
2004 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2005 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2006 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2007
2008 return c;
2009 }
2010 #endif /* ifndef YY_NO_INPUT */
2011
2012 /** Immediately switch to a different input stream.
2013 * @param input_file A readable stream.
2014 * @param yyscanner The scanner object.
2015 * @note This function does not reset the start condition to @c INITIAL .
2016 */
xlu__disk_yyrestart(FILE * input_file,yyscan_t yyscanner)2017 void xlu__disk_yyrestart (FILE * input_file , yyscan_t yyscanner)
2018 {
2019 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2020
2021 if ( ! YY_CURRENT_BUFFER ){
2022 xlu__disk_yyensure_buffer_stack (yyscanner);
2023 YY_CURRENT_BUFFER_LVALUE =
2024 xlu__disk_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2025 }
2026
2027 xlu__disk_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2028 xlu__disk_yy_load_buffer_state(yyscanner );
2029 }
2030
2031 /** Switch to a different input buffer.
2032 * @param new_buffer The new input buffer.
2033 * @param yyscanner The scanner object.
2034 */
xlu__disk_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)2035 void xlu__disk_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2036 {
2037 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2038
2039 /* TODO. We should be able to replace this entire function body
2040 * with
2041 * xlu__disk_yypop_buffer_state();
2042 * xlu__disk_yypush_buffer_state(new_buffer);
2043 */
2044 xlu__disk_yyensure_buffer_stack (yyscanner);
2045 if ( YY_CURRENT_BUFFER == new_buffer )
2046 return;
2047
2048 if ( YY_CURRENT_BUFFER )
2049 {
2050 /* Flush out information for old buffer. */
2051 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2052 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2053 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2054 }
2055
2056 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2057 xlu__disk_yy_load_buffer_state(yyscanner );
2058
2059 /* We don't actually know whether we did this switch during
2060 * EOF (xlu__disk_yywrap()) processing, but the only time this flag
2061 * is looked at is after xlu__disk_yywrap() is called, so it's safe
2062 * to go ahead and always set it.
2063 */
2064 yyg->yy_did_buffer_switch_on_eof = 1;
2065 }
2066
xlu__disk_yy_load_buffer_state(yyscan_t yyscanner)2067 static void xlu__disk_yy_load_buffer_state (yyscan_t yyscanner)
2068 {
2069 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2070 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2071 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2072 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2073 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2074 }
2075
2076 /** Allocate and initialize an input buffer state.
2077 * @param file A readable stream.
2078 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2079 * @param yyscanner The scanner object.
2080 * @return the allocated buffer state.
2081 */
xlu__disk_yy_create_buffer(FILE * file,int size,yyscan_t yyscanner)2082 YY_BUFFER_STATE xlu__disk_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2083 {
2084 YY_BUFFER_STATE b;
2085
2086 b = (YY_BUFFER_STATE) xlu__disk_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2087 if ( ! b )
2088 YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_create_buffer()" );
2089
2090 b->yy_buf_size = size;
2091
2092 /* yy_ch_buf has to be 2 characters longer than the size given because
2093 * we need to put in 2 end-of-buffer characters.
2094 */
2095 b->yy_ch_buf = (char *) xlu__disk_yyalloc(b->yy_buf_size + 2 ,yyscanner );
2096 if ( ! b->yy_ch_buf )
2097 YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_create_buffer()" );
2098
2099 b->yy_is_our_buffer = 1;
2100
2101 xlu__disk_yy_init_buffer(b,file ,yyscanner);
2102
2103 return b;
2104 }
2105
2106 /** Destroy the buffer.
2107 * @param b a buffer created with xlu__disk_yy_create_buffer()
2108 * @param yyscanner The scanner object.
2109 */
xlu__disk_yy_delete_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)2110 void xlu__disk_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2111 {
2112 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2113
2114 if ( ! b )
2115 return;
2116
2117 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2118 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2119
2120 if ( b->yy_is_our_buffer )
2121 xlu__disk_yyfree((void *) b->yy_ch_buf ,yyscanner );
2122
2123 xlu__disk_yyfree((void *) b ,yyscanner );
2124 }
2125
2126 /* Initializes or reinitializes a buffer.
2127 * This function is sometimes called more than once on the same buffer,
2128 * such as during a xlu__disk_yyrestart() or at EOF.
2129 */
xlu__disk_yy_init_buffer(YY_BUFFER_STATE b,FILE * file,yyscan_t yyscanner)2130 static void xlu__disk_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2131
2132 {
2133 int oerrno = errno;
2134 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2135
2136 xlu__disk_yy_flush_buffer(b ,yyscanner);
2137
2138 b->yy_input_file = file;
2139 b->yy_fill_buffer = 1;
2140
2141 /* If b is the current buffer, then xlu__disk_yy_init_buffer was _probably_
2142 * called from xlu__disk_yyrestart() or through yy_get_next_buffer.
2143 * In that case, we don't want to reset the lineno or column.
2144 */
2145 if (b != YY_CURRENT_BUFFER){
2146 b->yy_bs_lineno = 1;
2147 b->yy_bs_column = 0;
2148 }
2149
2150 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2151
2152 errno = oerrno;
2153 }
2154
2155 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2156 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2157 * @param yyscanner The scanner object.
2158 */
xlu__disk_yy_flush_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)2159 void xlu__disk_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2160 {
2161 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2162 if ( ! b )
2163 return;
2164
2165 b->yy_n_chars = 0;
2166
2167 /* We always need two end-of-buffer characters. The first causes
2168 * a transition to the end-of-buffer state. The second causes
2169 * a jam in that state.
2170 */
2171 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2172 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2173
2174 b->yy_buf_pos = &b->yy_ch_buf[0];
2175
2176 b->yy_at_bol = 1;
2177 b->yy_buffer_status = YY_BUFFER_NEW;
2178
2179 if ( b == YY_CURRENT_BUFFER )
2180 xlu__disk_yy_load_buffer_state(yyscanner );
2181 }
2182
2183 /** Pushes the new state onto the stack. The new state becomes
2184 * the current state. This function will allocate the stack
2185 * if necessary.
2186 * @param new_buffer The new state.
2187 * @param yyscanner The scanner object.
2188 */
xlu__disk_yypush_buffer_state(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)2189 void xlu__disk_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2190 {
2191 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2192 if (new_buffer == NULL)
2193 return;
2194
2195 xlu__disk_yyensure_buffer_stack(yyscanner);
2196
2197 /* This block is copied from xlu__disk_yy_switch_to_buffer. */
2198 if ( YY_CURRENT_BUFFER )
2199 {
2200 /* Flush out information for old buffer. */
2201 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2202 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2203 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2204 }
2205
2206 /* Only push if top exists. Otherwise, replace top. */
2207 if (YY_CURRENT_BUFFER)
2208 yyg->yy_buffer_stack_top++;
2209 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2210
2211 /* copied from xlu__disk_yy_switch_to_buffer. */
2212 xlu__disk_yy_load_buffer_state(yyscanner );
2213 yyg->yy_did_buffer_switch_on_eof = 1;
2214 }
2215
2216 /** Removes and deletes the top of the stack, if present.
2217 * The next element becomes the new top.
2218 * @param yyscanner The scanner object.
2219 */
xlu__disk_yypop_buffer_state(yyscan_t yyscanner)2220 void xlu__disk_yypop_buffer_state (yyscan_t yyscanner)
2221 {
2222 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2223 if (!YY_CURRENT_BUFFER)
2224 return;
2225
2226 xlu__disk_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2227 YY_CURRENT_BUFFER_LVALUE = NULL;
2228 if (yyg->yy_buffer_stack_top > 0)
2229 --yyg->yy_buffer_stack_top;
2230
2231 if (YY_CURRENT_BUFFER) {
2232 xlu__disk_yy_load_buffer_state(yyscanner );
2233 yyg->yy_did_buffer_switch_on_eof = 1;
2234 }
2235 }
2236
2237 /* Allocates the stack if it does not exist.
2238 * Guarantees space for at least one push.
2239 */
xlu__disk_yyensure_buffer_stack(yyscan_t yyscanner)2240 static void xlu__disk_yyensure_buffer_stack (yyscan_t yyscanner)
2241 {
2242 yy_size_t num_to_alloc;
2243 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2244
2245 if (!yyg->yy_buffer_stack) {
2246
2247 /* First allocation is just for 2 elements, since we don't know if this
2248 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2249 * immediate realloc on the next call.
2250 */
2251 num_to_alloc = 1;
2252 yyg->yy_buffer_stack = (struct yy_buffer_state**)xlu__disk_yyalloc
2253 (num_to_alloc * sizeof(struct yy_buffer_state*)
2254 , yyscanner);
2255 if ( ! yyg->yy_buffer_stack )
2256 YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yyensure_buffer_stack()" );
2257
2258 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2259
2260 yyg->yy_buffer_stack_max = num_to_alloc;
2261 yyg->yy_buffer_stack_top = 0;
2262 return;
2263 }
2264
2265 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2266
2267 /* Increase the buffer to prepare for a possible push. */
2268 int grow_size = 8 /* arbitrary grow size */;
2269
2270 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2271 yyg->yy_buffer_stack = (struct yy_buffer_state**)xlu__disk_yyrealloc
2272 (yyg->yy_buffer_stack,
2273 num_to_alloc * sizeof(struct yy_buffer_state*)
2274 , yyscanner);
2275 if ( ! yyg->yy_buffer_stack )
2276 YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yyensure_buffer_stack()" );
2277
2278 /* zero only the new slots.*/
2279 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2280 yyg->yy_buffer_stack_max = num_to_alloc;
2281 }
2282 }
2283
2284 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2285 * @param base the character buffer
2286 * @param size the size in bytes of the character buffer
2287 * @param yyscanner The scanner object.
2288 * @return the newly allocated buffer state object.
2289 */
xlu__disk_yy_scan_buffer(char * base,yy_size_t size,yyscan_t yyscanner)2290 YY_BUFFER_STATE xlu__disk_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2291 {
2292 YY_BUFFER_STATE b;
2293
2294 if ( size < 2 ||
2295 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2296 base[size-1] != YY_END_OF_BUFFER_CHAR )
2297 /* They forgot to leave room for the EOB's. */
2298 return 0;
2299
2300 b = (YY_BUFFER_STATE) xlu__disk_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2301 if ( ! b )
2302 YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_scan_buffer()" );
2303
2304 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2305 b->yy_buf_pos = b->yy_ch_buf = base;
2306 b->yy_is_our_buffer = 0;
2307 b->yy_input_file = 0;
2308 b->yy_n_chars = b->yy_buf_size;
2309 b->yy_is_interactive = 0;
2310 b->yy_at_bol = 1;
2311 b->yy_fill_buffer = 0;
2312 b->yy_buffer_status = YY_BUFFER_NEW;
2313
2314 xlu__disk_yy_switch_to_buffer(b ,yyscanner );
2315
2316 return b;
2317 }
2318
2319 /** Setup the input buffer state to scan a string. The next call to xlu__disk_yylex() will
2320 * scan from a @e copy of @a str.
2321 * @param yystr a NUL-terminated string to scan
2322 * @param yyscanner The scanner object.
2323 * @return the newly allocated buffer state object.
2324 * @note If you want to scan bytes that may contain NUL values, then use
2325 * xlu__disk_yy_scan_bytes() instead.
2326 */
xlu__disk_yy_scan_string(yyconst char * yystr,yyscan_t yyscanner)2327 YY_BUFFER_STATE xlu__disk_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
2328 {
2329
2330 return xlu__disk_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
2331 }
2332
2333 /** Setup the input buffer state to scan the given bytes. The next call to xlu__disk_yylex() will
2334 * scan from a @e copy of @a bytes.
2335 * @param yybytes the byte buffer to scan
2336 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2337 * @param yyscanner The scanner object.
2338 * @return the newly allocated buffer state object.
2339 */
xlu__disk_yy_scan_bytes(yyconst char * yybytes,yy_size_t _yybytes_len,yyscan_t yyscanner)2340 YY_BUFFER_STATE xlu__disk_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
2341 {
2342 YY_BUFFER_STATE b;
2343 char *buf;
2344 yy_size_t n;
2345 yy_size_t i;
2346
2347 /* Get memory for full buffer, including space for trailing EOB's. */
2348 n = _yybytes_len + 2;
2349 buf = (char *) xlu__disk_yyalloc(n ,yyscanner );
2350 if ( ! buf )
2351 YY_FATAL_ERROR( "out of dynamic memory in xlu__disk_yy_scan_bytes()" );
2352
2353 for ( i = 0; i < _yybytes_len; ++i )
2354 buf[i] = yybytes[i];
2355
2356 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2357
2358 b = xlu__disk_yy_scan_buffer(buf,n ,yyscanner);
2359 if ( ! b )
2360 YY_FATAL_ERROR( "bad buffer in xlu__disk_yy_scan_bytes()" );
2361
2362 /* It's okay to grow etc. this buffer, and we should throw it
2363 * away when we're done.
2364 */
2365 b->yy_is_our_buffer = 1;
2366
2367 return b;
2368 }
2369
2370 #ifndef YY_EXIT_FAILURE
2371 #define YY_EXIT_FAILURE 2
2372 #endif
2373
yy_fatal_error(yyconst char * msg,yyscan_t yyscanner)2374 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2375 {
2376 (void) fprintf( stderr, "%s\n", msg );
2377 exit( YY_EXIT_FAILURE );
2378 }
2379
2380 /* Redefine yyless() so it works in section 3 code. */
2381
2382 #undef yyless
2383 #define yyless(n) \
2384 do \
2385 { \
2386 /* Undo effects of setting up yytext. */ \
2387 int yyless_macro_arg = (n); \
2388 YY_LESS_LINENO(yyless_macro_arg);\
2389 yytext[yyleng] = yyg->yy_hold_char; \
2390 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2391 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2392 *yyg->yy_c_buf_p = '\0'; \
2393 yyleng = yyless_macro_arg; \
2394 } \
2395 while ( 0 )
2396
2397 /* Accessor methods (get/set functions) to struct members. */
2398
2399 /** Get the user-defined data for this scanner.
2400 * @param yyscanner The scanner object.
2401 */
xlu__disk_yyget_extra(yyscan_t yyscanner)2402 YY_EXTRA_TYPE xlu__disk_yyget_extra (yyscan_t yyscanner)
2403 {
2404 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2405 return yyextra;
2406 }
2407
2408 /** Get the current line number.
2409 * @param yyscanner The scanner object.
2410 */
xlu__disk_yyget_lineno(yyscan_t yyscanner)2411 int xlu__disk_yyget_lineno (yyscan_t yyscanner)
2412 {
2413 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2414
2415 if (! YY_CURRENT_BUFFER)
2416 return 0;
2417
2418 return yylineno;
2419 }
2420
2421 /** Get the current column number.
2422 * @param yyscanner The scanner object.
2423 */
xlu__disk_yyget_column(yyscan_t yyscanner)2424 int xlu__disk_yyget_column (yyscan_t yyscanner)
2425 {
2426 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2427
2428 if (! YY_CURRENT_BUFFER)
2429 return 0;
2430
2431 return yycolumn;
2432 }
2433
2434 /** Get the input stream.
2435 * @param yyscanner The scanner object.
2436 */
xlu__disk_yyget_in(yyscan_t yyscanner)2437 FILE *xlu__disk_yyget_in (yyscan_t yyscanner)
2438 {
2439 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2440 return yyin;
2441 }
2442
2443 /** Get the output stream.
2444 * @param yyscanner The scanner object.
2445 */
xlu__disk_yyget_out(yyscan_t yyscanner)2446 FILE *xlu__disk_yyget_out (yyscan_t yyscanner)
2447 {
2448 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2449 return yyout;
2450 }
2451
2452 /** Get the length of the current token.
2453 * @param yyscanner The scanner object.
2454 */
xlu__disk_yyget_leng(yyscan_t yyscanner)2455 yy_size_t xlu__disk_yyget_leng (yyscan_t yyscanner)
2456 {
2457 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2458 return yyleng;
2459 }
2460
2461 /** Get the current token.
2462 * @param yyscanner The scanner object.
2463 */
2464
xlu__disk_yyget_text(yyscan_t yyscanner)2465 char *xlu__disk_yyget_text (yyscan_t yyscanner)
2466 {
2467 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2468 return yytext;
2469 }
2470
2471 /** Set the user-defined data. This data is never touched by the scanner.
2472 * @param user_defined The data to be associated with this scanner.
2473 * @param yyscanner The scanner object.
2474 */
xlu__disk_yyset_extra(YY_EXTRA_TYPE user_defined,yyscan_t yyscanner)2475 void xlu__disk_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2476 {
2477 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2478 yyextra = user_defined ;
2479 }
2480
2481 /** Set the current line number.
2482 * @param line_number
2483 * @param yyscanner The scanner object.
2484 */
xlu__disk_yyset_lineno(int line_number,yyscan_t yyscanner)2485 void xlu__disk_yyset_lineno (int line_number , yyscan_t yyscanner)
2486 {
2487 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2488
2489 /* lineno is only valid if an input buffer exists. */
2490 if (! YY_CURRENT_BUFFER )
2491 YY_FATAL_ERROR( "xlu__disk_yyset_lineno called with no buffer" );
2492
2493 yylineno = line_number;
2494 }
2495
2496 /** Set the current column.
2497 * @param line_number
2498 * @param yyscanner The scanner object.
2499 */
xlu__disk_yyset_column(int column_no,yyscan_t yyscanner)2500 void xlu__disk_yyset_column (int column_no , yyscan_t yyscanner)
2501 {
2502 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2503
2504 /* column is only valid if an input buffer exists. */
2505 if (! YY_CURRENT_BUFFER )
2506 YY_FATAL_ERROR( "xlu__disk_yyset_column called with no buffer" );
2507
2508 yycolumn = column_no;
2509 }
2510
2511 /** Set the input stream. This does not discard the current
2512 * input buffer.
2513 * @param in_str A readable stream.
2514 * @param yyscanner The scanner object.
2515 * @see xlu__disk_yy_switch_to_buffer
2516 */
xlu__disk_yyset_in(FILE * in_str,yyscan_t yyscanner)2517 void xlu__disk_yyset_in (FILE * in_str , yyscan_t yyscanner)
2518 {
2519 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2520 yyin = in_str ;
2521 }
2522
xlu__disk_yyset_out(FILE * out_str,yyscan_t yyscanner)2523 void xlu__disk_yyset_out (FILE * out_str , yyscan_t yyscanner)
2524 {
2525 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2526 yyout = out_str ;
2527 }
2528
xlu__disk_yyget_debug(yyscan_t yyscanner)2529 int xlu__disk_yyget_debug (yyscan_t yyscanner)
2530 {
2531 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2532 return yy_flex_debug;
2533 }
2534
xlu__disk_yyset_debug(int bdebug,yyscan_t yyscanner)2535 void xlu__disk_yyset_debug (int bdebug , yyscan_t yyscanner)
2536 {
2537 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2538 yy_flex_debug = bdebug ;
2539 }
2540
2541 /* Accessor methods for yylval and yylloc */
2542
2543 /* User-visible API */
2544
2545 /* xlu__disk_yylex_init is special because it creates the scanner itself, so it is
2546 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2547 * That's why we explicitly handle the declaration, instead of using our macros.
2548 */
2549
xlu__disk_yylex_init(yyscan_t * ptr_yy_globals)2550 int xlu__disk_yylex_init(yyscan_t* ptr_yy_globals)
2551
2552 {
2553 if (ptr_yy_globals == NULL){
2554 errno = EINVAL;
2555 return 1;
2556 }
2557
2558 *ptr_yy_globals = (yyscan_t) xlu__disk_yyalloc ( sizeof( struct yyguts_t ), NULL );
2559
2560 if (*ptr_yy_globals == NULL){
2561 errno = ENOMEM;
2562 return 1;
2563 }
2564
2565 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2566 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2567
2568 return yy_init_globals ( *ptr_yy_globals );
2569 }
2570
2571 /* xlu__disk_yylex_init_extra has the same functionality as xlu__disk_yylex_init, but follows the
2572 * convention of taking the scanner as the last argument. Note however, that
2573 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2574 * is the reason, too, why this function also must handle its own declaration).
2575 * The user defined value in the first argument will be available to xlu__disk_yyalloc in
2576 * the yyextra field.
2577 */
2578
xlu__disk_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t * ptr_yy_globals)2579 int xlu__disk_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2580
2581 {
2582 struct yyguts_t dummy_yyguts;
2583
2584 xlu__disk_yyset_extra (yy_user_defined, &dummy_yyguts);
2585
2586 if (ptr_yy_globals == NULL){
2587 errno = EINVAL;
2588 return 1;
2589 }
2590
2591 *ptr_yy_globals = (yyscan_t) xlu__disk_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2592
2593 if (*ptr_yy_globals == NULL){
2594 errno = ENOMEM;
2595 return 1;
2596 }
2597
2598 /* By setting to 0xAA, we expose bugs in
2599 yy_init_globals. Leave at 0x00 for releases. */
2600 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2601
2602 xlu__disk_yyset_extra (yy_user_defined, *ptr_yy_globals);
2603
2604 return yy_init_globals ( *ptr_yy_globals );
2605 }
2606
yy_init_globals(yyscan_t yyscanner)2607 static int yy_init_globals (yyscan_t yyscanner)
2608 {
2609 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2610 /* Initialization is the same as for the non-reentrant scanner.
2611 * This function is called from xlu__disk_yylex_destroy(), so don't allocate here.
2612 */
2613
2614 yyg->yy_buffer_stack = 0;
2615 yyg->yy_buffer_stack_top = 0;
2616 yyg->yy_buffer_stack_max = 0;
2617 yyg->yy_c_buf_p = (char *) 0;
2618 yyg->yy_init = 0;
2619 yyg->yy_start = 0;
2620
2621 yyg->yy_start_stack_ptr = 0;
2622 yyg->yy_start_stack_depth = 0;
2623 yyg->yy_start_stack = NULL;
2624
2625 yyg->yy_state_buf = 0;
2626 yyg->yy_state_ptr = 0;
2627 yyg->yy_full_match = 0;
2628 yyg->yy_lp = 0;
2629
2630 /* Defined in main.c */
2631 #ifdef YY_STDINIT
2632 yyin = stdin;
2633 yyout = stdout;
2634 #else
2635 yyin = (FILE *) 0;
2636 yyout = (FILE *) 0;
2637 #endif
2638
2639 /* For future reference: Set errno on error, since we are called by
2640 * xlu__disk_yylex_init()
2641 */
2642 return 0;
2643 }
2644
2645 /* xlu__disk_yylex_destroy is for both reentrant and non-reentrant scanners. */
xlu__disk_yylex_destroy(yyscan_t yyscanner)2646 int xlu__disk_yylex_destroy (yyscan_t yyscanner)
2647 {
2648 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2649
2650 /* Pop the buffer stack, destroying each element. */
2651 while(YY_CURRENT_BUFFER){
2652 xlu__disk_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2653 YY_CURRENT_BUFFER_LVALUE = NULL;
2654 xlu__disk_yypop_buffer_state(yyscanner);
2655 }
2656
2657 /* Destroy the stack itself. */
2658 xlu__disk_yyfree(yyg->yy_buffer_stack ,yyscanner);
2659 yyg->yy_buffer_stack = NULL;
2660
2661 /* Destroy the start condition stack. */
2662 xlu__disk_yyfree(yyg->yy_start_stack ,yyscanner );
2663 yyg->yy_start_stack = NULL;
2664
2665 xlu__disk_yyfree ( yyg->yy_state_buf , yyscanner);
2666 yyg->yy_state_buf = NULL;
2667
2668 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2669 * xlu__disk_yylex() is called, initialization will occur. */
2670 yy_init_globals( yyscanner);
2671
2672 /* Destroy the main struct (reentrant only). */
2673 xlu__disk_yyfree ( yyscanner , yyscanner );
2674 yyscanner = NULL;
2675 return 0;
2676 }
2677
2678 /*
2679 * Internal utility routines.
2680 */
2681
2682 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,yyconst char * s2,int n,yyscan_t yyscanner)2683 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2684 {
2685 register int i;
2686 for ( i = 0; i < n; ++i )
2687 s1[i] = s2[i];
2688 }
2689 #endif
2690
2691 #ifdef YY_NEED_STRLEN
yy_flex_strlen(yyconst char * s,yyscan_t yyscanner)2692 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2693 {
2694 register int n;
2695 for ( n = 0; s[n]; ++n )
2696 ;
2697
2698 return n;
2699 }
2700 #endif
2701
xlu__disk_yyalloc(yy_size_t size,yyscan_t yyscanner)2702 void *xlu__disk_yyalloc (yy_size_t size , yyscan_t yyscanner)
2703 {
2704 return (void *) malloc( size );
2705 }
2706
xlu__disk_yyrealloc(void * ptr,yy_size_t size,yyscan_t yyscanner)2707 void *xlu__disk_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2708 {
2709 /* The cast to (char *) in the following accommodates both
2710 * implementations that use char* generic pointers, and those
2711 * that use void* generic pointers. It works with the latter
2712 * because both ANSI C and C++ allow castless assignment from
2713 * any pointer type to void*, and deal with argument conversions
2714 * as though doing an assignment.
2715 */
2716 return (void *) realloc( (char *) ptr, size );
2717 }
2718
xlu__disk_yyfree(void * ptr,yyscan_t yyscanner)2719 void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
2720 {
2721 free( (char *) ptr ); /* see xlu__disk_yyrealloc() for (char *) cast */
2722 }
2723
2724 #define YYTABLES_NAME "yytables"
2725
2726 #line 278 "libxlu_disk_l.l"
2727