#include <stdio.h>#include <stdlib.h>#include <assert.h>#include "tree234.h"#include "../../mem/shm_mem.h"

Go to the source code of this file.
Data Structures | |
| struct | node234_Tag |
| struct | tree234_Tag |
Defines | |
| #define | LOG123(x) |
| #define | mknew(typ) ( (typ *) smalloc (sizeof (typ)) ) |
| #define | sfree shm_free |
| #define | smalloc shm_malloc |
Typedefs | |
| typedef struct node234_Tag | node234 |
Functions | |
| void * | add234 (tree234 *t, void *e) |
| static void * | add234_internal (tree234 *t, void *e, int index) |
| void * | addpos234 (tree234 *t, void *e, int index) |
| int | count234 (tree234 *t) |
| static int | countnode234 (node234 *n) |
| void * | del234 (tree234 *t, void *e) |
| void * | delpos234 (tree234 *t, int index) |
| static void * | delpos234_internal (tree234 *t, int index) |
| void * | find234 (tree234 *t, void *e, cmpfn234 cmp) |
| void * | findpos234 (tree234 *t, void *e, cmpfn234 cmp, int *index) |
| void * | findrel234 (tree234 *t, void *e, cmpfn234 cmp, int relation) |
| void * | findrelpos234 (tree234 *t, void *e, cmpfn234 cmp, int relation, int *index) |
| static void | free2node234 (node234 *n, freefn fn) |
| void | free2tree234 (tree234 *t, freefn fn) |
| static void | freenode234 (node234 *n) |
| void | freetree234 (tree234 *t) |
| void * | index234 (tree234 *t, int index) |
| tree234 * | newtree234 (cmpfn234 cmp) |
| #define LOG123 | ( | x | ) |
Definition at line 49 of file tree234.c.
Referenced by add234_internal(), delpos234_internal(), and newtree234().
| #define mknew | ( | typ | ) | ( (typ *) smalloc (sizeof (typ)) ) |
| #define sfree shm_free |
Definition at line 42 of file tree234.c.
Referenced by delpos234_internal(), free2node234(), free2tree234(), freenode234(), and freetree234().
| typedef struct node234_Tag node234 |
| void* add234 | ( | tree234 * | t, | |
| void * | e | |||
| ) |
Definition at line 426 of file tree234.c.
References add234_internal(), tree234_Tag::cmp, and NULL.
Referenced by xj_jcon_get_jconf(), and xj_wlist_get().
| static void* add234_internal | ( | tree234 * | t, | |
| void * | e, | |||
| int | index | |||
| ) | [static] |
Definition at line 152 of file tree234.c.
References tree234_Tag::cmp, countnode234(), node234_Tag::counts, node234_Tag::elems, node234_Tag::kids, LOG123, mknew, NULL, node234_Tag::parent, and tree234_Tag::root.
Referenced by add234(), and addpos234().
| void* addpos234 | ( | tree234 * | t, | |
| void * | e, | |||
| int | index | |||
| ) |
| int count234 | ( | tree234 * | t | ) |
| static int countnode234 | ( | node234 * | n | ) | [static] |
Definition at line 125 of file tree234.c.
References node234_Tag::counts, and node234_Tag::elems.
Referenced by add234_internal(), count234(), delpos234(), delpos234_internal(), and index234().
| void* del234 | ( | tree234 * | t, | |
| void * | e | |||
| ) |
Definition at line 933 of file tree234.c.
References delpos234_internal(), findrelpos234(), NULL, and REL234_EQ.
Referenced by xj_jcon_del_jconf(), and xj_wlist_del().
| void* delpos234 | ( | tree234 * | t, | |
| int | index | |||
| ) |
Definition at line 928 of file tree234.c.
References countnode234(), delpos234_internal(), NULL, and tree234_Tag::root.
Referenced by xj_jcon_free(), xj_wlist_clean_jobs(), and xj_worker_check_jcons().
| static void* delpos234_internal | ( | tree234 * | t, | |
| int | index | |||
| ) | [static] |
Definition at line 601 of file tree234.c.
References countnode234(), node234_Tag::counts, node234_Tag::elems, node234_Tag::kids, LOG123, NULL, node234_Tag::parent, tree234_Tag::root, and sfree.
Referenced by del234(), and delpos234().
Definition at line 587 of file tree234.c.
References findrelpos234(), NULL, and REL234_EQ.
Referenced by xj_jcon_check_jconf(), xj_jcon_get_jconf(), xj_wlist_check(), xj_wlist_get(), and xj_wlist_set_flag().
Definition at line 483 of file tree234.c.
References tree234_Tag::cmp, node234_Tag::counts, node234_Tag::elems, index234(), node234_Tag::kids, NULL, REL234_EQ, REL234_GT, REL234_LE, REL234_LT, and tree234_Tag::root.
Referenced by del234(), find234(), findpos234(), and findrel234().
Definition at line 100 of file tree234.c.
References node234_Tag::elems, node234_Tag::kids, and sfree.
Referenced by free2tree234().
Definition at line 113 of file tree234.c.
References free2node234(), NULL, tree234_Tag::root, and sfree.
Referenced by xj_wlist_free(), and xj_wlist_init().
| static void freenode234 | ( | node234 * | n | ) | [static] |
Definition at line 80 of file tree234.c.
References node234_Tag::kids, and sfree.
Referenced by freetree234().
| void freetree234 | ( | tree234 * | t | ) |
Definition at line 89 of file tree234.c.
References freenode234(), NULL, tree234_Tag::root, and sfree.
| void* index234 | ( | tree234 * | t, | |
| int | index | |||
| ) |
Definition at line 444 of file tree234.c.
References countnode234(), node234_Tag::counts, node234_Tag::elems, node234_Tag::kids, NULL, and tree234_Tag::root.
Referenced by findrelpos234().
Definition at line 69 of file tree234.c.
References tree234_Tag::cmp, LOG123, mknew, NULL, and tree234_Tag::root.
Referenced by xj_jcon_get_jconf(), and xj_wlist_init().
1.5.6