sarg
2.4.0
About: SARG ia a Squid Analysis Report Generator. Fossies Dox: sarg-2.4.0.tar.gz ("unofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file.
30 #define AVL_SINGLE_RIGHT_ROTATION 1
31 #define AVL_SINGLE_LEFT_ROTATION 2
32 #define AVL_DOUBLE_RIGHT_ROTATION 3
33 #define AVL_DOUBLE_LEFT_ROTATION 4
53 struct bt *new_item_bt = NULL;
57 new_item_bt->
left = NULL;
58 new_item_bt->
right = NULL;
66 int result = strncmp(root->
value, item, 64);
71 root->
left = new_item_bt;
78 root->
right = new_item_bt;
92 struct bt *disbalanced_node = NULL;
100 while (disbalanced_node);
120 while (root && (result = strncmp(root->
value, item, 64)))
132 int l_depth = d, r_depth = d;
137 return( ( l_depth > r_depth ) ? l_depth : r_depth );
148 while (
tmp && (result = strncmp(node->
value,
tmp->value,64)))
170 int l_depth = 0, r_depth = 0;
202 parent->
right = node;
224 parent->
right = node;
261 debuga(__FILE__,__LINE__,
_(
"Failed to balance the b-tree cache"));
297 struct bt *root = NULL;
298 char strict_chars[] =
" ~!@^&(){}|<>?:;\"\'\\[]`,\r\n\0", *strict_chars_ptr;
300 strict_chars_ptr = strict_chars;
301 while (*strict_chars_ptr)
303 char *strict_chr_ptr = strchr(key, *strict_chars_ptr);
305 *strict_chr_ptr =
'\0';
static struct bt * get_parent(struct bt *node)
#define AVL_SINGLE_LEFT_ROTATION
void debuga(const char *File, int Line, const char *msg,...)
static void set_balance_info(struct bt *node)
static int get_disbalance_type(struct bt *node)
static void balance_tree(struct bt *node)
static void rotate_right(struct bt *node)
static int get_length(struct bt *node, int d)
#define AVL_SINGLE_RIGHT_ROTATION
char * search_in_cache(const char *key)
Include headers and define global variables. */.
#define AVL_DOUBLE_RIGHT_ROTATION
static void delete_tree(struct bt *root)
static void rotate_left(struct bt *node)
int insert_to_cache(const char *key, const char *value)
static struct bt * search_item(struct bt *root, const char *item)
void safe_strcpy(char *dest, const char *src, int length)
static struct bt * insert_node(struct bt *root, const char *item, const char *value)
Declaration of the structures and functions.
static void balance_node(struct bt *node)
static struct bt * get_disbalanced_node(struct bt *node)
#define AVL_DOUBLE_LEFT_ROTATION