]>
Commit | Line | Data |
---|---|---|
d2b03e6a CW |
1 | #ifndef CYGUTILS_COMMON_H |
2 | #define CYGUTILS_COMMON_H 1 | |
3 | ||
4 | #if HAVE_CONFIG_H | |
5 | # include <config.h> | |
6 | #endif | |
7 | ||
8 | #include <stdio.h> | |
9 | ||
10 | #if HAVE_SYS_TYPES_H | |
11 | # include <sys/types.h> | |
bd695173 CW |
12 | #endif /* HAVE_SYS_TYPES_H */ |
13 | #if HAVE_SYS_STAT_H | |
14 | # include <sys/stat.h> | |
15 | #endif /* HAVE_SYS_STAT_H */ | |
d2b03e6a CW |
16 | #if STDC_HEADERS |
17 | # include <stdlib.h> | |
bd695173 CW |
18 | # include <stddef.h> |
19 | #else | |
20 | # if HAVE_STDLIB_H | |
21 | # include <stdlib.h> | |
22 | # endif | |
23 | #endif /*STDC_HEADERS*/ | |
24 | ||
25 | #if HAVE_STRING_H | |
26 | # if !STDC_HEADERS && HAVE_MEMORY_H | |
27 | # include <memory.h> | |
28 | # endif | |
d2b03e6a CW |
29 | # include <string.h> |
30 | #elif HAVE_STRINGS_H | |
31 | # include <strings.h> | |
bd695173 CW |
32 | #endif /*HAVE_STRING[S]_H*/ |
33 | ||
34 | #if HAVE_STDARG_H | |
35 | # include <stdarg.h> | |
36 | # define VA_START(a, f) va_start(a, f) | |
37 | #else | |
38 | # if HAVE_VARARGS_H | |
39 | # include <varargs.h> | |
40 | # define VA_START(a, f) va_start(a) | |
41 | # endif | |
42 | #endif | |
43 | #ifndef VA_START | |
44 | error no variadic api | |
45 | #endif /* VARIADIC */ | |
46 | ||
47 | #if TIME_WITH_SYS_TIME | |
48 | # include <sys/time.h> | |
49 | # include <time.h> | |
50 | #else | |
51 | # if HAVE_SYS_TIME_H | |
52 | # include <sys/time.h> | |
53 | # else | |
54 | # include <time.h> | |
55 | # endif | |
56 | #endif /* TIME */ | |
d2b03e6a CW |
57 | |
58 | #if HAVE_UNISTD_H | |
59 | # include <unistd.h> | |
60 | #endif /*HAVE_UNISTD_H*/ | |
61 | ||
bd695173 CW |
62 | #if HAVE_SYS_PARAM_H |
63 | # include <sys/param.h> | |
64 | #endif /*HAVE_SYS_PARAM_H */ | |
65 | ||
d2b03e6a CW |
66 | #if HAVE_ERRNO_H |
67 | # include <errno.h> | |
68 | #endif /*HAVE_ERRNO_H*/ | |
69 | ||
bd695173 CW |
70 | #if HAVE_FCNTL_H |
71 | # include <fcntl.h> | |
72 | #endif /*HAVE_FCNTL_H*/ | |
d2b03e6a CW |
73 | |
74 | #if HAVE_LIMITS_H | |
75 | # include <limits.h> | |
76 | #endif /*HAVE_LIMITS_H*/ | |
77 | ||
bd695173 CW |
78 | #if HAVE_MALLOC_H |
79 | # include <malloc.h> | |
80 | #endif /*HAVE_LIMITS_H*/ | |
81 | ||
82 | /* Geez, last.c/utmpdump.c have a lot of special requirements */ | |
83 | #if HAVE_CTYPE_H | |
84 | # include <ctype.h> | |
85 | #endif | |
86 | #if HAVE_GETOPT_H | |
87 | # include <getopt.h> | |
88 | #endif | |
89 | #if HAVE_UTMP_H | |
90 | # include <utmp.h> | |
91 | #endif /* HAVE_UTMP_H */ | |
92 | #if HAVE_SIGNAL_H | |
93 | # include <signal.h> | |
94 | #endif /* HAVE_SIGNAL_H */ | |
95 | #if HAVE_NETINET_IN_H | |
96 | # include <netinet/in.h> | |
97 | #endif /* HAVE_NETINET_IN_H */ | |
98 | #if HAVE_NETDB_H | |
99 | # include <netdb.h> | |
100 | #endif /* HAVE_NETDB_H */ | |
101 | #if HAVE_ARPA_INET_H | |
102 | # include <arpa/inet.h> | |
103 | #endif /* HAVE_ARPA_INET_H */ | |
104 | #if HAVE_SYS_SOCKET_H | |
105 | # include <sys/socket.h> | |
106 | #endif /* HAVE_SYS_SOCKET_H */ | |
107 | /* End: last.c/utmpdump.c stuff */ | |
108 | ||
67358361 CW |
109 | /* column needs TIOCGWINSZ */ |
110 | #if HAVE_TERMIOS_H | |
111 | # include <termios.h> | |
112 | #endif | |
113 | ||
114 | #if GWINSZ_IN_SYS_IOCTL | |
115 | # include <sys/ioctl.h> | |
116 | #endif | |
117 | /* End: column needs TIOCGWINSZ */ | |
118 | ||
119 | ||
d2b03e6a CW |
120 | #if HAVE_POPT_H |
121 | # include <popt.h> | |
122 | #endif /*HAVE_POPT_H*/ | |
123 | ||
124 | #if HAVE_WINDOWS_H | |
125 | # include <windows.h> | |
126 | #else | |
127 | # ifndef O_BINARY | |
128 | # define O_BINARY 0 | |
129 | # endif | |
130 | # define setmode(a, b) | |
131 | #endif /*HAVE_WINDOWS_H*/ | |
132 | ||
bd695173 CW |
133 | /* we don't include wchar.h or wctype.h here. let widechar.h do that */ |
134 | ||
d2b03e6a CW |
135 | #endif /* !CYGUTILS_COMMON_H */ |
136 |