Header And Logo

PostgreSQL
| The world's most advanced open source database.

Defines

tupmacs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#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)

Define 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) \
    )) \
)

Definition at line 172 of file tupmacs.h.

Referenced by array_cmp(), array_contain_compare(), array_eq(), array_iterate(), array_out(), array_seek(), array_send(), array_set(), array_slice_size(), array_to_text_internal(), array_unnest(), deconstruct_array(), ExecEvalScalarArrayOp(), get_text_array_contents(), hash_array(), heap_deform_tuple(), nocache_index_getattr(), nocachegetattr(), range_deserialize(), and slot_deform_tuple().

#define att_align_datum (   cur_offset,
  attalign,
  attlen,
  attdatum 
)
Value:
( \
    ((attlen) == -1 && VARATT_IS_SHORT(DatumGetPointer(attdatum))) ? \
    (intptr_t) (cur_offset) : \
    att_align_nominal(cur_offset, attalign) \
)

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)) ? \
    (intptr_t) (cur_offset) : \
    att_align_nominal(cur_offset, attalign) \
)

Definition at line 122 of file tupmacs.h.

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

#define att_isnull (   ATT,
  BITS 
)    (!((BITS)[(ATT) >> 3] & (1 << ((ATT) & 0x07))))
#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)) \
)

Definition at line 71 of file tupmacs.h.

Referenced by array_cmp(), array_contain_compare(), array_eq(), array_iterate(), array_map(), array_out(), array_replace_internal(), array_send(), array_to_text_internal(), ArrayCast(), deconstruct_array(), ExecEvalScalarArrayOp(), hash_array(), and range_deserialize().

#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)

Definition at line 222 of file tupmacs.h.

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