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;
50typedef signed char flex_int8_t;
51typedef short int flex_int16_t;
52typedef int flex_int32_t;
53typedef unsigned char flex_uint8_t;
54typedef unsigned short int flex_uint16_t;
55typedef unsigned int flex_uint32_t;
59#define INT8_MIN (-128)
62#define INT16_MIN (-32767-1)
65#define INT32_MIN (-2147483647-1)
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)
87#define SIZE_MAX (~(size_t)0)
99#if defined(__GNUC__) && __GNUC__ >= 3
100#define yynoreturn __attribute__((__noreturn__))
111#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
117#define BEGIN (yy_start) = 1 + 2 *
122#define YY_START (((yy_start) - 1) / 2)
123#define YYSTATE YY_START
125#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
127#define YY_NEW_FILE yyrestart( yyin )
128#define YY_END_OF_BUFFER_CHAR 0
137#define YY_BUF_SIZE 32768
139#define YY_BUF_SIZE 16384
145#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
147#ifndef YY_TYPEDEF_YY_BUFFER_STATE
148#define YY_TYPEDEF_YY_BUFFER_STATE
152#ifndef YY_TYPEDEF_YY_SIZE_T
153#define YY_TYPEDEF_YY_SIZE_T
154typedef size_t yy_size_t;
159extern FILE *yyin, *yyout;
161#define EOB_ACT_CONTINUE_SCAN 0
162#define EOB_ACT_END_OF_FILE 1
163#define EOB_ACT_LAST_MATCH 2
165 #define YY_LESS_LINENO(n)
166 #define YY_LINENO_REWIND_TO(ptr)
173 int yyless_macro_arg = (n); \
174 YY_LESS_LINENO(yyless_macro_arg);\
175 *yy_cp = (yy_hold_char); \
176 YY_RESTORE_YY_MORE_OFFSET \
177 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
178 YY_DO_BEFORE_ACTION; \
181#define unput(c) yyunput( c, (yytext_ptr) )
183#ifndef YY_STRUCT_YY_BUFFER_STATE
184#define YY_STRUCT_YY_BUFFER_STATE
206 int yy_is_our_buffer;
213 int yy_is_interactive;
229 int yy_buffer_status;
231#define YY_BUFFER_NEW 0
232#define YY_BUFFER_NORMAL 1
243#define YY_BUFFER_EOF_PENDING 2
249static size_t yy_buffer_stack_top = 0;
250static size_t yy_buffer_stack_max = 0;
259#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
260 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
265#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
268static char yy_hold_char;
269static int yy_n_chars;
273static char *yy_c_buf_p = NULL;
274static int yy_init = 0;
275static int yy_start = 0;
280static int yy_did_buffer_switch_on_eof;
282void yyrestart ( FILE *input_file );
288void yypop_buffer_state (
void );
290static void yyensure_buffer_stack (
void );
291static void yy_load_buffer_state (
void );
293#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
299void *yyalloc ( yy_size_t );
300void *yyrealloc (
void *, yy_size_t );
301void yyfree (
void * );
303#define yy_new_buffer yy_create_buffer
304#define yy_set_interactive(is_interactive) \
306 if ( ! YY_CURRENT_BUFFER ){ \
307 yyensure_buffer_stack (); \
308 YY_CURRENT_BUFFER_LVALUE = \
309 yy_create_buffer( yyin, YY_BUF_SIZE ); \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
313#define yy_set_bol(at_bol) \
315 if ( ! YY_CURRENT_BUFFER ){\
316 yyensure_buffer_stack (); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 yy_create_buffer( yyin, YY_BUF_SIZE ); \
320 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
322#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
327#define YY_SKIP_YYWRAP
328typedef flex_uint8_t YY_CHAR;
330FILE *yyin = NULL, *yyout = NULL;
332typedef int yy_state_type;
341#define yytext_ptr yytext
343static yy_state_type yy_get_previous_state (
void );
344static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
345static int yy_get_next_buffer (
void );
346static void yynoreturn yy_fatal_error (
const char* msg );
351#define YY_DO_BEFORE_ACTION \
352 (yytext_ptr) = yy_bp; \
353 yyleng = (int) (yy_cp - yy_bp); \
354 (yy_hold_char) = *yy_cp; \
356 (yy_c_buf_p) = yy_cp;
357#define YY_NUM_RULES 7
358#define YY_END_OF_BUFFER 8
363 flex_int32_t yy_verify;
366static const flex_int16_t yy_accept[17] =
368 0, 0, 8, 6, 4, 2, 6, 1, 6, 5,
372static const YY_CHAR yy_ec[256] =
374 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 2, 1, 4, 5, 1, 1, 1, 6, 1,
378 1, 1, 1, 1, 7, 7, 7, 8, 8, 8,
379 8, 8, 8, 8, 8, 8, 8, 7, 1, 1,
380 7, 1, 1, 7, 9, 9, 9, 9, 9, 9,
381 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
382 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
383 1, 7, 1, 1, 7, 1, 10, 10, 10, 10,
385 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
386 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
387 10, 10, 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,
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,
396 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,
404static const YY_CHAR yy_meta[11] =
406 1, 1, 2, 1, 1, 1, 1, 1, 1, 1
409static const flex_int16_t yy_base[20] =
411 0, 0, 15, 31, 31, 31, 8, 0, 10, 10,
412 18, 31, 0, 20, 0, 31, 26, 13, 28
415static const flex_int16_t yy_def[20] =
417 16, 1, 16, 16, 16, 16, 17, 18, 19, 16,
418 17, 16, 18, 19, 10, 0, 16, 16, 16
421static const flex_int16_t yy_nxt[42] =
423 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
424 12, 12, 12, 13, 16, 12, 15, 15, 15, 15,
425 12, 12, 12, 16, 16, 12, 11, 11, 14, 14,
426 3, 16, 16, 16, 16, 16, 16, 16, 16, 16,
430static const flex_int16_t yy_chk[42] =
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 7, 7, 9, 18, 3, 9, 10, 10, 10, 10,
434 11, 11, 14, 0, 0, 14, 17, 17, 19, 19,
435 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
439static yy_state_type yy_last_accepting_state;
440static char *yy_last_accepting_cpos;
442extern int yy_flex_debug;
443int yy_flex_debug = 0;
448#define REJECT reject_used_but_not_detected
449#define yymore() yymore_used_but_not_detected
451#define YY_RESTORE_YY_MORE_OFFSET
453#line 1 "configfile.l"
489#line 38 "configfile.l"
496#include "configfile.h"
498int evaluatetoken(
char *pcToken);
500static int iLinenumber;
501static int iOldLinenumber;
502static char *pcPrevious;
503static char *pcCurrent;
504static char *pcFriendlyname;
505static char *pcDevicename;
506static char *pcLibpath;
507static char *pcChannelid;
510static int reader_list_size;
513void tok_error(
const char *pcToken_error);
515#line 516 "configfile.c"
517#line 518 "configfile.c"
521#ifndef YY_NO_UNISTD_H
530#define YY_EXTRA_TYPE void *
533static int yy_init_globals (
void );
538int yylex_destroy (
void );
540int yyget_debug (
void );
542void yyset_debug (
int debug_flag );
544YY_EXTRA_TYPE yyget_extra (
void );
546void yyset_extra ( YY_EXTRA_TYPE user_defined );
548FILE *yyget_in (
void );
550void yyset_in ( FILE * _in_str );
552FILE *yyget_out (
void );
554void yyset_out ( FILE * _out_str );
556 int yyget_leng (
void );
558char *yyget_text (
void );
560int yyget_lineno (
void );
562void yyset_lineno (
int _line_number );
568#ifndef YY_SKIP_YYWRAP
570extern "C" int yywrap (
void );
572extern int yywrap (
void );
581static void yy_flex_strncpy (
char *,
const char *,
int );
585static int yy_flex_strlen (
const char * );
590static int yyinput (
void );
592static int input (
void );
598#ifndef YY_READ_BUF_SIZE
601#define YY_READ_BUF_SIZE 16384
603#define YY_READ_BUF_SIZE 8192
612#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
619#define YY_INPUT(buf,result,max_size) \
620 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
624 for ( n = 0; n < max_size && \
625 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
628 buf[n++] = (char) c; \
629 if ( c == EOF && ferror( yyin ) ) \
630 YY_FATAL_ERROR( "input in flex scanner failed" ); \
636 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
638 if( errno != EINTR) \
640 YY_FATAL_ERROR( "input in flex scanner failed" ); \
656#define yyterminate() return YY_NULL
660#ifndef YY_START_STACK_INCR
661#define YY_START_STACK_INCR 25
665#ifndef YY_FATAL_ERROR
666#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
675#define YY_DECL_IS_OURS 1
677extern int yylex (
void);
679#define YY_DECL int yylex (void)
685#ifndef YY_USER_ACTION
686#define YY_USER_ACTION
691#define YY_BREAK break;
694#define YY_RULE_SETUP \
701 yy_state_type yy_current_state;
722 if ( ! YY_CURRENT_BUFFER ) {
723 yyensure_buffer_stack ();
724 YY_CURRENT_BUFFER_LVALUE =
725 yy_create_buffer( yyin, YY_BUF_SIZE );
728 yy_load_buffer_state( );
732#line 69 "configfile.l"
735#line 736 "configfile.c"
739 yy_cp = (yy_c_buf_p);
742 *yy_cp = (yy_hold_char);
749 yy_current_state = (yy_start);
753 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
754 if ( yy_accept[yy_current_state] )
756 (yy_last_accepting_state) = yy_current_state;
757 (yy_last_accepting_cpos) = yy_cp;
759 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
761 yy_current_state = (int) yy_def[yy_current_state];
762 if ( yy_current_state >= 17 )
763 yy_c = yy_meta[yy_c];
765 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
768 while ( yy_base[yy_current_state] != 31 );
771 yy_act = yy_accept[yy_current_state];
774 yy_cp = (yy_last_accepting_cpos);
775 yy_current_state = (yy_last_accepting_state);
776 yy_act = yy_accept[yy_current_state];
787 *yy_cp = (yy_hold_char);
788 yy_cp = (yy_last_accepting_cpos);
789 yy_current_state = (yy_last_accepting_state);
794#line 71 "configfile.l"
800#line 72 "configfile.l"
806#line 73 "configfile.l"
807{ (void)evaluatetoken(yytext); }
811#line 74 "configfile.l"
816#line 75 "configfile.l"
817{ (void)evaluatetoken(yytext); }
821#line 76 "configfile.l"
822{ iOldLinenumber = iLinenumber; tok_error(yytext); }
826#line 77 "configfile.l"
829#line 830 "configfile.c"
830case YY_STATE_EOF(INITIAL):
833 case YY_END_OF_BUFFER:
836 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
839 *yy_cp = (yy_hold_char);
840 YY_RESTORE_YY_MORE_OFFSET
842 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
853 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
854 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
855 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
865 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
867 yy_state_type yy_next_state;
869 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
871 yy_current_state = yy_get_previous_state( );
882 yy_next_state = yy_try_NUL_trans( yy_current_state );
884 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
889 yy_cp = ++(yy_c_buf_p);
890 yy_current_state = yy_next_state;
896 yy_cp = (yy_c_buf_p);
901 else switch ( yy_get_next_buffer( ) )
903 case EOB_ACT_END_OF_FILE:
905 (yy_did_buffer_switch_on_eof) = 0;
918 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
920 yy_act = YY_STATE_EOF(YY_START);
926 if ( ! (yy_did_buffer_switch_on_eof) )
932 case EOB_ACT_CONTINUE_SCAN:
934 (yytext_ptr) + yy_amount_of_matched_text;
936 yy_current_state = yy_get_previous_state( );
938 yy_cp = (yy_c_buf_p);
939 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
942 case EOB_ACT_LAST_MATCH:
944 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
946 yy_current_state = yy_get_previous_state( );
948 yy_cp = (yy_c_buf_p);
949 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
957 "fatal flex scanner internal error--no action found" );
970static int yy_get_next_buffer (
void)
972 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
973 char *source = (yytext_ptr);
974 int number_to_move, i;
977 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
979 "fatal flex scanner internal error--end of buffer missed" );
981 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
983 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
988 return EOB_ACT_END_OF_FILE;
996 return EOB_ACT_LAST_MATCH;
1003 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1005 for ( i = 0; i < number_to_move; ++i )
1006 *(dest++) = *(source++);
1008 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1012 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1017 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1019 while ( num_to_read <= 0 )
1025 int yy_c_buf_p_offset =
1026 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1028 if ( b->yy_is_our_buffer )
1030 int new_size = b->yy_buf_size * 2;
1032 if ( new_size <= 0 )
1033 b->yy_buf_size += b->yy_buf_size / 8;
1035 b->yy_buf_size *= 2;
1037 b->yy_ch_buf = (
char *)
1039 yyrealloc( (
void *) b->yy_ch_buf,
1040 (yy_size_t) (b->yy_buf_size + 2) );
1044 b->yy_ch_buf = NULL;
1046 if ( ! b->yy_ch_buf )
1048 "fatal error - scanner input buffer overflow" );
1050 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1052 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1057 if ( num_to_read > YY_READ_BUF_SIZE )
1058 num_to_read = YY_READ_BUF_SIZE;
1061 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1062 (yy_n_chars), num_to_read );
1064 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1067 if ( (yy_n_chars) == 0 )
1069 if ( number_to_move == YY_MORE_ADJ )
1071 ret_val = EOB_ACT_END_OF_FILE;
1077 ret_val = EOB_ACT_LAST_MATCH;
1078 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1079 YY_BUFFER_EOF_PENDING;
1084 ret_val = EOB_ACT_CONTINUE_SCAN;
1086 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1088 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1089 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) yyrealloc(
1090 (
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1091 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1092 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1094 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1097 (yy_n_chars) += number_to_move;
1098 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1099 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1101 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1108 static yy_state_type yy_get_previous_state (
void)
1110 yy_state_type yy_current_state;
1113 yy_current_state = (yy_start);
1115 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1117 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1118 if ( yy_accept[yy_current_state] )
1120 (yy_last_accepting_state) = yy_current_state;
1121 (yy_last_accepting_cpos) = yy_cp;
1123 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1125 yy_current_state = (int) yy_def[yy_current_state];
1126 if ( yy_current_state >= 17 )
1127 yy_c = yy_meta[yy_c];
1129 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1132 return yy_current_state;
1140 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1143 char *yy_cp = (yy_c_buf_p);
1146 if ( yy_accept[yy_current_state] )
1148 (yy_last_accepting_state) = yy_current_state;
1149 (yy_last_accepting_cpos) = yy_cp;
1151 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1153 yy_current_state = (int) yy_def[yy_current_state];
1154 if ( yy_current_state >= 17 )
1155 yy_c = yy_meta[yy_c];
1157 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1158 yy_is_jam = (yy_current_state == 16);
1160 return yy_is_jam ? 0 : yy_current_state;
1169 static int yyinput (
void)
1171 static int input (
void)
1177 *(yy_c_buf_p) = (yy_hold_char);
1179 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1185 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1187 *(yy_c_buf_p) =
'\0';
1191 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1194 switch ( yy_get_next_buffer( ) )
1196 case EOB_ACT_LAST_MATCH:
1212 case EOB_ACT_END_OF_FILE:
1217 if ( ! (yy_did_buffer_switch_on_eof) )
1226 case EOB_ACT_CONTINUE_SCAN:
1227 (yy_c_buf_p) = (yytext_ptr) + offset;
1233 c = *(
unsigned char *) (yy_c_buf_p);
1234 *(yy_c_buf_p) =
'\0';
1235 (yy_hold_char) = *++(yy_c_buf_p);
1246 void yyrestart (FILE * input_file )
1249 if ( ! YY_CURRENT_BUFFER ){
1250 yyensure_buffer_stack ();
1251 YY_CURRENT_BUFFER_LVALUE =
1252 yy_create_buffer( yyin, YY_BUF_SIZE );
1255 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1256 yy_load_buffer_state( );
1271 yyensure_buffer_stack ();
1272 if ( YY_CURRENT_BUFFER == new_buffer )
1275 if ( YY_CURRENT_BUFFER )
1278 *(yy_c_buf_p) = (yy_hold_char);
1279 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1280 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1283 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1284 yy_load_buffer_state( );
1291 (yy_did_buffer_switch_on_eof) = 1;
1294static void yy_load_buffer_state (
void)
1296 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1297 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1298 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1299 (yy_hold_char) = *(yy_c_buf_p);
1314 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1316 b->yy_buf_size = size;
1321 b->yy_ch_buf = (
char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1322 if ( ! b->yy_ch_buf )
1323 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1325 b->yy_is_our_buffer = 1;
1327 yy_init_buffer( b, file );
1342 if ( b == YY_CURRENT_BUFFER )
1345 if ( b->yy_is_our_buffer )
1346 yyfree( (
void *) b->yy_ch_buf );
1348 yyfree( (
void *) b );
1360 yy_flush_buffer( b );
1362 b->yy_input_file = file;
1363 b->yy_fill_buffer = 1;
1369 if (b != YY_CURRENT_BUFFER){
1374 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1394 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1395 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1397 b->yy_buf_pos = &b->yy_ch_buf[0];
1400 b->yy_buffer_status = YY_BUFFER_NEW;
1402 if ( b == YY_CURRENT_BUFFER )
1403 yy_load_buffer_state( );
1414 if (new_buffer == NULL)
1417 yyensure_buffer_stack();
1420 if ( YY_CURRENT_BUFFER )
1423 *(yy_c_buf_p) = (yy_hold_char);
1424 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1425 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1429 if (YY_CURRENT_BUFFER)
1430 (yy_buffer_stack_top)++;
1431 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1434 yy_load_buffer_state( );
1435 (yy_did_buffer_switch_on_eof) = 1;
1442void yypop_buffer_state (
void)
1444 if (!YY_CURRENT_BUFFER)
1447 yy_delete_buffer(YY_CURRENT_BUFFER );
1448 YY_CURRENT_BUFFER_LVALUE = NULL;
1449 if ((yy_buffer_stack_top) > 0)
1450 --(yy_buffer_stack_top);
1452 if (YY_CURRENT_BUFFER) {
1453 yy_load_buffer_state( );
1454 (yy_did_buffer_switch_on_eof) = 1;
1461static void yyensure_buffer_stack (
void)
1463 yy_size_t num_to_alloc;
1465 if (!(yy_buffer_stack)) {
1475 if ( ! (yy_buffer_stack) )
1476 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1478 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
1480 (yy_buffer_stack_max) = num_to_alloc;
1481 (yy_buffer_stack_top) = 0;
1485 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1488 yy_size_t grow_size = 8 ;
1490 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1495 if ( ! (yy_buffer_stack) )
1496 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1499 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
1500 (yy_buffer_stack_max) = num_to_alloc;
1515 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1516 base[size-1] != YY_END_OF_BUFFER_CHAR )
1522 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1524 b->yy_buf_size = (int) (size - 2);
1525 b->yy_buf_pos = b->yy_ch_buf = base;
1526 b->yy_is_our_buffer = 0;
1527 b->yy_input_file = NULL;
1528 b->yy_n_chars = b->yy_buf_size;
1529 b->yy_is_interactive = 0;
1531 b->yy_fill_buffer = 0;
1532 b->yy_buffer_status = YY_BUFFER_NEW;
1534 yy_switch_to_buffer( b );
1550 return yy_scan_bytes( yystr, (
int) strlen(yystr) );
1560YY_BUFFER_STATE yy_scan_bytes (
const char * yybytes,
int _yybytes_len )
1568 n = (yy_size_t) (_yybytes_len + 2);
1569 buf = (
char *) yyalloc( n );
1571 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1573 for ( i = 0; i < _yybytes_len; ++i )
1574 buf[i] = yybytes[i];
1576 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1578 b = yy_scan_buffer( buf, n );
1580 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1585 b->yy_is_our_buffer = 1;
1590#ifndef YY_EXIT_FAILURE
1591#define YY_EXIT_FAILURE 2
1594static void yynoreturn yy_fatal_error (
const char* msg )
1596 fprintf( stderr,
"%s\n", msg );
1597 exit( YY_EXIT_FAILURE );
1607 int yyless_macro_arg = (n); \
1608 YY_LESS_LINENO(yyless_macro_arg);\
1609 yytext[yyleng] = (yy_hold_char); \
1610 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1611 (yy_hold_char) = *(yy_c_buf_p); \
1612 *(yy_c_buf_p) = '\0'; \
1613 yyleng = yyless_macro_arg; \
1622int yyget_lineno (
void)
1631FILE *yyget_in (
void)
1639FILE *yyget_out (
void)
1647int yyget_leng (
void)
1656char *yyget_text (
void)
1665void yyset_lineno (
int _line_number )
1668 yylineno = _line_number;
1677void yyset_in (FILE * _in_str )
1682void yyset_out (FILE * _out_str )
1687int yyget_debug (
void)
1689 return yy_flex_debug;
1692void yyset_debug (
int _bdebug )
1694 yy_flex_debug = _bdebug ;
1697static int yy_init_globals (
void)
1703 (yy_buffer_stack) = NULL;
1704 (yy_buffer_stack_top) = 0;
1705 (yy_buffer_stack_max) = 0;
1706 (yy_c_buf_p) = NULL;
1726int yylex_destroy (
void)
1730 while(YY_CURRENT_BUFFER){
1731 yy_delete_buffer( YY_CURRENT_BUFFER );
1732 YY_CURRENT_BUFFER_LVALUE = NULL;
1733 yypop_buffer_state();
1737 yyfree((yy_buffer_stack) );
1738 (yy_buffer_stack) = NULL;
1752static void yy_flex_strncpy (
char* s1,
const char * s2,
int n )
1756 for ( i = 0; i < n; ++i )
1761#ifdef YY_NEED_STRLEN
1762static int yy_flex_strlen (
const char * s )
1765 for ( n = 0; s[n]; ++n )
1772void *yyalloc (yy_size_t size )
1774 return malloc(size);
1777void *yyrealloc (
void * ptr, yy_size_t size )
1787 return realloc(ptr, size);
1790void yyfree (
void * ptr )
1792 free( (
char *) ptr );
1795#define YYTABLES_NAME "yytables"
1797#line 77 "configfile.l"
1806#include "pcsclite.h"
1812int evaluatetoken(
char *pcToken)
1814 if (pcPrevious == NULL)
1816 pcPrevious = strdup(pcToken);
1817 iOldLinenumber = iLinenumber;
1822 if (iOldLinenumber != iLinenumber)
1824 tok_error(pcPrevious);
1825 pcPrevious = strdup(pcToken);
1826 iOldLinenumber = iLinenumber;
1830 pcCurrent = pcToken;
1831 if (strcmp(pcPrevious,
"FRIENDLYNAME") == 0)
1833 if (pcFriendlyname == NULL)
1837 pcFriendlyname = malloc(strlen(pcCurrent) + 1);
1838 for (n = 0, p = 0; n < strlen(pcCurrent); n++)
1840 if (pcCurrent[n] !=
'"')
1842 pcFriendlyname[p++] = pcCurrent[n];
1845 pcFriendlyname[p++] =
'\0';
1849 tok_error(pcPrevious);
1853 else if (strcmp(pcPrevious,
"DEVICENAME") == 0)
1855 if (pcDevicename == NULL)
1857 struct stat fStatBuf;
1859 pcDevicename = strdup(pcCurrent);
1860 if ((NULL == strchr(pcDevicename,
':'))
1861 && (stat(pcDevicename, &fStatBuf) != 0))
1863 Log3(PCSC_LOG_CRITICAL,
"Error with device %s: %s",
1864 pcDevicename, strerror(errno));
1865 Log1(PCSC_LOG_CRITICAL,
"You should remove the DEVICENAME line if your driver does not use this field");
1871 tok_error(pcPrevious);
1875 else if (strcmp(pcPrevious,
"LIBPATH") == 0)
1877 if (pcLibpath == NULL)
1879 struct stat fStatBuf;
1881 pcLibpath = strdup(pcCurrent);
1882 if (stat(pcLibpath, &fStatBuf) != 0)
1884 Log3(PCSC_LOG_CRITICAL,
"Error with library %s: %s",
1885 pcLibpath, strerror(errno));
1889 if (strstr(pcLibpath,
".bundle") != NULL)
1891 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1892 Log2(PCSC_LOG_ERROR,
"WARNING: USB drivers SHOULD NOT be declared in a reader.conf file: %s", pcLibpath);
1893 Log1(PCSC_LOG_ERROR,
"WARNING *************************************");
1898 tok_error(pcPrevious);
1902 else if (strcmp(pcPrevious,
"CHANNELID") == 0)
1904 if (pcChannelid == NULL)
1905 pcChannelid = strdup(pcCurrent);
1908 tok_error(pcPrevious);
1914 tok_error(pcPrevious);
1925 if (pcFriendlyname && pcLibpath && badError != 1
1926 && (pcChannelid || pcDevicename))
1929 static char* defaultDeviceName = (
char *)
"";
1931 Log2(PCSC_LOG_DEBUG,
"Add reader: %s", pcFriendlyname);
1932 if (0 == reader_list_size)
1935 reader_list_size = 2;
1936 reader_list = malloc(reader_list_size *
sizeof(
SerialReader));
1942 new_reader_list = realloc(reader_list, reader_list_size *
1944 if (new_reader_list == NULL)
1946 reader_list = new_reader_list;
1948 if (reader_list == NULL)
1950 tok_error(
"No Memory");
1958 if (NULL == pcDevicename)
1959 pcDevicename = defaultDeviceName;
1962 channelId = strtoul(pcChannelid, NULL, 0);
1965 reader_list[reader_list_size-2].
pcFriendlyname = strdup(pcFriendlyname);
1966 reader_list[reader_list_size-2].
pcDevicename = strdup(pcDevicename);
1967 reader_list[reader_list_size-2].
pcLibpath = strdup(pcLibpath),
1968 reader_list[reader_list_size-2].
channelId = channelId;
1970 free(pcFriendlyname);
1971 pcFriendlyname = NULL;
1973 if (pcDevicename != defaultDeviceName)
1975 pcDevicename = NULL;
1988void tok_error(
const char *token_error)
1993 Log4(PCSC_LOG_ERROR,
"tok_error: invalid value line %d in %s: %s",
1994 iOldLinenumber, ConfFile, token_error);
1998int DBGetReaderListDir(
const char *readerconf_dir,
2006 reader_list_size = 0;
2008 dir = opendir(readerconf_dir);
2012 struct dirent *direntry;
2014 Log2(PCSC_LOG_DEBUG,
"Parsing conf directory: %s", readerconf_dir);
2017 while ((direntry = readdir(dir)) != NULL)
2019 char filename[FILENAME_MAX];
2022 snprintf(filename,
sizeof(filename),
"%s/%s",
2023 readerconf_dir, direntry->d_name);
2026#ifdef HAVE_STRUCT_DIRENT_D_TYPE
2027 if (direntry->d_type == DT_UNKNOWN)
2032 if (lstat(filename, &st) != 0)
2034 Log2(PCSC_LOG_DEBUG,
"Skipping non statable file: %s",
2039 if (!S_ISREG(st.st_mode))
2041 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
2046#ifdef HAVE_STRUCT_DIRENT_D_TYPE
2048 if (direntry->d_type != DT_REG)
2050 Log2(PCSC_LOG_DEBUG,
"Skipping non regular file: %s",
2057 if (
'.' == direntry->d_name[0])
2059 Log2(PCSC_LOG_DEBUG,
"Skipping hidden file: %s",
2065 r = DBGetReaderList(filename, caller_reader_list);
2076 ret = DBGetReaderList(readerconf_dir, caller_reader_list);
2081int DBGetReaderList(
const char *readerconf,
SerialReader **caller_reader_list)
2083 FILE *configFile = NULL;
2085 *caller_reader_list = NULL;
2088 ConfFile = readerconf;
2090 Log2(PCSC_LOG_DEBUG,
"Parsing conf file: %s", ConfFile);
2092 configFile = fopen(readerconf,
"r");
2094 if (configFile == NULL)
2101 iOldLinenumber = -1;
2102 pcFriendlyname = NULL;
2103 pcDevicename = NULL;
2114 while (!feof(configFile));
2117 (void)fclose(configFile);
2119 *caller_reader_list = reader_list;
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.