libvirt/src/hash.h
Daniel Veillard 1192a2ade3 * Makefile.am README TODO autogen.sh configure.in libvir.pc.in
libvir.spec.in docs/Makefile.am docs/apibuild.py docs/structures.fig
  include/Makefile.am include/libvir.h src/Makefile.am src/hash.c
  src/hash.h src/internal.h src/libvir.c src/libvir_sym.version
  src/virsh.c: renamed to libvir
Daniel
2005-12-05 11:16:07 +00:00

72 lines
1.5 KiB
C

/*
* Summary: Chained hash tables
* Description: This module implements the hash table support used in
* various places in the library.
*
* Copy: See Copyright for the status of this software.
*
* Author: Bjorn Reese <bjorn.reese@systematic.dk>
*/
#ifndef __VIR_HASH_H__
#define __VIR_HASH_H__
#ifdef __cplusplus
extern "C" {
#endif
/*
* The hash table.
*/
typedef struct _virHashTable virHashTable;
typedef virHashTable *virHashTablePtr;
/*
* function types:
*/
/**
* virHashDeallocator:
* @payload: the data in the hash
* @name: the name associated
*
* Callback to free data from a hash.
*/
typedef void (*virHashDeallocator)(void *payload, char *name);
/*
* Constructor and destructor.
*/
virHashTablePtr virHashCreate (int size);
void
virHashFree (virHashTablePtr table,
virHashDeallocator f);
int virHashSize (virHashTablePtr table);
/*
* Add a new entry to the hash table.
*/
int virHashAddEntry (virHashTablePtr table,
const char *name,
void *userdata);
int virHashUpdateEntry(virHashTablePtr table,
const char *name,
void *userdata,
virHashDeallocator f);
/*
* Remove an entry from the hash table.
*/
int virHashRemoveEntry(virHashTablePtr table,
const char *name,
virHashDeallocator f);
/*
* Retrieve the userdata.
*/
void * virHashLookup (virHashTablePtr table,
const char *name);
#ifdef __cplusplus
}
#endif
#endif /* ! __VIR_HASH_H__ */