From 96a3fede405cd095e353398ff05f4b43a07c457d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Feb 2005 16:36:44 +0000 Subject: r5517: code cleanup; rename the sorted_tree to pathtree (used by registry code) I was going to use this for tracking dfs mounts in smbclient but found another way. Still the cleanup is valid so commiting it. should be minimally disruptive since it is not widely used. (This used to be commit 00738dca3b07083c91545910486a1f30f2b17281) --- source3/include/adt_tree.h | 29 +++++++++++++++++++++++++++++ source3/include/includes.h | 1 - 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index 12e2ea5cc5..2fbfb55e88 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -21,6 +21,14 @@ #ifndef ADT_TREE_H #define ADT_TREE_H +#ifndef _BOOL +typedef int BOOL; +#define _BOOL +#endif + + +/* data structure used to build the tree */ + typedef struct _tree_node { struct _tree_node *parent; struct _tree_node **children; @@ -35,4 +43,25 @@ typedef struct _tree_root { void (*free_func)(void *p); } SORTED_TREE; +/* + * API + */ + +/* initializer and desctrutor */ +SORTED_TREE* pathtree_init( void *data_p, int (cmp_fn)(void*, void*), void (free_fn)(void*) ); +void pathtree_destroy( SORTED_TREE *tree ); + +/* add a new path component */ + +BOOL pathtree_add( SORTED_TREE *tree, const char *path, void *data_p ); + +/* search path */ + +void* pathtree_find( SORTED_TREE *tree, char *key ); + +/* debug (print) functions */ + +void pathtree_print_keys( SORTED_TREE *tree, int debug ); + + #endif diff --git a/source3/include/includes.h b/source3/include/includes.h index 45c7133f1e..982eee1886 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -802,7 +802,6 @@ extern int errno; #include "messages.h" #include "charset.h" #include "dynconfig.h" -#include "adt_tree.h" #include "util_getent.h" -- cgit