#define COMMON_H
#include "collectd.h"
+#include "plugin.h"
#define sfree(ptr) \
if((ptr) != NULL) { \
void sstrncpy(char *d, const char *s, int len);
char *sstrdup(const char *s);
void *smalloc(size_t size);
+char *sstrerror (int errnum, char *buf, size_t buflen);
/*
* NAME
*/
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);
unsigned long long ntohll (unsigned long long n);
unsigned long long htonll (unsigned long long n);
+int format_name (char *ret, int ret_len,
+ const char *hostname,
+ const char *plugin, const char *plugin_instance,
+ const char *type, const char *type_instance);
+#define FORMAT_VL(ret, ret_len, vl, ds) \
+ 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);
+
#endif /* COMMON_H */