4 #define YY_INT_ALIGNED short int 9 #define YY_FLEX_MAJOR_VERSION 2 10 #define YY_FLEX_MINOR_VERSION 5 11 #define YY_FLEX_SUBMINOR_VERSION 35 12 #if YY_FLEX_SUBMINOR_VERSION > 0 33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 38 #ifndef __STDC_LIMIT_MACROS 39 #define __STDC_LIMIT_MACROS 1 43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
59 #define INT8_MIN (-128) 62 #define INT16_MIN (-32767-1) 65 #define INT32_MIN (-2147483647-1) 68 #define INT8_MAX (127) 71 #define INT16_MAX (32767) 74 #define INT32_MAX (2147483647) 77 #define UINT8_MAX (255U) 80 #define UINT16_MAX (65535U) 83 #define UINT32_MAX (4294967295U) 98 #if defined (__STDC__) 106 #define yyconst const 119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 125 #define BEGIN (yy_start) = 1 + 2 * 131 #define YY_START (((yy_start) - 1) / 2) 132 #define YYSTATE YY_START 135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 138 #define YY_NEW_FILE yyrestart(yyin ) 140 #define YY_END_OF_BUFFER_CHAR 0 149 #define YY_BUF_SIZE 32768 151 #define YY_BUF_SIZE 16384 157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 160 #define YY_TYPEDEF_YY_BUFFER_STATE 166 extern FILE *yyin, *yyout;
168 #define EOB_ACT_CONTINUE_SCAN 0 169 #define EOB_ACT_END_OF_FILE 1 170 #define EOB_ACT_LAST_MATCH 2 172 #define YY_LESS_LINENO(n) 179 int yyless_macro_arg = (n); \ 180 YY_LESS_LINENO(yyless_macro_arg);\ 181 *yy_cp = (yy_hold_char); \ 182 YY_RESTORE_YY_MORE_OFFSET \ 183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 184 YY_DO_BEFORE_ACTION; \ 188 #define unput(c) yyunput( c, (yytext_ptr) ) 190 #ifndef YY_TYPEDEF_YY_SIZE_T 191 #define YY_TYPEDEF_YY_SIZE_T 192 typedef size_t yy_size_t;
195 #ifndef YY_STRUCT_YY_BUFFER_STATE 196 #define YY_STRUCT_YY_BUFFER_STATE 207 yy_size_t yy_buf_size;
218 int yy_is_our_buffer;
225 int yy_is_interactive;
241 int yy_buffer_status;
243 #define YY_BUFFER_NEW 0 244 #define YY_BUFFER_NORMAL 1 255 #define YY_BUFFER_EOF_PENDING 2 271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 281 static char yy_hold_char;
282 static int yy_n_chars;
286 static char *yy_c_buf_p = (
char *) 0;
287 static int yy_init = 0;
288 static int yy_start = 0;
293 static int yy_did_buffer_switch_on_eof;
295 void yyrestart (FILE *input_file );
296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297 YY_BUFFER_STATE yy_create_buffer (FILE *file,
int size );
298 void yy_delete_buffer (YY_BUFFER_STATE b );
299 void yy_flush_buffer (YY_BUFFER_STATE b );
300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301 void yypop_buffer_state (
void );
303 static void yyensure_buffer_stack (
void );
304 static void yy_load_buffer_state (
void );
305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 309 YY_BUFFER_STATE yy_scan_buffer (
char *base,yy_size_t size );
310 YY_BUFFER_STATE yy_scan_string (yyconst
char *yy_str );
311 YY_BUFFER_STATE yy_scan_bytes (yyconst
char *bytes,
int len );
313 void *yyalloc (yy_size_t );
314 void *yyrealloc (
void *,yy_size_t );
315 void yyfree (
void * );
317 #define yy_new_buffer yy_create_buffer 319 #define yy_set_interactive(is_interactive) \ 321 if ( ! YY_CURRENT_BUFFER ){ \ 322 yyensure_buffer_stack (); \ 323 YY_CURRENT_BUFFER_LVALUE = \ 324 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 329 #define yy_set_bol(at_bol) \ 331 if ( ! YY_CURRENT_BUFFER ){\ 332 yyensure_buffer_stack (); \ 333 YY_CURRENT_BUFFER_LVALUE = \ 334 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 344 #define YY_SKIP_YYWRAP 346 typedef unsigned char YY_CHAR;
348 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
350 typedef int yy_state_type;
357 #define yytext_ptr yytext 359 static yy_state_type yy_get_previous_state (
void );
360 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
361 static int yy_get_next_buffer (
void );
362 static void yy_fatal_error (yyconst
char msg[] );
367 #define YY_DO_BEFORE_ACTION \ 368 (yytext_ptr) = yy_bp; \ 369 yyleng = (size_t) (yy_cp - yy_bp); \ 370 (yy_hold_char) = *yy_cp; \ 372 (yy_c_buf_p) = yy_cp; 374 #define YY_NUM_RULES 7 375 #define YY_END_OF_BUFFER 8 380 flex_int32_t yy_verify;
383 static yyconst flex_int16_t yy_accept[17] =
385 0, 0, 8, 6, 4, 2, 6, 1, 6, 5,
389 static yyconst flex_int32_t yy_ec[256] =
391 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 2, 1, 4, 5, 1, 1, 1, 6, 1,
395 1, 1, 1, 1, 7, 7, 7, 8, 8, 8,
396 8, 8, 8, 8, 8, 8, 8, 7, 1, 1,
397 1, 1, 1, 7, 9, 9, 9, 9, 9, 9,
398 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
399 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
400 1, 7, 1, 1, 7, 1, 10, 10, 10, 10,
402 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
403 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
404 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 static yyconst flex_int32_t yy_meta[11] =
423 1, 1, 2, 1, 1, 1, 1, 1, 1, 1
426 static yyconst flex_int16_t yy_base[20] =
428 0, 0, 15, 31, 31, 31, 8, 0, 10, 10,
429 18, 31, 0, 20, 0, 31, 26, 13, 28
432 static yyconst flex_int16_t yy_def[20] =
434 16, 1, 16, 16, 16, 16, 17, 18, 19, 16,
435 17, 16, 18, 19, 10, 0, 16, 16, 16
438 static yyconst flex_int16_t yy_nxt[42] =
440 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
441 12, 12, 12, 13, 16, 12, 15, 15, 15, 15,
442 12, 12, 12, 16, 16, 12, 11, 11, 14, 14,
443 3, 16, 16, 16, 16, 16, 16, 16, 16, 16,
447 static yyconst flex_int16_t yy_chk[42] =
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 7, 7, 9, 18, 3, 9, 10, 10, 10, 10,
451 11, 11, 14, 0, 0, 14, 17, 17, 19, 19,
452 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
456 static yy_state_type yy_last_accepting_state;
457 static char *yy_last_accepting_cpos;
459 extern int yy_flex_debug;
460 int yy_flex_debug = 0;
465 #define REJECT reject_used_but_not_detected 466 #define yymore() yymore_used_but_not_detected 467 #define YY_MORE_ADJ 0 468 #define YY_RESTORE_YY_MORE_OFFSET 470 #line 1 "configfile.l" 511 #line 43 "configfile.l" 517 #include "configfile.h" 519 int evaluatetoken(
char *pcToken);
521 static int iLinenumber;
522 static int iOldLinenumber;
523 static char *pcPrevious;
524 static char *pcCurrent;
525 static char *pcFriendlyname;
526 static char *pcDevicename;
527 static char *pcLibpath;
528 static char *pcChannelid;
531 static int reader_list_size;
532 const char *ConfFile;
534 void tok_error(
char *pcToken_error);
536 #define YY_NO_INPUT 1 537 #line 538 "configfile.c" 541 #ifndef YY_NO_UNISTD_H 549 #ifndef YY_EXTRA_TYPE 550 #define YY_EXTRA_TYPE void * 553 static int yy_init_globals (
void );
558 int yylex_destroy (
void );
560 int yyget_debug (
void );
562 void yyset_debug (
int debug_flag );
564 YY_EXTRA_TYPE yyget_extra (
void );
566 void yyset_extra (YY_EXTRA_TYPE user_defined );
568 FILE *yyget_in (
void );
570 void yyset_in (FILE * in_str );
572 FILE *yyget_out (
void );
574 void yyset_out (FILE * out_str );
576 int yyget_leng (
void );
578 char *yyget_text (
void );
580 int yyget_lineno (
void );
582 void yyset_lineno (
int line_number );
588 #ifndef YY_SKIP_YYWRAP 590 extern "C" int yywrap (
void );
592 extern int yywrap (
void );
597 static void yy_flex_strncpy (
char *,yyconst
char *,
int );
600 #ifdef YY_NEED_STRLEN 601 static int yy_flex_strlen (yyconst
char * );
607 static int yyinput (
void );
609 static int input (
void );
615 #ifndef YY_READ_BUF_SIZE 618 #define YY_READ_BUF_SIZE 16384 620 #define YY_READ_BUF_SIZE 8192 629 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) 636 #define YY_INPUT(buf,result,max_size) \ 637 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 641 for ( n = 0; n < max_size && \ 642 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 645 buf[n++] = (char) c; \ 646 if ( c == EOF && ferror( yyin ) ) \ 647 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 653 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 655 if( errno != EINTR) \ 657 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 673 #define yyterminate() return YY_NULL 677 #ifndef YY_START_STACK_INCR 678 #define YY_START_STACK_INCR 25 682 #ifndef YY_FATAL_ERROR 683 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 692 #define YY_DECL_IS_OURS 1 694 extern int yylex (
void);
696 #define YY_DECL int yylex (void) 702 #ifndef YY_USER_ACTION 703 #define YY_USER_ACTION 708 #define YY_BREAK break; 711 #define YY_RULE_SETUP \ 718 register yy_state_type yy_current_state;
719 register char *yy_cp, *yy_bp;
722 #line 73 "configfile.l" 725 #line 726 "configfile.c" 744 if ( ! YY_CURRENT_BUFFER ) {
745 yyensure_buffer_stack ();
746 YY_CURRENT_BUFFER_LVALUE =
747 yy_create_buffer(yyin,YY_BUF_SIZE );
750 yy_load_buffer_state( );
755 yy_cp = (yy_c_buf_p);
758 *yy_cp = (yy_hold_char);
765 yy_current_state = (yy_start);
769 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
770 if ( yy_accept[yy_current_state] )
772 (yy_last_accepting_state) = yy_current_state;
773 (yy_last_accepting_cpos) = yy_cp;
775 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
777 yy_current_state = (int) yy_def[yy_current_state];
778 if ( yy_current_state >= 17 )
779 yy_c = yy_meta[(
unsigned int) yy_c];
781 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
784 while ( yy_base[yy_current_state] != 31 );
787 yy_act = yy_accept[yy_current_state];
790 yy_cp = (yy_last_accepting_cpos);
791 yy_current_state = (yy_last_accepting_state);
792 yy_act = yy_accept[yy_current_state];
803 *yy_cp = (yy_hold_char);
804 yy_cp = (yy_last_accepting_cpos);
805 yy_current_state = (yy_last_accepting_state);
810 #line 75 "configfile.l" 816 #line 76 "configfile.l" 822 #line 77 "configfile.l" 823 { (void)evaluatetoken(yytext); }
827 #line 78 "configfile.l" 832 #line 79 "configfile.l" 833 { (void)evaluatetoken(yytext); }
837 #line 80 "configfile.l" 838 { iOldLinenumber = iLinenumber; tok_error(yytext); }
842 #line 81 "configfile.l" 845 #line 846 "configfile.c" 846 case YY_STATE_EOF(INITIAL):
849 case YY_END_OF_BUFFER:
852 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
855 *yy_cp = (yy_hold_char);
856 YY_RESTORE_YY_MORE_OFFSET
858 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
869 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
870 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
871 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
881 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
883 yy_state_type yy_next_state;
885 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
887 yy_current_state = yy_get_previous_state( );
898 yy_next_state = yy_try_NUL_trans( yy_current_state );
900 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
905 yy_cp = ++(yy_c_buf_p);
906 yy_current_state = yy_next_state;
912 yy_cp = (yy_c_buf_p);
917 else switch ( yy_get_next_buffer( ) )
919 case EOB_ACT_END_OF_FILE:
921 (yy_did_buffer_switch_on_eof) = 0;
934 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
936 yy_act = YY_STATE_EOF(YY_START);
942 if ( ! (yy_did_buffer_switch_on_eof) )
948 case EOB_ACT_CONTINUE_SCAN:
950 (yytext_ptr) + yy_amount_of_matched_text;
952 yy_current_state = yy_get_previous_state( );
954 yy_cp = (yy_c_buf_p);
955 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
958 case EOB_ACT_LAST_MATCH:
960 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
962 yy_current_state = yy_get_previous_state( );
964 yy_cp = (yy_c_buf_p);
965 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
973 "fatal flex scanner internal error--no action found" );
985 static int yy_get_next_buffer (
void)
987 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
988 register char *source = (yytext_ptr);
989 register int number_to_move, i;
992 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
994 "fatal flex scanner internal error--end of buffer missed" );
996 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
998 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1003 return EOB_ACT_END_OF_FILE;
1011 return EOB_ACT_LAST_MATCH;
1018 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1020 for ( i = 0; i < number_to_move; ++i )
1021 *(dest++) = *(source++);
1023 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1027 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1032 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1034 while ( num_to_read <= 0 )
1038 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1040 int yy_c_buf_p_offset =
1041 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1043 if ( b->yy_is_our_buffer )
1045 int new_size = b->yy_buf_size * 2;
1047 if ( new_size <= 0 )
1048 b->yy_buf_size += b->yy_buf_size / 8;
1050 b->yy_buf_size *= 2;
1052 b->yy_ch_buf = (
char *)
1054 yyrealloc((
void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1060 if ( ! b->yy_ch_buf )
1062 "fatal error - scanner input buffer overflow" );
1064 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1066 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1071 if ( num_to_read > YY_READ_BUF_SIZE )
1072 num_to_read = YY_READ_BUF_SIZE;
1075 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1076 (yy_n_chars), (
size_t) num_to_read );
1078 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1081 if ( (yy_n_chars) == 0 )
1083 if ( number_to_move == YY_MORE_ADJ )
1085 ret_val = EOB_ACT_END_OF_FILE;
1091 ret_val = EOB_ACT_LAST_MATCH;
1092 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1093 YY_BUFFER_EOF_PENDING;
1098 ret_val = EOB_ACT_CONTINUE_SCAN;
1100 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1102 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1103 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc((
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1104 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1105 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1108 (yy_n_chars) += number_to_move;
1109 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1110 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1112 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1119 static yy_state_type yy_get_previous_state (
void)
1121 register yy_state_type yy_current_state;
1122 register char *yy_cp;
1124 yy_current_state = (yy_start);
1126 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1128 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1129 if ( yy_accept[yy_current_state] )
1131 (yy_last_accepting_state) = yy_current_state;
1132 (yy_last_accepting_cpos) = yy_cp;
1134 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1136 yy_current_state = (int) yy_def[yy_current_state];
1137 if ( yy_current_state >= 17 )
1138 yy_c = yy_meta[(
unsigned int) yy_c];
1140 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1143 return yy_current_state;
1151 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1153 register int yy_is_jam;
1154 register char *yy_cp = (yy_c_buf_p);
1156 register YY_CHAR yy_c = 1;
1157 if ( yy_accept[yy_current_state] )
1159 (yy_last_accepting_state) = yy_current_state;
1160 (yy_last_accepting_cpos) = yy_cp;
1162 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1164 yy_current_state = (int) yy_def[yy_current_state];
1165 if ( yy_current_state >= 17 )
1166 yy_c = yy_meta[(
unsigned int) yy_c];
1168 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1169 yy_is_jam = (yy_current_state == 16);
1171 return yy_is_jam ? 0 : yy_current_state;
1176 static int yyinput (
void)
1178 static int input (
void)
1184 *(yy_c_buf_p) = (yy_hold_char);
1186 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1192 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1194 *(yy_c_buf_p) =
'\0';
1198 int offset = (yy_c_buf_p) - (yytext_ptr);
1201 switch ( yy_get_next_buffer( ) )
1203 case EOB_ACT_LAST_MATCH:
1219 case EOB_ACT_END_OF_FILE:
1224 if ( ! (yy_did_buffer_switch_on_eof) )
1233 case EOB_ACT_CONTINUE_SCAN:
1234 (yy_c_buf_p) = (yytext_ptr) + offset;
1240 c = *(
unsigned char *) (yy_c_buf_p);
1241 *(yy_c_buf_p) =
'\0';
1242 (yy_hold_char) = *++(yy_c_buf_p);
1253 void yyrestart (FILE * input_file )
1256 if ( ! YY_CURRENT_BUFFER ){
1257 yyensure_buffer_stack ();
1258 YY_CURRENT_BUFFER_LVALUE =
1259 yy_create_buffer(yyin,YY_BUF_SIZE );
1262 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1263 yy_load_buffer_state( );
1270 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1278 yyensure_buffer_stack ();
1279 if ( YY_CURRENT_BUFFER == new_buffer )
1282 if ( YY_CURRENT_BUFFER )
1285 *(yy_c_buf_p) = (yy_hold_char);
1286 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1287 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1290 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1291 yy_load_buffer_state( );
1298 (yy_did_buffer_switch_on_eof) = 1;
1301 static void yy_load_buffer_state (
void)
1303 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1304 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1305 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1306 (yy_hold_char) = *(yy_c_buf_p);
1315 YY_BUFFER_STATE yy_create_buffer (FILE * file,
int size )
1321 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1323 b->yy_buf_size = size;
1328 b->yy_ch_buf = (
char *) yyalloc(b->yy_buf_size + 2 );
1329 if ( ! b->yy_ch_buf )
1330 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1332 b->yy_is_our_buffer = 1;
1334 yy_init_buffer(b,file );
1343 void yy_delete_buffer (YY_BUFFER_STATE b )
1349 if ( b == YY_CURRENT_BUFFER )
1350 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1352 if ( b->yy_is_our_buffer )
1353 yyfree((
void *) b->yy_ch_buf );
1355 yyfree((
void *) b );
1359 extern int isatty (
int );
1366 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1371 yy_flush_buffer(b );
1373 b->yy_input_file = file;
1374 b->yy_fill_buffer = 1;
1380 if (b != YY_CURRENT_BUFFER){
1385 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1394 void yy_flush_buffer (YY_BUFFER_STATE b )
1405 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1406 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1408 b->yy_buf_pos = &b->yy_ch_buf[0];
1411 b->yy_buffer_status = YY_BUFFER_NEW;
1413 if ( b == YY_CURRENT_BUFFER )
1414 yy_load_buffer_state( );
1423 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1425 if (new_buffer == NULL)
1428 yyensure_buffer_stack();
1431 if ( YY_CURRENT_BUFFER )
1434 *(yy_c_buf_p) = (yy_hold_char);
1435 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1436 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1440 if (YY_CURRENT_BUFFER)
1442 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1445 yy_load_buffer_state( );
1446 (yy_did_buffer_switch_on_eof) = 1;
1453 void yypop_buffer_state (
void)
1455 if (!YY_CURRENT_BUFFER)
1458 yy_delete_buffer(YY_CURRENT_BUFFER );
1459 YY_CURRENT_BUFFER_LVALUE = NULL;
1463 if (YY_CURRENT_BUFFER) {
1464 yy_load_buffer_state( );
1465 (yy_did_buffer_switch_on_eof) = 1;
1472 static void yyensure_buffer_stack (
void)
1476 if (!(yy_buffer_stack)) {
1486 if ( ! (yy_buffer_stack) )
1487 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1489 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
1506 if ( ! (yy_buffer_stack) )
1507 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1521 YY_BUFFER_STATE yy_scan_buffer (
char * base, yy_size_t size )
1526 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1527 base[size-1] != YY_END_OF_BUFFER_CHAR )
1533 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1535 b->yy_buf_size = size - 2;
1536 b->yy_buf_pos = b->yy_ch_buf = base;
1537 b->yy_is_our_buffer = 0;
1538 b->yy_input_file = 0;
1539 b->yy_n_chars = b->yy_buf_size;
1540 b->yy_is_interactive = 0;
1542 b->yy_fill_buffer = 0;
1543 b->yy_buffer_status = YY_BUFFER_NEW;
1545 yy_switch_to_buffer(b );
1558 YY_BUFFER_STATE yy_scan_string (yyconst
char * yystr )
1561 return yy_scan_bytes(yystr,strlen(yystr) );
1571 YY_BUFFER_STATE yy_scan_bytes (yyconst
char * yybytes,
int _yybytes_len )
1579 n = _yybytes_len + 2;
1580 buf = (
char *) yyalloc(n );
1582 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1584 for ( i = 0; i < _yybytes_len; ++i )
1585 buf[i] = yybytes[i];
1587 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1589 b = yy_scan_buffer(buf,n );
1591 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1596 b->yy_is_our_buffer = 1;
1601 #ifndef YY_EXIT_FAILURE 1602 #define YY_EXIT_FAILURE 2 1605 static void yy_fatal_error (yyconst
char* msg )
1607 (void) fprintf( stderr,
"%s\n", msg );
1608 exit( YY_EXIT_FAILURE );
1618 int yyless_macro_arg = (n); \ 1619 YY_LESS_LINENO(yyless_macro_arg);\ 1620 yytext[yyleng] = (yy_hold_char); \ 1621 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1622 (yy_hold_char) = *(yy_c_buf_p); \ 1623 *(yy_c_buf_p) = '\0'; \ 1624 yyleng = yyless_macro_arg; \ 1633 int yyget_lineno (
void)
1642 FILE *yyget_in (
void)
1650 FILE *yyget_out (
void)
1658 int yyget_leng (
void)
1667 char *yyget_text (
void)
1676 void yyset_lineno (
int line_number )
1679 yylineno = line_number;
1688 void yyset_in (FILE * in_str )
1693 void yyset_out (FILE * out_str )
1698 int yyget_debug (
void)
1700 return yy_flex_debug;
1703 void yyset_debug (
int bdebug )
1705 yy_flex_debug = bdebug ;
1708 static int yy_init_globals (
void)
1717 (yy_c_buf_p) = (
char *) 0;
1737 int yylex_destroy (
void)
1741 while(YY_CURRENT_BUFFER){
1742 yy_delete_buffer(YY_CURRENT_BUFFER );
1743 YY_CURRENT_BUFFER_LVALUE = NULL;
1744 yypop_buffer_state();
1748 yyfree((yy_buffer_stack) );
1763 static void yy_flex_strncpy (
char* s1, yyconst
char * s2,
int n )
1766 for ( i = 0; i < n; ++i )
1771 #ifdef YY_NEED_STRLEN 1772 static int yy_flex_strlen (yyconst
char * s )
1775 for ( n = 0; s[n]; ++n )
1782 void *yyalloc (yy_size_t size )
1784 return (
void *) malloc( size );
1787 void *yyrealloc (
void * ptr, yy_size_t size )
1796 return (
void *) realloc( (
char *) ptr, size );
1799 void yyfree (
void * ptr )
1801 free( (
char *) ptr );
1804 #define YYTABLES_NAME "yytables" 1806 #line 81 "configfile.l" 1822 int evaluatetoken(
char *pcToken)
1824 if (pcPrevious == NULL)
1826 pcPrevious = strdup(pcToken);
1827 iOldLinenumber = iLinenumber;
1832 if (iOldLinenumber != iLinenumber)
1834 tok_error(pcPrevious);
1835 pcPrevious = strdup(pcToken);
1836 iOldLinenumber = iLinenumber;
1840 pcCurrent = pcToken;
1841 if (strcmp(pcPrevious,
"FRIENDLYNAME") == 0)
1843 if (pcFriendlyname == NULL)
1847 pcFriendlyname = malloc(strlen(pcCurrent) + 1);
1848 for (n = 0, p = 0; n < strlen(pcCurrent); n++)
1850 if (pcCurrent[n] !=
'"')
1852 pcFriendlyname[p++] = pcCurrent[n];
1855 pcFriendlyname[p++] =
'\0';
1859 tok_error(pcPrevious);
1863 else if (strcmp(pcPrevious,
"DEVICENAME") == 0)
1865 if (pcDevicename == NULL)
1867 struct stat fStatBuf;
1869 pcDevicename = strdup(pcCurrent);
1870 if ((NULL == strchr(pcDevicename,
':'))
1871 && (stat(pcDevicename, &fStatBuf) != 0))
1873 Log3(PCSC_LOG_CRITICAL,
"Error with device %s: %s",
1874 pcDevicename, strerror(errno));
1875 Log1(PCSC_LOG_CRITICAL,
"You should remove the DEVICENAME line if your driver does not use this field");
1881 tok_error(pcPrevious);
1885 else if (strcmp(pcPrevious,
"LIBPATH") == 0)
1887 if (pcLibpath == NULL)
1889 struct stat fStatBuf;
1891 pcLibpath = strdup(pcCurrent);
1892 if (stat(pcLibpath, &fStatBuf) != 0)
1894 Log3(PCSC_LOG_CRITICAL,
"Error with library %s: %s",
1895 pcLibpath, strerror(errno));
1899 if (strstr(pcLibpath,
".bundle") != NULL)
1901 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1902 Log2(PCSC_LOG_ERROR,
"WARNING: USB drivers SHOULD NOT be declared in reader.conf: %s", pcLibpath);
1903 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1908 tok_error(pcPrevious);
1912 else if (strcmp(pcPrevious,
"CHANNELID") == 0)
1914 if (pcChannelid == NULL)
1915 pcChannelid = strdup(pcCurrent);
1918 tok_error(pcPrevious);
1924 tok_error(pcPrevious);
1935 if (pcFriendlyname && pcLibpath && badError != 1
1936 && (pcChannelid || pcDevicename))
1939 static char* defaultDeviceName = (
char *)
"";
1941 Log2(PCSC_LOG_DEBUG,
"Add reader: %s", pcFriendlyname);
1942 if (0 == reader_list_size)
1945 reader_list_size = 2;
1946 reader_list = malloc(reader_list_size *
sizeof(
SerialReader));
1951 reader_list = realloc(reader_list, reader_list_size *
1959 if (NULL == pcDevicename)
1960 pcDevicename = defaultDeviceName;
1963 channelId = strtoul(pcChannelid, NULL, 0);
1966 reader_list[reader_list_size-2].
pcFriendlyname = strdup(pcFriendlyname);
1967 reader_list[reader_list_size-2].
pcDevicename = strdup(pcDevicename);
1968 reader_list[reader_list_size-2].
pcLibpath = strdup(pcLibpath),
1969 reader_list[reader_list_size-2].
channelId = channelId;
1971 free(pcFriendlyname);
1972 pcFriendlyname = NULL;
1974 if (pcDevicename != defaultDeviceName)
1976 pcDevicename = NULL;
1989 void tok_error(
char *token_error)
1991 Log4(PCSC_LOG_ERROR,
"tok_error: invalid value line %d in %s: %s",
1992 iOldLinenumber, ConfFile, token_error);
1996 int DBGetReaderListDir(
const char *readerconf_dir,
2004 reader_list_size = 0;
2006 dir = opendir(readerconf_dir);
2010 struct dirent *direntry;
2012 Log2(PCSC_LOG_DEBUG,
"Parsing conf directory: %s", readerconf_dir);
2015 while ((direntry = readdir(dir)) != NULL)
2017 char filename[FILENAME_MAX];
2021 if (direntry->d_type != DT_REG)
2023 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
2029 if (
'.' == direntry->d_name[0])
2031 Log2(PCSC_LOG_DEBUG,
"Skipping hidden file: %s",
2036 snprintf(filename,
sizeof(filename),
"%s/%s",
2037 readerconf_dir, direntry->d_name);
2040 r = DBGetReaderList(filename, caller_reader_list);
2051 ret = DBGetReaderList(readerconf_dir, caller_reader_list);
2056 int DBGetReaderList(
const char *readerconf,
SerialReader **caller_reader_list)
2058 FILE *configFile = NULL;
2060 *caller_reader_list = NULL;
2063 ConfFile = readerconf;
2065 Log2(PCSC_LOG_DEBUG,
"Parsing conf file: %s", ConfFile);
2067 configFile = fopen(readerconf,
"r");
2069 if (configFile == NULL)
2076 iOldLinenumber = -1;
2077 pcFriendlyname = NULL;
2078 pcDevicename = NULL;
2089 while (!feof(configFile));
2092 (void)fclose(configFile);
2094 *caller_reader_list = reader_list;
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
int yy_bs_column
The column count.
This handles abstract system level calls.
static size_t yy_buffer_stack_max
capacity of stack.
This keeps a list of defines for pcsc-lite.
This keeps a list of Windows(R) types.
This keeps a list of defines for pcsc-lite.
YY_DECL
The main scanner function which does all the work.
This keeps track of a list of currently available reader structures.
static size_t yy_buffer_stack_top
index of top of stack.
char * pcDevicename
DEVICENAME.
char * pcFriendlyname
FRIENDLYNAME.
int yy_bs_lineno
The line count.