QUARK  0.9.0
QUARK-QUeuingAndRuntimeforKernels
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
bsd_tree.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPLAY_HEAD(name, type)
#define SPLAY_INITIALIZER(root)   { NULL }
#define SPLAY_INIT(root)
#define SPLAY_ENTRY(type)
#define SPLAY_LEFT(elm, field)   (elm)->field.spe_left
#define SPLAY_RIGHT(elm, field)   (elm)->field.spe_right
#define SPLAY_ROOT(head)   (head)->sph_root
#define SPLAY_EMPTY(head)   (SPLAY_ROOT(head) == NULL)
#define SPLAY_ROTATE_RIGHT(head, tmp, field)
#define SPLAY_ROTATE_LEFT(head, tmp, field)
#define SPLAY_LINKLEFT(head, tmp, field)
#define SPLAY_LINKRIGHT(head, tmp, field)
#define SPLAY_ASSEMBLE(head, node, left, right, field)
#define SPLAY_PROTOTYPE(name, type, field, cmp)
#define SPLAY_GENERATE(name, type, field, cmp)
#define SPLAY_NEGINF   -1
#define SPLAY_INF   1
#define SPLAY_INSERT(name, x, y)   name##_SPLAY_INSERT(x, y)
#define SPLAY_REMOVE(name, x, y)   name##_SPLAY_REMOVE(x, y)
#define SPLAY_FIND(name, x, y)   name##_SPLAY_FIND(x, y)
#define SPLAY_NEXT(name, x, y)   name##_SPLAY_NEXT(x, y)
#define SPLAY_MIN(name, x)
#define SPLAY_MAX(name, x)
#define SPLAY_FOREACH(x, name, head)
#define RB_HEAD(name, type)
#define RB_INITIALIZER(root)   { NULL }
#define RB_INIT(root)
#define RB_BLACK   0
#define RB_RED   1
#define RB_ENTRY(type)
#define RB_LEFT(elm, field)   (elm)->field.rbe_left
#define RB_RIGHT(elm, field)   (elm)->field.rbe_right
#define RB_PARENT(elm, field)   (elm)->field.rbe_parent
#define RB_COLOR(elm, field)   (elm)->field.rbe_color
#define RB_ROOT(head)   (head)->rbh_root
#define RB_EMPTY(head)   (RB_ROOT(head) == NULL)
#define RB_SET(elm, parent, field)
#define RB_SET_BLACKRED(black, red, field)
#define RB_AUGMENT(x)   do {} while (0)
#define RB_ROTATE_LEFT(head, elm, tmp, field)
#define RB_ROTATE_RIGHT(head, elm, tmp, field)
#define RB_PROTOTYPE(name, type, field, cmp)   RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
#define RB_PROTOTYPE_STATIC(name, type, field, cmp)   RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static)
#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr)
#define RB_GENERATE(name, type, field, cmp)   RB_GENERATE_INTERNAL(name, type, field, cmp,)
#define RB_GENERATE_STATIC(name, type, field, cmp)   RB_GENERATE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static)
#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr)
#define RB_NEGINF   -1
#define RB_INF   1
#define RB_INSERT(name, x, y)   name##_RB_INSERT(x, y)
#define RB_REMOVE(name, x, y)   name##_RB_REMOVE(x, y)
#define RB_FIND(name, x, y)   name##_RB_FIND(x, y)
#define RB_NFIND(name, x, y)   name##_RB_NFIND(x, y)
#define RB_NEXT(name, x, y)   name##_RB_NEXT(y)
#define RB_PREV(name, x, y)   name##_RB_PREV(y)
#define RB_MIN(name, x)   name##_RB_MINMAX(x, RB_NEGINF)
#define RB_MAX(name, x)   name##_RB_MINMAX(x, RB_INF)
#define RB_FOREACH(x, name, head)
#define RB_FOREACH_REVERSE(x, name, head)

Macro Definition Documentation

#define RB_AUGMENT (   x)    do {} while (0)

Definition at line 334 of file bsd_tree.h.

#define RB_BLACK   0

Definition at line 305 of file bsd_tree.h.

#define RB_COLOR (   elm,
  field 
)    (elm)->field.rbe_color

Definition at line 318 of file bsd_tree.h.

#define RB_EMPTY (   head)    (RB_ROOT(head) == NULL)

Definition at line 320 of file bsd_tree.h.

#define RB_ENTRY (   type)
Value:
struct { \
struct type *rbe_left; /* left element */ \
struct type *rbe_right; /* right element */ \
struct type *rbe_parent; /* parent element */ \
int rbe_color; /* node color */ \
}

Definition at line 307 of file bsd_tree.h.

#define RB_FIND (   name,
  x,
 
)    name##_RB_FIND(x, y)

Definition at line 729 of file bsd_tree.h.

