X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Futils%2Fcommon%2Fcommon.h;fp=src%2Futils%2Fcommon%2Fcommon.h;h=4e2eceda7cb948bb86c3a2128cbdb26f64868157;hp=1ca650544c36bae19aa366b11d26503646c75654;hb=5ebc182261321f0781f38d8645bfc7c74353434c;hpb=d56aca9a8efcc1e40ce0c7f4b1123aaa8d3115ab diff --git a/src/utils/common/common.h b/src/utils/common/common.h index 1ca65054..4e2eceda 100644 --- a/src/utils/common/common.h +++ b/src/utils/common/common.h @@ -356,7 +356,11 @@ typedef int (*dirwalk_callback_f)(const char *dirname, const char *filename, int walk_directory(const char *dir, dirwalk_callback_f callback, void *user_data, int hidden); /* Returns the number of bytes read or negative on error. */ -ssize_t read_file_contents(char const *filename, char *buf, size_t bufsize); +ssize_t read_file_contents(char const *filename, void *buf, size_t bufsize); +/* Writes the contents of the file into the buffer with a trailing NUL. + * Returns the number of bytes written to the buffer or negative on error. */ +ssize_t read_text_file_contents(char const *filename, char *buf, + size_t bufsize); counter_t counter_diff(counter_t old_value, counter_t new_value);