upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / include / apr_ldap.hw
1 /* Copyright 2000-2004 The Apache Software Foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #include "apr.h"
17 #include "apu.h"
18
19 /*
20  * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
21  */
22 /**
23  * @file apr_ldap.h
24  * @brief  APR-UTIL LDAP 
25  */
26 #ifndef APU_LDAP_H
27 #define APU_LDAP_H
28
29 /**
30  * @defgroup APR_Util_LDAP LDAP
31  * @ingroup APR_Util
32  * @{
33  */
34
35
36 /*
37  * This switches LDAP support on or off.
38  */
39
40 /* this will be defined if LDAP support was compiled into apr-util */
41 #define APR_HAS_LDAP              1
42
43 /* this whole thing disappears if LDAP is not enabled */
44 #if !APR_HAS_LDAP
45
46 #define APR_HAS_NETSCAPE_LDAPSDK    0
47 #define APR_HAS_NOVELL_LDAPSDK      0
48 #define APR_HAS_OPENLDAP_LDAPSDK    0
49 #define APR_HAS_MICROSOFT_LDAPSDK   0
50 #define APR_HAS_OTHER_LDAPSDK       0
51
52 #define APR_HAS_LDAP_SSL            0
53 #define APR_HAS_LDAP_URL_PARSE    0
54
55
56 #else /* ldap support available */
57
58
59    /* There a several LDAPv3 SDKs available on various platforms
60     * define which LDAP SDK is used 
61    */
62 #define APR_HAS_NETSCAPE_LDAPSDK    0
63 #define APR_HAS_NOVELL_LDAPSDK      0
64 #define APR_HAS_OPENLDAP_LDAPSDK    0
65 #define APR_HAS_MICROSOFT_LDAPSDK   1
66 #define APR_HAS_OTHER_LDAPSDK       0
67
68    /* define if LDAP SSL support is available 
69    */
70 #define APR_HAS_LDAP_SSL            1
71
72    /* If no APR_HAS_xxx_LDAPSDK is defined error out
73     * Define if the SDK supports the ldap_url_parse function 
74    */
75 #if APR_HAS_NETSCAPE_LDAPSDK 
76    #define APR_HAS_LDAP_URL_PARSE      1
77 #elif APR_HAS_NOVELL_LDAPSDK 
78    #define APR_HAS_LDAP_URL_PARSE      1
79 #elif APR_HAS_OPENLDAP_LDAPSDK
80    #define APR_HAS_LDAP_URL_PARSE      1
81 #elif APR_HAS_MICROSOFT_LDAPSDK
82    #define APR_HAS_LDAP_URL_PARSE      0
83 #elif APR_HAS_OTHER_LDAPSDK
84    #define APR_HAS_LDAP_URL_PARSE      0
85 #else
86    #define APR_HAS_LDAP_URL_PARSE      0
87    #error "ERROR no LDAP SDK defined!"
88 #endif
89
90 /* These are garbage, our public macros are always APR_HAS_ prefixed,
91  * and use 0/1 values, not defined/undef semantics.  
92  *
93  * Will be deprecated in APR 1.0
94  */
95 #if APR_HAS_LDAP
96 #define APU_HAS_LDAP
97 #endif
98
99
100 /* LDAP header files */
101
102 #if APR_HAS_NETSCAPE_LDAPSDK
103 #include <ldap.h>
104 #include <lber.h>
105 #if APR_HAS_LDAP_SSL 
106 #include <ldap_ssl.h>
107 #endif
108 #endif
109
110 #if APR_HAS_NOVELL_LDAPSDK
111 #include <ldap.h>
112 #include <lber.h>
113 #if APR_HAS_LDAP_SSL 
114 #include <ldap_ssl.h>
115 #endif
116 #endif
117
118 #if APR_HAS_OPENLDAP_LDAPSDK
119 #include <ldap.h>
120 #include <lber.h>
121 #endif
122
123 /* Included in Windows 2000 and later, earlier 9x/NT 4.0 clients
124  * will need to obtain the Active Directory Client Extensions.
125  */
126 #if APR_HAS_MICROSOFT_LDAPSDK
127 #include <winldap.h>
128 #define LDAPS_PORT LDAP_SSL_PORT
129 #endif
130
131 /* MS & v2 LDAP SDKs don't use const parameters in their prototypes,
132  * LDAPv3 SDKs mostly use const.  Bridge the gap for clean compilation.
133  */
134
135 #if LDAP_VERSION_MAX <= 2 || APR_HAS_MICROSOFT_LDAPSDK || defined(DOXYGEN)
136 /**
137  * Cast away constness to compile cleanly against v2 and MS LDAP SDKs
138  * @param conststr The value to un-constify on older LDAP SDKs
139  */
140 #define APR_LDAP_UNCONST(conststr) ((char *)(conststr))
141 #else
142 #define APR_LDAP_UNCONST(conststr) (conststr)
143 #endif
144
145 #ifndef __cplusplus
146 /**
147  * Cast away constness to compile against v2 and MS LDAP SDKs
148  * @param conststr The value to un-constify on older LDAP SDKs
149  * @bug The apr_ldap.h macro const_cast violated three rules;
150  *   it was a C++ reserved keyword, it violated the uppercase-only
151  *   style guideline for apr macros, and it was not namespace protected.
152  *   It exists here soley to avoid breaking legacy sources using APR 0.9.
153  * @deprecated @see APR_LDAP_UNCONST
154  */
155 #define const_cast(conststr) APR_LDAP_UNCONST(conststr)
156 #endif
157
158 #include "apr_ldap_url.h"
159
160 /* Define some errors that are mysteriously gone from OpenLDAP 2.x */
161 #ifndef LDAP_URL_ERR_NOTLDAP
162 #define LDAP_URL_ERR_NOTLDAP LDAP_URL_ERR_BADSCHEME
163 #endif
164
165 #ifndef LDAP_URL_ERR_NODN
166 #define LDAP_URL_ERR_NODN LDAP_URL_ERR_BADURL
167 #endif
168
169 /** @} */
170 #endif /* APR_HAS_LDAP */
171 #endif /* APU_LDAP_H */