Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / include / tsearch / ts_cache.h
blob4991bf3ec799696c9efc643edf659673119714ee
1 /*-------------------------------------------------------------------------
3 * ts_cache.h
4 * Tsearch related object caches.
6 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * $PostgreSQL$
11 *-------------------------------------------------------------------------
13 #ifndef TS_CACHE_H
14 #define TS_CACHE_H
16 #include "fmgr.h"
17 #include "utils/guc.h"
21 * All TS*CacheEntry structs must share this common header
22 * (see InvalidateTSCacheCallBack)
24 typedef struct TSAnyCacheEntry
26 Oid objId;
27 bool isvalid;
28 } TSAnyCacheEntry;
31 typedef struct TSParserCacheEntry
33 /* prsId is the hash lookup key and MUST BE FIRST */
34 Oid prsId; /* OID of the parser */
35 bool isvalid;
37 Oid startOid;
38 Oid tokenOid;
39 Oid endOid;
40 Oid headlineOid;
41 Oid lextypeOid;
44 * Pre-set-up fmgr call of most needed parser's methods
46 FmgrInfo prsstart;
47 FmgrInfo prstoken;
48 FmgrInfo prsend;
49 FmgrInfo prsheadline;
50 } TSParserCacheEntry;
52 typedef struct TSDictionaryCacheEntry
54 /* dictId is the hash lookup key and MUST BE FIRST */
55 Oid dictId;
56 bool isvalid;
58 /* most frequent fmgr call */
59 Oid lexizeOid;
60 FmgrInfo lexize;
62 MemoryContext dictCtx; /* memory context to store private data */
63 void *dictData;
64 } TSDictionaryCacheEntry;
66 typedef struct
68 int len;
69 Oid *dictIds;
70 } ListDictionary;
72 typedef struct
74 /* cfgId is the hash lookup key and MUST BE FIRST */
75 Oid cfgId;
76 bool isvalid;
78 Oid prsId;
80 int lenmap;
81 ListDictionary *map;
82 } TSConfigCacheEntry;
86 * GUC variable for current configuration
88 extern char *TSCurrentConfig;
91 extern TSParserCacheEntry *lookup_ts_parser_cache(Oid prsId);
92 extern TSDictionaryCacheEntry *lookup_ts_dictionary_cache(Oid dictId);
93 extern TSConfigCacheEntry *lookup_ts_config_cache(Oid cfgId);
95 extern Oid getTSCurrentConfig(bool emitError);
96 extern const char *assignTSCurrentConfig(const char *newval, bool doit, GucSource source);
98 #endif /* TS_CACHE_H */