summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev2003-12-05 14:27:42 +0000
committerTeodor Sigaev2003-12-05 14:27:42 +0000
commit8f678600c269a056dc0f35b53424649501dcd664 (patch)
tree4866ed43f4b79fe4143123cfcf7fefb2b0160892
parent59b1a23028245c593414c01ae482fc35709760ff (diff)
Avoid confusion start_parse_str function with tsearch V1
-rw-r--r--contrib/tsearch2/wordparser/parser.h8
-rw-r--r--contrib/tsearch2/wordparser/parser.l5
-rw-r--r--contrib/tsearch2/wparser_def.c4
3 files changed, 9 insertions, 8 deletions
diff --git a/contrib/tsearch2/wordparser/parser.h b/contrib/tsearch2/wordparser/parser.h
index 1ce18741977..7fb2d0a2868 100644
--- a/contrib/tsearch2/wordparser/parser.h
+++ b/contrib/tsearch2/wordparser/parser.h
@@ -1,10 +1,10 @@
#ifndef __PARSER_H__
#define __PARSER_H__
-char *token;
-int tokenlen;
+extern char *token;
+extern int tokenlen;
int tsearch2_yylex(void);
-void start_parse_str(char *, int);
-void end_parse(void);
+void tsearch2_start_parse_str(char *, int);
+void tsearch2_end_parse(void);
#endif
diff --git a/contrib/tsearch2/wordparser/parser.l b/contrib/tsearch2/wordparser/parser.l
index b7f5a0013b6..fd8244817a7 100644
--- a/contrib/tsearch2/wordparser/parser.l
+++ b/contrib/tsearch2/wordparser/parser.l
@@ -9,6 +9,7 @@
#define fprintf(file, fmt, msg) ts_error(ERROR, fmt, msg)
char *token = NULL; /* pointer to token */
+int tokenlen;
char *s = NULL; /* to return WHOLE hyphenated-word */
YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string */
@@ -280,14 +281,14 @@ ftp"://" {
%%
/* clearing after parsing from string */
-void end_parse() {
+void tsearch2_end_parse() {
if (s) { free(s); s=NULL; }
tsearch2_yy_delete_buffer( buf );
buf = NULL;
}
/* start parse from string */
-void start_parse_str(char* str, int limit) {
+void tsearch2_start_parse_str(char* str, int limit) {
if (buf) end_parse();
buf = tsearch2_yy_scan_bytes( str, limit );
tsearch2_yy_switch_to_buffer( buf );
diff --git a/contrib/tsearch2/wparser_def.c b/contrib/tsearch2/wparser_def.c
index f0f4cde9bbc..6e8775063af 100644
--- a/contrib/tsearch2/wparser_def.c
+++ b/contrib/tsearch2/wparser_def.c
@@ -42,7 +42,7 @@ Datum prsd_start(PG_FUNCTION_ARGS);
Datum
prsd_start(PG_FUNCTION_ARGS)
{
- start_parse_str((char *) PG_GETARG_POINTER(0), PG_GETARG_INT32(1));
+ tsearch2_start_parse_str((char *) PG_GETARG_POINTER(0), PG_GETARG_INT32(1));
PG_RETURN_POINTER(NULL);
}
@@ -67,7 +67,7 @@ Datum
prsd_end(PG_FUNCTION_ARGS)
{
/* ParserState *p=(ParserState*)PG_GETARG_POINTER(0); */
- end_parse();
+ tsearch2_end_parse();
PG_RETURN_VOID();
}