aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/radix.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:57:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:57:31 +0100
commit379055dbbb4af997b4d3ffb161d447872d7ca357 (patch)
tree3774553d470f93e12ddeb454aad9b3b607cf8918 /src/libutil/radix.h
parent602ae7a0b7e215ba2677131b8fdc70abc156b3ca (diff)
downloadrspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.tar.gz
rspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.zip
Unify style without sorting headers.
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