pcsc-lite 2.0.3
tokenparser.c
Go to the documentation of this file.
1
2#line 3 "tokenparser.c"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define yy_create_buffer tp_create_buffer
9#define yy_delete_buffer tp_delete_buffer
10#define yy_scan_buffer tp_scan_buffer
11#define yy_scan_string tp_scan_string
12#define yy_scan_bytes tp_scan_bytes
13#define yy_init_buffer tp_init_buffer
14#define yy_flush_buffer tp_flush_buffer
15#define yy_load_buffer_state tp_load_buffer_state
16#define yy_switch_to_buffer tp_switch_to_buffer
17#define yypush_buffer_state tppush_buffer_state
18#define yypop_buffer_state tppop_buffer_state
19#define yyensure_buffer_stack tpensure_buffer_stack
20#define yy_flex_debug tp_flex_debug
21#define yyin tpin
22#define yyleng tpleng
23#define yylex tplex
24#define yylineno tplineno
25#define yyout tpout
26#define yyrestart tprestart
27#define yytext tptext
28#define yywrap tpwrap
29#define yyalloc tpalloc
30#define yyrealloc tprealloc
31#define yyfree tpfree
32
33#define FLEX_SCANNER
34#define YY_FLEX_MAJOR_VERSION 2
35#define YY_FLEX_MINOR_VERSION 6
36#define YY_FLEX_SUBMINOR_VERSION 4
37#if YY_FLEX_SUBMINOR_VERSION > 0
38#define FLEX_BETA
39#endif
40
41#ifdef yy_create_buffer
42#define tp_create_buffer_ALREADY_DEFINED
43#else
44#define yy_create_buffer tp_create_buffer
45#endif
46
47#ifdef yy_delete_buffer
48#define tp_delete_buffer_ALREADY_DEFINED
49#else
50#define yy_delete_buffer tp_delete_buffer
51#endif
52
53#ifdef yy_scan_buffer
54#define tp_scan_buffer_ALREADY_DEFINED
55#else
56#define yy_scan_buffer tp_scan_buffer
57#endif
58
59#ifdef yy_scan_string
60#define tp_scan_string_ALREADY_DEFINED
61#else
62#define yy_scan_string tp_scan_string
63#endif
64
65#ifdef yy_scan_bytes
66#define tp_scan_bytes_ALREADY_DEFINED
67#else
68#define yy_scan_bytes tp_scan_bytes
69#endif
70
71#ifdef yy_init_buffer
72#define tp_init_buffer_ALREADY_DEFINED
73#else
74#define yy_init_buffer tp_init_buffer
75#endif
76
77#ifdef yy_flush_buffer
78#define tp_flush_buffer_ALREADY_DEFINED
79#else
80#define yy_flush_buffer tp_flush_buffer
81#endif
82
83#ifdef yy_load_buffer_state
84#define tp_load_buffer_state_ALREADY_DEFINED
85#else
86#define yy_load_buffer_state tp_load_buffer_state
87#endif
88
89#ifdef yy_switch_to_buffer
90#define tp_switch_to_buffer_ALREADY_DEFINED
91#else
92#define yy_switch_to_buffer tp_switch_to_buffer
93#endif
94
95#ifdef yypush_buffer_state
96#define tppush_buffer_state_ALREADY_DEFINED
97#else
98#define yypush_buffer_state tppush_buffer_state
99#endif
100
101#ifdef yypop_buffer_state
102#define tppop_buffer_state_ALREADY_DEFINED
103#else
104#define yypop_buffer_state tppop_buffer_state
105#endif
106
107#ifdef yyensure_buffer_stack
108#define tpensure_buffer_stack_ALREADY_DEFINED
109#else
110#define yyensure_buffer_stack tpensure_buffer_stack
111#endif
112
113#ifdef yylex
114#define tplex_ALREADY_DEFINED
115#else
116#define yylex tplex
117#endif
118
119#ifdef yyrestart
120#define tprestart_ALREADY_DEFINED
121#else
122#define yyrestart tprestart
123#endif
124
125#ifdef yylex_init
126#define tplex_init_ALREADY_DEFINED
127#else
128#define yylex_init tplex_init
129#endif
130
131#ifdef yylex_init_extra
132#define tplex_init_extra_ALREADY_DEFINED
133#else
134#define yylex_init_extra tplex_init_extra
135#endif
136
137#ifdef yylex_destroy
138#define tplex_destroy_ALREADY_DEFINED
139#else
140#define yylex_destroy tplex_destroy
141#endif
142
143#ifdef yyget_debug
144#define tpget_debug_ALREADY_DEFINED
145#else
146#define yyget_debug tpget_debug
147#endif
148
149#ifdef yyset_debug
150#define tpset_debug_ALREADY_DEFINED
151#else
152#define yyset_debug tpset_debug
153#endif
154
155#ifdef yyget_extra
156#define tpget_extra_ALREADY_DEFINED
157#else
158#define yyget_extra tpget_extra
159#endif
160
161#ifdef yyset_extra
162#define tpset_extra_ALREADY_DEFINED
163#else
164#define yyset_extra tpset_extra
165#endif
166
167#ifdef yyget_in
168#define tpget_in_ALREADY_DEFINED
169#else
170#define yyget_in tpget_in
171#endif
172
173#ifdef yyset_in
174#define tpset_in_ALREADY_DEFINED
175#else
176#define yyset_in tpset_in
177#endif
178
179#ifdef yyget_out
180#define tpget_out_ALREADY_DEFINED
181#else
182#define yyget_out tpget_out
183#endif
184
185#ifdef yyset_out
186#define tpset_out_ALREADY_DEFINED
187#else
188#define yyset_out tpset_out
189#endif
190
191#ifdef yyget_leng
192#define tpget_leng_ALREADY_DEFINED
193#else
194#define yyget_leng tpget_leng
195#endif
196
197#ifdef yyget_text
198#define tpget_text_ALREADY_DEFINED
199#else
200#define yyget_text tpget_text
201#endif
202
203#ifdef yyget_lineno
204#define tpget_lineno_ALREADY_DEFINED
205#else
206#define yyget_lineno tpget_lineno
207#endif
208
209#ifdef yyset_lineno
210#define tpset_lineno_ALREADY_DEFINED
211#else
212#define yyset_lineno tpset_lineno
213#endif
214
215#ifdef yywrap
216#define tpwrap_ALREADY_DEFINED
217#else
218#define yywrap tpwrap
219#endif
220
221#ifdef yyalloc
222#define tpalloc_ALREADY_DEFINED
223#else
224#define yyalloc tpalloc
225#endif
226
227#ifdef yyrealloc
228#define tprealloc_ALREADY_DEFINED
229#else
230#define yyrealloc tprealloc
231#endif
232
233#ifdef yyfree
234#define tpfree_ALREADY_DEFINED
235#else
236#define yyfree tpfree
237#endif
238
239#ifdef yytext
240#define tptext_ALREADY_DEFINED
241#else
242#define yytext tptext
243#endif
244
245#ifdef yyleng
246#define tpleng_ALREADY_DEFINED
247#else
248#define yyleng tpleng
249#endif
250
251#ifdef yyin
252#define tpin_ALREADY_DEFINED
253#else
254#define yyin tpin
255#endif
256
257#ifdef yyout
258#define tpout_ALREADY_DEFINED
259#else
260#define yyout tpout
261#endif
262
263#ifdef yy_flex_debug
264#define tp_flex_debug_ALREADY_DEFINED
265#else
266#define yy_flex_debug tp_flex_debug
267#endif
268
269#ifdef yylineno
270#define tplineno_ALREADY_DEFINED
271#else
272#define yylineno tplineno
273#endif
274
275/* First, we deal with platform-specific or compiler-specific issues. */
276
277/* begin standard C headers. */
278/* Feature test macros. Flex uses functions that require a minimum set of
279 * macros defined. As defining some macros may hide function declarations that
280 * user code might use, be conservative and respect user's definitions as much
281 * as possible. In glibc, feature test macros may not be all set up until one
282 * of the libc header (that includes <features.h>) is included. This creates
283 * a circular dependency when we check the macros. <assert.h> is the safest
284 * header we can include and does not declare too many functions we don't need.
285 */
286#if !defined(__GNU_LIBRARY__) && defined(__STDC__)
287#include <assert.h>
288#endif
289#if !(defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
290 defined(_POSIX_SOURCE))
291# define _POSIX_C_SOURCE 1 /* Required for fileno() */
292# define _POSIX_SOURCE 1
293#endif
294#include <stdio.h>
295#include <string.h>
296#include <errno.h>
297#include <stdlib.h>
298
299/* end standard C headers. */
300
301/* begin standard C++ headers. */
302
303/* flex integer type definitions */
304
305/* Prefer C99 integer types if available. */
306#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
307/* Include <inttypes.h> and not <stdint.h> because Solaris 2.6 has the former
308 * and not the latter.
309 */
310#include <inttypes.h>
311# define YYFLEX_USE_STDINT
312#else
313# if defined(_MSC_VER) && _MSC_VER >= 1600
314/* Visual C++ 2010 does not define __STDC_VERSION__ and has <stdint.h> but not
315 * <inttypes.h>.
316 */
317#include <stdint.h>
318# define YYFLEX_USE_STDINT
319# endif
320#endif
321#ifdef YYFLEX_USE_STDINT
322typedef int8_t flex_int8_t;
323typedef uint8_t flex_uint8_t;
324typedef int16_t flex_int16_t;
325typedef uint16_t flex_uint16_t;
326typedef int32_t flex_int32_t;
327typedef uint32_t flex_uint32_t;
328#else
329typedef unsigned char flex_uint8_t;
330typedef short int flex_int16_t;
331typedef unsigned short int flex_uint16_t;
332# ifdef __STDC__
333typedef signed char flex_int8_t;
334/* ISO C only requires at least 16 bits for int. */
335#include <limits.h>
336# if UINT_MAX >= 4294967295
337# define YYFLEX_INT32_DEFINED
338typedef int flex_int32_t;
339typedef unsigned int flex_uint32_t;
340# endif
341# else
342typedef char flex_int8_t;
343# endif
344# ifndef YYFLEX_INT32_DEFINED
345typedef long int flex_int32_t;
346typedef unsigned long int flex_uint32_t;
347# endif
348#endif
349
350/* TODO: this is always defined, so inline it */
351#define yyconst const
352
353#if defined(__GNUC__) && __GNUC__ >= 3
354#define yynoreturn __attribute__((__noreturn__))
355#else
356#define yynoreturn
357#endif
358
359/* Returned upon end-of-file. */
360#define YY_NULL 0
361
362/* Promotes a possibly negative, possibly signed char to an
363 * integer in range [0..255] for use as an array index.
364 */
365#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
366
367/* Enter a start condition. This macro really ought to take a parameter,
368 * but we do it the disgusting crufty way forced on us by the ()-less
369 * definition of BEGIN.
370 */
371#define BEGIN (yy_start) = 1 + 2 *
372/* Translate the current start state into a value that can be later handed
373 * to BEGIN to return to the state. The YYSTATE alias is for lex
374 * compatibility.
375 */
376#define YY_START (((yy_start) - 1) / 2)
377#define YYSTATE YY_START
378/* Action number for EOF rule of a given start state. */
379#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
380/* Special action meaning "start processing a new file". */
381#define YY_NEW_FILE yyrestart( yyin )
382#define YY_END_OF_BUFFER_CHAR 0
383
384/* Size of default input buffer. */
385#ifndef YY_BUF_SIZE
386#ifdef __ia64__
387/* On IA-64, the buffer size is 16k, not 8k.
388 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
389 * Ditto for the __ia64__ case accordingly.
390 */
391#define YY_BUF_SIZE 32768
392#else
393#define YY_BUF_SIZE 16384
394#endif /* __ia64__ */
395#endif
396
397/* The state buf must be large enough to hold one state per character in the main buffer.
398 */
399#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
400
401#ifndef YY_TYPEDEF_YY_BUFFER_STATE
402#define YY_TYPEDEF_YY_BUFFER_STATE
403typedef struct yy_buffer_state *YY_BUFFER_STATE;
404#endif
405
406#ifndef YY_TYPEDEF_YY_SIZE_T
407#define YY_TYPEDEF_YY_SIZE_T
408typedef size_t yy_size_t;
409#endif
410
411extern int yyleng;
412
413extern FILE *yyin, *yyout;
414
415#define EOB_ACT_CONTINUE_SCAN 0
416#define EOB_ACT_END_OF_FILE 1
417#define EOB_ACT_LAST_MATCH 2
418
419 #define YY_LESS_LINENO(n)
420 #define YY_LINENO_REWIND_TO(ptr)
421
422/* Return all but the first "n" matched characters back to the input stream. */
423#define yyless(n) \
424 do \
425 { \
426 /* Undo effects of setting up yytext. */ \
427 int yyless_macro_arg = (n); \
428 YY_LESS_LINENO(yyless_macro_arg);\
429 *yy_cp = (yy_hold_char); \
430 YY_RESTORE_YY_MORE_OFFSET \
431 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
432 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
433 } \
434 while ( 0 )
435#define unput(c) yyunput( c, (yytext_ptr) )
436
437#ifndef YY_STRUCT_YY_BUFFER_STATE
438#define YY_STRUCT_YY_BUFFER_STATE
439struct yy_buffer_state
440 {
441 FILE *yy_input_file;
442
443 char *yy_ch_buf; /* input buffer */
444 char *yy_buf_pos; /* current position in input buffer */
445
446 /* Size of input buffer in bytes, not including room for EOB
447 * characters.
448 */
449 int yy_buf_size;
450
451 /* Number of characters read into yy_ch_buf, not including EOB
452 * characters.
453 */
454 int yy_n_chars;
455
456 /* Whether we "own" the buffer - i.e., we know we created it,
457 * and can realloc() it to grow it, and should free() it to
458 * delete it.
459 */
460 int yy_is_our_buffer;
461
462 /* Whether this is an "interactive" input source; if so, and
463 * if we're using stdio for input, then we want to use getc()
464 * instead of fread(), to make sure we stop fetching input after
465 * each newline.
466 */
467 int yy_is_interactive;
468
469 /* Whether we're considered to be at the beginning of a line.
470 * If so, '^' rules will be active on the next match, otherwise
471 * not.
472 */
473 int yy_at_bol;
474
475 int yy_bs_lineno;
476 int yy_bs_column;
478 /* Whether to try to fill the input buffer when we reach the
479 * end of it.
480 */
481 int yy_fill_buffer;
482
483 int yy_buffer_status;
484
485#define YY_BUFFER_NEW 0
486#define YY_BUFFER_NORMAL 1
487 /* When an EOF's been seen but there's still some text to process
488 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
489 * shouldn't try reading from the input source any more. We might
490 * still have a bunch of tokens to match, though, because of
491 * possible backing-up.
492 *
493 * When we actually see the EOF, we change the status to "new"
494 * (via yyrestart()), so that the user can continue scanning by
495 * just pointing yyin at a new input file.
496 */
497#define YY_BUFFER_EOF_PENDING 2
498
499 };
500#endif /* !YY_STRUCT_YY_BUFFER_STATE */
501
502/* Stack of input buffers. */
503static size_t yy_buffer_stack_top = 0;
504static size_t yy_buffer_stack_max = 0;
507/* We provide macros for accessing buffer states in case in the
508 * future we want to put the buffer states in a more general
509 * "scanner state".
510 *
511 * Returns the top of the stack, or NULL.
512 */
513#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
514 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
515 : NULL)
516/* Same as previous macro, but useful when we know that the buffer stack is not
517 * NULL or when we need an lvalue. For internal use only.
518 */
519#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
520
521/* yy_hold_char holds the character lost when yytext is formed. */
522static char yy_hold_char;
523static int yy_n_chars; /* number of characters read into yy_ch_buf */
524int yyleng;
525
526/* Points to current character in buffer. */
527static char *yy_c_buf_p = NULL;
528static int yy_init = 0; /* whether we need to initialize */
529static int yy_start = 0; /* start state number */
530
531/* Flag which is used to allow yywrap()'s to do buffer switches
532 * instead of setting up a fresh yyin. A bit of a hack ...
533 */
534static int yy_did_buffer_switch_on_eof;
535
536void yyrestart ( FILE *input_file );
537void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
538YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
539void yy_delete_buffer ( YY_BUFFER_STATE b );
540void yy_flush_buffer ( YY_BUFFER_STATE b );
541void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
542void yypop_buffer_state ( void );
543
544static void yyensure_buffer_stack ( void );
545static void yy_load_buffer_state ( void );
546static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
547#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
548
549YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
550YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
551YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
552
553void *yyalloc ( yy_size_t );
554void *yyrealloc ( void *, yy_size_t );
555void yyfree ( void * );
556
557#define yy_new_buffer yy_create_buffer
558#define yy_set_interactive(is_interactive) \
559 { \
560 if ( ! YY_CURRENT_BUFFER ){ \
561 yyensure_buffer_stack (); \
562 YY_CURRENT_BUFFER_LVALUE = \
563 yy_create_buffer( yyin, YY_BUF_SIZE ); \
564 } \
565 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
566 }
567#define yy_set_bol(at_bol) \
568 { \
569 if ( ! YY_CURRENT_BUFFER ){\
570 yyensure_buffer_stack (); \
571 YY_CURRENT_BUFFER_LVALUE = \
572 yy_create_buffer( yyin, YY_BUF_SIZE ); \
573 } \
574 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
575 }
576#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
577
578/* Begin user sect3 */
579
580#define tpwrap() (/*CONSTCOND*/1)
581#define YY_SKIP_YYWRAP
582typedef flex_uint8_t YY_CHAR;
583
584FILE *yyin = NULL, *yyout = NULL;
585
586typedef int yy_state_type;
587
588extern int yylineno;
589int yylineno = 1;
590
591extern char *yytext;
592#ifdef yytext_ptr
593#undef yytext_ptr
594#endif
595#define yytext_ptr yytext
596
597static yy_state_type yy_get_previous_state ( void );
598static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
599static int yy_get_next_buffer ( void );
600static void yynoreturn yy_fatal_error ( const char* msg );
601
602/* Done after the current pattern has been matched and before the
603 * corresponding action - sets up yytext.
604 */
605#define YY_DO_BEFORE_ACTION \
606 (yytext_ptr) = yy_bp; \
607 yyleng = (int) (yy_cp - yy_bp); \
608 (yy_hold_char) = *yy_cp; \
609 *yy_cp = '\0'; \
610 (yy_c_buf_p) = yy_cp;
611#define YY_NUM_RULES 7
612#define YY_END_OF_BUFFER 8
613/* This struct is not used in this scanner,
614 but its presence is necessary. */
615struct yy_trans_info
616 {
617 flex_int32_t yy_verify;
618 flex_int32_t yy_nxt;
619 };
620static const flex_int16_t yy_accept[39] =
621 { 0,
622 0, 0, 8, 6, 4, 2, 1, 6, 1, 0,
623 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
624 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
625 0, 0, 0, 0, 0, 0, 5, 0
626 } ;
627
628static const YY_CHAR yy_ec[256] =
629 { 0,
630 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
631 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
632 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
633 1, 2, 1, 1, 4, 1, 1, 1, 1, 1,
634 1, 1, 1, 1, 1, 1, 5, 6, 6, 6,
635 6, 6, 6, 6, 6, 6, 6, 1, 1, 7,
636 1, 8, 1, 1, 9, 9, 9, 9, 9, 9,
637 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
638 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
639 1, 1, 1, 1, 1, 1, 10, 10, 10, 10,
640
641 11, 10, 12, 10, 13, 10, 14, 10, 10, 15,
642 10, 10, 10, 16, 17, 18, 10, 10, 10, 10,
643 19, 10, 1, 1, 1, 1, 1, 1, 1, 1,
644 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
645 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
646 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
648 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
651
652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
654 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
655 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 1, 1, 1, 1
658 } ;
659
660static const YY_CHAR yy_meta[20] =
661 { 0,
662 1, 2, 3, 1, 1, 2, 1, 1, 2, 2,
663 2, 2, 2, 2, 2, 2, 2, 2, 2
664 } ;
665
666static const flex_int16_t yy_base[43] =
667 { 0,
668 0, 6, 54, 55, 55, 55, 0, 0, 0, 42,
669 34, 32, 34, 41, 35, 0, 32, 39, 33, 39,
670 35, 28, 0, 30, 33, 20, 11, 30, 4, 55,
671 5, 8, 12, 13, 15, 22, 19, 55, 30, 33,
672 3, 35
673 } ;
674
675static const flex_int16_t yy_def[43] =
676 { 0,
677 39, 39, 38, 38, 38, 38, 40, 38, 40, 38,
678 38, 38, 38, 38, 38, 41, 38, 41, 38, 38,
679 38, 38, 42, 38, 42, 38, 42, 38, 42, 38,
680 42, 42, 42, 42, 42, 42, 42, 0, 38, 38,
681 38, 38
682 } ;
683
684static const flex_int16_t yy_nxt[75] =
685 { 0,
686 38, 5, 6, 7, 18, 38, 8, 5, 6, 7,
687 27, 27, 8, 10, 27, 29, 11, 27, 27, 27,
688 31, 27, 32, 33, 34, 27, 36, 35, 27, 37,
689 4, 4, 4, 9, 9, 25, 25, 30, 28, 27,
690 26, 24, 23, 22, 21, 20, 19, 17, 16, 15,
691 14, 13, 12, 38, 3, 38, 38, 38, 38, 38,
692 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
693 38, 38, 38, 38
694 } ;
695
696static const flex_int16_t yy_chk[75] =
697 { 0,
698 0, 1, 1, 1, 41, 0, 1, 2, 2, 2,
699 29, 31, 2, 8, 32, 27, 8, 27, 33, 34,
700 29, 35, 31, 32, 33, 37, 35, 34, 36, 36,
701 39, 39, 39, 40, 40, 42, 42, 28, 26, 25,
702 24, 22, 21, 20, 19, 18, 17, 15, 14, 13,
703 12, 11, 10, 3, 38, 38, 38, 38, 38, 38,
704 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
705 38, 38, 38, 38
706 } ;
707
708static yy_state_type yy_last_accepting_state;
709static char *yy_last_accepting_cpos;
710
711extern int yy_flex_debug;
712int yy_flex_debug = 0;
713
714/* The intent behind this definition is that it'll catch
715 * any uses of REJECT which flex missed.
716 */
717#define REJECT reject_used_but_not_detected
718#define yymore() yymore_used_but_not_detected
719#define YY_MORE_ADJ 0
720#define YY_RESTORE_YY_MORE_OFFSET
721char *yytext;
722#line 1 "tokenparser.l"
723/*
724 * Reads lexical config files and updates database.
725 *
726 * MUSCLE SmartCard Development ( https://pcsclite.apdu.fr/ )
727 *
728 * Copyright (C) 2001-2003
729 * David Corcoran <corcoran@musclecard.com>
730 * Copyright (C) 2003-2010
731 * Ludovic Rousseau <ludovic.rousseau@free.fr>
732 *
733Redistribution and use in source and binary forms, with or without
734modification, are permitted provided that the following conditions
735are met:
736
7371. Redistributions of source code must retain the above copyright
738 notice, this list of conditions and the following disclaimer.
7392. Redistributions in binary form must reproduce the above copyright
740 notice, this list of conditions and the following disclaimer in the
741 documentation and/or other materials provided with the distribution.
7423. The name of the author may not be used to endorse or promote products
743 derived from this software without specific prior written permission.
744
745THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
746IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
747OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
748IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
749INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
750NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
751DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
752THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
753(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
754THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
755 */
761#line 42 "tokenparser.l"
762
763#include "config.h"
764#include <stdio.h>
765#include <string.h>
766#include <errno.h>
767#ifndef NDEBUG
768#define NDEBUG
769#endif
770#include <assert.h>
771
772#include "simclist.h"
773#include "debuglog.h"
774#include "parser.h"
775
776static void eval_key(char *pcToken, list_t *list_key);
777static void eval_value(char *pcToken, list_t *list_values);
778void tperrorCheck (char *pcToken_error);
779
780static list_t *ListKeys;
781static list_t *ListValues;
782
783#line 784 "tokenparser.c"
784#define YY_NO_INPUT 1
785#line 786 "tokenparser.c"
786
787#define INITIAL 0
788
789#ifndef YY_NO_UNISTD_H
790/* Special case for "unistd.h", since it is non-ANSI. We include it way
791 * down here because we want the user's section 1 to have been scanned first.
792 * The user has a chance to override it with an option.
793 */
794#include <unistd.h>
795#endif
796
797#ifndef YY_EXTRA_TYPE
798#define YY_EXTRA_TYPE void *
799#endif
800
801static int yy_init_globals ( void );
802
803/* Accessor methods to globals.
804 These are made visible to non-reentrant scanners for convenience. */
805
806int yylex_destroy ( void );
807
808int yyget_debug ( void );
809
810void yyset_debug ( int debug_flag );
811
812YY_EXTRA_TYPE yyget_extra ( void );
813
814void yyset_extra ( YY_EXTRA_TYPE user_defined );
815
816FILE *yyget_in ( void );
817
818void yyset_in ( FILE * _in_str );
819
820FILE *yyget_out ( void );
821
822void yyset_out ( FILE * _out_str );
823
824 int yyget_leng ( void );
825
826char *yyget_text ( void );
827
828int yyget_lineno ( void );
829
830void yyset_lineno ( int _line_number );
831
832/* Macros after this point can all be overridden by user definitions in
833 * section 1.
834 */
835
836#ifndef YY_SKIP_YYWRAP
837#ifdef __cplusplus
838extern "C" int yywrap ( void );
839#else
840extern int yywrap ( void );
841#endif
842#endif
843
844#ifndef YY_NO_UNPUT
845
846#endif
847
848#ifndef yytext_ptr
849static void yy_flex_strncpy ( char *, const char *, int );
850#endif
851
852#ifdef YY_NEED_STRLEN
853static int yy_flex_strlen ( const char * );
854#endif
855
856#ifndef YY_NO_INPUT
857#ifdef __cplusplus
858static int yyinput ( void );
859#else
860static int input ( void );
861#endif
862
863#endif
864
865/* Amount of stuff to slurp up with each read. */
866#ifndef YY_READ_BUF_SIZE
867#ifdef __ia64__
868/* On IA-64, the buffer size is 16k, not 8k */
869#define YY_READ_BUF_SIZE 16384
870#else
871#define YY_READ_BUF_SIZE 8192
872#endif /* __ia64__ */
873#endif
874
875/* Copy whatever the last rule matched to the standard output. */
876#ifndef ECHO
877/* This used to be an fputs(), but since the string might contain NUL's,
878 * we now use fwrite().
879 */
880#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
881#endif
882
883/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
884 * is returned in "result".
885 */
886#ifndef YY_INPUT
887#define YY_INPUT(buf,result,max_size) \
888 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
889 { \
890 int c = '*'; \
891 int n; \
892 for ( n = 0; n < max_size && \
893 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
894 buf[n] = (char) c; \
895 if ( c == '\n' ) \
896 buf[n++] = (char) c; \
897 if ( c == EOF && ferror( yyin ) ) \
898 YY_FATAL_ERROR( "input in flex scanner failed" ); \
899 result = n; \
900 } \
901 else \
902 { \
903 errno=0; \
904 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
905 { \
906 if( errno != EINTR) \
907 { \
908 YY_FATAL_ERROR( "input in flex scanner failed" ); \
909 break; \
910 } \
911 errno=0; \
912 clearerr(yyin); \
913 } \
914 }\
915\
916
917#endif
918
919/* No semi-colon after return; correct usage is to write "yyterminate();" -
920 * we don't want an extra ';' after the "return" because that will cause
921 * some compilers to complain about unreachable statements.
922 */
923#ifndef yyterminate
924#define yyterminate() return YY_NULL
925#endif
926
927/* Number of entries by which start-condition stack grows. */
928#ifndef YY_START_STACK_INCR
929#define YY_START_STACK_INCR 25
930#endif
931
932/* Report a fatal error. */
933#ifndef YY_FATAL_ERROR
934#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
935#endif
936
937/* end tables serialization structures and prototypes */
938
939/* Default declaration of generated scanner - a define so the user can
940 * easily add parameters.
941 */
942#ifndef YY_DECL
943#define YY_DECL_IS_OURS 1
944
945extern int yylex (void);
946
947#define YY_DECL int yylex (void)
948#endif /* !YY_DECL */
949
950/* Code executed at the beginning of each rule, after yytext and yyleng
951 * have been set up.
952 */
953#ifndef YY_USER_ACTION
954#define YY_USER_ACTION
955#endif
956
957/* Code executed at the end of each rule. */
958#ifndef YY_BREAK
959#define YY_BREAK /*LINTED*/break;
960#endif
961
962#define YY_RULE_SETUP \
963 YY_USER_ACTION
964
967YY_DECL
968{
969 yy_state_type yy_current_state;
970 char *yy_cp, *yy_bp;
971 int yy_act;
972
973 if ( !(yy_init) )
974 {
975 (yy_init) = 1;
976
977#ifdef YY_USER_INIT
978 YY_USER_INIT;
979#endif
980
981 if ( ! (yy_start) )
982 (yy_start) = 1; /* first start state */
983
984 if ( ! yyin )
985 yyin = stdin;
986
987 if ( ! yyout )
988 yyout = stdout;
989
990 if ( ! YY_CURRENT_BUFFER ) {
991 yyensure_buffer_stack ();
992 YY_CURRENT_BUFFER_LVALUE =
993 yy_create_buffer( yyin, YY_BUF_SIZE );
994 }
995
996 yy_load_buffer_state( );
997 }
998
999 {
1000#line 69 "tokenparser.l"
1001
1002
1003#line 1004 "tokenparser.c"
1004
1005 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1006 {
1007 yy_cp = (yy_c_buf_p);
1008
1009 /* Support of yytext. */
1010 *yy_cp = (yy_hold_char);
1011
1012 /* yy_bp points to the position in yy_ch_buf of the start of
1013 * the current run.
1014 */
1015 yy_bp = yy_cp;
1016
1017 yy_current_state = (yy_start);
1018yy_match:
1019 do
1020 {
1021 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1022 if ( yy_accept[yy_current_state] )
1023 {
1024 (yy_last_accepting_state) = yy_current_state;
1025 (yy_last_accepting_cpos) = yy_cp;
1026 }
1027 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1028 {
1029 yy_current_state = (int) yy_def[yy_current_state];
1030 if ( yy_current_state >= 39 )
1031 yy_c = yy_meta[yy_c];
1032 }
1033 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1034 ++yy_cp;
1035 }
1036 while ( yy_base[yy_current_state] != 55 );
1037
1038yy_find_action:
1039 yy_act = yy_accept[yy_current_state];
1040 if ( yy_act == 0 )
1041 { /* have to back up */
1042 yy_cp = (yy_last_accepting_cpos);
1043 yy_current_state = (yy_last_accepting_state);
1044 yy_act = yy_accept[yy_current_state];
1045 }
1046
1047 YY_DO_BEFORE_ACTION;
1048
1049do_action: /* This label is used only to access EOF actions. */
1050
1051 switch ( yy_act )
1052 { /* beginning of action switch */
1053 case 0: /* must back up */
1054 /* undo the effects of YY_DO_BEFORE_ACTION */
1055 *yy_cp = (yy_hold_char);
1056 yy_cp = (yy_last_accepting_cpos);
1057 yy_current_state = (yy_last_accepting_state);
1058 goto yy_find_action;
1059
1060case 1:
1061YY_RULE_SETUP
1062#line 71 "tokenparser.l"
1063{}
1064 YY_BREAK
1065case 2:
1066/* rule 2 can match eol */
1067YY_RULE_SETUP
1068#line 72 "tokenparser.l"
1069{}
1070 YY_BREAK
1071case 3:
1072YY_RULE_SETUP
1073#line 73 "tokenparser.l"
1074{ eval_key(yytext, ListKeys); }
1075 YY_BREAK
1076case 4:
1077YY_RULE_SETUP
1078#line 74 "tokenparser.l"
1079{}
1080 YY_BREAK
1081case 5:
1082YY_RULE_SETUP
1083#line 75 "tokenparser.l"
1084{ eval_value(yytext, ListValues); }
1085 YY_BREAK
1086case 6:
1087YY_RULE_SETUP
1088#line 76 "tokenparser.l"
1089{ tperrorCheck(yytext); }
1090 YY_BREAK
1091case 7:
1092YY_RULE_SETUP
1093#line 77 "tokenparser.l"
1094ECHO;
1095 YY_BREAK
1096#line 1097 "tokenparser.c"
1097case YY_STATE_EOF(INITIAL):
1098 yyterminate();
1099
1100 case YY_END_OF_BUFFER:
1101 {
1102 /* Amount of text matched not including the EOB char. */
1103 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1104
1105 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1106 *yy_cp = (yy_hold_char);
1107 YY_RESTORE_YY_MORE_OFFSET
1108
1109 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1110 {
1111 /* We're scanning a new file or input source. It's
1112 * possible that this happened because the user
1113 * just pointed yyin at a new source and called
1114 * yylex(). If so, then we have to assure
1115 * consistency between YY_CURRENT_BUFFER and our
1116 * globals. Here is the right place to do so, because
1117 * this is the first action (other than possibly a
1118 * back-up) that will match for the new input source.
1119 */
1120 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1121 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1122 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1123 }
1124
1125 /* Note that here we test for yy_c_buf_p "<=" to the position
1126 * of the first EOB in the buffer, since yy_c_buf_p will
1127 * already have been incremented past the NUL character
1128 * (since all states make transitions on EOB to the
1129 * end-of-buffer state). Contrast this with the test
1130 * in input().
1131 */
1132 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1133 { /* This was really a NUL. */
1134 yy_state_type yy_next_state;
1135
1136 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1137
1138 yy_current_state = yy_get_previous_state( );
1139
1140 /* Okay, we're now positioned to make the NUL
1141 * transition. We couldn't have
1142 * yy_get_previous_state() go ahead and do it
1143 * for us because it doesn't know how to deal
1144 * with the possibility of jamming (and we don't
1145 * want to build jamming into it because then it
1146 * will run more slowly).
1147 */
1148
1149 yy_next_state = yy_try_NUL_trans( yy_current_state );
1150
1151 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1152
1153 if ( yy_next_state )
1154 {
1155 /* Consume the NUL. */
1156 yy_cp = ++(yy_c_buf_p);
1157 yy_current_state = yy_next_state;
1158 goto yy_match;
1159 }
1160
1161 else
1162 {
1163 yy_cp = (yy_c_buf_p);
1164 goto yy_find_action;
1165 }
1166 }
1167
1168 else switch ( yy_get_next_buffer( ) )
1169 {
1170 case EOB_ACT_END_OF_FILE:
1171 {
1172 (yy_did_buffer_switch_on_eof) = 0;
1173
1174 if ( yywrap( ) )
1175 {
1176 /* Note: because we've taken care in
1177 * yy_get_next_buffer() to have set up
1178 * yytext, we can now set up
1179 * yy_c_buf_p so that if some total
1180 * hoser (like flex itself) wants to
1181 * call the scanner after we return the
1182 * YY_NULL, it'll still work - another
1183 * YY_NULL will get returned.
1184 */
1185 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1186
1187 yy_act = YY_STATE_EOF(YY_START);
1188 goto do_action;
1189 }
1190
1191 else
1192 {
1193 if ( ! (yy_did_buffer_switch_on_eof) )
1194 YY_NEW_FILE;
1195 }
1196 break;
1197 }
1198
1199 case EOB_ACT_CONTINUE_SCAN:
1200 (yy_c_buf_p) =
1201 (yytext_ptr) + yy_amount_of_matched_text;
1202
1203 yy_current_state = yy_get_previous_state( );
1204
1205 yy_cp = (yy_c_buf_p);
1206 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1207 goto yy_match;
1208
1209 case EOB_ACT_LAST_MATCH:
1210 (yy_c_buf_p) =
1211 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1212
1213 yy_current_state = yy_get_previous_state( );
1214
1215 yy_cp = (yy_c_buf_p);
1216 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1217 goto yy_find_action;
1218 }
1219 break;
1220 }
1221
1222 default:
1223 YY_FATAL_ERROR(
1224 "fatal flex scanner internal error--no action found" );
1225 } /* end of action switch */
1226 } /* end of scanning one token */
1227 } /* end of user's declarations */
1228} /* end of yylex */
1229
1230/* yy_get_next_buffer - try to read in a new buffer
1231 *
1232 * Returns a code representing an action:
1233 * EOB_ACT_LAST_MATCH -
1234 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1235 * EOB_ACT_END_OF_FILE - end of file
1236 */
1237static int yy_get_next_buffer (void)
1238{
1239 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1240 char *source = (yytext_ptr);
1241 int number_to_move, i;
1242 int ret_val;
1243
1244 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1245 YY_FATAL_ERROR(
1246 "fatal flex scanner internal error--end of buffer missed" );
1247
1248 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1249 { /* Don't try to fill the buffer, so this is an EOF. */
1250 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1251 {
1252 /* We matched a single character, the EOB, so
1253 * treat this as a final EOF.
1254 */
1255 return EOB_ACT_END_OF_FILE;
1256 }
1257
1258 else
1259 {
1260 /* We matched some text prior to the EOB, first
1261 * process it.
1262 */
1263 return EOB_ACT_LAST_MATCH;
1264 }
1265 }
1266
1267 /* Try to read more data. */
1268
1269 /* First move last chars to start of buffer. */
1270 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1271
1272 for ( i = 0; i < number_to_move; ++i )
1273 *(dest++) = *(source++);
1274
1275 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1276 /* don't do the read, it's not guaranteed to return an EOF,
1277 * just force an EOF
1278 */
1279 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1280
1281 else
1282 {
1283 int num_to_read =
1284 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1285
1286 while ( num_to_read <= 0 )
1287 { /* Not enough room in the buffer - grow it. */
1288
1289 /* just a shorter name for the current buffer */
1290 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1291
1292 int yy_c_buf_p_offset =
1293 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1294
1295 if ( b->yy_is_our_buffer )
1296 {
1297 int new_size = b->yy_buf_size * 2;
1298
1299 if ( new_size <= 0 )
1300 b->yy_buf_size += b->yy_buf_size / 8;
1301 else
1302 b->yy_buf_size *= 2;
1303
1304 b->yy_ch_buf = (char *)
1305 /* Include room in for 2 EOB chars. */
1306 yyrealloc( (void *) b->yy_ch_buf,
1307 (yy_size_t) (b->yy_buf_size + 2) );
1308 }
1309 else
1310 /* Can't grow it, we don't own it. */
1311 b->yy_ch_buf = NULL;
1312
1313 if ( ! b->yy_ch_buf )
1314 YY_FATAL_ERROR(
1315 "fatal error - scanner input buffer overflow" );
1316
1317 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1318
1319 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1320 number_to_move - 1;
1321
1322 }
1323
1324 if ( num_to_read > YY_READ_BUF_SIZE )
1325 num_to_read = YY_READ_BUF_SIZE;
1326
1327 /* Read in more data. */
1328 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1329 (yy_n_chars), num_to_read );
1330
1331 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1332 }
1333
1334 if ( (yy_n_chars) == 0 )
1335 {
1336 if ( number_to_move == YY_MORE_ADJ )
1337 {
1338 ret_val = EOB_ACT_END_OF_FILE;
1339 yyrestart( yyin );
1340 }
1341
1342 else
1343 {
1344 ret_val = EOB_ACT_LAST_MATCH;
1345 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1346 YY_BUFFER_EOF_PENDING;
1347 }
1348 }
1349
1350 else
1351 ret_val = EOB_ACT_CONTINUE_SCAN;
1352
1353 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1354 /* Extend the array by 50%, plus the number we really need. */
1355 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1356 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1357 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1358 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1359 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1360 /* "- 2" to take care of EOB's */
1361 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1362 }
1363
1364 (yy_n_chars) += number_to_move;
1365 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1366 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1367
1368 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1369
1370 return ret_val;
1371}
1372
1373/* yy_get_previous_state - get the state just before the EOB char was reached */
1374
1375 static yy_state_type yy_get_previous_state (void)
1376{
1377 yy_state_type yy_current_state;
1378 char *yy_cp;
1379
1380 yy_current_state = (yy_start);
1381
1382 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1383 {
1384 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1385 if ( yy_accept[yy_current_state] )
1386 {
1387 (yy_last_accepting_state) = yy_current_state;
1388 (yy_last_accepting_cpos) = yy_cp;
1389 }
1390 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1391 {
1392 yy_current_state = (int) yy_def[yy_current_state];
1393 if ( yy_current_state >= 39 )
1394 yy_c = yy_meta[yy_c];
1395 }
1396 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1397 }
1398
1399 return yy_current_state;
1400}
1401
1402/* yy_try_NUL_trans - try to make a transition on the NUL character
1403 *
1404 * synopsis
1405 * next_state = yy_try_NUL_trans( current_state );
1406 */
1407 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1408{
1409 int yy_is_jam;
1410 char *yy_cp = (yy_c_buf_p);
1411
1412 YY_CHAR yy_c = 1;
1413 if ( yy_accept[yy_current_state] )
1414 {
1415 (yy_last_accepting_state) = yy_current_state;
1416 (yy_last_accepting_cpos) = yy_cp;
1417 }
1418 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1419 {
1420 yy_current_state = (int) yy_def[yy_current_state];
1421 if ( yy_current_state >= 39 )
1422 yy_c = yy_meta[yy_c];
1423 }
1424 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1425 yy_is_jam = (yy_current_state == 38);
1426
1427 return yy_is_jam ? 0 : yy_current_state;
1428}
1429
1430#ifndef YY_NO_UNPUT
1431
1432#endif
1433
1434#ifndef YY_NO_INPUT
1435#ifdef __cplusplus
1436 static int yyinput (void)
1437#else
1438 static int input (void)
1439#endif
1440
1441{
1442 int c;
1443
1444 *(yy_c_buf_p) = (yy_hold_char);
1445
1446 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1447 {
1448 /* yy_c_buf_p now points to the character we want to return.
1449 * If this occurs *before* the EOB characters, then it's a
1450 * valid NUL; if not, then we've hit the end of the buffer.
1451 */
1452 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1453 /* This was really a NUL. */
1454 *(yy_c_buf_p) = '\0';
1455
1456 else
1457 { /* need more input */
1458 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1459 ++(yy_c_buf_p);
1460
1461 switch ( yy_get_next_buffer( ) )
1462 {
1463 case EOB_ACT_LAST_MATCH:
1464 /* This happens because yy_g_n_b()
1465 * sees that we've accumulated a
1466 * token and flags that we need to
1467 * try matching the token before
1468 * proceeding. But for input(),
1469 * there's no matching to consider.
1470 * So convert the EOB_ACT_LAST_MATCH
1471 * to EOB_ACT_END_OF_FILE.
1472 */
1473
1474 /* Reset buffer status. */
1475 yyrestart( yyin );
1476
1477 /*FALLTHROUGH*/
1478
1479 case EOB_ACT_END_OF_FILE:
1480 {
1481 if ( yywrap( ) )
1482 return 0;
1483
1484 if ( ! (yy_did_buffer_switch_on_eof) )
1485 YY_NEW_FILE;
1486#ifdef __cplusplus
1487 return yyinput();
1488#else
1489 return input();
1490#endif
1491 }
1492
1493 case EOB_ACT_CONTINUE_SCAN:
1494 (yy_c_buf_p) = (yytext_ptr) + offset;
1495 break;
1496 }
1497 }
1498 }
1499
1500 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1501 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1502 (yy_hold_char) = *++(yy_c_buf_p);
1503
1504 return c;
1505}
1506#endif /* ifndef YY_NO_INPUT */
1507
1513 void yyrestart (FILE * input_file )
1514{
1515
1516 if ( ! YY_CURRENT_BUFFER ){
1517 yyensure_buffer_stack ();
1518 YY_CURRENT_BUFFER_LVALUE =
1519 yy_create_buffer( yyin, YY_BUF_SIZE );
1520 }
1521
1522 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1523 yy_load_buffer_state( );
1524}
1525
1530 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1531{
1532
1533 /* TODO. We should be able to replace this entire function body
1534 * with
1535 * yypop_buffer_state();
1536 * yypush_buffer_state(new_buffer);
1537 */
1538 yyensure_buffer_stack ();
1539 if ( YY_CURRENT_BUFFER == new_buffer )
1540 return;
1541
1542 if ( YY_CURRENT_BUFFER )
1543 {
1544 /* Flush out information for old buffer. */
1545 *(yy_c_buf_p) = (yy_hold_char);
1546 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1547 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1548 }
1549
1550 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1551 yy_load_buffer_state( );
1552
1553 /* We don't actually know whether we did this switch during
1554 * EOF (yywrap()) processing, but the only time this flag
1555 * is looked at is after yywrap() is called, so it's safe
1556 * to go ahead and always set it.
1557 */
1558 (yy_did_buffer_switch_on_eof) = 1;
1559}
1560
1561static void yy_load_buffer_state (void)
1562{
1563 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1564 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1565 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1566 (yy_hold_char) = *(yy_c_buf_p);
1567}
1568
1575 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1576{
1578
1579 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1580 if ( ! b )
1581 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1582
1583 b->yy_buf_size = size;
1584
1585 /* yy_ch_buf has to be 2 characters longer than the size given because
1586 * we need to put in 2 end-of-buffer characters.
1587 */
1588 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1589 if ( ! b->yy_ch_buf )
1590 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1591
1592 b->yy_is_our_buffer = 1;
1593
1594 yy_init_buffer( b, file );
1595
1596 return b;
1597}
1598
1603 void yy_delete_buffer (YY_BUFFER_STATE b )
1604{
1605
1606 if ( ! b )
1607 return;
1608
1609 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1610 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1611
1612 if ( b->yy_is_our_buffer )
1613 yyfree( (void *) b->yy_ch_buf );
1614
1615 yyfree( (void *) b );
1616}
1617
1618/* Initializes or reinitializes a buffer.
1619 * This function is sometimes called more than once on the same buffer,
1620 * such as during a yyrestart() or at EOF.
1621 */
1622 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1623
1624{
1625 int oerrno = errno;
1626
1627 yy_flush_buffer( b );
1628
1629 b->yy_input_file = file;
1630 b->yy_fill_buffer = 1;
1631
1632 /* If b is the current buffer, then yy_init_buffer was _probably_
1633 * called from yyrestart() or through yy_get_next_buffer.
1634 * In that case, we don't want to reset the lineno or column.
1635 */
1636 if (b != YY_CURRENT_BUFFER){
1637 b->yy_bs_lineno = 1;
1638 b->yy_bs_column = 0;
1639 }
1640
1641 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1642
1643 errno = oerrno;
1644}
1645
1650 void yy_flush_buffer (YY_BUFFER_STATE b )
1651{
1652 if ( ! b )
1653 return;
1654
1655 b->yy_n_chars = 0;
1656
1657 /* We always need two end-of-buffer characters. The first causes
1658 * a transition to the end-of-buffer state. The second causes
1659 * a jam in that state.
1660 */
1661 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1662 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1663
1664 b->yy_buf_pos = &b->yy_ch_buf[0];
1665
1666 b->yy_at_bol = 1;
1667 b->yy_buffer_status = YY_BUFFER_NEW;
1668
1669 if ( b == YY_CURRENT_BUFFER )
1670 yy_load_buffer_state( );
1671}
1672
1679void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1680{
1681 if (new_buffer == NULL)
1682 return;
1683
1684 yyensure_buffer_stack();
1685
1686 /* This block is copied from yy_switch_to_buffer. */
1687 if ( YY_CURRENT_BUFFER )
1688 {
1689 /* Flush out information for old buffer. */
1690 *(yy_c_buf_p) = (yy_hold_char);
1691 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1692 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1693 }
1694
1695 /* Only push if top exists. Otherwise, replace top. */
1696 if (YY_CURRENT_BUFFER)
1698 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1699
1700 /* copied from yy_switch_to_buffer. */
1701 yy_load_buffer_state( );
1702 (yy_did_buffer_switch_on_eof) = 1;
1703}
1704
1709void yypop_buffer_state (void)
1710{
1711 if (!YY_CURRENT_BUFFER)
1712 return;
1713
1714 yy_delete_buffer(YY_CURRENT_BUFFER );
1715 YY_CURRENT_BUFFER_LVALUE = NULL;
1716 if ((yy_buffer_stack_top) > 0)
1718
1719 if (YY_CURRENT_BUFFER) {
1720 yy_load_buffer_state( );
1721 (yy_did_buffer_switch_on_eof) = 1;
1722 }
1723}
1724
1725/* Allocates the stack if it does not exist.
1726 * Guarantees space for at least one push.
1727 */
1728static void yyensure_buffer_stack (void)
1729{
1730 yy_size_t num_to_alloc;
1731
1732 if (!(yy_buffer_stack)) {
1733
1734 /* First allocation is just for 2 elements, since we don't know if this
1735 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1736 * immediate realloc on the next call.
1737 */
1738 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1739 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1740 (num_to_alloc * sizeof(struct yy_buffer_state*)
1741 );
1742 if ( ! (yy_buffer_stack) )
1743 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1744
1745 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1746
1747 (yy_buffer_stack_max) = num_to_alloc;
1748 (yy_buffer_stack_top) = 0;
1749 return;
1750 }
1751
1752 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1753
1754 /* Increase the buffer to prepare for a possible push. */
1755 yy_size_t grow_size = 8 /* arbitrary grow size */;
1756
1757 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1758 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1759 ((yy_buffer_stack),
1760 num_to_alloc * sizeof(struct yy_buffer_state*)
1761 );
1762 if ( ! (yy_buffer_stack) )
1763 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1764
1765 /* zero only the new slots.*/
1766 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1767 (yy_buffer_stack_max) = num_to_alloc;
1768 }
1769}
1770
1777YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1778{
1780
1781 if ( size < 2 ||
1782 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1783 base[size-1] != YY_END_OF_BUFFER_CHAR )
1784 /* They forgot to leave room for the EOB's. */
1785 return NULL;
1786
1787 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1788 if ( ! b )
1789 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1790
1791 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1792 b->yy_buf_pos = b->yy_ch_buf = base;
1793 b->yy_is_our_buffer = 0;
1794 b->yy_input_file = NULL;
1795 b->yy_n_chars = b->yy_buf_size;
1796 b->yy_is_interactive = 0;
1797 b->yy_at_bol = 1;
1798 b->yy_fill_buffer = 0;
1799 b->yy_buffer_status = YY_BUFFER_NEW;
1800
1801 yy_switch_to_buffer( b );
1802
1803 return b;
1804}
1805
1814YY_BUFFER_STATE yy_scan_string (const char * yystr )
1815{
1816
1817 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1818}
1819
1827YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1828{
1830 char *buf;
1831 yy_size_t n;
1832 int i;
1833
1834 /* Get memory for full buffer, including space for trailing EOB's. */
1835 n = (yy_size_t) (_yybytes_len + 2);
1836 buf = (char *) yyalloc( n );
1837 if ( ! buf )
1838 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1839
1840 for ( i = 0; i < _yybytes_len; ++i )
1841 buf[i] = yybytes[i];
1842
1843 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1844
1845 b = yy_scan_buffer( buf, n );
1846 if ( ! b )
1847 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1848
1849 /* It's okay to grow etc. this buffer, and we should throw it
1850 * away when we're done.
1851 */
1852 b->yy_is_our_buffer = 1;
1853
1854 return b;
1855}
1856
1857#ifndef YY_EXIT_FAILURE
1858#define YY_EXIT_FAILURE 2
1859#endif
1860
1861static void yynoreturn yy_fatal_error (const char* msg )
1862{
1863 fprintf( stderr, "%s\n", msg );
1864 exit( YY_EXIT_FAILURE );
1865}
1866
1867/* Redefine yyless() so it works in section 3 code. */
1868
1869#undef yyless
1870#define yyless(n) \
1871 do \
1872 { \
1873 /* Undo effects of setting up yytext. */ \
1874 int yyless_macro_arg = (n); \
1875 YY_LESS_LINENO(yyless_macro_arg);\
1876 yytext[yyleng] = (yy_hold_char); \
1877 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1878 (yy_hold_char) = *(yy_c_buf_p); \
1879 *(yy_c_buf_p) = '\0'; \
1880 yyleng = yyless_macro_arg; \
1881 } \
1882 while ( 0 )
1883
1884/* Accessor methods (get/set functions) to struct members. */
1885
1889int yyget_lineno (void)
1890{
1891
1892 return yylineno;
1893}
1894
1898FILE *yyget_in (void)
1899{
1900 return yyin;
1901}
1902
1906FILE *yyget_out (void)
1907{
1908 return yyout;
1909}
1910
1914int yyget_leng (void)
1915{
1916 return yyleng;
1917}
1918
1923char *yyget_text (void)
1924{
1925 return yytext;
1926}
1927
1932void yyset_lineno (int _line_number )
1933{
1934
1935 yylineno = _line_number;
1936}
1937
1944void yyset_in (FILE * _in_str )
1945{
1946 yyin = _in_str ;
1947}
1948
1949void yyset_out (FILE * _out_str )
1950{
1951 yyout = _out_str ;
1952}
1953
1954int yyget_debug (void)
1955{
1956 return yy_flex_debug;
1957}
1958
1959void yyset_debug (int _bdebug )
1960{
1961 yy_flex_debug = _bdebug ;
1962}
1963
1964static int yy_init_globals (void)
1965{
1966 /* Initialization is the same as for the non-reentrant scanner.
1967 * This function is called from yylex_destroy(), so don't allocate here.
1968 */
1969
1970 (yy_buffer_stack) = NULL;
1971 (yy_buffer_stack_top) = 0;
1972 (yy_buffer_stack_max) = 0;
1973 (yy_c_buf_p) = NULL;
1974 (yy_init) = 0;
1975 (yy_start) = 0;
1976
1977/* Defined in main.c */
1978#ifdef YY_STDINIT
1979 yyin = stdin;
1980 yyout = stdout;
1981#else
1982 yyin = NULL;
1983 yyout = NULL;
1984#endif
1985
1986 /* For future reference: Set errno on error, since we are called by
1987 * yylex_init()
1988 */
1989 return 0;
1990}
1991
1992/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1993int yylex_destroy (void)
1994{
1995
1996 /* Pop the buffer stack, destroying each element. */
1997 while(YY_CURRENT_BUFFER){
1998 yy_delete_buffer( YY_CURRENT_BUFFER );
1999 YY_CURRENT_BUFFER_LVALUE = NULL;
2000 yypop_buffer_state();
2001 }
2002
2003 /* Destroy the stack itself. */
2004 yyfree((yy_buffer_stack) );
2005 (yy_buffer_stack) = NULL;
2006
2007 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2008 * yylex() is called, initialization will occur. */
2009 yy_init_globals( );
2010
2011 return 0;
2012}
2013
2014/*
2015 * Internal utility routines.
2016 */
2017
2018#ifndef yytext_ptr
2019static void yy_flex_strncpy (char* s1, const char * s2, int n )
2020{
2021
2022 int i;
2023 for ( i = 0; i < n; ++i )
2024 s1[i] = s2[i];
2025}
2026#endif
2027
2028#ifdef YY_NEED_STRLEN
2029static int yy_flex_strlen (const char * s )
2030{
2031 int n;
2032 for ( n = 0; s[n]; ++n )
2033 ;
2034
2035 return n;
2036}
2037#endif
2038
2039void *yyalloc (yy_size_t size )
2040{
2041 return malloc(size);
2042}
2043
2044void *yyrealloc (void * ptr, yy_size_t size )
2045{
2046
2047 /* The cast to (char *) in the following accommodates both
2048 * implementations that use char* generic pointers, and those
2049 * that use void* generic pointers. It works with the latter
2050 * because both ANSI C and C++ allow castless assignment from
2051 * any pointer type to void*, and deal with argument conversions
2052 * as though doing an assignment.
2053 */
2054 return realloc(ptr, size);
2055}
2056
2057void yyfree (void * ptr )
2058{
2059 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2060}
2061
2062#define YYTABLES_NAME "yytables"
2063
2064#line 77 "tokenparser.l"
2065
2066
2067
2068static void eval_key(char *pcToken, list_t *list_key)
2069{
2070 struct bundleElt *elt;
2071 int r;
2072 size_t len;
2073
2074 /* create a new list element */
2075 elt = malloc(sizeof(*elt));
2076 assert(elt);
2077
2078 /* <key>foobar</key>
2079 * 012345 : 5 is the first key character index */
2080
2081 /* calculate the argument length */
2082 for (len=0; pcToken[len+5] != '<'; len++)
2083 ;
2084 len++; /* final NULL byte */
2085
2086 elt->key = malloc(len);
2087 memcpy(elt->key, &pcToken[5], len-1);
2088 elt->key[len-1] = '\0';
2089
2090 r = list_init(&elt->values);
2091 assert(r >= 0);
2092 (void)r;
2093
2094 /* add the key/values */
2095 list_append(list_key, elt);
2096
2097 /* set the list to store the values */
2098 ListValues = &elt->values;
2099}
2100
2101static void eval_value(char *pcToken, list_t *list_values)
2102{
2103 int r;
2104 size_t len;
2105 char *value;
2106 char *amp;
2107
2108 /* <string>foobar</string>
2109 * 012345678 : 8 is the first string character index */
2110
2111 /* calculate the argument length */
2112 for (len=0; pcToken[len+8] != '<'; len++)
2113 ;
2114 len++; /* final NULL byte */
2115
2116 value = malloc(len);
2117 assert(value);
2118
2119 memcpy(value, &pcToken[8], len-1);
2120 value[len-1] = '\0';
2121
2122 /* for all &amp; in the string */
2123 amp = value;
2124 while ((amp = strstr(amp, "&amp;")) != NULL)
2125 {
2126 char *p;
2127
2128 /* just skip "amp;" substring (4 letters) */
2129 for (p = amp+1; *(p+4); p++)
2130 {
2131 *p = *(p+4);
2132 }
2133 /* terminate the now shorter string */
2134 *p = '\0';
2135
2136 /* skip the & and continue */
2137 amp++;
2138 }
2139
2140 r = list_append(list_values, value);
2141 assert(r >= 0);
2142 (void)r;
2143}
2144
2145void tperrorCheck (char *token_error)
2146{
2147 (void)token_error;
2148}
2149
2160int LTPBundleFindValueWithKey(list_t *l, const char *key, list_t **values)
2161{
2162 unsigned int i;
2163 int ret = 1;
2164
2165 for (i=0; i < list_size(l); i++)
2166 {
2167 struct bundleElt *elt;
2168
2169 elt = list_get_at(l, i);
2170 assert(elt);
2171
2172 if (0 == strcmp(elt->key, key))
2173 {
2174 *values = &elt->values;
2175 ret = 0;
2176 }
2177 }
2178
2179 return ret;
2180}
2181
2182
2191int bundleParse(const char *fileName, list_t *l)
2192{
2193 FILE *file = NULL;
2194 int r;
2195#ifndef NDEBUG
2196 int i;
2197#endif
2198
2199 file = fopen(fileName, "r");
2200 if (!file)
2201 {
2202 Log3(PCSC_LOG_CRITICAL, "Could not open bundle file %s: %s",
2203 fileName, strerror(errno));
2204 return 1;
2205 }
2206
2207 r = list_init(l);
2208 assert(r >= 0);
2209 (void)r;
2210
2211 ListKeys = l;
2212 yyin = file;
2213
2214 do
2215 {
2216 (void)yylex();
2217 } while (!feof(file));
2218 yylex_destroy();
2219
2220 (void)fclose(file);
2221
2222#ifndef NDEBUG
2223 printf("size: %d\n", list_size(l));
2224 for (i=0; i < list_size(l); i++)
2225 {
2226 struct bundleElt *elt;
2227 unsigned int j;
2228
2229 elt = list_get_at(l, i);
2230 assert(elt);
2231 printf("Key: %s\n", elt->key);
2232
2233 for (j=0; j<list_size(&elt->values); j++)
2234 {
2235 char *v = list_get_at(&elt->values, j);
2236 printf(" value: %s\n", v);
2237 }
2238 }
2239#endif
2240
2241 return 0;
2242}
2243
2249void bundleRelease(list_t *l)
2250{
2251 unsigned int i;
2252
2253 for (i=0; i < list_size(l); i++)
2254 {
2255 struct bundleElt *elt;
2256 unsigned int j;
2257
2258 elt = list_get_at(l, i);
2259 assert(elt);
2260
2261 /* free all the values */
2262 for (j=0; j<list_size(&elt->values); j++)
2263 free(list_get_at(&elt->values, j));
2264 list_destroy(&elt->values);
2265
2266 /* free the key */
2267 free(elt->key);
2268 free(elt);
2269 }
2270
2271 list_destroy(l);
2272}
2273
This handles debugging.
Reads lexical config files and updates database.
list object
Definition simclist.h:181
int yy_bs_lineno
The line count.
Definition configfile.c:216
int yy_bs_column
The column count.
Definition configfile.c:217
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
static size_t yy_buffer_stack_max
capacity of stack.
static size_t yy_buffer_stack_top
index of top of stack.