--- lmtp2nntp_lh.c 2002/01/14 14:49:07 1.1
+++ lmtp2nntp_lh.c 2002/01/15 11:57:31 1.2
@@ -152,7 +152,7 @@
*/
static long
lh_hash(
- register unsigned char *k,
+ register const unsigned char *k,
register size_t length)
{
register long a,b,c,len;
@@ -213,7 +213,7 @@
}
/* create the hash table structure */
-lh_t *lh_new(void)
+lh_t *lh_create(void)
{
lh_t *h;
@@ -357,7 +357,7 @@
}
/* insert element into hash table */
-int lh_insert(lh_t *h, void *keyptr, int keylen, void *datptr, int datlen, int override)
+int lh_insert(lh_t *h, const void *keyptr, int keylen, const void *datptr, int datlen, int override)
{
unsigned int hash, addr;
element_t *el, **pel;
@@ -418,8 +418,8 @@
}
/* insert contents into element structure */
- el->e_keyptr = keyptr;
- el->e_datptr = datptr;
+ el->e_keyptr = (void *)keyptr;
+ el->e_datptr = (void *)datptr;
el->e_endptr = (char *)datptr+datlen;
el->e_hash = hash;
@@ -431,7 +431,7 @@
}
/* lookup an element in hash table */
-int lh_lookup(lh_t *h, void *keyptr, int keylen, void **datptr, int *datlen)
+int lh_lookup(lh_t *h, const void *keyptr, int keylen, void **datptr, int *datlen)
{
unsigned int hash, addr;
element_t *el, **pel;
@@ -466,7 +466,7 @@
}
/* delete an element in hash table */
-int lh_delete(lh_t *h, void *keyptr, int keylen)
+int lh_delete(lh_t *h, const void *keyptr, int keylen)
{
unsigned int hash, addr;
element_t *el, *lel, **pel;
@@ -514,7 +514,7 @@
}
/* destroy the whole hash table */
-int lh_free(lh_t *h)
+int lh_destroy(lh_t *h)
{
element_t *el, **pel;
unsigned int i, j;
|