5 /* Copyright (C) 1995, 1996 Tom Lord
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Library General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this software; see the file COPYING. If not, write to
19 * the Free Software Foundation, 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
26 * Tom Lord (lord@cygnus.com, lord@gnu.ai.mit.edu)
32 /* giant inflatable hash trees */
36 struct rx_hash_item
* next_same_hash
;
37 struct rx_hash
* table
;
45 struct rx_hash
* parent
;
53 /* rx_hash_eq should work like the == operator. */
56 typedef int (*rx_hash_eq
)(void *, void *);
57 typedef struct rx_hash
* (*rx_alloc_hash
)(struct rx_hash_rules
*);
58 typedef void (*rx_free_hash
)(struct rx_hash
*,
59 struct rx_hash_rules
*);
60 typedef struct rx_hash_item
* (*rx_alloc_hash_item
)(struct rx_hash_rules
*,
62 typedef void (*rx_free_hash_item
)(struct rx_hash_item
*,
63 struct rx_hash_rules
*);
64 typedef void (*rx_hash_freefn
) (struct rx_hash_item
* it
);
66 typedef int (*rx_hash_eq
)();
67 typedef struct rx_hash
* (*rx_alloc_hash
)();
68 typedef void (*rx_free_hash
)();
69 typedef struct rx_hash_item
* (*rx_alloc_hash_item
)();
70 typedef void (*rx_free_hash_item
)();
71 typedef void (*rx_hash_freefn
) ();
77 rx_alloc_hash hash_alloc
;
78 rx_free_hash free_hash
;
79 rx_alloc_hash_item hash_item_alloc
;
80 rx_free_hash_item free_hash_item
;
85 extern struct rx_hash_item
* rx_hash_find (struct rx_hash
* table
,
88 struct rx_hash_rules
* rules
);
89 extern struct rx_hash_item
* rx_hash_store (struct rx_hash
* table
,
92 struct rx_hash_rules
* rules
);
93 extern void rx_hash_free (struct rx_hash_item
* it
, struct rx_hash_rules
* rules
);
94 extern void rx_free_hash_table (struct rx_hash
* tab
, rx_hash_freefn freefn
,
95 struct rx_hash_rules
* rules
);
96 extern int rx_count_hash_nodes (struct rx_hash
* st
);
99 extern struct rx_hash_item
* rx_hash_find ();
100 extern struct rx_hash_item
* rx_hash_store ();
101 extern void rx_hash_free ();
102 extern void rx_free_hash_table ();
103 extern int rx_count_hash_nodes ();