lsquic_hash.h revision 229fce07
1/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc. See LICENSE. */ 2/* 3 * lsquic_hash.c -- A generic hash 4 */ 5 6#ifndef LSQUIC_HASH_H 7#define LSQUIC_HASH_H 8 9struct lsquic_hash; 10struct lsquic_hash_elem; 11 12struct lsquic_hash * 13lsquic_hash_create (void); 14 15void 16lsquic_hash_destroy (struct lsquic_hash *); 17 18struct lsquic_hash_elem * 19lsquic_hash_insert (struct lsquic_hash *, const void *key, unsigned key_sz, 20 void *data); 21 22struct lsquic_hash_elem * 23lsquic_hash_find (struct lsquic_hash *, const void *key, unsigned key_sz); 24 25void * 26lsquic_hashelem_getdata (const struct lsquic_hash_elem *); 27 28void 29lsquic_hash_erase (struct lsquic_hash *, struct lsquic_hash_elem *); 30 31void 32lsquic_hash_reset_iter (struct lsquic_hash *); 33 34struct lsquic_hash_elem * 35lsquic_hash_first (struct lsquic_hash *); 36 37struct lsquic_hash_elem * 38lsquic_hash_next (struct lsquic_hash *); 39 40unsigned 41lsquic_hash_count (struct lsquic_hash *); 42 43size_t 44lsquic_hash_mem_used (const struct lsquic_hash *); 45#endif 46