pcsc-lite
1.8.8
|
provides parsing functions for Info.plist files platforms More...
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "config.h"
#include <assert.h>
#include "simclist.h"
#include "debuglog.h"
#include "parser.h"
#include "strlcpycat.h"
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | yy_buffer_state |
struct | yy_trans_info |
Macros | |
#define | YY_INT_ALIGNED short int |
#define | yy_create_buffer tp_create_buffer |
#define | yy_delete_buffer tp_delete_buffer |
#define | yy_flex_debug tp_flex_debug |
#define | yy_init_buffer tp_init_buffer |
#define | yy_flush_buffer tp_flush_buffer |
#define | yy_load_buffer_state tp_load_buffer_state |
#define | yy_switch_to_buffer tp_switch_to_buffer |
#define | yyin tpin |
#define | yyleng tpleng |
#define | yylex tplex |
#define | yylineno tplineno |
#define | yyout tpout |
#define | yyrestart tprestart |
#define | yytext tptext |
#define | yywrap tpwrap |
#define | yyalloc tpalloc |
#define | yyrealloc tprealloc |
#define | yyfree tpfree |
#define | FLEX_SCANNER |
#define | YY_FLEX_MAJOR_VERSION 2 |
#define | YY_FLEX_MINOR_VERSION 5 |
#define | YY_FLEX_SUBMINOR_VERSION 35 |
#define | FLEX_BETA |
#define | FLEXINT_H |
#define | INT8_MIN (-128) |
#define | INT16_MIN (-32767-1) |
#define | INT32_MIN (-2147483647-1) |
#define | INT8_MAX (127) |
#define | INT16_MAX (32767) |
#define | INT32_MAX (2147483647) |
#define | UINT8_MAX (255U) |
#define | UINT16_MAX (65535U) |
#define | UINT32_MAX (4294967295U) |
#define | yyconst |
#define | YY_NULL 0 |
#define | YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
#define | BEGIN (yy_start) = 1 + 2 * |
#define | YY_START (((yy_start) - 1) / 2) |
#define | YYSTATE YY_START |
#define | YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
#define | YY_NEW_FILE tprestart(tpin ) |
#define | YY_END_OF_BUFFER_CHAR 0 |
#define | YY_BUF_SIZE 16384 |
#define | YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
#define | YY_TYPEDEF_YY_BUFFER_STATE |
#define | EOB_ACT_CONTINUE_SCAN 0 |
#define | EOB_ACT_END_OF_FILE 1 |
#define | EOB_ACT_LAST_MATCH 2 |
#define | YY_LESS_LINENO(n) |
#define | yyless(n) |
#define | unput(c) yyunput( c, (yytext_ptr) ) |
#define | YY_TYPEDEF_YY_SIZE_T |
#define | YY_STRUCT_YY_BUFFER_STATE |
#define | YY_BUFFER_NEW 0 |
#define | YY_BUFFER_NORMAL 1 |
#define | YY_BUFFER_EOF_PENDING 2 |
#define | YY_CURRENT_BUFFER |
#define | YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
#define | YY_FLUSH_BUFFER tp_flush_buffer(YY_CURRENT_BUFFER ) |
#define | yy_new_buffer tp_create_buffer |
#define | yy_set_interactive(is_interactive) |
#define | yy_set_bol(at_bol) |
#define | YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
#define | tpwrap(n) 1 |
#define | YY_SKIP_YYWRAP |
#define | yytext_ptr tptext |
#define | YY_DO_BEFORE_ACTION |
#define | YY_NUM_RULES 7 |
#define | YY_END_OF_BUFFER 8 |
#define | REJECT reject_used_but_not_detected |
#define | yymore() yymore_used_but_not_detected |
#define | YY_MORE_ADJ 0 |
#define | YY_RESTORE_YY_MORE_OFFSET |
#define | NDEBUG |
#define | YY_NO_INPUT 1 |
#define | INITIAL 0 |
#define | YY_EXTRA_TYPE void * |
#define | YY_READ_BUF_SIZE 8192 |
#define | ECHO do { if (fwrite( tptext, tpleng, 1, tpout )) {} } while (0) |
#define | YY_INPUT(buf, result, max_size) |
#define | yyterminate() return YY_NULL |
#define | YY_START_STACK_INCR 25 |
#define | YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
#define | YY_DECL_IS_OURS 1 |
#define | YY_DECL int tplex (void) |
#define | YY_USER_ACTION |
#define | YY_BREAK break; |
#define | YY_RULE_SETUP YY_USER_ACTION |
#define | YY_EXIT_FAILURE 2 |
#define | yyless(n) |
#define | YYTABLES_NAME "yytables" |
Typedefs | |
typedef signed char | flex_int8_t |
typedef short int | flex_int16_t |
typedef int | flex_int32_t |
typedef unsigned char | flex_uint8_t |
typedef unsigned short int | flex_uint16_t |
typedef unsigned int | flex_uint32_t |
typedef struct yy_buffer_state * | YY_BUFFER_STATE |
typedef size_t | yy_size_t |
typedef unsigned char | YY_CHAR |
typedef int | yy_state_type |
Functions | |
void | tprestart (FILE *input_file) |
Immediately switch to a different input stream. More... | |
void | tp_switch_to_buffer (YY_BUFFER_STATE new_buffer) |
Switch to a different input buffer. More... | |
YY_BUFFER_STATE | tp_create_buffer (FILE *file, int size) |
Allocate and initialize an input buffer state. More... | |
void | tp_delete_buffer (YY_BUFFER_STATE b) |
Destroy the buffer. More... | |
void | tp_flush_buffer (YY_BUFFER_STATE b) |
Discard all buffered characters. More... | |
void | tppush_buffer_state (YY_BUFFER_STATE new_buffer) |
Pushes the new state onto the stack. More... | |
void | tppop_buffer_state (void) |
Removes and deletes the top of the stack, if present. More... | |
static void | tpensure_buffer_stack (void) |
static void | tp_load_buffer_state (void) |
static void | tp_init_buffer (YY_BUFFER_STATE b, FILE *file) |
YY_BUFFER_STATE | tp_scan_buffer (char *base, yy_size_t size) |
Setup the input buffer state to scan directly from a user-specified character buffer. More... | |
YY_BUFFER_STATE | tp_scan_string (yyconst char *yystr) |
Setup the input buffer state to scan a string. More... | |
YY_BUFFER_STATE | tp_scan_bytes (yyconst char *yybytes, int _yybytes_len) |
Setup the input buffer state to scan the given bytes. More... | |
void * | tpalloc (yy_size_t) |
void * | tprealloc (void *, yy_size_t) |
void | tpfree (void *) |
static yy_state_type | yy_get_previous_state (void) |
static yy_state_type | yy_try_NUL_trans (yy_state_type current_state) |
static int | yy_get_next_buffer (void) |
static void | yy_fatal_error (yyconst char msg[]) |
static void | eval_key (char *pcToken, list_t *list_key) |
static void | eval_value (char *pcToken, list_t *list_values) |
void | tperrorCheck (char *pcToken_error) |
static int | yy_init_globals (void) |
int | tplex_destroy (void) |
int | tpget_debug (void) |
void | tpset_debug (int debug_flag) |
YY_EXTRA_TYPE | tpget_extra (void) |
void | tpset_extra (YY_EXTRA_TYPE user_defined) |
FILE * | tpget_in (void) |
Get the input stream. | |
void | tpset_in (FILE *in_str) |
Set the input stream. More... | |
FILE * | tpget_out (void) |
Get the output stream. | |
void | tpset_out (FILE *out_str) |
int | tpget_leng (void) |
Get the length of the current token. | |
char * | tpget_text (void) |
Get the current token. | |
int | tpget_lineno (void) |
Get the current line number. | |
void | tpset_lineno (int line_number) |
Set the current line number. More... | |
int | tplex (void) |
if (!YY_CURRENT_BUFFER) | |
while (1) | |
int | isatty (int) |
static void | yy_fatal_error (yyconst char *msg) |
int | LTPBundleFindValueWithKey (list_t *l, const char *key, list_t **values) |
Find an optional key in a configuration file No error is logged if the key is not found. More... | |
int | bundleParse (const char *fileName, list_t *l) |
Parse a Info.plist file and file a list. More... | |
void | bundleRelease (list_t *l) |
Free the list created by bundleParse() More... | |
Variables | |
int | tpleng |
FILE * | tpin = (FILE *) 0 |
FILE * | tpout = (FILE *) 0 |
static size_t | yy_buffer_stack_top = 0 |
index of top of stack. More... | |
static size_t | yy_buffer_stack_max = 0 |
capacity of stack. More... | |
static YY_BUFFER_STATE * | yy_buffer_stack = 0 |
Stack as an array. More... | |
static char | yy_hold_char |
static int | yy_n_chars |
static char * | yy_c_buf_p = (char *) 0 |
static int | yy_init = 0 |
static int | yy_start = 0 |
static int | yy_did_buffer_switch_on_eof |
int | tplineno = 1 |
char * | tptext |
static yyconst flex_int16_t | yy_accept [39] |
static yyconst flex_int32_t | yy_ec [256] |
static yyconst flex_int32_t | yy_meta [21] |
static yyconst flex_int16_t | yy_base [43] |
static yyconst flex_int16_t | yy_def [43] |
static yyconst flex_int16_t | yy_nxt [71] |
static yyconst flex_int16_t | yy_chk [71] |
static yy_state_type | yy_last_accepting_state |
static char * | yy_last_accepting_cpos |
int | tp_flex_debug = 0 |
static list_t * | ListKeys |
static list_t * | ListValues |
YY_DECL | |
The main scanner function which does all the work. More... | |
register char * | yy_cp |
register char * | yy_bp |
register int | yy_act |
provides parsing functions for Info.plist files platforms
Definition in file tokenparser.c.
#define YY_CURRENT_BUFFER |
Definition at line 290 of file tokenparser.c.
#define YY_DO_BEFORE_ACTION |
Definition at line 386 of file tokenparser.c.
#define YY_INPUT | ( | buf, | |
result, | |||
max_size | |||
) |
Definition at line 641 of file tokenparser.c.
#define yy_set_bol | ( | at_bol | ) |
Definition at line 348 of file tokenparser.c.
#define yy_set_interactive | ( | is_interactive | ) |
Definition at line 338 of file tokenparser.c.
#define yyless | ( | n | ) |
Definition at line 1618 of file tokenparser.c.
#define yyless | ( | n | ) |
Definition at line 1618 of file tokenparser.c.
int bundleParse | ( | const char * | fileName, |
list_t * | l | ||
) |
Parse a Info.plist file and file a list.
fileName | file name |
l | list containing the results |
-1 | configuration file not found |
0 | OK |
Definition at line 1936 of file tokenparser.c.
void bundleRelease | ( | list_t * | l | ) |
Free the list created by bundleParse()
l | list containing the results |
Definition at line 1993 of file tokenparser.c.
Find an optional key in a configuration file No error is logged if the key is not found.
l | list generated by bundleParse() | |
key | searched key | |
[out] | values | list of token value (if key found) |
0 | OK |
1 | key not found |
Definition at line 1905 of file tokenparser.c.
YY_BUFFER_STATE tp_create_buffer | ( | FILE * | file, |
int | size | ||
) |
Allocate and initialize an input buffer state.
file | A readable stream. |
size | The character buffer size in bytes. When in doubt, use YY_BUF_SIZE . |
Definition at line 1319 of file tokenparser.c.
Referenced by tprestart().
void tp_delete_buffer | ( | YY_BUFFER_STATE | b | ) |
Destroy the buffer.
b | a buffer created with tp_create_buffer() |
Definition at line 1347 of file tokenparser.c.
Referenced by tppop_buffer_state().
void tp_flush_buffer | ( | YY_BUFFER_STATE | b | ) |
Discard all buffered characters.
On the next scan, YY_INPUT will be called.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . |
Definition at line 1398 of file tokenparser.c.
YY_BUFFER_STATE tp_scan_buffer | ( | char * | base, |
yy_size_t | size | ||
) |
Setup the input buffer state to scan directly from a user-specified character buffer.
base | the character buffer |
size | the size in bytes of the character buffer |
Definition at line 1525 of file tokenparser.c.
References tp_switch_to_buffer().
Referenced by tp_scan_bytes().
YY_BUFFER_STATE tp_scan_bytes | ( | yyconst char * | yybytes, |
int | _yybytes_len | ||
) |
Setup the input buffer state to scan the given bytes.
The next call to tplex() will scan from a copy of bytes.
yybytes | the byte buffer to scan |
_yybytes_len | the number of bytes in the buffer pointed to by bytes. |
Definition at line 1575 of file tokenparser.c.
References tp_scan_buffer().
Referenced by tp_scan_string().
YY_BUFFER_STATE tp_scan_string | ( | yyconst char * | yystr | ) |
Setup the input buffer state to scan a string.
The next call to tplex() will scan from a copy of str.
yystr | a NUL-terminated string to scan |
Definition at line 1562 of file tokenparser.c.
References tp_scan_bytes().
void tp_switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer | ) |
Switch to a different input buffer.
new_buffer | The new input buffer. |
Definition at line 1274 of file tokenparser.c.
Referenced by tp_scan_buffer().
void tppop_buffer_state | ( | void | ) |
Removes and deletes the top of the stack, if present.
The next element becomes the new top.
Definition at line 1457 of file tokenparser.c.
References tp_delete_buffer(), and yy_buffer_stack_top.
void tppush_buffer_state | ( | YY_BUFFER_STATE | new_buffer | ) |
Pushes the new state onto the stack.
The new state becomes the current state. This function will allocate the stack if necessary.
new_buffer | The new state. |
Definition at line 1427 of file tokenparser.c.
References yy_buffer_stack_top.
void tprestart | ( | FILE * | input_file | ) |
Immediately switch to a different input stream.
input_file | A readable stream. |
INITIAL
. Definition at line 1257 of file tokenparser.c.
References tp_create_buffer().
void tpset_in | ( | FILE * | in_str | ) |
Set the input stream.
This does not discard the current input buffer.
in_str | A readable stream. |
Definition at line 1692 of file tokenparser.c.
void tpset_lineno | ( | int | line_number | ) |
|
static |
Definition at line 402 of file tokenparser.c.
|
static |
Definition at line 448 of file tokenparser.c.
|
static |
Stack as an array.
Definition at line 282 of file tokenparser.c.
|
static |
capacity of stack.
Definition at line 281 of file tokenparser.c.
|
static |
index of top of stack.
Definition at line 280 of file tokenparser.c.
Referenced by tppop_buffer_state(), and tppush_buffer_state().
|
static |
Definition at line 477 of file tokenparser.c.
YY_DECL |
The main scanner function which does all the work.
Definition at line 722 of file tokenparser.c.
|
static |
Definition at line 457 of file tokenparser.c.
|
static |
Definition at line 442 of file tokenparser.c.
|
static |
Definition at line 466 of file tokenparser.c.