1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
/* Copyright (c) 2014, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#if !defined(IN_LHASH_H)
#error "Don't include this file directly. Include lhash.h"
#endif
/* ASN1_OBJECT */
#define lh_ASN1_OBJECT_new(hash, comp) \
((LHASH_OF(ASN1_OBJECT) *)lh_new( \
CHECKED_CAST(lhash_hash_func, uint32_t (*)(const ASN1_OBJECT *), hash), \
CHECKED_CAST(lhash_cmp_func, \
int (*)(const ASN1_OBJECT *a, const ASN1_OBJECT *b), \
comp)))
#define lh_ASN1_OBJECT_free(lh) \
lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh));
#define lh_ASN1_OBJECT_num_items(lh) \
lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh))
#define lh_ASN1_OBJECT_retrieve(lh, data) \
((ASN1_OBJECT *)lh_retrieve( \
CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \
CHECKED_CAST(void *, ASN1_OBJECT *, data)))
#define lh_ASN1_OBJECT_insert(lh, old_data, data) \
lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \
CHECKED_CAST(void **, ASN1_OBJECT **, old_data), \
CHECKED_CAST(void *, ASN1_OBJECT *, data))
#define lh_ASN1_OBJECT_delete(lh, data) \
((ASN1_OBJECT *)lh_delete( \
CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \
CHECKED_CAST(void *, ASN1_OBJECT *, data)))
#define lh_ASN1_OBJECT_doall(lh, func) \
lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \
CHECKED_CAST(void (*)(void *), void (*)(ASN1_OBJECT *), func));
#define lh_ASN1_OBJECT_doall_arg(lh, func, arg) \
lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \
CHECKED_CAST(void (*)(void *, void *), \
void (*)(ASN1_OBJECT *, void *), func), \
arg);
/* CONF_VALUE */
#define lh_CONF_VALUE_new(hash, comp) \
((LHASH_OF(CONF_VALUE) *)lh_new( \
CHECKED_CAST(lhash_hash_func, uint32_t (*)(const CONF_VALUE *), hash), \
CHECKED_CAST(lhash_cmp_func, \
int (*)(const CONF_VALUE *a, const CONF_VALUE *b), comp)))
#define lh_CONF_VALUE_free(lh) \
lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh));
#define lh_CONF_VALUE_num_items(lh) \
lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh))
#define lh_CONF_VALUE_retrieve(lh, data) \
((CONF_VALUE *)lh_retrieve( \
CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \
CHECKED_CAST(void *, CONF_VALUE *, data)))
#define lh_CONF_VALUE_insert(lh, old_data, data) \
lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \
CHECKED_CAST(void **, CONF_VALUE **, old_data), \
CHECKED_CAST(void *, CONF_VALUE *, data))
#define lh_CONF_VALUE_delete(lh, data) \
((CONF_VALUE *)lh_delete(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \
CHECKED_CAST(void *, CONF_VALUE *, data)))
#define lh_CONF_VALUE_doall(lh, func) \
lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \
CHECKED_CAST(void (*)(void *), void (*)(CONF_VALUE *), func));
#define lh_CONF_VALUE_doall_arg(lh, func, arg) \
lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \
CHECKED_CAST(void (*)(void *, void *), \
void (*)(CONF_VALUE *, void *), func), \
arg);
/* ERR_STATE */
#define lh_ERR_STATE_new(hash, comp) \
((LHASH_OF(ERR_STATE) *)lh_new( \
CHECKED_CAST(lhash_hash_func, uint32_t (*)(const ERR_STATE *), hash), \
CHECKED_CAST(lhash_cmp_func, \
int (*)(const ERR_STATE *a, const ERR_STATE *b), comp)))
#define lh_ERR_STATE_free(lh) \
lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(ERR_STATE) *, lh));
#define lh_ERR_STATE_num_items(lh) \
lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(ERR_STATE) *, lh))
#define lh_ERR_STATE_retrieve(lh, data) \
((ERR_STATE *)lh_retrieve(CHECKED_CAST(_LHASH *, LHASH_OF(ERR_STATE) *, lh), \
CHECKED_CAST(void *, ERR_STATE *, data)))
#define lh_ERR_STATE_insert(lh, old_data, data) \
lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(ERR_STATE) *, lh), \
CHECKED_CAST(void **, ERR_STATE **, old_data), \
CHECKED_CAST(void *, ERR_STATE *, data))
#define lh_ERR_STATE_delete(lh, data) \
((ERR_STATE *)lh_delete(CHECKED_CAST(_LHASH *, LHASH_OF(ERR_STATE) *, lh), \
CHECKED_CAST(void *, ERR_STATE *, data)))
#define lh_ERR_STATE_doall(lh, func) \
lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(ERR_STATE) *, lh), \
CHECKED_CAST(void (*)(void *), void (*)(ERR_STATE *), func));
#define lh_ERR_STATE_doall_arg(lh, func, arg) \
lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(ERR_STATE) *, lh), \
CHECKED_CAST(void (*)(void *, void *), \
void (*)(ERR_STATE *, void *), func), \
arg);
/* EX_CLASS_ITEM */
#define lh_EX_CLASS_ITEM_new(hash, comp) \
((LHASH_OF(EX_CLASS_ITEM) *)lh_new( \
CHECKED_CAST(lhash_hash_func, uint32_t (*)(const EX_CLASS_ITEM *), \
hash), \
CHECKED_CAST(lhash_cmp_func, \
int (*)(const EX_CLASS_ITEM *a, const EX_CLASS_ITEM *b), \
comp)))
#define lh_EX_CLASS_ITEM_free(lh) \
lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(EX_CLASS_ITEM) *, lh));
#define lh_EX_CLASS_ITEM_num_items(lh) \
lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(EX_CLASS_ITEM) *, lh))
#define lh_EX_CLASS_ITEM_retrieve(lh, data) \
((EX_CLASS_ITEM *)lh_retrieve( \
CHECKED_CAST(_LHASH *, LHASH_OF(EX_CLASS_ITEM) *, lh), \
CHECKED_CAST(void *, EX_CLASS_ITEM *, data)))
#define lh_EX_CLASS_ITEM_insert(lh, old_data, data) \
lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(EX_CLASS_ITEM) *, lh), \
CHECKED_CAST(void **, EX_CLASS_ITEM **, old_data), \
CHECKED_CAST(void *, EX_CLASS_ITEM *, data))
#define lh_EX_CLASS_ITEM_delete(lh, data) \
((EX_CLASS_ITEM *)lh_delete( \
CHECKED_CAST(_LHASH *, LHASH_OF(EX_CLASS_ITEM) *, lh), \
CHECKED_CAST(void *, EX_CLASS_ITEM *, data)))
#define lh_EX_CLASS_ITEM_doall(lh, func) \
lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(EX_CLASS_ITEM) *, lh), \
CHECKED_CAST(void (*)(void *), void (*)(EX_CLASS_ITEM *), func));
#define lh_EX_CLASS_ITEM_doall_arg(lh, func, arg) \
lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(EX_CLASS_ITEM) *, lh), \
CHECKED_CAST(void (*)(void *, void *), \
void (*)(EX_CLASS_ITEM *, void *), func), \
arg);
/* SSL_SESSION */
#define lh_SSL_SESSION_new(hash, comp) \
((LHASH_OF(SSL_SESSION) *)lh_new( \
CHECKED_CAST(lhash_hash_func, uint32_t (*)(const SSL_SESSION *), hash), \
CHECKED_CAST(lhash_cmp_func, \
int (*)(const SSL_SESSION *a, const SSL_SESSION *b), \
comp)))
#define lh_SSL_SESSION_free(lh) \
lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh));
#define lh_SSL_SESSION_num_items(lh) \
lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh))
#define lh_SSL_SESSION_retrieve(lh, data) \
((SSL_SESSION *)lh_retrieve( \
CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \
CHECKED_CAST(void *, SSL_SESSION *, data)))
#define lh_SSL_SESSION_insert(lh, old_data, data) \
lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \
CHECKED_CAST(void **, SSL_SESSION **, old_data), \
CHECKED_CAST(void *, SSL_SESSION *, data))
#define lh_SSL_SESSION_delete(lh, data) \
((SSL_SESSION *)lh_delete( \
CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \
CHECKED_CAST(void *, SSL_SESSION *, data)))
#define lh_SSL_SESSION_doall(lh, func) \
lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \
CHECKED_CAST(void (*)(void *), void (*)(SSL_SESSION *), func));
#define lh_SSL_SESSION_doall_arg(lh, func, arg) \
lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \
CHECKED_CAST(void (*)(void *, void *), \
void (*)(SSL_SESSION *, void *), func), \
arg);
|