itable.h
Go to the documentation of this file.
/*
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef ITABLE_H
#define ITABLE_H
#include "int_sizes.h"
struct itable *itable_create(int buckets);
void itable_clear( struct itable *h, void (*delete_func)(void*) );
void itable_delete(struct itable *h);
int itable_size(struct itable *h);
int itable_insert(struct itable *h, UINT64_T key, const void *value);
void *itable_lookup(struct itable *h, UINT64_T key);
void *itable_remove(struct itable *h, UINT64_T key);
void * itable_pop( struct itable *h );
void itable_firstkey(struct itable *h);
int itable_nextkey(struct itable *h, UINT64_T * key, void **value);
#define ITABLE_ITERATE(table,key,value) itable_firstkey(table); while(itable_nextkey(table,&key,(void**)&value))
#endif
itable_size
int itable_size(struct itable *h)
Count the entries in an integer table.
itable_nextkey
int itable_nextkey(struct itable *h, UINT64_T *key, void **value)
Continue iteration over all keys.
itable_clear
void itable_clear(struct itable *h, void(*delete_func)(void *))
Remove all entries from an integer table.
itable_lookup
void * itable_lookup(struct itable *h, UINT64_T key)
Look up a value by key.
itable_delete
void itable_delete(struct itable *h)
Delete an integer table.
itable_firstkey
void itable_firstkey(struct itable *h)
Begin iteration over all keys.
itable_create
struct itable * itable_create(int buckets)
Create a new integer table.
itable_pop
void * itable_pop(struct itable *h)
Remove any one value.
itable_remove
void * itable_remove(struct itable *h, UINT64_T key)
Remove a value by key.
itable_insert
int itable_insert(struct itable *h, UINT64_T key, const void *value)
Insert a key and value.