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