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(* cb_free_element )(void *data)
 Free callback pointer for hashmap element (to free users data).
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 93 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_::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

Referenced by mntd_volume_manager_contains(), and new_VolumeManager().

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

HashMap Destructor.

Call it to free to hashmap

Parameters:
phm Pointer to HashMap Object

Referenced by mntd_volume_manager_add_volume(), mntd_volume_manager_destroy(), and new_VolumeManager().

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

Referenced by mntd_volume_manager_foreach_mounted().

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_::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

Referenced by mntd_volume_manager_remove_volume().

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 Wed Mar 30 13:43:27 2005 for Mntd by  doxygen 1.3.9.1