summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-01-14 16:15:20 -0800
committerAndres Freund <andres@anarazel.de>2019-01-14 16:25:50 -0800
commit774a975c9a5903d271a727a260efd8c31125b9d6 (patch)
treeab4f9c018b82f5a4c97917470ea034fb4dfebd72 /src/include
parente451dd5521966516110eb1761342ae4a1380b19d (diff)
Make naming of tupdesc related structs more consistent with the rest of PG.
We usually don't change the name of structs between the struct name itself and the name of the typedef. Additionally, structs that are usually used via a typedef that hides being a pointer, are commonly suffixed Data. Change tupdesc code to follow those convention. This is triggered by a future patch that intends to forward declare TupleDescData in another header - keeping with the naming scheme makes that easier to understand. Author: Andres Freund Discussion: https://postgr.es/m/20190114000701.y4ttcb74jpskkcfb@alap3.anarazel.de
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/tupdesc.h15
-rw-r--r--src/include/access/tupdesc_details.h2
-rw-r--r--src/include/jit/llvmjit.h2
3 files changed, 10 insertions, 9 deletions
diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h
index 93546ce585b..66d1b2fc40e 100644
--- a/src/include/access/tupdesc.h
+++ b/src/include/access/tupdesc.h
@@ -19,13 +19,13 @@
#include "nodes/pg_list.h"
-typedef struct attrDefault
+typedef struct AttrDefault
{
AttrNumber adnum;
char *adbin; /* nodeToString representation of expr */
} AttrDefault;
-typedef struct constrCheck
+typedef struct ConstrCheck
{
char *ccname;
char *ccbin; /* nodeToString representation of expr */
@@ -34,11 +34,11 @@ typedef struct constrCheck
} ConstrCheck;
/* This structure contains constraints of a tuple */
-typedef struct tupleConstr
+typedef struct TupleConstr
{
AttrDefault *defval; /* array */
ConstrCheck *check; /* array */
- struct attrMissing *missing; /* missing attributes values, NULL if none */
+ struct AttrMissing *missing; /* missing attributes values, NULL if none */
uint16 num_defval;
uint16 num_check;
bool has_not_null;
@@ -75,7 +75,7 @@ typedef struct tupleConstr
* field of such a descriptor to -1, while reference-counted descriptors
* always have tdrefcount >= 0.
*/
-typedef struct tupleDesc
+typedef struct TupleDescData
{
int natts; /* number of attributes in the tuple */
Oid tdtypeid; /* composite type ID for tuple type */
@@ -84,7 +84,8 @@ typedef struct tupleDesc
TupleConstr *constr; /* constraints, or NULL if none */
/* attrs[N] is the description of Attribute Number N+1 */
FormData_pg_attribute attrs[FLEXIBLE_ARRAY_MEMBER];
-} *TupleDesc;
+} TupleDescData;
+typedef struct TupleDescData *TupleDesc;
/* Accessor for the i'th attribute of tupdesc. */
#define TupleDescAttr(tupdesc, i) (&(tupdesc)->attrs[(i)])
@@ -98,7 +99,7 @@ extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc);
extern TupleDesc CreateTupleDescCopyConstr(TupleDesc tupdesc);
#define TupleDescSize(src) \
- (offsetof(struct tupleDesc, attrs) + \
+ (offsetof(struct TupleDescData, attrs) + \
(src)->natts * sizeof(FormData_pg_attribute))
extern void TupleDescCopy(TupleDesc dst, TupleDesc src);
diff --git a/src/include/access/tupdesc_details.h b/src/include/access/tupdesc_details.h
index 39c0320a818..a0b2be100f3 100644
--- a/src/include/access/tupdesc_details.h
+++ b/src/include/access/tupdesc_details.h
@@ -19,7 +19,7 @@
* Structure used to represent value to be used when the attribute is not
* present at all in a tuple, i.e. when the column was created after the tuple
*/
-typedef struct attrMissing
+typedef struct AttrMissing
{
bool am_present; /* true if non-NULL missing value exists */
Datum am_value; /* value when attribute is missing */
diff --git a/src/include/jit/llvmjit.h b/src/include/jit/llvmjit.h
index 91829bc441c..2545abeddd1 100644
--- a/src/include/jit/llvmjit.h
+++ b/src/include/jit/llvmjit.h
@@ -62,7 +62,7 @@ extern LLVMTypeRef TypePGFunction;
extern LLVMTypeRef TypeSizeT;
extern LLVMTypeRef TypeStorageBool;
-extern LLVMTypeRef StructtupleDesc;
+extern LLVMTypeRef StructTupleDescData;
extern LLVMTypeRef StructHeapTupleData;
extern LLVMTypeRef StructTupleTableSlot;
extern LLVMTypeRef StructHeapTupleTableSlot;