1 /* GLIB - Library of useful routines for C programming
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 * Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * Modified by the GLib Team and others 1997-2000. See the AUTHORS
23 * file for a list of people on the GLib Team. See the ChangeLog
24 * files for a list of changes. These files are distributed with
25 * GLib at ftp://ftp.gtk.org/pub/gtk/.
32 #include <glib/gnode.h>
36 typedef struct _GTree GTree;
38 typedef gboolean (*GTraverseFunc) (gpointer key,
42 /* Balanced binary trees
44 IMPORT_C GTree* g_tree_new (GCompareFunc key_compare_func);
45 IMPORT_C GTree* g_tree_new_with_data (GCompareDataFunc key_compare_func,
46 gpointer key_compare_data);
47 IMPORT_C GTree* g_tree_new_full (GCompareDataFunc key_compare_func,
48 gpointer key_compare_data,
49 GDestroyNotify key_destroy_func,
50 GDestroyNotify value_destroy_func);
51 IMPORT_C void g_tree_destroy (GTree *tree);
52 IMPORT_C void g_tree_insert (GTree *tree,
55 IMPORT_C void g_tree_replace (GTree *tree,
58 IMPORT_C gboolean g_tree_remove (GTree *tree,
60 IMPORT_C gboolean g_tree_steal (GTree *tree,
62 IMPORT_C gpointer g_tree_lookup (GTree *tree,
64 IMPORT_C gboolean g_tree_lookup_extended (GTree *tree,
65 gconstpointer lookup_key,
68 IMPORT_C void g_tree_foreach (GTree *tree,
72 #ifndef G_DISABLE_DEPRECATED
73 IMPORT_C void g_tree_traverse (GTree *tree,
74 GTraverseFunc traverse_func,
75 GTraverseType traverse_type,
77 #endif /* G_DISABLE_DEPRECATED */
79 IMPORT_C gpointer g_tree_search (GTree *tree,
80 GCompareFunc search_func,
81 gconstpointer user_data);
82 IMPORT_C gint g_tree_height (GTree *tree);
83 IMPORT_C gint g_tree_nnodes (GTree *tree);
89 #endif /* __G_TREE_H__ */