X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=common.h;h=2b5662f6b5eb5a57d277b07e02c3bec0c6cdadfa;hb=a27a2222a526bfc8fde95d4f59e9e93bce322bfd;hp=01c8710eb010c4560af4880701e6049a5234c3a1;hpb=9e5770370bb085ccfb19f3dd14707542bf1475f1;p=collection4.git diff --git a/common.h b/common.h index 01c8710..2b5662f 100644 --- a/common.h +++ b/common.h @@ -1,16 +1,24 @@ #ifndef COMMON_H #define COMMON_H 1 -#define DATA_DIR "/var/lib/collectd/rrd" +#include +#include -typedef int (*callback_type_t) (const char *type, void *user_data); -typedef int (*callback_plugin_t) (const char *plugin, void *user_data); -typedef int (*callback_host_t) (const char *host, void *user_data); +int print_debug (const char *format, ...) + __attribute__((format(printf,1,2))); +#if 0 +# define DEBUG(...) print_debug (__VA_ARGS__) +#else +# define DEBUG(...) /**/ +#endif -int foreach_type (const char *host, const char *plugin, - callback_type_t, void *user_data); -int foreach_plugin (const char *host, callback_plugin_t, void *user_data); -int foreach_host (callback_host_t, void *user_data); +size_t c_strlcat (char *dst, const char *src, size_t size); +#define strlcat c_strlcat + +int ds_list_from_rrd_file (char *file, + size_t *ret_dses_num, char ***ret_dses); + +uint32_t get_random_color (void); #endif /* COMMON_H */ /* vim: set sw=2 sts=2 et fdm=marker : */