X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fcommon.h;h=3d864f4244d6b31e2f1499ae2023baf432d601ce;hb=299a229c67fc74730317a4cf9a066de14ccf102c;hp=04521023cbff3f9e5dcf7dbf2536082de9ade417;hpb=9dce165013e612c83e15777af290f6d4f7e83350;p=netdata.git diff --git a/src/common.h b/src/common.h index 04521023..3d864f42 100644 --- a/src/common.h +++ b/src/common.h @@ -67,9 +67,9 @@ #include #include -#if !(defined(__FreeBSD__) || defined(__APPLE__)) +#ifdef HAVE_SYS_PRCTL_H #include -#endif /* __FreeBSD__ || __APPLE__*/ +#endif #include #include @@ -109,6 +109,10 @@ #include #endif +#ifdef HAVE_CAPABILITY +#include +#endif + // ---------------------------------------------------------------------------- // netdata common definitions @@ -164,6 +168,7 @@ // ---------------------------------------------------------------------------- // netdata include files +#include "simple_pattern.h" #include "avl.h" #include "clocks.h" #include "log.h" @@ -184,19 +189,22 @@ #if defined(__FreeBSD__) #include "plugin_freebsd.h" +#define NETDATA_OS_TYPE "freebsd" #elif defined(__APPLE__) #include "plugin_macos.h" +#define NETDATA_OS_TYPE "macos" #else #include "plugin_proc.h" #include "plugin_proc_diskspace.h" +#define NETDATA_OS_TYPE "linux" #endif /* __FreeBSD__, __APPLE__*/ -#include "plugin_tc.h" -#include "plugins_d.h" #include "socket.h" #include "eval.h" #include "health.h" #include "rrd.h" +#include "plugin_tc.h" +#include "plugins_d.h" #include "rrd2json.h" #include "web_client.h" #include "web_server.h" @@ -206,18 +214,29 @@ #include "unit_test.h" #include "ipc.h" #include "backends.h" +#include "inlined.h" +#include "adaptive_resortable_list.h" +#include "rrdpush.h" +#include "web_api_v1.h" +#include "web_api_old.h" + +extern char *netdata_configured_hostname; +extern char *netdata_configured_config_dir; +extern char *netdata_configured_log_dir; +extern char *netdata_configured_plugins_dir; +extern char *netdata_configured_web_dir; +extern char *netdata_configured_cache_dir; +extern char *netdata_configured_varlib_dir; +extern char *netdata_configured_home_dir; +extern char *netdata_configured_host_prefix; 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 uint32_t simple_uhash(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, ...) PRINTFLIKE(3, 4); @@ -249,7 +268,6 @@ extern int savememory(const char *filename, void *mem, size_t size); extern int fd_is_valid(int fd); -extern char *global_host_prefix; extern int enable_ksm; extern pid_t gettid(void); @@ -268,6 +286,10 @@ extern pid_t get_system_pid_max(void); extern unsigned int hz; extern void get_system_HZ(void); +extern volatile sig_atomic_t netdata_exit; +extern const char *os_type; + +extern const char *program_version; /* fix for alpine linux */ #ifndef RUSAGE_THREAD @@ -276,16 +298,4 @@ extern void get_system_HZ(void); #endif #endif -extern int read_single_number_file(const char *filename, unsigned long long *result); - -typedef enum { - NETDATA_SIMPLE_PATTERN_MODE_EXACT, - NETDATA_SIMPLE_PATTERN_MODE_PREFIX, - NETDATA_SIMPLE_PATTERN_MODE_SUFFIX, - NETDATA_SIMPLE_PATTERN_MODE_SUBSTRING -} NETDATA_SIMPLE_PREFIX_MODE; -typedef void NETDATA_SIMPLE_PATTERN; -extern NETDATA_SIMPLE_PATTERN *netdata_simple_pattern_list_create(const char *list, NETDATA_SIMPLE_PREFIX_MODE default_mode); -extern int netdata_simple_pattern_list_matches(NETDATA_SIMPLE_PATTERN *list, const char *str); - #endif /* NETDATA_COMMON_H */