PageRenderTime 28ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/src/magma.h

https://gitlab.com/drwdal/magma
C Header | 531 lines | 97 code | 28 blank | 406 comment | 0 complexity | c62b7d32f4f3987e81ee38a40f988b95 MD5 | raw file
  1. /**
  2. * @file /magma/magma.h
  3. *
  4. * @brief The global include file. This header includes both system headers and Magma module headers.
  5. *
  6. * $Author$
  7. * $Date$
  8. * $Revision$
  9. *
  10. */
  11. #ifndef MAGMA_H
  12. #define MAGMA_H
  13. #define __USE_GNU
  14. #include <stdlib.h>
  15. #include <stdio.h>
  16. #include <unistd.h>
  17. #include <stddef.h>
  18. #include <limits.h>
  19. #include <signal.h>
  20. #include <string.h>
  21. #include <dirent.h>
  22. #include <time.h>
  23. #include <pwd.h>
  24. #include <errno.h>
  25. #include <fcntl.h>
  26. #include <inttypes.h>
  27. #include <pthread.h>
  28. #include <stdarg.h>
  29. #include <dlfcn.h>
  30. #include <execinfo.h>
  31. #include <stdbool.h>
  32. #include <sys/types.h>
  33. #include <sys/stat.h>
  34. #include <sys/resource.h>
  35. #include <sys/time.h>
  36. #include <sys/socket.h>
  37. #include <sys/utsname.h>
  38. #include <sys/epoll.h>
  39. #include <netinet/in.h>
  40. #include <arpa/inet.h>
  41. #include <arpa/nameser.h>
  42. #include <netdb.h>
  43. #include <resolv.h>
  44. #include <regex.h>
  45. #include <ftw.h>
  46. #include <search.h>
  47. #include <semaphore.h>
  48. #include <sys/mman.h>
  49. // GNU C Library
  50. #include <gnu/libc-version.h>
  51. // SPF
  52. #include <spf.h>
  53. #include <spf_dns_zone.h>
  54. // ClamAV
  55. #include <clamav.h>
  56. // MySQL
  57. #include <mysql.h>
  58. // OpenSSL
  59. #include <openssl/conf.h>
  60. #include <openssl/ssl.h>
  61. #include <openssl/crypto.h>
  62. #include <openssl/rand.h>
  63. #include <openssl/engine.h>
  64. #include <openssl/x509.h>
  65. #include <openssl/x509v3.h>
  66. #include <openssl/ec.h>
  67. #include <openssl/dh.h>
  68. #include <openssl/err.h>
  69. // LZO
  70. #include <lzo/lzoconf.h>
  71. #include <lzo/lzodefs.h>
  72. #include <lzo/lzoutil.h>
  73. #include <lzo/lzo1x.h>
  74. // XML2
  75. #include <libxml/xmlmemory.h>
  76. #include <libxml/tree.h>
  77. #include <libxml/valid.h>
  78. #include <libxml/xpath.h>
  79. #include <libxml/xpathInternals.h>
  80. #include <libxml/parserInternals.h>
  81. #include <libxml/xmlerror.h>
  82. // ZLIB
  83. #include <zlib.h>
  84. // BZIP
  85. #include <bzlib.h>
  86. // TOKYO
  87. #include <tcutil.h>
  88. #include <tcadb.h>
  89. #include <tchdb.h>
  90. #include <tcbdb.h>
  91. // Memcached
  92. #include <libmemcached/memcached.h>
  93. // DKIM
  94. #define lint
  95. #include <dkim.h>
  96. #undef lint
  97. // DSPAM
  98. #define CONFIG_DEFAULT ""
  99. #define LOGDIR "~/"
  100. #include <libdspam.h>
  101. #include <mysql_drv.h>
  102. // Jansson
  103. #include <jansson.h>
  104. // GD
  105. #include <gd.h>
  106. // PNG
  107. #include <png.h>
  108. // JPEG
  109. #include <jpeglib.h>
  110. // FreeType
  111. #include <ft2build.h>
  112. #include FT_FREETYPE_H
  113. #include "core/core.h"
  114. #include "providers/providers.h"
  115. #include "engine/engine.h"
  116. #include "network/network.h"
  117. #include "objects/objects.h"
  118. #include "servers/servers.h"
  119. #include "web/web.h"
  120. #include "queries.h"
  121. extern magma_t magma;
  122. extern __thread char threadBuffer[1024];
  123. #define bufptr (char *)&(threadBuffer)
  124. #define buflen sizeof(threadBuffer)
  125. /*
  126. #define HAVE_ABI_CXA_DEMANGLE 1
  127. #define HAVE_ACCESS 1
  128. #define HAVE_AIO_H 1
  129. #define HAVE_ALARM 1
  130. #define HAVE_ALLOCA 1
  131. #define HAVE_ALLOCA_H 1
  132. #define HAVE_ANSIDECL_H 1
  133. #define HAVE_ARPA_INET_H 1
  134. #define HAVE_ARPA_NAMESER_H 1
  135. #define HAVE_ASM_TERMBITS_H 1
  136. #define HAVE_ASSERT_H 1
  137. #define HAVE_ATEXIT 1
  138. #define HAVE_ATOI 1
  139. #define HAVE_ATOL 1
  140. #define HAVE_BACKTRACE 1
  141. #define HAVE_BACKTRACE_SYMBOLS 1
  142. #define HAVE_BACKTRACE_SYMBOLS_FD 1
  143. #define HAVE_BOOL 1
  144. #define HAVE_BSEARCH 1
  145. #define HAVE_BSS_START 1
  146. #define HAVE_BZERO 1
  147. #define HAVE_CEILF 1
  148. #define HAVE_CHARSET_armscii8 1
  149. #define HAVE_CHARSET_ascii 1
  150. #define HAVE_CHARSET_big5 1
  151. #define HAVE_CHARSET_cp1250 1
  152. #define HAVE_CHARSET_cp1251 1
  153. #define HAVE_CHARSET_cp1256 1
  154. #define HAVE_CHARSET_cp1257 1
  155. #define HAVE_CHARSET_cp850 1
  156. #define HAVE_CHARSET_cp852 1
  157. #define HAVE_CHARSET_cp866 1
  158. #define HAVE_CHARSET_cp932 1
  159. #define HAVE_CHARSET_dec8 1
  160. #define HAVE_CHARSET_eucjpms 1
  161. #define HAVE_CHARSET_euckr 1
  162. #define HAVE_CHARSET_gb2312 1
  163. #define HAVE_CHARSET_gbk 1
  164. #define HAVE_CHARSET_geostd8 1
  165. #define HAVE_CHARSET_greek 1
  166. #define HAVE_CHARSET_hebrew 1
  167. #define HAVE_CHARSET_hp8 1
  168. #define HAVE_CHARSET_keybcs2 1
  169. #define HAVE_CHARSET_koi8r 1
  170. #define HAVE_CHARSET_koi8u 1
  171. #define HAVE_CHARSET_latin1 1
  172. #define HAVE_CHARSET_latin2 1
  173. #define HAVE_CHARSET_latin5 1
  174. #define HAVE_CHARSET_latin7 1
  175. #define HAVE_CHARSET_macce 1
  176. #define HAVE_CHARSET_macroman 1
  177. #define HAVE_CHARSET_sjis 1
  178. #define HAVE_CHARSET_swe7 1
  179. #define HAVE_CHARSET_tis620 1
  180. #define HAVE_CHARSET_ucs2 1
  181. #define HAVE_CHARSET_ujis 1
  182. #define HAVE_CHARSET_utf8 1
  183. #define HAVE_CHMOD 1
  184. #define HAVE_CHOWN 1
  185. #define HAVE_C_INLINE
  186. #define HAVE_CLOCK_GETTIME 1
  187. #define HAVE_COMPRESS 1
  188. #define HAVE_CRYPT 1
  189. #define HAVE_CRYPT_H 1
  190. #define HAVE_CTIME 1
  191. #define HAVE_CTYPE_H 1
  192. #define HAVE_CURSES_H 1
  193. #define HAVE_CUSERID 1
  194. #define HAVE_CXXABI_H 1
  195. #define HAVE_DECL_BZERO 1
  196. #define HAVE_DECL_FDATASYNC 1
  197. #define HAVE_DECL_MADVISE 1
  198. #define HAVE_DECL_NS_T_INVALID 1
  199. #define HAVE_DECL_NS_T_SPF 0
  200. #define HAVE_DECL_RES_NDESTROY 0
  201. #define HAVE_DECL_RES_NINIT 1
  202. #define HAVE_DECL_SHM_HUGETLB 1
  203. #define HAVE_DECL_TGOTO 1
  204. #define HAVE_DIFFTIME 1
  205. #define HAVE_DIRENT_H 1
  206. #define HAVE_DLERROR 1
  207. #define HAVE_DLFCN_H 1
  208. #define HAVE_DLOPEN
  209. #define HAVE_ERRNO_H 1
  210. #define HAVE_EVENT_BASE_FREE 1
  211. #define HAVE_EVENT_BASE_GET_METHOD 1
  212. #define HAVE_EVENT_BASE_NEW 1
  213. #define HAVE_EXECINFO_H 1
  214. #define HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 1
  215. #define HAVE_FCHMOD 1
  216. #define HAVE_FCNTL 1
  217. #define HAVE_FCNTL_H 1
  218. #define HAVE_FDATASYNC 1
  219. #define HAVE_FEDISABLEEXCEPT 1
  220. #define HAVE_FENV_H 1
  221. #define HAVE_FESETROUND 1
  222. #define HAVE_FINITE 1
  223. #define HAVE_FLOAT_H 1
  224. #define HAVE_FLOCKFILE 1
  225. #define HAVE_FLOORF 1
  226. #define HAVE_FNMATCH_H 1
  227. #define HAVE_FORK 1
  228. #define HAVE_FPRINTF 1
  229. #define HAVE_FPU_CONTROL_H 1
  230. #define HAVE_FSTAT 1
  231. #define HAVE_FSYNC 1
  232. #define HAVE_FT2BUILD_H 1
  233. #define HAVE_FTIME 1
  234. #define HAVE_FTRUNCATE 1
  235. #define HAVE_GCC_ATOMIC_BUILTINS 1
  236. #define HAVE_GETADDRINFO
  237. #define HAVE_GETCWD 1
  238. #define HAVE_GETEGID 1
  239. #define HAVE_GETENV 1
  240. #define HAVE_GETEUID 1
  241. #define HAVE_GETGID 1
  242. #define HAVE_GETHOSTBYADDR_R 1
  243. #define HAVE_GETHOSTBYNAME 1
  244. #define HAVE_GETHOSTBYNAME_R 1
  245. #define HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1
  246. #define HAVE_GETHOSTNAME 1
  247. #define HAVE_GETLINE 1
  248. #define HAVE_GETOPT_H 1
  249. #define HAVE_GETOPT_LONG_ONLY 1
  250. #define HAVE_GETPAGESIZE 1
  251. #define HAVE_GETPASS 1
  252. #define HAVE_GETPWNAM 1
  253. #define HAVE_GETPWUID 1
  254. #define HAVE_GETRLIMIT 1
  255. #define HAVE_GETRUSAGE 1
  256. #define HAVE_GETTIMEOFDAY 1
  257. #define HAVE_GETUID 1
  258. #define HAVE_GETWD 1
  259. #define HAVE_GMTIME 1
  260. #define HAVE_GMTIME_R 1
  261. #define HAVE_GRP_H 1
  262. #define HAVE_IB_ATOMIC_PTHREAD_T_GCC 1
  263. #define HAVE_IB_GCC_ATOMIC_BUILTINS 1
  264. #define HAVE_IB_PAUSE_INSTRUCTION 1
  265. #define HAVE_ICONV 1
  266. #define HAVE_ICONV_H 1
  267. #define HAVE_ICONV_T_DEF 1
  268. #define HAVE_IN_ADDR_T 1
  269. #define HAVE_INDEX 1
  270. #define HAVE_INET_NTOA 1
  271. #define HAVE_INITGROUPS 1
  272. #define HAVE_INTTYPES_H 1
  273. #define HAVE_ISATTY 1
  274. #define HAVE_ISINF 1
  275. #define HAVE_ISNAN 1
  276. #define HAVE_ISWCTYPE 1
  277. #define HAVE_ISWLOWER 1
  278. #define HAVE_ISWUPPER 1
  279. #define HAVE_LANGINFO_CODESET
  280. #define HAVE_LANGINFO_H 1
  281. #define HAVE_LARGE_PAGES 1
  282. #define HAVE_LIBDL 1
  283. #define HAVE_LIBEVENT 1
  284. #define HAVE_LIBFREETYPE 1
  285. #define HAVE_LIBINTL_H 1
  286. #define HAVE_LIBJPEG 1
  287. #define HAVE_LIBM 1
  288. #define HAVE_LIBMEMCACHED 1
  289. #define HAVE_LIBMEMCACHEDUTIL 1
  290. #define HAVE_LIBNSL 1
  291. #define HAVE_LIBPNG 1
  292. #define HAVE_LIBPTHREAD 1
  293. #define HAVE_LIBZ 1
  294. #define HAVE_LIMITS_H 1
  295. #define HAVE_LOCALE_H 1
  296. #define HAVE_LOCALTIME 1
  297. #define HAVE_LOCALTIME_R 1
  298. #define HAVE_LONGJMP 1
  299. #define HAVE_LONG_LONG_INT 1
  300. #define HAVE_LRAND48 1
  301. #define HAVE_LSTAT 1
  302. #define HAVE_MADVISE 1
  303. #define HAVE_MALLINFO 1
  304. #define HAVE_MALLOC 1
  305. #define HAVE_MALLOC_H 1
  306. #define HAVE_MATH_H 1
  307. #define HAVE_MBRLEN
  308. #define HAVE_MBRTOWC
  309. #define HAVE_MBSRTOWCS
  310. #define HAVE_MBSTATE_T
  311. #define HAVE_MEMCMP 1
  312. #define HAVE_MEMCPY 1
  313. #define HAVE_MEMMOVE 1
  314. #define HAVE_MEMORY_H 1
  315. #define HAVE_MEMSET 1
  316. #define HAVE_MKDIR 1
  317. #define HAVE_MKSTEMP 1
  318. #define HAVE_MKTIME 1
  319. #define HAVE_MLOCKALL 1
  320. #define HAVE_MMAP 1
  321. #define HAVE_MMAP64 1
  322. #define HAVE_MODE_T
  323. #define HAVE_MPROTECT 1
  324. #define HAVE_MSG_DONTWAIT 1
  325. #define HAVE_MSG_MORE 1
  326. #define HAVE_MSG_NOSIGNAL 1
  327. #define HAVE_MUNMAP 1
  328. #define HAVE_MURMUR_HASH 1
  329. #define HAVE_NETDB_H 1
  330. #define HAVE_NETINET_IN_H 1
  331. #define HAVE_NPTL 1
  332. #define HAVE_OFF_T 1
  333. #define HAVE_PATHS_H 1
  334. #define HAVE_PERROR 1
  335. #define HAVE_PNG_H 1
  336. #define HAVE_POLL 1
  337. #define HAVE_POLL_H 1
  338. #define HAVE_POSIX_FALLOCATE 1
  339. #define HAVE_POSIX_SIGNALS 1
  340. #define HAVE_PREAD 1
  341. #define HAVE_PRINTF 1
  342. #define HAVE_PTHREAD 1
  343. #define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
  344. #define HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1
  345. #define HAVE_PTHREAD_ATTR_SETSCOPE 1
  346. #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
  347. #define HAVE_PTHREAD_H 1
  348. #define HAVE_PTHREAD_KEY_DELETE 1
  349. #define HAVE_PTHREAD_RWLOCK_RDLOCK 1
  350. #define HAVE_PTHREAD_SETSCHEDPARAM 1
  351. #define HAVE_PTHREAD_SETSCHEDPRIO 1
  352. #define HAVE_PTHREAD_SIGMASK 1
  353. #define HAVE_PTHREAD_YIELD_ZERO_ARG 1
  354. #define HAVE_PUTENV 1
  355. #define HAVE_PWD_H 1
  356. #define HAVE_QSORT 1
  357. #define HAVE_QUERY_CACHE 1
  358. #define HAVE_RAISE 1
  359. #define HAVE_RCVTIMEO 1
  360. #define HAVE_READDIR_R 1
  361. #define HAVE_READLINK 1
  362. #define HAVE_REALLOC 1
  363. #define HAVE_REALPATH 1
  364. #define HAVE_RE_COMP 1
  365. #define HAVE_REGCOMP 1
  366. #define HAVE_RENAME 1
  367. #define HAVE_RESOLV_H 1
  368. #define HAVE_RESTARTABLE_SYSCALLS 1
  369. #define HAVE_RINT 1
  370. #define HAVE_RMDIR 1
  371. #define HAVE_RTREE_KEYS 1
  372. #define HAVE_SCHED_H 1
  373. #define HAVE_SCHED_YIELD 1
  374. #define HAVE_SELECT 1
  375. #define HAVE_SEMAPHORE_H 1
  376. #define HAVE_SETENV 1
  377. #define HAVE_SETJMP 1
  378. #define HAVE_SETJMP_H 1
  379. #define HAVE_SETLOCALE 1
  380. #define HAVE_SHMAT 1
  381. #define HAVE_SHMCTL 1
  382. #define HAVE_SHMDT 1
  383. #define HAVE_SHMGET 1
  384. #define HAVE_SIGACTION 1
  385. #define HAVE_SIGADDSET 1
  386. #define HAVE_SIGEMPTYSET 1
  387. #define HAVE_SIGHOLD 1
  388. #define HAVE_SIGNAL 1
  389. #define HAVE_SIGNAL_H 1
  390. #define HAVE_SIGSET 1
  391. #define HAVE_SIGSET_T 1
  392. #define HAVE_SIGWAIT 1
  393. #define HAVE_SIZE_T 1
  394. #define HAVE_SLEEP 1
  395. #define HAVE_SNDTIMEO 1
  396. #define HAVE_SNPRINTF 1
  397. #define HAVE_SOCKET 1
  398. #define HAVE_SPATIAL 1
  399. #define HAVE_SPRINTF 1
  400. #define HAVE_SSCANF 1
  401. #define HAVE_STAT 1
  402. #define HAVE_STDARG_H 1
  403. #define HAVE_STDDEF_H 1
  404. #define HAVE_STDINT_H 1
  405. #define HAVE_STDIO_H 1
  406. #define HAVE_STDLIB_H 1
  407. #define HAVE_STPCPY 1
  408. #define HAVE_STRCASECMP 1
  409. #define HAVE_STRCHR 1
  410. #define HAVE_STRCOLL 1
  411. #define HAVE_STRCSPN 1
  412. #define HAVE_ST_RDEV 1
  413. #define HAVE_STRDUP 1
  414. #define HAVE_STRERROR 1
  415. #define HAVE_STRERROR_S 1
  416. #define HAVE_STRFTIME 1
  417. #define HAVE_STRING_H 1
  418. #define HAVE_STRINGS_H 1
  419. #define HAVE_STRNCASECMP 1
  420. #define HAVE_STRNDUP 1
  421. #define HAVE_STRNLEN 1
  422. #define HAVE_STRPBRK 1
  423. #define HAVE_STRRCHR 1
  424. #define HAVE_STRSIGNAL 1
  425. #define HAVE_STRSPN 1
  426. #define HAVE_STRSTR 1
  427. #define HAVE_STRTOK_R 1
  428. #define HAVE_STRTOL 1
  429. #define HAVE_STRTOLL 1
  430. #define HAVE_STRTOUL 1
  431. #define HAVE_STRTOULL 1
  432. #define HAVE_STRUCT_IN6_ADDR 1
  433. #define HAVE_STRUCT_STAT_ST_RDEV 1
  434. #define HAVE_STRUCT_TIMESPEC
  435. #define HAVE_SYS_CDEFS_H 1
  436. #define HAVE_SYS_DIR_H 1
  437. #define HAVE_SYS_FILE_H 1
  438. #define HAVE_SYS_IOCTL_H 1
  439. #define HAVE_SYS_IPC_H 1
  440. #define HAVE_SYSLOG_H 1
  441. #define HAVE_SYS_MMAN_H 1
  442. #define HAVE_SYS_PARAM_H 1
  443. #define HAVE_SYS_PRCTL_H 1
  444. #define HAVE_SYS_RESOURCE_H 1
  445. #define HAVE_SYS_SELECT_H 1
  446. #define HAVE_SYS_SHM_H 1
  447. #define HAVE_SYS_SOCKET_H 1
  448. #define HAVE_SYS_STAT_H 1
  449. #define HAVE_SYS_TIMEB_H 1
  450. #define HAVE_SYS_TIME_H 1
  451. #define HAVE_SYS_TYPES_H 1
  452. #define HAVE_SYS_UN_H 1
  453. #define HAVE_SYS_WAIT_H 1
  454. #define HAVE_TCGETATTR 1
  455. #define HAVE_TEMPNAM 1
  456. #define HAVE_TERMCAP_H 1
  457. #define HAVE_TERM_H 1
  458. #define HAVE_TERMIO_H 1
  459. #define HAVE_TERMIOS_H 1
  460. #define HAVE_TIME 1
  461. #define HAVE_TIME_H 1
  462. #define HAVE_TOWLOWER 1
  463. #define HAVE_TOWUPPER 1
  464. #define HAVE_TZNAME 1
  465. #define HAVE_U_CHAR 1
  466. #define HAVE_UCONTEXT_H 1
  467. #define HAVE_UINT 1
  468. #define HAVE_U_INT16_T 1
  469. #define HAVE_UINT16_T 1
  470. #define HAVE_U_INT32_T 1
  471. #define HAVE_UINT32_T 1
  472. #define HAVE_U_INT8_T 1
  473. #define HAVE_UINT8_T 1
  474. #define HAVE_ULONG 1
  475. #define HAVE_UMASK 1
  476. #define HAVE_UNISTD_H 1
  477. #define HAVE_UTIME 1
  478. #define HAVE_UTIME_H 1
  479. #define HAVE_UTIME_NULL 1
  480. #define HAVE_VA_COPY 1
  481. #define HAVE_VFORK 1
  482. #define HAVE_VFPRINTF 1
  483. #define HAVE_VIO_READ_BUFF 1
  484. #define HAVE_VISIBILITY 1
  485. #define HAVE_VPRINTF 1
  486. #define HAVE_VSNPRINTF 1
  487. #define HAVE_VSPRINTF 1
  488. #define HAVE_WCHAR_H 1
  489. #define HAVE_WCHAR_T 1
  490. #define HAVE_WCRTOMB
  491. #define HAVE_WCSCOLL
  492. #define HAVE_WCSDUP
  493. #define HAVE_WCTYPE
  494. #define HAVE_WCTYPE_H 1
  495. #define HAVE_WCTYPE_T 1
  496. #define HAVE_WCWIDTH
  497. #define HAVE_WEAK_SYMBOL 1
  498. #define HAVE_WORKING_FORK 1
  499. #define HAVE_WORKING_VFORK 1
  500. #define HAVE_ZLIB_H 1
  501. */
  502. #endif