gtree.h

Go to the documentation of this file.
00001 /* GLIB - Library of useful routines for C programming
00002  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 /*
00021  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
00022  * file for a list of people on the GLib Team.  See the ChangeLog
00023  * files for a list of changes.  These files are distributed with
00024  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
00025  */
00026 
00027 #ifndef __G_TREE_H__
00028 #define __G_TREE_H__
00029 
00030 #include <gnode.h>
00031 
00032 G_BEGIN_DECLS
00033 
00034 typedef struct _GTree           GTree;
00035 
00036 typedef gint            (*GTraverseFunc)        (gpointer       key,
00037                                                  gpointer       value,
00038                                                  gpointer       data);
00039 
00040 /* Balanced binary trees
00041  */
00042 GTree*   g_tree_new           (GCompareFunc      key_compare_func);
00043 GTree*   g_tree_new_with_data (GCompareFuncData  key_compare_func,
00044                                gpointer          user_data);
00045 void     g_tree_destroy       (GTree            *tree);
00046 void     g_tree_insert        (GTree            *tree,
00047                                gpointer          key,
00048                                gpointer          value);
00049 void     g_tree_remove        (GTree            *tree,
00050                                gconstpointer     key);
00051 gpointer g_tree_lookup        (GTree            *tree,
00052                                gconstpointer     key);
00053 void     g_tree_traverse      (GTree            *tree,
00054                                GTraverseFunc     traverse_func,
00055                                GTraverseType     traverse_type,
00056                                gpointer          data);
00057 gpointer g_tree_search        (GTree            *tree,
00058                                GCompareFunc      search_func,
00059                                gconstpointer     data);
00060 gint     g_tree_height        (GTree            *tree);
00061 gint     g_tree_nnodes        (GTree            *tree);
00062 
00063 
00064 
00065 G_END_DECLS
00066 
00067 #endif /* __G_TREE_H__ */
00068 

Generated on Tue Jul 5 14:14:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1