aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSterling Hughes <sterling@bumblebury.com>2002-04-13 01:56:22 +0000
committerSterling Hughes <sterling@bumblebury.com>2002-04-13 01:56:22 +0000
commitbb44791bf38bf6dd0a24e50f9081f1cc1693ec67 (patch)
tree1b4d042d203ac5196046e876fd7c9ce62e633a8b
parent9ebcfe9dff762ee1f294b851fd2872fab032455a (diff)
Add protos and change return value of curl_hash_count....
-rw-r--r--lib/hash.c20
-rw-r--r--lib/hash.h2
2 files changed, 20 insertions, 2 deletions
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);