PostgreSQL Source Code  git master
relptr.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define relptr(type)   union { type *relptr_type; Size relptr_off; }
 
#define relptr_declare(type, relptrtype)    typedef relptr(type) relptrtype
 
#define relptr_access(base, rp)
 
#define relptr_is_null(rp)    ((rp).relptr_off == 0)
 
#define relptr_offset(rp)    ((rp).relptr_off - 1)
 
#define relptr_store(base, rp, val)
 
#define relptr_copy(rp1, rp2)    ((rp1).relptr_off = (rp2).relptr_off)
 

Functions

static Size relptr_store_eval (char *base, char *val)
 

Macro Definition Documentation

◆ relptr

#define relptr (   type)    union { type *relptr_type; Size relptr_off; }

Definition at line 29 of file relptr.h.

◆ relptr_access

#define relptr_access (   base,
  rp 
)
Value:
(AssertVariableIsOfTypeMacro(base, char *), \
(void *) ((rp).relptr_off == 0 ? NULL : (base) + (rp).relptr_off - 1))
#define AssertVariableIsOfTypeMacro(varname, typename)
Definition: c.h:938

Definition at line 51 of file relptr.h.

◆ relptr_copy

#define relptr_copy (   rp1,
  rp2 
)     ((rp1).relptr_off = (rp2).relptr_off)

Definition at line 90 of file relptr.h.

◆ relptr_declare

#define relptr_declare (   type,
  relptrtype 
)     typedef relptr(type) relptrtype

Definition at line 38 of file relptr.h.

◆ relptr_is_null

#define relptr_is_null (   rp)     ((rp).relptr_off == 0)

Definition at line 56 of file relptr.h.

◆ relptr_offset

#define relptr_offset (   rp)     ((rp).relptr_off - 1)

Definition at line 59 of file relptr.h.

◆ relptr_store

#define relptr_store (   base,
  rp,
  val 
)
Value:
(AssertVariableIsOfTypeMacro(base, char *), \
(rp).relptr_off = relptr_store_eval((base), (char *) (val)))
long val
Definition: informix.c:689
static Size relptr_store_eval(char *base, char *val)
Definition: relptr.h:64

Definition at line 85 of file relptr.h.

Function Documentation

◆ relptr_store_eval()

static Size relptr_store_eval ( char *  base,
char *  val 
)
inlinestatic

Definition at line 64 of file relptr.h.

65 {
66  if (val == NULL)
67  return 0;
68  else
69  {
70  Assert(val >= base);
71  return val - base + 1;
72  }
73 }
#define Assert(condition)
Definition: c.h:812

References Assert, and val.