Data Delivery C API Library Reference  1.2
Data Structures | Functions
ddca_config.h File Reference

Data Structures

struct  ddca_conf_profile_t
 Configuration variable type for DDCA Configuration API. More...

Functions

int ddca_conf_load_profile (const char *profile_filename, ddca_conf_profile_t **profile)
 load a profile specified with the filename
int ddca_conf_get_string_value (const ddca_conf_profile_t *profile, const char *name, char **ret)
 get a string value of a specified attribute from given profile variable
int ddca_conf_get_bool_value (const ddca_conf_profile_t *profile, const char *name, ddca_bool_t *ret)
 get a bool value of a specified attribute from given profile variable
int ddca_conf_get_int_value (const ddca_conf_profile_t *profile, const char *name, ddca_int32_t *ret)
 get an int value of a specified attribute from given profile variable
int ddca_conf_get_double_value (const ddca_conf_profile_t *profile, const char *name, ddca_double64_t *ret)
 get a double value of a specified attribute from given profile variable
int ddca_conf_is_null_value (const ddca_conf_profile_t *profile, const char *name, int *ret)
 return whether a specified attribute in the given profile variable is null or not
int ddca_conf_get_map (const ddca_conf_profile_t *profile, const char *name, ddca_map_t **ret)
 get a ddca_map_t instance of a specified attribute from given event variable
int ddca_conf_get_array (const ddca_conf_profile_t *profile, const char *name, ddca_array_t **ret)
 get a ddca_array_t instance of a specified attribute from given profile variable
int ddca_conf_put_string_value (ddca_conf_profile_t *profile, const char *name, const char *value)
 add a pair of key/value string attribute to the specified profile variable
int ddca_conf_put_bool_value (ddca_conf_profile_t *profile, const char *name, const ddca_bool_t value)
 add a pair of string key and bool value attribute to the specified profile variable
int ddca_conf_put_int_value (ddca_conf_profile_t *profile, const char *name, const ddca_int32_t value)
 add a pair of string key and int value attribute to the specified profile variable
int ddca_conf_put_double_value (ddca_conf_profile_t *profile, const char *name, const ddca_double64_t value)
 add a pair of string key and double value attribute to the specified profile variable
int ddca_conf_put_null (ddca_conf_profile_t *profile, const char *name)
 add a pair of string key and null value attribute to the specified profile variable
int ddca_conf_put_map (ddca_conf_profile_t *profile, const char *name, ddca_map_t *map)
 add a pair of string key and ddca_map_t variable to the specified profile variable
int ddca_conf_put_array (ddca_conf_profile_t *profile, const char *name, ddca_array_t *array)
 add a pair of string key and ddca_array_t variable to the specified profile variable
int ddca_conf_del_value (ddca_conf_profile_t *profile, const char *name)
 delete a specified object from the ddca_conf_profile_t object

Detailed Description


Function Documentation

int ddca_conf_del_value ( ddca_conf_profile_t profile,
const char *  name 
)

delete a specified object from the ddca_conf_profile_t object

This function deletes an object specified with the name from the ddca_conf_profile_t object . This function works only the same level as the given variable; use ddca_get_object and this function to delete the nested attribute.

Parameters:
[in,out]*profileprofile variable to delete from
[in]*nameprofile name to be deleted
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_get_array ( const ddca_conf_profile_t profile,
const char *  name,
ddca_array_t **  ret 
)

get a ddca_array_t instance of a specified attribute from given profile variable

This function searches and returns a ddca_array_t instance of a specified attribute from given profile variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given profile variable. Note that the output array must not be freed since this function return the reference to it.

Parameters:
[in]*profileprofile variable to search
[in]*namename of attribute to get
[out]**retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_get_bool_value ( const ddca_conf_profile_t profile,
const char *  name,
ddca_bool_t ret 
)

get a bool value of a specified attribute from given profile variable

This function searches and returns a bool value of a specified attribute from given profile variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given profile variable. Note that the bool value is represented as a ddca_bool_t type and DDCA_BOOL value.

Parameters:
[in]*profileprofile variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_get_double_value ( const ddca_conf_profile_t profile,
const char *  name,
ddca_double64_t *  ret 
)

get a double value of a specified attribute from given profile variable

This function searches and returns a double value of a specified attribute from given profile variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given profile variable.

Parameters:
[in]*profileprofile variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_get_int_value ( const ddca_conf_profile_t profile,
const char *  name,
ddca_int32_t *  ret 
)

get an int value of a specified attribute from given profile variable

