1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * This file is now only used on Windows
7 * type functions split out of here to make things look nicer in the
8 * various include files which need these definitions, as well as in
9 * the util/ directories.
12 #ifndef _KRB5_WIN_MAC_H
13 #define _KRB5_WIN_MAC_H
17 #define ID_READ_PWD_DIALOG 10000
18 #define ID_READ_PWD_PROMPT 10001
19 #define ID_READ_PWD_PROMPT2 10002
20 #define ID_READ_PWD_PWD 10003
24 #define APSTUDIO_HIDDEN_SYMBOLS
27 #else /* ! RES_ONLY */
29 /* To ensure backward compatibility of the ABI use 32-bit time_t on
34 #error krb5.h included before k5-int.h
35 #endif /* KRB5_GENERAL__ */
36 #if _INTEGRAL_MAX_BITS >= 64 && _MSC_VER >= 1400 && !defined(_WIN64) && !defined(_USE_32BIT_TIME_T)
37 #if defined(_TIME_T_DEFINED) || defined(_INC_IO) || defined(_INC_TIME) || defined(_INC_WCHAR)
38 #error time_t has been defined as a 64-bit integer which is incompatible with Kerberos on this platform.
39 #endif /* _TIME_T_DEFINED */
40 #define _USE_32BIT_TIME_T
45 #define SIZEOF_SHORT 2
51 #ifndef SIZE_MAX /* in case Microsoft defines max size of size_t */
52 #ifdef MAX_SIZE /* Microsoft defines MAX_SIZE as max size of size_t */
53 #define SIZE_MAX MAX_SIZE
55 #define SIZE_MAX UINT_MAX
60 # define KRB5_CALLCONV __stdcall
61 # define KRB5_CALLCONV_C __cdecl
64 * Use this to mark an incorrect calling convention that has been
65 * "immortalized" because it was incorrectly exported in a previous
69 # define KRB5_CALLCONV_WRONG KRB5_CALLCONV_C
71 #endif /* !KRB5_CALLCONV */
73 #ifndef KRB5_SYSTYPES__
74 #define KRB5_SYSTYPES__
75 #include <sys/types.h>
76 typedef unsigned long u_long; /* Not part of sys/types.h on the pc */
77 typedef unsigned int u_int;
78 typedef unsigned short u_short;
79 typedef unsigned char u_char;
80 typedef unsigned int uint32_t;
82 #if _INTEGRAL_MAX_BITS >= 64
83 typedef unsigned __int64 uint64_t;
84 typedef __int64 int64_t;
86 #ifndef SSIZE_T_DEFINED
91 typedef __int64 ssize_t;
93 typedef _W64 int ssize_t;
95 #define SSIZE_T_DEFINED
97 #endif /* KRB5_SYSTYPES__ */
99 #define MAXHOSTNAMELEN 512
101 #define MAXPATHLEN 256 /* Also for Windows temp files */
104 #define HAVE_NETINET_IN_H
105 #define MSDOS_FILESYSTEM
106 #define HAVE_STRING_H
110 #define HAVE_GETADDRINFO
111 #define HAVE_GETNAMEINFO
114 #define HAVE_STRERROR
115 #define SYS_ERRLIST_DECLARED
116 /* if __STDC_VERSION__ >= 199901L this shouldn't be needed */
117 #define inline __inline
118 #define KRB5_USE_INET6
119 #define NEED_INSIXADDR_ANY
120 #define ENABLE_THREADS
122 #define WM_KERBEROS5_CHANGED "Kerberos5 Changed"
124 #define WM_KERBEROS_CHANGED "Kerberos Changed"
127 /* Kerberos Windows initialization file */
128 #define KERBEROS_INI "kerberos.ini"
130 #define KERBEROS_HLP "kerbnet.hlp"
132 #define KERBEROS_HLP "krb5clnt.hlp"
134 #define INI_DEFAULTS "Defaults"
135 #define INI_USER "User" /* Default user */
136 #define INI_INSTANCE "Instance" /* Default instance */
137 #define INI_REALM "Realm" /* Default realm */
138 #define INI_POSITION "Position"
139 #define INI_OPTIONS "Options"
140 #define INI_DURATION "Duration" /* Ticket duration in minutes */
141 #define INI_EXPIRATION "Expiration" /* Action on expiration (alert or beep) */
142 #define INI_ALERT "Alert"
143 #define INI_BEEP "Beep"
144 #define INI_FILES "Files"
146 #define INI_KRB_CONF "krb.conf" /* Location of krb.conf file */
147 #define DEF_KRB_CONF "krb.conf" /* Default name for krb.conf file */
149 #define INI_KRB5_CONF "krb5.ini" /* From k5-config.h */
150 #define INI_KRB_CONF INI_KRB5_CONF /* Location of krb.conf file */
151 #define DEF_KRB_CONF INI_KRB5_CONF /* Default name for krb.conf file */
152 #define INI_TICKETOPTS "TicketOptions" /* Ticket options */
153 #define INI_FORWARDABLE "Forwardable" /* get forwardable tickets */
154 #define INI_KRB_CCACHE "krb5cc" /* From k5-config.h */
156 #define INI_KRB_REALMS "krb.realms" /* Location of krb.realms file */
157 #define DEF_KRB_REALMS "krb.realms" /* Default name for krb.realms file */
158 #define INI_RECENT_LOGINS "Recent Logins"
159 #define INI_LOGIN "Login"
161 #define HAS_VOID_TYPE
162 #define HAVE_STDARG_H
163 #define HAVE_SYS_TYPES_H
164 #define HAVE_STDLIB_H
166 /* This controls which encryption routines libcrypto will provide */
167 #define PROVIDE_DES_CBC_MD5
168 #define PROVIDE_DES_CBC_CRC
169 #define PROVIDE_DES_CBC_RAW
170 #define PROVIDE_DES_CBC_CKSUM
171 #define PROVIDE_CRC32
172 #define PROVIDE_RSA_MD4
173 #define PROVIDE_RSA_MD5
174 /* #define PROVIDE_DES3_CBC_SHA */
175 /* #define PROVIDE_DES3_CBC_RAW */
176 /* #define PROVIDE_NIST_SHA */
178 /* Ugly. Microsoft, in stdc mode, doesn't support the low-level i/o
179 * routines directly. Rather, they only export the _<function> version.
180 * The following defines works around this problem.
182 #include <sys\types.h>
183 #include <sys\stat.h>
189 /* Only needed by util/et/error_message.c but let's keep the source clean */
190 #define sys_nerr _sys_nerr
191 #define sys_errlist _sys_errlist
195 * Functions with slightly different names on the PC
198 #define strcasecmp _stricmp
201 #define strncasecmp _strnicmp
204 /* VS2005 has deprecated strdup */
206 #define strdup _strdup
209 /* Windows has its own name for reentrant strtok. */
210 #define strtok_r strtok_s
212 HINSTANCE get_lib_instance(void);
214 #define GETSOCKNAME_ARG2_TYPE struct sockaddr
215 #define GETSOCKNAME_ARG3_TYPE size_t
216 #define GETPEERNAME_ARG2_TYPE GETSOCKNAME_ARG2_TYPE
217 #define GETPEERNAME_ARG3_TYPE GETSOCKNAME_ARG3_TYPE
219 #endif /* !RES_ONLY */
223 #define THREEPARAMOPEN(x,y,z) open(x,y,z)
225 #ifndef KRB5_CALLCONV
226 #define KRB5_CALLCONV
229 #ifndef KRB5_CALLCONV_C
230 #define KRB5_CALLCONV_C
233 #endif /* _KRB5_WIN_MAC_H */