X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcommon.h;h=ae8e311f9983e8ff63441c0ab2936d287220ae67;hb=aee87d9c1665ca8823c7489bfc9900ff12e0e177;hp=8a7d986534919efa65e449c17313882f363cce93;hpb=842c1a2d2a640151a89b9de7f4acd3b6a058c799;p=collectd.git diff --git a/src/common.h b/src/common.h index 8a7d9865..ae8e311f 100644 --- a/src/common.h +++ b/src/common.h @@ -208,6 +208,13 @@ int strsubstitute (char *str, char c_from, char c_to); */ int strunescape (char *buf, size_t buf_len); +/** + * Removed trailing newline characters (CR and LF) from buffer, which must be + * null terminated. Returns the length of the resulting string. + */ +__attribute__((nonnull (1))) +size_t strstripnewline (char *buffer); + /* * NAME * timeval_cmp @@ -317,4 +324,7 @@ int service_name_to_port_number (const char *service_name); * failure. If failure is returned, ret_value is not touched. */ int strtoderive (const char *string, derive_t *ret_value); +int strarray_add (char ***ret_array, size_t *ret_array_len, char const *str); +void strarray_free (char **array, size_t array_len); + #endif /* COMMON_H */