PostgreSQL Source Code  git master
tupmacs.h File Reference
#include "catalog/pg_type_d.h"
Include dependency graph for tupmacs.h:
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

◆ att_addlength_datum

#define att_addlength_datum (   cur_offset,
  attlen,
  attdatum 
)     att_addlength_pointer(cur_offset, attlen, DatumGetPointer(attdatum))

Definition at line 164 of file tupmacs.h.

◆ att_addlength_pointer

#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:805
int16 attlen
Definition: pg_attribute.h:68
#define VARSIZE_ANY(PTR)
Definition: postgres.h:348

Definition at line 176 of file tupmacs.h.

◆ att_align_datum

#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) \
)
char attalign
Definition: pg_attribute.h:118
#define VARATT_IS_SHORT(PTR)
Definition: postgres.h:339
#define DatumGetPointer(X)
Definition: postgres.h:593

Definition at line 105 of file tupmacs.h.

◆ att_align_nominal

#define att_align_nominal (   cur_offset,
  attalign 
)
Value:
( \
((attalign) == TYPALIGN_INT) ? INTALIGN(cur_offset) : \
(((attalign) == TYPALIGN_CHAR) ? (uintptr_t) (cur_offset) : \
(((attalign) == TYPALIGN_DOUBLE) ? DOUBLEALIGN(cur_offset) : \
( \
AssertMacro((attalign) == TYPALIGN_SHORT), \
SHORTALIGN(cur_offset) \
))) \
)
#define DOUBLEALIGN(LEN)
Definition: c.h:756
#define INTALIGN(LEN)
Definition: c.h:754
#define SHORTALIGN(LEN)
Definition: c.h:753

Definition at line 148 of file tupmacs.h.

◆ att_align_pointer

#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 VARATT_NOT_PAD_BYTE(PTR)
Definition: postgres.h:258
#define att_align_nominal(cur_offset, attalign)
Definition: tupmacs.h:148

Definition at line 126 of file tupmacs.h.

◆ att_isnull

#define att_isnull (   ATT,
  BITS 
)    (!((BITS)[(ATT) >> 3] & (1 << ((ATT) & 0x07))))

Definition at line 25 of file tupmacs.h.

◆ fetch_att

#define fetch_att (   T,
  attbyval,
  attlen 
)
Value:
( \
(attbyval) ? \
( \
(attlen) == (int) sizeof(int32) ? \
Int32GetDatum(*((int32 *)(T))) \
: \
( \
(attlen) == (int) sizeof(int16) ? \
Int16GetDatum(*((int16 *)(T))) \
: \
( \
AssertMacro((attlen) == 1), \
CharGetDatum(*((char *)(T))) \
) \
) \
) \
: \
PointerGetDatum((char *) (T)) \
)
signed short int16
Definition: c.h:428
signed int int32
Definition: c.h:429
static const uint32 T[65]
Definition: md5.c:119
bool attbyval
Definition: pg_attribute.h:112
#define Int16GetDatum(X)
Definition: postgres.h:495
#define CharGetDatum(X)
Definition: postgres.h:460

Definition at line 75 of file tupmacs.h.

◆ fetchatt

#define fetchatt (   A,
  T 
)    fetch_att(T, (A)->attbyval, (A)->attlen)

Definition at line 41 of file tupmacs.h.

◆ store_att_byval

#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)
#define ERROR
Definition: elog.h:33
#define DatumGetInt32(X)
Definition: postgres.h:516
#define DatumGetChar(X)
Definition: postgres.h:453
#define DatumGetInt16(X)
Definition: postgres.h:488

Definition at line 226 of file tupmacs.h.