X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcommon.h;h=f12b5e4d73b659503e3f7d959e4e1fd4cbba1a3d;hb=79e5cac135349c56f26cd437dff6f865b8c4e949;hp=6c097f6c0ad3e454e7b288508b730e8102108d01;hpb=06adec208286b5a136ffa5c5f3832c35e9f62844;p=collectd.git diff --git a/src/common.h b/src/common.h index 6c097f6c..f12b5e4d 100644 --- a/src/common.h +++ b/src/common.h @@ -24,6 +24,11 @@ #define COMMON_H #include "collectd.h" +#include "plugin.h" + +#if HAVE_PWD_H +# include +#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 */