* [including the GNU Public Licence.]
*/
-char *lh_version="lhash part of OpenSSL 0.9.2 31-Dec-1998";
-
/* Code for dynamic hash table routines
* Author - Eric Young v 2.0
*
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include "crypto.h"
-#include "lhash.h"
+#include <openssl/crypto.h>
+#include <openssl/lhash.h>
+
+const char *lh_version="lhash" OPENSSL_VERSION_PTEXT;
#undef MIN_NODES
#define MIN_NODES 16
#endif
-LHASH *lh_new(h, c)
-unsigned long (*h)();
-int (*c)();
+LHASH *lh_new(unsigned long (*h)(), int (*c)())
{
LHASH *ret;
int i;
return(NULL);
}
-void lh_free(lh)
-LHASH *lh;
+void lh_free(LHASH *lh)
{
unsigned int i;
LHASH_NODE *n,*nn;
Free((char *)lh);
}
-char *lh_insert(lh, data)
-LHASH *lh;
-char *data;
+char *lh_insert(LHASH *lh, char *data)
{
unsigned long hash;
LHASH_NODE *nn,**rn;
return(ret);
}
-char *lh_delete(lh, data)
-LHASH *lh;
-char *data;
+char *lh_delete(LHASH *lh, char *data)
{
unsigned long hash;
LHASH_NODE *nn,**rn;
return(ret);
}
-char *lh_retrieve(lh, data)
-LHASH *lh;
-char *data;
+char *lh_retrieve(LHASH *lh, char *data)
{
unsigned long hash;
LHASH_NODE **rn;
return(ret);
}
-void lh_doall(lh, func)
-LHASH *lh;
-void (*func)();
+void lh_doall(LHASH *lh, void (*func)())
{
lh_doall_arg(lh,func,NULL);
}
-void lh_doall_arg(lh, func, arg)
-LHASH *lh;
-void (*func)();
-char *arg;
+void lh_doall_arg(LHASH *lh, void (*func)(), char *arg)
{
int i;
LHASH_NODE *a,*n;
}
}
-static void expand(lh)
-LHASH *lh;
+static void expand(LHASH *lh)
{
LHASH_NODE **n,**n1,**n2,*np;
unsigned int p,i,j;
}
}
-static void contract(lh)
-LHASH *lh;
+static void contract(LHASH *lh)
{
LHASH_NODE **n,*n1,*np;
}
}
-static LHASH_NODE **getrn(lh, data, rhash)
-LHASH *lh;
-char *data;
-unsigned long *rhash;
+static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash)
{
LHASH_NODE **ret,*n1;
unsigned long hash,nn;
* no collisions on /usr/dict/words and it distributes on %2^n quite
* well, not as good as MD5, but still good.
*/
-unsigned long lh_strhash(c)
-char *c;
+unsigned long lh_strhash(const char *c)
{
unsigned long ret=0;
long n;