N-sim
Emulation and simulation of
Wireless Sensor Networks



   Home


   Project Page


   Download


   CVS



   Installation


   Configuration


   Plug-ins




 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/Vaike/linux/system-addons/networking/avl.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <syslog.h>
#include "avl.h"

Go to the source code of this file.

Defines

#define avl_malloc(size)   malloc(size)
#define avl_free(ptr)   free(ptr)
#define avl_error()   syslog(LOG_ERR, __VA_ARGS__)
#define avl_log()   syslog(LOG_INFO, __VA_ARGS__)
#define return_errno(num)   do { errno = num; return -1; } while (0)

Enumerations

enum  { LEFT = 0, RIGHT = 1 }

Functions

unsigned long avl_size (struct avltree *tree)
avlnodeavl_find (unsigned long key, struct avltree *tree)
void * avl_retrieve (unsigned long key, struct avltree *tree)
avlnodeavl_find_min (struct avltree *tree)
avlnodeavl_find_max (struct avltree *tree)
int avl_insert (void *elt, unsigned long key, struct avltree *tree)
int avl_delete (void *elt, unsigned long key, struct avltree *tree)
void destroy_avltree (struct avlnode *root)
void avl_print (struct avltree *tree)
void avl_print_list (struct avltree *tree)


Define Documentation

 
#define avl_error  )     syslog(LOG_ERR, __VA_ARGS__)
 

Definition at line 57 of file avl.c.

#define avl_free ptr   )     free(ptr)
 

Definition at line 56 of file avl.c.

Referenced by destroy_avltree().

 
#define avl_log  )     syslog(LOG_INFO, __VA_ARGS__)
 

Definition at line 58 of file avl.c.

Referenced by avl_print(), and avl_print_list().

#define avl_malloc size   )     malloc(size)
 

Definition at line 55 of file avl.c.

#define return_errno num   )     do { errno = num; return -1; } while (0)
 

Definition at line 59 of file avl.c.

Referenced by avl_delete(), and avl_insert().


Enumeration Type Documentation

anonymous enum
 

Enumerator:
LEFT 
RIGHT 

Definition at line 66 of file avl.c.


Function Documentation

int avl_delete void *  elt,
unsigned long  key,
struct avltree tree
 

Definition at line 343 of file avl.c.

References return_errno, and avltree::root.

struct avlnode* avl_find unsigned long  key,
struct avltree tree
 

Definition at line 151 of file avl.c.

References avlnode::key, avlnode::left, avlnode::right, and avltree::root.

struct avlnode* avl_find_max struct avltree tree  ) 
 

Definition at line 200 of file avl.c.

References avlnode::right, and avltree::root.

struct avlnode* avl_find_min struct avltree tree  ) 
 

Definition at line 182 of file avl.c.

References avlnode::left, and avltree::root.

int avl_insert void *  elt,
unsigned long  key,
struct avltree tree
 

Definition at line 281 of file avl.c.

References return_errno, and avltree::root.

void avl_print struct avltree tree  ) 
 

Definition at line 389 of file avl.c.

References avl_log, OQ_PRINTLN, and avltree::root.

void avl_print_list struct avltree tree  ) 
 

Definition at line 399 of file avl.c.

References avl_find_min(), avl_log, avlnode::key, avlnode::next, OQ_PRINT, and OQ_PRINTLN.

void* avl_retrieve unsigned long  key,
struct avltree tree
 

Definition at line 173 of file avl.c.

References avl_find(), and avlnode::element.

unsigned long avl_size struct avltree tree  ) 
 

Definition at line 139 of file avl.c.

References avl_find_min(), and avlnode::next.

void destroy_avltree struct avlnode root  ) 
 

Definition at line 356 of file avl.c.

References avl_free, destroy_avltree(), avlnode::left, and avlnode::right.


© 2007, Los Alamos National Security, LLC.