Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

HASHMAP_ Struct Reference
[Hash Map Wrapper]

main hash map structure More...

#include <mntd_volume_hash.h>


Data Fields

CHTblhm
 Pointer to chained hashmap table.

unsigned int bucket
 Number of buckets to be used.

int(* init )(PHASHMAP phm)
 HashMap Constructor.

int(* hash )(const void *obj)
 HashMap hash for element.

int(* compare )(const void *obj1, const void *obj2)
 HashMap compare for element.

void(* free )(void *data)
 HashMap hash for element.

void(* destroy )(PHASHMAP phm)
 HashMap Destructor.

int(* add )(PHASHMAP phm, const char *key, void *data)
 Add to HashMap.

int(* remove )(PHASHMAP phm, const char *key)
 Remove from HashMap.

int(* size )(PHASHMAP phm)
 Size of HashMap.

int(* contains )(PHASHMAP phm, const char *key)
 HashMap contains.

int(* get )(PHASHMAP phm, const char *key, void **userdata)
 Get userdata from HashMap.

int(* update )(PHASHMAP phm, const char *key, void *userdata)
 Update element in HashMap.

int(* foreach )(PHASHMAP phm, int(*func)(void *data, void *userdata), void *userdata)
 Iterate over HashMap.


Detailed Description

main hash map structure

Definition at line 91 of file mntd_volume_hash.h.


Field Documentation

int(* HASHMAP_::add)(PHASHMAP phm, const char *key, void *data)
 

Add to HashMap.

Parameters:
phm Pointer to HashMap Object
key Key for hash entry
data Data pointer to store
Returns:
0 if successfully inserted -1 if error while inserting 1 if element is already in list

int(* HASHMAP_::compare)(const void *obj1, const void *obj2)
 

HashMap compare for element.

Parameters:
obj1 Key for hash entry (default: element)
obj2 Key for hash entry (default: element)
Returns:
compare status

int(* HASHMAP_::contains)(PHASHMAP phm, const char *key)
 

HashMap contains.

Parameters:
phm Pointer to HashMap Object
key Key to search for
Returns:
1 if found, 0 otherwise

void(* HASHMAP_::destroy)(PHASHMAP phm)
 

HashMap Destructor.

Call it to free to hashmap

Parameters:
phm Pointer to HashMap Object

int(* HASHMAP_::foreach)(PHASHMAP phm, int (*func)(void *data, void *userdata), void *userdata)
 

Iterate over HashMap.

Parameters:
phm Pointer to HashMap Object
func callback function
data User data pointer
Returns:
0 if successful, -1 otherwise

void(* HASHMAP_::free)(void *data)
 

HashMap hash for element.

Parameters:
data Pointer to data (default: element)

int(* HASHMAP_::get)(PHASHMAP phm, const char *key, void **userdata)
 

Get userdata from HashMap.

Parameters:
phm Pointer to HashMap Object
key Key for hash entry
userdata return value
Returns:
0 if successful, -1 otherwise

int(* HASHMAP_::hash)(const void *obj)
 

HashMap hash for element.

Parameters:
key Key for hash entry
Returns:
hash from key (buckets will be handled by chtbl)

int(* HASHMAP_::init)(PHASHMAP phm)
 

HashMap Constructor.

Parameters:
phm Pointer to HashMap Object
Returns:
0 if successful, -1 otherwise

int(* HASHMAP_::remove)(PHASHMAP phm, const char *key)
 

Remove from HashMap.

Parameters:
phm Pointer to HashMap Object
key Key for hash entry
Returns:
0 if successful, -1 otherwise

int(* HASHMAP_::size)(PHASHMAP phm)
 

Size of HashMap.

Parameters:
phm Pointer to HashMap Object
Returns:
>=0 if successful, -1 otherwise

int(* HASHMAP_::update)(PHASHMAP phm, const char *key, void *userdata)
 

Update element in HashMap.

Parameters:
phm Pointer to HashMap Object
key Key for hash entry
data Data pointer to update
Returns:
0 if successful, -1 otherwise


The documentation for this struct was generated from the following file:
Generated on Thu May 27 23:27:28 2004 for Mntd by doxygen 1.3.5