cctools
itable.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
8 #ifndef ITABLE_H
9 #define ITABLE_H
10 
11 #include "int_sizes.h"
12 
47 struct itable *itable_create(int buckets);
48 
54 void itable_clear(struct itable *h);
55 
61 void itable_delete(struct itable *h);
62 
68 int itable_size(struct itable *h);
69 
80 int itable_insert(struct itable *h, UINT64_T key, const void *value);
81 
88 void *itable_lookup(struct itable *h, UINT64_T key);
89 
96 void *itable_remove(struct itable *h, UINT64_T key);
97 
105 void itable_firstkey(struct itable *h);
106 
115 int itable_nextkey(struct itable *h, UINT64_T * key, void **value);
116 
117 #endif
int itable_insert(struct itable *h, UINT64_T key, const void *value)
Insert a key and value.
void * itable_lookup(struct itable *h, UINT64_T key)
Look up a value by key.
void itable_firstkey(struct itable *h)
Begin iteration over all keys.
void * itable_remove(struct itable *h, UINT64_T key)
Remove a value by key.
int itable_nextkey(struct itable *h, UINT64_T *key, void **value)
Continue iteration over all keys.
int itable_size(struct itable *h)
Count the entries in an integer table.
void itable_clear(struct itable *h)
Remove all entries from an integer table.
struct itable * itable_create(int buckets)
Create a new integer table.
void itable_delete(struct itable *h)
Delete an integer table.