This function searches and returns an int value of a specified attribute from given profile variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given profile variable.

Parameters:
[in]*profileprofile variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_get_map ( const ddca_conf_profile_t profile,
const char *  name,
ddca_map_t **  ret 
)

get a ddca_map_t instance of a specified attribute from given event variable

This function searches and returns a ddca_map_t instance of a specified attribute from given profile variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given profile variable. Note that the output map must not be freed since this function return the reference to it.

Parameters:
[in]*profileprofile variable to search
[in]*namename of attribute to get
[out]**retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_get_string_value ( const ddca_conf_profile_t profile,
const char *  name,
char **  ret 
)

get a string value of a specified attribute from given profile variable

This function searches and returns a string value of a specified attribute from given profile variable. This function do not search the nested values. So the attribute to be returned must locate the same level as the given profile variable. Note that the output string must be freed after the use.

Parameters:
[in]*profileprofile variable to search
[in]*namename of attribute to get
[out]**retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_is_null_value ( const ddca_conf_profile_t profile,
const char *  name,
int *  ret 
)

return whether a specified attribute in the given profile variable is null or not

This function searches and returns the result whether a specified attribute in the given profile 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 profile variable.

Parameters:
[in]*profileprofile variable to search
[in]*namename of attribute to get
[out]*retvariable to accumulate the result
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_load_profile ( const char *  profile_filename,
ddca_conf_profile_t **  profile 
)

load a profile specified with the filename

This function loads a profile from the specified profile filename.

Parameters:
[in]*profile_filenamethe filename of the profile
[out]**profilethe variable to accumulate the loaded profile
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_put_array ( ddca_conf_profile_t profile,
const char *  name,
ddca_array_t array 
)

add a pair of string key and ddca_array_t variable to the specified profile variable

This function adds a pair of string key and ddca_array_t variable to the specified profile variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target profile, this function will return failure. Note that the input array must not be freed since this function use the reference to it.

Parameters:
[in,out]*profileprofile variable where the attribute will be added
[in]*namename of attribute to be added
[in]*arrayvalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_put_bool_value ( ddca_conf_profile_t profile,
const char *  name,
const ddca_bool_t  value 
)

add a pair of string key and bool value attribute to the specified profile variable

This function adds a pair of string key and bool value attribute to the specified profile variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target profile. this function will return failure.

Parameters:
[in,out]*profileprofile variable where the attribute will be added
[in]*namename of attribute to be added
[in]valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_put_double_value ( ddca_conf_profile_t profile,
const char *  name,
const ddca_double64_t  value 
)

add a pair of string key and double value attribute to the specified profile variable

This function adds a pair of string key and double value attribute to the specified profile variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target profile, this function will return failure.

Parameters:
[in,out]*profileprofile variable where the attribute will be added
[in]*namename of attribute to be added
[in]valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_put_int_value ( ddca_conf_profile_t profile,
const char *  name,
const ddca_int32_t  value 
)

add a pair of string key and int value attribute to the specified profile variable

This function adds a pair of string key and int value attribute to the specified profile variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target profile, this function will return failure.

Parameters:
[in,out]*profileprofile variable where the attribute will be added
[in]*namename of attribute to be added
[in]valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_put_map ( ddca_conf_profile_t profile,
const char *  name,
ddca_map_t map 
)

add a pair of string key and ddca_map_t variable to the specified profile variable

This function adds a pair of string key and ddca_map_t variable to the specified profile variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target profile, this function will return failure. Note that the input map must not be freed since this function use the reference to it.

Parameters:
[in,out]*profileprofile variable to add
[in]*namename of attribute to be added
[in]*mapvalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_put_null ( ddca_conf_profile_t profile,
const char *  name 
)

add a pair of string key and null value attribute to the specified profile variable

This function adds a pair of string key and null value attribute to the specified profile variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target profile, this function will return failure.

Parameters:
[in,out]*profileprofile variable where the attribute will be added
[in]*namename of attribute to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_conf_put_string_value ( ddca_conf_profile_t profile,
const char *  name,
const char *  value 
)

add a pair of key/value string attribute to the specified profile variable

This function adds a pair of key/value string attribute to the specified profile variable. More than one attribute with the same name cannot be added to the same object. So if the key name to be added already exist to the target profile, this function will return failure. The input string can be freed if the function is success.

Parameters:
[in,out]*profileprofile variable where the attribute will be added
[in]*namename of attribute to be added
[in]*valuevalue to be added
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
 All Data Structures Files Functions Variables Typedefs Defines