projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/common.[ch]: read_file_contents: Use {s,}size_t rather than int.
[collectd.git]
/
src
/
common.h
diff --git
a/src/common.h
b/src/common.h
index
8a7d986
..
7c0d936
100644
(file)
--- 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);
*/
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
/*
* NAME
* timeval_cmp
@@
-296,7
+303,7
@@
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. */
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. */
-
int read_file_contents (const char *filename, char *buf, in
t bufsize);
+
ssize_t read_file_contents (char const *filename, char *buf, size_
t bufsize);
counter_t counter_diff (counter_t old_value, counter_t new_value);
counter_t counter_diff (counter_t old_value, counter_t new_value);
@@
-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);
* 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 */
#endif /* COMMON_H */