Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

tokenparser.c File Reference

provides LTPBundleFindValueWithKey() function on non-MacOS X platforms. More...

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "config.h"
#include "misc.h"
#include "debug.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

Defines

#define YY_INT_ALIGNED   short int
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION   2
#define YY_FLEX_MINOR_VERSION   5
#define YY_FLEX_SUBMINOR_VERSION   33
#define FLEX_BETA
#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 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_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()   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 INITIAL   0
#define YY_EXTRA_TYPE   void *
#define YY_READ_BUF_SIZE   8192
#define ECHO   (void) fwrite( tptext, tpleng, 1, tpout )
#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_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 yy_buffer_state * YY_BUFFER_STATE
typedef unsigned int yy_size_t
typedef unsigned char YY_CHAR
typedef int yy_state_type

Functions

void tprestart (FILE *input_file)
void tp_switch_to_buffer (YY_BUFFER_STATE new_buffer)
YY_BUFFER_STATE tp_create_buffer (FILE *file, int size)
void tp_delete_buffer (YY_BUFFER_STATE b)
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...

void tpensure_buffer_stack (void)
void tp_load_buffer_state (void)
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 *yy_str)
 Setup the input buffer state to scan a string. More...

YY_BUFFER_STATE tp_scan_bytes (yyconst char *bytes, int 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 *)
yy_state_type yy_get_previous_state (void)
yy_state_type yy_try_NUL_trans (yy_state_type current_state)
int yy_get_next_buffer (void)
void yy_fatal_error (yyconst char msg[])
void tpevalToken (char *pcToken, int tokType)
void tperrorCheck (char *pcToken_error)
int yy_init_globals (void)
int input (void)
int tplex (void)
void yy_fatal_error (yyconst char *msg)
int tpget_lineno (void)
 Get the current line number.

FILE * tpget_in (void)
 Get the input stream.

FILE * tpget_out (void)
 Get the output stream.

int tpget_leng (void)
 Get the length of the current token.

char * tpget_text (void)
 Get the current token.

void tpset_lineno (int line_number)
 Set the current line number. More...

void tpset_in (FILE *in_str)
 Set the input stream. More...

void tpset_out (FILE *out_str)
int tpget_debug (void)
void tpset_debug (int bdebug)
int tplex_destroy (void)
int LTPBundleFindValueWithKey (const char *fileName, const char *tokenKey, char *tokenValue, int tokenIndice)
 Find a key in a configuration file. More...


Variables

int tpleng
FILE * tpin = (FILE *) 0
FILE * tpout = (FILE *) 0
size_t yy_buffer_stack_top = 0
 index of top of stack.

size_t yy_buffer_stack_max = 0
 capacity of stack.

YY_BUFFER_STATE * yy_buffer_stack = 0
 Stack as an array.

char yy_hold_char
int yy_n_chars
char * yy_c_buf_p = (char *) 0
int yy_init = 0
int yy_start = 0
int yy_did_buffer_switch_on_eof
int tplineno = 1
char * tptext
yyconst flex_int16_t yy_accept [39]
yyconst flex_int32_t yy_ec [256]
yyconst flex_int32_t yy_meta [21]
yyconst flex_int16_t yy_base [43]
yyconst flex_int16_t yy_def [43]
yyconst flex_int16_t yy_nxt [71]
yyconst flex_int16_t yy_chk [71]
yy_state_type yy_last_accepting_state
char * yy_last_accepting_cpos
int tp_flex_debug = 0
const char * pcDesiredKey = NULL
char pcKey [TOKEN_MAX_KEY_SIZE]
char pcValue [TOKEN_MAX_VALUE_SIZE]
char pcFinValue [TOKEN_MAX_VALUE_SIZE]
int valueIndex = 0
int desiredIndex = 0


Detailed Description

provides LTPBundleFindValueWithKey() function on non-MacOS X platforms.

Definition in file tokenparser.c.


Define Documentation

#define YY_CURRENT_BUFFER
 

Value:

( (yy_buffer_stack) \
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
                          : NULL)

Definition at line 266 of file tokenparser.c.

#define YY_DO_BEFORE_ACTION
 

Value:

(yytext_ptr) = yy_bp; \
    tpleng = (size_t) (yy_cp - yy_bp); \
    (yy_hold_char) = *yy_cp; \
    *yy_cp = '\0'; \
    (yy_c_buf_p) = yy_cp;

Definition at line 362 of file tokenparser.c.

#define YY_INPUT buf,
result,
max_size   
 

Value:

if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
        { \
        int c = '*'; \
        size_t n; \
        for ( n = 0; n < max_size && \
                 (c = getc( tpin )) != EOF && c != '\n'; ++n ) \
            buf[n] = (char) c; \
        if ( c == '\n' ) \
            buf[n++] = (char) c; \
        if ( c == EOF && ferror( tpin ) ) \
            YY_FATAL_ERROR( "input in flex scanner failed" ); \
        result = n; \
        } \
    else \
        { \
        errno=0; \
        while ( (result = fread(buf, 1, max_size, tpin))==0 && ferror(tpin)) \
            { \
            if( errno != EINTR) \
                { \
                YY_FATAL_ERROR( "input in flex scanner failed" ); \
                break; \
                } \
            errno=0; \
            clearerr(tpin); \
            } \
        }\
\

Definition at line 583 of file tokenparser.c.

#define yy_set_bol at_bol   
 

Value:

{ \
    if ( ! YY_CURRENT_BUFFER ){\
        tpensure_buffer_stack (); \
        YY_CURRENT_BUFFER_LVALUE =    \
            tp_create_buffer(tpin,YY_BUF_SIZE ); \
    } \
    YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
    }

Definition at line 324 of file tokenparser.c.

#define yy_set_interactive is_interactive   
 

