X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcommon.h.in;h=09df00dd5c42d43e6a918e410106c4530cc002e1;hb=7ceff0d5a95f5c5f34235ef6682595f169864d2f;hp=9cb4bcbbd8ef91bf825d24357c756078b7793d59;hpb=44a321cb8a42d6c0ea2d96a1086a17f2134c89cc;p=nagiosplug.git diff --git a/plugins/common.h.in b/plugins/common.h.in index 9cb4bcb..09df00d 100644 --- a/plugins/common.h.in +++ b/plugins/common.h.in @@ -66,12 +66,19 @@ #include #endif -/* #ifdef HAVE_GETOPT_H */ +/* TODO: define can be removed when all ifdef in each plugin has been removed */ +#define HAVE_GETOPT_H #include -/* #endif */ #include +#if HAVE_LWRES_NETDB_H +#include +#elif !HAVE_GETADDRINFO +#include "getaddrinfo.h" +#else +#include +#endif /* * @@ -87,6 +94,22 @@ # define strtoul(a,b,c) (unsigned long)atol((a)) #endif +#ifndef HAVE_ASPRINTF +int asprintf(char **strp, const char *fmt, ...); +#endif + +#ifndef HAVE_VASPRINTF +/* int vasprintf(char **strp, const char *fmt, va_list ap); */ +#endif + +#ifndef HAVE_SNPRINTF +int snprintf(char *str, size_t size, const char *format, ...); +#endif + +#ifndef HAVE_VSNPRINTF +int vsnprintf(char *str, size_t size, const char *format, va_list ap); +#endif + /* * * Standard Values @@ -102,8 +125,8 @@ #define STATE_CRITICAL 2 /* service state return codes */ #define STATE_WARNING 1 #define STATE_OK 0 -#define STATE_UNKNOWN -1 -#define STATE_DEPENDENT -2 +#define STATE_UNKNOWN 3 +#define STATE_DEPENDENT 4 #define DEFAULT_SOCKET_TIMEOUT 10 /* timeout after 10 seconds */