1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

Update this branch to match CVS head, includes WIN32 improvements.

This commit is contained in:
Bruce Momjian
2003-09-07 04:37:13 +00:00
parent 432ca9116b
commit c40ed51319
383 changed files with 82452 additions and 85073 deletions

View File

@@ -5,7 +5,6 @@ char *token;
int tokenlen;
int tsearch_yylex(void);
void start_parse_str(char *, int);
void start_parse_fh(FILE *, int);
void end_parse(void);
#endif

View File

@@ -22,36 +22,6 @@ char *s = NULL; /* to return WHOLE hyphenated-word */
YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string */
int lrlimit = -1; /* for limiting read from filehandle ( -1 - unlimited read ) */
int bytestoread = 0; /* for limiting read from filehandle */
/* redefine macro for read limited length */
#define YY_INPUT(buf,result,max_size) \
if ( yy_current_buffer->yy_is_interactive ) { \
int c = '*', n; \
for ( n = 0; n < max_size && \
(c = getc( tsearch_yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( tsearch_yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} else { \
if ( lrlimit == 0 ) \
result=YY_NULL; \
else { \
if ( lrlimit>0 ) { \
bytestoread = ( lrlimit > max_size ) ? max_size : lrlimit; \
lrlimit -= bytestoread; \
} else \
bytestoread = max_size; \
if ( ((result = fread( buf, 1, bytestoread, tsearch_yyin )) == 0) \
&& ferror( tsearch_yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
} \
}
%}
%option 8bit
@@ -327,13 +297,4 @@ void start_parse_str(char* str, int limit) {
BEGIN INITIAL;
}
/* start parse from filehandle */
void start_parse_fh( FILE* fh, int limit ) {
if (buf) end_parse();
lrlimit = ( limit ) ? limit : -1;
buf = tsearch_yy_create_buffer( fh, YY_BUF_SIZE );
tsearch_yy_switch_to_buffer( buf );
BEGIN INITIAL;
}