#define zbx_bsearch(key, base, nmemb, size, compar) (0 == (nmemb) ? NULL : bsearch(key, base, nmemb, size, compar))
#ifndef ZABBIX_COMMON_H
#define ZABBIX_COMMON_H
#include "zbxsysinc.h"
#include "module.h"
#include "version.h"
#if defined(__MINGW32__)
# define __try
# define __except(x) if (0)
#endif
#ifndef va_copy
# if defined(__va_copy)
# define va_copy(d, s) __va_copy(d, s)
# else
# define va_copy(d, s) memcpy(&d, &s, sizeof(va_list))
# endif
#endif
#ifdef snprintf
# undef snprintf
#endif
#define snprintf ERROR_DO_NOT_USE_SNPRINTF_FUNCTION_TRY_TO_USE_ZBX_SNPRINTF
#ifdef sprintf
# undef sprintf
#endif
#define sprintf ERROR_DO_NOT_USE_SPRINTF_FUNCTION_TRY_TO_USE_ZBX_SNPRINTF
#ifdef strncpy
# undef strncpy
#endif
#define strncpy ERROR_DO_NOT_USE_STRNCPY_FUNCTION_TRY_TO_USE_ZBX_STRLCPY
#ifdef strcpy
# undef strcpy
#endif
#define strcpy ERROR_DO_NOT_USE_STRCPY_FUNCTION_TRY_TO_USE_ZBX_STRLCPY
#ifdef vsprintf
# undef vsprintf
#endif
#define vsprintf ERROR_DO_NOT_USE_VSPRINTF_FUNCTION_TRY_TO_USE_ZBX_VSNPRINTF
#ifdef strncat
# undef strncat
#endif
#define strncat ERROR_DO_NOT_USE_STRNCAT_FUNCTION_TRY_TO_USE_ZBX_STRLCAT
#ifdef strncasecmp
# undef strncasecmp
#endif
#define strncasecmp ERROR_DO_NOT_USE_STRNCASECMP_FUNCTION_TRY_TO_USE_ZBX_STRNCASECMP
#define ON 1
#define OFF 0
#if defined(_WINDOWS)
# pragma warning (disable: 4996)
#endif
#if defined(__GNUC__) && __GNUC__ >= 7
# define ZBX_FALLTHROUGH __attribute__ ((fallthrough))
#else
# define ZBX_FALLTHROUGH
#endif
#define SUCCEED_OR_FAIL(result) (FAIL != (result) ? SUCCEED : FAIL)
const char *zbx_sysinfo_ret_string(int ret);
const char *zbx_result_string(int result);
#define MAX_ID_LEN 21
#define MAX_STRING_LEN 2048
#define MAX_BUFFER_LEN 65536
#define ZBX_MAX_HOSTNAME_LEN 128
#define ZBX_HOSTNAME_BUF_LEN (ZBX_MAX_HOSTNAME_LEN + 1)