4#define YY_INT_ALIGNED short int
9#define YY_FLEX_MAJOR_VERSION 2
10#define YY_FLEX_MINOR_VERSION 6
11#define YY_FLEX_SUBMINOR_VERSION 4
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
43typedef int8_t flex_int8_t;
44typedef uint8_t flex_uint8_t;
45typedef int16_t flex_int16_t;
46typedef uint16_t flex_uint16_t;
47typedef int32_t flex_int32_t;
48typedef uint32_t flex_uint32_t;
49typedef uint64_t flex_uint64_t;
51typedef signed char flex_int8_t;
52typedef short int flex_int16_t;
53typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t;
60#define INT8_MIN (-128)
63#define INT16_MIN (-32767-1)
66#define INT32_MIN (-2147483647-1)
72#define INT16_MAX (32767)
75#define INT32_MAX (2147483647)
78#define UINT8_MAX (255U)
81#define UINT16_MAX (65535U)
84#define UINT32_MAX (4294967295U)
88#define SIZE_MAX (~(size_t)0)
100#if defined(__GNUC__) && __GNUC__ >= 3
101#define yynoreturn __attribute__((__noreturn__))
112#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
118#define BEGIN (yy_start) = 1 + 2 *
123#define YY_START (((yy_start) - 1) / 2)
124#define YYSTATE YY_START
126#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
128#define YY_NEW_FILE yyrestart( yyin )
129#define YY_END_OF_BUFFER_CHAR 0
138#define YY_BUF_SIZE 32768
140#define YY_BUF_SIZE 16384
146#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
148#ifndef YY_TYPEDEF_YY_BUFFER_STATE
149#define YY_TYPEDEF_YY_BUFFER_STATE
153#ifndef YY_TYPEDEF_YY_SIZE_T
154#define YY_TYPEDEF_YY_SIZE_T
155typedef size_t yy_size_t;
158extern yy_size_t yyleng;
160extern FILE *yyin, *yyout;
162#define EOB_ACT_CONTINUE_SCAN 0
163#define EOB_ACT_END_OF_FILE 1
164#define EOB_ACT_LAST_MATCH 2
166 #define YY_LESS_LINENO(n)
167 #define YY_LINENO_REWIND_TO(ptr)
174 int yyless_macro_arg = (n); \
175 YY_LESS_LINENO(yyless_macro_arg);\
176 *yy_cp = (yy_hold_char); \
177 YY_RESTORE_YY_MORE_OFFSET \
178 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
179 YY_DO_BEFORE_ACTION; \
182#define unput(c) yyunput( c, (yytext_ptr) )
184#ifndef YY_STRUCT_YY_BUFFER_STATE
185#define YY_STRUCT_YY_BUFFER_STATE
201 yy_size_t yy_n_chars;
207 int yy_is_our_buffer;
214 int yy_is_interactive;
230 int yy_buffer_status;
232#define YY_BUFFER_NEW 0
233#define YY_BUFFER_NORMAL 1
244#define YY_BUFFER_EOF_PENDING 2
250static size_t yy_buffer_stack_top = 0;
251static size_t yy_buffer_stack_max = 0;
260#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
261 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
266#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
269static char yy_hold_char;
270static yy_size_t yy_n_chars;
274static char *yy_c_buf_p = NULL;
275static int yy_init = 0;
276static int yy_start = 0;
281static int yy_did_buffer_switch_on_eof;
283void yyrestart ( FILE *input_file );
289void yypop_buffer_state (
void );
291static void yyensure_buffer_stack (
void );
292static void yy_load_buffer_state (
void );
294#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
300void *yyalloc ( yy_size_t );
301void *yyrealloc (
void *, yy_size_t );
302void yyfree (
void * );
304#define yy_new_buffer yy_create_buffer
305#define yy_set_interactive(is_interactive) \
307 if ( ! YY_CURRENT_BUFFER ){ \
308 yyensure_buffer_stack (); \
309 YY_CURRENT_BUFFER_LVALUE = \
310 yy_create_buffer( yyin, YY_BUF_SIZE ); \
312 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
314#define yy_set_bol(at_bol) \
316 if ( ! YY_CURRENT_BUFFER ){\
317 yyensure_buffer_stack (); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 yy_create_buffer( yyin, YY_BUF_SIZE ); \
321 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
323#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
328#define YY_SKIP_YYWRAP
329typedef flex_uint8_t YY_CHAR;
331FILE *yyin = NULL, *yyout = NULL;
333typedef int yy_state_type;
342#define yytext_ptr yytext
344static yy_state_type yy_get_previous_state (
void );
345static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
346static int yy_get_next_buffer (
void );
347static void yynoreturn yy_fatal_error (
const char* msg );
352#define YY_DO_BEFORE_ACTION \
353 (yytext_ptr) = yy_bp; \
354 yyleng = (yy_size_t) (yy_cp - yy_bp); \
355 (yy_hold_char) = *yy_cp; \
357 (yy_c_buf_p) = yy_cp;
358#define YY_NUM_RULES 7
359#define YY_END_OF_BUFFER 8
364 flex_int32_t yy_verify;
367static const flex_int16_t yy_accept[17] =
369 0, 0, 8, 6, 4, 2, 6, 1, 6, 5,
373static const YY_CHAR yy_ec[256] =
375 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 2, 1, 4, 5, 1, 1, 1, 6, 1,
379 1, 1, 1, 1, 7, 7, 7, 8, 8, 8,
380 8, 8, 8, 8, 8, 8, 8, 7, 1, 1,
381 7, 1, 1, 7, 9, 9, 9, 9, 9, 9,
382 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
383 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
384 1, 7, 1, 1, 7, 1, 10, 10, 10, 10,
386 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
387 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
388 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405static const YY_CHAR yy_meta[11] =
407 1, 1, 2, 1, 1, 1, 1, 1, 1, 1
410static const flex_int16_t yy_base[20] =
412 0, 0, 15, 31, 31, 31, 8, 0, 10, 10,
413 18, 31, 0, 20, 0, 31, 26, 13, 28
416static const flex_int16_t yy_def[20] =
418 16, 1, 16, 16, 16, 16, 17, 18, 19, 16,
419 17, 16, 18, 19, 10, 0, 16, 16, 16
422static const flex_int16_t yy_nxt[42] =
424 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
425 12, 12, 12, 13, 16, 12, 15, 15, 15, 15,
426 12, 12, 12, 16, 16, 12, 11, 11, 14, 14,
427 3, 16, 16, 16, 16, 16, 16, 16, 16, 16,
431static const flex_int16_t yy_chk[42] =
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 7, 7, 9, 18, 3, 9, 10, 10, 10, 10,
435 11, 11, 14, 0, 0, 14, 17, 17, 19, 19,
436 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
440static yy_state_type yy_last_accepting_state;
441static char *yy_last_accepting_cpos;
443extern int yy_flex_debug;
444int yy_flex_debug = 0;
449#define REJECT reject_used_but_not_detected
450#define yymore() yymore_used_but_not_detected
452#define YY_RESTORE_YY_MORE_OFFSET
454#line 1 "configfile.l"
490#line 38 "configfile.l"
497#include "configfile.h"
499int evaluatetoken(
char *pcToken);
501static int iLinenumber;
502static int iOldLinenumber;
503static char *pcPrevious;
504static char *pcCurrent;
505static char *pcFriendlyname;
506static char *pcDevicename;
507static char *pcLibpath;
508static char *pcChannelid;
511static int reader_list_size;
514void tok_error(
const char *pcToken_error);
516#line 516 "configfile.c"
518#line 518 "configfile.c"
522#ifndef YY_NO_UNISTD_H
531#define YY_EXTRA_TYPE void *
534static int yy_init_globals (
void );
539int yylex_destroy (
void );
541int yyget_debug (
void );
543void yyset_debug (
int debug_flag );
545YY_EXTRA_TYPE yyget_extra (
void );
547void yyset_extra ( YY_EXTRA_TYPE user_defined );
549FILE *yyget_in (
void );
551void yyset_in ( FILE * _in_str );
553FILE *yyget_out (
void );
555void yyset_out ( FILE * _out_str );
557 yy_size_t yyget_leng (
void );
559char *yyget_text (
void );
561int yyget_lineno (
void );
563void yyset_lineno (
int _line_number );
569#ifndef YY_SKIP_YYWRAP
571extern "C" int yywrap (
void );
573extern int yywrap (
void );
582static void yy_flex_strncpy (
char *,
const char *,
int );
586static int yy_flex_strlen (
const char * );
591static int yyinput (
void );
593static int input (
void );
599#ifndef YY_READ_BUF_SIZE
602#define YY_READ_BUF_SIZE 16384
604#define YY_READ_BUF_SIZE 8192
613#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
620#define YY_INPUT(buf,result,max_size) \
621 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
625 for ( n = 0; n < max_size && \
626 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
629 buf[n++] = (char) c; \
630 if ( c == EOF && ferror( yyin ) ) \
631 YY_FATAL_ERROR( "input in flex scanner failed" ); \
637 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
639 if( errno != EINTR) \
641 YY_FATAL_ERROR( "input in flex scanner failed" ); \
657#define yyterminate() return YY_NULL
661#ifndef YY_START_STACK_INCR
662#define YY_START_STACK_INCR 25
666#ifndef YY_FATAL_ERROR
667#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
676#define YY_DECL_IS_OURS 1
678extern int yylex (
void);
680#define YY_DECL int yylex (void)
686#ifndef YY_USER_ACTION
687#define YY_USER_ACTION
692#define YY_BREAK break;
695#define YY_RULE_SETUP \
702 yy_state_type yy_current_state;
723 if ( ! YY_CURRENT_BUFFER ) {
724 yyensure_buffer_stack ();
725 YY_CURRENT_BUFFER_LVALUE =
726 yy_create_buffer( yyin, YY_BUF_SIZE );
729 yy_load_buffer_state( );
733#line 69 "configfile.l"
736#line 736 "configfile.c"
740 yy_cp = (yy_c_buf_p);
743 *yy_cp = (yy_hold_char);
750 yy_current_state = (yy_start);
754 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
755 if ( yy_accept[yy_current_state] )
757 (yy_last_accepting_state) = yy_current_state;
758 (yy_last_accepting_cpos) = yy_cp;
760 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
762 yy_current_state = (int) yy_def[yy_current_state];
763 if ( yy_current_state >= 17 )
764 yy_c = yy_meta[yy_c];
766 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
769 while ( yy_base[yy_current_state] != 31 );
772 yy_act = yy_accept[yy_current_state];
775 yy_cp = (yy_last_accepting_cpos);
776 yy_current_state = (yy_last_accepting_state);
777 yy_act = yy_accept[yy_current_state];
788 *yy_cp = (yy_hold_char);
789 yy_cp = (yy_last_accepting_cpos);
790 yy_current_state = (yy_last_accepting_state);
795#line 71 "configfile.l"
801#line 72 "configfile.l"
807#line 73 "configfile.l"
808{ (void)evaluatetoken(yytext); }
812#line 74 "configfile.l"
817#line 75 "configfile.l"
818{ (void)evaluatetoken(yytext); }
822#line 76 "configfile.l"
823{ iOldLinenumber = iLinenumber; tok_error(yytext); }
827#line 77 "configfile.l"
830#line 830 "configfile.c"
831case YY_STATE_EOF(INITIAL):
834 case YY_END_OF_BUFFER:
837 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
840 *yy_cp = (yy_hold_char);
841 YY_RESTORE_YY_MORE_OFFSET
843 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
854 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
855 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
856 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
866 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
868 yy_state_type yy_next_state;
870 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
872 yy_current_state = yy_get_previous_state( );
883 yy_next_state = yy_try_NUL_trans( yy_current_state );
885 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
890 yy_cp = ++(yy_c_buf_p);
891 yy_current_state = yy_next_state;
897 yy_cp = (yy_c_buf_p);
902 else switch ( yy_get_next_buffer( ) )
904 case EOB_ACT_END_OF_FILE:
906 (yy_did_buffer_switch_on_eof) = 0;
919 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
921 yy_act = YY_STATE_EOF(YY_START);
927 if ( ! (yy_did_buffer_switch_on_eof) )
933 case EOB_ACT_CONTINUE_SCAN:
935 (yytext_ptr) + yy_amount_of_matched_text;
937 yy_current_state = yy_get_previous_state( );
939 yy_cp = (yy_c_buf_p);
940 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
943 case EOB_ACT_LAST_MATCH:
945 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
947 yy_current_state = yy_get_previous_state( );
949 yy_cp = (yy_c_buf_p);
950 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
958 "fatal flex scanner internal error--no action found" );
971static int yy_get_next_buffer (
void)
973 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
974 char *source = (yytext_ptr);
975 int number_to_move, i;
978 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
980 "fatal flex scanner internal error--end of buffer missed" );
982 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
984 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
989 return EOB_ACT_END_OF_FILE;
997 return EOB_ACT_LAST_MATCH;
1004 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1006 for ( i = 0; i < number_to_move; ++i )
1007 *(dest++) = *(source++);
1009 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1013 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1017 yy_size_t num_to_read =
1018 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1020 while ( num_to_read <= 0 )
1026 int yy_c_buf_p_offset =
1027 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1029 if ( b->yy_is_our_buffer )
1031 yy_size_t new_size = b->yy_buf_size * 2;
1033 if ( new_size <= 0 )
1034 b->yy_buf_size += b->yy_buf_size / 8;
1036 b->yy_buf_size *= 2;
1038 b->yy_ch_buf = (
char *)
1040 yyrealloc( (
void *) b->yy_ch_buf,
1041 (yy_size_t) (b->yy_buf_size + 2) );
1045 b->yy_ch_buf = NULL;
1047 if ( ! b->yy_ch_buf )
1049 "fatal error - scanner input buffer overflow" );
1051 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1053 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1058 if ( num_to_read > YY_READ_BUF_SIZE )
1059 num_to_read = YY_READ_BUF_SIZE;
1062 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1063 (yy_n_chars), num_to_read );
1065 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1068 if ( (yy_n_chars) == 0 )
1070 if ( number_to_move == YY_MORE_ADJ )
1072 ret_val = EOB_ACT_END_OF_FILE;
1078 ret_val = EOB_ACT_LAST_MATCH;
1079 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1080 YY_BUFFER_EOF_PENDING;
1085 ret_val = EOB_ACT_CONTINUE_SCAN;
1087 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1089 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1090 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc(
1091 (
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1092 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1093 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1095 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1098 (yy_n_chars) += number_to_move;
1099 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1100 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1102 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1109 static yy_state_type yy_get_previous_state (
void)
1111 yy_state_type yy_current_state;
1114 yy_current_state = (yy_start);
1116 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1118 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1119 if ( yy_accept[yy_current_state] )
1121 (yy_last_accepting_state) = yy_current_state;
1122 (yy_last_accepting_cpos) = yy_cp;
1124 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1126 yy_current_state = (int) yy_def[yy_current_state];
1127 if ( yy_current_state >= 17 )
1128 yy_c = yy_meta[yy_c];
1130 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1133 return yy_current_state;
1141 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1144 char *yy_cp = (yy_c_buf_p);
1147 if ( yy_accept[yy_current_state] )
1149 (yy_last_accepting_state) = yy_current_state;
1150 (yy_last_accepting_cpos) = yy_cp;
1152 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1154 yy_current_state = (int) yy_def[yy_current_state];
1155 if ( yy_current_state >= 17 )
1156 yy_c = yy_meta[yy_c];
1158 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1159 yy_is_jam = (yy_current_state == 16);
1161 return yy_is_jam ? 0 : yy_current_state;
1170 static int yyinput (
void)
1172 static int input (
void)
1178 *(yy_c_buf_p) = (yy_hold_char);
1180 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1186 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1188 *(yy_c_buf_p) =
'\0';
1192 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1195 switch ( yy_get_next_buffer( ) )
1197 case EOB_ACT_LAST_MATCH:
1213 case EOB_ACT_END_OF_FILE:
1218 if ( ! (yy_did_buffer_switch_on_eof) )
1227 case EOB_ACT_CONTINUE_SCAN:
1228 (yy_c_buf_p) = (yytext_ptr) + offset;
1234 c = *(
unsigned char *) (yy_c_buf_p);
1235 *(yy_c_buf_p) =
'\0';
1236 (yy_hold_char) = *++(yy_c_buf_p);
1247 void yyrestart (FILE * input_file )
1250 if ( ! YY_CURRENT_BUFFER ){
1251 yyensure_buffer_stack ();
1252 YY_CURRENT_BUFFER_LVALUE =
1253 yy_create_buffer( yyin, YY_BUF_SIZE );
1256 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1257 yy_load_buffer_state( );
1272 yyensure_buffer_stack ();
1273 if ( YY_CURRENT_BUFFER == new_buffer )
1276 if ( YY_CURRENT_BUFFER )
1279 *(yy_c_buf_p) = (yy_hold_char);
1280 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1281 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1284 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1285 yy_load_buffer_state( );
1292 (yy_did_buffer_switch_on_eof) = 1;
1295static void yy_load_buffer_state (
void)
1297 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1298 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1299 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1300 (yy_hold_char) = *(yy_c_buf_p);
1315 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1317 b->yy_buf_size = size;
1322 b->yy_ch_buf = (
char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1323 if ( ! b->yy_ch_buf )
1324 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1326 b->yy_is_our_buffer = 1;
1328 yy_init_buffer( b, file );
1343 if ( b == YY_CURRENT_BUFFER )
1346 if ( b->yy_is_our_buffer )
1347 yyfree( (
void *) b->yy_ch_buf );
1349 yyfree( (
void *) b );
1361 yy_flush_buffer( b );
1363 b->yy_input_file = file;
1364 b->yy_fill_buffer = 1;
1370 if (b != YY_CURRENT_BUFFER){
1375 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1395 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1396 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1398 b->yy_buf_pos = &b->yy_ch_buf[0];
1401 b->yy_buffer_status = YY_BUFFER_NEW;
1403 if ( b == YY_CURRENT_BUFFER )
1404 yy_load_buffer_state( );
1415 if (new_buffer == NULL)
1418 yyensure_buffer_stack();
1421 if ( YY_CURRENT_BUFFER )
1424 *(yy_c_buf_p) = (yy_hold_char);
1425 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1426 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1430 if (YY_CURRENT_BUFFER)
1431 (yy_buffer_stack_top)++;
1432 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1435 yy_load_buffer_state( );
1436 (yy_did_buffer_switch_on_eof) = 1;
1443void yypop_buffer_state (
void)
1445 if (!YY_CURRENT_BUFFER)
1448 yy_delete_buffer(YY_CURRENT_BUFFER );
1449 YY_CURRENT_BUFFER_LVALUE = NULL;
1450 if ((yy_buffer_stack_top) > 0)
1451 --(yy_buffer_stack_top);
1453 if (YY_CURRENT_BUFFER) {
1454 yy_load_buffer_state( );
1455 (yy_did_buffer_switch_on_eof) = 1;
1462static void yyensure_buffer_stack (
void)
1464 yy_size_t num_to_alloc;
1466 if (!(yy_buffer_stack)) {
1476 if ( ! (yy_buffer_stack) )
1477 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1479 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
1481 (yy_buffer_stack_max) = num_to_alloc;
1482 (yy_buffer_stack_top) = 0;
1486 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1489 yy_size_t grow_size = 8 ;
1491 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1496 if ( ! (yy_buffer_stack) )
1497 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1500 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
1501 (yy_buffer_stack_max) = num_to_alloc;
1516 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1517 base[size-1] != YY_END_OF_BUFFER_CHAR )
1523 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1525 b->yy_buf_size = (int) (size - 2);
1526 b->yy_buf_pos = b->yy_ch_buf = base;
1527 b->yy_is_our_buffer = 0;
1528 b->yy_input_file = NULL;
1529 b->yy_n_chars = b->yy_buf_size;
1530 b->yy_is_interactive = 0;
1532 b->yy_fill_buffer = 0;
1533 b->yy_buffer_status = YY_BUFFER_NEW;
1535 yy_switch_to_buffer( b );
1551 return yy_scan_bytes( yystr, (
int) strlen(yystr) );
1561YY_BUFFER_STATE yy_scan_bytes (
const char * yybytes, yy_size_t _yybytes_len )
1569 n = (yy_size_t) (_yybytes_len + 2);
1570 buf = (
char *) yyalloc( n );
1572 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1574 for ( i = 0; i < _yybytes_len; ++i )
1575 buf[i] = yybytes[i];
1577 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1579 b = yy_scan_buffer( buf, n );
1581 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1586 b->yy_is_our_buffer = 1;
1591#ifndef YY_EXIT_FAILURE
1592#define YY_EXIT_FAILURE 2
1595static void yynoreturn yy_fatal_error (
const char* msg )
1597 fprintf( stderr,
"%s\n", msg );
1598 exit( YY_EXIT_FAILURE );
1608 yy_size_t yyless_macro_arg = (n); \
1609 YY_LESS_LINENO(yyless_macro_arg);\
1610 yytext[yyleng] = (yy_hold_char); \
1611 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1612 (yy_hold_char) = *(yy_c_buf_p); \
1613 *(yy_c_buf_p) = '\0'; \
1614 yyleng = yyless_macro_arg; \
1623int yyget_lineno (
void)
1632FILE *yyget_in (
void)
1640FILE *yyget_out (
void)
1648yy_size_t yyget_leng (
void)
1657char *yyget_text (
void)
1666void yyset_lineno (
int _line_number )
1669 yylineno = _line_number;
1678void yyset_in (FILE * _in_str )
1683void yyset_out (FILE * _out_str )
1688int yyget_debug (
void)
1690 return yy_flex_debug;
1693void yyset_debug (
int _bdebug )
1695 yy_flex_debug = _bdebug ;
1698static int yy_init_globals (
void)
1704 (yy_buffer_stack) = NULL;
1705 (yy_buffer_stack_top) = 0;
1706 (yy_buffer_stack_max) = 0;
1707 (yy_c_buf_p) = NULL;
1727int yylex_destroy (
void)
1731 while(YY_CURRENT_BUFFER){
1732 yy_delete_buffer( YY_CURRENT_BUFFER );
1733 YY_CURRENT_BUFFER_LVALUE = NULL;
1734 yypop_buffer_state();
1738 yyfree((yy_buffer_stack) );
1739 (yy_buffer_stack) = NULL;
1753static void yy_flex_strncpy (
char* s1,
const char * s2,
int n )
1757 for ( i = 0; i < n; ++i )
1762#ifdef YY_NEED_STRLEN
1763static int yy_flex_strlen (
const char * s )
1766 for ( n = 0; s[n]; ++n )
1773void *yyalloc (yy_size_t size )
1775 return malloc(size);
1778void *yyrealloc (
void * ptr, yy_size_t size )
1788 return realloc(ptr, size);
1791void yyfree (
void * ptr )
1793 free( (
char *) ptr );
1796#define YYTABLES_NAME "yytables"
1798#line 77 "configfile.l"
1813int evaluatetoken(
char *pcToken)
1815 if (pcPrevious == NULL)
1817 pcPrevious = strdup(pcToken);
1818 iOldLinenumber = iLinenumber;
1823 if (iOldLinenumber != iLinenumber)
1825 tok_error(pcPrevious);
1826 pcPrevious = strdup(pcToken);
1827 iOldLinenumber = iLinenumber;
1831 pcCurrent = pcToken;
1832 if (strcmp(pcPrevious,
"FRIENDLYNAME") == 0)
1834 if (pcFriendlyname == NULL)
1838 pcFriendlyname = malloc(strlen(pcCurrent) + 1);
1839 for (n = 0, p = 0; n < strlen(pcCurrent); n++)
1841 if (pcCurrent[n] !=
'"')
1843 pcFriendlyname[p++] = pcCurrent[n];
1846 pcFriendlyname[p++] =
'\0';
1850 tok_error(pcPrevious);
1854 else if (strcmp(pcPrevious,
"DEVICENAME") == 0)
1856 if (pcDevicename == NULL)
1858 struct stat fStatBuf;
1860 pcDevicename = strdup(pcCurrent);
1861 if ((NULL == strchr(pcDevicename,
':'))
1862 && (stat(pcDevicename, &fStatBuf) != 0))
1864 Log3(PCSC_LOG_CRITICAL,
"Error with device %s: %s",
1865 pcDevicename, strerror(errno));
1866 Log1(PCSC_LOG_CRITICAL,
"You should remove the DEVICENAME line if your driver does not use this field");
1872 tok_error(pcPrevious);
1876 else if (strcmp(pcPrevious,
"LIBPATH") == 0)
1878 if (pcLibpath == NULL)
1880 struct stat fStatBuf;
1882 pcLibpath = strdup(pcCurrent);
1883 if (stat(pcLibpath, &fStatBuf) != 0)
1885 Log3(PCSC_LOG_CRITICAL,
"Error with library %s: %s",
1886 pcLibpath, strerror(errno));
1890 if (strstr(pcLibpath,
".bundle") != NULL)
1892 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1893 Log2(PCSC_LOG_ERROR,
"WARNING: USB drivers SHOULD NOT be declared in a reader.conf file: %s", pcLibpath);
1894 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1899 tok_error(pcPrevious);
1903 else if (strcmp(pcPrevious,
"CHANNELID") == 0)
1905 if (pcChannelid == NULL)
1906 pcChannelid = strdup(pcCurrent);
1909 tok_error(pcPrevious);
1915 tok_error(pcPrevious);
1926 if (pcFriendlyname && pcLibpath && badError != 1
1927 && (pcChannelid || pcDevicename))
1930 static char* defaultDeviceName = (
char *)
"";
1932 Log2(PCSC_LOG_DEBUG,
"Add reader: %s", pcFriendlyname);
1933 if (0 == reader_list_size)
1936 reader_list_size = 2;
1937 reader_list = malloc(reader_list_size *
sizeof(
SerialReader));
1943 new_reader_list = realloc(reader_list, reader_list_size *
1945 if (new_reader_list == NULL)
1947 reader_list = new_reader_list;
1949 if (reader_list == NULL)
1951 tok_error(
"No Memory");
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;
1989void tok_error(
const char *token_error)
1994 Log4(PCSC_LOG_ERROR,
"tok_error: invalid value line %d in %s: %s",
1995 iOldLinenumber, ConfFile, token_error);
1999int DBGetReaderListDir(
const char *readerconf_dir,
2007 reader_list_size = 0;
2009 dir = opendir(readerconf_dir);
2013 struct dirent *direntry;
2015 Log2(PCSC_LOG_DEBUG,
"Parsing conf directory: %s", readerconf_dir);
2018 while ((direntry = readdir(dir)) != NULL)
2020 char filename[FILENAME_MAX];
2023 snprintf(filename,
sizeof(filename),
"%s/%s",
2024 readerconf_dir, direntry->d_name);
2027#ifdef HAVE_STRUCT_DIRENT_D_TYPE
2028 if (direntry->d_type == DT_UNKNOWN)
2033 if (lstat(filename, &st) != 0)
2035 Log2(PCSC_LOG_DEBUG,
"Skipping non statable file: %s",
2040 if (!S_ISREG(st.st_mode))
2042 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
2047#ifdef HAVE_STRUCT_DIRENT_D_TYPE
2049 if (direntry->d_type != DT_REG)
2051 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
2058 if (
'.' == direntry->d_name[0])
2060 Log2(PCSC_LOG_DEBUG,
"Skipping hidden file: %s",
2066 r = DBGetReaderList(filename, caller_reader_list);
2077 ret = DBGetReaderList(readerconf_dir, caller_reader_list);
2082int DBGetReaderList(
const char *readerconf,
SerialReader **caller_reader_list)
2084 FILE *configFile = NULL;
2086 *caller_reader_list = NULL;
2089 ConfFile = readerconf;
2091 Log2(PCSC_LOG_DEBUG,
"Parsing conf file: %s", ConfFile);
2093 configFile = fopen(readerconf,
"r");
2095 if (configFile == NULL)
2102 iOldLinenumber = -1;
2103 pcFriendlyname = NULL;
2104 pcDevicename = NULL;
2115 while (!feof(configFile));
2118 (void)fclose(configFile);
2120 *caller_reader_list = reader_list;
This keeps a list of defines for pcsc-lite.
This keeps track of a list of currently available reader structures.
char * pcFriendlyname
FRIENDLYNAME.
char * pcDevicename
DEVICENAME.
int yy_bs_lineno
The line count.
int yy_bs_column
The column count.
This handles abstract system level calls.
This keeps a list of Windows(R) types.