44 #ifndef EXPANDEDDATUM_H
45 #define EXPANDEDDATUM_H
48 #define EXPANDED_POINTER_SIZE (VARHDRSZ_EXTERNAL + sizeof(varatt_expanded))
69 void *result,
Size allocated_size);
127 #define EOH_HEADER_MAGIC (-1)
128 #define VARATT_IS_EXPANDED_HEADER(PTR) \
129 (((varattrib_4b *) (PTR))->va_4byte.va_header == (uint32) EOH_HEADER_MAGIC)
136 #define EOHPGetRWDatum(eohptr) PointerGetDatum((eohptr)->eoh_rw_ptr)
137 #define EOHPGetRODatum(eohptr) PointerGetDatum((eohptr)->eoh_ro_ptr)
140 #define DatumIsReadWriteExpandedObject(d, isnull, typlen) \
141 (((isnull) || (typlen) != -1) ? false : \
142 VARATT_IS_EXTERNAL_EXPANDED_RW(DatumGetPointer(d)))
144 #define MakeExpandedObjectReadOnly(d, isnull, typlen) \
145 (((isnull) || (typlen) != -1) ? (d) : \
146 MakeExpandedObjectReadOnlyInternal(d))
154 void *result,
Size allocated_size);
#define EXPANDED_POINTER_SIZE
void(* EOM_flatten_into_method)(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
Size(* EOM_get_flat_size_method)(ExpandedObjectHeader *eohptr)
void EOH_flatten_into(ExpandedObjectHeader *eohptr, void *result, Size allocated_size)
struct ExpandedObjectMethods ExpandedObjectMethods
void EOH_init_header(ExpandedObjectHeader *eohptr, const ExpandedObjectMethods *methods, MemoryContext obj_context)
void DeleteExpandedObject(Datum d)
Datum TransferExpandedObject(Datum d, MemoryContext new_parent)
Datum MakeExpandedObjectReadOnlyInternal(Datum d)
Size EOH_get_flat_size(ExpandedObjectHeader *eohptr)
char eoh_rw_ptr[EXPANDED_POINTER_SIZE]
MemoryContext eoh_context
const ExpandedObjectMethods * eoh_methods
char eoh_ro_ptr[EXPANDED_POINTER_SIZE]
EOM_get_flat_size_method get_flat_size
EOM_flatten_into_method flatten_into