Rizin
unix-like reverse engineering framework and cli tools
ph.h File Reference

Go to the source code of this file.

Macros

#define phn(a_type)
 
#define ph(a_type)
 
#define phn_lchild_get(a_type, a_field, a_phn)    (a_phn->a_field.phn_lchild)
 
#define phn_lchild_set(a_type, a_field, a_phn, a_lchild)
 
#define phn_next_get(a_type, a_field, a_phn)    (a_phn->a_field.phn_next)
 
#define phn_prev_set(a_type, a_field, a_phn, a_prev)
 
#define phn_prev_get(a_type, a_field, a_phn)    (a_phn->a_field.phn_prev)
 
#define phn_next_set(a_type, a_field, a_phn, a_next)
 
#define phn_merge_ordered(a_type, a_field, a_phn0, a_phn1, a_cmp)
 
#define phn_merge(a_type, a_field, a_phn0, a_phn1, a_cmp, rz_phn)
 
#define ph_merge_siblings(a_type, a_field, a_phn, a_cmp, rz_phn)
 
#define ph_merge_aux(a_type, a_field, a_ph, a_cmp)
 
#define ph_merge_children(a_type, a_field, a_phn, a_cmp, rz_phn)
 
#define ph_proto(a_attr, a_prefix, a_ph_type, a_type)
 
#define ph_gen(a_attr, a_prefix, a_ph_type, a_type, a_field, a_cmp)
 

Macro Definition Documentation

◆ ph

#define ph (   a_type)
Value:
struct { \
a_type *ph_root; \
}

Definition at line 27 of file ph.h.

◆ ph_gen

#define ph_gen (   a_attr,
  a_prefix,
  a_ph_type,
  a_type,
  a_field,
  a_cmp 
)

Definition at line 199 of file ph.h.

◆ ph_merge_aux

#define ph_merge_aux (   a_type,
  a_field,
  a_ph,
  a_cmp 
)
Value:
do { \
a_type *phn = phn_next_get(a_type, a_field, a_ph->ph_root); \
if (phn != NULL) { \
phn_prev_set(a_type, a_field, a_ph->ph_root, NULL); \
phn_next_set(a_type, a_field, a_ph->ph_root, NULL); \
phn_prev_set(a_type, a_field, phn, NULL); \
ph_merge_siblings(a_type, a_field, phn, a_cmp, phn); \
assert(phn_next_get(a_type, a_field, phn) == NULL); \
phn_merge(a_type, a_field, a_ph->ph_root, phn, a_cmp, \
a_ph->ph_root); \
} \
} while (0)
#define NULL
Definition: cris-opc.c:27
#define phn_next_get(a_type, a_field, a_phn)
Definition: ph.h:39
#define phn(a_type)
Definition: ph.h:19

Definition at line 160 of file ph.h.

◆ ph_merge_children

#define ph_merge_children (   a_type,
  a_field,
  a_phn,
  a_cmp,
  rz_phn 
)
Value:
do { \
a_type *lchild = phn_lchild_get(a_type, a_field, a_phn); \
if (lchild == NULL) \
rz_phn = NULL; \
else { \
ph_merge_siblings(a_type, a_field, lchild, a_cmp, \
rz_phn); \
} \
} while (0)
#define phn_lchild_get(a_type, a_field, a_phn)
Definition: ph.h:33

Definition at line 173 of file ph.h.

◆ ph_merge_siblings

#define ph_merge_siblings (   a_type,
  a_field,
  a_phn,
  a_cmp,
  rz_phn 
)

Definition at line 82 of file ph.h.

◆ ph_proto

#define ph_proto (   a_attr,
  a_prefix,
  a_ph_type,
  a_type 
)
Value:
a_attr void a_prefix##new(a_ph_type *ph); \
a_attr bool a_prefix##empty(a_ph_type *ph); \
a_attr a_type *a_prefix##first(a_ph_type *ph); \
a_attr void a_prefix##insert(a_ph_type *ph, a_type *phn); \
a_attr a_type *a_prefix##remove_first(a_ph_type *ph); \
a_attr void a_prefix##remove(a_ph_type *ph, a_type *phn);
static void insert(char *dst, const char *src)
Definition: filter.c:39
#define ph(a_type)
Definition: ph.h:27

Definition at line 187 of file ph.h.

◆ phn

#define phn (   a_type)
Value:
struct { \
a_type *phn_prev; \
a_type *phn_next; \
a_type *phn_lchild; \
}

Definition at line 19 of file ph.h.

◆ phn_lchild_get

#define phn_lchild_get (   a_type,
  a_field,
  a_phn 
)     (a_phn->a_field.phn_lchild)

Definition at line 33 of file ph.h.

◆ phn_lchild_set

#define phn_lchild_set (   a_type,
  a_field,
  a_phn,
  a_lchild 
)
Value:
do { \
a_phn->a_field.phn_lchild = a_lchild; \
} while (0)

Definition at line 35 of file ph.h.

◆ phn_merge

#define phn_merge (   a_type,
  a_field,
  a_phn0,
  a_phn1,
  a_cmp,
  rz_phn 
)
Value:
do { \
if (a_phn0 == NULL) \
rz_phn = a_phn1; \
else if (a_phn1 == NULL) \
rz_phn = a_phn0; \
else if (a_cmp(a_phn0, a_phn1) < 0) { \
phn_merge_ordered(a_type, a_field, a_phn0, a_phn1, \
a_cmp); \
rz_phn = a_phn0; \
} else { \
phn_merge_ordered(a_type, a_field, a_phn1, a_phn0, \
a_cmp); \
rz_phn = a_phn1; \
} \
} while (0)

Definition at line 66 of file ph.h.

◆ phn_merge_ordered

#define phn_merge_ordered (   a_type,
  a_field,
  a_phn0,
  a_phn1,
  a_cmp 
)
Value:
do { \
a_type *phn0child; \
assert(a_phn0 != NULL); \
assert(a_phn1 != NULL); \
assert(a_cmp(a_phn0, a_phn1) <= 0); \
phn_prev_set(a_type, a_field, a_phn1, a_phn0); \
phn0child = phn_lchild_get(a_type, a_field, a_phn0); \
phn_next_set(a_type, a_field, a_phn1, phn0child); \
if (phn0child != NULL) \
phn_prev_set(a_type, a_field, phn0child, a_phn1); \
phn_lchild_set(a_type, a_field, a_phn0, a_phn1); \
} while (0)
assert(limit<=UINT32_MAX/2)
#define phn_prev_set(a_type, a_field, a_phn, a_prev)
Definition: ph.h:41

Definition at line 51 of file ph.h.

◆ phn_next_get

#define phn_next_get (   a_type,
  a_field,
  a_phn 
)     (a_phn->a_field.phn_next)

Definition at line 39 of file ph.h.

◆ phn_next_set

#define phn_next_set (   a_type,
  a_field,
  a_phn,
  a_next 
)
Value:
do { \
a_phn->a_field.phn_next = a_next; \
} while (0)

Definition at line 47 of file ph.h.

◆ phn_prev_get

#define phn_prev_get (   a_type,
  a_field,
  a_phn 
)     (a_phn->a_field.phn_prev)

Definition at line 45 of file ph.h.

◆ phn_prev_set

#define phn_prev_set (   a_type,
  a_field,
  a_phn,
  a_prev 
)
Value:
do { \
a_phn->a_field.phn_prev = a_prev; \
} while (0)

Definition at line 41 of file ph.h.