From bb44791bf38bf6dd0a24e50f9081f1cc1693ec67 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Sat, 13 Apr 2002 01:56:22 +0000 Subject: Add protos and change return value of curl_hash_count.... --- lib/hash.c | 20 +++++++++++++++++++- lib/hash.h | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/hash.c b/lib/hash.c index 13311e205..dd2f00b6a 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -171,6 +171,8 @@ curl_hash_add (curl_hash *h, char *key, size_t key_len, const void *p) } /* }}} */ +/* {{{ int curl_hash_delete (curl_hash *, char *, size_t) + */ int curl_hash_delete(curl_hash *h, char *key, size_t key_len) { @@ -191,7 +193,10 @@ curl_hash_delete(curl_hash *h, char *key, size_t key_len) return 0; } +/* }}} */ +/* {{{ int curl_hash_find (curl_hash *, char *, size_t, void **) + */ int curl_hash_find(curl_hash *h, char *key, size_t key_len, void **p) { @@ -211,7 +216,10 @@ curl_hash_find(curl_hash *h, char *key, size_t key_len, void **p) return 0; } +/* }}} */ +/* {{{ void curl_hash_apply (curl_hash *, void *, void (*)(void *, curl_hash_element *)) + */ void curl_hash_apply(curl_hash *h, void *user, void (*cb)(void *, curl_hash_element *)) { @@ -224,7 +232,10 @@ curl_hash_apply(curl_hash *h, void *user, void (*cb)(void *, curl_hash_element * } } } +/* }}} */ +/* {{{ void curl_hash_clean (curl_hash *) + */ void curl_hash_clean(curl_hash *h) { @@ -236,13 +247,19 @@ curl_hash_clean(curl_hash *h) free(h->table); } +/* }}} */ -size_t +/* {{{ int curl_hash_count (curl_hash *) + */ +int curl_hash_count(curl_hash *h) { return h->size; } +/* }}} */ +/* {{{ void curl_hash_destroy (curl_hash *) + */ void curl_hash_destroy(curl_hash *h) { @@ -252,6 +269,7 @@ curl_hash_destroy(curl_hash *h) curl_hash_clean(h); free(h); } +/* }}} */ /* * local variables: diff --git a/lib/hash.h b/lib/hash.h index 6aa71b318..6c74ed2d3 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -51,7 +51,7 @@ int curl_hash_add(curl_hash *, char *, size_t, const void *); int curl_hash_delete(curl_hash *h, char *key, size_t key_len); int curl_hash_find(curl_hash *, char *, size_t, void **p); void curl_hash_apply(curl_hash *h, void *user, void (*cb)(void *, curl_hash_element *)); -size_t curl_hash_count(curl_hash *h); +int curl_hash_count(curl_hash *h); void curl_hash_clean(curl_hash *h); void curl_hash_destroy(curl_hash *h); -- cgit v1.2.3