summaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/common.h b/src/common.h
index e9987af72..c94f1cde5 100644
--- a/src/common.h
+++ b/src/common.h
@@ -1,5 +1,7 @@
+#include <stdarg.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <stdio.h>
#ifndef NETDATA_COMMON_H
#define NETDATA_COMMON_H 1
@@ -15,13 +17,18 @@
#define abs(x) ((x < 0)? -x : x)
#define usecdiff(now, last) (((((now)->tv_sec * 1000000ULL) + (now)->tv_usec) - (((last)->tv_sec * 1000000ULL) + (last)->tv_usec)))
-extern void netdata_fix_id(char *s);
+extern void netdata_fix_chart_id(char *s);
+extern void netdata_fix_chart_name(char *s);
extern uint32_t simple_hash(const char *name);
extern void strreverse(char* begin, char* end);
extern char *mystrsep(char **ptr, char *s);
extern char *trim(char *s);
+extern char *strncpyz(char *dst, const char *src, size_t n);
+extern int vsnprintfz(char *dst, size_t n, const char *fmt, va_list args);
+extern int snprintfz(char *dst, size_t n, const char *fmt, ...);
+
extern void *mymmap(const char *filename, size_t size, int flags, int ksm);
extern int savememory(const char *filename, void *mem, unsigned long size);
@@ -31,12 +38,15 @@ extern char *global_host_prefix;
extern int enable_ksm;
/* Number of ticks per second */
-#define HZ myhz
extern unsigned int hz;
extern void get_HZ(void);
extern pid_t gettid(void);
+extern unsigned long long timems(void);
+
+extern char *fgets_trim_len(char *buf, size_t buf_size, FILE *fp, size_t *len);
+
/* fix for alpine linux */
#ifndef RUSAGE_THREAD
#ifdef RUSAGE_CHILDREN