Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8f67860

Browse files
committed
Avoid confusion start_parse_str function with tsearch V1
1 parent 59b1a23 commit 8f67860

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

contrib/tsearch2/wordparser/parser.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef __PARSER_H__
22
#define __PARSER_H__
33

4-
char *token;
5-
int tokenlen;
4+
extern char *token;
5+
extern int tokenlen;
66
int tsearch2_yylex(void);
7-
void start_parse_str(char *, int);
8-
void end_parse(void);
7+
void tsearch2_start_parse_str(char *, int);
8+
void tsearch2_end_parse(void);
99

1010
#endif

contrib/tsearch2/wordparser/parser.l

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define fprintf(file, fmt, msg) ts_error(ERROR, fmt, msg)
1010

1111
char *token = NULL; /* pointer to token */
12+
int tokenlen;
1213
char *s = NULL; /* to return WHOLE hyphenated-word */
1314

1415
YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string */
@@ -280,14 +281,14 @@ ftp"://" {
280281
%%
281282

282283
/* clearing after parsing from string */
283-
void end_parse() {
284+
void tsearch2_end_parse() {
284285
if (s) { free(s); s=NULL; }
285286
tsearch2_yy_delete_buffer( buf );
286287
buf = NULL;
287288
}
288289

289290
/* start parse from string */
290-
void start_parse_str(char* str, int limit) {
291+
void tsearch2_start_parse_str(char* str, int limit) {
291292
if (buf) end_parse();
292293
buf = tsearch2_yy_scan_bytes( str, limit );
293294
tsearch2_yy_switch_to_buffer( buf );

contrib/tsearch2/wparser_def.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Datum prsd_start(PG_FUNCTION_ARGS);
4242
Datum
4343
prsd_start(PG_FUNCTION_ARGS)
4444
{
45-
start_parse_str((char *) PG_GETARG_POINTER(0), PG_GETARG_INT32(1));
45+
tsearch2_start_parse_str((char *) PG_GETARG_POINTER(0), PG_GETARG_INT32(1));
4646
PG_RETURN_POINTER(NULL);
4747
}
4848

@@ -67,7 +67,7 @@ Datum
6767
prsd_end(PG_FUNCTION_ARGS)
6868
{
6969
/* ParserState *p=(ParserState*)PG_GETARG_POINTER(0); */
70-
end_parse();
70+
tsearch2_end_parse();
7171
PG_RETURN_VOID();
7272
}
7373

0 commit comments

Comments
 (0)