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
27#if !defined(__GNU_LIBRARY__) && defined(__STDC__)
30#if !(defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
31 defined(_POSIX_SOURCE))
32# define _POSIX_C_SOURCE 1
33# define _POSIX_SOURCE 1
47#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
52# define YYFLEX_USE_STDINT
54# if defined(_MSC_VER) && _MSC_VER >= 1600
59# define YYFLEX_USE_STDINT
62#ifdef YYFLEX_USE_STDINT
63typedef int8_t flex_int8_t;
64typedef uint8_t flex_uint8_t;
65typedef int16_t flex_int16_t;
66typedef uint16_t flex_uint16_t;
67typedef int32_t flex_int32_t;
68typedef uint32_t flex_uint32_t;
70typedef unsigned char flex_uint8_t;
71typedef short int flex_int16_t;
72typedef unsigned short int flex_uint16_t;
74typedef signed char flex_int8_t;
77# if UINT_MAX >= 4294967295
78# define YYFLEX_INT32_DEFINED
79typedef int flex_int32_t;
80typedef unsigned int flex_uint32_t;
83typedef char flex_int8_t;
85# ifndef YYFLEX_INT32_DEFINED
86typedef long int flex_int32_t;
87typedef unsigned long int flex_uint32_t;
94#if defined(__GNUC__) && __GNUC__ >= 3
95#define yynoreturn __attribute__((__noreturn__))
106#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
112#define BEGIN (yy_start) = 1 + 2 *
117#define YY_START (((yy_start) - 1) / 2)
118#define YYSTATE YY_START
120#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
122#define YY_NEW_FILE yyrestart( yyin )
123#define YY_END_OF_BUFFER_CHAR 0
132#define YY_BUF_SIZE 32768
134#define YY_BUF_SIZE 16384
140#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
142#ifndef YY_TYPEDEF_YY_BUFFER_STATE
143#define YY_TYPEDEF_YY_BUFFER_STATE
147#ifndef YY_TYPEDEF_YY_SIZE_T
148#define YY_TYPEDEF_YY_SIZE_T
149typedef size_t yy_size_t;
154extern FILE *yyin, *yyout;
156#define EOB_ACT_CONTINUE_SCAN 0
157#define EOB_ACT_END_OF_FILE 1
158#define EOB_ACT_LAST_MATCH 2
160 #define YY_LESS_LINENO(n)
161 #define YY_LINENO_REWIND_TO(ptr)
168 int yyless_macro_arg = (n); \
169 YY_LESS_LINENO(yyless_macro_arg);\
170 *yy_cp = (yy_hold_char); \
171 YY_RESTORE_YY_MORE_OFFSET \
172 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
173 YY_DO_BEFORE_ACTION; \
176#define unput(c) yyunput( c, (yytext_ptr) )
178#ifndef YY_STRUCT_YY_BUFFER_STATE
179#define YY_STRUCT_YY_BUFFER_STATE
201 int yy_is_our_buffer;
208 int yy_is_interactive;
224 int yy_buffer_status;
226#define YY_BUFFER_NEW 0
227#define YY_BUFFER_NORMAL 1
238#define YY_BUFFER_EOF_PENDING 2
244static size_t yy_buffer_stack_top = 0;
245static size_t yy_buffer_stack_max = 0;
254#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
255 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
260#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
263static char yy_hold_char;
264static int yy_n_chars;
268static char *yy_c_buf_p = NULL;
269static int yy_init = 0;
270static int yy_start = 0;
275static int yy_did_buffer_switch_on_eof;
277void yyrestart ( FILE *input_file );
283void yypop_buffer_state (
void );
285static void yyensure_buffer_stack (
void );
286static void yy_load_buffer_state (
void );
288#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
294void *yyalloc ( yy_size_t );
295void *yyrealloc (
void *, yy_size_t );
296void yyfree (
void * );
298#define yy_new_buffer yy_create_buffer
299#define yy_set_interactive(is_interactive) \
301 if ( ! YY_CURRENT_BUFFER ){ \
302 yyensure_buffer_stack (); \
303 YY_CURRENT_BUFFER_LVALUE = \
304 yy_create_buffer( yyin, YY_BUF_SIZE ); \
306 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
308#define yy_set_bol(at_bol) \
310 if ( ! YY_CURRENT_BUFFER ){\
311 yyensure_buffer_stack (); \
312 YY_CURRENT_BUFFER_LVALUE = \
313 yy_create_buffer( yyin, YY_BUF_SIZE ); \
315 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
317#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
322#define YY_SKIP_YYWRAP
323typedef flex_uint8_t YY_CHAR;
325FILE *yyin = NULL, *yyout = NULL;
327typedef int yy_state_type;
336#define yytext_ptr yytext
338static yy_state_type yy_get_previous_state (
void );
339static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
340static int yy_get_next_buffer (
void );
341static void yynoreturn yy_fatal_error (
const char* msg );
346#define YY_DO_BEFORE_ACTION \
347 (yytext_ptr) = yy_bp; \
348 yyleng = (int) (yy_cp - yy_bp); \
349 (yy_hold_char) = *yy_cp; \
351 (yy_c_buf_p) = yy_cp;
352#define YY_NUM_RULES 7
353#define YY_END_OF_BUFFER 8
358 flex_int32_t yy_verify;
361static const flex_int16_t yy_accept[17] =
363 0, 0, 8, 6, 4, 2, 6, 1, 6, 5,
367static const YY_CHAR yy_ec[256] =
369 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 2, 1, 4, 5, 1, 1, 1, 6, 1,
373 1, 1, 1, 1, 7, 7, 7, 8, 8, 8,
374 8, 8, 8, 8, 8, 8, 8, 7, 1, 1,
375 7, 1, 1, 7, 9, 9, 9, 9, 9, 9,
376 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
377 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
378 1, 7, 1, 1, 7, 1, 10, 10, 10, 10,
380 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
381 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
382 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 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,
399static const YY_CHAR yy_meta[11] =
401 1, 1, 2, 1, 1, 1, 1, 1, 1, 1
404static const flex_int16_t yy_base[20] =
406 0, 0, 15, 31, 31, 31, 8, 0, 10, 10,
407 18, 31, 0, 20, 0, 31, 26, 13, 28
410static const flex_int16_t yy_def[20] =
412 16, 1, 16, 16, 16, 16, 17, 18, 19, 16,
413 17, 16, 18, 19, 10, 0, 16, 16, 16
416static const flex_int16_t yy_nxt[42] =
418 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
419 12, 12, 12, 13, 16, 12, 15, 15, 15, 15,
420 12, 12, 12, 16, 16, 12, 11, 11, 14, 14,
421 3, 16, 16, 16, 16, 16, 16, 16, 16, 16,
425static const flex_int16_t yy_chk[42] =
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 7, 7, 9, 18, 3, 9, 10, 10, 10, 10,
429 11, 11, 14, 0, 0, 14, 17, 17, 19, 19,
430 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
434static yy_state_type yy_last_accepting_state;
435static char *yy_last_accepting_cpos;
437extern int yy_flex_debug;
438int yy_flex_debug = 0;
443#define REJECT reject_used_but_not_detected
444#define yymore() yymore_used_but_not_detected
446#define YY_RESTORE_YY_MORE_OFFSET
448#line 1 "configfile.l"
484#line 38 "configfile.l"
491#include "configfile.h"
493int evaluatetoken(
char *pcToken);
495static int iLinenumber;
496static int iOldLinenumber;
497static char *pcPrevious;
498static char *pcCurrent;
499static char *pcFriendlyname;
500static char *pcDevicename;
501static char *pcLibpath;
502static char *pcChannelid;
505static int reader_list_size;
508void tok_error(
const char *pcToken_error);
510#line 511 "configfile.c"
512#line 513 "configfile.c"
516#ifndef YY_NO_UNISTD_H
525#define YY_EXTRA_TYPE void *
528static int yy_init_globals (
void );
533int yylex_destroy (
void );
535int yyget_debug (
void );
537void yyset_debug (
int debug_flag );
539YY_EXTRA_TYPE yyget_extra (
void );
541void yyset_extra ( YY_EXTRA_TYPE user_defined );
543FILE *yyget_in (
void );
545void yyset_in ( FILE * _in_str );
547FILE *yyget_out (
void );
549void yyset_out ( FILE * _out_str );
551 int yyget_leng (
void );
553char *yyget_text (
void );
555int yyget_lineno (
void );
557void yyset_lineno (
int _line_number );
563#ifndef YY_SKIP_YYWRAP
565extern "C" int yywrap (
void );
567extern int yywrap (
void );
576static void yy_flex_strncpy (
char *,
const char *,
int );
580static int yy_flex_strlen (
const char * );
585static int yyinput (
void );
587static int input (
void );
593#ifndef YY_READ_BUF_SIZE
596#define YY_READ_BUF_SIZE 16384
598#define YY_READ_BUF_SIZE 8192
607#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
614#define YY_INPUT(buf,result,max_size) \
615 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
619 for ( n = 0; n < max_size && \
620 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
623 buf[n++] = (char) c; \
624 if ( c == EOF && ferror( yyin ) ) \
625 YY_FATAL_ERROR( "input in flex scanner failed" ); \
631 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
633 if( errno != EINTR) \
635 YY_FATAL_ERROR( "input in flex scanner failed" ); \
651#define yyterminate() return YY_NULL
655#ifndef YY_START_STACK_INCR
656#define YY_START_STACK_INCR 25
660#ifndef YY_FATAL_ERROR
661#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
670#define YY_DECL_IS_OURS 1
672extern int yylex (
void);
674#define YY_DECL int yylex (void)
680#ifndef YY_USER_ACTION
681#define YY_USER_ACTION
686#define YY_BREAK break;
689#define YY_RULE_SETUP \
696 yy_state_type yy_current_state;
717 if ( ! YY_CURRENT_BUFFER ) {
718 yyensure_buffer_stack ();
719 YY_CURRENT_BUFFER_LVALUE =
720 yy_create_buffer( yyin, YY_BUF_SIZE );
723 yy_load_buffer_state( );
727#line 69 "configfile.l"
730#line 731 "configfile.c"
734 yy_cp = (yy_c_buf_p);
737 *yy_cp = (yy_hold_char);
744 yy_current_state = (yy_start);
748 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
749 if ( yy_accept[yy_current_state] )
751 (yy_last_accepting_state) = yy_current_state;
752 (yy_last_accepting_cpos) = yy_cp;
754 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
756 yy_current_state = (int) yy_def[yy_current_state];
757 if ( yy_current_state >= 17 )
758 yy_c = yy_meta[yy_c];
760 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
763 while ( yy_base[yy_current_state] != 31 );
766 yy_act = yy_accept[yy_current_state];
769 yy_cp = (yy_last_accepting_cpos);
770 yy_current_state = (yy_last_accepting_state);
771 yy_act = yy_accept[yy_current_state];
782 *yy_cp = (yy_hold_char);
783 yy_cp = (yy_last_accepting_cpos);
784 yy_current_state = (yy_last_accepting_state);
789#line 71 "configfile.l"
795#line 72 "configfile.l"
801#line 73 "configfile.l"
802{ (void)evaluatetoken(yytext); }
806#line 74 "configfile.l"
811#line 75 "configfile.l"
812{ (void)evaluatetoken(yytext); }
816#line 76 "configfile.l"
817{ iOldLinenumber = iLinenumber; tok_error(yytext); }
821#line 77 "configfile.l"
824#line 825 "configfile.c"
825case YY_STATE_EOF(INITIAL):
828 case YY_END_OF_BUFFER:
831 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
834 *yy_cp = (yy_hold_char);
835 YY_RESTORE_YY_MORE_OFFSET
837 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
848 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
849 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
850 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
860 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
862 yy_state_type yy_next_state;
864 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
866 yy_current_state = yy_get_previous_state( );
877 yy_next_state = yy_try_NUL_trans( yy_current_state );
879 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
884 yy_cp = ++(yy_c_buf_p);
885 yy_current_state = yy_next_state;
891 yy_cp = (yy_c_buf_p);
896 else switch ( yy_get_next_buffer( ) )
898 case EOB_ACT_END_OF_FILE:
900 (yy_did_buffer_switch_on_eof) = 0;
913 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
915 yy_act = YY_STATE_EOF(YY_START);
921 if ( ! (yy_did_buffer_switch_on_eof) )
927 case EOB_ACT_CONTINUE_SCAN:
929 (yytext_ptr) + yy_amount_of_matched_text;
931 yy_current_state = yy_get_previous_state( );
933 yy_cp = (yy_c_buf_p);
934 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
937 case EOB_ACT_LAST_MATCH:
939 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
941 yy_current_state = yy_get_previous_state( );
943 yy_cp = (yy_c_buf_p);
944 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
952 "fatal flex scanner internal error--no action found" );
965static int yy_get_next_buffer (
void)
967 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
968 char *source = (yytext_ptr);
969 int number_to_move, i;
972 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
974 "fatal flex scanner internal error--end of buffer missed" );
976 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
978 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
983 return EOB_ACT_END_OF_FILE;
991 return EOB_ACT_LAST_MATCH;
998 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1000 for ( i = 0; i < number_to_move; ++i )
1001 *(dest++) = *(source++);
1003 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1007 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1012 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1014 while ( num_to_read <= 0 )
1020 int yy_c_buf_p_offset =
1021 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1023 if ( b->yy_is_our_buffer )
1025 int new_size = b->yy_buf_size * 2;
1027 if ( new_size <= 0 )
1028 b->yy_buf_size += b->yy_buf_size / 8;
1030 b->yy_buf_size *= 2;
1032 b->yy_ch_buf = (
char *)
1034 yyrealloc( (
void *) b->yy_ch_buf,
1035 (yy_size_t) (b->yy_buf_size + 2) );
1039 b->yy_ch_buf = NULL;
1041 if ( ! b->yy_ch_buf )
1043 "fatal error - scanner input buffer overflow" );
1045 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1047 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1052 if ( num_to_read > YY_READ_BUF_SIZE )
1053 num_to_read = YY_READ_BUF_SIZE;
1056 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1057 (yy_n_chars), num_to_read );
1059 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1062 if ( (yy_n_chars) == 0 )
1064 if ( number_to_move == YY_MORE_ADJ )
1066 ret_val = EOB_ACT_END_OF_FILE;
1072 ret_val = EOB_ACT_LAST_MATCH;
1073 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1074 YY_BUFFER_EOF_PENDING;
1079 ret_val = EOB_ACT_CONTINUE_SCAN;
1081 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1083 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1084 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc(
1085 (
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1086 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1087 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1089 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1092 (yy_n_chars) += number_to_move;
1093 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1094 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1096 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1103 static yy_state_type yy_get_previous_state (
void)
1105 yy_state_type yy_current_state;
1108 yy_current_state = (yy_start);
1110 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1112 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1113 if ( yy_accept[yy_current_state] )
1115 (yy_last_accepting_state) = yy_current_state;
1116 (yy_last_accepting_cpos) = yy_cp;
1118 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1120 yy_current_state = (int) yy_def[yy_current_state];
1121 if ( yy_current_state >= 17 )
1122 yy_c = yy_meta[yy_c];
1124 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1127 return yy_current_state;
1135 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1138 char *yy_cp = (yy_c_buf_p);
1141 if ( yy_accept[yy_current_state] )
1143 (yy_last_accepting_state) = yy_current_state;
1144 (yy_last_accepting_cpos) = yy_cp;
1146 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1148 yy_current_state = (int) yy_def[yy_current_state];
1149 if ( yy_current_state >= 17 )
1150 yy_c = yy_meta[yy_c];
1152 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1153 yy_is_jam = (yy_current_state == 16);
1155 return yy_is_jam ? 0 : yy_current_state;
1164 static int yyinput (
void)
1166 static int input (
void)
1172 *(yy_c_buf_p) = (yy_hold_char);
1174 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1180 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1182 *(yy_c_buf_p) =
'\0';
1186 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1189 switch ( yy_get_next_buffer( ) )
1191 case EOB_ACT_LAST_MATCH:
1207 case EOB_ACT_END_OF_FILE:
1212 if ( ! (yy_did_buffer_switch_on_eof) )
1221 case EOB_ACT_CONTINUE_SCAN:
1222 (yy_c_buf_p) = (yytext_ptr) + offset;
1228 c = *(
unsigned char *) (yy_c_buf_p);
1229 *(yy_c_buf_p) =
'\0';
1230 (yy_hold_char) = *++(yy_c_buf_p);
1241 void yyrestart (FILE * input_file )
1244 if ( ! YY_CURRENT_BUFFER ){
1245 yyensure_buffer_stack ();
1246 YY_CURRENT_BUFFER_LVALUE =
1247 yy_create_buffer( yyin, YY_BUF_SIZE );
1250 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1251 yy_load_buffer_state( );
1266 yyensure_buffer_stack ();
1267 if ( YY_CURRENT_BUFFER == new_buffer )
1270 if ( YY_CURRENT_BUFFER )
1273 *(yy_c_buf_p) = (yy_hold_char);
1274 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1275 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1278 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1279 yy_load_buffer_state( );
1286 (yy_did_buffer_switch_on_eof) = 1;
1289static void yy_load_buffer_state (
void)
1291 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1292 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1293 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1294 (yy_hold_char) = *(yy_c_buf_p);
1309 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1311 b->yy_buf_size = size;
1316 b->yy_ch_buf = (
char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1317 if ( ! b->yy_ch_buf )
1318 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1320 b->yy_is_our_buffer = 1;
1322 yy_init_buffer( b, file );
1337 if ( b == YY_CURRENT_BUFFER )
1340 if ( b->yy_is_our_buffer )
1341 yyfree( (
void *) b->yy_ch_buf );
1343 yyfree( (
void *) b );
1355 yy_flush_buffer( b );
1357 b->yy_input_file = file;
1358 b->yy_fill_buffer = 1;
1364 if (b != YY_CURRENT_BUFFER){
1369 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1389 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1390 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1392 b->yy_buf_pos = &b->yy_ch_buf[0];
1395 b->yy_buffer_status = YY_BUFFER_NEW;
1397 if ( b == YY_CURRENT_BUFFER )
1398 yy_load_buffer_state( );
1409 if (new_buffer == NULL)
1412 yyensure_buffer_stack();
1415 if ( YY_CURRENT_BUFFER )
1418 *(yy_c_buf_p) = (yy_hold_char);
1419 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1420 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1424 if (YY_CURRENT_BUFFER)
1425 (yy_buffer_stack_top)++;
1426 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1429 yy_load_buffer_state( );
1430 (yy_did_buffer_switch_on_eof) = 1;
1437void yypop_buffer_state (
void)
1439 if (!YY_CURRENT_BUFFER)
1442 yy_delete_buffer(YY_CURRENT_BUFFER );
1443 YY_CURRENT_BUFFER_LVALUE = NULL;
1444 if ((yy_buffer_stack_top) > 0)
1445 --(yy_buffer_stack_top);
1447 if (YY_CURRENT_BUFFER) {
1448 yy_load_buffer_state( );
1449 (yy_did_buffer_switch_on_eof) = 1;
1456static void yyensure_buffer_stack (
void)
1458 yy_size_t num_to_alloc;
1460 if (!(yy_buffer_stack)) {
1470 if ( ! (yy_buffer_stack) )
1471 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1473 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
1475 (yy_buffer_stack_max) = num_to_alloc;
1476 (yy_buffer_stack_top) = 0;
1480 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1483 yy_size_t grow_size = 8 ;
1485 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1490 if ( ! (yy_buffer_stack) )
1491 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1494 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
1495 (yy_buffer_stack_max) = num_to_alloc;
1510 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1511 base[size-1] != YY_END_OF_BUFFER_CHAR )
1517 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1519 b->yy_buf_size = (int) (size - 2);
1520 b->yy_buf_pos = b->yy_ch_buf = base;
1521 b->yy_is_our_buffer = 0;
1522 b->yy_input_file = NULL;
1523 b->yy_n_chars = b->yy_buf_size;
1524 b->yy_is_interactive = 0;
1526 b->yy_fill_buffer = 0;
1527 b->yy_buffer_status = YY_BUFFER_NEW;
1529 yy_switch_to_buffer( b );
1545 return yy_scan_bytes( yystr, (
int) strlen(yystr) );
1555YY_BUFFER_STATE yy_scan_bytes (
const char * yybytes,
int _yybytes_len )
1563 n = (yy_size_t) (_yybytes_len + 2);
1564 buf = (
char *) yyalloc( n );
1566 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1568 for ( i = 0; i < _yybytes_len; ++i )
1569 buf[i] = yybytes[i];
1571 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1573 b = yy_scan_buffer( buf, n );
1575 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1580 b->yy_is_our_buffer = 1;
1585#ifndef YY_EXIT_FAILURE
1586#define YY_EXIT_FAILURE 2
1589static void yynoreturn yy_fatal_error (
const char* msg )
1591 fprintf( stderr,
"%s\n", msg );
1592 exit( YY_EXIT_FAILURE );
1602 int yyless_macro_arg = (n); \
1603 YY_LESS_LINENO(yyless_macro_arg);\
1604 yytext[yyleng] = (yy_hold_char); \
1605 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1606 (yy_hold_char) = *(yy_c_buf_p); \
1607 *(yy_c_buf_p) = '\0'; \
1608 yyleng = yyless_macro_arg; \
1617int yyget_lineno (
void)
1626FILE *yyget_in (
void)
1634FILE *yyget_out (
void)
1642int yyget_leng (
void)
1651char *yyget_text (
void)
1660void yyset_lineno (
int _line_number )
1663 yylineno = _line_number;
1672void yyset_in (FILE * _in_str )
1677void yyset_out (FILE * _out_str )
1682int yyget_debug (
void)
1684 return yy_flex_debug;
1687void yyset_debug (
int _bdebug )
1689 yy_flex_debug = _bdebug ;
1692static int yy_init_globals (
void)
1698 (yy_buffer_stack) = NULL;
1699 (yy_buffer_stack_top) = 0;
1700 (yy_buffer_stack_max) = 0;
1701 (yy_c_buf_p) = NULL;
1721int yylex_destroy (
void)
1725 while(YY_CURRENT_BUFFER){
1726 yy_delete_buffer( YY_CURRENT_BUFFER );
1727 YY_CURRENT_BUFFER_LVALUE = NULL;
1728 yypop_buffer_state();
1732 yyfree((yy_buffer_stack) );
1733 (yy_buffer_stack) = NULL;
1747static void yy_flex_strncpy (
char* s1,
const char * s2,
int n )
1751 for ( i = 0; i < n; ++i )
1756#ifdef YY_NEED_STRLEN
1757static int yy_flex_strlen (
const char * s )
1760 for ( n = 0; s[n]; ++n )
1767void *yyalloc (yy_size_t size )
1769 return malloc(size);
1772void *yyrealloc (
void * ptr, yy_size_t size )
1782 return realloc(ptr, size);
1785void yyfree (
void * ptr )
1787 free( (
char *) ptr );
1790#define YYTABLES_NAME "yytables"
1792#line 77 "configfile.l"
1807int evaluatetoken(
char *pcToken)
1809 if (pcPrevious == NULL)
1811 pcPrevious = strdup(pcToken);
1812 iOldLinenumber = iLinenumber;
1817 if (iOldLinenumber != iLinenumber)
1819 tok_error(pcPrevious);
1820 pcPrevious = strdup(pcToken);
1821 iOldLinenumber = iLinenumber;
1825 pcCurrent = pcToken;
1826 if (strcmp(pcPrevious,
"FRIENDLYNAME") == 0)
1828 if (pcFriendlyname == NULL)
1832 pcFriendlyname = malloc(strlen(pcCurrent) + 1);
1833 for (n = 0, p = 0; n < strlen(pcCurrent); n++)
1835 if (pcCurrent[n] !=
'"')
1837 pcFriendlyname[p++] = pcCurrent[n];
1840 pcFriendlyname[p++] =
'\0';
1844 tok_error(pcPrevious);
1848 else if (strcmp(pcPrevious,
"DEVICENAME") == 0)
1850 if (pcDevicename == NULL)
1852 struct stat fStatBuf;
1854 pcDevicename = strdup(pcCurrent);
1855 if ((NULL == strchr(pcDevicename,
':'))
1856 && (stat(pcDevicename, &fStatBuf) != 0))
1858 Log3(PCSC_LOG_CRITICAL,
"Error with device %s: %s",
1859 pcDevicename, strerror(errno));
1860 Log1(PCSC_LOG_CRITICAL,
"You should remove the DEVICENAME line if your driver does not use this field");
1866 tok_error(pcPrevious);
1870 else if (strcmp(pcPrevious,
"LIBPATH") == 0)
1872 if (pcLibpath == NULL)
1874 struct stat fStatBuf;
1876 pcLibpath = strdup(pcCurrent);
1877 if (stat(pcLibpath, &fStatBuf) != 0)
1879 Log3(PCSC_LOG_CRITICAL,
"Error with library %s: %s",
1880 pcLibpath, strerror(errno));
1884 if (strstr(pcLibpath,
".bundle") != NULL)
1886 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1887 Log2(PCSC_LOG_ERROR,
"WARNING: USB drivers SHOULD NOT be declared in a reader.conf file: %s", pcLibpath);
1888 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1893 tok_error(pcPrevious);
1897 else if (strcmp(pcPrevious,
"CHANNELID") == 0)
1899 if (pcChannelid == NULL)
1900 pcChannelid = strdup(pcCurrent);
1903 tok_error(pcPrevious);
1909 tok_error(pcPrevious);
1920 if (pcFriendlyname && pcLibpath && badError != 1
1921 && (pcChannelid || pcDevicename))
1924 static char* defaultDeviceName = (
char *)
"";
1926 Log2(PCSC_LOG_DEBUG,
"Add reader: %s", pcFriendlyname);
1927 if (0 == reader_list_size)
1930 reader_list_size = 2;
1931 reader_list = malloc(reader_list_size *
sizeof(
SerialReader));
1937 new_reader_list = realloc(reader_list, reader_list_size *
1939 if (new_reader_list == NULL)
1941 reader_list = new_reader_list;
1943 if (reader_list == NULL)
1945 tok_error(
"No Memory");
1953 if (NULL == pcDevicename)
1954 pcDevicename = defaultDeviceName;
1957 channelId = strtoul(pcChannelid, NULL, 0);
1960 reader_list[reader_list_size-2].
pcFriendlyname = strdup(pcFriendlyname);
1961 reader_list[reader_list_size-2].
pcDevicename = strdup(pcDevicename);
1962 reader_list[reader_list_size-2].
pcLibpath = strdup(pcLibpath),
1963 reader_list[reader_list_size-2].
channelId = channelId;
1965 free(pcFriendlyname);
1966 pcFriendlyname = NULL;
1968 if (pcDevicename != defaultDeviceName)
1970 pcDevicename = NULL;
1983void tok_error(
const char *token_error)
1988 Log4(PCSC_LOG_ERROR,
"tok_error: invalid value line %d in %s: %s",
1989 iOldLinenumber, ConfFile, token_error);
1993int DBGetReaderListDir(
const char *readerconf_dir,
2001 reader_list_size = 0;
2003 dir = opendir(readerconf_dir);
2007 struct dirent *direntry;
2009 Log2(PCSC_LOG_DEBUG,
"Parsing conf directory: %s", readerconf_dir);
2012 while ((direntry = readdir(dir)) != NULL)
2014 char filename[FILENAME_MAX];
2017 snprintf(filename,
sizeof(filename),
"%s/%s",
2018 readerconf_dir, direntry->d_name);
2021#ifdef HAVE_STRUCT_DIRENT_D_TYPE
2022 if (direntry->d_type == DT_UNKNOWN)
2027 if (lstat(filename, &st) != 0)
2029 Log2(PCSC_LOG_DEBUG,
"Skipping non statable file: %s",
2034 if (!S_ISREG(st.st_mode))
2036 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
2041#ifdef HAVE_STRUCT_DIRENT_D_TYPE
2043 if (direntry->d_type != DT_REG)
2045 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
2052 if (
'.' == direntry->d_name[0])
2054 Log2(PCSC_LOG_DEBUG,
"Skipping hidden file: %s",
2060 r = DBGetReaderList(filename, caller_reader_list);
2071 ret = DBGetReaderList(readerconf_dir, caller_reader_list);
2076int DBGetReaderList(
const char *readerconf,
SerialReader **caller_reader_list)
2078 FILE *configFile = NULL;
2080 *caller_reader_list = NULL;
2083 ConfFile = readerconf;
2085 Log2(PCSC_LOG_DEBUG,
"Parsing conf file: %s", ConfFile);
2087 configFile = fopen(readerconf,
"r");
2089 if (configFile == NULL)
2096 iOldLinenumber = -1;
2097 pcFriendlyname = NULL;
2098 pcDevicename = NULL;
2109 while (!feof(configFile));
2112 (void)fclose(configFile);
2114 *caller_reader_list = reader_list;
This keeps a list of defines for pcsc-lite.
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.