1#define yy_create_buffer bp_create_buffer 2#define yy_delete_buffer bp_delete_buffer 3#define yy_scan_buffer bp_scan_buffer 4#define yy_scan_string bp_scan_string 5#define yy_scan_bytes bp_scan_bytes 6#define yy_flex_debug bp_flex_debug 7#define yy_init_buffer bp_init_buffer 8#define yy_flush_buffer bp_flush_buffer 9#define yy_load_buffer_state bp_load_buffer_state 10#define yy_switch_to_buffer bp_switch_to_buffer 11#define yyin bpin 12#define yyleng bpleng 13#define yylex bplex 14#define yyout bpout 15#define yyrestart bprestart 16#define yytext bptext 17#define yywrap bpwrap 18 19/* 20 * A lexical scanner generated by flex 21 */ 22 23/* 24 * Scanner skeleton version: $Header: 25 * /home/cvsroot/muscle/PCSC/src/driverparser.c,v 1.1.1.1 2002/03/30 26 * 18:15:03 corcoran Exp $ 27 */ 28 29#define FLEX_SCANNER 30#define YY_FLEX_MAJOR_VERSION 2 31#define YY_FLEX_MINOR_VERSION 5 32 33#include <stdio.h> 34 35/* 36 * cfront 1.2 defines "c_plusplus" instead of "__cplusplus" 37 */ 38#ifdef c_plusplus 39#ifndef __cplusplus 40#define __cplusplus 41#endif 42#endif 43 44#ifdef __cplusplus 45 46#include <stdlib.h> 47#include <unistd.h> 48 49/* 50 * Use prototypes in function declarations. 51 */ 52#define YY_USE_PROTOS 53 54/* 55 * The "const" storage-class-modifier is valid. 56 */ 57#define YY_USE_CONST 58 59#else /* ! __cplusplus */ 60 61#if __STDC__ 62 63#define YY_USE_PROTOS 64#define YY_USE_CONST 65 66#endif /* __STDC__ */ 67#endif /* ! __cplusplus */ 68 69#ifdef __TURBOC__ 70#pragma warn -rch 71#pragma warn -use 72#include <io.h> 73#include <stdlib.h> 74#define YY_USE_CONST 75#define YY_USE_PROTOS 76#endif 77 78#ifdef YY_USE_CONST 79#define yyconst const 80#else 81#define yyconst 82#endif 83 84#ifdef YY_USE_PROTOS 85#define YY_PROTO(proto) proto 86#else 87#define YY_PROTO(proto) () 88#endif 89 90/* 91 * Returned upon end-of-file. 92 */ 93#define YY_NULL 0 94 95/* 96 * Promotes a possibly negative, possibly signed char to an unsigned 97 * integer for use as an array index. If the signed char is negative, we 98 * want to instead treat it as an 8-bit unsigned char, hence the double 99 * cast. 100 */ 101#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 102 103/* 104 * Enter a start condition. This macro really ought to take a parameter, 105 * but we do it the disgusting crufty way forced on us by the ()-less 106 * definition of BEGIN. 107 */ 108#define BEGIN yy_start = 1 + 2 * 109 110/* 111 * Translate the current start state into a value that can be later handed 112 * to BEGIN to return to the state. The YYSTATE alias is for lex 113 * compatibility. 114 */ 115#define YY_START ((yy_start - 1) / 2) 116#define YYSTATE YY_START 117 118/* 119 * Action number for EOF rule of a given start state. 120 */ 121#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 122 123/* 124 * Special action meaning "start processing a new file". 125 */ 126#define YY_NEW_FILE yyrestart( yyin ) 127 128#define YY_END_OF_BUFFER_CHAR 0 129 130/* 131 * Size of default input buffer. 132 */ 133#define YY_BUF_SIZE 16384 134 135typedef struct yy_buffer_state *YY_BUFFER_STATE; 136 137extern int yyleng; 138extern FILE *yyin, *yyout; 139 140#define EOB_ACT_CONTINUE_SCAN 0 141#define EOB_ACT_END_OF_FILE 1 142#define EOB_ACT_LAST_MATCH 2 143 144/* 145 * The funky do-while in the following #define is used to turn the 146 * definition int a single C statement (which needs a semi-colon 147 * terminator). This avoids problems with code like: if ( 148 * condition_holds ) yyless( 5 ); else do_something_else(); Prior to 149 * using the do-while the compiler would get upset at the "else" because 150 * it interpreted the "if" statement as being all done when it reached the 151 * ';' after the yyless() call. 152 */ 153 154/* 155 * Return all but the first 'n' matched characters back to the input 156 * stream. 157 */ 158 159#define yyless(n) \ 160 do \ 161 { \ 162 /* Undo effects of setting up yytext. */ \ 163 *yy_cp = yy_hold_char; \ 164 YY_RESTORE_YY_MORE_OFFSET \ 165 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 166 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 167 } \ 168 while ( 0 ) 169 170#define unput(c) yyunput( c, yytext_ptr ) 171 172/* 173 * The following is because we cannot portably get our hands on size_t 174 * (without autoconf's help, which isn't available because we want 175 * flex-generated scanners to compile on their own). 176 */ 177typedef unsigned int yy_size_t; 178 179struct yy_buffer_state 180{ 181 FILE *yy_input_file; 182 183 char *yy_ch_buf; /* input buffer */ 184 char *yy_buf_pos; /* current position in input buffer */ 185 186 /* 187 * Size of input buffer in bytes, not including room for EOB 188 * characters. 189 */ 190 yy_size_t yy_buf_size; 191 192 /* 193 * Number of characters read into yy_ch_buf, not including EOB 194 * characters. 195 */ 196 int yy_n_chars; 197 198 /* 199 * Whether we "own" the buffer - i.e., we know we created it, and can 200 * realloc() it to grow it, and should free() it to delete it. 201 */ 202 int yy_is_our_buffer; 203 204 /* 205 * Whether this is an "interactive" input source; if so, and if we're 206 * using stdio for input, then we want to use getc() instead of 207 * fread(), to make sure we stop fetching input after each newline. 208 */ 209 int yy_is_interactive; 210 211 /* 212 * Whether we're considered to be at the beginning of a line. If so, 213 * '^' rules will be active on the next match, otherwise not. 214 */ 215 int yy_at_bol; 216 217 /* 218 * Whether to try to fill the input buffer when we reach the end of 219 * it. 220 */ 221 int yy_fill_buffer; 222 223 int yy_buffer_status; 224#define YY_BUFFER_NEW 0 225#define YY_BUFFER_NORMAL 1 226 /* 227 * When an EOF's been seen but there's still some text to process then 228 * we mark the buffer as YY_EOF_PENDING, to indicate that we shouldn't 229 * try reading from the input source any more. We might still have a 230 * bunch of tokens to match, though, because of possible backing-up. 231 * When we actually see the EOF, we change the status to "new" (via 232 * yyrestart()), so that the user can continue scanning by just 233 * pointing yyin at a new input file. 234 */ 235#define YY_BUFFER_EOF_PENDING 2 236}; 237 238static YY_BUFFER_STATE yy_current_buffer = 0; 239 240/* 241 * We provide macros for accessing buffer states in case in the future we 242 * want to put the buffer states in a more general "scanner state". 243 */ 244#define YY_CURRENT_BUFFER yy_current_buffer 245 246/* 247 * yy_hold_char holds the character lost when yytext is formed. 248 */ 249static char yy_hold_char; 250 251static int yy_n_chars; /* number of characters read into 252 * yy_ch_buf */ 253 254int yyleng; 255 256/* 257 * Points to current character in buffer. 258 */ 259static char *yy_c_buf_p = (char *) 0; 260static int yy_init = 1; /* whether we need to initialize */ 261static int yy_start = 0; /* start state number */ 262 263/* 264 * Flag which is used to allow yywrap()'s to do buffer switches instead of 265 * setting up a fresh yyin. A bit of a hack ... 266 */ 267static int yy_did_buffer_switch_on_eof; 268 269void yyrestart YY_PROTO((FILE * input_file)); 270 271void yy_switch_to_buffer YY_PROTO((YY_BUFFER_STATE new_buffer)); 272void yy_load_buffer_state YY_PROTO((void)); 273YY_BUFFER_STATE yy_create_buffer YY_PROTO((FILE * file, int size)); 274void yy_delete_buffer YY_PROTO((YY_BUFFER_STATE b)); 275void yy_init_buffer YY_PROTO((YY_BUFFER_STATE b, FILE * file)); 276void yy_flush_buffer YY_PROTO((YY_BUFFER_STATE b)); 277#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 278 279YY_BUFFER_STATE yy_scan_buffer YY_PROTO((char *base, yy_size_t size)); 280YY_BUFFER_STATE yy_scan_string YY_PROTO((yyconst char *yy_str)); 281YY_BUFFER_STATE yy_scan_bytes YY_PROTO((yyconst char *bytes, int len)); 282 283static void *yy_flex_alloc YY_PROTO((yy_size_t)); 284static void *yy_flex_realloc YY_PROTO((void *, yy_size_t)); 285static void yy_flex_free YY_PROTO((void *)); 286 287#define yy_new_buffer yy_create_buffer 288 289#define yy_set_interactive(is_interactive) \ 290 { \ 291 if ( ! yy_current_buffer ) \ 292 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 293 yy_current_buffer->yy_is_interactive = is_interactive; \ 294 } 295 296#define yy_set_bol(at_bol) \ 297 { \ 298 if ( ! yy_current_buffer ) \ 299 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 300 yy_current_buffer->yy_at_bol = at_bol; \ 301 } 302 303#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 304 305typedef unsigned char YY_CHAR; 306FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 307typedef int yy_state_type; 308extern char *yytext; 309#define yytext_ptr yytext 310 311static yy_state_type yy_get_previous_state YY_PROTO((void)); 312static yy_state_type yy_try_NUL_trans YY_PROTO((yy_state_type 313 current_state)); 314static int yy_get_next_buffer YY_PROTO((void)); 315static void yy_fatal_error YY_PROTO((yyconst char msg[])); 316 317/* 318 * Done after the current pattern has been matched and before the 319 * corresponding action - sets up yytext. 320 */ 321#define YY_DO_BEFORE_ACTION \ 322 yytext_ptr = yy_bp; \ 323 yyleng = (int) (yy_cp - yy_bp); \ 324 yy_hold_char = *yy_cp; \ 325 *yy_cp = '\0'; \ 326 yy_c_buf_p = yy_cp; 327 328#define YY_NUM_RULES 7 329#define YY_END_OF_BUFFER 8 330static yyconst short int yy_accept[39] = { 0, 331 0, 0, 8, 6, 4, 2, 1, 6, 1, 0, 332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 333 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 334 0, 0, 0, 0, 0, 0, 5, 0 335}; 336 337static yyconst int yy_ec[256] = { 0, 338 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 341 1, 2, 4, 4, 5, 4, 4, 4, 4, 4, 342 4, 4, 4, 4, 4, 4, 6, 7, 7, 7, 343 7, 7, 7, 7, 7, 7, 7, 4, 1, 8, 344 4, 9, 4, 4, 10, 10, 10, 10, 10, 10, 345 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 346 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 347 1, 1, 1, 4, 4, 1, 11, 11, 11, 11, 348 349 12, 11, 13, 11, 14, 11, 15, 11, 11, 16, 350 11, 11, 11, 17, 18, 19, 11, 11, 11, 11, 351 20, 11, 1, 1, 1, 4, 1, 1, 1, 1, 352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 357 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 359 360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 365 1, 1, 1, 1, 1 366}; 367 368static yyconst int yy_meta[21] = { 0, 369 1, 2, 3, 4, 4, 4, 2, 1, 1, 2, 370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 371}; 372 373static yyconst short int yy_base[43] = { 0, 374 0, 7, 49, 50, 50, 50, 0, 1, 0, 36, 375 28, 26, 28, 35, 29, 0, 26, 33, 27, 33, 376 29, 22, 0, 24, 27, 14, 27, 23, 13, 50, 377 10, 9, 4, 1, 0, 2, 50, 50, 19, 23, 378 2, 26 379}; 380 381static yyconst short int yy_def[43] = { 0, 382 39, 39, 38, 38, 38, 38, 40, 38, 40, 38, 383 38, 38, 38, 38, 38, 41, 38, 41, 38, 38, 384 38, 38, 42, 38, 42, 38, 38, 38, 38, 38, 385 38, 38, 38, 38, 38, 38, 38, 0, 38, 38, 386 38, 38 387}; 388 389static yyconst short int yy_nxt[71] = { 0, 390 38, 5, 6, 18, 7, 38, 38, 8, 5, 6, 391 37, 7, 36, 38, 8, 10, 35, 34, 11, 4, 392 4, 4, 4, 9, 9, 33, 9, 25, 32, 25, 393 31, 30, 29, 28, 27, 26, 24, 23, 22, 21, 394 20, 19, 17, 16, 15, 14, 13, 12, 38, 3, 395 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 396 38, 38, 38, 38, 38, 38, 38, 38, 38, 38 397}; 398 399static yyconst short int yy_chk[71] = { 0, 400 0, 1, 1, 41, 1, 0, 0, 1, 2, 2, 401 36, 2, 35, 0, 2, 8, 34, 33, 8, 39, 402 39, 39, 39, 40, 40, 32, 40, 42, 31, 42, 403 29, 28, 27, 26, 25, 24, 22, 21, 20, 19, 404 18, 17, 15, 14, 13, 12, 11, 10, 3, 38, 405 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 406 38, 38, 38, 38, 38, 38, 38, 38, 38, 38 407}; 408 409static yy_state_type yy_last_accepting_state; 410static char *yy_last_accepting_cpos; 411 412/* 413 * The intent behind this definition is that it'll catch any uses of 414 * REJECT which flex missed. 415 */ 416#define REJECT reject_used_but_not_detected 417#define yymore() yymore_used_but_not_detected 418#define YY_MORE_ADJ 0 419#define YY_RESTORE_YY_MORE_OFFSET 420char *yytext; 421#line 1 "bundleparser.l" 422#define INITIAL 0 423/***************************************************************** 424 425 File : configfile.ll 426 Author : David Corcoran 427 Date : February 12, 1999 modified 7/28/99 428 Purpose: Reads lexical config files and updates database. 429 See http://www.linuxnet.com for more information. 430 License: Copyright (C) 1999 David Corcoran 431 <corcoran@linuxnet.com> 432 433******************************************************************/ 434#line 14 "bundleparser.l" 435 436void evalToken(char *pcToken, int tokType); 437 438static char *pcDesiredKey = 0; 439static char pcKey[200]; 440static char pcValue[200]; 441static char pcFinValue[200]; 442 443void errorCheck(char *pcToken_error); 444 445#line 427 "lex.bp.c" 446 447/* 448 * Macros after this point can all be overridden by user definitions in 449 * section 1. 450 */ 451 452#ifndef YY_SKIP_YYWRAP 453#ifdef __cplusplus 454extern "C" int yywrap YY_PROTO((void)); 455#else 456extern int yywrap YY_PROTO((void)); 457#endif 458#endif 459 460#ifndef YY_NO_UNPUT 461static void yyunput YY_PROTO((int c, char *buf_ptr)); 462#endif 463 464#ifndef yytext_ptr 465static void yy_flex_strncpy YY_PROTO((char *, yyconst char *, int)); 466#endif 467 468#ifdef YY_NEED_STRLEN 469static int yy_flex_strlen YY_PROTO((yyconst char *)); 470#endif 471 472#ifndef YY_NO_INPUT 473#ifdef __cplusplus 474static int yyinput YY_PROTO((void)); 475#else 476static int input YY_PROTO((void)); 477#endif 478#endif 479 480#if YY_STACK_USED 481static int yy_start_stack_ptr = 0; 482static int yy_start_stack_depth = 0; 483static int *yy_start_stack = 0; 484#ifndef YY_NO_PUSH_STATE 485static void yy_push_state YY_PROTO((int new_state)); 486#endif 487#ifndef YY_NO_POP_STATE 488static void yy_pop_state YY_PROTO((void)); 489#endif 490#ifndef YY_NO_TOP_STATE 491static int yy_top_state YY_PROTO((void)); 492#endif 493 494#else 495#define YY_NO_PUSH_STATE 1 496#define YY_NO_POP_STATE 1 497#define YY_NO_TOP_STATE 1 498#endif 499 500#ifdef YY_MALLOC_DECL 501YY_MALLOC_DECL 502#else 503#if __STDC__ 504#ifndef __cplusplus 505#include <stdlib.h> 506#endif 507#else 508/* 509 * Just try to get by without declaring the routines. This will fail 510 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 511 * or sizeof(void*) != sizeof(int). 512 */ 513#endif 514#endif 515 516/* 517 * Amount of stuff to slurp up with each read. 518 */ 519#ifndef YY_READ_BUF_SIZE 520#define YY_READ_BUF_SIZE 8192 521#endif 522 523/* 524 * Copy whatever the last rule matched to the standard output. 525 */ 526 527#ifndef ECHO 528/* 529 * This used to be an fputs(), but since the string might contain NUL's, 530 * we now use fwrite(). 531 */ 532#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 533#endif 534 535/* 536 * Gets input and stuffs it into "buf". number of characters read, or 537 * YY_NULL, is returned in "result". 538 */ 539#ifndef YY_INPUT 540#define YY_INPUT(buf,result,max_size) \ 541 if ( yy_current_buffer->yy_is_interactive ) \ 542 { \ 543 int c = '*', n; \ 544 for ( n = 0; n < max_size && \ 545 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 546 buf[n] = (char) c; \ 547 if ( c == '\n' ) \ 548 buf[n++] = (char) c; \ 549 if ( c == EOF && ferror( yyin ) ) \ 550 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 551 result = n; \ 552 } \ 553 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 554 && ferror( yyin ) ) \ 555 YY_FATAL_ERROR( "input in flex scanner failed" ); 556#endif 557 558/* 559 * No semi-colon after return; correct usage is to write "yyterminate();" 560 * - we don't want an extra ';' after the "return" because that will cause 561 * some compilers to complain about unreachable statements. 562 */ 563#ifndef yyterminate 564#define yyterminate() return YY_NULL 565#endif 566 567/* 568 * Number of entries by which start-condition stack grows. 569 */ 570#ifndef YY_START_STACK_INCR 571#define YY_START_STACK_INCR 25 572#endif 573 574/* 575 * Report a fatal error. 576 */ 577#ifndef YY_FATAL_ERROR 578#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 579#endif 580 581/* 582 * Default declaration of generated scanner - a define so the user can 583 * easily add parameters. 584 */ 585#ifndef YY_DECL 586#define YY_DECL int yylex YY_PROTO(( void )) 587#endif 588 589/* 590 * Code executed at the beginning of each rule, after yytext and yyleng 591 * have been set up. 592 */ 593#ifndef YY_USER_ACTION 594#define YY_USER_ACTION 595#endif 596 597/* 598 * Code executed at the end of each rule. 599 */ 600#ifndef YY_BREAK 601#define YY_BREAK break; 602#endif 603 604#define YY_RULE_SETUP \ 605 YY_USER_ACTION 606 607YY_DECL 608{ 609 register yy_state_type yy_current_state; 610 register char *yy_cp, *yy_bp; 611 register int yy_act; 612 613#line 26 "bundleparser.l" 614 615#line 581 "lex.bp.c" 616 617 if (yy_init) 618 { 619 yy_init = 0; 620 621#ifdef YY_USER_INIT 622 YY_USER_INIT; 623#endif 624 625 if (!yy_start) 626 yy_start = 1; /* first start state */ 627 628 if (!yyin) 629 yyin = stdin; 630 631 if (!yyout) 632 yyout = stdout; 633 634 if (!yy_current_buffer) 635 yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); 636 637 yy_load_buffer_state(); 638 } 639 640 while (1) /* loops until end-of-file is reached */ 641 { 642 yy_cp = yy_c_buf_p; 643 644 /* 645 * Support of yytext. 646 */ 647 *yy_cp = yy_hold_char; 648 649 /* 650 * yy_bp points to the position in yy_ch_buf of the start of the 651 * current run. 652 */ 653 yy_bp = yy_cp; 654 655 yy_current_state = yy_start; 656 yy_match: 657 do 658 { 659 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 660 if (yy_accept[yy_current_state]) 661 { 662 yy_last_accepting_state = yy_current_state; 663 yy_last_accepting_cpos = yy_cp; 664 } 665 while (yy_chk[yy_base[yy_current_state] + yy_c] != 666 yy_current_state) 667 { 668 yy_current_state = (int) yy_def[yy_current_state]; 669 if (yy_current_state >= 39) 670 yy_c = yy_meta[(unsigned int) yy_c]; 671 } 672 yy_current_state = 673 yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 674 ++yy_cp; 675 } 676 while (yy_base[yy_current_state] != 50); 677 678 yy_find_action: 679 yy_act = yy_accept[yy_current_state]; 680 if (yy_act == 0) 681 { /* have to back up */ 682 yy_cp = yy_last_accepting_cpos; 683 yy_current_state = yy_last_accepting_state; 684 yy_act = yy_accept[yy_current_state]; 685 } 686 687 YY_DO_BEFORE_ACTION; 688 689 do_action: /* This label is used only to access EOF actions. */ 690 691 switch (yy_act) 692 { /* beginning of action switch */ 693 case 0: /* must back up */ 694 /* 695 * undo the effects of YY_DO_BEFORE_ACTION 696 */ 697 *yy_cp = yy_hold_char; 698 yy_cp = yy_last_accepting_cpos; 699 yy_current_state = yy_last_accepting_state; 700 goto yy_find_action; 701 702 case 1: 703 YY_RULE_SETUP 704#line 28 "bundleparser.l" 705 { 706 } 707 YY_BREAK case 2: 708 YY_RULE_SETUP 709#line 29 "bundleparser.l" 710 { 711 } 712 YY_BREAK case 3: 713 YY_RULE_SETUP 714#line 30 "bundleparser.l" 715 { 716 evalToken(bptext, 1); 717 } 718 YY_BREAK case 4: 719 YY_RULE_SETUP 720#line 31 "bundleparser.l" 721 { 722 } 723 YY_BREAK case 5: 724 YY_RULE_SETUP 725#line 32 "bundleparser.l" 726 { 727 evalToken(bptext, 2); 728 } 729 YY_BREAK case 6: 730 YY_RULE_SETUP 731#line 33 "bundleparser.l" 732 { 733 errorCheck(bptext); 734 } 735 YY_BREAK case 7: 736 YY_RULE_SETUP 737#line 34 "bundleparser.l" 738 ECHO; 739 YY_BREAK 740#line 699 "lex.bp.c" 741 case YY_STATE_EOF(INITIAL): 742 yyterminate(); 743 744 case YY_END_OF_BUFFER: 745 { 746 /* 747 * Amount of text matched not including the EOB char. 748 */ 749 int yy_amount_of_matched_text = 750 (int) (yy_cp - yytext_ptr) - 1; 751 752 /* 753 * Undo the effects of YY_DO_BEFORE_ACTION. 754 */ 755 *yy_cp = yy_hold_char; 756 YY_RESTORE_YY_MORE_OFFSET 757 if (yy_current_buffer->yy_buffer_status == 758 YY_BUFFER_NEW) 759 { 760 /* 761 * We're scanning a new file or input source. It's 762 * possible that this happened because the user just 763 * pointed yyin at a new source and called yylex(). 764 * If so, then we have to assure consistency between 765 * yy_current_buffer and our globals. Here is the 766 * right place to do so, because this is the first 767 * action (other than possibly a back-up) that will 768 * match for the new input source. 769 */ 770 yy_n_chars = yy_current_buffer->yy_n_chars; 771 yy_current_buffer->yy_input_file = yyin; 772 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 773 } 774 775 /* 776 * Note that here we test for yy_c_buf_p "<=" to the 777 * position of the first EOB in the buffer, since 778 * yy_c_buf_p will already have been incremented past the 779 * NUL character (since all states make transitions on EOB 780 * to the end-of-buffer state). Contrast this with the 781 * test in input(). 782 */ 783 if (yy_c_buf_p <= 784 &yy_current_buffer->yy_ch_buf[yy_n_chars]) 785 { /* This was really a NUL. */ 786 yy_state_type yy_next_state; 787 788 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 789 790 yy_current_state = yy_get_previous_state(); 791 792 /* 793 * Okay, we're now positioned to make the NUL 794 * transition. We couldn't have 795 * yy_get_previous_state() go ahead and do it for us 796 * because it doesn't know how to deal with the 797 * possibility of jamming (and we don't want to build 798 * jamming into it because then it will run more 799 * slowly). 800 */ 801 802 yy_next_state = yy_try_NUL_trans(yy_current_state); 803 804 yy_bp = yytext_ptr + YY_MORE_ADJ; 805 806 if (yy_next_state) 807 { 808 /* 809 * Consume the NUL. 810 */ 811 yy_cp = ++yy_c_buf_p; 812 yy_current_state = yy_next_state; 813 goto yy_match; 814 } 815 816 else 817 { 818 yy_cp = yy_c_buf_p; 819 goto yy_find_action; 820 } 821 } 822 823 else 824 switch (yy_get_next_buffer()) 825 { 826 case EOB_ACT_END_OF_FILE: 827 { 828 yy_did_buffer_switch_on_eof = 0; 829 830 if (yywrap()) 831 { 832 /* 833 * Note: because we've taken care in 834 * yy_get_next_buffer() to have set up 835 * yytext, we can now set up yy_c_buf_p so 836 * that if some total hoser (like flex 837 * itself) wants to call the scanner after 838 * we return the YY_NULL, it'll still work 839 * - another YY_NULL will get returned. 840 */ 841 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 842 843 yy_act = YY_STATE_EOF(YY_START); 844 goto do_action; 845 } 846 847 else 848 { 849 if (!yy_did_buffer_switch_on_eof) 850 YY_NEW_FILE; 851 } 852 break; 853 } 854 855 case EOB_ACT_CONTINUE_SCAN: 856 yy_c_buf_p = 857 yytext_ptr + yy_amount_of_matched_text; 858 859 yy_current_state = yy_get_previous_state(); 860 861 yy_cp = yy_c_buf_p; 862 yy_bp = yytext_ptr + YY_MORE_ADJ; 863 goto yy_match; 864 865 case EOB_ACT_LAST_MATCH: 866 yy_c_buf_p = 867 &yy_current_buffer->yy_ch_buf[yy_n_chars]; 868 869 yy_current_state = yy_get_previous_state(); 870 871 yy_cp = yy_c_buf_p; 872 yy_bp = yytext_ptr + YY_MORE_ADJ; 873 goto yy_find_action; 874 } 875 break; 876 } 877 878 default: 879 YY_FATAL_ERROR 880 ("fatal flex scanner internal error--no action found"); 881 } /* end of action switch */ 882 } /* end of scanning one token */ 883} /* end of yylex */ 884 885/* 886 * yy_get_next_buffer - try to read in a new buffer Returns a code 887 * representing an action: EOB_ACT_LAST_MATCH - EOB_ACT_CONTINUE_SCAN - 888 * continue scanning from current position EOB_ACT_END_OF_FILE - end of 889 * file 890 */ 891 892static int yy_get_next_buffer() 893{ 894 register char *dest = yy_current_buffer->yy_ch_buf; 895 register char *source = yytext_ptr; 896 register int number_to_move, i; 897 int ret_val; 898 899 if (yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1]) 900 YY_FATAL_ERROR 901 ("fatal flex scanner internal error--end of buffer missed"); 902 903 if (yy_current_buffer->yy_fill_buffer == 0) 904 { /* Don't try to fill the buffer, so this is an EOF. */ 905 if (yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1) 906 { 907 /* 908 * We matched a single character, the EOB, so treat this as a 909 * final EOF. 910 */ 911 return EOB_ACT_END_OF_FILE; 912 } 913 914 else 915 { 916 /* 917 * We matched some text prior to the EOB, first process it. 918 */ 919 return EOB_ACT_LAST_MATCH; 920 } 921 } 922 923 /* 924 * Try to read more data. 925 */ 926 927 /* 928 * First move last chars to start of buffer. 929 */ 930 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 931 932 for (i = 0; i < number_to_move; ++i) 933 *(dest++) = *(source++); 934 935 if (yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING) 936 /* 937 * don't do the read, it's not guaranteed to return an EOF, just 938 * force an EOF 939 */ 940 yy_current_buffer->yy_n_chars = yy_n_chars = 0; 941 942 else 943 { 944 int num_to_read = 945 yy_current_buffer->yy_buf_size - number_to_move - 1; 946 947 while (num_to_read <= 0) 948 { /* Not enough room in the buffer - grow it. */ 949#ifdef YY_USES_REJECT 950 YY_FATAL_ERROR 951 ("input buffer overflow, can't enlarge buffer because scanner uses REJECT"); 952#else 953 954 /* 955 * just a shorter name for the current buffer 956 */ 957 YY_BUFFER_STATE b = yy_current_buffer; 958 959 int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); 960 961 if (b->yy_is_our_buffer) 962 { 963 int new_size = b->yy_buf_size * 2; 964 965 if (new_size <= 0) 966 b->yy_buf_size += b->yy_buf_size / 8; 967 else 968 b->yy_buf_size *= 2; 969 970 b->yy_ch_buf = (char *) 971 /* 972 * Include room in for 2 EOB chars. 973 */ 974 yy_flex_realloc((void *) b->yy_ch_buf, 975 b->yy_buf_size + 2); 976 } else 977 /* 978 * Can't grow it, we don't own it. 979 */ 980 b->yy_ch_buf = 0; 981 982 if (!b->yy_ch_buf) 983 YY_FATAL_ERROR 984 ("fatal error - scanner input buffer overflow"); 985 986 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 987 988 num_to_read = yy_current_buffer->yy_buf_size - 989 number_to_move - 1; 990#endif 991 } 992 993 if (num_to_read > YY_READ_BUF_SIZE) 994 num_to_read = YY_READ_BUF_SIZE; 995 996 /* 997 * Read in more data. 998 */ 999 YY_INPUT((&yy_current_buffer->yy_ch_buf[number_to_move]), 1000 yy_n_chars, num_to_read); 1001 1002 yy_current_buffer->yy_n_chars = yy_n_chars; 1003 } 1004 1005 if (yy_n_chars == 0) 1006 { 1007 if (number_to_move == YY_MORE_ADJ) 1008 { 1009 ret_val = EOB_ACT_END_OF_FILE; 1010 yyrestart(yyin); 1011 } 1012 1013 else 1014 { 1015 ret_val = EOB_ACT_LAST_MATCH; 1016 yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; 1017 } 1018 } 1019 1020 else 1021 ret_val = EOB_ACT_CONTINUE_SCAN; 1022 1023 yy_n_chars += number_to_move; 1024 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 1025 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 1026 1027 yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 1028 1029 return ret_val; 1030} 1031 1032/* 1033 * yy_get_previous_state - get the state just before the EOB char was 1034 * reached 1035 */ 1036 1037static yy_state_type yy_get_previous_state() 1038{ 1039 register yy_state_type yy_current_state; 1040 register char *yy_cp; 1041 1042 yy_current_state = yy_start; 1043 1044 for (yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp) 1045 { 1046 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1047 if (yy_accept[yy_current_state]) 1048 { 1049 yy_last_accepting_state = yy_current_state; 1050 yy_last_accepting_cpos = yy_cp; 1051 } 1052 while (yy_chk[yy_base[yy_current_state] + yy_c] != 1053 yy_current_state) 1054 { 1055 yy_current_state = (int) yy_def[yy_current_state]; 1056 if (yy_current_state >= 39) 1057 yy_c = yy_meta[(unsigned int) yy_c]; 1058 } 1059 yy_current_state = 1060 yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1061 } 1062 1063 return yy_current_state; 1064} 1065 1066/* 1067 * yy_try_NUL_trans - try to make a transition on the NUL character 1068 * synopsis next_state = yy_try_NUL_trans( current_state ); 1069 */ 1070 1071#ifdef YY_USE_PROTOS 1072static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) 1073#else 1074static yy_state_type yy_try_NUL_trans(yy_current_state) 1075 yy_state_type yy_current_state; 1076#endif 1077{ 1078 register int yy_is_jam; 1079 register char *yy_cp = yy_c_buf_p; 1080 1081 register YY_CHAR yy_c = 1; 1082 if (yy_accept[yy_current_state]) 1083 { 1084 yy_last_accepting_state = yy_current_state; 1085 yy_last_accepting_cpos = yy_cp; 1086 } 1087 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) 1088 { 1089 yy_current_state = (int) yy_def[yy_current_state]; 1090 if (yy_current_state >= 39) 1091 yy_c = yy_meta[(unsigned int) yy_c]; 1092 } 1093 yy_current_state = 1094 yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1095 yy_is_jam = (yy_current_state == 38); 1096 1097 return yy_is_jam ? 0 : yy_current_state; 1098} 1099 1100#ifndef YY_NO_UNPUT 1101#ifdef YY_USE_PROTOS 1102static void yyunput(int c, register char *yy_bp) 1103#else 1104static void yyunput(c, yy_bp) 1105 int c; 1106 register char *yy_bp; 1107#endif 1108{ 1109 register char *yy_cp = yy_c_buf_p; 1110 1111 /* 1112 * undo effects of setting up yytext 1113 */ 1114 *yy_cp = yy_hold_char; 1115 1116 if (yy_cp < yy_current_buffer->yy_ch_buf + 2) 1117 { /* need to shift things up to make room */ 1118 /* 1119 * +2 for EOB chars. 1120 */ 1121 register int number_to_move = yy_n_chars + 2; 1122 register char *dest = 1123 &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 1124 2]; 1125 register char *source = 1126 &yy_current_buffer->yy_ch_buf[number_to_move]; 1127 1128 while (source > yy_current_buffer->yy_ch_buf) 1129 *--dest = *--source; 1130 1131 yy_cp += (int) (dest - source); 1132 yy_bp += (int) (dest - source); 1133 yy_current_buffer->yy_n_chars = 1134 yy_n_chars = yy_current_buffer->yy_buf_size; 1135 1136 if (yy_cp < yy_current_buffer->yy_ch_buf + 2) 1137 YY_FATAL_ERROR("flex scanner push-back overflow"); 1138 } 1139 1140 *--yy_cp = (char) c; 1141 1142 yytext_ptr = yy_bp; 1143 yy_hold_char = *yy_cp; 1144 yy_c_buf_p = yy_cp; 1145} 1146#endif /* ifndef YY_NO_UNPUT */ 1147 1148#ifdef __cplusplus 1149static int yyinput() 1150#else 1151static int input() 1152#endif 1153{ 1154 int c; 1155 1156 *yy_c_buf_p = yy_hold_char; 1157 1158 if (*yy_c_buf_p == YY_END_OF_BUFFER_CHAR) 1159 { 1160 /* 1161 * yy_c_buf_p now points to the character we want to return. If 1162 * this occurs *before* the EOB characters, then it's a valid NUL; 1163 * if not, then we've hit the end of the buffer. 1164 */ 1165 if (yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars]) 1166 /* 1167 * This was really a NUL. 1168 */ 1169 *yy_c_buf_p = '\0'; 1170 1171 else 1172 { /* need more input */ 1173 int offset = yy_c_buf_p - yytext_ptr; 1174 ++yy_c_buf_p; 1175 1176 switch (yy_get_next_buffer()) 1177 { 1178 case EOB_ACT_LAST_MATCH: 1179 /* 1180 * This happens because yy_g_n_b() sees that we've 1181 * accumulated a token and flags that we need to try 1182 * matching the token before proceeding. But for input(), 1183 * there's no matching to consider. So convert the 1184 * EOB_ACT_LAST_MATCH to EOB_ACT_END_OF_FILE. 1185 */ 1186 1187 /* 1188 * Reset buffer status. 1189 */ 1190 yyrestart(yyin); 1191 1192 /* 1193 * fall through 1194 */ 1195 1196 case EOB_ACT_END_OF_FILE: 1197 { 1198 if (yywrap()) 1199 return EOF; 1200 1201 if (!yy_did_buffer_switch_on_eof) 1202 YY_NEW_FILE; 1203#ifdef __cplusplus 1204 return yyinput(); 1205#else 1206 return input(); 1207#endif 1208 } 1209 1210 case EOB_ACT_CONTINUE_SCAN: 1211 yy_c_buf_p = yytext_ptr + offset; 1212 break; 1213 } 1214 } 1215 } 1216 1217 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 1218 *yy_c_buf_p = '\0'; /* preserve yytext */ 1219 yy_hold_char = *++yy_c_buf_p; 1220 1221 return c; 1222} 1223 1224#ifdef YY_USE_PROTOS 1225void yyrestart(FILE * input_file) 1226#else 1227void yyrestart(input_file) 1228 FILE *input_file; 1229#endif 1230{ 1231 if (!yy_current_buffer) 1232 yy_current_buffer = yy_create_buffer(yyin, YY_BUF_SIZE); 1233 1234 yy_init_buffer(yy_current_buffer, input_file); 1235 yy_load_buffer_state(); 1236} 1237 1238#ifdef YY_USE_PROTOS 1239void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) 1240#else 1241void yy_switch_to_buffer(new_buffer) 1242 YY_BUFFER_STATE new_buffer; 1243#endif 1244{ 1245 if (yy_current_buffer == new_buffer) 1246 return; 1247 1248 if (yy_current_buffer) 1249 { 1250 /* 1251 * Flush out information for old buffer. 1252 */ 1253 *yy_c_buf_p = yy_hold_char; 1254 yy_current_buffer->yy_buf_pos = yy_c_buf_p; 1255 yy_current_buffer->yy_n_chars = yy_n_chars; 1256 } 1257 1258 yy_current_buffer = new_buffer; 1259 yy_load_buffer_state(); 1260 1261 /* 1262 * We don't actually know whether we did this switch during EOF 1263 * (yywrap()) processing, but the only time this flag is looked at is 1264 * after yywrap() is called, so it's safe to go ahead and always set 1265 * it. 1266 */ 1267 yy_did_buffer_switch_on_eof = 1; 1268} 1269 1270#ifdef YY_USE_PROTOS 1271void yy_load_buffer_state(void) 1272#else 1273void yy_load_buffer_state() 1274#endif 1275{ 1276 yy_n_chars = yy_current_buffer->yy_n_chars; 1277 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 1278 yyin = yy_current_buffer->yy_input_file; 1279 yy_hold_char = *yy_c_buf_p; 1280} 1281 1282#ifdef YY_USE_PROTOS 1283YY_BUFFER_STATE yy_create_buffer(FILE * file, int size) 1284#else 1285YY_BUFFER_STATE yy_create_buffer(file, size) 1286 FILE *file; 1287 int size; 1288#endif 1289{ 1290 YY_BUFFER_STATE b; 1291 1292 b = (YY_BUFFER_STATE) yy_flex_alloc(sizeof(struct yy_buffer_state)); 1293 if (!b) 1294 YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); 1295 1296 b->yy_buf_size = size; 1297 1298 /* 1299 * yy_ch_buf has to be 2 characters longer than the size given because 1300 * we need to put in 2 end-of-buffer characters. 1301 */ 1302 b->yy_ch_buf = (char *) yy_flex_alloc(b->yy_buf_size + 2); 1303 if (!b->yy_ch_buf) 1304 YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); 1305 1306 b->yy_is_our_buffer = 1; 1307 1308 yy_init_buffer(b, file); 1309 1310 return b; 1311} 1312 1313#ifdef YY_USE_PROTOS 1314void yy_delete_buffer(YY_BUFFER_STATE b) 1315#else 1316void yy_delete_buffer(b) 1317 YY_BUFFER_STATE b; 1318#endif 1319{ 1320 if (!b) 1321 return; 1322 1323 if (b == yy_current_buffer) 1324 yy_current_buffer = (YY_BUFFER_STATE) 0; 1325 1326 if (b->yy_is_our_buffer) 1327 yy_flex_free((void *) b->yy_ch_buf); 1328 1329 yy_flex_free((void *) b); 1330} 1331 1332#ifndef YY_ALWAYS_INTERACTIVE 1333#ifndef YY_NEVER_INTERACTIVE 1334extern int isatty YY_PROTO((int)); 1335#endif 1336#endif 1337 1338#ifdef YY_USE_PROTOS 1339void yy_init_buffer(YY_BUFFER_STATE b, FILE * file) 1340#else 1341void yy_init_buffer(b, file) 1342 YY_BUFFER_STATE b; 1343 FILE *file; 1344#endif 1345 1346{ 1347 yy_flush_buffer(b); 1348 1349 b->yy_input_file = file; 1350 b->yy_fill_buffer = 1; 1351 1352#if YY_ALWAYS_INTERACTIVE 1353 b->yy_is_interactive = 1; 1354#else 1355#if YY_NEVER_INTERACTIVE 1356 b->yy_is_interactive = 0; 1357#else 1358 b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0; 1359#endif 1360#endif 1361} 1362 1363#ifdef YY_USE_PROTOS 1364void yy_flush_buffer(YY_BUFFER_STATE b) 1365#else 1366void yy_flush_buffer(b) 1367 YY_BUFFER_STATE b; 1368#endif 1369 1370{ 1371 if (!b) 1372 return; 1373 1374 b->yy_n_chars = 0; 1375 1376 /* 1377 * We always need two end-of-buffer characters. The first causes a 1378 * transition to the end-of-buffer state. The second causes a jam in 1379 * that state. 1380 */ 1381 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1382 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1383 1384 b->yy_buf_pos = &b->yy_ch_buf[0]; 1385 1386 b->yy_at_bol = 1; 1387 b->yy_buffer_status = YY_BUFFER_NEW; 1388 1389 if (b == yy_current_buffer) 1390 yy_load_buffer_state(); 1391} 1392 1393#ifndef YY_NO_SCAN_BUFFER 1394#ifdef YY_USE_PROTOS 1395YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size) 1396#else 1397YY_BUFFER_STATE yy_scan_buffer(base, size) 1398 char *base; 1399 yy_size_t size; 1400#endif 1401{ 1402 YY_BUFFER_STATE b; 1403 1404 if (size < 2 || 1405 base[size - 2] != YY_END_OF_BUFFER_CHAR || 1406 base[size - 1] != YY_END_OF_BUFFER_CHAR) 1407 /* 1408 * They forgot to leave room for the EOB's. 1409 */ 1410 return 0; 1411 1412 b = (YY_BUFFER_STATE) yy_flex_alloc(sizeof(struct yy_buffer_state)); 1413 if (!b) 1414 YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); 1415 1416 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 1417 b->yy_buf_pos = b->yy_ch_buf = base; 1418 b->yy_is_our_buffer = 0; 1419 b->yy_input_file = 0; 1420 b->yy_n_chars = b->yy_buf_size; 1421 b->yy_is_interactive = 0; 1422 b->yy_at_bol = 1; 1423 b->yy_fill_buffer = 0; 1424 b->yy_buffer_status = YY_BUFFER_NEW; 1425 1426 yy_switch_to_buffer(b); 1427 1428 return b; 1429} 1430#endif 1431 1432#ifndef YY_NO_SCAN_STRING 1433#ifdef YY_USE_PROTOS 1434YY_BUFFER_STATE yy_scan_string(yyconst char *yy_str) 1435#else 1436YY_BUFFER_STATE yy_scan_string(yy_str) 1437 yyconst char *yy_str; 1438#endif 1439{ 1440 int len; 1441 for (len = 0; yy_str[len]; ++len) 1442 ; 1443 1444 return yy_scan_bytes(yy_str, len); 1445} 1446#endif 1447 1448#ifndef YY_NO_SCAN_BYTES 1449#ifdef YY_USE_PROTOS 1450YY_BUFFER_STATE yy_scan_bytes(yyconst char *bytes, int len) 1451#else 1452YY_BUFFER_STATE yy_scan_bytes(bytes, len) 1453 yyconst char *bytes; 1454 int len; 1455#endif 1456{ 1457 YY_BUFFER_STATE b; 1458 char *buf; 1459 yy_size_t n; 1460 int i; 1461 1462 /* 1463 * Get memory for full buffer, including space for trailing EOB's. 1464 */ 1465 n = len + 2; 1466 buf = (char *) yy_flex_alloc(n); 1467 if (!buf) 1468 YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); 1469 1470 for (i = 0; i < len; ++i) 1471 buf[i] = bytes[i]; 1472 1473 buf[len] = buf[len + 1] = YY_END_OF_BUFFER_CHAR; 1474 1475 b = yy_scan_buffer(buf, n); 1476 if (!b) 1477 YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); 1478 1479 /* 1480 * It's okay to grow etc. this buffer, and we should throw it away 1481 * when we're done. 1482 */ 1483 b->yy_is_our_buffer = 1; 1484 1485 return b; 1486} 1487#endif 1488 1489#ifndef YY_NO_PUSH_STATE 1490#ifdef YY_USE_PROTOS 1491static void yy_push_state(int new_state) 1492#else 1493static void yy_push_state(new_state) 1494 int new_state; 1495#endif 1496{ 1497 if (yy_start_stack_ptr >= yy_start_stack_depth) 1498 { 1499 yy_size_t new_size; 1500 1501 yy_start_stack_depth += YY_START_STACK_INCR; 1502 new_size = yy_start_stack_depth * sizeof(int); 1503 1504 if (!yy_start_stack) 1505 yy_start_stack = (int *) yy_flex_alloc(new_size); 1506 1507 else 1508 yy_start_stack = (int *) yy_flex_realloc( 1509 (void *) yy_start_stack, new_size); 1510 1511 if (!yy_start_stack) 1512 YY_FATAL_ERROR 1513 ("out of memory expanding start-condition stack"); 1514 } 1515 1516 yy_start_stack[yy_start_stack_ptr++] = YY_START; 1517 1518 BEGIN(new_state); 1519} 1520#endif 1521 1522#ifndef YY_NO_POP_STATE 1523static void yy_pop_state() 1524{ 1525 if (--yy_start_stack_ptr < 0) 1526 YY_FATAL_ERROR("start-condition stack underflow"); 1527 1528 BEGIN(yy_start_stack[yy_start_stack_ptr]); 1529} 1530#endif 1531 1532#ifndef YY_NO_TOP_STATE 1533static int yy_top_state() 1534{ 1535 return yy_start_stack[yy_start_stack_ptr - 1]; 1536} 1537#endif 1538 1539#ifndef YY_EXIT_FAILURE 1540#define YY_EXIT_FAILURE 2 1541#endif 1542 1543#ifdef YY_USE_PROTOS 1544static void yy_fatal_error(yyconst char msg[]) 1545#else 1546static void yy_fatal_error(msg) 1547 char msg[]; 1548#endif 1549{ 1550 (void) fprintf(stderr, "%s\n", msg); 1551 exit(YY_EXIT_FAILURE); 1552} 1553 1554/* 1555 * Redefine yyless() so it works in section 3 code. 1556 */ 1557 1558#undef yyless 1559#define yyless(n) \ 1560 do \ 1561 { \ 1562 /* Undo effects of setting up yytext. */ \ 1563 yytext[yyleng] = yy_hold_char; \ 1564 yy_c_buf_p = yytext + n; \ 1565 yy_hold_char = *yy_c_buf_p; \ 1566 *yy_c_buf_p = '\0'; \ 1567 yyleng = n; \ 1568 } \ 1569 while ( 0 ) 1570 1571/* 1572 * Internal utility routines. 1573 */ 1574 1575#ifndef yytext_ptr 1576#ifdef YY_USE_PROTOS 1577static void yy_flex_strncpy(char *s1, yyconst char *s2, int n) 1578#else 1579static void yy_flex_strncpy(s1, s2, n) 1580 char *s1; 1581 yyconst char *s2; 1582 int n; 1583#endif 1584{ 1585 register int i; 1586 for (i = 0; i < n; ++i) 1587 s1[i] = s2[i]; 1588} 1589#endif 1590 1591#ifdef YY_NEED_STRLEN 1592#ifdef YY_USE_PROTOS 1593static int yy_flex_strlen(yyconst char *s) 1594#else 1595static int yy_flex_strlen(s) 1596 yyconst char *s; 1597#endif 1598{ 1599 register int n; 1600 for (n = 0; s[n]; ++n) 1601 ; 1602 1603 return n; 1604} 1605#endif 1606 1607#ifdef YY_USE_PROTOS 1608static void *yy_flex_alloc(yy_size_t size) 1609#else 1610static void *yy_flex_alloc(size) 1611 yy_size_t size; 1612#endif 1613{ 1614 return (void *) malloc(size); 1615} 1616 1617#ifdef YY_USE_PROTOS 1618static void *yy_flex_realloc(void *ptr, yy_size_t size) 1619#else 1620static void *yy_flex_realloc(ptr, size) 1621 void *ptr; 1622 yy_size_t size; 1623#endif 1624{ 1625 /* 1626 * The cast to (char *) in the following accommodates both 1627 * implementations that use char* generic pointers, and those that use 1628 * void* generic pointers. It works with the latter because both ANSI 1629 * C and C++ allow castless assignment from any pointer type to void*, 1630 * and deal with argument conversions as though doing an assignment. 1631 */ 1632 return (void *) realloc((char *) ptr, size); 1633} 1634 1635#ifdef YY_USE_PROTOS 1636static void yy_flex_free(void *ptr) 1637#else 1638static void yy_flex_free(ptr) 1639 void *ptr; 1640#endif 1641{ 1642 free(ptr); 1643} 1644 1645#if YY_MAIN 1646int main() 1647{ 1648 yylex(); 1649 return 0; 1650} 1651#endif 1652#line 34 "bundleparser.l" 1653 1654#include <stdio.h> 1655#include <string.h> 1656 1657#include "wintypes.h" 1658#include "debuglog.h" 1659 1660int bpwrap() 1661{ 1662 return 1; 1663} 1664 1665void evalToken(char *pcToken, int tokType) 1666{ 1667 1668 int len; 1669 len = 0; 1670 1671 if (tokType == 1) 1672 { 1673 for (len = 5; pcToken[len] != '<'; len++) ; 1674 strncpy(pcKey, &pcToken[5], len - 5); 1675 pcKey[len - 5] = 0; 1676 } 1677 1678 if (tokType == 2) 1679 { 1680 for (len = 8; pcToken[len] != '<'; len++) ; 1681 strncpy(pcValue, &pcToken[8], len - 8); 1682 pcValue[len - 8] = 0; 1683 if (strcmp(pcKey, pcDesiredKey) == 0) 1684 { 1685 strcpy(pcFinValue, pcValue); 1686 } 1687 } 1688 1689} 1690 1691void errorCheck(char *token_error) 1692{ 1693} 1694 1695int LCFBundleFindValueWithKey(char *fileName, char *tokenKey, 1696 char *tokenValue) 1697{ 1698 1699 FILE *file; 1700 file = 0; 1701 1702 pcDesiredKey = tokenKey; 1703 pcFinValue[0] = 0; 1704 1705 file = fopen(fileName, "r"); 1706 1707 if (!file) 1708 { 1709 DebugLogB("Could not open bundle file : %s", fileName); 1710 return 1; 1711 } 1712 1713 bpin = file; 1714 1715 do 1716 { 1717 bplex(); 1718 } 1719 while (!feof(file)); 1720 1721 if (pcFinValue[0] == 0) 1722 { 1723 DebugLogB("Value/Key not defined for: %s", tokenKey); 1724 fclose(file); 1725 return -1; 1726 } else 1727 { 1728 strcpy(tokenValue, pcFinValue); 1729 fclose(file); 1730 return 0; 1731 } 1732 1733 fclose(file); 1734 return 0; 1735} 1736