Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / include / tsearch / ts_public.h
blob255a89720e1c30d57e510f8a80048cafc598b78d
1 /*-------------------------------------------------------------------------
3 * ts_public.h
4 * Public interface to various tsearch modules, such as
5 * parsers and dictionaries.
7 * Copyright (c) 1998-2009, PostgreSQL Global Development Group
9 * $PostgreSQL$
11 *-------------------------------------------------------------------------
13 #ifndef _PG_TS_PUBLIC_H_
14 #define _PG_TS_PUBLIC_H_
16 #include "tsearch/ts_type.h"
19 * Parser's framework
23 * returning type for prslextype method of parser
25 typedef struct
27 int lexid;
28 char *alias;
29 char *descr;
30 } LexDescr;
33 * Interface to headline generator
35 typedef struct
37 uint32 selected:1,
38 in:1,
39 replace:1,
40 repeated:1,
41 skip:1,
42 unused:3,
43 type:8,
44 len:16;
45 char *word;
46 QueryOperand *item;
47 } HeadlineWordEntry;
49 typedef struct
51 HeadlineWordEntry *words;
52 int4 lenwords;
53 int4 curwords;
54 char *startsel;
55 char *stopsel;
56 char *fragdelim;
57 int2 startsellen;
58 int2 stopsellen;
59 int2 fragdelimlen;
60 } HeadlineParsedText;
63 * Common useful things for tsearch subsystem
65 extern char *get_tsearch_config_filename(const char *basename,
66 const char *extension);
69 * Often useful stopword list management
71 typedef struct
73 int len;
74 char **stop;
75 } StopList;
77 extern void readstoplist(const char *fname, StopList *s,
78 char *(*wordop) (const char *));
79 extern bool searchstoplist(StopList *s, char *key);
82 * Interface with dictionaries
85 /* return struct for any lexize function */
86 typedef struct
89 * number of variant of split word , for example Word 'fotballklubber'
90 * (norwegian) has two varian to split: ( fotball, klubb ) and ( fot,
91 * ball, klubb ). So, dictionary should return: nvariant lexeme 1 fotball
92 * 1 klubb 2 fot 2 ball 2 klubb
94 uint16 nvariant;
96 uint16 flags;
98 /* C-string */
99 char *lexeme;
100 } TSLexeme;
102 #define TSL_ADDPOS 0x01
103 #define TSL_PREFIX 0x02
106 * Struct for supporting complex dictionaries like thesaurus.
107 * 4th argument for dictlexize method is a pointer to this
109 typedef struct
111 bool isend; /* in: marks for lexize_info about text end is
112 * reached */
113 bool getnext; /* out: dict wants next lexeme */
114 void *private; /* internal dict state between calls with
115 * getnext == true */
116 } DictSubState;
118 #endif /* _PG_TS_PUBLIC_H_ */