1 /* 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 module glib.gtree; 7 8 import glib.gtypes; 9 import glib.gnode; 10 11 struct GTree; 12 13 14 extern (C) { 15 16 17 alias GTraverseFunc = gboolean function (gpointer key, 18 gpointer value, 19 gpointer data); 20 21 GTree* g_tree_new (GCompareFunc key_compare_func); 22 23 GTree* g_tree_new_with_data (GCompareDataFunc key_compare_func, 24 gpointer key_compare_data); 25 26 GTree* g_tree_new_full (GCompareDataFunc key_compare_func, 27 gpointer key_compare_data, 28 GDestroyNotify key_destroy_func, 29 GDestroyNotify value_destroy_func); 30 31 GTree* g_tree_ref (GTree *tree); 32 33 void g_tree_unref (GTree *tree); 34 35 void g_tree_destroy (GTree *tree); 36 37 void g_tree_insert (GTree *tree, 38 gpointer key, 39 gpointer value); 40 41 void g_tree_replace (GTree *tree, 42 gpointer key, 43 gpointer value); 44 45 gboolean g_tree_remove (GTree *tree, 46 gconstpointer key); 47 48 gboolean g_tree_steal (GTree *tree, 49 gconstpointer key); 50 51 gpointer g_tree_lookup (GTree *tree, 52 gconstpointer key); 53 54 gboolean g_tree_lookup_extended (GTree *tree, 55 gconstpointer lookup_key, 56 gpointer *orig_key, 57 gpointer *value); 58 59 void g_tree_foreach (GTree *tree, 60 GTraverseFunc func, 61 gpointer user_data); 62 63 deprecated 64 void g_tree_traverse (GTree *tree, 65 GTraverseFunc traverse_func, 66 GTraverseType traverse_type, 67 gpointer user_data); 68 69 70 gpointer g_tree_search (GTree *tree, 71 GCompareFunc search_func, 72 gconstpointer user_data); 73 74 gint g_tree_height (GTree *tree); 75 76 gint g_tree_nnodes (GTree *tree); 77 78 } 79