1 | /* |
---|
2 | * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") |
---|
3 | * Copyright (C) 1999-2001 Internet Software Consortium. |
---|
4 | * |
---|
5 | * Permission to use, copy, modify, and distribute this software for any |
---|
6 | * purpose with or without fee is hereby granted, provided that the above |
---|
7 | * copyright notice and this permission notice appear in all copies. |
---|
8 | * |
---|
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH |
---|
10 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
---|
11 | * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, |
---|
12 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
---|
13 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE |
---|
14 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
---|
15 | * PERFORMANCE OF THIS SOFTWARE. |
---|
16 | */ |
---|
17 | |
---|
18 | /* $Id: config.h.win32,v 1.1.1.3 2005-04-15 15:33:10 ghudson Exp $ */ |
---|
19 | |
---|
20 | /* |
---|
21 | * win32 configuration file |
---|
22 | * All definitions, declarations, macros and includes are |
---|
23 | * specific to the requirements of the Windows NT and Windows 2000 |
---|
24 | * platforms |
---|
25 | */ |
---|
26 | |
---|
27 | /* Define to empty if the keyword does not work. */ |
---|
28 | /* #undef const */ |
---|
29 | |
---|
30 | /* Define as __inline if that's what the C compiler calls it. */ |
---|
31 | #define inline __inline |
---|
32 | |
---|
33 | /* Define to `unsigned' if <sys/types.h> doesn't define. */ |
---|
34 | /* #undef size_t */ |
---|
35 | |
---|
36 | /* |
---|
37 | * ANSI C compliance enabled |
---|
38 | */ |
---|
39 | #define __STDC__ 1 |
---|
40 | |
---|
41 | /* |
---|
42 | * Windows NT and 2K only |
---|
43 | */ |
---|
44 | #define _WIN32_WINNT 0x0400 |
---|
45 | /* Define if you have the ANSI C header files. */ |
---|
46 | #define STDC_HEADERS 1 |
---|
47 | |
---|
48 | /* Define if you can safely include both <sys/time.h> and <time.h>. */ |
---|
49 | #define TIME_WITH_SYS_TIME 1 |
---|
50 | |
---|
51 | /* define on DEC OSF to enable 4.4BSD style sa_len support */ |
---|
52 | /* #undef _SOCKADDR_LEN */ |
---|
53 | |
---|
54 | /* define if your system needs pthread_init() before using pthreads */ |
---|
55 | /* #undef NEED_PTHREAD_INIT */ |
---|
56 | |
---|
57 | /* define if your system has sigwait() */ |
---|
58 | /* #undef HAVE_SIGWAIT */ |
---|
59 | |
---|
60 | /* define on Solaris to get sigwait() to work using pthreads semantics */ |
---|
61 | /* #undef _POSIX_PTHREAD_SEMANTICS */ |
---|
62 | |
---|
63 | /* define if LinuxThreads is in use */ |
---|
64 | /* #undef HAVE_LINUXTHREADS */ |
---|
65 | |
---|
66 | /* define if catgets() is available */ |
---|
67 | /* #undef HAVE_CATGETS */ |
---|
68 | |
---|
69 | /* define if you have the NET_RT_IFLIST sysctl variable. */ |
---|
70 | #define HAVE_IFLIST_SYSCTL 1 |
---|
71 | |
---|
72 | /* define if you need to #define _XPG4_2 before including sys/socket.h */ |
---|
73 | /* #undef NEED_XPG4_2_BEFORE_SOCKET_H */ |
---|
74 | |
---|
75 | /* define if you need to #define _XOPEN_SOURCE_ENTENDED before including |
---|
76 | * sys/socket.h |
---|
77 | */ |
---|
78 | /* #undef NEED_XSE_BEFORE_SOCKET_H */ |
---|
79 | |
---|
80 | /* Define if you have the <fcntl.h> header file. */ |
---|
81 | #define HAVE_FCNTL_H 1 |
---|
82 | |
---|
83 | /* Define if you have the <sys/sockio.h> header file. */ |
---|
84 | #define HAVE_SYS_SOCKIO_H 1 |
---|
85 | |
---|
86 | /* Define if you have the <sys/time.h> header file. */ |
---|
87 | #define HAVE_SYS_TIME_H 1 |
---|
88 | |
---|
89 | /* Define if you have the <unistd.h> header file. */ |
---|
90 | #define HAVE_UNISTD_H 1 |
---|
91 | |
---|
92 | /* Define if you have the c_r library (-lc_r). */ |
---|
93 | /* #undef HAVE_LIBC_R */ |
---|
94 | |
---|
95 | /* Define if you have the nsl library (-lnsl). */ |
---|
96 | /* #undef HAVE_LIBNSL */ |
---|
97 | |
---|
98 | /* Define if you have the pthread library (-lpthread). */ |
---|
99 | /* #undef HAVE_LIBPTHREAD */ |
---|
100 | |
---|
101 | /* Define if you have the socket library (-lsocket). */ |
---|
102 | /* #undef HAVE_LIBSOCKET */ |
---|
103 | |
---|
104 | /* Define if you have h_errno */ |
---|
105 | #define HAVE_H_ERRNO |
---|
106 | |
---|
107 | #define ISC_PLATFORM_NEEDSTRLCAT |
---|
108 | |
---|
109 | #define ISC_PLATFORM_NEEDSTRLCPY |
---|
110 | |
---|
111 | #define S_IFMT _S_IFMT /* file type mask */ |
---|
112 | #define S_IFDIR _S_IFDIR /* directory */ |
---|
113 | #define S_IFCHR _S_IFCHR /* character special */ |
---|
114 | #define S_IFIFO _S_IFIFO /* pipe */ |
---|
115 | #define S_IFREG _S_IFREG /* regular */ |
---|
116 | #define S_IREAD _S_IREAD /* read permission, owner */ |
---|
117 | #define S_IWRITE _S_IWRITE /* write permission, owner */ |
---|
118 | #define S_IEXEC _S_IEXEC /* execute/search permission, owner */ |
---|
119 | |
---|
120 | #define O_RDONLY _O_RDONLY |
---|
121 | #define O_WRONLY _O_WRONLY |
---|
122 | #define O_RDWR _O_RDWR |
---|
123 | #define O_APPEND _O_APPEND |
---|
124 | #define O_CREAT _O_CREAT |
---|
125 | #define O_TRUNC _O_TRUNC |
---|
126 | #define O_EXCL _O_EXCL |
---|
127 | |
---|
128 | /* open() under unix allows setting of read/write permissions |
---|
129 | * at the owner, group and other levels. These don't exist in NT |
---|
130 | * We'll just map them all to the NT equivalent |
---|
131 | */ |
---|
132 | |
---|
133 | #define S_IRUSR _S_IREAD /* Owner read permission */ |
---|
134 | #define S_IWUSR _S_IWRITE /* Owner write permission */ |
---|
135 | #define S_IRGRP _S_IREAD /* Group read permission */ |
---|
136 | #define S_IWGRP _S_IWRITE /* Group write permission */ |
---|
137 | #define S_IROTH _S_IREAD /* Other read permission */ |
---|
138 | #define S_IWOTH _S_IWRITE /* Other write permission */ |
---|
139 | |
---|
140 | |
---|
141 | /* |
---|
142 | * WIN32 specials until some other way of dealing with these is decided. |
---|
143 | */ |
---|
144 | |
---|
145 | #define snprintf _snprintf |
---|
146 | #define vsnprintf _vsnprintf |
---|
147 | #define strcasecmp _stricmp |
---|
148 | #define strncasecmp _strnicmp |
---|
149 | #define strdup _strdup |
---|
150 | #define sopen _sopen |
---|
151 | #define isascii __isascii |
---|
152 | #define stat _stat |
---|
153 | #define fstat _fstat |
---|
154 | #define fileno _fileno |
---|
155 | #define unlink _unlink |
---|
156 | #define chdir _chdir |
---|
157 | #define mkdir _mkdir |
---|
158 | #define getcwd _getcwd |
---|
159 | #define utime _utime |
---|
160 | #define utimbuf _utimbuf |
---|
161 | |
---|
162 | /* #define EAFNOSUPPORT EINVAL */ |
---|
163 | #define chmod _chmod |
---|
164 | #define getpid _getpid |
---|
165 | #define getppid _getpid /* WARNING!!! For now this gets the same pid */ |
---|
166 | #define random rand /* Random number generator */ |
---|
167 | #define srandom srand /* Random number generator seeding */ |
---|
168 | /* for the config file */ |
---|
169 | typedef unsigned int uid_t; /* user id */ |
---|
170 | typedef unsigned int gid_t; /* group id */ |
---|
171 | typedef long pid_t; /* PID */ |
---|
172 | typedef int ssize_t; |
---|
173 | typedef long off_t; |
---|
174 | |
---|
175 | /* |
---|
176 | * Set up the Version Information |
---|
177 | */ |
---|
178 | #include <versions.h> |
---|
179 | |
---|
180 | /* We actually are using the CryptAPI and not a device */ |
---|
181 | #define PATH_RANDOMDEV "CryptAPI" |
---|
182 | |
---|
183 | #include <stddef.h> |
---|
184 | #include <stdio.h> |
---|
185 | #include <stdarg.h> |
---|
186 | |
---|
187 | /* |
---|
188 | * Applications may need to get the configuration path |
---|
189 | */ |
---|
190 | #ifndef _USRDLL |
---|
191 | #include <isc/ntpaths.h> |
---|
192 | #endif |
---|
193 | |
---|
194 | #define fdopen _fdopen |
---|
195 | #define read _read |
---|
196 | #define open _open |
---|
197 | #define close _close |
---|
198 | #define write _write |
---|
199 | #include <io.h> |
---|
200 | #define isatty _isatty |
---|
201 | |
---|
202 | #ifndef _WINSOCKAPI_ |
---|
203 | #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ |
---|
204 | #endif |
---|
205 | |
---|
206 | /* |
---|
207 | * Make the number of available sockets large |
---|
208 | * The number of sockets needed can get large and memory's cheap |
---|
209 | * This must be defined before winsock2.h gets included as the |
---|
210 | * macro is used there. |
---|
211 | */ |
---|
212 | |
---|
213 | #define FD_SETSIZE 16384 |
---|
214 | #include <windows.h> |
---|