Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d3fe721a
Commit
d3fe721a
authored
Aug 15, 2003
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate function start_parse_fh and macro YY_INPUT
parent
432ca911
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
79 deletions
+0
-79
contrib/tsearch/parser.h
contrib/tsearch/parser.h
+0
-1
contrib/tsearch/parser.l
contrib/tsearch/parser.l
+0
-39
contrib/tsearch2/wordparser/parser.h
contrib/tsearch2/wordparser/parser.h
+0
-1
contrib/tsearch2/wordparser/parser.l
contrib/tsearch2/wordparser/parser.l
+0
-38
No files found.
contrib/tsearch/parser.h
View file @
d3fe721a
...
...
@@ -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
contrib/tsearch/parser.l
View file @
d3fe721a
...
...
@@ -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;
}
contrib/tsearch2/wordparser/parser.h
View file @
d3fe721a
...
...
@@ -5,7 +5,6 @@ char *token;
int
tokenlen
;
int
tsearch2_yylex
(
void
);
void
start_parse_str
(
char
*
,
int
);
void
start_parse_fh
(
FILE
*
,
int
);
void
end_parse
(
void
);
#endif
contrib/tsearch2/wordparser/parser.l
View file @
d3fe721a
...
...
@@ -23,36 +23,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( tsearch2_yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( tsearch2_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, tsearch2_yyin )) == 0) \
&& ferror( tsearch2_yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
} \
}
%}
%option 8bit
...
...
@@ -334,13 +304,5 @@ 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 = tsearch2_yy_create_buffer( fh, YY_BUF_SIZE );
tsearch2_yy_switch_to_buffer( buf );
BEGIN INITIAL;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment