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