PostgreSQL Source Code: src/include/access/tupmacs.h File Reference (original) (raw)

#include "catalog/pg_type_d.h"

Go to the source code of this file.

Macros
#define fetchatt(A, T) fetch_att(T, (A)->attbyval, (A)->attlen)
#define att_align_datum(cur_offset, attalign, attlen, attdatum)
#define att_datum_alignby(cur_offset, attalignby, attlen, attdatum)
#define att_align_pointer(cur_offset, attalign, attlen, attptr)
#define att_pointer_alignby(cur_offset, attalignby, attlen, attptr)
#define att_align_nominal(cur_offset, attalign)
#define att_nominal_alignby(cur_offset, attalignby) TYPEALIGN(attalignby, cur_offset)
#define att_addlength_datum(cur_offset, attlen, attdatum) att_addlength_pointer(cur_offset, attlen, DatumGetPointer(attdatum))
#define att_addlength_pointer(cur_offset, attlen, attptr)
Functions
static bool att_isnull (int ATT, const bits8 *BITS)
static Datum fetch_att (const void *T, bool attbyval, int attlen)
static void store_att_byval (void *T, Datum newdatum, int attlen)

att_addlength_datum

att_addlength_pointer

| #define att_addlength_pointer | ( | | cur_offset, | | --------------------------------------------------------------------------- | - | | ------------ | | | attlen, | | | | | | attptr | | | | | ) | | | |

Value:

( \

( \

(cur_offset) + (attlen) \

) \

( \

) \

: \

( \

(cur_offset) + (strlen((char *) (attptr)) + 1) \

)) \

)

#define AssertMacro(condition)

static Size VARSIZE_ANY(const void *PTR)

Definition at line 180 of file tupmacs.h.

att_align_datum

Value:

( \

(uintptr_t) (cur_offset) : \

att_align_nominal(cur_offset, attalign) \

)

static Pointer DatumGetPointer(Datum X)

static bool VARATT_IS_SHORT(const void *PTR)

Definition at line 82 of file tupmacs.h.

att_align_nominal

| #define att_align_nominal | ( | | cur_offset, | | ---------------------------------------------------------------------------- | - | | ------------ | | | attalign | | | | | ) | | | |

Value:

( \

(((attalign) == TYPALIGN_CHAR) ? (uintptr_t) (cur_offset) : \

( \

))) \

)

Definition at line 145 of file tupmacs.h.

att_align_pointer

Value:

( \

(uintptr_t) (cur_offset) : \

)

#define att_align_nominal(cur_offset, attalign)

#define VARATT_NOT_PAD_BYTE(PTR)

Definition at line 113 of file tupmacs.h.

att_datum_alignby

| #define att_datum_alignby | ( | | cur_offset, | | --------------------------------------------------------------------------- | - | | ------------ | | | attalignby, | | | | | | attlen, | | | | | | attdatum | | | | | ) | | | |

Value:

( \

(uintptr_t) (cur_offset) : \

TYPEALIGN(attalignby, cur_offset))

Definition at line 93 of file tupmacs.h.

att_nominal_alignby

| #define att_nominal_alignby | ( | | cur_offset, | | ----------------------------- | ----------------------------------------------------------------------------------- | | ------------ | | | attalignby | | | | | ) | TYPEALIGN(attalignby, cur_offset) | | |

att_pointer_alignby

| #define att_pointer_alignby | ( | | cur_offset, | | --------------------------------------------------------------------------- | - | | ------------ | | | attalignby, | | | | | | attlen, | | | | | | attptr | | | | | ) | | | |

Value:

( \

(uintptr_t) (cur_offset) : \

#define TYPEALIGN(ALIGNVAL, LEN)

Definition at line 124 of file tupmacs.h.

fetchatt

att_isnull()

static bool att_isnull ( int ATT, const bits8 * BITS ) inlinestatic

Definition at line 26 of file tupmacs.h.

27{

28 return !(BITS[ATT >> 3] & (1 << (ATT & 0x07)));

29}

Referenced by brin_deconstruct_tuple(), check_tuple_attribute(), fastgetattr(), heap_attisnull(), heap_deform_tuple(), index_deform_tuple_internal(), index_getattr(), nocache_index_getattr(), nocachegetattr(), slot_deform_heap_tuple_internal(), and tuple_data_split_internal().

fetch_att()

static Datum fetch_att ( const void * T, bool attbyval, int attlen ) inlinestatic

Definition at line 50 of file tupmacs.h.

51{

53 {

55 {

56 case sizeof(char):

58 case sizeof(int16):

60 case sizeof(int32):

62 case sizeof(int64):

64 default:

66 return 0;

67 }

68 }

69 else

71}

static const uint32 T[65]

static Datum Int64GetDatum(int64 X)

static Datum PointerGetDatum(const void *X)

static Datum Int16GetDatum(int16 X)

static Datum Int32GetDatum(int32 X)

static Datum CharGetDatum(char X)

References attbyval, attlen, CharGetDatum(), elog, ERROR, Int16GetDatum(), Int32GetDatum(), Int64GetDatum(), PointerGetDatum(), and T.

Referenced by array_iter_next(), array_iterate(), array_replace_internal(), array_to_text_internal(), ArrayCast(), brin_range_deserialize(), deconstruct_array(), ExecEvalHashedScalarArrayOp(), ExecEvalScalarArrayOp(), multirange_get_bounds(), PLyList_FromArray_recurse(), range_deserialize(), statext_mcv_deserialize(), width_bucket_array_fixed(), and width_bucket_array_variable().

store_att_byval()

static void store_att_byval ( void * T, Datum newdatum, int attlen ) inlinestatic

Definition at line 206 of file tupmacs.h.

207{

209 {

210 case sizeof(char):

212 break;

213 case sizeof(int16):

215 break;

216 case sizeof(int32):

218 break;

219 case sizeof(int64):

221 break;

222 default:

224 }

225}

static int64 DatumGetInt64(Datum X)

static char DatumGetChar(Datum X)

static int16 DatumGetInt16(Datum X)

static int32 DatumGetInt32(Datum X)

References attlen, DatumGetChar(), DatumGetInt16(), DatumGetInt32(), DatumGetInt64(), elog, ERROR, and T.

Referenced by ArrayCastAndSet(), brin_range_serialize(), datum_write(), fill_val(), and statext_mcv_serialize().