54 if (!*in || *in ==
'#')
82 (
errcode(ERRCODE_CONFIG_FILE_ERROR),
83 errmsg(
"could not open synonym file \"%s\": %m",
137 pfree(real_filename);
156 foreach(l, dictoptions)
160 if (strcmp(defel->
defname,
"matchorig") == 0)
164 else if (strcmp(defel->
defname,
"keeporig") == 0)
168 else if (strcmp(defel->
defname,
"matchsynonyms") == 0)
172 else if (strcmp(defel->
defname,
"keepsynonyms") == 0)
176 else if (strcmp(defel->
defname,
"rules") == 0)
184 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
185 errmsg(
"unrecognized xsyn parameter: \"%s\"",
206 if (!length || d->
len == 0)
236 while ((syn =
find_word(pos, &end)) != NULL)
244 res[nsyns].nvariant = 0;
245 res[nsyns].flags = 0;
255 res[nsyns].lexeme = NULL;
static void PGresult * res
bool defGetBoolean(DefElem *def)
char * defGetString(DefElem *def)
static char * find_word(char *in, char **end)
static int compare_syn(const void *a, const void *b)
Datum dxsyn_init(PG_FUNCTION_ARGS)
static void read_dictionary(DictSyn *d, const char *filename)
Datum dxsyn_lexize(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(dxsyn_init)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_INT32(n)
#define PG_RETURN_POINTER(x)
if(TABLE==NULL||TABLE_index==NULL)
int pg_mblen(const char *mbstr)
char * pnstrdup(const char *in, Size len)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * palloc0(Size size)
void * repalloc(void *pointer, Size size)
#define qsort(a, b, c, d)
static void word(struct vars *v, int dir, struct state *lp, struct state *rp)
bool tsearch_readline_begin(tsearch_readline_state *stp, const char *filename)
char * tsearch_readline(tsearch_readline_state *stp)
int t_isspace(const char *ptr)
void tsearch_readline_end(tsearch_readline_state *stp)
char * lowerstr(const char *str)
char * get_tsearch_config_filename(const char *basename, const char *extension)