X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.h;h=67ca1c14cc6e8d9fcdbe4f70de47911d33d69f2d;hb=c76419c0cf983f1ecd3d36aa236cc4e3f9cff733;hp=9e2529326dbb871a72510fcf30b91a9b7cb7cb60;hpb=0a95b83f89a553be1ac2beae2003927e74230d23;p=collectd.git diff --git a/src/daemon/common.h b/src/daemon/common.h index 9e252932..67ca1c14 100644 --- a/src/daemon/common.h +++ b/src/daemon/common.h @@ -147,10 +147,12 @@ int strsplit (char *string, char **fields, size_t size); * is equivalent to the Perl built-in `join'. * * PARAMETERS - * `dst' Buffer where the result is stored. + * `dst' Buffer where the result is stored. Can be NULL if you need to + * determine the required buffer size only. * `dst_len' Length of the destination buffer. No more than this many * bytes will be written to the memory pointed to by `dst', - * including the trailing null-byte. + * including the trailing null-byte. Must be zero if dst is + * NULL. * `fields' Array of strings to be joined. * `fields_num' Number of elements in the `fields' array. * `sep' String to be inserted between any two elements of `fields'. @@ -158,9 +160,10 @@ int strsplit (char *string, char **fields, size_t size); * Instead of passing "" (empty string) one can pass NULL. * * RETURN VALUE - * Returns the number of characters in `dst', NOT including the trailing - * null-byte. If an error occurred (empty array or `dst' too small) a value - * smaller than zero will be returned. + * Returns the number of characters in the resulting string, excluding a + * tailing null byte. If this value is greater than or equal to "dst_len", the + * result in "dst" is truncated (but still null terminated). On error a + * negative value is returned. */ int strjoin (char *dst, size_t dst_len, char **fields, size_t fields_num, const char *sep); @@ -317,7 +320,8 @@ int format_values (char *ret, size_t ret_len, int parse_identifier (char *str, char **ret_host, char **ret_plugin, char **ret_plugin_instance, - char **ret_type, char **ret_type_instance); + char **ret_type, char **ret_type_instance, + char *default_host); int parse_identifier_vl (const char *str, value_list_t *vl); int parse_value (const char *value, value_t *ret_value, int ds_type); int parse_values (char *buffer, value_list_t *vl, const data_set_t *ds);