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"
485 #line 17 "configfile.l"
491 #include "configfile.h"
493 int evaluatetoken(
char *pcToken);
495 static int iLinenumber;
496 static int iOldLinenumber;
497 static char *pcPrevious;
498 static char *pcCurrent;
499 static char *pcFriendlyname;
500 static const char *pcDevicename;
501 static char *pcLibpath;
502 static char *pcChannelid;
505 static int reader_list_size;
506 const char *ConfFile;
508 void tok_error(
char *pcToken_error);
510 #define YY_NO_INPUT 1
511 #line 512 "configfile.c"
515 #ifndef YY_NO_UNISTD_H
523 #ifndef YY_EXTRA_TYPE
524 #define YY_EXTRA_TYPE void *
527 static int yy_init_globals (
void );
532 int yylex_destroy (
void );
534 int yyget_debug (
void );
536 void yyset_debug (
int debug_flag );
538 YY_EXTRA_TYPE yyget_extra (
void );
540 void yyset_extra (YY_EXTRA_TYPE user_defined );
542 FILE *yyget_in (
void );
544 void yyset_in (FILE * in_str );
546 FILE *yyget_out (
void );
548 void yyset_out (FILE * out_str );
550 int yyget_leng (
void );
552 char *yyget_text (
void );
554 int yyget_lineno (
void );
556 void yyset_lineno (
int line_number );
562 #ifndef YY_SKIP_YYWRAP
564 extern "C" int yywrap (
void );
566 extern int yywrap (
void );
571 static void yy_flex_strncpy (
char *,yyconst
char *,
int );
574 #ifdef YY_NEED_STRLEN
575 static int yy_flex_strlen (yyconst
char * );
581 static int yyinput (
void );
583 static int input (
void );
589 #ifndef YY_READ_BUF_SIZE
592 #define YY_READ_BUF_SIZE 16384
594 #define YY_READ_BUF_SIZE 8192
603 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
610 #define YY_INPUT(buf,result,max_size) \
611 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
615 for ( n = 0; n < max_size && \
616 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
619 buf[n++] = (char) c; \
620 if ( c == EOF && ferror( yyin ) ) \
621 YY_FATAL_ERROR( "input in flex scanner failed" ); \
627 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
629 if( errno != EINTR) \
631 YY_FATAL_ERROR( "input in flex scanner failed" ); \
647 #define yyterminate() return YY_NULL
651 #ifndef YY_START_STACK_INCR
652 #define YY_START_STACK_INCR 25
656 #ifndef YY_FATAL_ERROR
657 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
666 #define YY_DECL_IS_OURS 1
668 extern int yylex (
void);
670 #define YY_DECL int yylex (void)
676 #ifndef YY_USER_ACTION
677 #define YY_USER_ACTION
682 #define YY_BREAK break;
685 #define YY_RULE_SETUP \
692 register yy_state_type yy_current_state;
693 register char *yy_cp, *yy_bp;
696 #line 47 "configfile.l"
699 #line 700 "configfile.c"
718 if ( ! YY_CURRENT_BUFFER ) {
719 yyensure_buffer_stack ();
720 YY_CURRENT_BUFFER_LVALUE =
721 yy_create_buffer(yyin,YY_BUF_SIZE );
724 yy_load_buffer_state( );
729 yy_cp = (yy_c_buf_p);
732 *yy_cp = (yy_hold_char);
739 yy_current_state = (yy_start);
743 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
744 if ( yy_accept[yy_current_state] )
746 (yy_last_accepting_state) = yy_current_state;
747 (yy_last_accepting_cpos) = yy_cp;
749 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
751 yy_current_state = (int) yy_def[yy_current_state];
752 if ( yy_current_state >= 17 )
753 yy_c = yy_meta[(
unsigned int) yy_c];
755 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
758 while ( yy_base[yy_current_state] != 31 );
761 yy_act = yy_accept[yy_current_state];
764 yy_cp = (yy_last_accepting_cpos);
765 yy_current_state = (yy_last_accepting_state);
766 yy_act = yy_accept[yy_current_state];
777 *yy_cp = (yy_hold_char);
778 yy_cp = (yy_last_accepting_cpos);
779 yy_current_state = (yy_last_accepting_state);
784 #line 49 "configfile.l"
790 #line 50 "configfile.l"
796 #line 51 "configfile.l"
797 { (void)evaluatetoken(yytext); }
801 #line 52 "configfile.l"
806 #line 53 "configfile.l"
807 { (void)evaluatetoken(yytext); }
811 #line 54 "configfile.l"
812 { iOldLinenumber = iLinenumber; tok_error(yytext); }
816 #line 55 "configfile.l"
819 #line 820 "configfile.c"
820 case YY_STATE_EOF(INITIAL):
823 case YY_END_OF_BUFFER:
826 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
829 *yy_cp = (yy_hold_char);
830 YY_RESTORE_YY_MORE_OFFSET
832 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
843 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
844 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
845 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
855 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
857 yy_state_type yy_next_state;
859 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
861 yy_current_state = yy_get_previous_state( );
872 yy_next_state = yy_try_NUL_trans( yy_current_state );
874 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
879 yy_cp = ++(yy_c_buf_p);
880 yy_current_state = yy_next_state;
886 yy_cp = (yy_c_buf_p);
891 else switch ( yy_get_next_buffer( ) )
893 case EOB_ACT_END_OF_FILE:
895 (yy_did_buffer_switch_on_eof) = 0;
908 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
910 yy_act = YY_STATE_EOF(YY_START);
916 if ( ! (yy_did_buffer_switch_on_eof) )
922 case EOB_ACT_CONTINUE_SCAN:
924 (yytext_ptr) + yy_amount_of_matched_text;
926 yy_current_state = yy_get_previous_state( );
928 yy_cp = (yy_c_buf_p);
929 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
932 case EOB_ACT_LAST_MATCH:
934 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
936 yy_current_state = yy_get_previous_state( );
938 yy_cp = (yy_c_buf_p);
939 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
947 "fatal flex scanner internal error--no action found" );
959 static int yy_get_next_buffer (
void)
961 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
962 register char *source = (yytext_ptr);
963 register int number_to_move, i;
966 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
968 "fatal flex scanner internal error--end of buffer missed" );
970 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
972 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
977 return EOB_ACT_END_OF_FILE;
985 return EOB_ACT_LAST_MATCH;
992 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
994 for ( i = 0; i < number_to_move; ++i )
995 *(dest++) = *(source++);
997 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1001 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1006 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1008 while ( num_to_read <= 0 )
1012 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1014 int yy_c_buf_p_offset =
1015 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1017 if ( b->yy_is_our_buffer )
1019 int new_size = b->yy_buf_size * 2;
1021 if ( new_size <= 0 )
1022 b->yy_buf_size += b->yy_buf_size / 8;
1024 b->yy_buf_size *= 2;
1026 b->yy_ch_buf = (
char *)
1028 yyrealloc((
void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1034 if ( ! b->yy_ch_buf )
1036 "fatal error - scanner input buffer overflow" );
1038 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1040 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1045 if ( num_to_read > YY_READ_BUF_SIZE )
1046 num_to_read = YY_READ_BUF_SIZE;
1049 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1050 (yy_n_chars), (
size_t) num_to_read );
1052 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1055 if ( (yy_n_chars) == 0 )
1057 if ( number_to_move == YY_MORE_ADJ )
1059 ret_val = EOB_ACT_END_OF_FILE;
1065 ret_val = EOB_ACT_LAST_MATCH;
1066 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1067 YY_BUFFER_EOF_PENDING;
1072 ret_val = EOB_ACT_CONTINUE_SCAN;
1074 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1076 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1077 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc((
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1078 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1079 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1082 (yy_n_chars) += number_to_move;
1083 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1084 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1086 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1093 static yy_state_type yy_get_previous_state (
void)
1095 register yy_state_type yy_current_state;
1096 register char *yy_cp;
1098 yy_current_state = (yy_start);
1100 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1102 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1103 if ( yy_accept[yy_current_state] )
1105 (yy_last_accepting_state) = yy_current_state;
1106 (yy_last_accepting_cpos) = yy_cp;
1108 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1110 yy_current_state = (int) yy_def[yy_current_state];
1111 if ( yy_current_state >= 17 )
1112 yy_c = yy_meta[(
unsigned int) yy_c];
1114 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1117 return yy_current_state;
1125 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1127 register int yy_is_jam;
1128 register char *yy_cp = (yy_c_buf_p);
1130 register YY_CHAR yy_c = 1;
1131 if ( yy_accept[yy_current_state] )
1133 (yy_last_accepting_state) = yy_current_state;
1134 (yy_last_accepting_cpos) = yy_cp;
1136 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1138 yy_current_state = (int) yy_def[yy_current_state];
1139 if ( yy_current_state >= 17 )
1140 yy_c = yy_meta[(
unsigned int) yy_c];
1142 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1143 yy_is_jam = (yy_current_state == 16);
1145 return yy_is_jam ? 0 : yy_current_state;
1150 static int yyinput (
void)
1152 static int input (
void)
1158 *(yy_c_buf_p) = (yy_hold_char);
1160 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1166 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1168 *(yy_c_buf_p) =
'\0';
1172 int offset = (yy_c_buf_p) - (yytext_ptr);
1175 switch ( yy_get_next_buffer( ) )
1177 case EOB_ACT_LAST_MATCH:
1193 case EOB_ACT_END_OF_FILE:
1198 if ( ! (yy_did_buffer_switch_on_eof) )
1207 case EOB_ACT_CONTINUE_SCAN:
1208 (yy_c_buf_p) = (yytext_ptr) + offset;
1214 c = *(
unsigned char *) (yy_c_buf_p);
1215 *(yy_c_buf_p) =
'\0';
1216 (yy_hold_char) = *++(yy_c_buf_p);
1227 void yyrestart (FILE * input_file )
1230 if ( ! YY_CURRENT_BUFFER ){
1231 yyensure_buffer_stack ();
1232 YY_CURRENT_BUFFER_LVALUE =
1233 yy_create_buffer(yyin,YY_BUF_SIZE );
1236 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1237 yy_load_buffer_state( );
1244 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1252 yyensure_buffer_stack ();
1253 if ( YY_CURRENT_BUFFER == new_buffer )
1256 if ( YY_CURRENT_BUFFER )
1259 *(yy_c_buf_p) = (yy_hold_char);
1260 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1261 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1264 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1265 yy_load_buffer_state( );
1272 (yy_did_buffer_switch_on_eof) = 1;
1275 static void yy_load_buffer_state (
void)
1277 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1278 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1279 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1280 (yy_hold_char) = *(yy_c_buf_p);
1289 YY_BUFFER_STATE yy_create_buffer (FILE * file,
int size )
1295 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1297 b->yy_buf_size = size;
1302 b->yy_ch_buf = (
char *) yyalloc(b->yy_buf_size + 2 );
1303 if ( ! b->yy_ch_buf )
1304 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1306 b->yy_is_our_buffer = 1;
1308 yy_init_buffer(b,file );
1317 void yy_delete_buffer (YY_BUFFER_STATE b )
1323 if ( b == YY_CURRENT_BUFFER )
1324 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1326 if ( b->yy_is_our_buffer )
1327 yyfree((
void *) b->yy_ch_buf );
1329 yyfree((
void *) b );
1333 extern int isatty (
int );
1340 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1345 yy_flush_buffer(b );
1347 b->yy_input_file = file;
1348 b->yy_fill_buffer = 1;
1354 if (b != YY_CURRENT_BUFFER){
1359 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1368 void yy_flush_buffer (YY_BUFFER_STATE b )
1379 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1380 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1382 b->yy_buf_pos = &b->yy_ch_buf[0];
1385 b->yy_buffer_status = YY_BUFFER_NEW;
1387 if ( b == YY_CURRENT_BUFFER )
1388 yy_load_buffer_state( );
1397 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1399 if (new_buffer == NULL)
1402 yyensure_buffer_stack();
1405 if ( YY_CURRENT_BUFFER )
1408 *(yy_c_buf_p) = (yy_hold_char);
1409 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1410 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1414 if (YY_CURRENT_BUFFER)
1416 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1419 yy_load_buffer_state( );
1420 (yy_did_buffer_switch_on_eof) = 1;
1427 void yypop_buffer_state (
void)
1429 if (!YY_CURRENT_BUFFER)
1432 yy_delete_buffer(YY_CURRENT_BUFFER );
1433 YY_CURRENT_BUFFER_LVALUE = NULL;
1437 if (YY_CURRENT_BUFFER) {
1438 yy_load_buffer_state( );
1439 (yy_did_buffer_switch_on_eof) = 1;
1446 static void yyensure_buffer_stack (
void)
1450 if (!(yy_buffer_stack)) {
1460 if ( ! (yy_buffer_stack) )
1461 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1463 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
1480 if ( ! (yy_buffer_stack) )
1481 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1495 YY_BUFFER_STATE yy_scan_buffer (
char * base, yy_size_t size )
1500 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1501 base[size-1] != YY_END_OF_BUFFER_CHAR )
1507 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1509 b->yy_buf_size = size - 2;
1510 b->yy_buf_pos = b->yy_ch_buf = base;
1511 b->yy_is_our_buffer = 0;
1512 b->yy_input_file = 0;
1513 b->yy_n_chars = b->yy_buf_size;
1514 b->yy_is_interactive = 0;
1516 b->yy_fill_buffer = 0;
1517 b->yy_buffer_status = YY_BUFFER_NEW;
1519 yy_switch_to_buffer(b );
1532 YY_BUFFER_STATE yy_scan_string (yyconst
char * yystr )
1535 return yy_scan_bytes(yystr,strlen(yystr) );
1545 YY_BUFFER_STATE yy_scan_bytes (yyconst
char * yybytes,
int _yybytes_len )
1553 n = _yybytes_len + 2;
1554 buf = (
char *) yyalloc(n );
1556 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1558 for ( i = 0; i < _yybytes_len; ++i )
1559 buf[i] = yybytes[i];
1561 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1563 b = yy_scan_buffer(buf,n );
1565 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1570 b->yy_is_our_buffer = 1;
1575 #ifndef YY_EXIT_FAILURE
1576 #define YY_EXIT_FAILURE 2
1579 static void yy_fatal_error (yyconst
char* msg )
1581 (void) fprintf( stderr,
"%s\n", msg );
1582 exit( YY_EXIT_FAILURE );
1592 int yyless_macro_arg = (n); \
1593 YY_LESS_LINENO(yyless_macro_arg);\
1594 yytext[yyleng] = (yy_hold_char); \
1595 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1596 (yy_hold_char) = *(yy_c_buf_p); \
1597 *(yy_c_buf_p) = '\0'; \
1598 yyleng = yyless_macro_arg; \
1607 int yyget_lineno (
void)
1616 FILE *yyget_in (
void)
1624 FILE *yyget_out (
void)
1632 int yyget_leng (
void)
1641 char *yyget_text (
void)
1650 void yyset_lineno (
int line_number )
1653 yylineno = line_number;
1662 void yyset_in (FILE * in_str )
1667 void yyset_out (FILE * out_str )
1672 int yyget_debug (
void)
1674 return yy_flex_debug;
1677 void yyset_debug (
int bdebug )
1679 yy_flex_debug = bdebug ;
1682 static int yy_init_globals (
void)
1691 (yy_c_buf_p) = (
char *) 0;
1711 int yylex_destroy (
void)
1715 while(YY_CURRENT_BUFFER){
1716 yy_delete_buffer(YY_CURRENT_BUFFER );
1717 YY_CURRENT_BUFFER_LVALUE = NULL;
1718 yypop_buffer_state();
1722 yyfree((yy_buffer_stack) );
1737 static void yy_flex_strncpy (
char* s1, yyconst
char * s2,
int n )
1740 for ( i = 0; i < n; ++i )
1745 #ifdef YY_NEED_STRLEN
1746 static int yy_flex_strlen (yyconst
char * s )
1749 for ( n = 0; s[n]; ++n )
1756 void *yyalloc (yy_size_t size )
1758 return (
void *) malloc( size );
1761 void *yyrealloc (
void * ptr, yy_size_t size )
1770 return (
void *) realloc( (
char *) ptr, size );
1773 void yyfree (
void * ptr )
1775 free( (
char *) ptr );
1778 #define YYTABLES_NAME "yytables"
1780 #line 55 "configfile.l"
1796 int evaluatetoken(
char *pcToken)
1798 if (pcPrevious == NULL)
1800 pcPrevious = strdup(pcToken);
1801 iOldLinenumber = iLinenumber;
1806 if (iOldLinenumber != iLinenumber)
1808 tok_error(pcPrevious);
1809 pcPrevious = strdup(pcToken);
1810 iOldLinenumber = iLinenumber;
1814 pcCurrent = pcToken;
1815 if (strcmp(pcPrevious,
"FRIENDLYNAME") == 0)
1817 if (pcFriendlyname == NULL)
1821 pcFriendlyname = malloc(strlen(pcCurrent) + 1);
1822 for (n = 0, p = 0; n < strlen(pcCurrent); n++)
1824 if (pcCurrent[n] !=
'"')
1826 pcFriendlyname[p++] = pcCurrent[n];
1829 pcFriendlyname[p++] =
'\0';
1833 tok_error(pcPrevious);
1837 else if (strcmp(pcPrevious,
"DEVICENAME") == 0)
1839 if (pcDevicename == NULL)
1841 struct stat fStatBuf;
1843 pcDevicename = strdup(pcCurrent);
1844 if ((NULL == strchr(pcDevicename,
':'))
1845 && (stat(pcDevicename, &fStatBuf) != 0))
1847 Log3(PCSC_LOG_CRITICAL,
"Error with device %s: %s",
1848 pcDevicename, strerror(errno));
1849 Log1(PCSC_LOG_CRITICAL,
"You should remove the DEVICENAME line if your driver does not use this field");
1855 tok_error(pcPrevious);
1859 else if (strcmp(pcPrevious,
"LIBPATH") == 0)
1861 if (pcLibpath == NULL)
1863 struct stat fStatBuf;
1865 pcLibpath = strdup(pcCurrent);
1866 if (stat(pcLibpath, &fStatBuf) != 0)
1868 Log3(PCSC_LOG_CRITICAL,
"Error with library %s: %s",
1869 pcLibpath, strerror(errno));
1873 if (strstr(pcLibpath,
".bundle") != NULL)
1875 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1876 Log2(PCSC_LOG_ERROR,
"WARNING: USB drivers SHOULD NOT be declared in reader.conf: %s", pcLibpath);
1877 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1882 tok_error(pcPrevious);
1886 else if (strcmp(pcPrevious,
"CHANNELID") == 0)
1888 if (pcChannelid == NULL)
1889 pcChannelid = strdup(pcCurrent);
1892 tok_error(pcPrevious);
1898 tok_error(pcPrevious);
1908 if (pcFriendlyname != NULL &&
1909 pcLibpath != NULL && pcChannelid != NULL && badError != 1)
1913 if (0 == reader_list_size)
1916 reader_list_size = 2;
1917 reader_list = malloc(reader_list_size *
sizeof(
SerialReader));
1922 reader_list = realloc(reader_list, reader_list_size *
1930 if (NULL == pcDevicename)
1933 channelId = strtoul(pcChannelid, NULL, 0);
1934 reader_list[reader_list_size-2].
pcFriendlyname = strdup(pcFriendlyname);
1935 reader_list[reader_list_size-2].
pcDevicename = strdup(pcDevicename);
1936 reader_list[reader_list_size-2].
pcLibpath = strdup(pcLibpath),
1937 reader_list[reader_list_size-2].
channelId = channelId;
1939 pcFriendlyname = NULL;
1940 pcDevicename = NULL;
1948 void tok_error(
char *token_error)
1950 Log4(PCSC_LOG_ERROR,
"tok_error: invalid value line %d in %s: %s",
1951 iOldLinenumber, ConfFile, token_error);
1955 int DBGetReaderListDir(
const char *readerconf_dir,
1963 reader_list_size = 0;
1965 dir = opendir(readerconf_dir);
1969 struct dirent *direntry;
1971 Log2(PCSC_LOG_DEBUG,
"Parsing conf directory: %s", readerconf_dir);
1974 while ((direntry = readdir(dir)) != NULL)
1976 char filename[FILENAME_MAX];
1980 if (direntry->d_type != DT_REG)
1982 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
1988 if (
'.' == direntry->d_name[0])
1990 Log2(PCSC_LOG_DEBUG,
"Skipping hidden file: %s",
1995 snprintf(filename,
sizeof(filename),
"%s/%s",
1996 readerconf_dir, direntry->d_name);
1999 r = DBGetReaderList(filename, caller_reader_list);
2010 ret = DBGetReaderList(readerconf_dir, caller_reader_list);
2015 int DBGetReaderList(
const char *readerconf,
SerialReader **caller_reader_list)
2017 FILE *configFile = NULL;
2019 *caller_reader_list = NULL;
2022 ConfFile = readerconf;
2024 Log2(PCSC_LOG_DEBUG,
"Parsing conf file: %s", ConfFile);
2026 configFile = fopen(readerconf,
"r");
2028 if (configFile == NULL)
2035 iOldLinenumber = -1;
2036 pcFriendlyname = NULL;
2037 pcDevicename = NULL;
2048 while (!feof(configFile));
2050 (void)fclose(configFile);
2052 *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.