summaryrefslogtreecommitdiff
path: root/contrib/tsearch2/dict.h
diff options
context:
space:
mode:
authorTeodor Sigaev2003-07-21 10:27:44 +0000
committerTeodor Sigaev2003-07-21 10:27:44 +0000
commitb88605337ea37ce1080a696937540cf8b48338d1 (patch)
treeed26ee96ed8ca176fca8a956e938b3cc7adcb1f3 /contrib/tsearch2/dict.h
parenta6053826703e288ccc7bd2a9a86a278cef6bc7ed (diff)
tsearch2 module
Diffstat (limited to 'contrib/tsearch2/dict.h')
-rw-r--r--contrib/tsearch2/dict.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/tsearch2/dict.h b/contrib/tsearch2/dict.h
new file mode 100644
index 00000000000..bbbbfc47a51
--- /dev/null
+++ b/contrib/tsearch2/dict.h
@@ -0,0 +1,38 @@
+#ifndef __DICT_H__
+#define __DICT_H__
+#include "postgres.h"
+#include "fmgr.h"
+
+typedef struct {
+ int len;
+ char **stop;
+ char* (*wordop)(char*);
+} StopList;
+
+void sortstoplist(StopList *s);
+void freestoplist(StopList *s);
+void readstoplist(text *in, StopList *s);
+bool searchstoplist(StopList *s, char *key);
+char* lowerstr(char *str);
+
+typedef struct {
+ Oid dict_id;
+ FmgrInfo lexize_info;
+ void *dictionary;
+} DictInfo;
+
+void init_dict(Oid id, DictInfo *dict);
+DictInfo* finddict(Oid id);
+Oid name2id_dict(text *name);
+void reset_dict(void);
+
+
+/* simple parser of cfg string */
+typedef struct {
+ char *key;
+ char *value;
+} Map;
+
+void parse_cfgdict(text *in, Map **m);
+
+#endif