74 errmsg(
"duplicate source strings, first one will be used")));
108 errmsg(
"could not open unaccent file \"%s\": %m",
157 for (ptr = line; *ptr; ptr +=
ptrlen)
161 if (
isspace((
unsigned char) *ptr))
211 if (*(ptr + 1) ==
'"')
249 if (trg[
i] ==
'"' && trg[
i + 1] ==
'"')
262 (
unsigned char *) src,
srclen,
264 else if (
state == -1)
267 errmsg(
"invalid syntax: more than two strings in unaccent rule")));
268 else if (
state == -2)
271 errmsg(
"invalid syntax: unfinished quoted string in unaccent rule")));
354 errmsg(
"multiple Rules parameters")));
362 errmsg(
"unrecognized Unaccent parameter: \"%s\"",
371 errmsg(
"missing Rules parameter")));
454 const char *dictname =
"unaccent";
462 errmsg(
"text search dictionary \"%s.%s\" does not exist",
#define Assert(condition)
#define OidIsValid(objectId)
char * defGetString(DefElem *def)
ErrorData * CopyErrorData(void)
void FlushErrorState(void)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc_array(type, count)
#define palloc0_array(type, count)
#define PG_FREE_IF_COPY(ptr, n)
#define PG_GETARG_TEXT_PP(n)
#define PG_GETARG_POINTER(n)
#define PG_MODULE_MAGIC_EXT(...)
#define PG_FUNCTION_INFO_V1(funcname)
#define FunctionCall4(flinfo, arg1, arg2, arg3, arg4)
#define PG_RETURN_TEXT_P(x)
#define PG_GETARG_INT32(n)
#define PG_RETURN_POINTER(x)
#define PG_GETARG_TEXT_P_COPY(n)
Oid get_func_namespace(Oid funcid)
char * get_namespace_name(Oid nspid)
int pg_mblen(const char *mbstr)
void pfree(void *pointer)
MemoryContext CurrentMemoryContext
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static const struct exclude_list_item skip[]
static char buf[DEFAULT_XLOG_SEG_SIZE]
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
static Datum Int32GetDatum(int32 X)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void initStringInfo(StringInfo str)
struct TrieChar * nextChar
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)
TSDictionaryCacheEntry * lookup_ts_dictionary_cache(Oid dictId)
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)
char * get_tsearch_config_filename(const char *basename, const char *extension)
static TrieChar * initTrie(const char *filename)
Datum unaccent_init(PG_FUNCTION_ARGS)
Datum unaccent_lexize(PG_FUNCTION_ARGS)
static TrieChar * placeChar(TrieChar *node, const unsigned char *str, int lenstr, const char *replaceTo, int replacelen)
Datum unaccent_dict(PG_FUNCTION_ARGS)
static TrieChar * findReplaceTo(TrieChar *node, const unsigned char *src, int srclen, int *p_matchlen)
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
text * cstring_to_text(const char *s)