78
78
#define LQUERY_HDRSIZE MAXALIGN( offsetof(lquery, data) )
79
79
#define LQUERY_FIRST(x) ( (lquery_level*)( ((char*)(x))+LQUERY_HDRSIZE ) )
81
81
#define LQUERY_HASNOT 0x01
83
#define ISALNUM(x) ( t_isalpha(x) || t_isdigit(x) || ( pg_mblen(x) == 1 && t_iseq((x), '_') ) )
83
#define ISALNUM(x) ( t_isalpha(x) || t_isdigit(x) || ( pg_mblen(x) == 1 && t_iseq((x), '_') ) )
85
85
/* full text query */
153
153
/* Util function */
154
154
Datum ltree_in(PG_FUNCTION_ARGS);
156
bool ltree_execute(ITEM * curitem, void *checkval,
157
bool calcnot, bool (*chkcond) (void *checkval, ITEM * val));
156
bool ltree_execute(ITEM *curitem, void *checkval,
157
bool calcnot, bool (*chkcond) (void *checkval, ITEM *val));
159
int ltree_compare(const ltree * a, const ltree * b);
160
bool inner_isparent(const ltree * c, const ltree * p);
161
bool compare_subnode(ltree_level * t, char *q, int len,
162
int (*cmpptr) (const char *, const char *, size_t), bool anyend);
163
ltree *lca_inner(ltree ** a, int len);
164
int ltree_strncasecmp(const char *a, const char *b, size_t s);
159
int ltree_compare(const ltree *a, const ltree *b);
160
bool inner_isparent(const ltree *c, const ltree *p);
161
bool compare_subnode(ltree_level *t, char *q, int len,
162
int (*cmpptr) (const char *, const char *, size_t), bool anyend);
163
ltree *lca_inner(ltree **a, int len);
164
int ltree_strncasecmp(const char *a, const char *b, size_t s);
166
166
#define PG_GETARG_LTREE(x) ((ltree*)DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(x))))
167
167
#define PG_GETARG_LTREE_COPY(x) ((ltree*)DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(x))))