#define RB_FOREACH (   x,
  name,
  head 
)
Value:
for ((x) = RB_MIN(name, head); \
(x) != NULL; \
(x) = name##_RB_NEXT(x))

Definition at line 736 of file bsd_tree.h.

#define RB_FOREACH_REVERSE (   x,
  name,
  head 
)
Value:
for ((x) = RB_MAX(name, head); \
(x) != NULL; \
(x) = name##_RB_PREV(x))

Definition at line 741 of file bsd_tree.h.

#define RB_GENERATE (   name,
  type,
  field,
  cmp 
)    RB_GENERATE_INTERNAL(name, type, field, cmp,)

Definition at line 397 of file bsd_tree.h.

#define RB_GENERATE_INTERNAL (   name,
  type,
  field,
  cmp,
  attr 
)

Definition at line 401 of file bsd_tree.h.

#define RB_GENERATE_STATIC (   name,
  type,
  field,
  cmp 
)    RB_GENERATE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static)

Definition at line 399 of file bsd_tree.h.

#define RB_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *rbh_root; /* root of the tree */ \
}

Definition at line 293 of file bsd_tree.h.

#define RB_INF   1

Definition at line 725 of file bsd_tree.h.

#define RB_INIT (   root)
Value:
do { \
(root)->rbh_root = NULL; \
} while (0)

Definition at line 301 of file bsd_tree.h.

#define RB_INITIALIZER (   root)    { NULL }

Definition at line 298 of file bsd_tree.h.

#define RB_INSERT (   name,
  x,
 
)    name##_RB_INSERT(x, y)

Definition at line 727 of file bsd_tree.h.

#define RB_LEFT (   elm,
  field 
)    (elm)->field.rbe_left

Definition at line 315 of file bsd_tree.h.

#define RB_MAX (   name,
 
)    name##_RB_MINMAX(x, RB_INF)

Definition at line 734 of file bsd_tree.h.

#define RB_MIN (   name,
 
)    name##_RB_MINMAX(x, RB_NEGINF)

Definition at line 733 of file bsd_tree.h.

#define RB_NEGINF   -1

Definition at line 724 of file bsd_tree.h.

#define RB_NEXT (   name,
  x,
 
)    name##_RB_NEXT(y)

Definition at line 731 of file bsd_tree.h.

#define RB_NFIND (   name,
  x,
 
)    name##_RB_NFIND(x, y)

Definition at line 730 of file bsd_tree.h.

#define RB_PARENT (   elm,
  field 
)    (elm)->field.rbe_parent

Definition at line 317 of file bsd_tree.h.

#define RB_PREV (   name,
  x,
 
)    name##_RB_PREV(y)

Definition at line 732 of file bsd_tree.h.

#define RB_PROTOTYPE (   name,
  type,
  field,
  cmp 
)    RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)

Definition at line 378 of file bsd_tree.h.

#define RB_PROTOTYPE_INTERNAL (   name,
  type,
  field,
  cmp,
  attr 
)
Value:
attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
attr struct type *name##_RB_REMOVE(struct name *, struct type *); \
attr struct type *name##_RB_INSERT(struct name *, struct type *); \
attr struct type *name##_RB_FIND(struct name *, struct type *); \
attr struct type *name##_RB_NFIND(struct name *, struct type *); \
attr struct type *name##_RB_NEXT(struct type *); \
attr struct type *name##_RB_PREV(struct type *); \
attr struct type *name##_RB_MINMAX(struct name *, int); \
\

Definition at line 382 of file bsd_tree.h.

#define RB_PROTOTYPE_STATIC (   name,
  type,
  field,
  cmp 
)    RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static)

Definition at line 380 of file bsd_tree.h.

#define RB_RED   1

Definition at line 306 of file bsd_tree.h.

#define RB_REMOVE (   name,
  x,
 
)    name##_RB_REMOVE(x, y)

Definition at line 728 of file bsd_tree.h.

#define RB_RIGHT (   elm,
  field 
)    (elm)->field.rbe_right

Definition at line 316 of file bsd_tree.h.

#define RB_ROOT (   head)    (head)->rbh_root

Definition at line 319 of file bsd_tree.h.

#define RB_ROTATE_LEFT (   head,
  elm,
  tmp,
  field 
)
Value:
do { \
(tmp) = RB_RIGHT(elm, field); \
if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) { \
RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
} \
RB_AUGMENT(elm); \
if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
} else \
(head)->rbh_root = (tmp); \
RB_LEFT(tmp, field) = (elm); \
RB_PARENT(elm, field) = (tmp); \
RB_AUGMENT(tmp); \
if ((RB_PARENT(tmp, field))) \
RB_AUGMENT(RB_PARENT(tmp, field)); \
} while (0)

Definition at line 337 of file bsd_tree.h.

#define RB_ROTATE_RIGHT (   head,
  elm,
  tmp,
  field 
)
Value:
do { \
(tmp) = RB_LEFT(elm, field); \
if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) { \
RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
} \
RB_AUGMENT(elm); \
if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
} else \
(head)->rbh_root = (tmp); \
RB_RIGHT(tmp, field) = (elm); \
RB_PARENT(elm, field) = (tmp); \
RB_AUGMENT(tmp); \
if ((RB_PARENT(tmp, field))) \
RB_AUGMENT(RB_PARENT(tmp, field)); \
} while (0)

