Initial revision
[ssr] / StraySrc / SDLS / cdll / h / hashtable
1 /*
2 * hashtable.h
3 *
4 * Hash table handling for strings
5 *
6 * © 1994-1998 Straylight
7 */
8
9 /*----- Licensing note ----------------------------------------------------*
10 *
11 * This file is part of Straylight's Dynamic Linking System (SDLS)
12 *
13 * SDLS is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * SDLS is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with SDLS. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 */
27
28 #ifndef __hashtable_h
29 #define __hashtable_h
30
31 typedef struct hash__table *hashtable;
32
33 hashtable hash_create(void);
34 int hash_find(hashtable h,char *string);
35 int hash_add(hashtable h,char *string);
36 int hash_addWithOrd(hashtable h,char *string,unsigned int ord);
37 void hash_delete(hashtable h);
38 int hash_subset(hashtable super,
39 hashtable sub,
40 void (*proc)(char *p));
41 void hash_dump(hashtable h);
42 void hash_enumerate(hashtable h,
43 void (*func)(char *string,void *handle),
44 void *handle);
45 void hash_enumOrdered(hashtable h,
46 void (*func)(char *string,
47 unsigned int ord,
48 void *handle),
49 void *handle);
50 int hash_count(hashtable h);
51
52 #endif