You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
postgres/contrib/tsearch2/ts_cfg.h

79 lines
1.1 KiB

23 years ago
#ifndef __TS_CFG_H__
#define __TS_CFG_H__
23 years ago
#include "postgres.h"
#include "query.h"
23 years ago
typedef struct
{
int len;
Datum *dict_id;
} ListDictionary;
23 years ago
23 years ago
typedef struct
{
Oid id;
Oid prs_id;
int len;
ListDictionary *map;
23 years ago
} TSCfgInfo;
23 years ago
Oid name2id_cfg(text *name);
TSCfgInfo *findcfg(Oid id);
void init_cfg(Oid id, TSCfgInfo * cfg);
void reset_cfg(void);
23 years ago
23 years ago
typedef struct
{
uint16 len;
uint16 nvariant;
23 years ago
union
{
23 years ago
uint16 pos;
23 years ago
uint16 *apos;
} pos;
char *word;
uint32 alen;
} TSWORD;
23 years ago
typedef struct
{
TSWORD *words;
23 years ago
int4 lenwords;
int4 curwords;
23 years ago
int4 pos;
23 years ago
} PRSTEXT;
typedef struct
{
uint32 selected:1,
23 years ago
in:1,
replace:1,
repeated:1,
unused:4,
type:8,
len:16;
23 years ago
char *word;
ITEM *item;
} HLWORD;
23 years ago
23 years ago
typedef struct
{
HLWORD *words;
int4 lenwords;
int4 curwords;
char *startsel;
char *stopsel;
int2 startsellen;
int2 stopsellen;
} HLPRSTEXT;
23 years ago
23 years ago
void hlparsetext(TSCfgInfo * cfg, HLPRSTEXT * prs, QUERYTYPE * query, char *buf, int4 buflen);
text *genhl(HLPRSTEXT * prs);
23 years ago
23 years ago
void parsetext_v2(TSCfgInfo * cfg, PRSTEXT * prs, char *buf, int4 buflen);
int get_currcfg(void);
23 years ago
#endif