summaryrefslogtreecommitdiff
path: root/ldap/inckit/msdos.h
blob: 81a0de4d449ab5556300f891067db47a36de98f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/* wsa.h */
/*
 * Copyright (c) 1993 Regents of the University of Michigan.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that this notice is preserved and that due credit is given
 * to the University of Michigan at Ann Arbor. The name of the University
 * may not be used to endorse or promote products derived from this
 * software without specific prior written permission. This software
 * is provided ``as is'' without express or implied warranty.
 */

#ifndef _MSDOS_H
#define _MSDOS_H

/*
 * NOTE: This file should be included via ldap.h.  Many symbols are
 * defined here that are needed BEFORE anything else is included.
 * Be careful !!!
 */
/*
 * The following are defined within the Integrated Development Environment
 * of Microsoft's Visual C++ Compiler (v1.52c)
 * (Options/Project/Compiler/Preprocessor/Symbols and Macros to Define)
 * But there's a (buffer length) limit to how long this list can be, so 
 * I'm doing the rest here in msdos.h
 * WINSOCK, DOS, NEEDPROTOS, NO_USERINTERFACE
 */
/*
 * MIT's krb.h doesn't use the symbols provided by Microsoft.
 * It needs __MSDOS__ and WINDOWS.  Normally _WINDOWS is provided by MS
 * but it's based on having the prolog/epilog optimization switches set
 * in a way that we don't set them. So define it manually.
 *
 * kbind.c needs __MSDOS__ for krb.h to include osconf.h 
 * which includes conf-pc.h which defines byte order and such
 */
#define __MSDOS__
/*
 * conf-pc.h wants WINDOWS rather than _WINDOWS which Microsoft provides
 */
#define WINDOWS

/*
 * Where two of the config files live in the windows environment
 * There are two others also; ldfriend.cfg, & srchpref.cfg
 * These names are different that the unix names due to 8.3 rule
 */
#define FILTERFILE 	"ldfilter.cfg"
#define TEMPLATEFILE 	"disptmpl.cfg"
/*
 * These are not automatically defined for us even though we're a DLL.  They
 * are triggered by prolog/epilog configuration options that we don't use.
 * But be careful not to redefine them for other apps that include this file.
 */
#ifndef _WINDLL
/*
 * Needed by wshelper.h
 */
#define _WINDLL
#endif

#ifndef _WINDOWS
/*
 * Needed by authlib.h via kerberos.c via AUTHMAN
 */
#define _WINDOWS 1
#endif
  
/*
 * KERBEROS must be defined as a preprocessor symbol in the compiler.
 * It's too late to define it in this file.
 */

/*
 * AUTHMAN - Use Authlib.dll as a higher level interface to krbv4win.dll 
 * (kerberos).  If defined, get_kerberosv4_credentials in kerberos.c is
 * used and authlib.dll (and krbv4win.dll) are dynamically loaded and used.  
 * If AUTHMAN is not defined, the get_kerberosv4_credentials in 
 * kbind.c works just fine, but requires the presence of krbv4win.dll at
 * load time.
 */
/* don't want to be dependent on authman
 * #define AUTHMAN
 */

/*
 * define WSHELPER if you want wsockip.c to use rgethostbyaddr() (in
 * WSHELPER.DLL) rather than gethostbyaddr().  You might want this if your
 * gethostbyaddr() returns the WRONG host name and you want to use
 * kerberos authentication (need host name to form service ticket
 * request).  Most won't want kerberos, and of those, there might actually
 * be some vendors who really do the lookup rather than use cached info
 * from gethostbyname() calls.
 */
#define WSHELPER
/*
 * The new slapd stuff
 */
#define LDAP_REFERRALS
/*
 * LDAP character string translation routines
 * I compiled and tested these and they seemed to work.
 * The thing to test with is: 
 *   cn=Charset Test Entry, ou=SWITCHdirectory, o=SWITCH, c=CH
 *
 * I'm disabling it for release.
#define STR_TRANSLATION
#define LDAP_CHARSET_8859 88591
#define LDAP_DEFAULT_CHARSET LDAP_CHARSET_8859
 */


#ifdef _DEBUG
#define LDAP_DEBUG
#endif
#include <winsock.h>


#include <string.h>
#include <malloc.h>
#ifndef _WIN32
#define memcpy( a, b, n )	_fmemcpy( a, b, n )
#define strcpy( a, b )		_fstrcpy( a, b )
#define strchr( a, c )		_fstrchr( a, c )
#endif /* !_WIN32 */
#define strcasecmp(a,b) 	stricmp(a,b)
#define strncasecmp(a,b,len) 	strnicmp(a,b,len)

#endif /* _MSDOS_H */