1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-11 07:39:50 -04:00

Add protos and change return value of curl_hash_count....

This commit is contained in:
Sterling Hughes 2002-04-13 01:56:22 +00:00
parent 9ebcfe9dff
commit bb44791bf3
2 changed files with 20 additions and 2 deletions

View File

@ -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 int
curl_hash_delete(curl_hash *h, char *key, size_t key_len) 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; return 0;
} }
/* }}} */
/* {{{ int curl_hash_find (curl_hash *, char *, size_t, void **)
*/
int int
curl_hash_find(curl_hash *h, char *key, size_t key_len, void **p) 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; return 0;
} }
/* }}} */
/* {{{ void curl_hash_apply (curl_hash *, void *, void (*)(void *, curl_hash_element *))
*/
void void
curl_hash_apply(curl_hash *h, void *user, void (*cb)(void *, curl_hash_element *)) 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 void
curl_hash_clean(curl_hash *h) curl_hash_clean(curl_hash *h)
{ {
@ -236,13 +247,19 @@ curl_hash_clean(curl_hash *h)
free(h->table); free(h->table);
} }
/* }}} */
size_t /* {{{ int curl_hash_count (curl_hash *)
*/
int
curl_hash_count(curl_hash *h) curl_hash_count(curl_hash *h)
{ {
return h->size; return h->size;
} }
/* }}} */
/* {{{ void curl_hash_destroy (curl_hash *)
*/
void void
curl_hash_destroy(curl_hash *h) curl_hash_destroy(curl_hash *h)
{ {
@ -252,6 +269,7 @@ curl_hash_destroy(curl_hash *h)
curl_hash_clean(h); curl_hash_clean(h);
free(h); free(h);
} }
/* }}} */
/* /*
* local variables: * local variables:

View File

@ -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_delete(curl_hash *h, char *key, size_t key_len);
int curl_hash_find(curl_hash *, char *, size_t, void **p); 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 *)); 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_clean(curl_hash *h);
void curl_hash_destroy(curl_hash *h); void curl_hash_destroy(curl_hash *h);