diff options
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | hashtable.h | 7 | ||||
-rw-r--r-- | libhashtable.c | 2 |
3 files changed, 6 insertions, 4 deletions
@@ -5,6 +5,7 @@ TARGET=libhashtable.so all: $(TARGET) $(TARGET): + ./genheader.sh $(CC) $(CFLAGS) -o $(TARGET) libhashtable.c clean: diff --git a/hashtable.h b/hashtable.h index a58a392..60d1b50 100644 --- a/hashtable.h +++ b/hashtable.h @@ -21,7 +21,8 @@ void ll_destroy(struct entry *ll); void ht_destroy(struct hashtable *ht); void ht_freevalues(struct hashtable *ht); int ht_setkey(struct hashtable *ht,char *key,void *value); -struct entry *ll_getentry(struct entry *start,char *msg); +struct entry *ll_getentry(struct entry *start,char *key); struct entry *ht_getentry(struct hashtable *ht,char *key); -struct entry *ht_getnode(struct hashtable *ht,char *msg); -void *ht_getvalue(struct hashtable *ht,char *msg); +struct entry *ht_getnode(struct hashtable *ht,char *key); +void *ht_getvalue(struct hashtable *ht,char *key); +void ht_delete(struct hashtable *ht,char *key); diff --git a/libhashtable.c b/libhashtable.c index 496a3ee..9eb0ed4 100644 --- a/libhashtable.c +++ b/libhashtable.c @@ -160,6 +160,6 @@ void *ht_getvalue(struct hashtable *ht,char *key) { } //delete the node in the linked list in the table entry that matches the key. -void *ht_delete(struct hashtable *ht,char *key) { +void ht_delete(struct hashtable *ht,char *key) { ll_delete(ht_getentry(ht,key)); } |