PostgreSQL Source Code  git master
genbki.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * genbki.h
4  * Required include file for all POSTGRES catalog header files
5  *
6  * genbki.h defines CATALOG(), BKI_BOOTSTRAP and related macros
7  * so that the catalog header files can be read by the C compiler.
8  * (These same words are recognized by genbki.pl to build the BKI
9  * bootstrap file from these header files.)
10  *
11  *
12  * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
13  * Portions Copyright (c) 1994, Regents of the University of California
14  *
15  * src/include/catalog/genbki.h
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef GENBKI_H
20 #define GENBKI_H
21 
22 /* Introduces a catalog's structure definition */
23 #define CATALOG(name,oid,oidmacro) typedef struct CppConcat(FormData_,name)
24 
25 /* Options that may appear after CATALOG (on the same line) */
26 #define BKI_BOOTSTRAP
27 #define BKI_SHARED_RELATION
28 #define BKI_WITHOUT_OIDS
29 #define BKI_ROWTYPE_OID(oid,oidmacro)
30 #define BKI_SCHEMA_MACRO
31 
32 /* Options that may appear after an attribute (on the same line) */
33 #define BKI_FORCE_NULL
34 #define BKI_FORCE_NOT_NULL
35 /* Specifies a default value for a catalog field */
36 #define BKI_DEFAULT(value)
37 /* Indicates how to perform name lookups for an OID or OID-array field */
38 #define BKI_LOOKUP(catalog)
39 
40 /* The following are never defined; they are here only for documentation. */
41 
42 /*
43  * Variable-length catalog fields (except possibly the first not nullable one)
44  * should not be visible in C structures, so they are made invisible by #ifdefs
45  * of an undefined symbol. See also MARKNOTNULL in bootstrap.c for how this is
46  * handled.
47  */
48 #undef CATALOG_VARLEN
49 
50 /*
51  * There is code in some catalog headers that needs to be visible to clients,
52  * but we don't want clients to include the full header because of safety
53  * issues with other code in the header. To handle that, surround code that
54  * should be visible to clients with "#ifdef EXPOSE_TO_CLIENT_CODE". That
55  * instructs genbki.pl to copy the section when generating the corresponding
56  * "_d" header, which can be included by both client and backend code.
57  */
58 #undef EXPOSE_TO_CLIENT_CODE
59 
60 #endif /* GENBKI_H */