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