1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (c) 2002 Cray Inc.
5 * Copyright (c) 2002 Eric Hoffman
7 * This file is part of Portals, http://www.sf.net/projects/sandiaportals/
13 typedef struct table_entry {
16 struct table_entry *next;
20 typedef struct table {
22 int number_of_entries;
24 int (*compare_function)(void *, void *);
25 unsigned int (*key_function)(unsigned int *);
29 unsigned int key_from_int(int i);
30 unsigned int key_from_string(char *s);
31 table hash_create_table(int (*compare_function)(void *, void *), unsigned int (*key_function)(unsigned int *));
32 void *hash_table_find(table t, void *comparator);
33 void hash_table_insert(table t, void *value, void *comparator);
34 void hash_table_remove(table t, void *comparator);
35 void hash_iterate_table_entries(table t, void (*handler)(void *, void *), void *arg);
36 void hash_filter_table_entries(table t, int (*handler)(void *, void *), void *arg);
37 void hash_destroy_table(table t, void (*thunk)(void *));