tree234.c File Reference

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

Include dependency graph for tree234.c:

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)
tree234newtree234 (cmpfn234 cmp)


Define Documentation

#define LOG123 (  ) 

Definition at line 49 of file tree234.c.

Referenced by add234_internal(), delpos234_internal(), and newtree234().

#define mknew ( typ   )     ( (typ *) smalloc (sizeof (typ)) )

Definition at line 44 of file tree234.c.

Referenced by add234_internal(), and newtree234().

#define sfree   shm_free

Definition at line 42 of file tree234.c.

Referenced by delpos234_internal(), free2node234(), free2tree234(), freenode234(), and freetree234().

#define smalloc   shm_malloc

Definition at line 41 of file tree234.c.


Typedef Documentation

typedef struct node234_Tag node234

Definition at line 52 of file tree234.c.


Function Documentation

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]

void* addpos234 ( tree234 t,
void *  e,
int  index 
)

Definition at line 432 of file tree234.c.

References add234_internal(), tree234_Tag::cmp, and NULL.

int count234 ( tree234 t  ) 

Definition at line 141 of file tree234.c.

References countnode234(), and tree234_Tag::root.

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 
)

static void* delpos234_internal ( tree234 t,
int  index 
) [static]

void* find234 ( tree234 t,
void *  e,
cmpfn234  cmp 
)

void* findpos234 ( tree234 t,
void *  e,
cmpfn234  cmp,
int *  index 
)

Definition at line 593 of file tree234.c.

References findrelpos234(), and REL234_EQ.

void* findrel234 ( tree234 t,
void *  e,
cmpfn234  cmp,
int  relation 
)

Definition at line 590 of file tree234.c.

References findrelpos234(), and NULL.

void* findrelpos234 ( tree234 t,
void *  e,
cmpfn234  cmp,
int  relation,
int *  index 
)

static void free2node234 ( node234 n,
freefn  fn 
) [static]

Definition at line 100 of file tree234.c.

References node234_Tag::elems, node234_Tag::kids, and sfree.

Referenced by free2tree234().

void free2tree234 ( tree234 t,
freefn  fn 
)

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 
)

tree234* newtree234 ( cmpfn234  cmp  ) 

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().


Generated on Thu May 24 20:00:45 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6