2 * type functions split out of here to make things look nicer in the
3 * various include files which need these definitions, as well as in
4 * the util/ directories.
7 #ifndef _KRB5_WIN_MAC_H
8 #define _KRB5_WIN_MAC_H
10 #if (defined(_MSDOS) || defined(_WIN32))
12 * Machine-type definitions: PC Clone 386 running Microloss Windows
15 #define ID_READ_PWD_DIALOG 10000
16 #define ID_READ_PWD_PROMPT 10001
17 #define ID_READ_PWD_PROMPT2 10002
18 #define ID_READ_PWD_PWD 10003
22 #define APSTUDIO_HIDDEN_SYMBOLS
28 /* Windows 16 specific */
31 #define SIZEOF_SHORT 2
35 #define KRB5_CALLCONV __far __export __pascal
36 #define KRB5_CALLCONV_C __far __export __cdecl
37 #define KRB5_EXPORTVAR __far __export
39 #endif /* !KRB5_CALLCONV */
44 * The following defines are needed to make <windows.h> work
45 * in stdc mode (/Za flag). Winsock.h needs <windows.h>.
55 #define _pascal __pascal
56 #define _cdecl __cdecl
61 /* Windows 32 specific */
63 #define SIZEOF_SHORT 2
66 #include <windows.h> /* always include this here, to get correct FAR and NEAR */
73 # define KRB5_DLLIMP __declspec(dllexport)
75 # define KRB5_DLLIMP __declspec(dllimport)
78 # define GSS_DLLIMP __declspec(dllexport)
80 # define GSS_DLLIMP __declspec(dllimport)
82 # else /* !_MSC_VER */
86 # define KRB5_CALLCONV __stdcall
87 # define KRB5_CALLCONV_C __cdecl
88 # define KRB5_EXPORTVAR
89 #endif /* !KRB5_CALLCONV */
93 #ifndef KRB5_SYSTYPES__
94 #define KRB5_SYSTYPES__
95 #include <sys/types.h>
96 typedef unsigned long u_long; /* Not part of sys/types.h on the pc */
97 typedef unsigned int u_int;
98 typedef unsigned short u_short;
99 typedef unsigned char u_char;
100 #endif /* KRB5_SYSTYPES__ */
102 #define MAXHOSTNAMELEN 512
104 #define MAXPATHLEN 256 /* Also for Windows temp files */
107 #define HAVE_NETINET_IN_H
108 #define MSDOS_FILESYSTEM
109 #define HAVE_STRING_H
116 #define WM_KERBEROS5_CHANGED "Kerberos5 Changed"
118 #define WM_KERBEROS_CHANGED "Kerberos Changed"
121 /* Kerberos Windows initialization file */
122 #define KERBEROS_INI "kerberos.ini"
124 #define KERBEROS_HLP "kerbnet.hlp"
126 #define KERBEROS_HLP "krb5clnt.hlp"
128 #define INI_DEFAULTS "Defaults"
129 #define INI_USER "User" /* Default user */
130 #define INI_INSTANCE "Instance" /* Default instance */
131 #define INI_REALM "Realm" /* Default realm */
132 #define INI_POSITION "Position"
133 #define INI_OPTIONS "Options"
134 #define INI_DURATION "Duration" /* Ticket duration in minutes */
135 #define INI_EXPIRATION "Expiration" /* Action on expiration (alert or beep) */
136 #define INI_ALERT "Alert"
137 #define INI_BEEP "Beep"
138 #define INI_FILES "Files"
140 #define INI_KRB_CONF "krb.conf" /* Location of krb.conf file */
141 #define DEF_KRB_CONF "krb.conf" /* Default name for krb.conf file */
143 #define INI_KRB5_CONF "krb5.ini" /* From k5-config.h */
144 #define INI_KRB_CONF INI_KRB5_CONF /* Location of krb.conf file */
145 #define DEF_KRB_CONF INI_KRB5_CONF /* Default name for krb.conf file */
146 #define INI_TICKETOPTS "TicketOptions" /* Ticket options */
147 #define INI_FORWARDABLE "Forwardable" /* get forwardable tickets */
148 #define INI_KRB_CCACHE "krb5cc" /* From k5-config.h */
150 #define INI_KRB_REALMS "krb.realms" /* Location of krb.realms file */
151 #define DEF_KRB_REALMS "krb.realms" /* Default name for krb.realms file */
152 #define INI_RECENT_LOGINS "Recent Logins"
153 #define INI_LOGIN "Login"
155 #define HAS_ANSI_VOLATILE
156 #define HAS_VOID_TYPE
157 #define KRB5_PROVIDE_PROTOTYPES
158 #define HAVE_STDARG_H
159 #define HAVE_SYS_TYPES_H
160 #define HAVE_STDLIB_H
162 /* This controls which encryption routines libcrypto will provide */
163 #define PROVIDE_DES_CBC_MD5
164 #define PROVIDE_DES_CBC_CRC
165 #define PROVIDE_DES_CBC_RAW
166 #define PROVIDE_DES_CBC_CKSUM
167 #define PROVIDE_CRC32
168 #define PROVIDE_RSA_MD4
169 #define PROVIDE_RSA_MD5
170 /* #define PROVIDE_DES3_CBC_SHA */
171 /* #define PROVIDE_DES3_CBC_RAW */
172 /* #define PROVIDE_NIST_SHA */
174 /* Ugly. Microsoft, in stdc mode, doesn't support the low-level i/o
175 * routines directly. Rather, they only export the _<function> version.
176 * The following defines works around this problem.
178 #include <sys\types.h>
179 #include <sys\stat.h>
183 #define THREEPARAMOPEN(x,y,z) open(x,y,z)
185 #define O_RDONLY _O_RDONLY
186 #define O_WRONLY _O_WRONLY
187 #define O_RDWR _O_RDWR
188 #define O_APPEND _O_APPEND
189 #define O_CREAT _O_CREAT
190 #define O_TRUNC _O_TRUNC
191 #define O_EXCL _O_EXCL
192 #define O_TEXT _O_TEXT
193 #define O_BINARY _O_BINARY
194 #define O_NOINHERIT _O_NOINHERIT
196 #define unlink _unlink
203 #define mktemp _mktemp
206 #define getpid _getpid
210 /* Only needed by util/et/error_message.c but let's keep the source clean */
211 #define sys_nerr _sys_nerr
212 #define sys_errlist _sys_errlist
216 * Functions with slightly different names on the PC
218 #define strcasecmp stricmp
219 #define strncasecmp strnicmp
221 HINSTANCE get_lib_instance(void);
223 #endif /* !RES_ONLY */
225 #endif /* _MSDOS || _WIN32 */
229 #include <KerberosSupport/KerberosConditionalMacros.h>
231 #define USE_LOGIN_LIBRARY
233 #define KRB5_CALLCONV
234 #define KRB5_CALLCONV_C
245 #define SIZEOF_SHORT 2
249 /*#define ENOMEM 12*/
253 * Which encryption routines libcrypto will provide is controlled by
254 * mac/libraries/KerberosHeaders.h.
257 /* there is no <stat.h> for mpw */
259 typedef unsigned long size_t;
260 typedef unsigned long mode_t;
261 typedef unsigned long ino_t;
262 typedef unsigned long dev_t;
263 typedef short nlink_t;
264 typedef unsigned long uid_t;
265 typedef unsigned long gid_t;
270 mode_t st_mode; /* File mode; see #define's below */
271 ino_t st_ino; /* File serial number */
272 dev_t st_dev; /* ID of device containing this file */
273 nlink_t st_nlink; /* Number of links */
274 uid_t st_uid; /* User ID of the file's owner */
275 gid_t st_gid; /* Group ID of the file's group */
276 dev_t st_rdev; /* Device type */
277 off_t st_size; /* File size in bytes */
278 unsigned long st_atime; /* Time of last access */
279 unsigned long st_mtime; /* Time of last data modification */
280 unsigned long st_ctime; /* Time of last file status change */
281 long st_blksize; /* Optimal blocksize */
282 long st_blocks; /* blocks allocated for file */
285 int stat(const char *path, struct stat *buf);
288 int fstat(int fildes, struct stat *buf);
296 #define THREEPARAMOPEN(x,y,z) open(x,y)
297 #else /* macintosh */
298 #define THREEPARAMOPEN(x,y,z) open(x,y,z)
299 #endif /* macintosh */
301 #ifndef KRB5_CALLCONV
302 #define KRB5_CALLCONV
303 #define KRB5_CALLCONV_C
313 #endif /* _KRB5_WIN_MAC_H */