~ubuntu-branches/ubuntu/raring/xen/raring-proposed

« back to all changes in this revision

Viewing changes to tools/libxl/libxlu_disk_l.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-11-08 12:14:30 UTC
  • mfrom: (4.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20121108121430-o2nyj85dsqx15qx1
Tags: 4.2.0-1ubuntu1
* Merge from Debian Experimental, Remaining changes:
  - debian/control:
    - Build depends on ipxe-qemu.
    - libxenstore3.0: Conflict and replaces libxen3.
    - libxen-dev: Conflict and replaces libxen3-dev.
    - xenstore-utils: Conflict and replaces libxen3
    - xen-utils-4.1: Conflict and replaces libxen3, python-xen-3.3,
      and xen-utils-4.1.
    - Make sure the LDFLAGS value passed is suitable for use by ld
      rather than gcc.
  - disable debian/patches/config-etherboot.diff.
  - debian/patches/silence-gcc-warnings.patch: Silence gcc warnings.

Show diffs side-by-side

added added

removed removed

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