X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fconfigfile.h;h=a73def21760f8efbf0a642002c7f8ee5a45aec1d;hb=refs%2Fheads%2Fsh%2Fcollectd-4.9;hp=3952c180d9949f08bc42a94899d23a9c19a5db70;hpb=4747e79c6e87d443e9f390f8a446521c29c66fb0;p=collectd.git diff --git a/src/configfile.h b/src/configfile.h index 3952c180..a73def21 100644 --- a/src/configfile.h +++ b/src/configfile.h @@ -86,4 +86,18 @@ int cf_read (char *filename); int global_option_set (const char *option, const char *value); const char *global_option_get (const char *option); +/* Assures the config option is a string, duplicates it and returns the copy in + * "ret_string". If necessary "*ret_string" is freed first. Returns zero upon + * success. */ +int cf_util_get_string (const oconfig_item_t *ci, char **ret_string); + +/* Assures the config option is a boolean and assignes it to `ret_bool'. + * Otherwise, `ret_bool' is not changed and non-zero is returned. */ +int cf_util_get_boolean (const oconfig_item_t *ci, _Bool *ret_bool); + +/* Assures that the config option is a string. The string is then converted to + * a port number using `service_name_to_port_number' and returned. Returns the + * port number in the range [1-65535] or less than zero upon failure. */ +int cf_util_get_port_number (const oconfig_item_t *ci); + #endif /* defined(CONFIGFILE_H) */