Index: trunk/src/plug_footprint.c =================================================================== --- trunk/src/plug_footprint.c (revision 28500) +++ trunk/src/plug_footprint.c (revision 28501) @@ -114,27 +114,15 @@ return (char *) tagid; } -FILE *pcb_fp_fopen(const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx, pcb_data_t *dst) +FILE *pcb_fp_fopen(const pcb_conflist_t *path, const char *name, pcb_fp_fopen_ctx_t *fctx, pcb_data_t *dst) { + pcb_conf_listitem_t *ci; FILE *res = NULL; - if (strchr(path, ':') != NULL) { - char *tmp, *next, *curr; - curr = tmp = pcb_strdup(path); - while((res == NULL) && (curr != NULL)) { - next = strchr(curr, ':'); - if (next != NULL) { - *next= '\0'; - next++; - } - - PCB_HOOK_CALL(pcb_plug_fp_t, pcb_plug_fp_chain, fp_fopen, res, != NULL, (self, curr, name, fctx, dst)); - curr = next; - } - free(tmp); + for(ci = pcb_conflist_first((pcb_conflist_t *)path); ci != NULL; ci = pcb_conflist_next(ci)) { + const char *curr = ci->val.string[0]; + PCB_HOOK_CALL(pcb_plug_fp_t, pcb_plug_fp_chain, fp_fopen, res, != NULL, (self, curr, name, fctx, dst)); } - else - PCB_HOOK_CALL(pcb_plug_fp_t, pcb_plug_fp_chain, fp_fopen, res, != NULL, (self, path, name, fctx, dst)); return res; } @@ -371,11 +359,10 @@ * fp_fs_load_dir to put the footprints into PCB's internal * datastructures. */ -static int fp_read_lib_all_(const char *searchpath) +static int fp_read_lib_all_(const pcb_conflist_t *searchpath) { + pcb_conf_listitem_t *ci; char *toppath, toppath_[PCB_PATH_MAX + 1]; /* String holding abs path to top level library dir */ - char *libpaths; /* String holding list of library paths to search */ - char *p; /* Helper string used in iteration */ int n_footprints = 0; /* Running count of footprints found */ int res; @@ -382,8 +369,8 @@ /* Additional loop to allow for multiple 'newlib' style library directories * called out in Settings.LibraryTree */ - libpaths = pcb_strdup(searchpath); - for (p = strtok(libpaths, PCB_PATH_DELIMETER); p && *p; p = strtok(NULL, PCB_PATH_DELIMETER)) { + for(ci = pcb_conflist_first((pcb_conflist_t *)searchpath); ci != NULL; ci = pcb_conflist_next(ci)) { + const char *p = ci->val.string[0]; int silent_fail = 0; /* remove trailing path delimiter */ @@ -414,7 +401,6 @@ printf("Leaving ParseLibraryTree, found %d footprints.\n", n_footprints); #endif - free(libpaths); return n_footprints; } @@ -421,11 +407,6 @@ static gds_t fpds_paths; static int fpds_inited = 0; -const char *pcb_fp_default_search_path(void) -{ - return pcb_conf_concat_strlist(&conf_core.rc.library_search_paths, &fpds_paths, &fpds_inited, ':'); -} - int pcb_fp_host_uninit(void) { if (fpds_inited) @@ -440,7 +421,7 @@ /* List all footprint libraries. Then sort the whole * library. */ - if (fp_read_lib_all_(pcb_fp_default_search_path()) > 0 || resultFP != NULL) { + if (fp_read_lib_all_(&conf_core.rc.library_search_paths) > 0 || resultFP != NULL) { pcb_fp_sort_children(&pcb_library); return 0; } Index: trunk/src/plug_footprint.h =================================================================== --- trunk/src/plug_footprint.h (revision 28500) +++ trunk/src/plug_footprint.h (revision 28501) @@ -4,6 +4,7 @@ #include #include "vtlibrary.h" #include "data.h" +#include "conf.h" typedef struct pcb_plug_fp_s pcb_plug_fp_t; @@ -16,7 +17,7 @@ } pcb_fp_fopen_ctx_t; /* hook bindings, see below */ -FILE *pcb_fp_fopen(const char *path, const char *name, pcb_fp_fopen_ctx_t *fctx, pcb_data_t *dst); +FILE *pcb_fp_fopen(const pcb_conflist_t *path, const char *name, pcb_fp_fopen_ctx_t *fctx, pcb_data_t *dst); void pcb_fp_fclose(FILE * f, pcb_fp_fopen_ctx_t *fctx); /* duplicates the name and splits it into a basename and params; @@ -85,9 +86,6 @@ /* walk through all lib paths and build the library menu */ int pcb_fp_read_lib_all(void); - -const char *pcb_fp_default_search_path(void); - int pcb_fp_host_uninit(void); /* rescan/reload all footprints in the library cache */ Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 28500) +++ trunk/src/plug_io.c (revision 28501) @@ -250,7 +250,7 @@ FILE *f; pcb_fp_fopen_ctx_t fctx; - f = pcb_fp_fopen(pcb_fp_default_search_path(), Filename, &fctx, Ptr); + f = pcb_fp_fopen(&conf_core.rc.library_search_paths, Filename, &fctx, Ptr); if (f == PCB_FP_FOPEN_IN_DST) return 0; len = pcb_test_parse_all(f, Filename, fmt, PCB_IOT_FOOTPRINT, available, accepts, &accept_total, sizeof(available)/sizeof(available[0]), 0, 0); Index: trunk/src_plugins/diag/diag.c =================================================================== --- trunk/src_plugins/diag/diag.c (revision 28500) +++ trunk/src_plugins/diag/diag.c (revision 28501) @@ -48,6 +48,7 @@ #include "plug_footprint.h" #include "plug_io.h" #include "funchash_core.h" +#include "conf_core.h" conf_diag_t conf_diag; @@ -493,7 +494,7 @@ else PCB_ACT_FAIL(DumpLibFootprint); } - f = pcb_fp_fopen(pcb_fp_default_search_path(), fpn, &fctx, PCB->Data); + f = pcb_fp_fopen(&conf_core.rc.library_search_paths, fpn, &fctx, PCB->Data); if ((f != PCB_FP_FOPEN_IN_DST) && (f != NULL)) { /* dump file content */ Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 28500) +++ trunk/src_plugins/io_kicad/read.c (revision 28501) @@ -2839,7 +2839,7 @@ read_state_t st; gsx_parse_res_t res; - f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &fpst, NULL); + f = pcb_fp_fopen(&conf_core.rc.library_search_paths, name, &fpst, NULL); if (f == NULL) { return -1; Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 28500) +++ trunk/src_plugins/io_lihata/read.c (revision 28501) @@ -2530,7 +2530,7 @@ cfg_dest = CFR_invalid; - f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st, NULL); + f = pcb_fp_fopen(&conf_core.rc.library_search_paths, name, &st, NULL); if (f != NULL) { doc = lht_dom_load_stream(f, name, &errmsg); Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 28500) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 28501) @@ -8,11 +8,17 @@ #define yy_create_buffer pcb__create_buffer #define yy_delete_buffer pcb__delete_buffer -#define yy_flex_debug pcb__flex_debug +#define yy_scan_buffer pcb__scan_buffer +#define yy_scan_string pcb__scan_string +#define yy_scan_bytes pcb__scan_bytes #define yy_init_buffer pcb__init_buffer #define yy_flush_buffer pcb__flush_buffer #define yy_load_buffer_state pcb__load_buffer_state #define yy_switch_to_buffer pcb__switch_to_buffer +#define yypush_buffer_state pcb_push_buffer_state +#define yypop_buffer_state pcb_pop_buffer_state +#define yyensure_buffer_stack pcb_ensure_buffer_stack +#define yy_flex_debug pcb__flex_debug #define yyin pcb_in #define yyleng pcb_leng #define yylex pcb_lex @@ -27,12 +33,246 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define pcb__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer pcb__create_buffer +#endif + +#ifdef yy_delete_buffer +#define pcb__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer pcb__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define pcb__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer pcb__scan_buffer +#endif + +#ifdef yy_scan_string +#define pcb__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string pcb__scan_string +#endif + +#ifdef yy_scan_bytes +#define pcb__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes pcb__scan_bytes +#endif + +#ifdef yy_init_buffer +#define pcb__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer pcb__init_buffer +#endif + +#ifdef yy_flush_buffer +#define pcb__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer pcb__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define pcb__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state pcb__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define pcb__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer pcb__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define pcb_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state pcb_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define pcb_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state pcb_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define pcb_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack pcb_ensure_buffer_stack +#endif + +#ifdef yylex +#define pcb_lex_ALREADY_DEFINED +#else +#define yylex pcb_lex +#endif + +#ifdef yyrestart +#define pcb_restart_ALREADY_DEFINED +#else +#define yyrestart pcb_restart +#endif + +#ifdef yylex_init +#define pcb_lex_init_ALREADY_DEFINED +#else +#define yylex_init pcb_lex_init +#endif + +#ifdef yylex_init_extra +#define pcb_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra pcb_lex_init_extra +#endif + +#ifdef yylex_destroy +#define pcb_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy pcb_lex_destroy +#endif + +#ifdef yyget_debug +#define pcb_get_debug_ALREADY_DEFINED +#else +#define yyget_debug pcb_get_debug +#endif + +#ifdef yyset_debug +#define pcb_set_debug_ALREADY_DEFINED +#else +#define yyset_debug pcb_set_debug +#endif + +#ifdef yyget_extra +#define pcb_get_extra_ALREADY_DEFINED +#else +#define yyget_extra pcb_get_extra +#endif + +#ifdef yyset_extra +#define pcb_set_extra_ALREADY_DEFINED +#else +#define yyset_extra pcb_set_extra +#endif + +#ifdef yyget_in +#define pcb_get_in_ALREADY_DEFINED +#else +#define yyget_in pcb_get_in +#endif + +#ifdef yyset_in +#define pcb_set_in_ALREADY_DEFINED +#else +#define yyset_in pcb_set_in +#endif + +#ifdef yyget_out +#define pcb_get_out_ALREADY_DEFINED +#else +#define yyget_out pcb_get_out +#endif + +#ifdef yyset_out +#define pcb_set_out_ALREADY_DEFINED +#else +#define yyset_out pcb_set_out +#endif + +#ifdef yyget_leng +#define pcb_get_leng_ALREADY_DEFINED +#else +#define yyget_leng pcb_get_leng +#endif + +#ifdef yyget_text +#define pcb_get_text_ALREADY_DEFINED +#else +#define yyget_text pcb_get_text +#endif + +#ifdef yyget_lineno +#define pcb_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno pcb_get_lineno +#endif + +#ifdef yyset_lineno +#define pcb_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno pcb_set_lineno +#endif + +#ifdef yywrap +#define pcb_wrap_ALREADY_DEFINED +#else +#define yywrap pcb_wrap +#endif + +#ifdef yyalloc +#define pcb_alloc_ALREADY_DEFINED +#else +#define yyalloc pcb_alloc +#endif + +#ifdef yyrealloc +#define pcb_realloc_ALREADY_DEFINED +#else +#define yyrealloc pcb_realloc +#endif + +#ifdef yyfree +#define pcb_free_ALREADY_DEFINED +#else +#define yyfree pcb_free +#endif + +#ifdef yytext +#define pcb_text_ALREADY_DEFINED +#else +#define yytext pcb_text +#endif + +#ifdef yyleng +#define pcb_leng_ALREADY_DEFINED +#else +#define yyleng pcb_leng +#endif + +#ifdef yyin +#define pcb_in_ALREADY_DEFINED +#else +#define yyin pcb_in +#endif + +#ifdef yyout +#define pcb_out_ALREADY_DEFINED +#else +#define yyout pcb_out +#endif + +#ifdef yy_flex_debug +#define pcb__flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug pcb__flex_debug +#endif + +#ifdef yylineno +#define pcb_lineno_ALREADY_DEFINED +#else +#define yylineno pcb_lineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -103,40 +343,32 @@ #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST +/* TODO: this is always defined, so inline it */ +#define yyconst const -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less @@ -143,7 +375,6 @@ * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. @@ -150,13 +381,10 @@ */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE pcb_restart(pcb_in ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -181,50 +409,56 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int pcb_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif -extern FILE *pcb_in, *pcb_out; +extern int yyleng; +extern FILE *yyin, *yyout; + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE pcb_lex. + * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-pcb_lineno scanner, because yy_act is + * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ - for ( yyl = n; yyl < pcb_leng; ++yyl )\ - if ( pcb_text[yyl] == '\n' )\ - --pcb_lineno;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --yylineno;\ + }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up pcb_text. */ \ + /* Undo effects of setting up yytext. */ \ 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; /* set up pcb_text again */ \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -237,7 +471,7 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -265,7 +499,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -282,8 +516,8 @@ * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via pcb_restart()), so that the user can continue scanning by - * just pointing pcb_in at a new input file. + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -293,7 +527,7 @@ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -304,103 +538,98 @@ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when pcb_text is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int pcb_leng; +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow pcb_wrap()'s to do buffer switches - * instead of setting up a fresh pcb_in. A bit of a hack ... +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void pcb_restart (FILE *input_file ); -void pcb__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE pcb__create_buffer (FILE *file,int size ); -void pcb__delete_buffer (YY_BUFFER_STATE b ); -void pcb__flush_buffer (YY_BUFFER_STATE b ); -void pcb_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void pcb_pop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void pcb_ensure_buffer_stack (void ); -static void pcb__load_buffer_state (void ); -static void pcb__init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER pcb__flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE pcb__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE pcb__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE pcb__scan_bytes (yyconst char *bytes,int len ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); -void *pcb_alloc (yy_size_t ); -void *pcb_realloc (void *,yy_size_t ); -void pcb_free (void * ); - -#define yy_new_buffer pcb__create_buffer - +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - pcb_ensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - pcb__create_buffer(pcb_in,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - pcb_ensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - pcb__create_buffer(pcb_in,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; +FILE *yyin = NULL, *yyout = NULL; -FILE *pcb_in = (FILE *) 0, *pcb_out = (FILE *) 0; - typedef int yy_state_type; -extern int pcb_lineno; +extern int yylineno; +int yylineno = 1; -int pcb_lineno = 1; +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext -extern char *pcb_text; -#define yytext_ptr pcb_text +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 yynoreturn yy_fatal_error ( const char* msg ); -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[] ); - /* Done after the current pattern has been matched and before the - * corresponding action - sets up pcb_text. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - pcb_leng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 56 #define YY_END_OF_BUFFER 57 /* This struct is not used in this scanner, @@ -410,7 +639,7 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[224] = +static const flex_int16_t yy_accept[224] = { 0, 0, 0, 57, 55, 52, 53, 54, 55, 51, 55, 55, 47, 47, 55, 55, 55, 55, 55, 55, 55, @@ -439,7 +668,7 @@ 0, 34, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -471,7 +700,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[51] = +static const YY_CHAR yy_meta[51] = { 0, 1, 1, 2, 3, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, @@ -480,7 +709,7 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[229] = +static const flex_int16_t yy_base[229] = { 0, 0, 0, 260, 261, 257, 261, 261, 46, 252, 0, 42, 45, 46, 13, 16, 233, 216, 23, 210, 211, @@ -509,7 +738,7 @@ 67, 261, 261, 113, 117, 121, 125, 63 } ; -static yyconst flex_int16_t yy_def[229] = +static const flex_int16_t yy_def[229] = { 0, 223, 1, 223, 223, 223, 223, 223, 224, 225, 226, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, @@ -538,7 +767,7 @@ 223, 223, 0, 223, 223, 223, 223, 223 } ; -static yyconst flex_int16_t yy_nxt[312] = +static const flex_int16_t yy_nxt[312] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 4, 12, 13, 14, 4, 15, 16, 17, 18, 19, 20, 21, @@ -577,7 +806,7 @@ 223 } ; -static yyconst flex_int16_t yy_chk[312] = +static const flex_int16_t yy_chk[312] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -617,7 +846,7 @@ } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[57] = +static const flex_int32_t yy_rule_can_match_eol[57] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -626,8 +855,8 @@ static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int pcb__flex_debug; -int pcb__flex_debug = 0; +extern int yy_flex_debug; +int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -636,7 +865,7 @@ #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *pcb_text; +char *yytext; #line 1 "parse_l.l" #line 2 "parse_l.l" /* @@ -733,7 +962,8 @@ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename); -#line 737 "parse_l.c" +#line 966 "parse_l.c" +#line 967 "parse_l.c" #define INITIAL 0 @@ -749,36 +979,36 @@ #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int pcb_lex_destroy (void ); +int yylex_destroy ( void ); -int pcb_get_debug (void ); +int yyget_debug ( void ); -void pcb_set_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE pcb_get_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void pcb_set_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *pcb_get_in (void ); +FILE *yyget_in ( void ); -void pcb_set_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *pcb_get_out (void ); +FILE *yyget_out ( void ); -void pcb_set_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -int pcb_get_leng (void ); + int yyget_leng ( void ); -char *pcb_get_text (void ); +char *yyget_text ( void ); -int pcb_get_lineno (void ); +int yyget_lineno ( void ); -void pcb_set_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -786,28 +1016,31 @@ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int pcb_wrap (void ); +extern "C" int yywrap ( void ); #else -extern int pcb_wrap (void ); +extern int yywrap ( void ); #endif #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + static void yyunput ( int c, char *buf_ptr ); + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif @@ -827,7 +1060,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( pcb_text, pcb_leng, 1, pcb_out )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -838,13 +1071,13 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ - (c = getc( pcb_in )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( pcb_in ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ @@ -851,7 +1084,7 @@ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, pcb_in))==0 && ferror(pcb_in)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -859,7 +1092,7 @@ break; \ } \ errno=0; \ - clearerr(pcb_in); \ + clearerr(yyin); \ } \ }\ \ @@ -892,12 +1125,12 @@ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int pcb_lex (void); +extern int yylex (void); -#define YY_DECL int pcb_lex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after pcb_text and pcb_leng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -906,7 +1139,7 @@ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -916,15 +1149,10 @@ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; -#line 108 "parse_l.l" - - -#line 927 "parse_l.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -936,26 +1164,32 @@ if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ - if ( ! pcb_in ) - pcb_in = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! pcb_out ) - pcb_out = stdout; + if ( ! yyout ) + yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - pcb_ensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - pcb__create_buffer(pcb_in,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - pcb__load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 108 "parse_l.l" + + +#line 1187 "parse_l.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); - /* Support of pcb_text. */ + /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of @@ -967,7 +1201,7 @@ yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -977,9 +1211,9 @@ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 224 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 261 ); @@ -998,10 +1232,10 @@ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; - for ( yyl = 0; yyl < pcb_leng; ++yyl ) - if ( pcb_text[yyl] == '\n' ) - - pcb_lineno++; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + yylineno++; ; } @@ -1240,7 +1474,7 @@ YY_RULE_SETUP #line 156 "parse_l.l" { - pcb_lval.integer = (unsigned) *(pcb_text+1); + pcb_lval.integer = (unsigned) *(yytext+1); return(CHAR_CONST); } YY_BREAK @@ -1252,13 +1486,13 @@ case 47: YY_RULE_SETUP #line 161 "parse_l.l" -{ pcb_lval.integer = pcb_round (strtod (pcb_text, NULL)); return INTEGER; } +{ pcb_lval.integer = pcb_round (strtod (yytext, NULL)); return INTEGER; } YY_BREAK case 48: YY_RULE_SETUP #line 163 "parse_l.l" { unsigned n; - sscanf((char *) pcb_text, "%x", &n); + sscanf((char *) yytext, "%x", &n); pcb_lval.integer = n; return INTEGER; } @@ -1270,7 +1504,7 @@ char *p1, *p2; /* return NULL on empty string */ - if (pcb_leng == 2) + if (yyleng == 2) { pcb_lval.string = NULL; return(STRING); @@ -1280,16 +1514,16 @@ * stringlength is counted and copied without * leading and trailing '"' */ - pcb_leng -= 2; - pcb_lval.string = (char *)calloc (pcb_leng+1, sizeof (char)); - p1 = (char *) (pcb_text +1); + yyleng -= 2; + pcb_lval.string = (char *)calloc (yyleng+1, sizeof (char)); + p1 = (char *) (yytext +1); p2 = pcb_lval.string; - while(pcb_leng--) + while(yyleng--) { /* check for special character */ if (*p1 == '\\') { - pcb_leng--; + yyleng--; p1++; } @@ -1302,7 +1536,7 @@ case 50: YY_RULE_SETUP #line 200 "parse_l.l" -{ if (yy_parse_tags) { add_tag(pcb_text); }} +{ if (yy_parse_tags) { add_tag(yytext); }} YY_BREAK case 51: YY_RULE_SETUP @@ -1320,7 +1554,7 @@ #line 203 "parse_l.l" { #ifndef FLEX_SCANNER - pcb_lineno++; + yylineno++; #endif } YY_BREAK @@ -1332,7 +1566,7 @@ case 55: YY_RULE_SETUP #line 209 "parse_l.l" -{ return(*pcb_text); } +{ return(*yytext); } YY_BREAK case 56: YY_RULE_SETUP @@ -1339,7 +1573,7 @@ #line 211 "parse_l.l" ECHO; YY_BREAK -#line 1343 "parse_l.c" +#line 1577 "parse_l.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1356,8 +1590,8 @@ { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed pcb_in at a new source and called - * pcb_lex(). If so, then we have to assure + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a @@ -1364,7 +1598,7 @@ * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = pcb_in; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1417,11 +1651,11 @@ { (yy_did_buffer_switch_on_eof) = 0; - if ( pcb_wrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * pcb_text, we can now set up + * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the @@ -1470,7 +1704,8 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of pcb_lex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1481,9 +1716,9 @@ */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1512,7 +1747,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1532,7 +1767,7 @@ { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); @@ -1548,11 +1783,12 @@ b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - pcb_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1570,7 +1806,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1580,7 +1816,7 @@ if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - pcb_restart(pcb_in ); + yyrestart( yyin ); } else @@ -1594,12 +1830,15 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pcb_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1615,14 +1854,14 @@ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1632,9 +1871,9 @@ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 224 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1647,10 +1886,10 @@ */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1660,30 +1899,32 @@ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 224 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 223); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); - /* undo effects of setting up pcb_text */ + /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1692,7 +1933,7 @@ yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1701,7 +1942,7 @@ *--yy_cp = (char) c; if ( c == '\n' ){ - --pcb_lineno; + --yylineno; } (yytext_ptr) = yy_bp; @@ -1709,6 +1950,8 @@ (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1733,7 +1976,7 @@ else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1750,14 +1993,14 @@ */ /* Reset buffer status. */ - pcb_restart(pcb_in ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( pcb_wrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1776,12 +2019,12 @@ } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve pcb_text */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - - pcb_lineno++; + + yylineno++; ; return c; @@ -1793,17 +2036,17 @@ * * @note This function does not reset the start condition to @c INITIAL . */ - void pcb_restart (FILE * input_file ) + void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ - pcb_ensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - pcb__create_buffer(pcb_in,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - pcb__init_buffer(YY_CURRENT_BUFFER,input_file ); - pcb__load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -1810,15 +2053,15 @@ * @param new_buffer The new input buffer. * */ - void pcb__switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with - * pcb_pop_buffer_state(); - * pcb_push_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - pcb_ensure_buffer_stack (); + yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1831,21 +2074,21 @@ } YY_CURRENT_BUFFER_LVALUE = new_buffer; - pcb__load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (pcb_wrap()) processing, but the only time this flag - * is looked at is after pcb_wrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } -static void pcb__load_buffer_state (void) +static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - pcb_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } @@ -1855,13 +2098,13 @@ * * @return the allocated buffer state. */ - YY_BUFFER_STATE pcb__create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) pcb_alloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in pcb__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; @@ -1868,22 +2111,22 @@ /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) pcb_alloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in pcb__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - pcb__init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. - * @param b a buffer created with pcb__create_buffer() + * @param b a buffer created with yy_create_buffer() * */ - void pcb__delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) @@ -1893,31 +2136,27 @@ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - pcb_free((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - pcb_free((void *) b ); + yyfree( (void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a pcb_restart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void pcb__init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - pcb__flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then pcb__init_buffer was _probably_ - * called from pcb_restart() or through yy_get_next_buffer. + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -1934,7 +2173,7 @@ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void pcb__flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -1954,7 +2193,7 @@ b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - pcb__load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1963,14 +2202,14 @@ * @param new_buffer The new state. * */ -void pcb_push_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; - pcb_ensure_buffer_stack(); + yyensure_buffer_stack(); - /* This block is copied from pcb__switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1984,8 +2223,8 @@ (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from pcb__switch_to_buffer. */ - pcb__load_buffer_state( ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1993,18 +2232,18 @@ * The next element becomes the new top. * */ -void pcb_pop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; - pcb__delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - pcb__load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2012,9 +2251,9 @@ /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void pcb_ensure_buffer_stack (void) +static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -2022,15 +2261,15 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)pcb_alloc + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in pcb_ensure_buffer_stack()" ); - + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -2039,15 +2278,15 @@ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)pcb_realloc + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in pcb_ensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2059,9 +2298,9 @@ * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE pcb__scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; @@ -2069,16 +2308,16 @@ base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) pcb_alloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in pcb__scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2085,26 +2324,26 @@ b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - pcb__switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } -/** Setup the input buffer state to scan a string. The next call to pcb_lex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * pcb__scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE pcb__scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - return pcb__scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to pcb_lex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. @@ -2111,7 +2350,7 @@ * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE pcb__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -2119,10 +2358,10 @@ int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) pcb_alloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in pcb__scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; @@ -2129,9 +2368,9 @@ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = pcb__scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in pcb__scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2145,9 +2384,9 @@ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2157,14 +2396,14 @@ #define yyless(n) \ do \ { \ - /* Undo effects of setting up pcb_text. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - pcb_text[pcb_leng] = (yy_hold_char); \ - (yy_c_buf_p) = pcb_text + yyless_macro_arg; \ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ - pcb_leng = yyless_macro_arg; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) @@ -2173,34 +2412,34 @@ /** Get the current line number. * */ -int pcb_get_lineno (void) +int yyget_lineno (void) { - - return pcb_lineno; + + return yylineno; } /** Get the input stream. * */ -FILE *pcb_get_in (void) +FILE *yyget_in (void) { - return pcb_in; + return yyin; } /** Get the output stream. * */ -FILE *pcb_get_out (void) +FILE *yyget_out (void) { - return pcb_out; + return yyout; } /** Get the length of the current token. * */ -int pcb_get_leng (void) +int yyget_leng (void) { - return pcb_leng; + return yyleng; } /** Get the current token. @@ -2207,95 +2446,95 @@ * */ -char *pcb_get_text (void) +char *yyget_text (void) { - return pcb_text; + return yytext; } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void pcb_set_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - pcb_lineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * - * @see pcb__switch_to_buffer + * @see yy_switch_to_buffer */ -void pcb_set_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - pcb_in = in_str ; + yyin = _in_str ; } -void pcb_set_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - pcb_out = out_str ; + yyout = _out_str ; } -int pcb_get_debug (void) +int yyget_debug (void) { - return pcb__flex_debug; + return yy_flex_debug; } -void pcb_set_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - pcb__flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. - * This function is called from pcb_lex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - /* We do not touch pcb_lineno unless the option is enabled. */ - pcb_lineno = 1; + /* We do not touch yylineno unless the option is enabled. */ + yylineno = 1; - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT - pcb_in = stdin; - pcb_out = stdout; + yyin = stdin; + yyout = stdout; #else - pcb_in = (FILE *) 0; - pcb_out = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * pcb_lex_init() + * yylex_init() */ return 0; } -/* pcb_lex_destroy is for both reentrant and non-reentrant scanners. */ -int pcb_lex_destroy (void) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - pcb__delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; - pcb_pop_buffer_state(); + yypop_buffer_state(); } /* Destroy the stack itself. */ - pcb_free((yy_buffer_stack) ); + yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time - * pcb_lex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -2306,9 +2545,10 @@ */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2315,9 +2555,9 @@ #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2325,13 +2565,14 @@ } #endif -void *pcb_alloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *pcb_realloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2339,12 +2580,12 @@ * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void pcb_free (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see pcb_realloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" @@ -2352,7 +2593,6 @@ #line 211 "parse_l.l" - /* sets up the preprocessor command */ static int Parse(FILE *Pipe, const char *Executable, const char *Path, const char *Filename) { @@ -2383,8 +2623,8 @@ else sprintf(tmps, "%s", Filename); - pcb_in = pcb_fopen(NULL, tmps, "r"); - if (!pcb_in) { + yyin = pcb_fopen(NULL, tmps, "r"); + if (!yyin) { free(tmps); return (1); } @@ -2399,7 +2639,7 @@ p.hidlib = &PCB->hidlib; command = pcb_build_argfn(Executable, &p); /* open pipe to stdout of command */ - if (*command == '\0' || (pcb_in = pcb_popen(NULL, command, "r")) == NULL) { + if (*command == '\0' || (yyin = pcb_popen(NULL, command, "r")) == NULL) { pcb_popen_error_message(command); free(command); return (1); @@ -2408,18 +2648,18 @@ } } else { - pcb_in = Pipe; + yyin = Pipe; } #ifdef FLEX_SCANNER /* reset parser if not called the first time */ if (!firsttime) - pcb_restart(pcb_in); + yyrestart(yyin); firsttime = pcb_false; #endif /* init linenumber and filename for yyerror() */ - pcb_lineno = 1; + yylineno = 1; yyfilename = Filename; /* We need to save the data temporarily because lex-yacc are able @@ -2439,7 +2679,7 @@ returncode = pcb_parse(); #endif /* clean up parse buffer */ - pcb__delete_buffer(YY_CURRENT_BUFFER); + yy_delete_buffer(YY_CURRENT_BUFFER); pcb_create_be_lenient(pcb_false); @@ -2447,8 +2687,8 @@ return returncode; if (used_popen) - return (pcb_pclose(pcb_in) ? 1 : returncode); - return (fclose(pcb_in) ? 1 : returncode); + return (pcb_pclose(yyin) ? 1 : returncode); + return (fclose(yyin) ? 1 : returncode); } /* --------------------------------------------------------------------------- @@ -2460,7 +2700,7 @@ int ret; pcb_fp_fopen_ctx_t st; - f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st, NULL); + f = pcb_fp_fopen(&conf_core.rc.library_search_paths, name, &st, NULL); /* set up the yy globals only after the pcb_fp_fopen() because it can also call Parse */ @@ -2641,7 +2881,7 @@ static int parse_number () { - pcb_lval.number = strtod ((char *) pcb_text, NULL); + pcb_lval.number = strtod ((char *) yytext, NULL); return FLOATING; } Index: trunk/src_plugins/io_pcb/parse_l.h =================================================================== --- trunk/src_plugins/io_pcb/parse_l.h (revision 28500) +++ trunk/src_plugins/io_pcb/parse_l.h (revision 28501) @@ -12,12 +12,246 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define pcb__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer pcb__create_buffer +#endif + +#ifdef yy_delete_buffer +#define pcb__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer pcb__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define pcb__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer pcb__scan_buffer +#endif + +#ifdef yy_scan_string +#define pcb__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string pcb__scan_string +#endif + +#ifdef yy_scan_bytes +#define pcb__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes pcb__scan_bytes +#endif + +#ifdef yy_init_buffer +#define pcb__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer pcb__init_buffer +#endif + +#ifdef yy_flush_buffer +#define pcb__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer pcb__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define pcb__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state pcb__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define pcb__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer pcb__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define pcb_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state pcb_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define pcb_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state pcb_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define pcb_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack pcb_ensure_buffer_stack +#endif + +#ifdef yylex +#define pcb_lex_ALREADY_DEFINED +#else +#define yylex pcb_lex +#endif + +#ifdef yyrestart +#define pcb_restart_ALREADY_DEFINED +#else +#define yyrestart pcb_restart +#endif + +#ifdef yylex_init +#define pcb_lex_init_ALREADY_DEFINED +#else +#define yylex_init pcb_lex_init +#endif + +#ifdef yylex_init_extra +#define pcb_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra pcb_lex_init_extra +#endif + +#ifdef yylex_destroy +#define pcb_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy pcb_lex_destroy +#endif + +#ifdef yyget_debug +#define pcb_get_debug_ALREADY_DEFINED +#else +#define yyget_debug pcb_get_debug +#endif + +#ifdef yyset_debug +#define pcb_set_debug_ALREADY_DEFINED +#else +#define yyset_debug pcb_set_debug +#endif + +#ifdef yyget_extra +#define pcb_get_extra_ALREADY_DEFINED +#else +#define yyget_extra pcb_get_extra +#endif + +#ifdef yyset_extra +#define pcb_set_extra_ALREADY_DEFINED +#else +#define yyset_extra pcb_set_extra +#endif + +#ifdef yyget_in +#define pcb_get_in_ALREADY_DEFINED +#else +#define yyget_in pcb_get_in +#endif + +#ifdef yyset_in +#define pcb_set_in_ALREADY_DEFINED +#else +#define yyset_in pcb_set_in +#endif + +#ifdef yyget_out +#define pcb_get_out_ALREADY_DEFINED +#else +#define yyget_out pcb_get_out +#endif + +#ifdef yyset_out +#define pcb_set_out_ALREADY_DEFINED +#else +#define yyset_out pcb_set_out +#endif + +#ifdef yyget_leng +#define pcb_get_leng_ALREADY_DEFINED +#else +#define yyget_leng pcb_get_leng +#endif + +#ifdef yyget_text +#define pcb_get_text_ALREADY_DEFINED +#else +#define yyget_text pcb_get_text +#endif + +#ifdef yyget_lineno +#define pcb_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno pcb_get_lineno +#endif + +#ifdef yyset_lineno +#define pcb_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno pcb_set_lineno +#endif + +#ifdef yywrap +#define pcb_wrap_ALREADY_DEFINED +#else +#define yywrap pcb_wrap +#endif + +#ifdef yyalloc +#define pcb_alloc_ALREADY_DEFINED +#else +#define yyalloc pcb_alloc +#endif + +#ifdef yyrealloc +#define pcb_realloc_ALREADY_DEFINED +#else +#define yyrealloc pcb_realloc +#endif + +#ifdef yyfree +#define pcb_free_ALREADY_DEFINED +#else +#define yyfree pcb_free +#endif + +#ifdef yytext +#define pcb_text_ALREADY_DEFINED +#else +#define yytext pcb_text +#endif + +#ifdef yyleng +#define pcb_leng_ALREADY_DEFINED +#else +#define yyleng pcb_leng +#endif + +#ifdef yyin +#define pcb_in_ALREADY_DEFINED +#else +#define yyin pcb_in +#endif + +#ifdef yyout +#define pcb_out_ALREADY_DEFINED +#else +#define yyout pcb_out +#endif + +#ifdef yy_flex_debug +#define pcb__flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug pcb__flex_debug +#endif + +#ifdef yylineno +#define pcb_lineno_ALREADY_DEFINED +#else +#define yylineno pcb_lineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -88,29 +322,23 @@ #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST +/* TODO: this is always defined, so inline it */ +#define yyconst const -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Size of default input buffer. */ @@ -131,15 +359,15 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int pcb_leng; - -extern FILE *pcb_in, *pcb_out; - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif +extern int yyleng; + +extern FILE *yyin, *yyout; + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -152,7 +380,7 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -180,7 +408,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -191,28 +419,31 @@ }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void pcb_restart (FILE *input_file ); -void pcb__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE pcb__create_buffer (FILE *file,int size ); -void pcb__delete_buffer (YY_BUFFER_STATE b ); -void pcb__flush_buffer (YY_BUFFER_STATE b ); -void pcb_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void pcb_pop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -YY_BUFFER_STATE pcb__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE pcb__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE pcb__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -void *pcb_alloc (yy_size_t ); -void *pcb_realloc (void *,yy_size_t ); -void pcb_free (void * ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); /* Begin user sect3 */ -extern int pcb_lineno; +extern int yylineno; -extern char *pcb_text; -#define yytext_ptr pcb_text +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext #ifdef YY_HEADER_EXPORT_START_CONDITIONS #define INITIAL 0 @@ -234,31 +465,31 @@ /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int pcb_lex_destroy (void ); +int yylex_destroy ( void ); -int pcb_get_debug (void ); +int yyget_debug ( void ); -void pcb_set_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE pcb_get_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void pcb_set_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *pcb_get_in (void ); +FILE *yyget_in ( void ); -void pcb_set_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *pcb_get_out (void ); +FILE *yyget_out ( void ); -void pcb_set_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -int pcb_get_leng (void ); + int yyget_leng ( void ); -char *pcb_get_text (void ); +char *yyget_text ( void ); -int pcb_get_lineno (void ); +int yyget_lineno ( void ); -void pcb_set_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -266,18 +497,18 @@ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int pcb_wrap (void ); +extern "C" int yywrap ( void ); #else -extern int pcb_wrap (void ); +extern int yywrap ( void ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT @@ -305,9 +536,9 @@ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int pcb_lex (void); +extern int yylex (void); -#define YY_DECL int pcb_lex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ @@ -324,9 +555,154 @@ #undef YY_DECL #endif +#ifndef pcb__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef pcb__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef pcb__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef pcb__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef pcb__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef pcb__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef pcb__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef pcb__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef pcb__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef pcb_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef pcb_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef pcb_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef pcb_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef pcb_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef pcb_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef pcb_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef pcb_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef pcb_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef pcb_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef pcb_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef pcb_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef pcb_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef pcb_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef pcb_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef pcb_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef pcb_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef pcb_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef pcb_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef pcb_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef pcb_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef pcb_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef pcb_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef pcb_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef pcb_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef pcb_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef pcb_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef pcb_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef pcb_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef pcb_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef pcb_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef pcb_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef pcb_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef pcb_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef pcb__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef pcb_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef pcb_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef pcb_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef pcb_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + #line 211 "parse_l.l" -#line 331 "parse_l.h" +#line 707 "parse_l.h" #undef pcb_IN_HEADER #endif /* pcb_HEADER_H */ Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 28500) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 28501) @@ -317,7 +317,7 @@ int ret; pcb_fp_fopen_ctx_t st; - f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st, NULL); + f = pcb_fp_fopen(&conf_core.rc.library_search_paths, name, &st, NULL); /* set up the yy globals only after the pcb_fp_fopen() because it can also call Parse */