PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
tupmacs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define att_isnull(ATT, BITS)   (!((BITS)[(ATT) >> 3] & (1 << ((ATT) & 0x07))))
 
#define fetchatt(A, T)   fetch_att(T, (A)->attbyval, (A)->attlen)
 
#define fetch_att(T, attbyval, attlen)
 
#define att_align_datum(cur_offset, attalign, attlen, attdatum)
 
#define att_align_pointer(cur_offset, attalign, attlen, attptr)
 
#define att_align_nominal(cur_offset, attalign)
 
#define att_addlength_datum(cur_offset, attlen, attdatum)   att_addlength_pointer(cur_offset, attlen, DatumGetPointer(attdatum))
 
#define att_addlength_pointer(cur_offset, attlen, attptr)
 
#define store_att_byval(T, newdatum, attlen)
 

Macro Definition Documentation

#define att_addlength_datum (   cur_offset,
  attlen,
  attdatum 
)    att_addlength_pointer(cur_offset, attlen, DatumGetPointer(attdatum))
#define att_addlength_pointer (   cur_offset,
  attlen,
  attptr 
)
Value:
( \
((attlen) > 0) ? \
( \
(cur_offset) + (attlen) \
) \
: (((attlen) == -1) ? \
( \
(cur_offset) + VARSIZE_ANY(attptr) \
) \
: \
( \
AssertMacro((attlen) == -2), \
(cur_offset) + (strlen((char *) (attptr)) + 1) \
)) \
)
#define AssertMacro(condition)
Definition: c.h:672
#define VARSIZE_ANY(PTR)
Definition: postgres.h:336

Definition at line 172 of file tupmacs.h.

Referenced by array_iter_next(), array_iterate(), array_seek(), array_set_element(), array_slice_size(), array_to_text_internal(), brin_deconstruct_tuple(), deconstruct_array(), ExecEvalScalarArrayOp(), get_text_array_contents(), heap_deform_tuple(), nocache_index_getattr(), nocachegetattr(), PLyList_FromArray_recurse(), range_deserialize(), slot_deform_tuple(), tuple_data_split_internal(), and width_bucket_array_variable().

#define att_align_datum (   cur_offset,
  attalign,
  attlen,
  attdatum 
)
Value:
( \
((attlen) == -1 && VARATT_IS_SHORT(DatumGetPointer(attdatum))) ? \
(uintptr_t) (cur_offset) : \
att_align_nominal(cur_offset, attalign) \
)
#define att_align_nominal(cur_offset, attalign)
Definition: tupmacs.h:144
#define VARATT_IS_SHORT(PTR)
Definition: postgres.h:327
#define DatumGetPointer(X)
Definition: postgres.h:557

Definition at line 101 of file tupmacs.h.

Referenced by datum_compute_size(), and heap_compute_data_size().

#define att_align_nominal (   cur_offset,
  attalign 
)
#define att_align_pointer (   cur_offset,
  attalign,
  attlen,
  attptr 
)
Value:
( \
((attlen) == -1 && VARATT_NOT_PAD_BYTE(attptr)) ? \
(uintptr_t) (cur_offset) : \
att_align_nominal(cur_offset, attalign) \
)
#define att_align_nominal(cur_offset, attalign)
Definition: tupmacs.h:144
#define VARATT_NOT_PAD_BYTE(PTR)
Definition: postgres.h:247

Definition at line 122 of file tupmacs.h.

Referenced by brin_deconstruct_tuple(), heap_deform_tuple(), nocache_index_getattr(), nocachegetattr(), range_deserialize(), slot_deform_tuple(), and tuple_data_split_internal().

#define att_isnull (   ATT,
  BITS 
)    (!((BITS)[(ATT) >> 3] & (1 << ((ATT) & 0x07))))
#define fetch_att (   T,
  attbyval,
  attlen 
)
Value:
( \
(attbyval) ? \
( \
(attlen) == (int) sizeof(int32) ? \
: \
( \
(attlen) == (int) sizeof(int16) ? \
Int16GetDatum(*((int16 *)(T))) \
: \
( \
AssertMacro((attlen) == 1), \
CharGetDatum(*((char *)(T))) \
) \
) \
) \
: \
PointerGetDatum((char *) (T)) \
)
signed short int16
Definition: c.h:252
#define PointerGetDatum(X)
Definition: postgres.h:564
#define Int16GetDatum(X)
Definition: postgres.h:459
#define AssertMacro(condition)
Definition: c.h:672
signed int int32
Definition: c.h:253
static const uint32 T[65]
Definition: md5.c:101
#define CharGetDatum(X)
Definition: postgres.h:424
#define Int32GetDatum(X)
Definition: postgres.h:487

Definition at line 71 of file tupmacs.h.

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

#define fetchatt (   A,
  T 
)    fetch_att(T, (A)->attbyval, (A)->attlen)
#define store_att_byval (   T,
  newdatum,
  attlen 
)
Value:
do { \
switch (attlen) \
{ \
case sizeof(char): \
*(char *) (T) = DatumGetChar(newdatum); \
break; \
case sizeof(int16): \
*(int16 *) (T) = DatumGetInt16(newdatum); \
break; \
case sizeof(int32): \
*(int32 *) (T) = DatumGetInt32(newdatum); \
break; \
default: \
elog(ERROR, "unsupported byval length: %d", \
(int) (attlen)); \
break; \
} \
} while (0)
signed short int16
Definition: c.h:252
#define DatumGetInt32(X)
Definition: postgres.h:480
signed int int32
Definition: c.h:253
#define ERROR
Definition: elog.h:43
static const uint32 T[65]
Definition: md5.c:101
#define DatumGetInt16(X)
Definition: postgres.h:452
#define DatumGetChar(X)
Definition: postgres.h:417
#define elog
Definition: elog.h:219

Definition at line 222 of file tupmacs.h.

Referenced by ArrayCastAndSet(), datum_write(), and heap_fill_tuple().