Data Delivery C API Library Reference
1.2
|
Functions | |
int | ddca_cmn_create_map (ddca_map_t **map) |
create an empty ddca_map_t instance | |
int | ddca_cmn_delete_map (ddca_map_t *map) |
delete an entire ddca_map_t object | |
int | ddca_cmn_put_string_value (ddca_map_t *map, const char *name, const char *value) |
add a pair of key/value string attribute to the specified ddca_map_t variable | |
int | ddca_cmn_put_bool_value (ddca_map_t *evt, const char *name, const ddca_bool_t value) |
add a pair of string key and bool value attribute to the specified ddca_map_t variable | |
int | ddca_cmn_put_int_value (ddca_map_t *map, const char *name, const ddca_int32_t value) |
add a pair of string key and int value attribute to the specified ddca_map_t variable | |
int | ddca_cmn_put_double_value (ddca_map_t *map, const char *name, const ddca_double64_t value) |
add a pair of string key and double value attribute to the specified ddca_map_t variable | |
int | ddca_cmn_put_null (ddca_map_t *map, const char *name) |
add a pair of string key and null value attribute to the specified ddca_map_t variable | |
int | ddca_cmn_put_map (ddca_map_t *map, const char *name, ddca_map_t *child_map) |
add a ddca_map_t variable to the another ddca_map_t variable | |
int | ddca_cmn_put_array (ddca_map_t *map, const char *name, ddca_array_t *array) |
add a ddca_array_t array to the ddca_map_t variable | |
int | ddca_cmn_get_string_value (const ddca_map_t *map, const char *name, char **ret) |
get a string value of a specified attribute from given ddca_map_t variable | |
int | ddca_cmn_get_bool_value (const ddca_map_t *map, const char *name, ddca_bool_t *ret) |
get a bool value of a specified attribute from given ddca_map_t variable | |
int | ddca_cmn_get_int_value (const ddca_map_t *map, const char *name, ddca_int32_t *ret) |
get an int value of a specified attribute from given ddca_map_t variable | |
int | ddca_cmn_get_double_value (const ddca_map_t *map, const char *name, ddca_double64_t *ret) |
get a double value of a specified attribute from given ddca_map_t variable | |
int | ddca_cmn_is_null_value (const ddca_map_t *map, const char *name, int *ret) |
return whether a specified attribute in the given ddca_map_t variable is null or not | |
int | ddca_cmn_get_map (const ddca_map_t *map, const char *name, ddca_map_t **ret) |
get a ddca_map_t object from the ddca_map_t variable | |
int | ddca_cmn_get_array (const ddca_map_t *map, const char *name, ddca_array_t **ret) |
get a ddca_array_t array from the ddca_array_t variable | |
int | ddca_cmn_del_value (ddca_map_t *map, const char *name) |
delete a specified object from the ddca_map_t object | |
int | ddca_cmn_create_array (ddca_array_t **array) |
create an empty ddca_array_t array | |
int | ddca_cmn_create_string_array (const char **strings, int count, ddca_array_t **array) |
create a ddca_array_t array of given string values | |
int | ddca_cmn_create_bool_array (const ddca_bool_t *bools, int count, ddca_array_t **array) |
create a ddca_array_t array of given bool values | |
int | ddca_cmn_create_int_array (const ddca_int32_t *numbers, int count, ddca_array_t **array) |
create a ddca_array_t array of given int values | |
int | ddca_cmn_create_double_array (const ddca_double64_t *numbers, int count, ddca_array_t **array) |
create a ddca_array_t array of given double values | |
int | ddca_cmn_delete_array (ddca_array_t *array) |
delete an entire ddca_array_t | |
int | ddca_cmn_get_array_size (const ddca_array_t *array, int *size) |
get size of array from given array variable | |
int | ddca_cmn_append_string_value_to_array (ddca_array_t *array, const char *value) |
add a string value to the specified array variable | |
int | ddca_cmn_append_bool_value_to_array (ddca_array_t *array, const ddca_bool_t value) |
add a bool value to the specified array variable | |
int | ddca_cmn_append_int_value_to_array (ddca_array_t *array, const ddca_int32_t value) |
add an int value to the specified array variable | |
int | ddca_cmn_append_double_value_to_array (ddca_array_t *array, const ddca_double64_t value) |
add a double value to the specified array variable | |
int | ddca_cmn_append_map_to_array (ddca_array_t *array, ddca_map_t *map) |
add a ddca_array_t object to the specified array variable | |
int | ddca_cmn_append_array_to_array (ddca_array_t *array, ddca_array_t *child_array) |
add a ddca_array_t array to the specified array variable | |
int | ddca_cmn_insert_string_value_to_array (ddca_array_t *array, int index, const char *value) |
insert a string value to the specified index of given array variable | |
int | ddca_cmn_insert_bool_value_to_array (ddca_array_t *array, int index, const ddca_bool_t value) |
insert a bool value to the specified index of given array variable | |
int | ddca_cmn_insert_int_value_to_array (ddca_array_t *array, int index, const ddca_int32_t value) |
insert an int value to the specified index of given array variable | |
int | ddca_cmn_insert_double_value_to_array (ddca_array_t *array, int index, const ddca_double64_t value) |
insert a double value to the specified index of given array variable | |
int | ddca_cmn_insert_map_to_array (ddca_array_t *array, int index, ddca_map_t *map) |
insert a ddca_array_t object to the specified index of given array variable | |
int | ddca_cmn_insert_array_to_array (ddca_array_t *array, int index, ddca_array_t *child_array) |
insert a ddca_array_t array to the specified index of given array variable | |
int | ddca_cmn_get_string_value_in_array (const ddca_array_t *array, int index, char **ret) |
get a string value at a specified index from given array variable | |
int | ddca_cmn_get_bool_value_in_array (const ddca_array_t *array, int index, ddca_bool_t *ret) |
get a bool value at a specified index from given array variable | |
int | ddca_cmn_get_int_value_in_array (const ddca_array_t *array, int index, ddca_int32_t *ret) |
get an int value at a specified index from given array variable | |
int | ddca_cmn_get_double_value_in_array (const ddca_array_t *array, int index, ddca_double64_t *ret) |
get a double value at a specified index from given array variable | |
int | ddca_cmn_get_map_in_array (const ddca_array_t *array, int index, ddca_map_t **ret) |
get a ddca_array_t object at a specified index from given array variable | |
int | ddca_cmn_get_array_in_array (const ddca_array_t *array, int index, ddca_array_t **ret) |
get a ddca_array_t array at a specified index from given array variable | |
int | ddca_cmn_del_value_from_array (ddca_array_t *array, int index) |
delete a value at the specified index from given array variable |
int ddca_cmn_append_array_to_array | ( | ddca_array_t * | array, |
ddca_array_t * | child_array | ||
) |
add a ddca_array_t array to the specified array variable
This function adds a ddca_array_t array value to the specified array variable.
[in,out] | *array | array variable where the chiled_array will be added |
[in] | *child_array | array variable to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_append_bool_value_to_array | ( | ddca_array_t * | array, |
const ddca_bool_t | value | ||
) |
add a bool value to the specified array variable
This function adds a bool value to the specified array variable.
[in,out] | *array | array variable where the value will be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_append_double_value_to_array | ( | ddca_array_t * | array, |
const ddca_double64_t | value | ||
) |
add a double value to the specified array variable
This function adds a double value to the specified array variable.
[in,out] | *array | array variable where the value will be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_append_int_value_to_array | ( | ddca_array_t * | array, |
const ddca_int32_t | value | ||
) |
add an int value to the specified array variable
This function adds an int value to the specified array variable.
[in,out] | *array | array variable where the value will be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_append_map_to_array | ( | ddca_array_t * | array, |
ddca_map_t * | map | ||
) |
add a ddca_array_t object to the specified array variable
This function adds a ddca_array_t object to the specified array variable.
[in,out] | *array | array variable where the value will be added |
[in] | *map | ddca_map_t variable to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_append_string_value_to_array | ( | ddca_array_t * | array, |
const char * | value | ||
) |
add a string value to the specified array variable
This function adds a string value to the specified array variable.
[in,out] | *array | array variable where the value will be added |
[in] | *value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_create_array | ( | ddca_array_t ** | array | ) |
create an empty ddca_array_t array
This function creates an empty ddca_array_t array. The ddca_array_t array accumulates the sequence of objects expressed by array.
[out] | **array | array object to be created |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_create_bool_array | ( | const ddca_bool_t * | bools, |
int | count, | ||
ddca_array_t ** | array | ||
) |
create a ddca_array_t array of given bool values
This function creates a ddca_array_t array, and set bool values from given array of bool value to the ddca_array_t array.
[in] | *bools | array of bool values to set |
[in] | count | number of bool values in bools array |
[out] | **array | array object to be created |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_create_double_array | ( | const ddca_double64_t * | numbers, |
int | count, | ||
ddca_array_t ** | array | ||
) |
create a ddca_array_t array of given double values
This function creates a ddca_array_t array, and set double values from given array of double value to the ddca_array_t array.
[in] | *numbers | array of double values to set |
[in] | count | number of double values in numbers array |
[out] | **array | array object to be created |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_create_int_array | ( | const ddca_int32_t * | numbers, |
int | count, | ||
ddca_array_t ** | array | ||
) |
create a ddca_array_t array of given int values
This function creates a ddca_array_t array, and set int values from given array of int value to the ddca_array_t array.
[in] | *numbers | array of int values to set |
[in] | count | number of int values in numbers array |
[out] | **array | array object to be created |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_create_map | ( | ddca_map_t ** | map | ) |
create an empty ddca_map_t instance
This function creates an empty ddca_map_t instance.
[out] | **map | ddca_map_t variable to be created |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_create_string_array | ( | const char ** | strings, |
int | count, | ||
ddca_array_t ** | array | ||
) |
create a ddca_array_t array of given string values
This function creates a ddca_array_t array, and set string values from given array of string value to the ddca_array_t array.
[in] | **strings | array of string values to set |
[in] | count | number of string values in strings array |
[out] | **array | array object to be created |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_del_value | ( | ddca_map_t * | map, |
const char * | name | ||
) |
delete a specified object from the ddca_map_t object
This function deletes an object specified with the name on the ddca_map_t object. This function works only the same level as the given variable; use ddca_get_object function and this function to delete the nested attribute.
[in] | *map | ddca_map_t variable to delete from |
[in] | *name | key name to be deleted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_del_value_from_array | ( | ddca_array_t * | array, |
int | index | ||
) |
delete a value at the specified index from given array variable
This function deletes a value in the specified index from given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in] | *array | array variable to delete |
[in] | index | number of index to delete |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_delete_array | ( | ddca_array_t * | array | ) |
delete an entire ddca_array_t
This function deletes the ddca_array_t object and all its component objects.
[in] | *array | ddca_array_t variable to delete |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_delete_map | ( | ddca_map_t * | map | ) |
delete an entire ddca_map_t object
This function deletes the ddca_map_t object and all its descendants put to this object.
[in] | *map | ddca_map_t variable to delete |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_array | ( | const ddca_map_t * | map, |
const char * | name, | ||
ddca_array_t ** | ret | ||
) |
get a ddca_array_t array from the ddca_array_t variable
This function searches and gets a ddca_array_t array from the ddca_array_t variable specified by the attribute name. Note that the output array must not be freed since this function return the reference to it.
[in] | *map | ddca_map_t variable to search |
[in] | *name | name of attribute to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_array_in_array | ( | const ddca_array_t * | array, |
int | index, | ||
ddca_array_t ** | ret | ||
) |
get a ddca_array_t array at a specified index from given array variable
This function searches and gets a ddca_array_t array at a specified index from given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0. Note that the output array must not be freed since this function return the reference to it.
[in] | *array | array variable to search |
[in] | index | number of index to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_array_size | ( | const ddca_array_t * | array, |
int * | size | ||
) |
get size of array from given array variable
This function counts the number of the element included in the specified array variable and returns it.
[in] | *array | array variable |
[out] | *size | array size |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_bool_value | ( | const ddca_map_t * | map, |
const char * | name, | ||
ddca_bool_t * | ret | ||
) |
get a bool value of a specified attribute from given ddca_map_t variable
This function searches and returns a bool value of a specified attribute from given ddca_map_t variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given ddca_map_t variable. Note that the bool value is represented as a ddca_bool_t type and DDCA_BOOL value.
[in] | *map | ddca_map_t variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_bool_value_in_array | ( | const ddca_array_t * | array, |
int | index, | ||
ddca_bool_t * | ret | ||
) |
get a bool value at a specified index from given array variable
This function searches and returns a bool value at a specified index from given array variable. Note that the bool value is represented as a ddca_bool_t type and DDCA_BOOL value. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in] | *array | array variable to search |
[in] | index | number of index to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_double_value | ( | const ddca_map_t * | map, |
const char * | name, | ||
ddca_double64_t * | ret | ||
) |
get a double value of a specified attribute from given ddca_map_t variable
This function searches and returns a double value of a specified attribute from given ddca_map_t variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given ddca_map_t variable.
[in] | *map | ddca_map_t variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_double_value_in_array | ( | const ddca_array_t * | array, |
int | index, | ||
ddca_double64_t * | ret | ||
) |
get a double value at a specified index from given array variable
This function searches and returns a double value at a specified index from given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in] | *array | array variable to search |
[in] | index | number of index to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_int_value | ( | const ddca_map_t * | map, |
const char * | name, | ||
ddca_int32_t * | ret | ||
) |
get an int value of a specified attribute from given ddca_map_t variable
This function searches and returns an int value of a specified attribute from given ddca_map_t variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given ddca_map_t variable.
[in] | *map | ddca_map_t variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_int_value_in_array | ( | const ddca_array_t * | array, |
int | index, | ||
ddca_int32_t * | ret | ||
) |
get an int value at a specified index from given array variable
This function searches and returns an int value at a specified index from given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in] | *array | array variable to search |
[in] | index | number of index to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_map | ( | const ddca_map_t * | map, |
const char * | name, | ||
ddca_map_t ** | ret | ||
) |
get a ddca_map_t object from the ddca_map_t variable
This function searches and gets a ddca_map_t object from the ddca_map_t variable specified by the attribute name. Note that the output map must not be freed since this function return the reference to it.
[in] | *map | ddca_map_t variable to search |
[in] | *name | name of attribute to search |
[out] | **ret | value to be returned |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_map_in_array | ( | const ddca_array_t * | array, |
int | index, | ||
ddca_map_t ** | ret | ||
) |
get a ddca_array_t object at a specified index from given array variable
This function searches and gets a ddca_array_t object of a specified index from given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0. Note that the output map must not be freed since this function return the reference to it.
[in] | *array | array variable to search |
[in] | index | number of index to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_string_value | ( | const ddca_map_t * | map, |
const char * | name, | ||
char ** | ret | ||
) |
get a string value of a specified attribute from given ddca_map_t variable
This function searches and returns a string value of a specified attribute from given ddca_map_t variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given ddca_map_t variable. Note that the output string must be freed after the use.
[in] | *map | ddca_map_t variable to search |
[in] | *name | name of attribute to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_get_string_value_in_array | ( | const ddca_array_t * | array, |
int | index, | ||
char ** | ret | ||
) |
get a string value at a specified index from given array variable
This function searches and returns a string value at a specified index from given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0. Note that the output string must be freed after the use.
[in] | *array | array variable to search |
[in] | index | number of index to get |
[out] | **ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_insert_array_to_array | ( | ddca_array_t * | array, |
int | index, | ||
ddca_array_t * | child_array | ||
) |
insert a ddca_array_t array to the specified index of given array variable
This function inserts a ddca_array_t array to the specified index of given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in,out] | *array | array variable to insert |
[in] | index | number of index to insert |
[in] | *child_array | ddca_array_t variable to be inserted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_insert_bool_value_to_array | ( | ddca_array_t * | array, |
int | index, | ||
const ddca_bool_t | value | ||
) |
insert a bool value to the specified index of given array variable
This function inserts a bool value to the specified index of given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in,out] | *array | array variable to insert |
[in] | index | number of index to insert |
[in] | value | value to be inserted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_insert_double_value_to_array | ( | ddca_array_t * | array, |
int | index, | ||
const ddca_double64_t | value | ||
) |
insert a double value to the specified index of given array variable
This function inserts a double value to the specified index of given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in,out] | *array | array variable to insert |
[in] | index | number of index to insert |
[in] | value | value to be inserted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_insert_int_value_to_array | ( | ddca_array_t * | array, |
int | index, | ||
const ddca_int32_t | value | ||
) |
insert an int value to the specified index of given array variable
This function inserts an int value to the specified index of given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in,out] | *array | array variable to insert |
[in] | index | number of index to insert |
[in] | value | value to be inserted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_insert_map_to_array | ( | ddca_array_t * | array, |
int | index, | ||
ddca_map_t * | map | ||
) |
insert a ddca_array_t object to the specified index of given array variable
This function inserts a ddca_array_t object to the specified index of given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in,out] | *array | array variable to insert |
[in] | index | number of index to insert |
[in] | *map | ddca_map_t variable to be inserted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_insert_string_value_to_array | ( | ddca_array_t * | array, |
int | index, | ||
const char * | value | ||
) |
insert a string value to the specified index of given array variable
This function inserts a string value to the specified index of given array variable. Note that index starts from 0. So specify index between size of array - 1 and 0.
[in,out] | *array | array variable to insert |
[in] | index | number of index to insert |
[in] | *value | value to be inserted |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_is_null_value | ( | const ddca_map_t * | map, |
const char * | name, | ||
int * | ret | ||
) |
return whether a specified attribute in the given ddca_map_t variable is null or not
This function searches and returns the result whether a specified attribute in the given ddca_map_t variable is null or not. This function do not search the nested values. So the attribute to be returned must locate the same level as the given ddca_map_t variable.
[in] | *map | ddca_map_t variable to search |
[in] | *name | name of attribute to get |
[out] | *ret | variable to accumulate the result |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_put_array | ( | ddca_map_t * | map, |
const char * | name, | ||
ddca_array_t * | array | ||
) |
add a ddca_array_t array to the ddca_map_t variable
This function adds a ddca_array_t array to the ddca_map_t variable with the specified attribute name. Note that the input array must not be freed since this function use the reference to it.
[in,out] | *map | ddca_map_t variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | *array | ddca_array_t variable to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_put_bool_value | ( | ddca_map_t * | evt, |
const char * | name, | ||
const ddca_bool_t | value | ||
) |
add a pair of string key and bool value attribute to the specified ddca_map_t variable
This function adds a pair of string key and bool value attribute to the specified ddca_map_t variable. More than one attribute with the same name cannot be added to the same instance. So if the key name to be added already exist to the target instance, this function will return failure.
[in,out] | *map | ddca_map_t variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_put_double_value | ( | ddca_map_t * | map, |
const char * | name, | ||
const ddca_double64_t | value | ||
) |
add a pair of string key and double value attribute to the specified ddca_map_t variable
This function adds a pair of string key and double value attribute to the specified ddca_map_t variable. More than one attribute with the same name cannot be added to the same instance. So if the key name to be added already exist to the target instance, this function will return failure.
[in,out] | *map | ddca_map_t variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_put_int_value | ( | ddca_map_t * | map, |
const char * | name, | ||
const ddca_int32_t | value | ||
) |
add a pair of string key and int value attribute to the specified ddca_map_t variable
This function adds a pair of string key and int value attribute to the specified ddca_map_t variable. More than one attribute with the same name cannot be added to the same instance. So if the key name to be added already exist to the target instance, this function will return failure.
[in,out] | *map | ddca_map_t variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_put_map | ( | ddca_map_t * | map, |
const char * | name, | ||
ddca_map_t * | child_map | ||
) |
add a ddca_map_t variable to the another ddca_map_t variable
This function adds a ddca_map_t instance to the ddca_map_t variable with the specified attribute name. More than one attribute with the same name cannot be added to the same instance. So if the key name to be added already exist to the target instance, this function will return failure. Note that the input map must not be freed since this function use the reference to it.
[in,out] | *map | ddca_map_t variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | *child_map | ddca_map_t variable to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_put_null | ( | ddca_map_t * | map, |
const char * | name | ||
) |
add a pair of string key and null value attribute to the specified ddca_map_t variable
This function adds a pair of string key and null value attribute to the specified ddca_map_t variable. More than one attribute with the same name cannot be added to the same instance. So if the key name to be added already exist to the target instance, this function will return failure.
[in,out] | *map | ddca_map_t variable where the attribute will be added |
[in] | *name | name of attribute to be added |
DDCA_SUCCESS | operation success |
others | operation failure |
int ddca_cmn_put_string_value | ( | ddca_map_t * | map, |
const char * | name, | ||
const char * | value | ||
) |
add a pair of key/value string attribute to the specified ddca_map_t variable
This function adds a pair of key/value string attribute to the specified ddca_map_t variable. More than one attribute with the same name cannot be added to the same instance. So if the key name to be added already exist to the target instance, this function will return failure. The input string can be freed if the function is success.
[in,out] | *map | ddca_map_t variable where the attribute will be added |
[in] | *name | name of attribute to be added |
[in] | *value | value to be added |
DDCA_SUCCESS | operation success |
others | operation failure |