diff options
Diffstat (limited to 'src/lib/libcrypto/lhash/lhash.h')
-rw-r--r-- | src/lib/libcrypto/lhash/lhash.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/libcrypto/lhash/lhash.h b/src/lib/libcrypto/lhash/lhash.h index dee8207333..d392d0cd80 100644 --- a/src/lib/libcrypto/lhash/lhash.h +++ b/src/lib/libcrypto/lhash/lhash.h | |||
@@ -63,6 +63,7 @@ | |||
63 | #ifndef HEADER_LHASH_H | 63 | #ifndef HEADER_LHASH_H |
64 | #define HEADER_LHASH_H | 64 | #define HEADER_LHASH_H |
65 | 65 | ||
66 | #include <openssl/e_os2.h> | ||
66 | #ifndef OPENSSL_NO_FP_API | 67 | #ifndef OPENSSL_NO_FP_API |
67 | #include <stdio.h> | 68 | #include <stdio.h> |
68 | #endif | 69 | #endif |
@@ -77,7 +78,7 @@ extern "C" { | |||
77 | 78 | ||
78 | typedef struct lhash_node_st | 79 | typedef struct lhash_node_st |
79 | { | 80 | { |
80 | const void *data; | 81 | void *data; |
81 | struct lhash_node_st *next; | 82 | struct lhash_node_st *next; |
82 | #ifndef OPENSSL_NO_HASH_COMP | 83 | #ifndef OPENSSL_NO_HASH_COMP |
83 | unsigned long hash; | 84 | unsigned long hash; |
@@ -86,8 +87,8 @@ typedef struct lhash_node_st | |||
86 | 87 | ||
87 | typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *); | 88 | typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *); |
88 | typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *); | 89 | typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *); |
89 | typedef void (*LHASH_DOALL_FN_TYPE)(const void *); | 90 | typedef void (*LHASH_DOALL_FN_TYPE)(void *); |
90 | typedef void (*LHASH_DOALL_ARG_FN_TYPE)(const void *, void *); | 91 | typedef void (*LHASH_DOALL_ARG_FN_TYPE)(void *, void *); |
91 | 92 | ||
92 | /* Macros for declaring and implementing type-safe wrappers for LHASH callbacks. | 93 | /* Macros for declaring and implementing type-safe wrappers for LHASH callbacks. |
93 | * This way, callbacks can be provided to LHASH structures without function | 94 | * This way, callbacks can be provided to LHASH structures without function |
@@ -117,18 +118,18 @@ typedef void (*LHASH_DOALL_ARG_FN_TYPE)(const void *, void *); | |||
117 | 118 | ||
118 | /* Third: "doall" functions */ | 119 | /* Third: "doall" functions */ |
119 | #define DECLARE_LHASH_DOALL_FN(f_name,o_type) \ | 120 | #define DECLARE_LHASH_DOALL_FN(f_name,o_type) \ |
120 | void f_name##_LHASH_DOALL(const void *); | 121 | void f_name##_LHASH_DOALL(void *); |
121 | #define IMPLEMENT_LHASH_DOALL_FN(f_name,o_type) \ | 122 | #define IMPLEMENT_LHASH_DOALL_FN(f_name,o_type) \ |
122 | void f_name##_LHASH_DOALL(const void *arg) { \ | 123 | void f_name##_LHASH_DOALL(void *arg) { \ |
123 | o_type a = (o_type)arg; \ | 124 | o_type a = (o_type)arg; \ |
124 | f_name(a); } | 125 | f_name(a); } |
125 | #define LHASH_DOALL_FN(f_name) f_name##_LHASH_DOALL | 126 | #define LHASH_DOALL_FN(f_name) f_name##_LHASH_DOALL |
126 | 127 | ||
127 | /* Fourth: "doall_arg" functions */ | 128 | /* Fourth: "doall_arg" functions */ |
128 | #define DECLARE_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ | 129 | #define DECLARE_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ |
129 | void f_name##_LHASH_DOALL_ARG(const void *, void *); | 130 | void f_name##_LHASH_DOALL_ARG(void *, void *); |
130 | #define IMPLEMENT_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ | 131 | #define IMPLEMENT_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ |
131 | void f_name##_LHASH_DOALL_ARG(const void *arg1, void *arg2) { \ | 132 | void f_name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ |
132 | o_type a = (o_type)arg1; \ | 133 | o_type a = (o_type)arg1; \ |
133 | a_type b = (a_type)arg2; \ | 134 | a_type b = (a_type)arg2; \ |
134 | f_name(a,b); } | 135 | f_name(a,b); } |
@@ -172,7 +173,7 @@ typedef struct lhash_st | |||
172 | 173 | ||
173 | LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); | 174 | LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); |
174 | void lh_free(LHASH *lh); | 175 | void lh_free(LHASH *lh); |
175 | void *lh_insert(LHASH *lh, const void *data); | 176 | void *lh_insert(LHASH *lh, void *data); |
176 | void *lh_delete(LHASH *lh, const void *data); | 177 | void *lh_delete(LHASH *lh, const void *data); |
177 | void *lh_retrieve(LHASH *lh, const void *data); | 178 | void *lh_retrieve(LHASH *lh, const void *data); |
178 | void lh_doall(LHASH *lh, LHASH_DOALL_FN_TYPE func); | 179 | void lh_doall(LHASH *lh, LHASH_DOALL_FN_TYPE func); |