src/utils_avltree.[ch]: Rename all types and functions to use the prefix `c_avl_'.
[collectd.git] / src / common.h
index 6c097f6..f12b5e4 100644 (file)
 #define COMMON_H
 
 #include "collectd.h"
+#include "plugin.h"
+
+#if HAVE_PWD_H
+# include <pwd.h>
+#endif
 
 #define sfree(ptr) \
        if((ptr) != NULL) { \
@@ -143,6 +148,8 @@ int strjoin (char *dst, size_t dst_len, char **fields, size_t fields_num, const
  */
 int escape_slashes (char *buf, int buf_len);
 
+int strsubstitute (char *str, char c_from, char c_to);
+
 /* FIXME: `timeval_sub_timespec' needs a description */
 int timeval_sub_timespec (struct timeval *tv0, struct timeval *tv1, struct timespec *ret);
 
@@ -164,4 +171,14 @@ int format_name (char *ret, int ret_len,
        format_name (ret, ret_len, (vl)->host, (vl)->plugin, (vl)->plugin_instance, \
                        (ds)->type, (vl)->type_instance)
 
+int parse_identifier (char *str, char **ret_host,
+               char **ret_plugin, char **ret_plugin_instance,
+               char **ret_type, char **ret_type_instance);
+int parse_values (char *buffer, value_list_t *vl, const data_set_t *ds);
+
+#if !HAVE_GETPWNAM_R
+int getpwnam_r (const char *name, struct passwd *pwbuf, char *buf,
+               size_t buflen, struct passwd **pwbufp);
+#endif
+
 #endif /* COMMON_H */