Change the magic number used to introduce a trie file, so that instead
[sgt/agedu] / agedu.h
1 /*
2 * Central header file for agedu, defining various useful things.
3 */
4
5 #include "config.h"
6
7 #ifdef HAVE_FEATURES_H
8 #define _GNU_SOURCE
9 #include <features.h>
10 #endif
11
12 #ifdef HAVE_STDIO_H
13 # include <stdio.h>
14 #endif
15 #ifdef HAVE_ERRNO_H
16 # include <errno.h>
17 #endif
18 #ifdef HAVE_TIME_H
19 # include <time.h>
20 #endif
21 #ifdef HAVE_ASSERT_H
22 # include <assert.h>
23 #endif
24 #ifdef HAVE_STRING_H
25 # include <string.h>
26 #endif
27 #ifdef HAVE_STDLIB_H
28 # include <stdlib.h>
29 #endif
30 #ifdef HAVE_STDARG_H
31 # include <stdarg.h>
32 #endif
33 #ifdef HAVE_STDINT_H
34 # include <stdint.h>
35 #endif
36 #ifdef HAVE_STDDEF_H
37 # include <stddef.h>
38 #endif
39 #ifdef HAVE_LIMITS_H
40 # include <limits.h>
41 #endif
42 #ifdef HAVE_CTYPE_H
43 # include <ctype.h>
44 #endif
45
46 #ifdef HAVE_SYS_TYPES_H
47 # include <sys/types.h>
48 #endif
49 #ifdef HAVE_SYS_STAT_H
50 # include <sys/stat.h>
51 #endif
52 #ifdef HAVE_UNISTD_H
53 # include <unistd.h>
54 #endif
55 #ifdef HAVE_FCNTL_H
56 # include <fcntl.h>
57 #endif
58 #ifdef HAVE_SYS_MMAN_H
59 # include <sys/mman.h>
60 #endif
61 #ifdef HAVE_TERMIOS_H
62 # include <termios.h>
63 #endif
64 #ifdef HAVE_SYS_IOCTL_H
65 # include <sys/ioctl.h>
66 #endif
67 #ifdef HAVE_FNMATCH_H
68 # include <fnmatch.h>
69 #endif
70 #ifdef HAVE_PWD_H
71 # include <pwd.h>
72 #endif
73 #ifdef HAVE_SYS_WAIT_H
74 # include <sys/wait.h>
75 #endif
76 #ifdef HAVE_SYS_SOCKET_H
77 # include <sys/socket.h>
78 #endif
79 #ifdef HAVE_ARPA_INET_H
80 # include <arpa/inet.h>
81 #endif
82 #ifdef HAVE_NETINET_IN_H
83 # include <netinet/in.h>
84 #endif
85 #ifdef HAVE_SYSLOG_H
86 # include <syslog.h>
87 #endif
88 #ifdef HAVE_SYS_SELECT_H
89 # include <sys/select.h>
90 #endif
91 #ifdef HAVE_NETDB_H
92 # include <netdb.h>
93 #endif
94
95 #ifndef HOST_NAME_MAX
96 /* Reportedly at least one Solaris fails to comply with its POSIX
97 * requirement to define this (see POSIX spec for gethostname) */
98 #define HOST_NAME_MAX 255 /* upper bound specified in SUS */
99 #endif
100
101 #define PNAME "agedu"
102
103 #define DUMPHDR "agedu dump file. pathsep="
104
105 #define lenof(x) (sizeof((x))/sizeof(*(x)))
106
107 extern char pathsep;
108
109 #if defined HAVE_LSTAT64 && HAVE_STAT64
110 #define STRUCT_STAT struct stat64
111 #define LSTAT_FUNC lstat64
112 #define STAT_FUNC stat64
113 #else
114 #define STRUCT_STAT struct stat
115 #define LSTAT_FUNC lstat
116 #define STAT_FUNC stat
117 #endif
118
119 #define max(x,y) ( (x) > (y) ? (x) : (y) )
120 #define min(x,y) ( (x) < (y) ? (x) : (y) )