Value:

{ \
    if ( ! YY_CURRENT_BUFFER ){ \
        tpensure_buffer_stack (); \
        YY_CURRENT_BUFFER_LVALUE =    \
            tp_create_buffer(tpin,YY_BUF_SIZE ); \
    } \
    YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
    }

Definition at line 314 of file tokenparser.c.

#define yyless  
 

Value:

do \
        { \
          \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
        tptext[tpleng] = (yy_hold_char); \
        (yy_c_buf_p) = tptext + yyless_macro_arg; \
        (yy_hold_char) = *(yy_c_buf_p); \
        *(yy_c_buf_p) = '\0'; \
        tpleng = yyless_macro_arg; \
        } \
    while ( 0 )

Definition at line 1548 of file tokenparser.c.

#define yyless  
 

Value:

do \
        { \
          \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
        *yy_cp = (yy_hold_char); \
        YY_RESTORE_YY_MORE_OFFSET \
        (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
        YY_DO_BEFORE_ACTION;   \
        } \
    while ( 0 )

Definition at line 1548 of file tokenparser.c.


Function Documentation

int LTPBundleFindValueWithKey const char *    fileName,
const char *    tokenKey,
char *    tokenValue,
int    tokenIndice
 

Find a key in a configuration file.

Parameters:
fileName  file name
tokenKey  key value
am[out] tokenValue token value (if key found)
Parameters:
tokenIndice  indice of the desired key
Return values:
-1  configuration file not found
0  OK
1  key not found

Definition at line 1802 of file tokenparser.c.

void tp_flush_buffer YY_BUFFER_STATE    b
 

Discard all buffered characters.

On the next scan, YY_INPUT will be called.

Parameters:
b  the buffer state to be flushed, usually YY_CURRENT_BUFFER.

Definition at line 1332 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.

Parameters:
base  the character buffer
size  the size in bytes of the character buffer
Returns:
the newly allocated buffer state object.

Definition at line 1455 of file tokenparser.c.

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.

Parameters:
bytes  the byte buffer to scan
len  the number of bytes in the buffer pointed to by bytes.
Returns:
the newly allocated buffer state object.

Definition at line 1505 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.

Parameters:
yystr  a NUL-terminated string to scan
Returns:
the newly allocated buffer state object.
Note:
If you want to scan bytes that may contain NUL values, then use tp_scan_bytes() instead.

Definition at line 1492 of file tokenparser.c.

References tp_scan_bytes.

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 1391 of file tokenparser.c.

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.

Parameters:
new_buffer  The new state.

Definition at line 1361 of file tokenparser.c.

void tpset_in FILE *    in_str
 

Set the input stream.

This does not discard the current input buffer.

Parameters:
in_str  A readable stream.
See also:
tp_switch_to_buffer

Definition at line 1622 of file tokenparser.c.

void tpset_lineno int    line_number
 

Set the current line number.

Parameters:
line_number 

Definition at line 1610 of file tokenparser.c.


Variable Documentation

yyconst flex_int16_t yy_accept[39] [static]
 

Initial value:

    {   0,
        0,    0,    8,    6,    4,    2,    1,    6,    1,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    3,
        0,    0,    0,    0,    0,    0,    5,    0
    }

Definition at line 378 of file tokenparser.c.

yyconst flex_int16_t yy_base[43] [static]
 

Initial value:

    {   0,
        0,    7,   49,   50,   50,   50,    0,    1,    0,   36,
       28,   26,   28,   35,   29,    0,   26,   33,   27,   33,
       29,   22,    0,   24,   27,   14,   27,   23,   13,   50,
       10,    9,    4,    1,    0,    2,   50,   50,   19,   23,
        2,   26
    }

Definition at line 424 of file tokenparser.c.

yyconst flex_int16_t yy_chk[71] [static]
 

Initial value:

    {   0,
        0,    1,    1,   41,    1,    0,    0,    1,    2,    2,
       36,    2,   35,    0,    2,    8,   34,   33,    8,   39,
       39,   39,   39,   40,   40,   32,   40,   42,   31,   42,
       29,   28,   27,   26,   25,   24,   22,   21,   20,   19,
       18,   17,   15,   14,   13,   12,   11,   10,    3,   38,
       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
       38,   38,   38,   38,   38,   38,   38,   38,   38,   38
    }

Definition at line 453 of file tokenparser.c.

yyconst flex_int16_t yy_def[43] [static]
 

Initial value:

    {   0,
       39,   39,   38,   38,   38,   38,   40,   38,   40,   38,
       38,   38,   38,   38,   38,   41,   38,   41,   38,   38,
       38,   38,   42,   38,   42,   38,   38,   38,   38,   38,
       38,   38,   38,   38,   38,   38,   38,    0,   38,   38,
       38,   38
    }

Definition at line 433 of file tokenparser.c.

yyconst flex_int32_t yy_meta[21] [static]
 

Initial value:

    {   0,
        1,    2,    3,    4,    4,    4,    2,    1,    1,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2
    }

Definition at line 418 of file tokenparser.c.

yyconst flex_int16_t yy_nxt[71] [static]
 

Initial value:

    {   0,
       38,    5,    6,   18,    7,   38,   38,    8,    5,    6,
       37,    7,   36,   38,    8,   10,   35,   34,   11,    4,
        4,    4,    4,    9,    9,   33,    9,   25,   32,   25,
       31,   30,   29,   28,   27,   26,   24,   23,   22,   21,
       20,   19,   17,   16,   15,   14,   13,   12,   38,    3,
       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
       38,   38,   38,   38,   38,   38,   38,   38,   38,   38
    }

Definition at line 442 of file tokenparser.c.


Generated on Wed Apr 2 13:59:23 2008 for pcsc-lite by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002