From 043d70fcdfa50c93dc826069aa5836206f8e3e2d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Jan 2005 00:06:29 +0000 Subject: Use plain structs and not typedef'ed ones in the hash and linked-list code. --- lib/hash.h | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'lib/hash.h') diff --git a/lib/hash.h b/lib/hash.h index 7814674fd..ceebb5234 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -31,30 +31,31 @@ typedef void (*curl_hash_dtor)(void *); -typedef struct _curl_hash { - curl_llist **table; +struct curl_hash { + struct curl_llist **table; curl_hash_dtor dtor; - int slots; - size_t size; -} curl_hash; + int slots; + size_t size; +}; -typedef struct _curl_hash_element { +struct curl_hash_element { void *ptr; char *key; size_t key_len; -} curl_hash_element; +}; -int Curl_hash_init(curl_hash *, int, curl_hash_dtor); -curl_hash *Curl_hash_alloc(int, curl_hash_dtor); -void *Curl_hash_add(curl_hash *, char *, size_t, void *); -int Curl_hash_delete(curl_hash *h, char *key, size_t key_len); -void *Curl_hash_pick(curl_hash *, char *, size_t); -void Curl_hash_apply(curl_hash *h, void *user, +int Curl_hash_init(struct curl_hash *, int, curl_hash_dtor); +struct curl_hash *Curl_hash_alloc(int, curl_hash_dtor); +void *Curl_hash_add(struct curl_hash *, char *, size_t, void *); +int Curl_hash_delete(struct curl_hash *h, char *key, size_t key_len); +void *Curl_hash_pick(struct curl_hash *, char *, size_t); +void Curl_hash_apply(struct curl_hash *h, void *user, void (*cb)(void *user, void *ptr)); -int Curl_hash_count(curl_hash *h); -void Curl_hash_clean(curl_hash *h); -void Curl_hash_clean_with_criterium(curl_hash *h, void *user, int (*comp)(void *, void *)); -void Curl_hash_destroy(curl_hash *h); +int Curl_hash_count(struct curl_hash *h); +void Curl_hash_clean(struct curl_hash *h); +void Curl_hash_clean_with_criterium(struct curl_hash *h, void *user, + int (*comp)(void *, void *)); +void Curl_hash_destroy(struct curl_hash *h); #endif -- cgit v1.2.3