PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include "crc32.h"
#include "libpq/pqformat.h"
#include "ltree.h"
#include "utils/memutils.h"
#include "varatt.h"
Go to the source code of this file.
Data Structures | |
struct | nodeitem |
Macros | |
#define | LTPRS_WAITNAME 0 |
#define | LTPRS_WAITDELIM 1 |
#define | UNCHAR |
#define | LQPRS_WAITLEVEL 0 |
#define | LQPRS_WAITDELIM 1 |
#define | LQPRS_WAITOPEN 2 |
#define | LQPRS_WAITFNUM 3 |
#define | LQPRS_WAITSNUM 4 |
#define | LQPRS_WAITND 5 |
#define | LQPRS_WAITCLOSE 6 |
#define | LQPRS_WAITEND 7 |
#define | LQPRS_WAITVAR 8 |
#define | GETVAR(x) ( *((nodeitem**)LQL_FIRST(x)) ) |
#define | ITEMSIZE MAXALIGN(LQL_HDRSIZE+sizeof(nodeitem*)) |
#define | NEXTLEV(x) ( (lquery_level*)( ((char*)(x)) + ITEMSIZE) ) |
#define | UNCHAR |
Functions | |
static bool | finish_nodeitem (nodeitem *lptr, const char *ptr, bool is_lquery, int pos, struct Node *escontext) |
static ltree * | parse_ltree (const char *buf, struct Node *escontext) |
static char * | deparse_ltree (const ltree *in) |
PG_FUNCTION_INFO_V1 (ltree_in) | |
Datum | ltree_in (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (ltree_out) | |
Datum | ltree_out (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (ltree_send) | |
Datum | ltree_send (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (ltree_recv) | |
Datum | ltree_recv (PG_FUNCTION_ARGS) |
static lquery * | parse_lquery (const char *buf, struct Node *escontext) |
static char * | deparse_lquery (const lquery *in) |
PG_FUNCTION_INFO_V1 (lquery_in) | |
Datum | lquery_in (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (lquery_out) | |
Datum | lquery_out (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (lquery_send) | |
Datum | lquery_send (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (lquery_recv) | |
Datum | lquery_recv (PG_FUNCTION_ARGS) |
#define ITEMSIZE MAXALIGN(LQL_HDRSIZE+sizeof(nodeitem*)) |
Definition at line 261 of file ltree_io.c.
#define LQPRS_WAITCLOSE 6 |
Definition at line 255 of file ltree_io.c.
#define LQPRS_WAITDELIM 1 |
Definition at line 250 of file ltree_io.c.
#define LQPRS_WAITEND 7 |
Definition at line 256 of file ltree_io.c.
#define LQPRS_WAITFNUM 3 |
Definition at line 252 of file ltree_io.c.
#define LQPRS_WAITLEVEL 0 |
Definition at line 249 of file ltree_io.c.
#define LQPRS_WAITND 5 |
Definition at line 254 of file ltree_io.c.
#define LQPRS_WAITOPEN 2 |
Definition at line 251 of file ltree_io.c.
#define LQPRS_WAITSNUM 4 |
Definition at line 253 of file ltree_io.c.
#define LQPRS_WAITVAR 8 |
Definition at line 257 of file ltree_io.c.
#define LTPRS_WAITDELIM 1 |
Definition at line 26 of file ltree_io.c.
#define LTPRS_WAITNAME 0 |
Definition at line 25 of file ltree_io.c.
#define NEXTLEV | ( | x | ) | ( (lquery_level*)( ((char*)(x)) + ITEMSIZE) ) |
Definition at line 262 of file ltree_io.c.
#define UNCHAR |
#define UNCHAR |
|
static |
Definition at line 628 of file ltree_io.c.
References buf, lquery_variant::flag, lquery_level::flag, lquery_level::high, i, if(), j, lquery_variant::len, lquery_level::low, LQL_COUNT, LQL_FIRST, LQL_NEXT, LQL_NOT, LQUERY_FIRST, LTREE_MAX_LEVELS, LVAR_ANYEND, LVAR_INCASE, LVAR_NEXT, LVAR_SUBLEXEME, lquery_variant::name, lquery::numlevel, lquery_level::numvar, palloc(), sprintf, and lquery_level::totallen.
Referenced by lquery_out(), and lquery_send().
|
static |
Definition at line 145 of file ltree_io.c.
References buf, i, ltree_level::len, LEVEL_NEXT, LTREE_FIRST, ltree_level::name, ltree::numlevel, palloc(), and VARSIZE.
Referenced by ltree_out(), and ltree_send().
|
static |
Definition at line 586 of file ltree_io.c.
References ereturn, errcode(), errdetail(), errmsg(), nodeitem::len, LTREE_LABEL_MAX_CHARS, nodeitem::start, and nodeitem::wlen.
Referenced by parse_lquery(), and parse_ltree().
Datum lquery_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 745 of file ltree_io.c.
References buf, parse_lquery(), PG_GETARG_POINTER, PG_RETURN_NULL, PG_RETURN_POINTER, and res.
Datum lquery_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 758 of file ltree_io.c.
References deparse_lquery(), PG_GETARG_LQUERY_P, and PG_RETURN_POINTER.
Datum lquery_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 800 of file ltree_io.c.
References buf, elog, ERROR, parse_lquery(), pfree(), PG_GETARG_POINTER, PG_RETURN_POINTER, pq_getmsgint(), pq_getmsgtext(), res, and str.
Datum lquery_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 775 of file ltree_io.c.
References buf, deparse_lquery(), pfree(), PG_GETARG_LQUERY_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendint8(), pq_sendtext(), and res.
Datum ltree_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 175 of file ltree_io.c.
References buf, parse_ltree(), PG_GETARG_POINTER, PG_RETURN_NULL, PG_RETURN_POINTER, and res.
Referenced by ltree_addtext(), ltree_textadd(), and text2ltree().
Datum ltree_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 188 of file ltree_io.c.
References deparse_ltree(), PG_GETARG_LTREE_P, and PG_RETURN_POINTER.
Datum ltree_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 230 of file ltree_io.c.
References buf, elog, ERROR, parse_ltree(), pfree(), PG_GETARG_POINTER, PG_RETURN_POINTER, pq_getmsgint(), pq_getmsgtext(), res, and str.
Datum ltree_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 205 of file ltree_io.c.
References buf, deparse_ltree(), pfree(), PG_GETARG_LTREE_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendint8(), pq_sendtext(), and res.
Definition at line 269 of file ltree_io.c.
References buf, cur, elog, ereturn, errcode(), errdetail(), errmsg(), ERROR, finish_nodeitem(), lquery::firstgood, lquery_variant::flag, lquery_level::flag, lquery::flag, nodeitem::flag, GETVAR, lquery_level::high, ISLABEL, ITEMSIZE, lquery_variant::len, nodeitem::len, lquery_level::low, LQL_COUNT, LQL_FIRST, LQL_HDRSIZE, LQL_NEXT, LQL_NOT, LQPRS_WAITCLOSE, LQPRS_WAITDELIM, LQPRS_WAITEND, LQPRS_WAITFNUM, LQPRS_WAITLEVEL, LQPRS_WAITND, LQPRS_WAITOPEN, LQPRS_WAITSNUM, LQPRS_WAITVAR, LQUERY_FIRST, LQUERY_HASNOT, LQUERY_HDRSIZE, LQUERY_MAX_LEVELS, ltree_crc32_sz(), LTREE_MAX_LEVELS, LVAR_ANYEND, LVAR_HDRSIZE, LVAR_INCASE, LVAR_NEXT, LVAR_SUBLEXEME, MAXALIGN, lquery_variant::name, NEXTLEV, lquery::numlevel, lquery_level::numvar, palloc0(), pfree(), pg_mblen(), SET_VARSIZE, nodeitem::start, t_isdigit(), t_iseq, UNCHAR, lquery_variant::val, and nodeitem::wlen.
Referenced by lquery_in(), and lquery_recv().
Definition at line 37 of file ltree_io.c.
References buf, elog, ereturn, errcode(), errdetail(), errmsg(), ERROR, finish_nodeitem(), ISLABEL, ltree_level::len, nodeitem::len, LEVEL_HDRSIZE, LEVEL_NEXT, sort-test::list, LTPRS_WAITDELIM, LTPRS_WAITNAME, LTREE_FIRST, LTREE_HDRSIZE, LTREE_MAX_LEVELS, MAXALIGN, ltree_level::name, ltree::numlevel, palloc(), palloc0(), pfree(), pg_mblen(), SET_VARSIZE, nodeitem::start, t_iseq, UNCHAR, and nodeitem::wlen.
Referenced by ltree_in(), and ltree_recv().
PG_FUNCTION_INFO_V1 | ( | lquery_in | ) |
PG_FUNCTION_INFO_V1 | ( | lquery_out | ) |
PG_FUNCTION_INFO_V1 | ( | lquery_recv | ) |
PG_FUNCTION_INFO_V1 | ( | lquery_send | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_in | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_out | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_recv | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_send | ) |