Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cmap_iter_next(3) [centos man page]

CMAP_ITER_NEXT(3)				    Corosync Cluster Engine Programmer's Manual 				 CMAP_ITER_NEXT(3)

NAME
cmap_iter_next - Return next item in iteration in CMAP SYNOPSIS
#include <corosync/cmap.h> cs_error_t cmap_iter_next(cmap_handle_t handle, cmap_iter_handle_t iter_handle, char key_name[], size_t *value_len, cmap_value_types_t *type); DESCRIPTION
The cmap_iter_next function is used to get next value in iteration. The handle argument is connection to CMAP database obtained by calling cmap_initialize(3) function. iter_handle argument is iterator handle obtained by cmap_iter_init(3) function. Following key name is stored inside key_name argument, which must be preallocated by caller and its quaranted maximum size is CMAP_KEYNAME_MAXLEN (urrently 255). value_len is pointer where length of value is stored, but can be NULL. type is also optional argument (can be NULL) and here type of value is stored (type is one of types described in cmap_get(3) function). RETURN VALUE
This call returns the CS_OK value if successful. If there are no more items to iterate, CS_NO_SECTION error code is returned. SEE ALSO
cmap_iter_init(3), cmap_iter_finalize(3), cmap_initialize(3), cmap_get(3), cmap_overview(8) CS_ERR_TRY_AGAIN Resource temporarily unavailable CS_ERR_INVALID_PARAM Invalid argument CS_ERR_ACCESS Permission denied CS_ERR_LIBRARY The connection failed CS_ERR_INTERRUPT System call inturrupted by a signal CS_ERR_NOT_SUPPORTED The requested protocol/functuality not supported CS_ERR_MESSAGE_ERROR Incorrect auth message received CS_ERR_NO_MEMORY Not enough memory to completed the requested task corosync Man Page 06/02/2012 CMAP_ITER_NEXT(3)

Check Out this Related Man Page

CMAP_GET(3)					    Corosync Cluster Engine Programmer's Manual 				       CMAP_GET(3)

NAME
cmap_get - Retreive value from CMAP SYNOPSIS
#include <corosync/cmap.h> cs_error_t cmap_get (cmap_handle_t handle, const char *key_name, void *value, size_t *value_len, cmap_value_types_t *type); Also shortcuts for different types are defined cs_error_t cmap_get_int8 (cmap_handle_t handle, const char *key_name, int8_t *i8); cs_error_t cmap_get_uint8 (cmap_handle_t handle, const char *key_name, uint8_t *u8); cs_error_t cmap_get_int16 (cmap_handle_t handle, const char *key_name, int16_t *i16); cs_error_t cmap_get_uint16 (cmap_handle_t handle, const char *key_name, uint16_t *u16); cs_error_t cmap_get_int32 (cmap_handle_t handle, const char *key_name, int32_t *i32); cs_error_t cmap_get_uint32 (cmap_handle_t handle, const char *key_name, uint32_t *u32); cs_error_t cmap_get_int64 (cmap_handle_t handle, const char *key_name, int64_t *i64); cs_error_t cmap_get_uint64 (cmap_handle_t handle, const char *key_name, uint64_t *u64); cs_error_t cmap_get_float (cmap_handle_t handle, const char *key_name, float *flt); cs_error_t cmap_get_double (cmap_handle_t handle, const char *key_name, double *dbl); cs_error_t cmap_get_string (cmap_handle_t handle, const char *key_name, char **str); DESCRIPTION
The cmap_get function is used to retreive key from cmap previously set by cmap_set(3) function. The handle argument is connection to CMAP database obtained by calling cmap_initialize(3) function. key_name is name of key to get value from. value is pointer to preallocated data used as storage for data, but can be also NULL, and then only value_len and/or type is returned (both of them can also be NULL, allow- ing function to be used only for test of existence of key). If value is not NULL, actual length of value in map is checked against *value_len. If *value_len is shorter then length of value in map, error CS_ERR_INVALID_PARAM is returned. After successful copy of value, *value_len is set to actual length of value in map. Parameter type is pointer to memory, where type of value is stored after successful return. Pointer can also be NULL and then nothing is stored. Type can be one of: CMAP_VALUETYPE_INT8 - 8-bit signed interger CMAP_VALUETYPE_UINT8 - 8-bit unsigned integer CMAP_VALUETYPE_INT16 - 16-bit signed interger CMAP_VALUETYPE_UINT16 - 16-bit unsigned integer CMAP_VALUETYPE_INT32 - 32-bit signed interger CMAP_VALUETYPE_UINT32 - 32-bit unsigned integer CMAP_VALUETYPE_INT64 - 64-bit signed interger CMAP_VALUETYPE_UINT64 - 64-bit unsigned integer CMAP_VALUETYPE_FLOAT - Float value CMAP_VALUETYPE_DOUBLE - Double value CMAP_VALUETYPE_STRING - C-style string CMAP_VALUETYPE_BINARY - Binary data, byte with zero value has no special meaning Sortcut functions tests cmap type with it's own type. If type didn't match, CS_ERR_INVALID_PARAM error is returned. No conversions are done, so for example cmap_get_int16 is not able to return value with CMAP_VALUETYPE_INT8 type. String shortcut function returns newly allocated memory and caller is responsible for freeing that. RETURN VALUE
This call returns the CS_OK value if successful. If value or key_name are unspecified, CS_ERR_INVALID_PARAM is returned. Same error is also returned if value is specified, and *value_len is too short for store of data. If key doesn't exists (it was not set by calling cmap_set(3) function first) CS_ERR_NOT_EXIST error is returned. For helper functions, CS_ERR_INVALID_PARAM is returned if type stored in cmap doesn't match with type of helper function. SEE ALSO
cmap_set(3), cmap_initialize(3), cmap_overview(8) CS_ERR_TRY_AGAIN Resource temporarily unavailable CS_ERR_INVALID_PARAM Invalid argument CS_ERR_ACCESS Permission denied CS_ERR_LIBRARY The connection failed CS_ERR_INTERRUPT System call inturrupted by a signal CS_ERR_NOT_SUPPORTED The requested protocol/functuality not supported CS_ERR_MESSAGE_ERROR Incorrect auth message received CS_ERR_NO_MEMORY Not enough memory to completed the requested task corosync Man Page 03/02/2012 CMAP_GET(3)
Man Page