aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/radix.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:45:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:45:28 +0100
commite0483657ff6cf1adc828ccce457814d61fe90a0d (patch)
tree5183e4163f40b81b3e7d5f51488d360883782154 /src/libutil/radix.h
parent7962087e808fb824aa3af6d41d02abc92916ba1e (diff)
downloadrspamd-e0483657ff6cf1adc828ccce457814d61fe90a0d.tar.gz
rspamd-e0483657ff6cf1adc828ccce457814d61fe90a0d.zip
Unify code style.
Diffstat (limited to 'src/libutil/radix.h')
-rw-r--r--src/libutil/radix.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/libutil/radix.h b/src/libutil/radix.h
index 88f345e3d..cfdefa25b 100644
--- a/src/libutil/radix.h
+++ b/src/libutil/radix.h
@@ -7,29 +7,30 @@
#define RADIX_NO_VALUE (uintptr_t)-1
-typedef struct radix_node_s radix_node_t;
+typedef struct radix_node_s radix_node_t;
struct radix_node_s {
- radix_node_t *right;
- radix_node_t *left;
- radix_node_t *parent;
- uintptr_t value;
+ radix_node_t *right;
+ radix_node_t *left;
+ radix_node_t *parent;
+ uintptr_t value;
guint32 key;
};
typedef struct {
- radix_node_t *root;
- size_t size;
+ radix_node_t *root;
+ size_t size;
rspamd_mempool_t *pool;
} radix_tree_t;
-typedef gboolean (*radix_tree_traverse_func)(guint32 key, guint32 mask, uintptr_t value, void *user_data);
+typedef gboolean (*radix_tree_traverse_func)(guint32 key, guint32 mask,
+ uintptr_t value, void *user_data);
/**
* Create new radix tree
*/
-radix_tree_t *radix_tree_create (void);
+radix_tree_t * radix_tree_create (void);
/**
* Insert value to radix tree
@@ -37,7 +38,10 @@ radix_tree_t *radix_tree_create (void);
* 0 if operation was successfull
* -1 if there was some error
*/
-gint radix32tree_insert (radix_tree_t *tree, guint32 key, guint32 mask, uintptr_t value);
+gint radix32tree_insert (radix_tree_t *tree,
+ guint32 key,
+ guint32 mask,
+ uintptr_t value);
/**
* Add value to radix tree or insert it if value does not exists
@@ -45,7 +49,10 @@ gint radix32tree_insert (radix_tree_t *tree, guint32 key, guint32 mask, uintptr_
* 0 if value was inserted
* -1 if there was some error
*/
-uintptr_t radix32tree_add (radix_tree_t *tree, guint32 key, guint32 mask, uintptr_t value);
+uintptr_t radix32tree_add (radix_tree_t *tree,
+ guint32 key,
+ guint32 mask,
+ uintptr_t value);
/**
* Replace value in radix tree or insert it if value does not exists
@@ -53,7 +60,10 @@ uintptr_t radix32tree_add (radix_tree_t *tree, guint32 key, guint32 mask, uintpt
* 0 if value was inserted
* -1 if there was some error
*/
-gint radix32tree_replace (radix_tree_t *tree, guint32 key, guint32 mask, uintptr_t value);
+gint radix32tree_replace (radix_tree_t *tree,
+ guint32 key,
+ guint32 mask,
+ uintptr_t value);
/**
* Delete value from radix tree
@@ -81,7 +91,9 @@ uintptr_t radix32_tree_find_addr (radix_tree_t *tree, rspamd_inet_addr_t *addr);
/**
* Traverse via the whole tree calling specified callback
*/
-void radix32tree_traverse (radix_tree_t *tree, radix_tree_traverse_func func, void *user_data);
+void radix32tree_traverse (radix_tree_t *tree,
+ radix_tree_traverse_func func,
+ void *user_data);
/**
* Frees radix tree