Definition at line 357 of file bsd_tree.h.

#define RB_SET (   elm,
  parent,
  field 
)
Value:
do { \
RB_PARENT(elm, field) = parent; \
RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
RB_COLOR(elm, field) = RB_RED; \
} while (0)

Definition at line 322 of file bsd_tree.h.

#define RB_SET_BLACKRED (   black,
  red,
  field 
)
Value:
do { \
RB_COLOR(black, field) = RB_BLACK; \
RB_COLOR(red, field) = RB_RED; \
} while (0)

Definition at line 328 of file bsd_tree.h.

#define SPLAY_ASSEMBLE (   head,
  node,
  left,
  right,
  field 
)
Value:
do { \
SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
} while (0)

Definition at line 109 of file bsd_tree.h.

#define SPLAY_EMPTY (   head)    (SPLAY_ROOT(head) == NULL)

Definition at line 82 of file bsd_tree.h.

#define SPLAY_ENTRY (   type)
Value:
struct { \
struct type *spe_left; /* left element */ \
struct type *spe_right; /* right element */ \
}

Definition at line 73 of file bsd_tree.h.

#define SPLAY_FIND (   name,
  x,
 
)    name##_SPLAY_FIND(x, y)

Definition at line 280 of file bsd_tree.h.

#define SPLAY_FOREACH (   x,
  name,
  head 
)
Value:
for ((x) = SPLAY_MIN(name, head); \
(x) != NULL; \
(x) = SPLAY_NEXT(name, head, x))

Definition at line 287 of file bsd_tree.h.

#define SPLAY_GENERATE (   name,
  type,
  field,
  cmp 
)

Definition at line 160 of file bsd_tree.h.

#define SPLAY_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *sph_root; /* root of the tree */ \
}

Definition at line 61 of file bsd_tree.h.

#define SPLAY_INF   1

Definition at line 276 of file bsd_tree.h.

#define SPLAY_INIT (   root)
Value:
do { \
(root)->sph_root = NULL; \
} while (0)

Definition at line 69 of file bsd_tree.h.

#define SPLAY_INITIALIZER (   root)    { NULL }

Definition at line 66 of file bsd_tree.h.

#define SPLAY_INSERT (   name,
  x,
 
)    name##_SPLAY_INSERT(x, y)

Definition at line 278 of file bsd_tree.h.

#define SPLAY_LEFT (   elm,
  field 
)    (elm)->field.spe_left

Definition at line 79 of file bsd_tree.h.

#define SPLAY_LINKLEFT (   head,
  tmp,
  field 
)
Value:
do { \
SPLAY_LEFT(tmp, field) = (head)->sph_root; \
tmp = (head)->sph_root; \
(head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \
} while (0)

Definition at line 97 of file bsd_tree.h.

#define SPLAY_LINKRIGHT (   head,
  tmp,
  field 
)
Value:
do { \
SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
tmp = (head)->sph_root; \
(head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \
} while (0)

Definition at line 103 of file bsd_tree.h.

#define SPLAY_MAX (   name,
 
)
Value:
(SPLAY_EMPTY(x) ? NULL \
: name##_SPLAY_MIN_MAX(x, SPLAY_INF))

Definition at line 284 of file bsd_tree.h.

#define SPLAY_MIN (   name,
 
)
Value:
(SPLAY_EMPTY(x) ? NULL \
: name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))

Definition at line 282 of file bsd_tree.h.

#define SPLAY_NEGINF   -1

Definition at line 275 of file bsd_tree.h.

#define SPLAY_NEXT (   name,
  x,
 
)    name##_SPLAY_NEXT(x, y)

Definition at line 281 of file bsd_tree.h.

#define SPLAY_PROTOTYPE (   name,
  type,
  field,
  cmp 
)

Definition at line 118 of file bsd_tree.h.

#define SPLAY_REMOVE (   name,
  x,
 
)    name##_SPLAY_REMOVE(x, y)

Definition at line 279 of file bsd_tree.h.

#define SPLAY_RIGHT (   elm,
  field 
)    (elm)->field.spe_right

Definition at line 80 of file bsd_tree.h.

#define SPLAY_ROOT (   head)    (head)->sph_root

Definition at line 81 of file bsd_tree.h.

#define SPLAY_ROTATE_LEFT (   head,
  tmp,
  field 
)
Value:
do { \
SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
SPLAY_LEFT(tmp, field) = (head)->sph_root; \
(head)->sph_root = tmp; \
} while (0)

Definition at line 91 of file bsd_tree.h.

#define SPLAY_ROTATE_RIGHT (   head,
  tmp,
  field 
)
Value:
do { \
SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
(head)->sph_root = tmp; \
} while (0)

Definition at line 85 of file bsd_tree.h.