Fiddle about with the configure script so it notices the need for
[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
92 #define PNAME "agedu"
93
94 #define DUMPHDR "agedu dump file. pathsep="
95
96 #define lenof(x) (sizeof((x))/sizeof(*(x)))
97
98 extern char pathsep;
99
100 #if defined HAVE_LSTAT64 && HAVE_STAT64
101 #define STRUCT_STAT struct stat64
102 #define LSTAT lstat64
103 #define STAT stat64
104 #else
105 #define STRUCT_STAT struct stat
106 #define LSTAT lstat
107 #define STAT stat
108 #endif
109
110 #define max(x,y) ( (x) > (y) ? (x) : (y) )
111 #define min(x,y) ( (x) < (y) ? (x) : (y) )