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.h33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/lib/libcrypto/lhash/lhash.h b/src/lib/libcrypto/lhash/lhash.h
index 70cbc6dfe7..6e5a1fe708 100644
--- a/src/lib/libcrypto/lhash/lhash.h
+++ b/src/lib/libcrypto/lhash/lhash.h
@@ -67,6 +67,10 @@
67extern "C" { 67extern "C" {
68#endif 68#endif
69 69
70#ifndef NO_FP_API
71#include <stdio.h>
72#endif
73
70typedef struct lhash_node_st 74typedef struct lhash_node_st
71 { 75 {
72 char *data; 76 char *data;
@@ -102,11 +106,16 @@ typedef struct lhash_st
102 unsigned long num_retrieve; 106 unsigned long num_retrieve;
103 unsigned long num_retrieve_miss; 107 unsigned long num_retrieve_miss;
104 unsigned long num_hash_comps; 108 unsigned long num_hash_comps;
109
110 int error;
105 } LHASH; 111 } LHASH;
106 112
107#define LH_LOAD_MULT 256 113#define LH_LOAD_MULT 256
108 114
109#ifndef NOPROTO 115/* Indicates a malloc() error in the last call, this is only bad
116 * in lh_insert(). */
117#define lh_error(lh) ((lh)->error)
118
110LHASH *lh_new(unsigned long (*h)(), int (*c)()); 119LHASH *lh_new(unsigned long (*h)(), int (*c)());
111void lh_free(LHASH *lh); 120void lh_free(LHASH *lh);
112char *lh_insert(LHASH *lh, char *data); 121char *lh_insert(LHASH *lh, char *data);
@@ -114,7 +123,7 @@ char *lh_delete(LHASH *lh, char *data);
114char *lh_retrieve(LHASH *lh, char *data); 123char *lh_retrieve(LHASH *lh, char *data);
115void lh_doall(LHASH *lh, void (*func)(/* char *b */)); 124void lh_doall(LHASH *lh, void (*func)(/* char *b */));
116void lh_doall_arg(LHASH *lh, void (*func)(/*char *a,char *b*/),char *arg); 125void lh_doall_arg(LHASH *lh, void (*func)(/*char *a,char *b*/),char *arg);
117unsigned long lh_strhash(char *c); 126unsigned long lh_strhash(const char *c);
118 127
119#ifndef NO_FP_API 128#ifndef NO_FP_API
120void lh_stats(LHASH *lh, FILE *out); 129void lh_stats(LHASH *lh, FILE *out);
@@ -127,26 +136,6 @@ void lh_stats_bio(LHASH *lh, BIO *out);
127void lh_node_stats_bio(LHASH *lh, BIO *out); 136void lh_node_stats_bio(LHASH *lh, BIO *out);
128void lh_node_usage_stats_bio(LHASH *lh, BIO *out); 137void lh_node_usage_stats_bio(LHASH *lh, BIO *out);
129#endif 138#endif
130#else
131LHASH *lh_new();
132void lh_free();
133char *lh_insert();
134char *lh_delete();
135char *lh_retrieve();
136void lh_doall();
137void lh_doall_arg();
138unsigned long lh_strhash();
139
140#ifndef NO_FP_API
141void lh_stats();
142void lh_node_stats();
143void lh_node_usage_stats();
144#endif
145void lh_stats_bio();
146void lh_node_stats_bio();
147void lh_node_usage_stats_bio();
148#endif
149
150#ifdef __cplusplus 139#ifdef __cplusplus
151} 140}
152#endif 141#endif