00001
00002 #line 3 "configfile.c"
00003
00004 #define YY_INT_ALIGNED short int
00005
00006
00007
00008 #define FLEX_SCANNER
00009 #define YY_FLEX_MAJOR_VERSION 2
00010 #define YY_FLEX_MINOR_VERSION 5
00011 #define YY_FLEX_SUBMINOR_VERSION 35
00012 #if YY_FLEX_SUBMINOR_VERSION > 0
00013 #define FLEX_BETA
00014 #endif
00015
00016
00017
00018
00019 #include <stdio.h>
00020 #include <string.h>
00021 #include <errno.h>
00022 #include <stdlib.h>
00023
00024
00025
00026
00027
00028 #ifndef FLEXINT_H
00029 #define FLEXINT_H
00030
00031
00032
00033 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
00034
00035
00036
00037
00038 #ifndef __STDC_LIMIT_MACROS
00039 #define __STDC_LIMIT_MACROS 1
00040 #endif
00041
00042 #include <inttypes.h>
00043 typedef int8_t flex_int8_t;
00044 typedef uint8_t flex_uint8_t;
00045 typedef int16_t flex_int16_t;
00046 typedef uint16_t flex_uint16_t;
00047 typedef int32_t flex_int32_t;
00048 typedef uint32_t flex_uint32_t;
00049 #else
00050 typedef signed char flex_int8_t;
00051 typedef short int flex_int16_t;
00052 typedef int flex_int32_t;
00053 typedef unsigned char flex_uint8_t;
00054 typedef unsigned short int flex_uint16_t;
00055 typedef unsigned int flex_uint32_t;
00056
00057
00058 #ifndef INT8_MIN
00059 #define INT8_MIN (-128)
00060 #endif
00061 #ifndef INT16_MIN
00062 #define INT16_MIN (-32767-1)
00063 #endif
00064 #ifndef INT32_MIN
00065 #define INT32_MIN (-2147483647-1)
00066 #endif
00067 #ifndef INT8_MAX
00068 #define INT8_MAX (127)
00069 #endif
00070 #ifndef INT16_MAX
00071 #define INT16_MAX (32767)
00072 #endif
00073 #ifndef INT32_MAX
00074 #define INT32_MAX (2147483647)
00075 #endif
00076 #ifndef UINT8_MAX
00077 #define UINT8_MAX (255U)
00078 #endif
00079 #ifndef UINT16_MAX
00080 #define UINT16_MAX (65535U)
00081 #endif
00082 #ifndef UINT32_MAX
00083 #define UINT32_MAX (4294967295U)
00084 #endif
00085
00086 #endif
00087
00088 #endif
00089
00090 #ifdef __cplusplus
00091
00092
00093 #define YY_USE_CONST
00094
00095 #else
00096
00097
00098 #if defined (__STDC__)
00099
00100 #define YY_USE_CONST
00101
00102 #endif
00103 #endif
00104
00105 #ifdef YY_USE_CONST
00106 #define yyconst const
00107 #else
00108 #define yyconst
00109 #endif
00110
00111
00112 #define YY_NULL 0
00113
00114
00115
00116
00117
00118
00119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00120
00121
00122
00123
00124
00125 #define BEGIN (yy_start) = 1 + 2 *
00126
00127
00128
00129
00130
00131 #define YY_START (((yy_start) - 1) / 2)
00132 #define YYSTATE YY_START
00133
00134
00135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00136
00137
00138 #define YY_NEW_FILE yyrestart(yyin )
00139
00140 #define YY_END_OF_BUFFER_CHAR 0
00141
00142
00143 #ifndef YY_BUF_SIZE
00144 #ifdef __ia64__
00145
00146
00147
00148
00149 #define YY_BUF_SIZE 32768
00150 #else
00151 #define YY_BUF_SIZE 16384
00152 #endif
00153 #endif
00154
00155
00156
00157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00158
00159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00160 #define YY_TYPEDEF_YY_BUFFER_STATE
00161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00162 #endif
00163
00164 extern int yyleng;
00165
00166 extern FILE *yyin, *yyout;
00167
00168 #define EOB_ACT_CONTINUE_SCAN 0
00169 #define EOB_ACT_END_OF_FILE 1
00170 #define EOB_ACT_LAST_MATCH 2
00171
00172 #define YY_LESS_LINENO(n)
00173
00174
00175 #define yyless(n) \
00176 do \
00177 { \
00178 \
00179 int yyless_macro_arg = (n); \
00180 YY_LESS_LINENO(yyless_macro_arg);\
00181 *yy_cp = (yy_hold_char); \
00182 YY_RESTORE_YY_MORE_OFFSET \
00183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00184 YY_DO_BEFORE_ACTION; \
00185 } \
00186 while ( 0 )
00187
00188 #define unput(c) yyunput( c, (yytext_ptr) )
00189
00190 #ifndef YY_TYPEDEF_YY_SIZE_T
00191 #define YY_TYPEDEF_YY_SIZE_T
00192 typedef size_t yy_size_t;
00193 #endif
00194
00195 #ifndef YY_STRUCT_YY_BUFFER_STATE
00196 #define YY_STRUCT_YY_BUFFER_STATE
00197 struct yy_buffer_state
00198 {
00199 FILE *yy_input_file;
00200
00201 char *yy_ch_buf;
00202 char *yy_buf_pos;
00203
00204
00205
00206
00207 yy_size_t yy_buf_size;
00208
00209
00210
00211
00212 int yy_n_chars;
00213
00214
00215
00216
00217
00218 int yy_is_our_buffer;
00219
00220
00221
00222
00223
00224
00225 int yy_is_interactive;
00226
00227
00228
00229
00230
00231 int yy_at_bol;
00232
00233 int yy_bs_lineno;
00234 int yy_bs_column;
00236
00237
00238
00239 int yy_fill_buffer;
00240
00241 int yy_buffer_status;
00242
00243 #define YY_BUFFER_NEW 0
00244 #define YY_BUFFER_NORMAL 1
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255 #define YY_BUFFER_EOF_PENDING 2
00256
00257 };
00258 #endif
00259
00260
00261 static size_t yy_buffer_stack_top = 0;
00262 static size_t yy_buffer_stack_max = 0;
00263 static YY_BUFFER_STATE * yy_buffer_stack = 0;
00265
00266
00267
00268
00269
00270
00271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
00272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
00273 : NULL)
00274
00275
00276
00277
00278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
00279
00280
00281 static char yy_hold_char;
00282 static int yy_n_chars;
00283 int yyleng;
00284
00285
00286 static char *yy_c_buf_p = (char *) 0;
00287 static int yy_init = 0;
00288 static int yy_start = 0;
00289
00290
00291
00292
00293 static int yy_did_buffer_switch_on_eof;
00294
00295 void yyrestart (FILE *input_file );
00296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
00297 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
00298 void yy_delete_buffer (YY_BUFFER_STATE b );
00299 void yy_flush_buffer (YY_BUFFER_STATE b );
00300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
00301 void yypop_buffer_state (void );
00302
00303 static void yyensure_buffer_stack (void );
00304 static void yy_load_buffer_state (void );
00305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
00306
00307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
00308
00309 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
00310 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
00311 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
00312
00313 void *yyalloc (yy_size_t );
00314 void *yyrealloc (void *,yy_size_t );
00315 void yyfree (void * );
00316
00317 #define yy_new_buffer yy_create_buffer
00318
00319 #define yy_set_interactive(is_interactive) \
00320 { \
00321 if ( ! YY_CURRENT_BUFFER ){ \
00322 yyensure_buffer_stack (); \
00323 YY_CURRENT_BUFFER_LVALUE = \
00324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
00325 } \
00326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00327 }
00328
00329 #define yy_set_bol(at_bol) \
00330 { \
00331 if ( ! YY_CURRENT_BUFFER ){\
00332 yyensure_buffer_stack (); \
00333 YY_CURRENT_BUFFER_LVALUE = \
00334 yy_create_buffer(yyin,YY_BUF_SIZE ); \
00335 } \
00336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00337 }
00338
00339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00340
00341
00342
00343 #define yywrap(n) 1
00344 #define YY_SKIP_YYWRAP
00345
00346 typedef unsigned char YY_CHAR;
00347
00348 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00349
00350 typedef int yy_state_type;
00351
00352 extern int yylineno;
00353
00354 int yylineno = 1;
00355
00356 extern char *yytext;
00357 #define yytext_ptr yytext
00358
00359 static yy_state_type yy_get_previous_state (void );
00360 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
00361 static int yy_get_next_buffer (void );
00362 static void yy_fatal_error (yyconst char msg[] );
00363
00364
00365
00366
00367 #define YY_DO_BEFORE_ACTION \
00368 (yytext_ptr) = yy_bp; \
00369 yyleng = (size_t) (yy_cp - yy_bp); \
00370 (yy_hold_char) = *yy_cp; \
00371 *yy_cp = '\0'; \
00372 (yy_c_buf_p) = yy_cp;
00373
00374 #define YY_NUM_RULES 7
00375 #define YY_END_OF_BUFFER 8
00376
00377
00378 struct yy_trans_info
00379 {
00380 flex_int32_t yy_verify;
00381 flex_int32_t yy_nxt;
00382 };
00383 static yyconst flex_int16_t yy_accept[17] =
00384 { 0,
00385 0, 0, 8, 6, 4, 2, 6, 1, 6, 5,
00386 0, 3, 1, 0, 5, 0
00387 } ;
00388
00389 static yyconst flex_int32_t yy_ec[256] =
00390 { 0,
00391 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
00392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00394 1, 2, 1, 4, 5, 1, 1, 1, 6, 1,
00395 1, 1, 1, 1, 7, 7, 7, 8, 8, 8,
00396 8, 8, 8, 8, 8, 8, 8, 7, 1, 1,
00397 1, 1, 1, 7, 9, 9, 9, 9, 9, 9,
00398 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
00399 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
00400 1, 7, 1, 1, 7, 1, 10, 10, 10, 10,
00401
00402 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00403 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
00404 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
00405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00412
00413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00418 1, 1, 1, 1, 1
00419 } ;
00420
00421 static yyconst flex_int32_t yy_meta[11] =
00422 { 0,
00423 1, 1, 2, 1, 1, 1, 1, 1, 1, 1
00424 } ;
00425
00426 static yyconst flex_int16_t yy_base[20] =
00427 { 0,
00428 0, 0, 15, 31, 31, 31, 8, 0, 10, 10,
00429 18, 31, 0, 20, 0, 31, 26, 13, 28
00430 } ;
00431
00432 static yyconst flex_int16_t yy_def[20] =
00433 { 0,
00434 16, 1, 16, 16, 16, 16, 17, 18, 19, 16,
00435 17, 16, 18, 19, 10, 0, 16, 16, 16
00436 } ;
00437
00438 static yyconst flex_int16_t yy_nxt[42] =
00439 { 0,
00440 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
00441 12, 12, 12, 13, 16, 12, 15, 15, 15, 15,
00442 12, 12, 12, 16, 16, 12, 11, 11, 14, 14,
00443 3, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00444 16
00445 } ;
00446
00447 static yyconst flex_int16_t yy_chk[42] =
00448 { 0,
00449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00450 7, 7, 9, 18, 3, 9, 10, 10, 10, 10,
00451 11, 11, 14, 0, 0, 14, 17, 17, 19, 19,
00452 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
00453 16
00454 } ;
00455
00456 static yy_state_type yy_last_accepting_state;
00457 static char *yy_last_accepting_cpos;
00458
00459 extern int yy_flex_debug;
00460 int yy_flex_debug = 0;
00461
00462
00463
00464
00465 #define REJECT reject_used_but_not_detected
00466 #define yymore() yymore_used_but_not_detected
00467 #define YY_MORE_ADJ 0
00468 #define YY_RESTORE_YY_MORE_OFFSET
00469 char *yytext;
00470 #line 1 "configfile.l"
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485 #line 17 "configfile.l"
00486 #include <dirent.h>
00487
00488 #include "wintypes.h"
00489 #include "pcscd.h"
00490 #include "readerfactory.h"
00491 #include "configfile.h"
00492
00493 int evaluatetoken(char *pcToken);
00494
00495 static int iLinenumber;
00496 static int iOldLinenumber;
00497 static char *pcPrevious;
00498 static char *pcCurrent;
00499 static char *pcFriendlyname;
00500 static char *pcDevicename;
00501 static char *pcLibpath;
00502 static char *pcChannelid;
00503 static int badError;
00504 static SerialReader *reader_list;
00505 static int reader_list_size;
00506 const char *ConfFile;
00507
00508 void tok_error(char *pcToken_error);
00509
00510 #define YY_NO_INPUT 1
00511 #line 512 "configfile.c"
00512
00513 #define INITIAL 0
00514
00515 #ifndef YY_NO_UNISTD_H
00516
00517
00518
00519
00520 #include <unistd.h>
00521 #endif
00522
00523 #ifndef YY_EXTRA_TYPE
00524 #define YY_EXTRA_TYPE void *
00525 #endif
00526
00527 static int yy_init_globals (void );
00528
00529
00530
00531
00532 int yylex_destroy (void );
00533
00534 int yyget_debug (void );
00535
00536 void yyset_debug (int debug_flag );
00537
00538 YY_EXTRA_TYPE yyget_extra (void );
00539
00540 void yyset_extra (YY_EXTRA_TYPE user_defined );
00541
00542 FILE *yyget_in (void );
00543
00544 void yyset_in (FILE * in_str );
00545
00546 FILE *yyget_out (void );
00547
00548 void yyset_out (FILE * out_str );
00549
00550 int yyget_leng (void );
00551
00552 char *yyget_text (void );
00553
00554 int yyget_lineno (void );
00555
00556 void yyset_lineno (int line_number );
00557
00558
00559
00560
00561
00562 #ifndef YY_SKIP_YYWRAP
00563 #ifdef __cplusplus
00564 extern "C" int yywrap (void );
00565 #else
00566 extern int yywrap (void );
00567 #endif
00568 #endif
00569
00570 #ifndef yytext_ptr
00571 static void yy_flex_strncpy (char *,yyconst char *,int );
00572 #endif
00573
00574 #ifdef YY_NEED_STRLEN
00575 static int yy_flex_strlen (yyconst char * );
00576 #endif
00577
00578 #ifndef YY_NO_INPUT
00579
00580 #ifdef __cplusplus
00581 static int yyinput (void );
00582 #else
00583 static int input (void );
00584 #endif
00585
00586 #endif
00587
00588
00589 #ifndef YY_READ_BUF_SIZE
00590 #ifdef __ia64__
00591
00592 #define YY_READ_BUF_SIZE 16384
00593 #else
00594 #define YY_READ_BUF_SIZE 8192
00595 #endif
00596 #endif
00597
00598
00599 #ifndef ECHO
00600
00601
00602
00603 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
00604 #endif
00605
00606
00607
00608
00609 #ifndef YY_INPUT
00610 #define YY_INPUT(buf,result,max_size) \
00611 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00612 { \
00613 int c = '*'; \
00614 size_t n; \
00615 for ( n = 0; n < max_size && \
00616 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00617 buf[n] = (char) c; \
00618 if ( c == '\n' ) \
00619 buf[n++] = (char) c; \
00620 if ( c == EOF && ferror( yyin ) ) \
00621 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00622 result = n; \
00623 } \
00624 else \
00625 { \
00626 errno=0; \
00627 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
00628 { \
00629 if( errno != EINTR) \
00630 { \
00631 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00632 break; \
00633 } \
00634 errno=0; \
00635 clearerr(yyin); \
00636 } \
00637 }\
00638 \
00639
00640 #endif
00641
00642
00643
00644
00645
00646 #ifndef yyterminate
00647 #define yyterminate() return YY_NULL
00648 #endif
00649
00650
00651 #ifndef YY_START_STACK_INCR
00652 #define YY_START_STACK_INCR 25
00653 #endif
00654
00655
00656 #ifndef YY_FATAL_ERROR
00657 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00658 #endif
00659
00660
00661
00662
00663
00664
00665 #ifndef YY_DECL
00666 #define YY_DECL_IS_OURS 1
00667
00668 extern int yylex (void);
00669
00670 #define YY_DECL int yylex (void)
00671 #endif
00672
00673
00674
00675
00676 #ifndef YY_USER_ACTION
00677 #define YY_USER_ACTION
00678 #endif
00679
00680
00681 #ifndef YY_BREAK
00682 #define YY_BREAK break;
00683 #endif
00684
00685 #define YY_RULE_SETUP \
00686 YY_USER_ACTION
00687
00690 YY_DECL
00691 {
00692 register yy_state_type yy_current_state;
00693 register char *yy_cp, *yy_bp;
00694 register int yy_act;
00695
00696 #line 47 "configfile.l"
00697
00698
00699 #line 700 "configfile.c"
00700
00701 if ( !(yy_init) )
00702 {
00703 (yy_init) = 1;
00704
00705 #ifdef YY_USER_INIT
00706 YY_USER_INIT;
00707 #endif
00708
00709 if ( ! (yy_start) )
00710 (yy_start) = 1;
00711
00712 if ( ! yyin )
00713 yyin = stdin;
00714
00715 if ( ! yyout )
00716 yyout = stdout;
00717
00718 if ( ! YY_CURRENT_BUFFER ) {
00719 yyensure_buffer_stack ();
00720 YY_CURRENT_BUFFER_LVALUE =
00721 yy_create_buffer(yyin,YY_BUF_SIZE );
00722 }
00723
00724 yy_load_buffer_state( );
00725 }
00726
00727 while ( 1 )
00728 {
00729 yy_cp = (yy_c_buf_p);
00730
00731
00732 *yy_cp = (yy_hold_char);
00733
00734
00735
00736
00737 yy_bp = yy_cp;
00738
00739 yy_current_state = (yy_start);
00740 yy_match:
00741 do
00742 {
00743 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00744 if ( yy_accept[yy_current_state] )
00745 {
00746 (yy_last_accepting_state) = yy_current_state;
00747 (yy_last_accepting_cpos) = yy_cp;
00748 }
00749 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00750 {
00751 yy_current_state = (int) yy_def[yy_current_state];
00752 if ( yy_current_state >= 17 )
00753 yy_c = yy_meta[(unsigned int) yy_c];
00754 }
00755 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00756 ++yy_cp;
00757 }
00758 while ( yy_base[yy_current_state] != 31 );
00759
00760 yy_find_action:
00761 yy_act = yy_accept[yy_current_state];
00762 if ( yy_act == 0 )
00763 {
00764 yy_cp = (yy_last_accepting_cpos);
00765 yy_current_state = (yy_last_accepting_state);
00766 yy_act = yy_accept[yy_current_state];
00767 }
00768
00769 YY_DO_BEFORE_ACTION;
00770
00771 do_action:
00772
00773 switch ( yy_act )
00774 {
00775 case 0:
00776
00777 *yy_cp = (yy_hold_char);
00778 yy_cp = (yy_last_accepting_cpos);
00779 yy_current_state = (yy_last_accepting_state);
00780 goto yy_find_action;
00781
00782 case 1:
00783 YY_RULE_SETUP
00784 #line 49 "configfile.l"
00785 {}
00786 YY_BREAK
00787 case 2:
00788
00789 YY_RULE_SETUP
00790 #line 50 "configfile.l"
00791 { iLinenumber++; }
00792 YY_BREAK
00793 case 3:
00794
00795 YY_RULE_SETUP
00796 #line 51 "configfile.l"
00797 { (void)evaluatetoken(yytext); }
00798 YY_BREAK
00799 case 4:
00800 YY_RULE_SETUP
00801 #line 52 "configfile.l"
00802 {}
00803 YY_BREAK
00804 case 5:
00805 YY_RULE_SETUP
00806 #line 53 "configfile.l"
00807 { (void)evaluatetoken(yytext); }
00808 YY_BREAK
00809 case 6:
00810 YY_RULE_SETUP
00811 #line 54 "configfile.l"
00812 { tok_error(yytext); }
00813 YY_BREAK
00814 case 7:
00815 YY_RULE_SETUP
00816 #line 55 "configfile.l"
00817 ECHO;
00818 YY_BREAK
00819 #line 820 "configfile.c"
00820 case YY_STATE_EOF(INITIAL):
00821 yyterminate();
00822
00823 case YY_END_OF_BUFFER:
00824 {
00825
00826 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
00827
00828
00829 *yy_cp = (yy_hold_char);
00830 YY_RESTORE_YY_MORE_OFFSET
00831
00832 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
00833 {
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
00844 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
00845 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
00846 }
00847
00848
00849
00850
00851
00852
00853
00854
00855 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
00856 {
00857 yy_state_type yy_next_state;
00858
00859 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
00860
00861 yy_current_state = yy_get_previous_state( );
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872 yy_next_state = yy_try_NUL_trans( yy_current_state );
00873
00874 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
00875
00876 if ( yy_next_state )
00877 {
00878
00879 yy_cp = ++(yy_c_buf_p);
00880 yy_current_state = yy_next_state;
00881 goto yy_match;
00882 }
00883
00884 else
00885 {
00886 yy_cp = (yy_c_buf_p);
00887 goto yy_find_action;
00888 }
00889 }
00890
00891 else switch ( yy_get_next_buffer( ) )
00892 {
00893 case EOB_ACT_END_OF_FILE:
00894 {
00895 (yy_did_buffer_switch_on_eof) = 0;
00896
00897 if ( yywrap( ) )
00898 {
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
00909
00910 yy_act = YY_STATE_EOF(YY_START);
00911 goto do_action;
00912 }
00913
00914 else
00915 {
00916 if ( ! (yy_did_buffer_switch_on_eof) )
00917 YY_NEW_FILE;
00918 }
00919 break;
00920 }
00921
00922 case EOB_ACT_CONTINUE_SCAN:
00923 (yy_c_buf_p) =
00924 (yytext_ptr) + yy_amount_of_matched_text;
00925
00926 yy_current_state = yy_get_previous_state( );
00927
00928 yy_cp = (yy_c_buf_p);
00929 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
00930 goto yy_match;
00931
00932 case EOB_ACT_LAST_MATCH:
00933 (yy_c_buf_p) =
00934 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
00935
00936 yy_current_state = yy_get_previous_state( );
00937
00938 yy_cp = (yy_c_buf_p);
00939 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
00940 goto yy_find_action;
00941 }
00942 break;
00943 }
00944
00945 default:
00946 YY_FATAL_ERROR(
00947 "fatal flex scanner internal error--no action found" );
00948 }
00949 }
00950 }
00951
00952
00953
00954
00955
00956
00957
00958
00959 static int yy_get_next_buffer (void)
00960 {
00961 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
00962 register char *source = (yytext_ptr);
00963 register int number_to_move, i;
00964 int ret_val;
00965
00966 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
00967 YY_FATAL_ERROR(
00968 "fatal flex scanner internal error--end of buffer missed" );
00969
00970 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
00971 {
00972 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
00973 {
00974
00975
00976
00977 return EOB_ACT_END_OF_FILE;
00978 }
00979
00980 else
00981 {
00982
00983
00984
00985 return EOB_ACT_LAST_MATCH;
00986 }
00987 }
00988
00989
00990
00991
00992 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
00993
00994 for ( i = 0; i < number_to_move; ++i )
00995 *(dest++) = *(source++);
00996
00997 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
00998
00999
01000
01001 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
01002
01003 else
01004 {
01005 int num_to_read =
01006 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01007
01008 while ( num_to_read <= 0 )
01009 {
01010
01011
01012 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01013
01014 int yy_c_buf_p_offset =
01015 (int) ((yy_c_buf_p) - b->yy_ch_buf);
01016
01017 if ( b->yy_is_our_buffer )
01018 {
01019 int new_size = b->yy_buf_size * 2;
01020
01021 if ( new_size <= 0 )
01022 b->yy_buf_size += b->yy_buf_size / 8;
01023 else
01024 b->yy_buf_size *= 2;
01025
01026 b->yy_ch_buf = (char *)
01027
01028 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
01029 }
01030 else
01031
01032 b->yy_ch_buf = 0;
01033
01034 if ( ! b->yy_ch_buf )
01035 YY_FATAL_ERROR(
01036 "fatal error - scanner input buffer overflow" );
01037
01038 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
01039
01040 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01041 number_to_move - 1;
01042
01043 }
01044
01045 if ( num_to_read > YY_READ_BUF_SIZE )
01046 num_to_read = YY_READ_BUF_SIZE;
01047
01048
01049 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01050 (yy_n_chars), (size_t) num_to_read );
01051
01052 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01053 }
01054
01055 if ( (yy_n_chars) == 0 )
01056 {
01057 if ( number_to_move == YY_MORE_ADJ )
01058 {
01059 ret_val = EOB_ACT_END_OF_FILE;
01060 yyrestart(yyin );
01061 }
01062
01063 else
01064 {
01065 ret_val = EOB_ACT_LAST_MATCH;
01066 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01067 YY_BUFFER_EOF_PENDING;
01068 }
01069 }
01070
01071 else
01072 ret_val = EOB_ACT_CONTINUE_SCAN;
01073
01074 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
01075
01076 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
01077 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
01078 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01079 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
01080 }
01081
01082 (yy_n_chars) += number_to_move;
01083 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
01084 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
01085
01086 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01087
01088 return ret_val;
01089 }
01090
01091
01092
01093 static yy_state_type yy_get_previous_state (void)
01094 {
01095 register yy_state_type yy_current_state;
01096 register char *yy_cp;
01097
01098 yy_current_state = (yy_start);
01099
01100 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
01101 {
01102 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01103 if ( yy_accept[yy_current_state] )
01104 {
01105 (yy_last_accepting_state) = yy_current_state;
01106 (yy_last_accepting_cpos) = yy_cp;
01107 }
01108 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01109 {
01110 yy_current_state = (int) yy_def[yy_current_state];
01111 if ( yy_current_state >= 17 )
01112 yy_c = yy_meta[(unsigned int) yy_c];
01113 }
01114 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01115 }
01116
01117 return yy_current_state;
01118 }
01119
01120
01121
01122
01123
01124
01125 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
01126 {
01127 register int yy_is_jam;
01128 register char *yy_cp = (yy_c_buf_p);
01129
01130 register YY_CHAR yy_c = 1;
01131 if ( yy_accept[yy_current_state] )
01132 {
01133 (yy_last_accepting_state) = yy_current_state;
01134 (yy_last_accepting_cpos) = yy_cp;
01135 }
01136 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01137 {
01138 yy_current_state = (int) yy_def[yy_current_state];
01139 if ( yy_current_state >= 17 )
01140 yy_c = yy_meta[(unsigned int) yy_c];
01141 }
01142 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01143 yy_is_jam = (yy_current_state == 16);
01144
01145 return yy_is_jam ? 0 : yy_current_state;
01146 }
01147
01148 #ifndef YY_NO_INPUT
01149 #ifdef __cplusplus
01150 static int yyinput (void)
01151 #else
01152 static int input (void)
01153 #endif
01154
01155 {
01156 int c;
01157
01158 *(yy_c_buf_p) = (yy_hold_char);
01159
01160 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
01161 {
01162
01163
01164
01165
01166 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01167
01168 *(yy_c_buf_p) = '\0';
01169
01170 else
01171 {
01172 int offset = (yy_c_buf_p) - (yytext_ptr);
01173 ++(yy_c_buf_p);
01174
01175 switch ( yy_get_next_buffer( ) )
01176 {
01177 case EOB_ACT_LAST_MATCH:
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189 yyrestart(yyin );
01190
01191
01192
01193 case EOB_ACT_END_OF_FILE:
01194 {
01195 if ( yywrap( ) )
01196 return EOF;
01197
01198 if ( ! (yy_did_buffer_switch_on_eof) )
01199 YY_NEW_FILE;
01200 #ifdef __cplusplus
01201 return yyinput();
01202 #else
01203 return input();
01204 #endif
01205 }
01206
01207 case EOB_ACT_CONTINUE_SCAN:
01208 (yy_c_buf_p) = (yytext_ptr) + offset;
01209 break;
01210 }
01211 }
01212 }
01213
01214 c = *(unsigned char *) (yy_c_buf_p);
01215 *(yy_c_buf_p) = '\0';
01216 (yy_hold_char) = *++(yy_c_buf_p);
01217
01218 return c;
01219 }
01220 #endif
01221
01227 void yyrestart (FILE * input_file )
01228 {
01229
01230 if ( ! YY_CURRENT_BUFFER ){
01231 yyensure_buffer_stack ();
01232 YY_CURRENT_BUFFER_LVALUE =
01233 yy_create_buffer(yyin,YY_BUF_SIZE );
01234 }
01235
01236 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
01237 yy_load_buffer_state( );
01238 }
01239
01244 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
01245 {
01246
01247
01248
01249
01250
01251
01252 yyensure_buffer_stack ();
01253 if ( YY_CURRENT_BUFFER == new_buffer )
01254 return;
01255
01256 if ( YY_CURRENT_BUFFER )
01257 {
01258
01259 *(yy_c_buf_p) = (yy_hold_char);
01260 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01261 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01262 }
01263
01264 YY_CURRENT_BUFFER_LVALUE = new_buffer;
01265 yy_load_buffer_state( );
01266
01267
01268
01269
01270
01271
01272 (yy_did_buffer_switch_on_eof) = 1;
01273 }
01274
01275 static void yy_load_buffer_state (void)
01276 {
01277 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01278 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01279 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01280 (yy_hold_char) = *(yy_c_buf_p);
01281 }
01282
01289 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
01290 {
01291 YY_BUFFER_STATE b;
01292
01293 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
01294 if ( ! b )
01295 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01296
01297 b->yy_buf_size = size;
01298
01299
01300
01301
01302 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
01303 if ( ! b->yy_ch_buf )
01304 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01305
01306 b->yy_is_our_buffer = 1;
01307
01308 yy_init_buffer(b,file );
01309
01310 return b;
01311 }
01312
01317 void yy_delete_buffer (YY_BUFFER_STATE b )
01318 {
01319
01320 if ( ! b )
01321 return;
01322
01323 if ( b == YY_CURRENT_BUFFER )
01324 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01325
01326 if ( b->yy_is_our_buffer )
01327 yyfree((void *) b->yy_ch_buf );
01328
01329 yyfree((void *) b );
01330 }
01331
01332 #ifndef __cplusplus
01333 extern int isatty (int );
01334 #endif
01335
01336
01337
01338
01339
01340 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
01341
01342 {
01343 int oerrno = errno;
01344
01345 yy_flush_buffer(b );
01346
01347 b->yy_input_file = file;
01348 b->yy_fill_buffer = 1;
01349
01350
01351
01352
01353
01354 if (b != YY_CURRENT_BUFFER){
01355 b->yy_bs_lineno = 1;
01356 b->yy_bs_column = 0;
01357 }
01358
01359 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01360
01361 errno = oerrno;
01362 }
01363
01368 void yy_flush_buffer (YY_BUFFER_STATE b )
01369 {
01370 if ( ! b )
01371 return;
01372
01373 b->yy_n_chars = 0;
01374
01375
01376
01377
01378
01379 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01380 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01381
01382 b->yy_buf_pos = &b->yy_ch_buf[0];
01383
01384 b->yy_at_bol = 1;
01385 b->yy_buffer_status = YY_BUFFER_NEW;
01386
01387 if ( b == YY_CURRENT_BUFFER )
01388 yy_load_buffer_state( );
01389 }
01390
01397 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
01398 {
01399 if (new_buffer == NULL)
01400 return;
01401
01402 yyensure_buffer_stack();
01403
01404
01405 if ( YY_CURRENT_BUFFER )
01406 {
01407
01408 *(yy_c_buf_p) = (yy_hold_char);
01409 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01410 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01411 }
01412
01413
01414 if (YY_CURRENT_BUFFER)
01415 (yy_buffer_stack_top)++;
01416 YY_CURRENT_BUFFER_LVALUE = new_buffer;
01417
01418
01419 yy_load_buffer_state( );
01420 (yy_did_buffer_switch_on_eof) = 1;
01421 }
01422
01427 void yypop_buffer_state (void)
01428 {
01429 if (!YY_CURRENT_BUFFER)
01430 return;
01431
01432 yy_delete_buffer(YY_CURRENT_BUFFER );
01433 YY_CURRENT_BUFFER_LVALUE = NULL;
01434 if ((yy_buffer_stack_top) > 0)
01435 --(yy_buffer_stack_top);
01436
01437 if (YY_CURRENT_BUFFER) {
01438 yy_load_buffer_state( );
01439 (yy_did_buffer_switch_on_eof) = 1;
01440 }
01441 }
01442
01443
01444
01445
01446 static void yyensure_buffer_stack (void)
01447 {
01448 int num_to_alloc;
01449
01450 if (!(yy_buffer_stack)) {
01451
01452
01453
01454
01455
01456 num_to_alloc = 1;
01457 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
01458 (num_to_alloc * sizeof(struct yy_buffer_state*)
01459 );
01460 if ( ! (yy_buffer_stack) )
01461 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
01462
01463 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01464
01465 (yy_buffer_stack_max) = num_to_alloc;
01466 (yy_buffer_stack_top) = 0;
01467 return;
01468 }
01469
01470 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
01471
01472
01473 int grow_size = 8 ;
01474
01475 num_to_alloc = (yy_buffer_stack_max) + grow_size;
01476 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
01477 ((yy_buffer_stack),
01478 num_to_alloc * sizeof(struct yy_buffer_state*)
01479 );
01480 if ( ! (yy_buffer_stack) )
01481 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
01482
01483
01484 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
01485 (yy_buffer_stack_max) = num_to_alloc;
01486 }
01487 }
01488
01495 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
01496 {
01497 YY_BUFFER_STATE b;
01498
01499 if ( size < 2 ||
01500 base[size-2] != YY_END_OF_BUFFER_CHAR ||
01501 base[size-1] != YY_END_OF_BUFFER_CHAR )
01502
01503 return 0;
01504
01505 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
01506 if ( ! b )
01507 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
01508
01509 b->yy_buf_size = size - 2;
01510 b->yy_buf_pos = b->yy_ch_buf = base;
01511 b->yy_is_our_buffer = 0;
01512 b->yy_input_file = 0;
01513 b->yy_n_chars = b->yy_buf_size;
01514 b->yy_is_interactive = 0;
01515 b->yy_at_bol = 1;
01516 b->yy_fill_buffer = 0;
01517 b->yy_buffer_status = YY_BUFFER_NEW;
01518
01519 yy_switch_to_buffer(b );
01520
01521 return b;
01522 }
01523
01532 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
01533 {
01534
01535 return yy_scan_bytes(yystr,strlen(yystr) );
01536 }
01537
01545 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
01546 {
01547 YY_BUFFER_STATE b;
01548 char *buf;
01549 yy_size_t n;
01550 int i;
01551
01552
01553 n = _yybytes_len + 2;
01554 buf = (char *) yyalloc(n );
01555 if ( ! buf )
01556 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
01557
01558 for ( i = 0; i < _yybytes_len; ++i )
01559 buf[i] = yybytes[i];
01560
01561 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
01562
01563 b = yy_scan_buffer(buf,n );
01564 if ( ! b )
01565 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
01566
01567
01568
01569
01570 b->yy_is_our_buffer = 1;
01571
01572 return b;
01573 }
01574
01575 #ifndef YY_EXIT_FAILURE
01576 #define YY_EXIT_FAILURE 2
01577 #endif
01578
01579 static void yy_fatal_error (yyconst char* msg )
01580 {
01581 (void) fprintf( stderr, "%s\n", msg );
01582 exit( YY_EXIT_FAILURE );
01583 }
01584
01585
01586
01587 #undef yyless
01588 #define yyless(n) \
01589 do \
01590 { \
01591 \
01592 int yyless_macro_arg = (n); \
01593 YY_LESS_LINENO(yyless_macro_arg);\
01594 yytext[yyleng] = (yy_hold_char); \
01595 (yy_c_buf_p) = yytext + yyless_macro_arg; \
01596 (yy_hold_char) = *(yy_c_buf_p); \
01597 *(yy_c_buf_p) = '\0'; \
01598 yyleng = yyless_macro_arg; \
01599 } \
01600 while ( 0 )
01601
01602
01603
01607 int yyget_lineno (void)
01608 {
01609
01610 return yylineno;
01611 }
01612
01616 FILE *yyget_in (void)
01617 {
01618 return yyin;
01619 }
01620
01624 FILE *yyget_out (void)
01625 {
01626 return yyout;
01627 }
01628
01632 int yyget_leng (void)
01633 {
01634 return yyleng;
01635 }
01636
01641 char *yyget_text (void)
01642 {
01643 return yytext;
01644 }
01645
01650 void yyset_lineno (int line_number )
01651 {
01652
01653 yylineno = line_number;
01654 }
01655
01662 void yyset_in (FILE * in_str )
01663 {
01664 yyin = in_str ;
01665 }
01666
01667 void yyset_out (FILE * out_str )
01668 {
01669 yyout = out_str ;
01670 }
01671
01672 int yyget_debug (void)
01673 {
01674 return yy_flex_debug;
01675 }
01676
01677 void yyset_debug (int bdebug )
01678 {
01679 yy_flex_debug = bdebug ;
01680 }
01681
01682 static int yy_init_globals (void)
01683 {
01684
01685
01686
01687
01688 (yy_buffer_stack) = 0;
01689 (yy_buffer_stack_top) = 0;
01690 (yy_buffer_stack_max) = 0;
01691 (yy_c_buf_p) = (char *) 0;
01692 (yy_init) = 0;
01693 (yy_start) = 0;
01694
01695
01696 #ifdef YY_STDINIT
01697 yyin = stdin;
01698 yyout = stdout;
01699 #else
01700 yyin = (FILE *) 0;
01701 yyout = (FILE *) 0;
01702 #endif
01703
01704
01705
01706
01707 return 0;
01708 }
01709
01710
01711 int yylex_destroy (void)
01712 {
01713
01714
01715 while(YY_CURRENT_BUFFER){
01716 yy_delete_buffer(YY_CURRENT_BUFFER );
01717 YY_CURRENT_BUFFER_LVALUE = NULL;
01718 yypop_buffer_state();
01719 }
01720
01721
01722 yyfree((yy_buffer_stack) );
01723 (yy_buffer_stack) = NULL;
01724
01725
01726
01727 yy_init_globals( );
01728
01729 return 0;
01730 }
01731
01732
01733
01734
01735
01736 #ifndef yytext_ptr
01737 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
01738 {
01739 register int i;
01740 for ( i = 0; i < n; ++i )
01741 s1[i] = s2[i];
01742 }
01743 #endif
01744
01745 #ifdef YY_NEED_STRLEN
01746 static int yy_flex_strlen (yyconst char * s )
01747 {
01748 register int n;
01749 for ( n = 0; s[n]; ++n )
01750 ;
01751
01752 return n;
01753 }
01754 #endif
01755
01756 void *yyalloc (yy_size_t size )
01757 {
01758 return (void *) malloc( size );
01759 }
01760
01761 void *yyrealloc (void * ptr, yy_size_t size )
01762 {
01763
01764
01765
01766
01767
01768
01769
01770 return (void *) realloc( (char *) ptr, size );
01771 }
01772
01773 void yyfree (void * ptr )
01774 {
01775 free( (char *) ptr );
01776 }
01777
01778 #define YYTABLES_NAME "yytables"
01779
01780 #line 55 "configfile.l"
01781
01782
01783
01784 #include <stdio.h>
01785 #include <string.h>
01786 #include <errno.h>
01787
01788 #include "config.h"
01789 #include "misc.h"
01790 #include "pcsclite.h"
01791 #include "pcscd.h"
01792 #include "debuglog.h"
01793 #include "sys_generic.h"
01794 #include "readerfactory.h"
01795
01796 int evaluatetoken(char *pcToken)
01797 {
01798
01799 int channelId = 0;
01800 int p = 0;
01801 unsigned int n = 0;
01802
01803 if (pcPrevious == NULL)
01804 {
01805 pcPrevious = strdup(pcToken);
01806 iOldLinenumber = iLinenumber;
01807 }
01808 else
01809 {
01810
01811 if (iOldLinenumber != iLinenumber)
01812 {
01813 tok_error(pcPrevious);
01814 pcPrevious = strdup(pcToken);
01815 iOldLinenumber = iLinenumber;
01816 return 1;
01817 }
01818
01819 pcCurrent = pcToken;
01820 if (strcmp(pcPrevious, "FRIENDLYNAME") == 0)
01821 {
01822 if (pcFriendlyname == NULL)
01823 {
01824 pcFriendlyname = malloc(strlen(pcCurrent) - 1);
01825 for (n = 0; n < strlen(pcCurrent); n++)
01826 {
01827 if (pcCurrent[n] != '"')
01828 {
01829 pcFriendlyname[p++] = pcCurrent[n];
01830 }
01831 }
01832 pcFriendlyname[p++] = '\0';
01833 }
01834 else
01835 {
01836 tok_error(pcPrevious);
01837 return 1;
01838 }
01839 }
01840 else if (strcmp(pcPrevious, "DEVICENAME") == 0)
01841 {
01842 if (pcDevicename == NULL)
01843 {
01844 struct stat fStatBuf;
01845
01846 pcDevicename = strdup(pcCurrent);
01847 if ((NULL == strchr(pcDevicename, ':'))
01848 && (stat(pcDevicename, &fStatBuf) != 0))
01849 {
01850 Log3(PCSC_LOG_CRITICAL, "Error with device %s: %s",
01851 pcDevicename, strerror(errno));
01852 Log1(PCSC_LOG_CRITICAL, "You should use 'DEVICENAME /dev/null' if your driver does not use this field");
01853 badError = 1;
01854 }
01855 }
01856 else
01857 {
01858 tok_error(pcPrevious);
01859 return 1;
01860 }
01861 }
01862 else if (strcmp(pcPrevious, "LIBPATH") == 0)
01863 {
01864 if (pcLibpath == NULL)
01865 {
01866 struct stat fStatBuf;
01867
01868 pcLibpath = strdup(pcCurrent);
01869 if (stat(pcLibpath, &fStatBuf) != 0)
01870 {
01871 Log3(PCSC_LOG_CRITICAL, "Error with library %s: %s",
01872 pcLibpath, strerror(errno));
01873 badError = 1;
01874 }
01875
01876 if (strstr(pcLibpath, ".bundle") != NULL)
01877 {
01878 Log1(PCSC_LOG_ERROR, "WARNING *************************************");
01879 Log2(PCSC_LOG_ERROR, "WARNING: USB drivers SHOULD NOT be declared in reader.conf: %s", pcLibpath);
01880 Log1(PCSC_LOG_ERROR, "WARNING *************************************");
01881 }
01882 }
01883 else
01884 {
01885 tok_error(pcPrevious);
01886 return 1;
01887 }
01888 }
01889 else if (strcmp(pcPrevious, "CHANNELID") == 0)
01890 {
01891 if (pcChannelid == NULL)
01892 pcChannelid = strdup(pcCurrent);
01893 else
01894 {
01895 tok_error(pcPrevious);
01896 return 1;
01897 }
01898 }
01899 else
01900 {
01901 tok_error(pcPrevious);
01902 free(pcPrevious);
01903 pcPrevious = NULL;
01904 return 1;
01905 }
01906
01907 free(pcPrevious);
01908 pcPrevious = NULL;
01909 }
01910
01911 if (pcFriendlyname != NULL && pcDevicename != NULL &&
01912 pcLibpath != NULL && pcChannelid != NULL && badError != 1)
01913 {
01914 if (0 == reader_list_size)
01915 {
01916
01917 reader_list_size = 2;
01918 reader_list = malloc(reader_list_size * sizeof(SerialReader));
01919 }
01920 else
01921 {
01922 reader_list_size++;
01923 reader_list = realloc(reader_list, reader_list_size *
01924 sizeof(SerialReader));
01925 }
01926
01927
01928 reader_list[reader_list_size-1].pcFriendlyname = NULL;
01929
01930 channelId = strtoul(pcChannelid, 0, 16);
01931 reader_list[reader_list_size-2].pcFriendlyname = strdup(pcFriendlyname);
01932 reader_list[reader_list_size-2].pcDevicename = strdup(pcDevicename);
01933 reader_list[reader_list_size-2].pcLibpath = strdup(pcLibpath),
01934 reader_list[reader_list_size-2].channelId = channelId;
01935
01936 pcFriendlyname = NULL;
01937 pcDevicename = NULL;
01938 pcLibpath = NULL;
01939 pcChannelid = NULL;
01940 }
01941
01942 return 0;
01943 }
01944
01945 void tok_error(char *token_error)
01946 {
01947 Log4(PCSC_LOG_ERROR, "tok_error: invalid value line %d in %s: %s",
01948 iOldLinenumber, ConfFile, token_error);
01949 badError = 1;
01950 }
01951
01952 int DBGetReaderListDir(const char *readerconf_dir,
01953 SerialReader **caller_reader_list)
01954 {
01955 DIR *dir;
01956 int ret = 0;
01957
01958
01959 reader_list = NULL;
01960 reader_list_size = 0;
01961
01962 dir = opendir(readerconf_dir);
01963 if (dir)
01964 {
01965
01966 struct dirent *direntry;
01967
01968 Log2(PCSC_LOG_DEBUG, "Parsing conf directory: %s", readerconf_dir);
01969
01970
01971 while ((direntry = readdir(dir)) != NULL)
01972 {
01973 char filename[FILENAME_MAX];
01974 int r;
01975
01976
01977 if ((strcmp(direntry->d_name, ".") == 0) ||
01978 (strcmp(direntry->d_name, "..") == 0))
01979 continue;
01980
01981 snprintf(filename, sizeof(filename), "%s/%s",
01982 readerconf_dir, direntry->d_name);
01983
01984
01985 r = DBGetReaderList(filename, caller_reader_list);
01986
01987
01988 if (r)
01989 ret = r;
01990 }
01991
01992 closedir(dir);
01993 }
01994 else
01995
01996 ret = DBGetReaderList(readerconf_dir, caller_reader_list);
01997
01998 return ret;
01999 }
02000
02001 int DBGetReaderList(const char *readerconf, SerialReader **caller_reader_list)
02002 {
02003 FILE *configFile = NULL;
02004
02005 *caller_reader_list = NULL;
02006
02007
02008 ConfFile = readerconf;
02009
02010 Log2(PCSC_LOG_DEBUG, "Parsing conf file: %s", ConfFile);
02011
02012 configFile = fopen(readerconf, "r");
02013
02014 if (configFile == NULL)
02015 return 1;
02016
02017 yyin = configFile;
02018
02019
02020 iLinenumber = 1;
02021 iOldLinenumber = -1;
02022 pcFriendlyname = NULL;
02023 pcDevicename = NULL;
02024 pcLibpath = NULL;
02025 pcChannelid = NULL;
02026 pcPrevious = NULL;
02027 pcCurrent = NULL;
02028 badError = 0;
02029
02030 do
02031 {
02032 (void)yylex();
02033 }
02034 while (!feof(configFile));
02035
02036 (void)fclose(configFile);
02037
02038 *caller_reader_list = reader_list;
02039
02040 if (badError == 1)
02041 return -1;
02042 else
02043 return 0;
02044 }
02045
02046