2 * LibAxl: Another XML library
3 * Copyright (C) 2006 Advanced Software Production Line, S.L.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 of
8 * the License, or (at your option) any later version.
10 * This program 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
13 * GNU 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 program; if not, write to the Free
17 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 * You may find a copy of the license under this software is released
21 * at COPYING file. This is LGPL software: you are welcome to
22 * develop proprietary applications using this library without any
23 * royalty or fee but returning back any change, improvement or
24 * addition in the form of source code, project image, documentation
27 * For commercial support on build XML enabled solutions contact us:
30 * Advanced Software Production Line, S.L.
31 * C/ Dr. Michavila NÂș 14
32 * Coslada 28820 Madrid
36 * info@aspl.es - http://fact.aspl.es
38 #ifndef __AXL_HASH_H__
39 #define __AXL_HASH_H__
45 axlHash
* axl_hash_new (axlHashFunc hash
,
48 axlHash
* axl_hash_new_full (axlHashFunc hash
,
52 unsigned int axl_hash_string (axlPointer key
);
54 int axl_hash_equal_string (axlPointer keya
,
57 unsigned int axl_hash_int (axlPointer key
);
59 int axl_hash_equal_int (axlPointer keya
,
62 void axl_hash_insert (axlHash
* hash
,
66 void axl_hash_insert_full (axlHash
* hash
,
68 axlDestroyFunc destroy_key
,
70 axlDestroyFunc destroy_data
);
72 void axl_hash_remove (axlHash
* hash
,
75 void axl_hash_delete (axlHash
* hash
,
78 bool axl_hash_exists (axlHash
* hash
,
81 axlPointer
axl_hash_get (axlHash
* hash
,
84 void axl_hash_foreach (axlHash
* hash
,
85 axlHashForeachFunc func
,
86 axlPointer user_data
);
88 void axl_hash_foreach2 (axlHash
* hash
,
89 axlHashForeachFunc2 func
,
91 axlPointer user_data2
);
93 void axl_hash_foreach3 (axlHash
* hash
,
94 axlHashForeachFunc3 func
,
96 axlPointer user_data2
,
97 axlPointer user_data3
);
99 void axl_hash_foreach4 (axlHash
* hash
,
100 axlHashForeachFunc4 func
,
101 axlPointer user_data
,
102 axlPointer user_data2
,
103 axlPointer user_data3
,
104 axlPointer user_data4
);
106 int axl_hash_items (axlHash
* hash
);
108 axlHash
* axl_hash_copy (axlHash
* hash
,
109 axlHashItemCopy key_copy
,
110 axlHashItemCopy value_copy
);
113 void axl_hash_show_status (axlHash
* hash
);
115 typedef void (*axlHashPrintKeyData
) (axlPointer key
, axlPointer data
);
117 void axl_hash_show_status_full (axlHash
* hash
,
118 axlHashPrintKeyData show_item
);
121 void axl_hash_free (axlHash
* hash
);
123 /* cursor interface */
124 axlHashCursor
* axl_hash_cursor_new (axlHash
* hash
);
126 void axl_hash_cursor_first (axlHashCursor
* cursor
);
128 void axl_hash_cursor_last (axlHashCursor
* cursor
);
130 void axl_hash_cursor_next (axlHashCursor
* cursor
);
132 bool axl_hash_cursor_has_next (axlHashCursor
* cursor
);
134 bool axl_hash_cursor_has_item (axlHashCursor
* cursor
);
136 void axl_hash_cursor_remove (axlHashCursor
* cursor
);
138 axlPointer
axl_hash_cursor_get_key (axlHashCursor
* cursor
);
140 axlPointer
axl_hash_cursor_get_value (axlHashCursor
* cursor
);
142 axlHash
* axl_hash_cursor_hash (axlHashCursor
* cursor
);
144 void axl_hash_cursor_free (axlHashCursor
* cursor
);