2003-07-21 18:27:44 +08:00
|
|
|
#ifndef __TS_CFG_H__
|
|
|
|
#define __TS_CFG_H__
|
2004-05-31 21:29:43 +08:00
|
|
|
|
2003-07-21 18:27:44 +08:00
|
|
|
#include "postgres.h"
|
|
|
|
#include "query.h"
|
|
|
|
|
2004-05-31 21:29:43 +08:00
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
Datum *dict_id;
|
|
|
|
} ListDictionary;
|
2003-07-21 18:27:44 +08:00
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Oid id;
|
|
|
|
Oid prs_id;
|
|
|
|
int len;
|
|
|
|
ListDictionary *map;
|
2003-07-21 18:27:44 +08:00
|
|
|
} TSCfgInfo;
|
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
Oid name2id_cfg(text *name);
|
|
|
|
TSCfgInfo *findcfg(Oid id);
|
|
|
|
void init_cfg(Oid id, TSCfgInfo * cfg);
|
|
|
|
void reset_cfg(void);
|
2003-07-21 18:27:44 +08:00
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint16 len;
|
2005-01-25 23:24:38 +08:00
|
|
|
uint16 nvariant;
|
2003-08-04 08:43:34 +08:00
|
|
|
union
|
|
|
|
{
|
2003-07-21 18:27:44 +08:00
|
|
|
uint16 pos;
|
2003-08-04 08:43:34 +08:00
|
|
|
uint16 *apos;
|
|
|
|
} pos;
|
|
|
|
char *word;
|
|
|
|
uint32 alen;
|
2004-05-31 21:29:43 +08:00
|
|
|
} TSWORD;
|
2003-08-04 08:43:34 +08:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2004-05-31 21:29:43 +08:00
|
|
|
TSWORD *words;
|
2003-08-04 08:43:34 +08:00
|
|
|
int4 lenwords;
|
|
|
|
int4 curwords;
|
2003-07-21 18:27:44 +08:00
|
|
|
int4 pos;
|
2003-08-04 08:43:34 +08:00
|
|
|
} PRSTEXT;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2004-06-29 00:19:09 +08:00
|
|
|
uint32 selected:1,
|
2003-08-04 08:43:34 +08:00
|
|
|
in:1,
|
|
|
|
replace:1,
|
2004-06-29 00:19:09 +08:00
|
|
|
repeated:1,
|
|
|
|
unused:4,
|
|
|
|
type:8,
|
|
|
|
len:16;
|
2003-08-04 08:43:34 +08:00
|
|
|
char *word;
|
|
|
|
ITEM *item;
|
|
|
|
} HLWORD;
|
2003-07-21 18:27:44 +08:00
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
HLWORD *words;
|
|
|
|
int4 lenwords;
|
|
|
|
int4 curwords;
|
|
|
|
char *startsel;
|
|
|
|
char *stopsel;
|
|
|
|
int2 startsellen;
|
|
|
|
int2 stopsellen;
|
|
|
|
} HLPRSTEXT;
|
2003-07-21 18:27:44 +08:00
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
void hlparsetext(TSCfgInfo * cfg, HLPRSTEXT * prs, QUERYTYPE * query, char *buf, int4 buflen);
|
|
|
|
text *genhl(HLPRSTEXT * prs);
|
2003-07-21 18:27:44 +08:00
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
void parsetext_v2(TSCfgInfo * cfg, PRSTEXT * prs, char *buf, int4 buflen);
|
|
|
|
int get_currcfg(void);
|
2003-07-21 18:27:44 +08:00
|
|
|
|
|
|
|
#endif
|