From 06ae9ac5d98a752d8ca17686a4a3b1786fbe520d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 18 Jul 2002 23:00:24 +0000 Subject: virtual registry framework with initial printing hooks. (This used to be commit a43d9788fa8823d678ee72470421b980165ec2b0) --- source3/include/adt_tree.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source3/include/adt_tree.h (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h new file mode 100644 index 0000000000..b1bf7ad85d --- /dev/null +++ b/source3/include/adt_tree.h @@ -0,0 +1,38 @@ +/* + * Unix SMB/CIFS implementation. + * Generic Abstract Data Types + * Copyright (C) Gerald Carter 2002. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef ADT_TREE_H +#define ADT_TREE_H + +typedef struct _tree_node { + struct _tree_node *parent; + struct _tree_node **children; + int num_children; + char *key; + void *data_p; +} TREE_NODE; + +typedef struct _tree_root { + TREE_NODE *root; + int (*compare)(void* x, void *y); + void (*free)(void *p); +} SORTED_TREE; + +#endif -- cgit From 79d5739893dca1272b60d6566ccb728c73c4240e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 Feb 2004 02:11:31 +0000 Subject: fixed compilation with --enable-dmalloc the macro redefinition of free() means we cannot have a structure element called "free" (This used to be commit d2d653a1a6db9d0407e99affb317a0045e56168a) --- source3/include/adt_tree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index b1bf7ad85d..12e2ea5cc5 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -32,7 +32,7 @@ typedef struct _tree_node { typedef struct _tree_root { TREE_NODE *root; int (*compare)(void* x, void *y); - void (*free)(void *p); + void (*free_func)(void *p); } SORTED_TREE; #endif -- cgit 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 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source3/include/adt_tree.h') 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 -- cgit From 99c909c2fa2b847e6f55f6f5706d5f46014f8b86 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 3 Sep 2005 16:38:51 +0000 Subject: r9998: starting content for maintainers file (This used to be commit 554c22faeefe6932a01aa7bd6e2861c5abd37510) --- source3/include/adt_tree.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index 2fbfb55e88..51b6fb1c88 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -1,7 +1,7 @@ /* * Unix SMB/CIFS implementation. * Generic Abstract Data Types - * Copyright (C) Gerald Carter 2002. + * Copyright (C) Gerald Carter 2002-2005. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,17 +39,18 @@ typedef struct _tree_node { typedef struct _tree_root { TREE_NODE *root; + + /* not used currently (is it needed?) */ int (*compare)(void* x, void *y); - 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 ); +/* create a new tree, talloc_free() to throw it away */ + +SORTED_TREE* pathtree_init( void *data_p, int (cmp_fn)(void*, void*) ); /* add a new path component */ -- cgit From beecb90440af7cb59e31ffc708fdb7ad53932b6b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 21 Sep 2006 08:48:18 +0000 Subject: r18784: hopefully fix the BOOL bug on AIX metze (This used to be commit 454d9590de6ff94a1edd7321e26af0f0978a356a) --- source3/include/adt_tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index 51b6fb1c88..a053013a9b 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -21,9 +21,9 @@ #ifndef ADT_TREE_H #define ADT_TREE_H -#ifndef _BOOL +#ifndef _UPPER_BOOL typedef int BOOL; -#define _BOOL +#define _UPPER_BOOL #endif -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/include/adt_tree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index a053013a9b..e3c840d1e1 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -5,7 +5,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/include/adt_tree.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index e3c840d1e1..b647412e5d 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see . */ #ifndef ADT_TREE_H -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/include/adt_tree.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index b647412e5d..3e2f10001e 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -20,12 +20,6 @@ #ifndef ADT_TREE_H #define ADT_TREE_H -#ifndef _UPPER_BOOL -typedef int BOOL; -#define _UPPER_BOOL -#endif - - /* data structure used to build the tree */ typedef struct _tree_node { @@ -53,7 +47,7 @@ SORTED_TREE* pathtree_init( void *data_p, int (cmp_fn)(void*, void*) ); /* add a new path component */ -BOOL pathtree_add( SORTED_TREE *tree, const char *path, void *data_p ); +bool pathtree_add( SORTED_TREE *tree, const char *path, void *data_p ); /* search path */ -- cgit From 01f4bd4f4d05e195911f4787f209b2ab6e2d8ab4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 13 Apr 2008 14:41:44 +0200 Subject: adt_tree: change pathtree_add to return WERR instead of bool. Michael (This used to be commit da45fb92f69221758f36db4cbb7d871e3ce60718) --- source3/include/adt_tree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/adt_tree.h') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index 3e2f10001e..3acda8edb8 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -47,7 +47,7 @@ SORTED_TREE* pathtree_init( void *data_p, int (cmp_fn)(void*, void*) ); /* add a new path component */ -bool pathtree_add( SORTED_TREE *tree, const char *path, void *data_p ); +WERROR pathtree_add( SORTED_TREE *tree, const char *path, void *data_p ); /* search path */ -- cgit