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_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)))
#define AssertVariableIsOfTypeMacro(varname, typename)
Definition: c.h:966

Definition at line 51 of file relptr.h.

◆ relptr_copy

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

Definition at line 87 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_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:664
static Size relptr_store_eval(char *base, char *val)
Definition: relptr.h:61

Definition at line 82 of file relptr.h.

Function Documentation

◆ relptr_store_eval()

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

Definition at line 61 of file relptr.h.

62 {
63  if (val == NULL)
64  return 0;
65  else
66  {
67  Assert(val > base);
68  return val - base;
69  }
70 }
Assert(fmt[strlen(fmt) - 1] !='\n')

References Assert(), and val.