X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils%2Fcommon%2Fcommon.h;h=4e2eceda7cb948bb86c3a2128cbdb26f64868157;hb=f43a473fd8ffa483bd7d74579a22886ab2df9101;hp=1ca650544c36bae19aa366b11d26503646c75654;hpb=a1bba58ed83a67ba47e7c88dca6a939ce3181a9d;p=collectd.git 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);