19#include "catalog/pg_collation_d.h"
35 const char *extension)
49 if (strspn(basename,
"abcdefghijklmnopqrstuvwxyz0123456789_") != strlen(basename))
51 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
52 errmsg(
"invalid text search configuration file name \"%s\"",
58 sharepath, basename, extension);
83 (
errcode(ERRCODE_CONFIG_FILE_ERROR),
84 errmsg(
"could not open stop-word file \"%s\": %m",
92 while (*pbuf && !isspace((
unsigned char) *pbuf))
103 if (s->
len >= reallen)
108 stop = (
char **)
palloc(
sizeof(
char *) * reallen);
113 stop = (
char **)
repalloc(stop,
sizeof(
char *) * reallen);
119 stop[s->
len] = wordop(line, strlen(line), DEFAULT_COLLATION_OID);
120 if (stop[s->
len] != line)
143 return (s->
stop && s->
len > 0 &&
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
char my_exec_path[MAXPGPATH]
int pg_mblen(const char *mbstr)
void * repalloc(void *pointer, Size size)
void pfree(void *pointer)
void get_share_path(const char *my_exec_path, char *ret_path)
int pg_qsort_strcmp(const void *a, const void *b)
#define qsort(a, b, c, d)
bool tsearch_readline_begin(tsearch_readline_state *stp, const char *filename)
char * tsearch_readline(tsearch_readline_state *stp)
void tsearch_readline_end(tsearch_readline_state *stp)
void readstoplist(const char *fname, StopList *s, char *(*wordop)(const char *, size_t, Oid))
bool searchstoplist(StopList *s, char *key)
char * get_tsearch_config_filename(const char *basename, const char *extension)