#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
- static int fnname (struct hashtable * htable, keytype key, valuetype value) { \
- return hashtable_insert(htable, (addr_t)key, (addr_t)value); \
- }
+ static int fnname (struct hashtable * htable, keytype key, valuetype value) { \
+ return hashtable_insert(htable, (addr_t)key, (addr_t)value); \
+ }
#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \
- static valuetype * fnname (struct hashtable * htable, keytype key) { \
- return (valuetype *) (hashtable_search(htable, (addr_t)key)); \
- }
+ static valuetype * fnname (struct hashtable * htable, keytype key) { \
+ return (valuetype *) (hashtable_search(htable, (addr_t)key)); \
+ }
#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype, free_key) \
- static valuetype * fnname (struct hashtable * htable, keytype key) { \
- return (valuetype *) (hashtable_remove(htable, (addr_t)key, free_key)); \
- }
+ static valuetype * fnname (struct hashtable * htable, keytype key) { \
+ return (valuetype *) (hashtable_remove(htable, (addr_t)key, free_key)); \
+ }
int hashtable_dec(struct hashtable * htable, addr_t key, addr_t value);
- /* ************ */
- /* ITERATOR API */
+/* ************ */
+/* ITERATOR API */
/* ************ */
#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
- int fnname (struct hashtable_itr * iter, struct hashtable * htable, keytype * key) { \
- return (hashtable_iterator_search(iter, htable, key)); \
- }
+ int fnname (struct hashtable_itr * iter, struct hashtable * htable, keytype * key) { \
+ return (hashtable_iterator_search(iter, htable, key)); \
+ }
/* This struct is only concrete here to allow the inlining of two of the
* accessor functions. */
struct hashtable_iter {
- struct hashtable * htable;
- struct hash_entry * entry;
- struct hash_entry * parent;
- uint_t index;
+ struct hashtable * htable;
+ struct hash_entry * entry;
+ struct hash_entry * parent;
+ uint_t index;
};
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ */