- Added malloc wrappers for OSX builds.

This commit is contained in:
ccremers 2006-09-12 16:17:49 +00:00
parent c0f87ce87d
commit 31f1753e4e
4 changed files with 1143 additions and 1158 deletions

View File

@ -11,9 +11,11 @@
#include <limits.h>
#include <float.h>
#include <string.h>
#ifndef OSXHOST
#ifdef DEBUG
#include <malloc.h>
#endif
#endif
#include "term.h"
#include "termlist.h"

View File

@ -14,7 +14,9 @@
#include "arachne.h"
#include "switches.h"
#include "depend.h"
#ifndef OSXHOST
#include <malloc.h>
#endif
static System sys; //!< local storage of system pointer

View File

@ -6,7 +6,9 @@
*/
#include "list.h"
#ifndef OSXHOST
#include <malloc.h>
#endif
#include <stdlib.h>
//! Make a node

View File

@ -373,7 +373,8 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[148] = { 0,
static yyconst flex_int16_t yy_accept[148] =
{ 0,
0, 0, 0, 0, 0, 0, 31, 29, 7, 6,
28, 9, 29, 29, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 3, 3, 2, 30, 4,
@ -392,7 +393,8 @@ static yyconst flex_int16_t yy_accept[148] = { 0,
28, 28, 21, 28, 19, 25, 0
} ;
static yyconst flex_int32_t yy_ec[256] = { 0,
static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -423,14 +425,16 @@ static yyconst flex_int32_t yy_ec[256] = { 0,
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[36] = { 0,
static yyconst flex_int32_t yy_meta[36] =
{ 0,
1, 1, 2, 1, 3, 4, 1, 1, 1, 3,
1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3
} ;
static yyconst flex_int16_t yy_base[154] = { 0,
static yyconst flex_int16_t yy_base[154] =
{ 0,
0, 0, 34, 35, 176, 175, 180, 183, 40, 43,
0, 0, 30, 0, 24, 147, 164, 151, 150, 146,
31, 32, 145, 26, 159, 0, 51, 183, 183, 161,
@ -450,7 +454,8 @@ static yyconst flex_int16_t yy_base[154] = { 0,
84, 88, 91
} ;
static yyconst flex_int16_t yy_def[154] = { 0,
static yyconst flex_int16_t yy_def[154] =
{ 0,
147, 1, 148, 148, 149, 149, 147, 147, 147, 147,
150, 151, 147, 150, 150, 150, 150, 150, 150, 150,
150, 150, 150, 150, 150, 152, 152, 147, 147, 147,
@ -470,7 +475,8 @@ static yyconst flex_int16_t yy_def[154] = { 0,
147, 147, 147
} ;
static yyconst flex_int16_t yy_nxt[219] = { 0,
static yyconst flex_int16_t yy_nxt[219] =
{ 0,
8, 9, 10, 9, 11, 8, 12, 8, 13, 11,
8, 14, 11, 11, 11, 15, 11, 11, 16, 11,
17, 18, 19, 11, 11, 11, 11, 20, 21, 22,
@ -497,7 +503,8 @@ static yyconst flex_int16_t yy_nxt[219] = { 0,
147, 147, 147, 147, 147, 147, 147, 147
} ;
static yyconst flex_int16_t yy_chk[219] = { 0,
static yyconst flex_int16_t yy_chk[219] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -525,10 +532,10 @@ static yyconst flex_int16_t yy_chk[219] = { 0,
} ;
/* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[31] = { 0,
static yyconst flex_int32_t yy_rule_can_match_eol[31] =
{ 0,
0, 0, 1, 0, 0, 1, 1, 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, };
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
@ -565,8 +572,7 @@ int yyerror (char *s);
Symbol mkstring(char *name);
struct stringlist
{
struct stringlist {
char* string;
struct stringlist* next;
};
@ -759,10 +765,10 @@ YY_DECL
if ( ! yyout )
yyout = stdout;
if (!YY_CURRENT_BUFFER)
{
if ( ! YY_CURRENT_BUFFER ) {
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer (yyin, YY_BUF_SIZE);
YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE );
}
yy_load_buffer_state( );
@ -796,8 +802,7 @@ YY_DECL
if ( yy_current_state >= 148 )
yy_c = yy_meta[(unsigned int) 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] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 183 );
@ -838,10 +843,13 @@ YY_DECL
YY_RULE_SETUP
#line 62 "scanner.l"
BEGIN(incl);
YY_BREAK case 2:YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
#line 63 "scanner.l"
/* eat the whitespace */
YY_BREAK case 3:
YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 64 "scanner.l"
@ -852,7 +860,8 @@ YY_DECL
exit( 1 );
}
include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
include_stack[include_stack_ptr++] =
YY_CURRENT_BUFFER;
/* try to open, using scytherdirs environment variable as well. */
yyin = openFileSearch (yytext, NULL);
@ -866,12 +875,15 @@ YY_DECL
BEGIN(INITIAL);
}
YY_BREAK case 4:YY_RULE_SETUP
YY_BREAK
case 4:
YY_RULE_SETUP
#line 88 "scanner.l"
{ /* eat the closing things */
BEGIN(INITIAL);
}
YY_BREAK case YY_STATE_EOF (INITIAL):
YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 92 "scanner.l"
{
if ( --include_stack_ptr < 0 )
@ -886,7 +898,9 @@ YY_DECL
BEGIN(inclend);
}
}
YY_BREAK case 5:YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
#line 107 "scanner.l"
{
register int c;
@ -914,129 +928,134 @@ YY_DECL
}
}
}
YY_BREAK case 6:
YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
#line 134 "scanner.l"
{
mylineno++;
}
YY_BREAK case 7:
{ mylineno++; }
YY_BREAK
case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
#line 135 "scanner.l"
{
}
YY_BREAK case 8:YY_RULE_SETUP
{ }
YY_BREAK
case 8:
YY_RULE_SETUP
#line 136 "scanner.l"
{
}
YY_BREAK case 9:YY_RULE_SETUP
{ }
YY_BREAK
case 9:
YY_RULE_SETUP
#line 137 "scanner.l"
{
}
YY_BREAK case 10:YY_RULE_SETUP
{ }
YY_BREAK
case 10:
YY_RULE_SETUP
#line 139 "scanner.l"
{
return PROTOCOL;
}
YY_BREAK case 11:YY_RULE_SETUP
{ return PROTOCOL; }
YY_BREAK
case 11:
YY_RULE_SETUP
#line 140 "scanner.l"
{
return ROLE;
}
YY_BREAK case 12:YY_RULE_SETUP
{ return ROLE; }
YY_BREAK
case 12:
YY_RULE_SETUP
#line 141 "scanner.l"
{
return READT;
}
YY_BREAK case 13:YY_RULE_SETUP
{ return READT; }
YY_BREAK
case 13:
YY_RULE_SETUP
#line 142 "scanner.l"
{
return SENDT;
}
YY_BREAK case 14:YY_RULE_SETUP
{ return SENDT; }
YY_BREAK
case 14:
YY_RULE_SETUP
#line 143 "scanner.l"
{
return VAR;
}
YY_BREAK case 15:YY_RULE_SETUP
{ return VAR; }
YY_BREAK
case 15:
YY_RULE_SETUP
#line 144 "scanner.l"
{
return CONST;
}
YY_BREAK case 16:YY_RULE_SETUP
{ return CONST; }
YY_BREAK
case 16:
YY_RULE_SETUP
#line 145 "scanner.l"
{
return CLAIMT;
}
YY_BREAK case 17:YY_RULE_SETUP
{ return CLAIMT; }
YY_BREAK
case 17:
YY_RULE_SETUP
#line 146 "scanner.l"
{
return RUN;
}
YY_BREAK case 18:YY_RULE_SETUP
{ return RUN; }
YY_BREAK
case 18:
YY_RULE_SETUP
#line 147 "scanner.l"
{
return SECRET;
}
YY_BREAK case 19:YY_RULE_SETUP
{ return SECRET; }
YY_BREAK
case 19:
YY_RULE_SETUP
#line 148 "scanner.l"
{
return INVERSEKEYS;
}
YY_BREAK case 20:YY_RULE_SETUP
{ return INVERSEKEYS; }
YY_BREAK
case 20:
YY_RULE_SETUP
#line 149 "scanner.l"
{
return UNTRUSTED;
}
YY_BREAK case 21:YY_RULE_SETUP
{ return UNTRUSTED; }
YY_BREAK
case 21:
YY_RULE_SETUP
#line 150 "scanner.l"
{
return COMPROMISED;
}
YY_BREAK case 22:YY_RULE_SETUP
{ return COMPROMISED; }
YY_BREAK
case 22:
YY_RULE_SETUP
#line 151 "scanner.l"
{
return USERTYPE;
}
YY_BREAK case 23:YY_RULE_SETUP
{ return USERTYPE; }
YY_BREAK
case 23:
YY_RULE_SETUP
#line 152 "scanner.l"
{
return SINGULAR;
}
YY_BREAK case 24:YY_RULE_SETUP
{ return SINGULAR; }
YY_BREAK
case 24:
YY_RULE_SETUP
#line 153 "scanner.l"
{
return FUNCTION;
}
YY_BREAK case 25:YY_RULE_SETUP
{ return FUNCTION; }
YY_BREAK
case 25:
YY_RULE_SETUP
#line 154 "scanner.l"
{
return HASHFUNCTION;
}
YY_BREAK case 26:YY_RULE_SETUP
{ return HASHFUNCTION; }
YY_BREAK
case 26:
YY_RULE_SETUP
#line 155 "scanner.l"
{
return KNOWS;
}
YY_BREAK case 27:YY_RULE_SETUP
{ return KNOWS; }
YY_BREAK
case 27:
YY_RULE_SETUP
#line 156 "scanner.l"
{
return TRUSTED;
}
YY_BREAK case 28:YY_RULE_SETUP
{ return TRUSTED; }
YY_BREAK
case 28:
YY_RULE_SETUP
#line 157 "scanner.l"
{
yylval.symb = mkstring(yytext);
return ID;
}
YY_BREAK case 29:YY_RULE_SETUP
YY_BREAK
case 29:
YY_RULE_SETUP
#line 161 "scanner.l"
{
return yytext[0];
}
YY_BREAK case 30:YY_RULE_SETUP
{ return yytext[0]; }
YY_BREAK
case 30:
YY_RULE_SETUP
#line 165 "scanner.l"
ECHO;
YY_BREAK
@ -1053,6 +1072,7 @@ YY_DECL
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
@ -1076,8 +1096,7 @@ YY_DECL
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ((yy_c_buf_p) <=
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
@ -1113,8 +1132,7 @@ YY_DECL
}
}
else
switch (yy_get_next_buffer ())
else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
@ -1146,7 +1164,8 @@ YY_DECL
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
(yy_c_buf_p) =
(yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
@ -1168,8 +1187,8 @@ YY_DECL
}
default:
YY_FATAL_ERROR
("fatal flex scanner internal error--no action found");
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of yylex */
@ -1181,8 +1200,7 @@ YY_DECL
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int
yy_get_next_buffer (void)
static int yy_get_next_buffer (void)
{
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char *source = (yytext_ptr);
@ -1190,8 +1208,8 @@ yy_get_next_buffer (void)
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR
("fatal flex scanner internal error--end of buffer missed");
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
@ -1237,7 +1255,8 @@ yy_get_next_buffer (void)
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf);
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
@ -1257,7 +1276,8 @@ yy_get_next_buffer (void)
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR ("fatal error - scanner input buffer overflow");
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
@ -1287,7 +1307,8 @@ yy_get_next_buffer (void)
else
{
ret_val = EOB_ACT_LAST_MATCH;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
@ -1296,8 +1317,7 @@ yy_get_next_buffer (void)
(yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] =
YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
@ -1306,8 +1326,7 @@ yy_get_next_buffer (void)
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type
yy_get_previous_state (void)
static yy_state_type yy_get_previous_state (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
@ -1328,8 +1347,7 @@ yy_get_previous_state (void)
if ( yy_current_state >= 148 )
yy_c = yy_meta[(unsigned int) 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] + (unsigned int) yy_c];
}
return yy_current_state;
@ -1340,8 +1358,7 @@ yy_get_previous_state (void)
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state)
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);
@ -1364,8 +1381,7 @@ yy_try_NUL_trans (yy_state_type yy_current_state)
return yy_is_jam ? 0 : yy_current_state;
}
static void
yyunput (int c, register char *yy_bp)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
@ -1378,9 +1394,8 @@ yyunput (int c, register char *yy_bp)
{ /* 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[YY_CURRENT_BUFFER_LVALUE->
yy_buf_size + 2];
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
@ -1398,8 +1413,7 @@ yyunput (int c, register char *yy_bp)
*--yy_cp = (char) c;
if (c == '\n')
{
if ( c == '\n' ){
--yylineno;
}
@ -1410,12 +1424,11 @@ yyunput (int c, register char *yy_bp)
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int
yyinput (void)
static int yyinput (void)
#else
static int
input (void)
static int input (void)
#endif
{
int c;
@ -1452,7 +1465,9 @@ input (void)
/* Reset buffer status. */
yyrestart(yyin );
/*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE:
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
if ( yywrap( ) )
return EOF;
@ -1491,14 +1506,13 @@ input (void)
*
* @note This function does not reset the start condition to @c INITIAL .
*/
void
yyrestart (FILE * input_file)
void yyrestart (FILE * input_file )
{
if (!YY_CURRENT_BUFFER)
{
if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer (yyin, YY_BUF_SIZE);
YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE );
}
yy_init_buffer(YY_CURRENT_BUFFER,input_file );
@ -1509,8 +1523,7 @@ yyrestart (FILE * input_file)
* @param new_buffer The new input buffer.
*
*/
void
yy_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
@ -1541,8 +1554,7 @@ yy_switch_to_buffer (YY_BUFFER_STATE new_buffer)
(yy_did_buffer_switch_on_eof) = 1;
}
static void
yy_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;
@ -1556,8 +1568,7 @@ yy_load_buffer_state (void)
*
* @return the allocated buffer state.
*/
YY_BUFFER_STATE
yy_create_buffer (FILE * file, int size)
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
@ -1585,8 +1596,7 @@ yy_create_buffer (FILE * file, int size)
* @param b a buffer created with yy_create_buffer()
*
*/
void
yy_delete_buffer (YY_BUFFER_STATE b)
void yy_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
@ -1609,8 +1619,8 @@ extern int isatty (int);
* This function is sometimes called more than once on the same buffer,
* such as during a yyrestart() or at EOF.
*/
static void
yy_init_buffer (YY_BUFFER_STATE b, FILE * file)
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
int oerrno = errno;
@ -1623,8 +1633,7 @@ yy_init_buffer (YY_BUFFER_STATE b, FILE * file)
* 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)
{
if (b != YY_CURRENT_BUFFER){
b->yy_bs_lineno = 1;
b->yy_bs_column = 0;
}
@ -1638,8 +1647,7 @@ yy_init_buffer (YY_BUFFER_STATE b, FILE * file)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*/
void
yy_flush_buffer (YY_BUFFER_STATE b)
void yy_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
@ -1668,8 +1676,7 @@ yy_flush_buffer (YY_BUFFER_STATE b)
* @param new_buffer The new state.
*
*/
void
yypush_buffer_state (YY_BUFFER_STATE new_buffer)
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
if (new_buffer == NULL)
return;
@ -1699,8 +1706,7 @@ yypush_buffer_state (YY_BUFFER_STATE new_buffer)
* The next element becomes the new top.
*
*/
void
yypop_buffer_state (void)
void yypop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
@ -1710,8 +1716,7 @@ yypop_buffer_state (void)
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER)
{
if (YY_CURRENT_BUFFER) {
yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
@ -1720,13 +1725,11 @@ yypop_buffer_state (void)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
static void
yyensure_buffer_stack (void)
static void yyensure_buffer_stack (void)
{
int num_to_alloc;
if (!(yy_buffer_stack))
{
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
* scanner will even need a stack. We use 2 instead of 1 to avoid an
@ -1734,29 +1737,29 @@ yyensure_buffer_stack (void)
*/
num_to_alloc = 1;
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof (struct yy_buffer_state *));
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
memset ((yy_buffer_stack), 0,
num_to_alloc * sizeof (struct yy_buffer_state *));
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;
}
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1)
{
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 */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
((yy_buffer_stack), num_to_alloc * sizeof (struct yy_buffer_state *));
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
/* zero only the new slots.*/
memset ((yy_buffer_stack) + (yy_buffer_stack_max), 0,
grow_size * sizeof (struct yy_buffer_state *));
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
}
}
@ -1767,8 +1770,7 @@ yyensure_buffer_stack (void)
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE
yy_scan_buffer (char *base, yy_size_t size)
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
@ -1805,8 +1807,7 @@ yy_scan_buffer (char *base, yy_size_t size)
* @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead.
*/
YY_BUFFER_STATE
yy_scan_string (yyconst char *yy_str)
YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
{
return yy_scan_bytes(yy_str,strlen(yy_str) );
@ -1819,8 +1820,7 @@ yy_scan_string (yyconst char *yy_str)
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE
yy_scan_bytes (yyconst char *bytes, int len)
YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
{
YY_BUFFER_STATE b;
char *buf;
@ -1854,8 +1854,7 @@ yy_scan_bytes (yyconst char *bytes, int len)
#define YY_EXIT_FAILURE 2
#endif
static void
yy_fatal_error (yyconst char *msg)
static void yy_fatal_error (yyconst char* msg )
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
@ -1883,8 +1882,7 @@ yy_fatal_error (yyconst char *msg)
/** Get the current line number.
*
*/
int
yyget_lineno (void)
int yyget_lineno (void)
{
return yylineno;
@ -1893,8 +1891,7 @@ yyget_lineno (void)
/** Get the input stream.
*
*/
FILE *
yyget_in (void)
FILE *yyget_in (void)
{
return yyin;
}
@ -1902,8 +1899,7 @@ yyget_in (void)
/** Get the output stream.
*
*/
FILE *
yyget_out (void)
FILE *yyget_out (void)
{
return yyout;
}
@ -1911,8 +1907,7 @@ yyget_out (void)
/** Get the length of the current token.
*
*/
int
yyget_leng (void)
int yyget_leng (void)
{
return yyleng;
}
@ -1921,8 +1916,7 @@ yyget_leng (void)
*
*/
char *
yyget_text (void)
char *yyget_text (void)
{
return yytext;
}
@ -1931,8 +1925,7 @@ yyget_text (void)
* @param line_number
*
*/
void
yyset_lineno (int line_number)
void yyset_lineno (int line_number )
{
yylineno = line_number;
@ -1944,38 +1937,32 @@ yyset_lineno (int line_number)
*
* @see yy_switch_to_buffer
*/
void
yyset_in (FILE * in_str)
void yyset_in (FILE * in_str )
{
yyin = in_str ;
}
void
yyset_out (FILE * out_str)
void yyset_out (FILE * out_str )
{
yyout = out_str ;
}
int
yyget_debug (void)
int yyget_debug (void)
{
return yy_flex_debug;
}
void
yyset_debug (int bdebug)
void yyset_debug (int bdebug )
{
yy_flex_debug = bdebug ;
}
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int
yylex_destroy (void)
int yylex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while (YY_CURRENT_BUFFER)
{
while(YY_CURRENT_BUFFER){
yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
yypop_buffer_state();
@ -1993,8 +1980,7 @@ yylex_destroy (void)
*/
#ifndef yytext_ptr
static void
yy_flex_strncpy (char *s1, yyconst char *s2, int n)
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
register int i;
for ( i = 0; i < n; ++i )
@ -2003,8 +1989,7 @@ yy_flex_strncpy (char *s1, yyconst char *s2, int n)
#endif
#ifdef YY_NEED_STRLEN
static int
yy_flex_strlen (yyconst char *s)
static int yy_flex_strlen (yyconst char * s )
{
register int n;
for ( n = 0; s[n]; ++n )
@ -2014,14 +1999,12 @@ yy_flex_strlen (yyconst char *s)
}
#endif
void *
yyalloc (yy_size_t size)
void *yyalloc (yy_size_t size )
{
return (void *) malloc( size );
}
void *
yyrealloc (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
@ -2033,8 +2016,7 @@ yyrealloc (void *ptr, yy_size_t size)
return (void *) realloc( (char *) ptr, size );
}
void
yyfree (void *ptr)
void yyfree (void * ptr )
{
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
@ -2057,8 +2039,7 @@ yyfree (void *ptr)
Symbol
mkstring (char *name)
Symbol mkstring(char *name)
{
Symbol t;
char* s;
@ -2088,14 +2069,12 @@ mkstring (char *name)
return t;
}
void
scanner_cleanup (void)
void scanner_cleanup(void)
{
yy_delete_buffer (YY_CURRENT_BUFFER);
}
void
strings_cleanup (void)
void strings_cleanup(void)
{
Stringlist sl;
while (allocatedStrings != NULL)
@ -2107,8 +2086,7 @@ strings_cleanup (void)
}
}
int
yywrap (void)
int yywrap (void)
{
/* signal true to let lex know that nothing else is coming */
return 1;
@ -2122,3 +2100,4 @@ void mktext(void);
// vim:ft=lex: