OSSP CVS Repository

ossp - Check-in [1550]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1550
Date: 2002-Jan-15 12:57:31 (local)
2002-Jan-15 11:57:31 (UTC)
User:thl
Branch:
Comment: constification
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp_lh.c      1.1 -> 1.2     8 inserted, 8 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_lh.h      1.1 -> 1.2     5 inserted, 5 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp_lh.c 1.1 -> 1.2

--- 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;


ossp-pkg/lmtp2nntp/lmtp2nntp_lh.h 1.1 -> 1.2

--- lmtp2nntp_lh.h       2002/01/14 14:49:07     1.1
+++ lmtp2nntp_lh.h       2002/01/15 11:57:31     1.2
@@ -30,11 +30,11 @@
 struct lh_st;
 typedef struct lh_st lh_t;
 
-lh_t *lh_new   (void);
-int   lh_insert(lh_t *h, void *keyptr, int keylen, void  *datptr, int  datlen, int override);
-int   lh_lookup(lh_t *h, void *keyptr, int keylen, void **datptr, int *datlen);
-int   lh_delete(lh_t *h, void *keyptr, int keylen);
-int   lh_free  (lh_t *h);
+lh_t *lh_create (void);
+int   lh_insert (lh_t *h, const void *keyptr, int keylen, const void  *datptr, int  datlen, int override);
+int   lh_lookup (lh_t *h, const void *keyptr, int keylen,       void **datptr, int *datlen);
+int   lh_delete (lh_t *h, const void *keyptr, int keylen);
+int   lh_destroy(lh_t *h);
 
 #endif /* __LH_H__ */
 

CVSTrac 2.0.1