Changeset 529
- Timestamp:
- 04/25/06 16:30:47 (3 years ago)
- Files:
-
- nepenthes/trunk/modules/shellcode-signatures/Makefile.am (modified) (2 diffs)
- nepenthes/trunk/modules/shellcode-signatures/Makefile.parser (modified) (1 diff)
- nepenthes/trunk/modules/shellcode-signatures/lex.nepenthes_shellcodesignatures_yy.c (moved) (moved from nepenthes/trunk/modules/shellcode-signatures/lex.yy.c) (72 diffs)
- nepenthes/trunk/modules/shellcode-signatures/parser.y (modified) (4 diffs)
- nepenthes/trunk/modules/shellcode-signatures/y.tab.c (modified) (7 diffs)
- nepenthes/trunk/modules/shellcode-signatures/y.tab.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/modules/shellcode-signatures/Makefile.am
r520 r529 7 7 AM_CPPFLAGS = -I$(top_srcdir)/nepenthes-core/include -I$(top_srcdir)/nepenthes-core/src -pipe -D _GNU_SOURCE 8 8 AM_CXXFLAGS = -Wall -Werror 9 AM_CFLAGS = -Wall 9 10 AM_LDFLAGS = -lpcre 10 11 … … 13 14 14 15 shellcodesignatures_la_SOURCES = shellcode-signatures.sc 15 shellcodesignatures_la_SOURCES += y.tab.c lex. yy.c y.tab.h16 shellcodesignatures_la_SOURCES += y.tab.c lex.nepenthes_shellcodesignatures_yy.c y.tab.h 16 17 shellcodesignatures_la_SOURCES += parser.hpp parser.h 17 18 shellcodesignatures_la_SOURCES += shellcode-signatures.cpp shellcode-signatures.hpp nepenthes/trunk/modules/shellcode-signatures/Makefile.parser
r422 r529 4 4 5 5 lex.yy.c: parser.l 6 lex $^6 lex -P nepenthes_shellcodesignatures_yy $^ 7 7 8 8 y.tab.c: parser.y 9 yacc - d $^9 yacc -p nepenthes_shellcodesignatures_yy -d $^ 10 10 11 11 clean: nepenthes/trunk/modules/shellcode-signatures/lex.nepenthes_shellcodesignatures_yy.c
r521 r529 1 1 2 #line 3 "lex. yy.c"2 #line 3 "lex.nepenthes_shellcodesignatures_yy.c" 3 3 4 4 #define YY_INT_ALIGNED short int … … 126 126 127 127 /* Special action meaning "start processing a new file". */ 128 #define YY_NEW_FILE yyrestart(yyin )128 #define YY_NEW_FILE nepenthes_shellcodesignatures_yyrestart(nepenthes_shellcodesignatures_yyin ) 129 129 130 130 #define YY_END_OF_BUFFER_CHAR 0 … … 140 140 #endif 141 141 142 extern int yyleng;143 144 extern FILE * yyin, *yyout;142 extern int nepenthes_shellcodesignatures_yyleng; 143 144 extern FILE *nepenthes_shellcodesignatures_yyin, *nepenthes_shellcodesignatures_yyout; 145 145 146 146 #define EOB_ACT_CONTINUE_SCAN 0 … … 154 154 do \ 155 155 { \ 156 /* Undo effects of setting up yytext. */ \156 /* Undo effects of setting up nepenthes_shellcodesignatures_yytext. */ \ 157 157 int yyless_macro_arg = (n); \ 158 158 YY_LESS_LINENO(yyless_macro_arg);\ … … 160 160 YY_RESTORE_YY_MORE_OFFSET \ 161 161 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 162 YY_DO_BEFORE_ACTION; /* set up yytext again */ \162 YY_DO_BEFORE_ACTION; /* set up nepenthes_shellcodesignatures_yytext again */ \ 163 163 } \ 164 164 while ( 0 ) … … 233 233 * 234 234 * When we actually see the EOF, we change the status to "new" 235 * (via yyrestart()), so that the user can continue scanning by236 * just pointing yyin at a new input file.235 * (via nepenthes_shellcodesignatures_yyrestart()), so that the user can continue scanning by 236 * just pointing nepenthes_shellcodesignatures_yyin at a new input file. 237 237 */ 238 238 #define YY_BUFFER_EOF_PENDING 2 … … 261 261 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 262 262 263 /* yy_hold_char holds the character lost when yytext is formed. */263 /* yy_hold_char holds the character lost when nepenthes_shellcodesignatures_yytext is formed. */ 264 264 static char yy_hold_char; 265 265 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 266 int yyleng;266 int nepenthes_shellcodesignatures_yyleng; 267 267 268 268 /* Points to current character in buffer. */ … … 271 271 static int yy_start = 0; /* start state number */ 272 272 273 /* Flag which is used to allow yywrap()'s to do buffer switches274 * instead of setting up a fresh yyin. A bit of a hack ...273 /* Flag which is used to allow nepenthes_shellcodesignatures_yywrap()'s to do buffer switches 274 * instead of setting up a fresh nepenthes_shellcodesignatures_yyin. A bit of a hack ... 275 275 */ 276 276 static int yy_did_buffer_switch_on_eof; 277 277 278 void yyrestart (FILE *input_file );279 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );280 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );281 void yy_delete_buffer (YY_BUFFER_STATE b );282 void yy_flush_buffer (YY_BUFFER_STATE b );283 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );284 void yypop_buffer_state (void );285 286 static void yyensure_buffer_stack (void );287 static void yy_load_buffer_state (void );288 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );289 290 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )291 292 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );293 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );294 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );295 296 void * yyalloc (yy_size_t );297 void * yyrealloc (void *,yy_size_t );298 void yyfree (void * );299 300 #define yy_new_buffer yy_create_buffer278 void nepenthes_shellcodesignatures_yyrestart (FILE *input_file ); 279 void nepenthes_shellcodesignatures_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 280 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_create_buffer (FILE *file,int size ); 281 void nepenthes_shellcodesignatures_yy_delete_buffer (YY_BUFFER_STATE b ); 282 void nepenthes_shellcodesignatures_yy_flush_buffer (YY_BUFFER_STATE b ); 283 void nepenthes_shellcodesignatures_yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 284 void nepenthes_shellcodesignatures_yypop_buffer_state (void ); 285 286 static void nepenthes_shellcodesignatures_yyensure_buffer_stack (void ); 287 static void nepenthes_shellcodesignatures_yy_load_buffer_state (void ); 288 static void nepenthes_shellcodesignatures_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 289 290 #define YY_FLUSH_BUFFER nepenthes_shellcodesignatures_yy_flush_buffer(YY_CURRENT_BUFFER ) 291 292 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_scan_buffer (char *base,yy_size_t size ); 293 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_scan_string (yyconst char *yy_str ); 294 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_scan_bytes (yyconst char *bytes,int len ); 295 296 void *nepenthes_shellcodesignatures_yyalloc (yy_size_t ); 297 void *nepenthes_shellcodesignatures_yyrealloc (void *,yy_size_t ); 298 void nepenthes_shellcodesignatures_yyfree (void * ); 299 300 #define yy_new_buffer nepenthes_shellcodesignatures_yy_create_buffer 301 301 302 302 #define yy_set_interactive(is_interactive) \ 303 303 { \ 304 304 if ( ! YY_CURRENT_BUFFER ){ \ 305 yyensure_buffer_stack (); \305 nepenthes_shellcodesignatures_yyensure_buffer_stack (); \ 306 306 YY_CURRENT_BUFFER_LVALUE = \ 307 yy_create_buffer(yyin,YY_BUF_SIZE ); \307 nepenthes_shellcodesignatures_yy_create_buffer(nepenthes_shellcodesignatures_yyin,YY_BUF_SIZE ); \ 308 308 } \ 309 309 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ … … 313 313 { \ 314 314 if ( ! YY_CURRENT_BUFFER ){\ 315 yyensure_buffer_stack (); \315 nepenthes_shellcodesignatures_yyensure_buffer_stack (); \ 316 316 YY_CURRENT_BUFFER_LVALUE = \ 317 yy_create_buffer(yyin,YY_BUF_SIZE ); \317 nepenthes_shellcodesignatures_yy_create_buffer(nepenthes_shellcodesignatures_yyin,YY_BUF_SIZE ); \ 318 318 } \ 319 319 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ … … 326 326 typedef unsigned char YY_CHAR; 327 327 328 FILE * yyin = (FILE *) 0, *yyout = (FILE *) 0;328 FILE *nepenthes_shellcodesignatures_yyin = (FILE *) 0, *nepenthes_shellcodesignatures_yyout = (FILE *) 0; 329 329 330 330 typedef int yy_state_type; 331 331 332 extern int yylineno;333 334 int yylineno = 1;335 336 extern char * yytext;337 #define yytext_ptr yytext332 extern int nepenthes_shellcodesignatures_yylineno; 333 334 int nepenthes_shellcodesignatures_yylineno = 1; 335 336 extern char *nepenthes_shellcodesignatures_yytext; 337 #define yytext_ptr nepenthes_shellcodesignatures_yytext 338 338 339 339 static yy_state_type yy_get_previous_state (void ); … … 343 343 344 344 /* Done after the current pattern has been matched and before the 345 * corresponding action - sets up yytext.345 * corresponding action - sets up nepenthes_shellcodesignatures_yytext. 346 346 */ 347 347 #define YY_DO_BEFORE_ACTION \ 348 348 (yytext_ptr) = yy_bp; \ 349 yyleng = (size_t) (yy_cp - yy_bp); \349 nepenthes_shellcodesignatures_yyleng = (size_t) (yy_cp - yy_bp); \ 350 350 (yy_hold_char) = *yy_cp; \ 351 351 *yy_cp = '\0'; \ … … 580 580 static char *yy_last_accepting_cpos; 581 581 582 extern int yy_flex_debug;583 int yy_flex_debug = 0;582 extern int nepenthes_shellcodesignatures_yy_flex_debug; 583 int nepenthes_shellcodesignatures_yy_flex_debug = 0; 584 584 585 585 /* The intent behind this definition is that it'll catch … … 590 590 #define YY_MORE_ADJ 0 591 591 #define YY_RESTORE_YY_MORE_OFFSET 592 char * yytext;592 char *nepenthes_shellcodesignatures_yytext; 593 593 #line 1 "parser.l" 594 594 /* $Id$ */ … … 608 608 609 609 610 #line 611 "lex. yy.c"610 #line 611 "lex.nepenthes_shellcodesignatures_yy.c" 611 611 612 612 #define INITIAL 0 … … 632 632 #ifndef YY_SKIP_YYWRAP 633 633 #ifdef __cplusplus 634 extern "C" int yywrap (void );634 extern "C" int nepenthes_shellcodesignatures_yywrap (void ); 635 635 #else 636 extern int yywrap (void );636 extern int nepenthes_shellcodesignatures_yywrap (void ); 637 637 #endif 638 638 #endif … … 668 668 * we now use fwrite(). 669 669 */ 670 #define ECHO (void) fwrite( yytext, yyleng, 1,yyout )670 #define ECHO (void) fwrite( nepenthes_shellcodesignatures_yytext, nepenthes_shellcodesignatures_yyleng, 1, nepenthes_shellcodesignatures_yyout ) 671 671 #endif 672 672 … … 681 681 size_t n; \ 682 682 for ( n = 0; n < max_size && \ 683 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \683 (c = getc( nepenthes_shellcodesignatures_yyin )) != EOF && c != '\n'; ++n ) \ 684 684 buf[n] = (char) c; \ 685 685 if ( c == '\n' ) \ 686 686 buf[n++] = (char) c; \ 687 if ( c == EOF && ferror( yyin ) ) \687 if ( c == EOF && ferror( nepenthes_shellcodesignatures_yyin ) ) \ 688 688 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 689 689 result = n; \ … … 692 692 { \ 693 693 errno=0; \ 694 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \694 while ( (result = fread(buf, 1, max_size, nepenthes_shellcodesignatures_yyin))==0 && ferror(nepenthes_shellcodesignatures_yyin)) \ 695 695 { \ 696 696 if( errno != EINTR) \ … … 700 700 } \ 701 701 errno=0; \ 702 clearerr( yyin); \702 clearerr(nepenthes_shellcodesignatures_yyin); \ 703 703 } \ 704 704 }\ … … 733 733 #define YY_DECL_IS_OURS 1 734 734 735 extern int yylex (void);736 737 #define YY_DECL int yylex (void)735 extern int nepenthes_shellcodesignatures_yylex (void); 736 737 #define YY_DECL int nepenthes_shellcodesignatures_yylex (void) 738 738 #endif /* !YY_DECL */ 739 739 740 /* Code executed at the beginning of each rule, after yytext andyyleng740 /* Code executed at the beginning of each rule, after nepenthes_shellcodesignatures_yytext and nepenthes_shellcodesignatures_yyleng 741 741 * have been set up. 742 742 */ … … 765 765 766 766 767 #line 768 "lex. yy.c"767 #line 768 "lex.nepenthes_shellcodesignatures_yy.c" 768 768 769 769 if ( (yy_init) ) … … 778 778 (yy_start) = 1; /* first start state */ 779 779 780 if ( ! yyin )781 yyin = stdin;782 783 if ( ! yyout )784 yyout = stdout;780 if ( ! nepenthes_shellcodesignatures_yyin ) 781 nepenthes_shellcodesignatures_yyin = stdin; 782 783 if ( ! nepenthes_shellcodesignatures_yyout ) 784 nepenthes_shellcodesignatures_yyout = stdout; 785 785 786 786 if ( ! YY_CURRENT_BUFFER ) { 787 yyensure_buffer_stack ();787 nepenthes_shellcodesignatures_yyensure_buffer_stack (); 788 788 YY_CURRENT_BUFFER_LVALUE = 789 yy_create_buffer(yyin,YY_BUF_SIZE );789 nepenthes_shellcodesignatures_yy_create_buffer(nepenthes_shellcodesignatures_yyin,YY_BUF_SIZE ); 790 790 } 791 791 792 yy_load_buffer_state( );792 nepenthes_shellcodesignatures_yy_load_buffer_state( ); 793 793 } 794 794 … … 797 797 yy_cp = (yy_c_buf_p); 798 798 799 /* Support of yytext. */799 /* Support of nepenthes_shellcodesignatures_yytext. */ 800 800 *yy_cp = (yy_hold_char); 801 801 … … 1046 1046 YY_RULE_SETUP 1047 1047 #line 75 "parser.l" 1048 { string_append( yytext,yyleng); return SC_ID; }1048 { string_append(nepenthes_shellcodesignatures_yytext, nepenthes_shellcodesignatures_yyleng); return SC_ID; } 1049 1049 YY_BREAK 1050 1050 case 41: … … 1118 1118 #line 92 "parser.l" 1119 1119 { 1120 char hexval[] = {'0', 'x', *( yytext + 2), *(yytext + 3), '\0'};1120 char hexval[] = {'0', 'x', *(nepenthes_shellcodesignatures_yytext + 2), *(nepenthes_shellcodesignatures_yytext + 3), '\0'}; 1121 1121 unsigned int c; 1122 1122 … … 1129 1129 YY_RULE_SETUP 1130 1130 #line 99 "parser.l" 1131 { string_append( yytext,yyleng); }1131 { string_append(nepenthes_shellcodesignatures_yytext, nepenthes_shellcodesignatures_yyleng); } 1132 1132 YY_BREAK 1133 1133 case 56: … … 1162 1162 ECHO; 1163 1163 YY_BREAK 1164 #line 1165 "lex. yy.c"1164 #line 1165 "lex.nepenthes_shellcodesignatures_yy.c" 1165 1165 case YY_STATE_EOF(INITIAL): 1166 1166 case YY_STATE_EOF(comment): … … 1181 1181 /* We're scanning a new file or input source. It's 1182 1182 * possible that this happened because the user 1183 * just pointed yyin at a new source and called1184 * yylex(). If so, then we have to assure1183 * just pointed nepenthes_shellcodesignatures_yyin at a new source and called 1184 * nepenthes_shellcodesignatures_yylex(). If so, then we have to assure 1185 1185 * consistency between YY_CURRENT_BUFFER and our 1186 1186 * globals. Here is the right place to do so, because … … 1189 1189 */ 1190 1190 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1191 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;1191 YY_CURRENT_BUFFER_LVALUE->yy_input_file = nepenthes_shellcodesignatures_yyin; 1192 1192 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 1193 1193 } … … 1242 1242 (yy_did_buffer_switch_on_eof) = 0; 1243 1243 1244 if ( yywrap( ) )1244 if ( nepenthes_shellcodesignatures_yywrap( ) ) 1245 1245 { 1246 1246 /* Note: because we've taken care in 1247 1247 * yy_get_next_buffer() to have set up 1248 * yytext, we can now set up1248 * nepenthes_shellcodesignatures_yytext, we can now set up 1249 1249 * yy_c_buf_p so that if some total 1250 1250 * hoser (like flex itself) wants to … … 1295 1295 } /* end of action switch */ 1296 1296 } /* end of scanning one token */ 1297 } /* end of yylex */1297 } /* end of nepenthes_shellcodesignatures_yylex */ 1298 1298 1299 1299 /* yy_get_next_buffer - try to read in a new buffer … … 1373 1373 b->yy_ch_buf = (char *) 1374 1374 /* Include room in for 2 EOB chars. */ 1375 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );1375 nepenthes_shellcodesignatures_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 1376 1376 } 1377 1377 else … … 1405 1405 { 1406 1406 ret_val = EOB_ACT_END_OF_FILE; 1407 yyrestart(yyin );1407 nepenthes_shellcodesignatures_yyrestart(nepenthes_shellcodesignatures_yyin ); 1408 1408 } 1409 1409 … … 1491 1491 yy_cp = (yy_c_buf_p); 1492 1492 1493 /* undo effects of setting up yytext */1493 /* undo effects of setting up nepenthes_shellcodesignatures_yytext */ 1494 1494 *yy_cp = (yy_hold_char); 1495 1495 … … 1563 1563 1564 1564 /* Reset buffer status. */ 1565 yyrestart(yyin );1565 nepenthes_shellcodesignatures_yyrestart(nepenthes_shellcodesignatures_yyin ); 1566 1566 1567 1567 /*FALLTHROUGH*/ … … 1569 1569 case EOB_ACT_END_OF_FILE: 1570 1570 { 1571 if ( yywrap( ) )1571 if ( nepenthes_shellcodesignatures_yywrap( ) ) 1572 1572 return EOF; 1573 1573 … … 1589 1589 1590 1590 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 1591 *(yy_c_buf_p) = '\0'; /* preserve yytext */1591 *(yy_c_buf_p) = '\0'; /* preserve nepenthes_shellcodesignatures_yytext */ 1592 1592 (yy_hold_char) = *++(yy_c_buf_p); 1593 1593 … … 1601 1601 * @note This function does not reset the start condition to @c INITIAL . 1602 1602 */ 1603 void yyrestart (FILE * input_file )1603 void nepenthes_shellcodesignatures_yyrestart (FILE * input_file ) 1604 1604 { 1605 1605 1606 1606 if ( ! YY_CURRENT_BUFFER ){ 1607 yyensure_buffer_stack ();1607 nepenthes_shellcodesignatures_yyensure_buffer_stack (); 1608 1608 YY_CURRENT_BUFFER_LVALUE = 1609 yy_create_buffer(yyin,YY_BUF_SIZE );1609 nepenthes_shellcodesignatures_yy_create_buffer(nepenthes_shellcodesignatures_yyin,YY_BUF_SIZE ); 1610 1610 } 1611 1611 1612 yy_init_buffer(YY_CURRENT_BUFFER,input_file );1613 yy_load_buffer_state( );1612 nepenthes_shellcodesignatures_yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 1613 nepenthes_shellcodesignatures_yy_load_buffer_state( ); 1614 1614 } 1615 1615 … … 1618 1618 * 1619 1619 */ 1620 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )1620 void nepenthes_shellcodesignatures_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1621 1621 { 1622 1622 1623 1623 /* TODO. We should be able to replace this entire function body 1624 1624 * with 1625 * yypop_buffer_state();1626 * yypush_buffer_state(new_buffer);1625 * nepenthes_shellcodesignatures_yypop_buffer_state(); 1626 * nepenthes_shellcodesignatures_yypush_buffer_state(new_buffer); 1627 1627 */ 1628 yyensure_buffer_stack ();1628 nepenthes_shellcodesignatures_yyensure_buffer_stack (); 1629 1629 if ( YY_CURRENT_BUFFER == new_buffer ) 1630 1630 return; … … 1639 1639 1640 1640 YY_CURRENT_BUFFER_LVALUE = new_buffer; 1641 yy_load_buffer_state( );1641 nepenthes_shellcodesignatures_yy_load_buffer_state( ); 1642 1642 1643 1643 /* We don't actually know whether we did this switch during 1644 * EOF ( yywrap()) processing, but the only time this flag1645 * is looked at is after yywrap() is called, so it's safe1644 * EOF (nepenthes_shellcodesignatures_yywrap()) processing, but the only time this flag 1645 * is looked at is after nepenthes_shellcodesignatures_yywrap() is called, so it's safe 1646 1646 * to go ahead and always set it. 1647 1647 */ … … 1649 1649 } 1650 1650 1651 static void yy_load_buffer_state (void)1651 static void nepenthes_shellcodesignatures_yy_load_buffer_state (void) 1652 1652 { 1653 1653 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1654 1654 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1655 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;1655 nepenthes_shellcodesignatures_yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1656 1656 (yy_hold_char) = *(yy_c_buf_p); 1657 1657 } … … 1663 1663 * @return the allocated buffer state. 1664 1664 */ 1665 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )1665 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_create_buffer (FILE * file, int size ) 1666 1666 { 1667 1667 YY_BUFFER_STATE b; 1668 1668 1669 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );1669 b = (YY_BUFFER_STATE) nepenthes_shellcodesignatures_yyalloc(sizeof( struct yy_buffer_state ) ); 1670 1670 if ( ! b ) 1671 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );1671 YY_FATAL_ERROR( "out of dynamic memory in nepenthes_shellcodesignatures_yy_create_buffer()" ); 1672 1672 1673 1673 b->yy_buf_size = size; … … 1676 1676 * we need to put in 2 end-of-buffer characters. 1677 1677 */ 1678 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );1678 b->yy_ch_buf = (char *) nepenthes_shellcodesignatures_yyalloc(b->yy_buf_size + 2 ); 1679 1679 if ( ! b->yy_ch_buf ) 1680 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );1680 YY_FATAL_ERROR( "out of dynamic memory in nepenthes_shellcodesignatures_yy_create_buffer()" ); 1681 1681 1682 1682 b->yy_is_our_buffer = 1; 1683 1683 1684 yy_init_buffer(b,file );1684 nepenthes_shellcodesignatures_yy_init_buffer(b,file ); 1685 1685 1686 1686 return b; … … 1688 1688 1689 1689 /** Destroy the buffer. 1690 * @param b a buffer created with yy_create_buffer()1690 * @param b a buffer created with nepenthes_shellcodesignatures_yy_create_buffer() 1691 1691 * 1692 1692 */ 1693 void yy_delete_buffer (YY_BUFFER_STATE b )1693 void nepenthes_shellcodesignatures_yy_delete_buffer (YY_BUFFER_STATE b ) 1694 1694 { 1695 1695 … … 1701 1701 1702 1702 if ( b->yy_is_our_buffer ) 1703 yyfree((void *) b->yy_ch_buf );1704 1705 yyfree((void *) b );1703 nepenthes_shellcodesignatures_yyfree((void *) b->yy_ch_buf ); 1704 1705 nepenthes_shellcodesignatures_yyfree((void *) b ); 1706 1706 } 1707 1707 … … 1712 1712 /* Initializes or reinitializes a buffer. 1713 1713 * This function is sometimes called more than once on the same buffer, 1714 * such as during a yyrestart() or at EOF.1715 */ 1716 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )1714 * such as during a nepenthes_shellcodesignatures_yyrestart() or at EOF. 1715 */ 1716 static void nepenthes_shellcodesignatures_yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1717 1717 1718 1718 { 1719 1719 int oerrno = errno; 1720 1720 1721 yy_flush_buffer(b );1721 nepenthes_shellcodesignatures_yy_flush_buffer(b ); 1722 1722 1723 1723 b->yy_input_file = file; 1724 1724 b->yy_fill_buffer = 1; 1725 1725 1726 /* If b is the current buffer, then yy_init_buffer was _probably_1727 * called from yyrestart() or through yy_get_next_buffer.1726 /* If b is the current buffer, then nepenthes_shellcodesignatures_yy_init_buffer was _probably_ 1727 * called from nepenthes_shellcodesignatures_yyrestart() or through yy_get_next_buffer. 1728 1728 * In that case, we don't want to reset the lineno or column. 1729 1729 */ … … 1742 1742 * 1743 1743 */ 1744 void yy_flush_buffer (YY_BUFFER_STATE b )1744 void nepenthes_shellcodesignatures_yy_flush_buffer (YY_BUFFER_STATE b ) 1745 1745 { 1746 1746 if ( ! b ) … … 1762 1762 1763 1763 if ( b == YY_CURRENT_BUFFER ) 1764 yy_load_buffer_state( );1764 nepenthes_shellcodesignatures_yy_load_buffer_state( ); 1765 1765 } 1766 1766 … … 1771 1771 * 1772 1772 */ 1773 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )1773 void nepenthes_shellcodesignatures_yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1774 1774 { 1775 1775 if (new_buffer == NULL) 1776 1776 return; 1777 1777 1778 yyensure_buffer_stack();1779 1780 /* This block is copied from yy_switch_to_buffer. */1778 nepenthes_shellcodesignatures_yyensure_buffer_stack(); 1779 1780 /* This block is copied from nepenthes_shellcodesignatures_yy_switch_to_buffer. */ 1781 1781 if ( YY_CURRENT_BUFFER ) 1782 1782 { … … 1792 1792 YY_CURRENT_BUFFER_LVALUE = new_buffer; 1793 1793 1794 /* copied from yy_switch_to_buffer. */1795 yy_load_buffer_state( );1794 /* copied from nepenthes_shellcodesignatures_yy_switch_to_buffer. */ 1795 nepenthes_shellcodesignatures_yy_load_buffer_state( ); 1796 1796 (yy_did_buffer_switch_on_eof) = 1; 1797 1797 } … … 1801 1801 * 1802 1802 */ 1803 void yypop_buffer_state (void)1803 void nepenthes_shellcodesignatures_yypop_buffer_state (void) 1804 1804 { 1805 1805 if (!YY_CURRENT_BUFFER) 1806 1806 return; 1807 1807 1808 yy_delete_buffer(YY_CURRENT_BUFFER );1808 nepenthes_shellcodesignatures_yy_delete_buffer(YY_CURRENT_BUFFER ); 1809 1809 YY_CURRENT_BUFFER_LVALUE = NULL; 1810 1810 if ((yy_buffer_stack_top) > 0) … … 1812 1812 1813 1813 if (YY_CURRENT_BUFFER) { 1814 yy_load_buffer_state( );1814 nepenthes_shellcodesignatures_yy_load_buffer_state( ); 1815 1815 (yy_did_buffer_switch_on_eof) = 1; 1816 1816 } … … 1820 1820 * Guarantees space for at least one push. 1821 1821 */ 1822 static void yyensure_buffer_stack (void)1822 static void nepenthes_shellcodesignatures_yyensure_buffer_stack (void) 1823 1823 { 1824 1824 int num_to_alloc; … … 1831 1831 */ 1832 1832 num_to_alloc = 1; 1833 (yy_buffer_stack) = (struct yy_buffer_state**) yyalloc1833 (yy_buffer_stack) = (struct yy_buffer_state**)nepenthes_shellcodesignatures_yyalloc 1834 1834 (num_to_alloc * sizeof(struct yy_buffer_state*) 1835 1835 ); … … 1848 1848 1849 1849 num_to_alloc = (yy_buffer_stack_max) + grow_size; 1850 (yy_buffer_stack) = (struct yy_buffer_state**) yyrealloc1850 (yy_buffer_stack) = (struct yy_buffer_state**)nepenthes_shellcodesignatures_yyrealloc 1851 1851 ((yy_buffer_stack), 1852 1852 num_to_alloc * sizeof(struct yy_buffer_state*) … … 1865 1865 * @return the newly allocated buffer state object. 1866 1866 */ 1867 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )1867 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_scan_buffer (char * base, yy_size_t size ) 1868 1868 { 1869 1869 YY_BUFFER_STATE b; … … 1875 1875 return 0; 1876 1876 1877 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );1877 b = (YY_BUFFER_STATE) nepenthes_shellcodesignatures_yyalloc(sizeof( struct yy_buffer_state ) ); 1878 1878 if ( ! b ) 1879 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );1879 YY_FATAL_ERROR( "out of dynamic memory in nepenthes_shellcodesignatures_yy_scan_buffer()" ); 1880 1880 1881 1881 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ … … 1889 1889 b->yy_buffer_status = YY_BUFFER_NEW; 1890 1890 1891 yy_switch_to_buffer(b );1891 nepenthes_shellcodesignatures_yy_switch_to_buffer(b ); 1892 1892 1893 1893 return b; 1894 1894 } 1895 1895 1896 /** Setup the input buffer state to scan a string. The next call to yylex() will1896 /** Setup the input buffer state to scan a string. The next call to nepenthes_shellcodesignatures_yylex() will 1897 1897 * scan from a @e copy of @a str. 1898 1898 * @param str a NUL-terminated string to scan … … 1901 1901 * @return the newly allocated buffer state object. 1902 1902 * @note If you want to scan bytes that may contain NUL values, then use 1903 * yy_scan_bytes() instead.1904 */ 1905 YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )1903 * nepenthes_shellcodesignatures_yy_scan_bytes() instead. 1904 */ 1905 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_scan_string (yyconst char * yy_str ) 1906 1906 { 1907 1907 1908 return yy_scan_bytes(yy_str,strlen(yy_str) );1909 } 1910 1911 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will1908 return nepenthes_shellcodesignatures_yy_scan_bytes(yy_str,strlen(yy_str) ); 1909 } 1910 1911 /** Setup the input buffer state to scan the given bytes. The next call to nepenthes_shellcodesignatures_yylex() will 1912 1912 * scan from a @e copy of @a bytes. 1913 1913 * @param bytes the byte buffer to scan … … 1916 1916 * @return the newly allocated buffer state object. 1917 1917 */ 1918 YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )1918 YY_BUFFER_STATE nepenthes_shellcodesignatures_yy_scan_bytes (yyconst char * bytes, int len ) 1919 1919 { 1920 1920 YY_BUFFER_STATE b; … … 1925 1925 /* Get memory for full buffer, including space for trailing EOB's. */ 1926 1926 n = len + 2; 1927 buf = (char *) yyalloc(n );1927 buf = (char *) nepenthes_shellcodesignatures_yyalloc(n ); 1928 1928 if ( ! buf ) 1929 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );1929 YY_FATAL_ERROR( "out of dynamic memory in nepenthes_shellcodesignatures_yy_scan_bytes()" ); 1930 1930 1931 1931 for ( i = 0; i < len; ++i ) … … 1934 1934 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 1935 1935 1936 b = yy_scan_buffer(buf,n );1936 b = nepenthes_shellcodesignatures_yy_scan_buffer(buf,n ); 1937 1937 if ( ! b ) 1938 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );1938 YY_FATAL_ERROR( "bad buffer in nepenthes_shellcodesignatures_yy_scan_bytes()" ); 1939 1939 1940 1940 /* It's okay to grow etc. this buffer, and we should throw it … … 1962 1962 do \ 1963 1963 { \ 1964 /* Undo effects of setting up yytext. */ \1964 /* Undo effects of setting up nepenthes_shellcodesignatures_yytext. */ \ 1965 1965 int yyless_macro_arg = (n); \ 1966 1966 YY_LESS_LINENO(yyless_macro_arg);\ 1967 yytext[yyleng] = (yy_hold_char); \1968 (yy_c_buf_p) = yytext + yyless_macro_arg; \1967 nepenthes_shellcodesignatures_yytext[nepenthes_shellcodesignatures_yyleng] = (yy_hold_char); \ 1968 (yy_c_buf_p) = nepenthes_shellcodesignatures_yytext + yyless_macro_arg; \ 1969 1969 (yy_hold_char) = *(yy_c_buf_p); \ 1970 1970 *(yy_c_buf_p) = '\0'; \ 1971 yyleng = yyless_macro_arg; \1971 nepenthes_shellcodesignatures_yyleng = yyless_macro_arg; \ 1972 1972 } \ 1973 1973 while ( 0 ) … … 1978 1978 * 1979 1979 */ 1980 int yyget_lineno (void)1980 int nepenthes_shellcodesignatures_yyget_lineno (void) 1981 1981 { 1982 1982 1983 return yylineno;1983 return nepenthes_shellcodesignatures_yylineno; 1984 1984 } 1985 1985 … … 1987 1987 * 1988 1988 */ 1989 FILE * yyget_in (void)1990 { 1991 return yyin;1989 FILE *nepenthes_shellcodesignatures_yyget_in (void) 1990 { 1991 return nepenthes_shellcodesignatures_yyin; 1992 1992 } 1993 1993 … … 1995 1995 * 1996 1996 */ 1997 FILE * yyget_out (void)1998 { 1999 return yyout;1997 FILE *nepenthes_shellcodesignatures_yyget_out (void) 1998 { 1999 return nepenthes_shellcodesignatures_yyout; 2000 2000 } 2001 2001 … … 2003 2003 * 2004 2004 */ 2005 int yyget_leng (void)2006 { 2007 return yyleng;2005 int nepenthes_shellcodesignatures_yyget_leng (void) 2006 { 2007 return nepenthes_shellcodesignatures_yyleng; 2008 2008 } 2009 2009 … … 2012 2012 */ 2013 2013 2014 char * yyget_text (void)2015 { 2016 return yytext;2014 char *nepenthes_shellcodesignatures_yyget_text (void) 2015 { 2016 return nepenthes_shellcodesignatures_yytext; 2017 2017 } 2018 2018 … … 2021 2021 * 2022 2022 */ 2023 void yyset_lineno (int line_number )2023 void nepenthes_shellcodesignatures_yyset_lineno (int line_number ) 2024 2024 { 2025 2025 2026 yylineno = line_number;2026 nepenthes_shellcodesignatures_yylineno = line_number; 2027 2027 } 2028 2028 … … 2031 2031 * @param in_str A readable stream. 2032 2032 * 2033 * @see yy_switch_to_buffer2034 */ 2035 void yyset_in (FILE * in_str )2036 { 2037 yyin = in_str ;2038 } 2039 2040 void yyset_out (FILE * out_str )2041 { 2042 yyout = out_str ;2043 } 2044 2045 int yyget_debug (void)2046 { 2047 return yy_flex_debug;2048 } 2049 2050 void yyset_debug (int bdebug )2051 { 2052 yy_flex_debug = bdebug ;2053 } 2054 2055 /* yylex_destroy is for both reentrant and non-reentrant scanners. */2056 int yylex_destroy (void)2033 * @see nepenthes_shellcodesignatures_yy_switch_to_buffer 2034 */ 2035 void nepenthes_shellcodesignatures_yyset_in (FILE * in_str ) 2036 { 2037 nepenthes_shellcodesignatures_yyin = in_str ; 2038 } 2039 2040 void nepenthes_shellcodesignatures_yyset_out (FILE * out_str ) 2041 { 2042 nepenthes_shellcodesignatures_yyout = out_str ; 2043 } 2044 2045 int nepenthes_shellcodesignatures_yyget_debug (void) 2046 { 2047 return nepenthes_shellcodesignatures_yy_flex_debug; 2048 } 2049 2050 void nepenthes_shellcodesignatures_yyset_debug (int bdebug ) 2051 { 2052 nepenthes_shellcodesignatures_yy_flex_debug = bdebug ; 2053 } 2054 2055 /* nepenthes_shellcodesignatures_yylex_destroy is for both reentrant and non-reentrant scanners. */ 2056 int nepenthes_shellcodesignatures_yylex_destroy (void) 2057 2057 { 2058 2058 2059 2059 /* Pop the buffer stack, destroying each element. */ 2060 2060 while(YY_CURRENT_BUFFER){ 2061 yy_delete_buffer(YY_CURRENT_BUFFER );2061 nepenthes_shellcodesignatures_yy_delete_buffer(YY_CURRENT_BUFFER ); 2062 2062 YY_CURRENT_BUFFER_LVALUE = NULL; 2063 yypop_buffer_state();2063 nepenthes_shellcodesignatures_yypop_buffer_state(); 2064 2064 } 2065 2065 2066 2066 /* Destroy the stack itself. */ 2067 yyfree((yy_buffer_stack) );2067 nepenthes_shellcodesignatures_yyfree((yy_buffer_stack) ); 2068 2068 (yy_buffer_stack) = NULL; 2069 2069 … … 2095 2095 #endif 2096 2096 2097 void * yyalloc (yy_size_t size )2097 void *nepenthes_shellcodesignatures_yyalloc (yy_size_t size ) 2098 2098 { 2099 2099 return (void *) malloc( size ); 2100 2100 } 2101 2101 2102 void * yyrealloc (void * ptr, yy_size_t size )2102 void *nepenthes_shellcodesignatures_yyrealloc (void * ptr, yy_size_t size ) 2103 2103 { 2104 2104 /* The cast to (char *) in the following accommodates both … … 2112 2112 } 2113 2113 2114 void yyfree (void * ptr )2115 { 2116 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */2114 void nepenthes_shellcodesignatures_yyfree (void * ptr ) 2115 { 2116 free( (char *) ptr ); /* see nepenthes_shellcodesignatures_yyrealloc() for (char *) cast */ 2117 2117 } 2118 2118 nepenthes/trunk/modules/shell
