summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/lhash
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/lhash
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/lhash')
-rw-r--r--src/lib/libcrypto/lhash/Makefile.ssl38
-rw-r--r--src/lib/libcrypto/lhash/lh_stats.c38
-rw-r--r--src/lib/libcrypto/lhash/lh_test.c2
-rw-r--r--src/lib/libcrypto/lhash/lhash.c97
-rw-r--r--src/lib/libcrypto/lhash/lhash.h33
-rw-r--r--src/lib/libcrypto/lhash/num.pl2
6 files changed, 88 insertions, 122 deletions
diff --git a/src/lib/libcrypto/lhash/Makefile.ssl b/src/lib/libcrypto/lhash/Makefile.ssl
index cb08547b4f..cc9ff46b04 100644
--- a/src/lib/libcrypto/lhash/Makefile.ssl
+++ b/src/lib/libcrypto/lhash/Makefile.ssl
@@ -7,9 +7,11 @@ TOP= ../..
7CC= cc 7CC= cc
8INCLUDES= 8INCLUDES=
9CFLAG=-g 9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
10INSTALLTOP=/usr/local/ssl 12INSTALLTOP=/usr/local/ssl
11MAKE= make -f Makefile.ssl 13MAKE= make -f Makefile.ssl
12MAKEDEPEND= makedepend -f Makefile.ssl 14MAKEDEPEND= $(TOP)/util/domd $(TOP)
13MAKEFILE= Makefile.ssl 15MAKEFILE= Makefile.ssl
14AR= ar r 16AR= ar r
15 17
@@ -37,24 +39,23 @@ all: lib
37 39
38lib: $(LIBOBJ) 40lib: $(LIBOBJ)
39 $(AR) $(LIB) $(LIBOBJ) 41 $(AR) $(LIB) $(LIBOBJ)
40 sh $(TOP)/util/ranlib.sh $(LIB) 42 $(RANLIB) $(LIB)
41 @touch lib 43 @touch lib
42 44
43files: 45files:
44 perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO 46 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
45 47
46links: 48links:
47 /bin/rm -f Makefile 49 @$(TOP)/util/point.sh Makefile.ssl Makefile
48 $(TOP)/util/point.sh Makefile.ssl Makefile ; 50 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
49 $(TOP)/util/mklink.sh ../../include $(EXHEADER) 51 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
50 $(TOP)/util/mklink.sh ../../test $(TEST) 52 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
51 $(TOP)/util/mklink.sh ../../apps $(APPS)
52 53
53install: 54install:
54 @for i in $(EXHEADER) ; \ 55 @for i in $(EXHEADER) ; \
55 do \ 56 do \
56 (cp $$i $(INSTALLTOP)/include/$$i; \ 57 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
57 chmod 644 $(INSTALLTOP)/include/$$i ); \ 58 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
58 done; 59 done;
59 60
60tags: 61tags:
@@ -66,15 +67,22 @@ lint:
66 lint -DLINT $(INCLUDES) $(SRC)>fluff 67 lint -DLINT $(INCLUDES) $(SRC)>fluff
67 68
68depend: 69depend:
69 $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) 70 $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
70 71
71dclean: 72dclean:
72 perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 73 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
73 mv -f Makefile.new $(MAKEFILE) 74 mv -f Makefile.new $(MAKEFILE)
74 75
75clean: 76clean:
76 /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 77 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
77
78errors:
79 78
80# DO NOT DELETE THIS LINE -- make depend depends on it. 79# DO NOT DELETE THIS LINE -- make depend depends on it.
80
81lh_stats.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
82lh_stats.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
83lh_stats.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
84lh_stats.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
85lh_stats.o: ../../include/openssl/opensslv.h ../../include/openssl/stack.h
86lh_stats.o: ../cryptlib.h
87lhash.o: ../../include/openssl/crypto.h ../../include/openssl/lhash.h
88lhash.o: ../../include/openssl/opensslv.h ../../include/openssl/stack.h
diff --git a/src/lib/libcrypto/lhash/lh_stats.c b/src/lib/libcrypto/lhash/lh_stats.c
index 23fe82f777..80b931c12b 100644
--- a/src/lib/libcrypto/lhash/lh_stats.c
+++ b/src/lib/libcrypto/lhash/lh_stats.c
@@ -63,13 +63,11 @@
63 * and things should work as expected */ 63 * and things should work as expected */
64#include "cryptlib.h" 64#include "cryptlib.h"
65 65
66#include "lhash.h" 66#include <openssl/lhash.h>
67 67
68#ifndef HEADER_BIO_H 68#ifndef HEADER_BIO_H
69 69
70void lh_stats(lh, out) 70void lh_stats(LHASH *lh, FILE *out)
71LHASH *lh;
72FILE *out;
73 { 71 {
74 fprintf(out,"num_items = %lu\n",lh->num_items); 72 fprintf(out,"num_items = %lu\n",lh->num_items);
75 fprintf(out,"num_nodes = %u\n",lh->num_nodes); 73 fprintf(out,"num_nodes = %u\n",lh->num_nodes);
@@ -95,9 +93,7 @@ FILE *out;
95#endif 93#endif
96 } 94 }
97 95
98void lh_node_stats(lh, out) 96void lh_node_stats(LHASH *lh, FILE *out)
99LHASH *lh;
100FILE *out;
101 { 97 {
102 LHASH_NODE *n; 98 LHASH_NODE *n;
103 unsigned int i,num; 99 unsigned int i,num;
@@ -110,9 +106,7 @@ FILE *out;
110 } 106 }
111 } 107 }
112 108
113void lh_node_usage_stats(lh, out) 109void lh_node_usage_stats(LHASH *lh, FILE *out)
114LHASH *lh;
115FILE *out;
116 { 110 {
117 LHASH_NODE *n; 111 LHASH_NODE *n;
118 unsigned long num; 112 unsigned long num;
@@ -142,9 +136,7 @@ FILE *out;
142#else 136#else
143 137
144#ifndef NO_FP_API 138#ifndef NO_FP_API
145void lh_stats(lh,fp) 139void lh_stats(LHASH *lh, FILE *fp)
146LHASH *lh;
147FILE *fp;
148 { 140 {
149 BIO *bp; 141 BIO *bp;
150 142
@@ -156,9 +148,7 @@ FILE *fp;
156end:; 148end:;
157 } 149 }
158 150
159void lh_node_stats(lh,fp) 151void lh_node_stats(LHASH *lh, FILE *fp)
160LHASH *lh;
161FILE *fp;
162 { 152 {
163 BIO *bp; 153 BIO *bp;
164 154
@@ -170,9 +160,7 @@ FILE *fp;
170end:; 160end:;
171 } 161 }
172 162
173void lh_node_usage_stats(lh,fp) 163void lh_node_usage_stats(LHASH *lh, FILE *fp)
174LHASH *lh;
175FILE *fp;
176 { 164 {
177 BIO *bp; 165 BIO *bp;
178 166
@@ -186,9 +174,7 @@ end:;
186 174
187#endif 175#endif
188 176
189void lh_stats_bio(lh, out) 177void lh_stats_bio(LHASH *lh, BIO *out)
190LHASH *lh;
191BIO *out;
192 { 178 {
193 char buf[128]; 179 char buf[128];
194 180
@@ -236,9 +222,7 @@ BIO *out;
236#endif 222#endif
237 } 223 }
238 224
239void lh_node_stats_bio(lh, out) 225void lh_node_stats_bio(LHASH *lh, BIO *out)
240LHASH *lh;
241BIO *out;
242 { 226 {
243 LHASH_NODE *n; 227 LHASH_NODE *n;
244 unsigned int i,num; 228 unsigned int i,num;
@@ -253,9 +237,7 @@ BIO *out;
253 } 237 }
254 } 238 }
255 239
256void lh_node_usage_stats_bio(lh, out) 240void lh_node_usage_stats_bio(LHASH *lh, BIO *out)
257LHASH *lh;
258BIO *out;
259 { 241 {
260 LHASH_NODE *n; 242 LHASH_NODE *n;
261 unsigned long num; 243 unsigned long num;
diff --git a/src/lib/libcrypto/lhash/lh_test.c b/src/lib/libcrypto/lhash/lh_test.c
index 294b42bc82..08138b52c3 100644
--- a/src/lib/libcrypto/lhash/lh_test.c
+++ b/src/lib/libcrypto/lhash/lh_test.c
@@ -59,7 +59,7 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62#include "lhash.h" 62#include <openssl/lhash.h>
63 63
64main() 64main()
65 { 65 {
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c
index 6dfb5c9ccc..801322beb6 100644
--- a/src/lib/libcrypto/lhash/lhash.c
+++ b/src/lib/libcrypto/lhash/lhash.c
@@ -56,11 +56,14 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59char *lh_version="lhash part of SSLeay 0.9.0b 29-Jun-1998";
60
61/* Code for dynamic hash table routines 59/* Code for dynamic hash table routines
62 * Author - Eric Young v 2.0 60 * Author - Eric Young v 2.0
63 * 61 *
62 * 2.2 eay - added #include "crypto.h" so the memory leak checking code is
63 * present. eay 18-Jun-98
64 *
65 * 2.1 eay - Added an 'error in last operation' flag. eay 6-May-98
66 *
64 * 2.0 eay - Fixed a bug that occured when using lh_delete 67 * 2.0 eay - Fixed a bug that occured when using lh_delete
65 * from inside lh_doall(). As entries were deleted, 68 * from inside lh_doall(). As entries were deleted,
66 * the 'table' was 'contract()ed', making some entries 69 * the 'table' was 'contract()ed', making some entries
@@ -94,14 +97,16 @@ char *lh_version="lhash part of SSLeay 0.9.0b 29-Jun-1998";
94#include <stdio.h> 97#include <stdio.h>
95#include <string.h> 98#include <string.h>
96#include <stdlib.h> 99#include <stdlib.h>
97#include "lhash.h" 100#include <openssl/crypto.h>
101#include <openssl/lhash.h>
102
103const char *lh_version="lhash" OPENSSL_VERSION_PTEXT;
98 104
99#undef MIN_NODES 105#undef MIN_NODES
100#define MIN_NODES 16 106#define MIN_NODES 16
101#define UP_LOAD (2*LH_LOAD_MULT) /* load times 256 (default 2) */ 107#define UP_LOAD (2*LH_LOAD_MULT) /* load times 256 (default 2) */
102#define DOWN_LOAD (LH_LOAD_MULT) /* load times 256 (default 1) */ 108#define DOWN_LOAD (LH_LOAD_MULT) /* load times 256 (default 1) */
103 109
104#ifndef NOPROTO
105 110
106#define P_CP char * 111#define P_CP char *
107#define P_CPP char *,char * 112#define P_CPP char *,char *
@@ -109,26 +114,14 @@ static void expand(LHASH *lh);
109static void contract(LHASH *lh); 114static void contract(LHASH *lh);
110static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash); 115static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash);
111 116
112#else 117LHASH *lh_new(unsigned long (*h)(), int (*c)())
113
114#define P_CP
115#define P_CPP
116static void expand();
117static void contract();
118static LHASH_NODE **getrn();
119
120#endif
121
122LHASH *lh_new(h, c)
123unsigned long (*h)();
124int (*c)();
125 { 118 {
126 LHASH *ret; 119 LHASH *ret;
127 int i; 120 int i;
128 121
129 if ((ret=(LHASH *)malloc(sizeof(LHASH))) == NULL) 122 if ((ret=(LHASH *)Malloc(sizeof(LHASH))) == NULL)
130 goto err0; 123 goto err0;
131 if ((ret->b=(LHASH_NODE **)malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL) 124 if ((ret->b=(LHASH_NODE **)Malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL)
132 goto err1; 125 goto err1;
133 for (i=0; i<MIN_NODES; i++) 126 for (i=0; i<MIN_NODES; i++)
134 ret->b[i]=NULL; 127 ret->b[i]=NULL;
@@ -156,41 +149,43 @@ int (*c)();
156 ret->num_retrieve_miss=0; 149 ret->num_retrieve_miss=0;
157 ret->num_hash_comps=0; 150 ret->num_hash_comps=0;
158 151
152 ret->error=0;
159 return(ret); 153 return(ret);
160err1: 154err1:
161 free((char *)ret); 155 Free((char *)ret);
162err0: 156err0:
163 return(NULL); 157 return(NULL);
164 } 158 }
165 159
166void lh_free(lh) 160void lh_free(LHASH *lh)
167LHASH *lh;
168 { 161 {
169 unsigned int i; 162 unsigned int i;
170 LHASH_NODE *n,*nn; 163 LHASH_NODE *n,*nn;
171 164
165 if(lh == NULL)
166 return;
167
172 for (i=0; i<lh->num_nodes; i++) 168 for (i=0; i<lh->num_nodes; i++)
173 { 169 {
174 n=lh->b[i]; 170 n=lh->b[i];
175 while (n != NULL) 171 while (n != NULL)
176 { 172 {
177 nn=n->next; 173 nn=n->next;
178 free(n); 174 Free(n);
179 n=nn; 175 n=nn;
180 } 176 }
181 } 177 }
182 free((char *)lh->b); 178 Free((char *)lh->b);
183 free((char *)lh); 179 Free((char *)lh);
184 } 180 }
185 181
186char *lh_insert(lh, data) 182char *lh_insert(LHASH *lh, char *data)
187LHASH *lh;
188char *data;
189 { 183 {
190 unsigned long hash; 184 unsigned long hash;
191 LHASH_NODE *nn,**rn; 185 LHASH_NODE *nn,**rn;
192 char *ret; 186 char *ret;
193 187
188 lh->error=0;
194 if (lh->up_load <= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)) 189 if (lh->up_load <= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))
195 expand(lh); 190 expand(lh);
196 191
@@ -198,8 +193,11 @@ char *data;
198 193
199 if (*rn == NULL) 194 if (*rn == NULL)
200 { 195 {
201 if ((nn=(LHASH_NODE *)malloc(sizeof(LHASH_NODE))) == NULL) 196 if ((nn=(LHASH_NODE *)Malloc(sizeof(LHASH_NODE))) == NULL)
197 {
198 lh->error++;
202 return(NULL); 199 return(NULL);
200 }
203 nn->data=data; 201 nn->data=data;
204 nn->next=NULL; 202 nn->next=NULL;
205#ifndef NO_HASH_COMP 203#ifndef NO_HASH_COMP
@@ -219,14 +217,13 @@ char *data;
219 return(ret); 217 return(ret);
220 } 218 }
221 219
222char *lh_delete(lh, data) 220char *lh_delete(LHASH *lh, char *data)
223LHASH *lh;
224char *data;
225 { 221 {
226 unsigned long hash; 222 unsigned long hash;
227 LHASH_NODE *nn,**rn; 223 LHASH_NODE *nn,**rn;
228 char *ret; 224 char *ret;
229 225
226 lh->error=0;
230 rn=getrn(lh,data,&hash); 227 rn=getrn(lh,data,&hash);
231 228
232 if (*rn == NULL) 229 if (*rn == NULL)
@@ -239,7 +236,7 @@ char *data;
239 nn= *rn; 236 nn= *rn;
240 *rn=nn->next; 237 *rn=nn->next;
241 ret=nn->data; 238 ret=nn->data;
242 free((char *)nn); 239 Free((char *)nn);
243 lh->num_delete++; 240 lh->num_delete++;
244 } 241 }
245 242
@@ -251,14 +248,13 @@ char *data;
251 return(ret); 248 return(ret);
252 } 249 }
253 250
254char *lh_retrieve(lh, data) 251char *lh_retrieve(LHASH *lh, char *data)
255LHASH *lh;
256char *data;
257 { 252 {
258 unsigned long hash; 253 unsigned long hash;
259 LHASH_NODE **rn; 254 LHASH_NODE **rn;
260 char *ret; 255 char *ret;
261 256
257 lh->error=0;
262 rn=getrn(lh,data,&hash); 258 rn=getrn(lh,data,&hash);
263 259
264 if (*rn == NULL) 260 if (*rn == NULL)
@@ -274,17 +270,12 @@ char *data;
274 return(ret); 270 return(ret);
275 } 271 }
276 272
277void lh_doall(lh, func) 273void lh_doall(LHASH *lh, void (*func)())
278LHASH *lh;
279void (*func)();
280 { 274 {
281 lh_doall_arg(lh,func,NULL); 275 lh_doall_arg(lh,func,NULL);
282 } 276 }
283 277
284void lh_doall_arg(lh, func, arg) 278void lh_doall_arg(LHASH *lh, void (*func)(), char *arg)
285LHASH *lh;
286void (*func)();
287char *arg;
288 { 279 {
289 int i; 280 int i;
290 LHASH_NODE *a,*n; 281 LHASH_NODE *a,*n;
@@ -305,8 +296,7 @@ char *arg;
305 } 296 }
306 } 297 }
307 298
308static void expand(lh) 299static void expand(LHASH *lh)
309LHASH *lh;
310 { 300 {
311 LHASH_NODE **n,**n1,**n2,*np; 301 LHASH_NODE **n,**n1,**n2,*np;
312 unsigned int p,i,j; 302 unsigned int p,i,j;
@@ -342,11 +332,12 @@ LHASH *lh;
342 if ((lh->p) >= lh->pmax) 332 if ((lh->p) >= lh->pmax)
343 { 333 {
344 j=(int)lh->num_alloc_nodes*2; 334 j=(int)lh->num_alloc_nodes*2;
345 n=(LHASH_NODE **)realloc((char *)lh->b, 335 n=(LHASH_NODE **)Realloc((char *)lh->b,
346 (unsigned int)sizeof(LHASH_NODE *)*j); 336 (unsigned int)sizeof(LHASH_NODE *)*j);
347 if (n == NULL) 337 if (n == NULL)
348 { 338 {
349/* fputs("realloc error in lhash",stderr); */ 339/* fputs("realloc error in lhash",stderr); */
340 lh->error++;
350 lh->p=0; 341 lh->p=0;
351 return; 342 return;
352 } 343 }
@@ -361,8 +352,7 @@ LHASH *lh;
361 } 352 }
362 } 353 }
363 354
364static void contract(lh) 355static void contract(LHASH *lh)
365LHASH *lh;
366 { 356 {
367 LHASH_NODE **n,*n1,*np; 357 LHASH_NODE **n,*n1,*np;
368 358
@@ -370,11 +360,12 @@ LHASH *lh;
370 lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */ 360 lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */
371 if (lh->p == 0) 361 if (lh->p == 0)
372 { 362 {
373 n=(LHASH_NODE **)realloc((char *)lh->b, 363 n=(LHASH_NODE **)Realloc((char *)lh->b,
374 (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax)); 364 (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));
375 if (n == NULL) 365 if (n == NULL)
376 { 366 {
377/* fputs("realloc error in lhash",stderr); */ 367/* fputs("realloc error in lhash",stderr); */
368 lh->error++;
378 return; 369 return;
379 } 370 }
380 lh->num_contract_reallocs++; 371 lh->num_contract_reallocs++;
@@ -400,10 +391,7 @@ LHASH *lh;
400 } 391 }
401 } 392 }
402 393
403static LHASH_NODE **getrn(lh, data, rhash) 394static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash)
404LHASH *lh;
405char *data;
406unsigned long *rhash;
407 { 395 {
408 LHASH_NODE **ret,*n1; 396 LHASH_NODE **ret,*n1;
409 unsigned long hash,nn; 397 unsigned long hash,nn;
@@ -457,8 +445,7 @@ char *str;
457 * no collisions on /usr/dict/words and it distributes on %2^n quite 445 * no collisions on /usr/dict/words and it distributes on %2^n quite
458 * well, not as good as MD5, but still good. 446 * well, not as good as MD5, but still good.
459 */ 447 */
460unsigned long lh_strhash(c) 448unsigned long lh_strhash(const char *c)
461char *c;
462 { 449 {
463 unsigned long ret=0; 450 unsigned long ret=0;
464 long n; 451 long n;
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
diff --git a/src/lib/libcrypto/lhash/num.pl b/src/lib/libcrypto/lhash/num.pl
index 4d937c1f90..30fedf9cd5 100644
--- a/src/lib/libcrypto/lhash/num.pl
+++ b/src/lib/libcrypto/lhash/num.pl
@@ -1,4 +1,4 @@
1#!/usr/bin/perl 1#!/usr/local/bin/perl
2 2
3#node 10 -> 4 3#node 10 -> 4
4 4