]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/st.h
MdeModulePkg RegularExpressionDxe: Update Oniguruma to 6.9.0
[mirror_edk2.git] / MdeModulePkg / Universal / RegularExpressionDxe / Oniguruma / st.h
1 /* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
2
3 /* @(#) st.h 5.1 89/12/14 */
4
5 #ifndef ST_INCLUDED
6
7 #define ST_INCLUDED
8
9 #ifdef _WIN32
10 # include <windows.h>
11 typedef ULONG_PTR st_data_t;
12 #else
13 // typedef unsigned long st_data_t;
14 #endif
15 #define ST_DATA_T_DEFINED
16 typedef UINTN st_data_t;
17
18 typedef struct st_table st_table;
19
20 struct st_hash_type {
21 int (*compare)();
22 int (*hash)();
23 };
24
25 struct st_table {
26 struct st_hash_type *type;
27 int num_bins;
28 int num_entries;
29 struct st_table_entry **bins;
30 };
31
32 #define st_is_member(table,key) st_lookup(table,key,(st_data_t *)0)
33
34 enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
35
36 #ifndef _
37 # define _(args) args
38 #endif
39 #ifndef ANYARGS
40 # ifdef __cplusplus
41 # define ANYARGS ...
42 # else
43 # define ANYARGS
44 # endif
45 #endif
46
47 st_table *st_init_table _((struct st_hash_type *));
48 st_table *st_init_table_with_size _((struct st_hash_type *, int));
49 st_table *st_init_numtable _((void));
50 st_table *st_init_numtable_with_size _((int));
51 st_table *st_init_strtable _((void));
52 st_table *st_init_strtable_with_size _((int));
53 int st_delete _((st_table *, st_data_t *, st_data_t *));
54 int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t));
55 int st_insert _((st_table *, st_data_t, st_data_t));
56 int st_lookup _((st_table *, st_data_t, st_data_t *));
57 int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));
58 void st_add_direct _((st_table *, st_data_t, st_data_t));
59 void st_free_table _((st_table *));
60 void st_cleanup_safe _((st_table *, st_data_t));
61 st_table *st_copy _((st_table *));
62
63 #define ST_NUMCMP ((int (*)()) 0)
64 #define ST_NUMHASH ((int (*)()) -2)
65
66 #define st_numcmp ST_NUMCMP
67 #define st_numhash ST_NUMHASH
68
69 #endif /* ST_INCLUDED */