summaryrefslogtreecommitdiff
path: root/contrib/tsearch2/common.h
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2003-07-21 10:27:44 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2003-07-21 10:27:44 +0000
commitb88605337ea37ce1080a696937540cf8b48338d1 (patch)
treeed26ee96ed8ca176fca8a956e938b3cc7adcb1f3 /contrib/tsearch2/common.h
parenta6053826703e288ccc7bd2a9a86a278cef6bc7ed (diff)
downloadpostgresql-b88605337ea37ce1080a696937540cf8b48338d1.tar.gz
tsearch2 module
Diffstat (limited to 'contrib/tsearch2/common.h')
-rw-r--r--contrib/tsearch2/common.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/tsearch2/common.h b/contrib/tsearch2/common.h
new file mode 100644
index 0000000000..70313fa4d2
--- /dev/null
+++ b/contrib/tsearch2/common.h
@@ -0,0 +1,24 @@
+#ifndef __TS_COMMON_H__
+#define __TS_COMMON_H__
+#include "postgres.h"
+#include "fmgr.h"
+
+#ifndef PG_NARGS
+#define PG_NARGS() (fcinfo->nargs)
+#endif
+
+text* char2text(char* in);
+text* charl2text(char* in, int len);
+char *text2char(text* in);
+char *pnstrdup(char* in, int len);
+text *ptextdup(text* in);
+text *mtextdup(text* in);
+
+int text_cmp(text *a, text *b);
+
+#define NEXTVAL(x) ( (text*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )
+#define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x))
+
+void ts_error(int state, const char *format, ...);
+
+#endif