123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- #ifndef RSPAMD_CONFIG_H_IN
- #define RSPAMD_CONFIG_H_IN
-
- #cmakedefine BUILD_STATIC 1
- #cmakedefine CURL_FOUND 1
- #cmakedefine DEBUG_MODE 1
- #cmakedefine GIT_VERSION 1
- #cmakedefine GLIB_COMPAT 1
- #cmakedefine GLIB_HASH_COMPAT 1
- #cmakedefine GLIB_RE_COMPAT 1
- #cmakedefine GLIB_UNISCRIPT_COMPAT 1
- #cmakedefine GMIME24 1
- #cmakedefine HAVE_AIO_H 1
- #cmakedefine HAVE_ARPA_INET_H 1
- #cmakedefine HAVE_ASM_PAUSE 1
- #cmakedefine HAVE_ATOMIC_BUILTINS 1
- #cmakedefine HAVE_CLOCK_GETTIME 1
- #cmakedefine HAVE_CLOCK_PROCESS_CPUTIME_ID 1
- #cmakedefine HAVE_CLOCK_VIRTUAL 1
- #cmakedefine HAVE_COMPATIBLE_QUEUE_H 1
- #cmakedefine HAVE_CPUID_H 1
- #cmakedefine HAVE_CTYPE_H 1
- #cmakedefine HAVE_DIRENT_H 1
- #cmakedefine HAVE_ENDIAN_H 1
- #cmakedefine HAVE_EXP2L 1
- #cmakedefine HAVE_EXPL 1
- #cmakedefine HAVE_EXPLICIT_BZERO 1
- #cmakedefine HAVE_FADVISE 1
- #cmakedefine HAVE_FALLOCATE 1
- #cmakedefine HAVE_FCNTL_H 1
- #cmakedefine HAVE_FDATASYNC 1
- #cmakedefine HAVE_FETCH_H 1
- #cmakedefine HAVE_FLOCK 1
- #cmakedefine HAVE_GETPAGESIZE 1
- #cmakedefine HAVE_GET_CPUID 1
- #cmakedefine HAVE_GLOB_H 1
- #cmakedefine HAVE_GRP_H 1
- #cmakedefine HAVE_INET_PTON 1
- #cmakedefine HAVE_INTTYPES_H 1
- #cmakedefine HAVE_IPV6_V6ONLY 1
- #cmakedefine HAVE_LIBAIO_H 1
- #cmakedefine HAVE_LIBGEN_H 1
- #cmakedefine HAVE_LIBUTIL_H 1
- #cmakedefine HAVE_LOCALE_H 1
- #cmakedefine HAVE_MACHINE_ENDIAN_H 1
- #cmakedefine HAVE_MATH_H 1
- #cmakedefine HAVE_MAXPATHLEN 1
- #cmakedefine HAVE_MEMSET_S 1
- #cmakedefine HAVE_MKSTEMP 1
- #cmakedefine HAVE_MMAP_ANON 1
- #cmakedefine HAVE_MMAP_NOCORE 1
- #cmakedefine HAVE_MMAP_SHARED 1
- #cmakedefine HAVE_NANOSLEEP 1
- #cmakedefine HAVE_NETDB_H 1
- #cmakedefine HAVE_NETINET_IN_H 1
- #cmakedefine HAVE_NFTW 1
- #cmakedefine HAVE_OASYNC 1
- #cmakedefine HAVE_OPENSSL 1
- #cmakedefine HAVE_O_DIRECT 1
- #cmakedefine HAVE_PATH_MAX 1
- #cmakedefine HAVE_PCRE_JIT 1
- #cmakedefine HAVE_PCRE_JIT_FAST 1
- #cmakedefine HAVE_PIDFILE 1
- #cmakedefine HAVE_PIDFILE_FILENO 1
- #cmakedefine HAVE_POLL_H 1
- #cmakedefine HAVE_POSIX_FALLOCATE 1
- #cmakedefine HAVE_PTHREAD_PROCESS_SHARED 1
- #cmakedefine HAVE_PWD_H 1
- #cmakedefine HAVE_READPASSPHRASE_H 1
- #cmakedefine HAVE_SA_SIGINFO 1
- #cmakedefine HAVE_SCHED_YEILD 1
- #cmakedefine HAVE_SC_NPROCESSORS_ONLN 1
- #cmakedefine HAVE_SEARCH_H 1
- #cmakedefine HAVE_SENDFILE 1
- #cmakedefine HAVE_SETITIMER 1
- #cmakedefine HAVE_SETPROCTITLE 1
- #cmakedefine HAVE_SETSIG 1
- #cmakedefine HAVE_SIGINFO_H 1
- #cmakedefine HAVE_SOCK_SEQPACKET 1
- #cmakedefine HAVE_STDBOOL_H 1
- #cmakedefine HAVE_STDINT_H 1
- #cmakedefine HAVE_STDIO_H 1
- #cmakedefine HAVE_STDLIB_H 1
- #cmakedefine HAVE_STRINGS_H 1
- #cmakedefine HAVE_STRING_H 1
- #cmakedefine HAVE_STROPS_H 1
- #cmakedefine HAVE_SYSEXITS_H 1
- #cmakedefine HAVE_SYSLOG_H 1
- #cmakedefine HAVE_SYS_CDEFS_H 1
- #cmakedefine HAVE_SYS_ENDIAN_H 1
- #cmakedefine HAVE_SYS_EVENTFD_H 1
- #cmakedefine HAVE_SYS_FILE_H 1
- #cmakedefine HAVE_SYS_IOCTL_H 1
- #cmakedefine HAVE_SYS_MMAN_H 1
- #cmakedefine HAVE_SYS_PARAM_H 1
- #cmakedefine HAVE_SYS_QUEUE_H 1
- #cmakedefine HAVE_SYS_RESOURCE_H 1
- #cmakedefine HAVE_SYS_SENDFILE_H 1
- #cmakedefine HAVE_SYS_SOCKET_H 1
- #cmakedefine HAVE_SYS_STAT_H 1
- #cmakedefine HAVE_SYS_TIMEB_H 1
- #cmakedefine HAVE_SYS_TIME_H 1
- #cmakedefine HAVE_SYS_TYPES_H 1
- #cmakedefine HAVE_SYS_UIO_H 1
- #cmakedefine HAVE_SYS_UN_H 1
- #cmakedefine HAVE_SYS_UTSNAME_H 1
- #cmakedefine HAVE_SYS_WAIT_H 1
- #cmakedefine HAVE_TANH 1
- #cmakedefine HAVE_TANHL 1
- #cmakedefine HAVE_TERMIOS_H 1
- #cmakedefine HAVE_TIME_H 1
- #cmakedefine HAVE_UNISTD_H 1
- #cmakedefine HAVE_VFORK 1
- #cmakedefine HAVE_WAIT4 1
- #cmakedefine HAVE_WAITPID 1
- #cmakedefine HAVE_WEAK_SYMBOLS 1
- #cmakedefine LIBEVENT_EVHTTP 1
- #cmakedefine PARAM_H_HAS_BITSET 1
- #cmakedefine WITH_DB 1
- #cmakedefine WITH_FANN 1
- #cmakedefine WITH_GPERF_TOOLS 1
- #cmakedefine WITH_HIREDIS 1
- #cmakedefine WITH_HYPERSCAN 1
- #cmakedefine WITH_JUDY 1
- #cmakedefine WITH_LUA 1
- #cmakedefine WITH_PROFILER 1
- #cmakedefine WITH_SNOWBALL 1
- #cmakedefine WITH_SQLITE 1
- #cmakedefine WITH_SYSTEM_HIREDIS 1
-
- /* Detect endiannes */
-
- #ifdef HAVE_ENDIAN_H
- #include <endian.h>
- #elif defined(HAVE_SYS_ENDIAN_H)
- #include <sys/endian.h>
- #elif defined(HAVE_MACHINE_ENDIAN_H)
- #include <machine/endian.h>
- #endif
-
- #ifndef BYTE_ORDER
-
- #ifndef LITTLE_ENDIAN
- #define LITTLE_ENDIAN 1234
- #endif
- #ifndef BIG_ENDIAN
- #define BIG_ENDIAN 4321
- #endif
-
- #if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \
- defined(__BIG_ENDIAN__) || \
- defined(__ARMEB__) || \
- defined(__THUMBEB__) || \
- defined(__AARCH64EB__) || \
- defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)
- #define BYTE_ORDER BIG_ENDIAN
- #elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \
- defined(__LITTLE_ENDIAN__) || \
- defined(__ARMEL__) || \
- defined(__THUMBEL__) || \
- defined(__AARCH64EL__) || \
- defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
- #define BYTE_ORDER LITTLE_ENDIAN
- #else
- #error "I don't know what architecture this is!"
- #endif
-
- #endif /* BYTE_ORDER */
-
- /* Configure allocator */
- #define uthash_malloc(sz) g_slice_alloc(sz)
- #define uthash_free(ptr,sz) g_slice_free1(sz, ptr)
-
- #define RSPAMD_CONFDIR "${CONFDIR}"
- #define RSPAMD_RUNDIR "${RUNDIR}"
- #define RSPAMD_LOGDIR "${LOGDIR}"
- #define RSPAMD_DBDIR "${DBDIR}"
- #define RSPAMD_EXAMPLESDIR "${EXAMPLESDIR}"
- #define RSPAMD_PLUGINSDIR "${PLUGINSDIR}"
- #define RSPAMD_RULESDIR "${RULESDIR}"
- #define RSPAMD_WWWDIR "${WWWDIR}"
- #define RSPAMD_PREFIX "${CMAKE_INSTALL_PREFIX}"
-
-
- #ifdef GIT_VERSION
- # define RVERSION "${RSPAMD_VERSION}"
- # define RID "${RSPAMD_ID}"
- #else
- # define RVERSION "${RSPAMD_VERSION}"
- # define RID "release"
- #endif
-
- #define RSPAMD_MASTER_SITE_URL "${RSPAMD_MASTER_SITE_URL}"
-
- #define MODULES_NUM ${RSPAMD_MODULES_NUM}
-
- #define BUILDROOT "${CMAKE_BINARY_DIR}"
-
- /* sys/types */
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
-
- /* cdefs */
- #ifdef HAVE_SYS_CDEFS_H
- #include <sys/cdefs.h>
- #endif
-
- /* sys/param */
- #ifdef HAVE_SYS_PARAM_H
- #include <sys/param.h>
- #endif
-
- /* stdint */
- #ifdef HAVE_STDINT_H
- #include <stdint.h>
- #elif defined(HAVE_INTTYPES_H)
- #include <inttypes.h>
- #endif
-
- /* stdbool */
- #ifdef HAVE_STDBOOL_H
- #include <stdbool.h>
- #endif
-
- /* stdlib */
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
-
- /* stdio */
- #ifdef HAVE_STDIO_H
- #include <stdio.h>
- #endif
-
- /* time */
- #ifdef HAVE_TIME_H
- #include <time.h>
- #endif
-
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
-
- /* string */
- #ifdef HAVE_STRING_H
- #include <string.h>
- #endif
-
- #ifdef HAVE_STRINGS_H
- #include <strings.h>
- #endif
-
- #include <errno.h>
-
- #include <glib.h>
-
-
- #ifdef GLIB_RE_COMPAT
- #include "gregex.h"
- #endif
- #ifdef GLIB_UNISCRIPT_COMPAT
- #include "guniscript.h"
- #endif
- #ifdef GLIB_COMPAT
- #include "gchecksum.h"
- #endif
-
- #if (GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 14)
- typedef off_t goffset;
- #endif
-
- #ifndef PARAM_H_HAS_BITSET
- /* Bit map related macros. */
- #ifndef NBBY
- # define NBBY 8 /* number of bits in a byte */
- #endif
- #define setbit(a, \
- i) (((unsigned char *)(a))[(i) / NBBY] |= 1 << ((i) % NBBY))
- #define clrbit(a, \
- i) (((unsigned char *)(a))[(i) / NBBY] &= ~(1 << ((i) % NBBY)))
- #define isset(a,i) \
- (((const unsigned char *)(a))[(i) / NBBY] & (1 << ((i) % NBBY)))
- #define isclr(a,i) \
- ((((const unsigned char *)(a))[(i) / NBBY] & (1 << ((i) % NBBY))) == 0)
- #endif
-
- #ifdef _MSC_VER
- # define RSPAMD_PACKED(name) \
- __pragma(pack(push, 1)) struct name __pragma(pack(pop))
- #elif defined(__GNUC__)
- # define RSPAMD_PACKED(name) struct __attribute__((packed)) name
- #else
- # define RSPAMD_PACKED(name) struct name
- #endif
-
- #ifndef RSPAMD_ALIGNED
- #if defined(_MSC_VER)
- # define RSPAMD_ALIGNED(x) __declspec(align(x))
- #elif defined(__GNUC__)
- # define RSPAMD_ALIGNED(x) __attribute__((aligned(x)))
- #else
- # define RSPAMD_ALIGNED(x)
- #endif
- #endif
-
- #ifndef BITSPERBYTE
- # define BITSPERBYTE (NBBY * sizeof (char))
- #endif
- #ifndef NBYTES
- # define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE)
- #endif
-
- extern uint64_t ottery_rand_uint64(void);
- #define UCL_RANDOM_FUNCTION ottery_rand_uint64()
-
- #endif
|