PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ts_cache.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * ts_cache.h
4  * Tsearch related object caches.
5  *
6  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/tsearch/ts_cache.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef TS_CACHE_H
14 #define TS_CACHE_H
15 
16 #include "utils/guc.h"
17 
18 
19 /*
20  * All TS*CacheEntry structs must share this common header
21  * (see InvalidateTSCacheCallBack)
22  */
23 typedef struct TSAnyCacheEntry
24 {
26  bool isvalid;
28 
29 
30 typedef struct TSParserCacheEntry
31 {
32  /* prsId is the hash lookup key and MUST BE FIRST */
33  Oid prsId; /* OID of the parser */
34  bool isvalid;
35 
41 
42  /*
43  * Pre-set-up fmgr call of most needed parser's methods
44  */
50 
51 typedef struct TSDictionaryCacheEntry
52 {
53  /* dictId is the hash lookup key and MUST BE FIRST */
55  bool isvalid;
56 
57  /* most frequent fmgr call */
60 
61  MemoryContext dictCtx; /* memory context to store private data */
62  void *dictData;
64 
65 typedef struct
66 {
67  int len;
70 
71 typedef struct
72 {
73  /* cfgId is the hash lookup key and MUST BE FIRST */
75  bool isvalid;
76 
78 
79  int lenmap;
82 
83 
84 /*
85  * GUC variable for current configuration
86  */
87 extern char *TSCurrentConfig;
88 
89 
93 
94 extern Oid getTSCurrentConfig(bool emitError);
95 extern bool check_TSCurrentConfig(char **newval, void **extra, GucSource source);
96 extern void assign_TSCurrentConfig(const char *newval, void *extra);
97 
98 #endif /* TS_CACHE_H */
Oid getTSCurrentConfig(bool emitError)
Definition: ts_cache.c:556
TSParserCacheEntry * lookup_ts_parser_cache(Oid prsId)
Definition: ts_cache.c:112
struct TSAnyCacheEntry TSAnyCacheEntry
Definition: fmgr.h:53
TSDictionaryCacheEntry * lookup_ts_dictionary_cache(Oid dictId)
Definition: ts_cache.c:210
char * TSCurrentConfig
Definition: ts_cache.c:75
unsigned int Oid
Definition: postgres_ext.h:31
TSConfigCacheEntry * lookup_ts_config_cache(Oid cfgId)
Definition: ts_cache.c:385
GucSource
Definition: guc.h:105
void assign_TSCurrentConfig(const char *newval, void *extra)
Definition: ts_cache.c:647
FmgrInfo prsend
Definition: ts_cache.h:47
Oid * dictIds
Definition: ts_cache.h:68
ListDictionary * map
Definition: ts_cache.h:80
FmgrInfo prstoken
Definition: ts_cache.h:46
#define newval
bool check_TSCurrentConfig(char **newval, void **extra, GucSource source)
Definition: ts_cache.c:587
FmgrInfo prsstart
Definition: ts_cache.h:45
struct TSParserCacheEntry TSParserCacheEntry
struct TSDictionaryCacheEntry TSDictionaryCacheEntry
MemoryContext dictCtx
Definition: ts_cache.h:61
FmgrInfo prsheadline
Definition: ts_cache.h:48