PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
varbit.h File Reference
#include <limits.h>
#include "fmgr.h"
Include dependency graph for varbit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  VarBit
 

Macros

#define PG_GETARG_VARBIT_P(n)   DatumGetVarBitP(PG_GETARG_DATUM(n))
 
#define PG_GETARG_VARBIT_P_COPY(n)   DatumGetVarBitPCopy(PG_GETARG_DATUM(n))
 
#define PG_RETURN_VARBIT_P(x)   return VarBitPGetDatum(x)
 
#define VARBITHDRSZ   sizeof(int32)
 
#define VARBITLEN(PTR)   (((VarBit *) (PTR))->bit_len)
 
#define VARBITS(PTR)   (((VarBit *) (PTR))->bit_dat)
 
#define VARBITBYTES(PTR)   (VARSIZE(PTR) - VARHDRSZ - VARBITHDRSZ)
 
#define VARBITPAD(PTR)   (VARBITBYTES(PTR)*BITS_PER_BYTE - VARBITLEN(PTR))
 
#define VARBITTOTALLEN(BITLEN)
 
#define VARBITMAXLEN   (INT_MAX - BITS_PER_BYTE + 1)
 
#define VARBITEND(PTR)   (((bits8 *) (PTR)) + VARSIZE(PTR))
 
#define BITMASK   0xFF
 

Functions

static VarBitDatumGetVarBitP (Datum X)
 
static VarBitDatumGetVarBitPCopy (Datum X)
 
static Datum VarBitPGetDatum (const VarBit *X)
 

Macro Definition Documentation

◆ BITMASK

#define BITMASK   0xFF

Definition at line 87 of file varbit.h.

◆ PG_GETARG_VARBIT_P

#define PG_GETARG_VARBIT_P (   n)    DatumGetVarBitP(PG_GETARG_DATUM(n))

Definition at line 62 of file varbit.h.

◆ PG_GETARG_VARBIT_P_COPY

#define PG_GETARG_VARBIT_P_COPY (   n)    DatumGetVarBitPCopy(PG_GETARG_DATUM(n))

Definition at line 63 of file varbit.h.

◆ PG_RETURN_VARBIT_P

#define PG_RETURN_VARBIT_P (   x)    return VarBitPGetDatum(x)

Definition at line 64 of file varbit.h.

◆ VARBITBYTES

#define VARBITBYTES (   PTR)    (VARSIZE(PTR) - VARHDRSZ - VARBITHDRSZ)

Definition at line 73 of file varbit.h.

◆ VARBITEND

#define VARBITEND (   PTR)    (((bits8 *) (PTR)) + VARSIZE(PTR))

Definition at line 85 of file varbit.h.

◆ VARBITHDRSZ

#define VARBITHDRSZ   sizeof(int32)

Definition at line 67 of file varbit.h.

◆ VARBITLEN

#define VARBITLEN (   PTR)    (((VarBit *) (PTR))->bit_len)

Definition at line 69 of file varbit.h.

◆ VARBITMAXLEN

#define VARBITMAXLEN   (INT_MAX - BITS_PER_BYTE + 1)

Definition at line 83 of file varbit.h.

◆ VARBITPAD

#define VARBITPAD (   PTR)    (VARBITBYTES(PTR)*BITS_PER_BYTE - VARBITLEN(PTR))

Definition at line 75 of file varbit.h.

◆ VARBITS

#define VARBITS (   PTR)    (((VarBit *) (PTR))->bit_dat)

Definition at line 71 of file varbit.h.

◆ VARBITTOTALLEN

#define VARBITTOTALLEN (   BITLEN)
Value:
(((BITLEN) + BITS_PER_BYTE-1)/BITS_PER_BYTE + \
VARHDRSZ + VARBITHDRSZ)
#define BITS_PER_BYTE
#define VARBITHDRSZ
Definition: varbit.h:67

Definition at line 77 of file varbit.h.

Function Documentation

◆ DatumGetVarBitP()

static VarBit* DatumGetVarBitP ( Datum  X)
inlinestatic

Definition at line 45 of file varbit.h.

46 {
47  return (VarBit *) PG_DETOAST_DATUM(X);
48 }
#define PG_DETOAST_DATUM(datum)
Definition: fmgr.h:240
Definition: varbit.h:31

References PG_DETOAST_DATUM.

◆ DatumGetVarBitPCopy()

static VarBit* DatumGetVarBitPCopy ( Datum  X)
inlinestatic

Definition at line 51 of file varbit.h.

52 {
53  return (VarBit *) PG_DETOAST_DATUM_COPY(X);
54 }
#define PG_DETOAST_DATUM_COPY(datum)
Definition: fmgr.h:242

References PG_DETOAST_DATUM_COPY.

◆ VarBitPGetDatum()

static Datum VarBitPGetDatum ( const VarBit X)
inlinestatic

Definition at line 57 of file varbit.h.

58 {
59  return PointerGetDatum(X);
60 }
static Datum PointerGetDatum(const void *X)
Definition: postgres.h:322

References PointerGetDatum().

Referenced by bitshiftleft(), and bitshiftright().