1 /* 2 * Copyright (C) 2004 Benjamin Otte <otte@gnome.org> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 19 /* The interfaces in this file are subject to change at any time. */ 20 21 #ifndef vte_tree_h_included 22 #define vte_tree_h_included 23 24 25 #include <glib.h> 26 27 G_BEGIN_DECLS 28 29 /* This is an optimiziation for GTrees we use with unicode characters. Since 30 * most characters are in the range [0-128], we store that range in an array 31 * for faster access. 32 * We match the API for GTree here. 33 */ 34 #define VTE_TREE_ARRAY_SIZE (128) 35 36 typedef struct _VteTree VteTree; 37 struct _VteTree { 38 GTree *tree; 39 gpointer array[VTE_TREE_ARRAY_SIZE]; 40 }; 41 42 VteTree *_vte_tree_new(GCompareFunc key_compare_func); 43 void _vte_tree_destroy(VteTree *tree); 44 void _vte_tree_insert(VteTree *tree, gpointer key, gpointer value); 45 gpointer _vte_tree_lookup(VteTree *tree, gconstpointer key); 46 /* extend as needed */ 47 48 G_END_DECLS 49 50 #endif 51