PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include "crc32.h"
#include "libpq/pqformat.h"
#include "ltree.h"
#include "miscadmin.h"
Go to the source code of this file.
Data Structures | |
struct | NODE |
struct | QPRS_STATE |
struct | INFIX |
Macros | |
#define | WAITOPERAND 1 |
#define | INOPERAND 2 |
#define | WAITOPERATOR 3 |
#define | STACKDEPTH 32 |
#define | RESIZEBUF(inf, addsize) |
Typedefs | |
typedef struct NODE | NODE |
Functions | |
static int32 | gettoken_query (QPRS_STATE *state, int32 *val, int32 *lenval, char **strval, uint16 *flag) |
static void | pushquery (QPRS_STATE *state, int32 type, int32 val, int32 distance, int32 lenval, uint16 flag) |
static void | pushval_asis (QPRS_STATE *state, int type, char *strval, int lenval, uint16 flag) |
static int32 | makepol (QPRS_STATE *state) |
static void | findoprnd (ITEM *ptr, int32 *pos) |
static ltxtquery * | queryin (char *buf) |
PG_FUNCTION_INFO_V1 (ltxtq_in) | |
Datum | ltxtq_in (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (ltxtq_recv) | |
Datum | ltxtq_recv (PG_FUNCTION_ARGS) |
static void | infix (INFIX *in, bool first) |
PG_FUNCTION_INFO_V1 (ltxtq_out) | |
Datum | ltxtq_out (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (ltxtq_send) | |
Datum | ltxtq_send (PG_FUNCTION_ARGS) |
#define INOPERAND 2 |
Definition at line 18 of file ltxtquery_io.c.
Referenced by gettoken_query().
#define RESIZEBUF | ( | inf, | |
addsize | |||
) |
Definition at line 429 of file ltxtquery_io.c.
Referenced by infix().
#define STACKDEPTH 32 |
Definition at line 195 of file ltxtquery_io.c.
Referenced by makepol().
#define WAITOPERAND 1 |
Definition at line 17 of file ltxtquery_io.c.
Referenced by gettoken_query(), and queryin().
#define WAITOPERATOR 3 |
Definition at line 19 of file ltxtquery_io.c.
Referenced by gettoken_query().
Definition at line 275 of file ltxtquery_io.c.
References check_stack_depth(), ITEM::left, NODE::type, NODE::val, VAL, and VALTRUE.
Referenced by queryin().
|
static |
Definition at line 56 of file ltxtquery_io.c.
References QPRS_STATE::buf, CLOSE, QPRS_STATE::count, END, ereport, ERR, errcode(), errmsg(), ERROR, INOPERAND, ISALNUM, LVAR_ANYEND, LVAR_INCASE, LVAR_SUBLEXEME, OPEN, OPR, pg_mblen(), QPRS_STATE::state, t_iseq, t_isspace(), VAL, WAITOPERAND, and WAITOPERATOR.
Referenced by makepol().
Definition at line 443 of file ltxtquery_io.c.
References INFIX::buf, INFIX::buflen, check_stack_depth(), INFIX::cur, INFIX::curpol, ITEM::distance, ITEM::flag, ITEM::length, ltxtq_out(), LVAR_ANYEND, LVAR_INCASE, LVAR_SUBLEXEME, INFIX::op, OPR, palloc(), pfree(), PG_FUNCTION_INFO_V1(), RESIZEBUF, sprintf, ITEM::type, ITEM::val, and VAL.
Referenced by ltxtq_out(), and ltxtq_send().
Datum ltxtq_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 384 of file ltxtquery_io.c.
References ltxtq_recv(), PG_FUNCTION_INFO_V1(), PG_GETARG_POINTER, PG_RETURN_POINTER, and queryin().
Referenced by queryin().
Datum ltxtq_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 543 of file ltxtquery_io.c.
References INFIX::buf, INFIX::buflen, INFIX::cur, INFIX::curpol, ereport, errcode(), errdetail(), errmsg(), ERROR, GETOPERAND, GETQUERY, infix(), ltxtq_send(), INFIX::op, palloc(), PG_FUNCTION_INFO_V1(), PG_GETARG_LTXTQUERY_P, PG_RETURN_POINTER, and ltxtquery::size.
Referenced by infix().
Datum ltxtq_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 399 of file ltxtquery_io.c.
References buf, cur, StringInfoData::cursor, elog, ERROR, StringInfoData::len, pfree(), PG_GETARG_POINTER, PG_RETURN_POINTER, pq_getmsgint(), pq_getmsgtext(), queryin(), and generate_unaccent_rules::str.
Referenced by ltxtq_in().
Datum ltxtq_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 574 of file ltxtquery_io.c.
References buf, INFIX::buf, INFIX::buflen, INFIX::cur, INFIX::curpol, ereport, errcode(), errdetail(), errmsg(), ERROR, GETOPERAND, GETQUERY, infix(), INFIX::op, palloc(), pfree(), PG_GETARG_LTXTQUERY_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendint8(), pq_sendtext(), and ltxtquery::size.
Referenced by ltxtq_out().
|
static |
Definition at line 200 of file ltxtquery_io.c.
References check_stack_depth(), CLOSE, elog, END, ereport, ERR, errcode(), errmsg(), ERROR, NODE::flag, gettoken_query(), OPEN, OPR, pushquery(), pushval_asis(), STACKDEPTH, NODE::type, NODE::val, and VAL.
Referenced by queryin().
PG_FUNCTION_INFO_V1 | ( | ltxtq_in | ) |
Referenced by infix(), ltxtq_in(), ltxtq_out(), and queryin().
PG_FUNCTION_INFO_V1 | ( | ltxtq_recv | ) |
PG_FUNCTION_INFO_V1 | ( | ltxtq_out | ) |
PG_FUNCTION_INFO_V1 | ( | ltxtq_send | ) |
|
static |
Definition at line 144 of file ltxtquery_io.c.
References NODE::distance, ereport, errcode(), errmsg(), ERROR, NODE::flag, NODE::length, NODE::next, QPRS_STATE::num, palloc(), QPRS_STATE::str, NODE::type, and NODE::val.
Referenced by makepol(), and pushval_asis().
|
static |
Definition at line 170 of file ltxtquery_io.c.
References QPRS_STATE::curop, ereport, errcode(), errmsg(), ERROR, QPRS_STATE::lenop, ltree_crc32_sz(), QPRS_STATE::op, pushquery(), repalloc(), and QPRS_STATE::sumlen.
Referenced by makepol().
|
static |
Definition at line 308 of file ltxtquery_io.c.
References QPRS_STATE::buf, buf, COMPUTESIZE, QPRS_STATE::count, cur, QPRS_STATE::curop, NODE::distance, ITEM::distance, ereport, errcode(), errdetail(), errmsg(), ERROR, findoprnd(), NODE::flag, ITEM::flag, GETOPERAND, GETQUERY, i, NODE::length, ITEM::length, QPRS_STATE::lenop, ltxtq_in(), LTXTQUERY_TOO_BIG, makepol(), NODE::next, QPRS_STATE::num, QPRS_STATE::op, palloc(), palloc0(), pfree(), PG_FUNCTION_INFO_V1(), SET_VARSIZE, ltxtquery::size, QPRS_STATE::state, QPRS_STATE::str, QPRS_STATE::sumlen, NODE::type, ITEM::type, NODE::val, ITEM::val, and WAITOPERAND.
Referenced by ltxtq_in(), and ltxtq_recv().