PostgreSQL Source Code: src/backend/tsearch/wparser.c Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

15

21#include "utils/fmgrprotos.h"

24

25

26

27typedef struct

28{

32

33

35{

43

45

46static void

48 Oid prsid)

49{

54

56 elog(ERROR, "method lextype isn't defined for text search parser %u",

57 prsid);

58

60

62 st->cur = 0;

63

67

69 elog(ERROR, "return type must be a row type");

72

74}

75

78{

80

83 {

86 char txtid[16];

88

93

96

99 st->cur++;

100 return result;

101 }

102 return (Datum) 0;

103}

104

107{

110

112 {

115 }

116

118

122}

123

126{

129

131 {

133 Oid prsId;

134

138 }

139

141

145}

146

147typedef struct

148{

152

153typedef struct

154{

159

160

161static void

164{

169 char *lex = NULL;

170 int llen = 0,

172 void *prsdata;

173

175

177 st->cur = 0;

178 st->len = 16;

180

184

189 {

190 if (st->cur >= st->len)

191 {

192 st->len = 2 * st->len;

194 }

199 st->cur++;

200 }

201

203

205 st->cur = 0;

206

207 funcctx->user_fctx = (void *) st;

209 elog(ERROR, "return type must be a row type");

213}

214

217{

219

222 {

225 char tid[16];

227

233

235 st->cur++;

236 return result;

237 }

238 return (Datum) 0;

239}

240

243{

246

248 {

250

254 }

255

257

261}

262

265{

268

270 {

273 Oid prsId;

274

278 }

279

281

285}

286

289{

295 List *prsoptions;

299

302

305 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),

306 errmsg("text search parser does not support headline creation")));

307

311

314

315 if (opt)

317 else

318 prsoptions = NIL;

319

324

326

329 if (opt)

334

336}

337

340{

345}

346

349{

354}

355

358{

364}

365

368{

377

381

382 state->prs = &prs;

385 state->query = query;

386 if (opt)

388 else

390

393 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),

394 errmsg("text search parser does not support headline creation")));

395

397

400 if (opt)

402

404

405 if (state->transformed)

406 {

409 }

410

412}

413

416{

421}

422

425{

430}

431

434{

440}

441

444{

451

454

458

459 state->prs = &prs;

462 state->query = query;

463 if (opt)

465 else

467

470 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),

471 errmsg("text search parser does not support headline creation")));

472

474

477 if (opt)

480

481 if (state->transformed)

482 {

485 }

486

488}

489

492{

497}

498

501{

506}

507

510{

516}

517

518

519

520

521

524{

526

531 List *prsoptions = state->prsoptions;

532

539

540 state->transformed = true;

542}

static Datum values[MAXATTR]

#define OidIsValid(objectId)

int errcode(int sqlerrcode)

int errmsg(const char *fmt,...)

#define ereport(elevel,...)

HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)

AttInMetadata * TupleDescGetAttInMetadata(TupleDesc tupdesc)

#define OidFunctionCall1(functionId, arg1)

#define PG_FREE_IF_COPY(ptr, n)

#define PG_GETARG_TEXT_PP(n)

#define DirectFunctionCall4(func, arg1, arg2, arg3, arg4)

#define PG_GETARG_POINTER(n)

#define PG_GETARG_DATUM(n)

#define FunctionCall1(flinfo, arg1)

#define PG_RETURN_TEXT_P(x)

#define FunctionCall2(flinfo, arg1, arg2)

#define PG_RETURN_DATUM(x)

#define DirectFunctionCall3(func, arg1, arg2, arg3)

#define PG_RETURN_POINTER(x)

#define FunctionCall3(flinfo, arg1, arg2, arg3)

#define PG_GETARG_TEXT_P(n)

TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)

#define SRF_IS_FIRSTCALL()

#define SRF_PERCALL_SETUP()

#define SRF_RETURN_NEXT(_funcctx, _result)

#define SRF_FIRSTCALL_INIT()

static Datum HeapTupleGetDatum(const HeapTupleData *tuple)

#define SRF_RETURN_DONE(_funcctx)

if(TABLE==NULL||TABLE_index==NULL)

#define PG_RETURN_JSONB_P(x)

#define PG_GETARG_JSONB_P(x)

text * transform_json_string_values(text *json, void *action_state, JsonTransformStringValuesAction transform_action)

Jsonb * transform_jsonb_string_values(Jsonb *jsonb, void *action_state, JsonTransformStringValuesAction transform_action)

text *(* JsonTransformStringValuesAction)(void *state, char *elem_value, int elem_len)

void * repalloc(void *pointer, Size size)

void pfree(void *pointer)

void * palloc0(Size size)

Oid get_ts_parser_oid(List *names, bool missing_ok)

static MemoryContext MemoryContextSwitchTo(MemoryContext context)

static Datum PointerGetDatum(const void *X)

static Datum ObjectIdGetDatum(Oid X)

static Pointer DatumGetPointer(Datum X)

static Datum Int32GetDatum(int32 X)

static int32 DatumGetInt32(Datum X)

AttInMetadata * attinmeta

MemoryContext multi_call_memory_ctx

TSParserCacheEntry * prsobj

HeadlineWordEntry * words

Oid getTSCurrentConfig(bool emitError)

TSConfigCacheEntry * lookup_ts_config_cache(Oid cfgId)

TSParserCacheEntry * lookup_ts_parser_cache(Oid prsId)

text * generateHeadline(HeadlineParsedText *prs)

void hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int buflen)

#define PG_GETARG_TSQUERY(n)

List * deserialize_deflist(Datum txt)

#define VARSIZE_ANY_EXHDR(PTR)

List * textToQualifiedNameList(text *textval)

static void prs_setup_firstcall(FuncCallContext *funcctx, FunctionCallInfo fcinfo, Oid prsid, text *txt)

Datum ts_headline_opt(PG_FUNCTION_ARGS)

Datum ts_parse_byname(PG_FUNCTION_ARGS)

Datum ts_token_type_byid(PG_FUNCTION_ARGS)

Datum ts_headline(PG_FUNCTION_ARGS)

Datum ts_headline_byid_opt(PG_FUNCTION_ARGS)

static Datum prs_process_call(FuncCallContext *funcctx)

Datum ts_headline_json_byid_opt(PG_FUNCTION_ARGS)

Datum ts_headline_jsonb_byid_opt(PG_FUNCTION_ARGS)

Datum ts_parse_byid(PG_FUNCTION_ARGS)

Datum ts_headline_byid(PG_FUNCTION_ARGS)

struct HeadlineJsonState HeadlineJsonState

Datum ts_headline_jsonb_byid(PG_FUNCTION_ARGS)

static void tt_setup_firstcall(FuncCallContext *funcctx, FunctionCallInfo fcinfo, Oid prsid)

Datum ts_token_type_byname(PG_FUNCTION_ARGS)

Datum ts_headline_json_opt(PG_FUNCTION_ARGS)

Datum ts_headline_jsonb(PG_FUNCTION_ARGS)

Datum ts_headline_jsonb_opt(PG_FUNCTION_ARGS)

Datum ts_headline_json(PG_FUNCTION_ARGS)

static text * headline_json_value(void *_state, char *elem_value, int elem_len)

static Datum tt_process_call(FuncCallContext *funcctx)

Datum ts_headline_json_byid(PG_FUNCTION_ARGS)