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