/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
* For more information on the algorithm, see
*
* Dynamic Hash Tables
- * Per-Åke Larson (Per-Ake Larson)
+ * Per-Åke Larson (Per-Ake Larson)
* Communications of the ACM
* Vol. 31, No. 4 (April 1988), Pages 446-457
*/
typedef struct afs_lhash afs_lhash;
struct afs_lhash_stat {
- size_t min_chain_length;
- size_t max_chain_length;
- size_t buckets;
- size_t records;
-
- size_t search_calls; /* cumulative afs_lhash_search() call count */
- size_t search_tests; /* cumulative afs_lhash_search() comparison count */
- size_t remove_calls; /* cumulative afs_lhash_remove() call count */
- size_t remove_tests; /* cumulative afs_lhash_remove() comparison count */
+ size_t min_chain_length;
+ size_t max_chain_length;
+ size_t buckets;
+ size_t records;
+
+ size_t search_calls; /* cumulative afs_lhash_search() call count */
+ size_t search_tests; /* cumulative afs_lhash_search() comparison count */
+ size_t remove_calls; /* cumulative afs_lhash_remove() call count */
+ size_t remove_tests; /* cumulative afs_lhash_remove() comparison count */
};
/*
* error.
*/
-afs_lhash *
-afs_lhash_create
-( int (*equal)(const void *a, const void *b)
- /* returns true if the elements pointed to by
- a and b are the same, false otherwise */
-, void *(*allocate)(size_t n)
-, void (*deallocate)(void *p, size_t n)
-);
+afs_lhash *afs_lhash_create(int (*equal) (const void *a, const void *b)
+ /* returns true if the elements pointed to by
+ * a and b are the same, false otherwise */
+ , void *(*allocate) (size_t n)
+ , void (*deallocate) (void *p, size_t n)
+ );
/*
* afs_lhash_destroy() destroys the given hash table.
*/
void
-afs_lhash_destroy
-( afs_lhash *lh
-);
+ afs_lhash_destroy(afs_lhash * lh);
/*
* afs_lhash_iter() calls the given function for each element of the
*/
void
-afs_lhash_iter
-( afs_lhash *lh
-, void(*f)(size_t index, unsigned key, void *data)
-);
+
+ afs_lhash_iter(afs_lhash * lh,
+ void (*f) (size_t index, unsigned key, void *data)
+ );
/*
* afs_lhash_search() searches the given hash table for the given key
* found, 0 otherwise.
*/
-void *
-afs_lhash_search
-( afs_lhash *lh
-, unsigned key
-, const void *data
-);
+void *afs_lhash_search(afs_lhash * lh, unsigned key, const void *data);
/*
* afs_lhash_rosearch() searches the given hash table for the given key
* found, 0 otherwise.
*/
-void *
-afs_lhash_rosearch
-( const afs_lhash *lh
-, unsigned key
-, const void *data
-);
+void *afs_lhash_rosearch(const afs_lhash * lh, unsigned key,
+ const void *data);
/*
* afs_lhash_remove() removes an item matching the given key and data
* 0 otherwise.
*/
-void *
-afs_lhash_remove
-( afs_lhash *lh
-, unsigned key
-, const void *data
-);
+void *afs_lhash_remove(afs_lhash * lh, unsigned key, const void *data);
/*
* afs_lhash_enter() enters the given data element into the given hash
*/
int
-afs_lhash_enter
-( afs_lhash *lh
-, unsigned key
-, void *data
-);
+ afs_lhash_enter(afs_lhash * lh, unsigned key, void *data);
/*
* afs_lhash_stat() writes certain statistics about the given hash table
*/
int
-afs_lhash_stat
-( afs_lhash *lh
-, struct afs_lhash_stat *sb
-);
+ afs_lhash_stat(afs_lhash * lh, struct afs_lhash_stat *sb);
#endif /* AFS_LHASH_H */