Other Utilities
[HMap]

Functions

const char * u_hmap_strerror (u_hmap_ret_t rc)
 Get a string representation of an error code.
int u_hmap_copy (u_hmap_t *to, u_hmap_t *from)
 Copy hmap.
int u_hmap_foreach (u_hmap_t *hmap, int f(const void *val))
 Perform an operation on all objects.
int u_hmap_foreach_arg (u_hmap_t *hmap, int f(const void *val, const void *arg), void *arg)
 u_hmap_foreach with user supplied parameter
int u_hmap_foreach_keyval (u_hmap_t *hmap, int f(const void *key, const void *val))
 Perform an operation on all objects.
void u_hmap_dbg (u_hmap_t *hmap)
 Debug Hmap.
void u_hmap_pcy_dbg (u_hmap_t *hmap)
 Debug policy.

Function Documentation

int u_hmap_copy ( u_hmap_t *  to,
u_hmap_t *  from 
)

Perform a copy of an hmap from to to by rehashing all elements and copying the object pointers to the new locations.

Parameters:
to destination hmap
from source hmap
Return values:
U_HMAP_ERR_NONE on success
U_HMAP_ERR_FAIL on failure

Definition at line 1516 of file srcs/toolbox/hmap.c.

References u_hmap_put().

void u_hmap_dbg ( u_hmap_t *  hmap  ) 

Print out information on an hmap.

Parameters:
hmap hmap object

Definition at line 1885 of file srcs/toolbox/hmap.c.

References u_string_append(), u_string_aprintf(), u_string_c(), u_string_cat, u_string_clear(), u_string_create(), u_string_free(), and u_string_len().

int u_hmap_foreach ( u_hmap_t *  hmap,
int   fconst void *val 
)

Execute function f on all objects within hmap. These functions should return U_HMAP_ERR_NONE on success, and take an object as a parameter.

Parameters:
hmap hmap object
f function
Return values:
U_HMAP_ERR_NONE on success
U_HMAP_ERR_FAIL on failure

Definition at line 1793 of file srcs/toolbox/hmap.c.

int u_hmap_foreach_arg ( u_hmap_t *  hmap,
int   fconst void *val, const void *arg,
void *  arg 
)

Execute function f on all objects within hmap supplying arg as custom argument. These functions should return U_HMAP_ERR_NONE on success, and take an hmap object and arg as parameters.

Parameters:
hmap hmap object
f function
arg custom arg that will be supplied to f
Return values:
U_HMAP_ERR_NONE on success
U_HMAP_ERR_FAIL on failure

Definition at line 1826 of file srcs/toolbox/hmap.c.

int u_hmap_foreach_keyval ( u_hmap_t *  hmap,
int   fconst void *key, const void *val 
)

Execute function f on all objects within hmap. These functions should return U_HMAP_ERR_NONE on success, and take an object as a parameter.

Parameters:
hmap hmap object
f function, must accept key and val params
Return values:
U_HMAP_ERR_NONE on success
U_HMAP_ERR_FAIL on failure

Definition at line 1858 of file srcs/toolbox/hmap.c.

void u_hmap_pcy_dbg ( u_hmap_t *  hmap  ) 

Print out policy information.

Parameters:
hmap hmap object

Definition at line 1935 of file srcs/toolbox/hmap.c.

References U_HMAP_PCY_LFU, u_string_aprintf(), u_string_c(), u_string_cat, u_string_clear(), u_string_create(), and u_string_free().

const char* u_hmap_strerror ( u_hmap_ret_t  rc  ) 

Get a string representation of an error code

Parameters:
rc return code

Definition at line 1490 of file srcs/toolbox/hmap.c.


←Products
© 2005-2012 - KoanLogic S.r.l. - All rights reserved