Merge branch 'msys-perl' into msys
[msysgit.git] / include / apr-0 / apr_ldap.h
blobfc737456f289db3a885b17ea04b77cd19d89cabd
1 /* Copyright 2002-2004 The Apache Software Foundation
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
19 /**
20 * @file apr_ldap.h
21 * @brief APR-UTIL LDAP
23 #ifndef APU_LDAP_H
24 #define APU_LDAP_H
26 /**
27 * @defgroup APR_Util_LDAP LDAP
28 * @ingroup APR_Util
29 * @{
34 * This switches LDAP support on or off.
37 /* this will be defined if LDAP support was compiled into apr-util */
38 #define APR_HAS_LDAP 0
40 /* this whole thing disappears if LDAP is not enabled */
41 #if !APR_HAS_LDAP
43 #define APR_HAS_NETSCAPE_LDAPSDK 0
44 #define APR_HAS_NOVELL_LDAPSDK 0
45 #define APR_HAS_OPENLDAP_LDAPSDK 0
46 #define APR_HAS_MICROSOFT_LDAPSDK 0
47 #define APR_HAS_OTHER_LDAPSDK 0
49 #define APR_HAS_LDAP_SSL 0
50 #define APR_HAS_LDAP_URL_PARSE 0
53 #else /* ldap support available */
55 #ifdef APR_NOT_READY_YET
56 /* FIXME: this code awaits support from apu-conf.m4 */
58 /* There a several LDAPv3 SDKs available on various platforms
59 * define which LDAP SDK is used
61 #define APR_HAS_NETSCAPE_LDAPSDK @apu_has_ldap_netscape@
62 #define APR_HAS_NOVELL_LDAPSDK @apu_has_ldap_novell@
63 #define APR_HAS_OPENLDAP_LDAPSDK @apu_has_ldap_openldap@
64 #define APR_HAS_MICROSOFT_LDAPSDK @apu_has_ldap_microsoft@
65 #define APR_HAS_OTHER_LDAPSDK @apu_has_ldap_other@
67 /* define if LDAP SSL support is available
69 #define APR_HAS_LDAP_SSL @apu_has_ldap_ssl@
71 #else /* APR_NOT_READY_YET */
73 /* FIXME: remove this when above code works. Default to build with
74 * OpenLDAP until apu-conf.m4 support exists */
75 #define APR_HAS_OPENLDAP_LDAPSDK 1
76 #define APR_HAS_LDAP_SSL 1
78 #endif /* APR_NOT_READY_YET */
80 /* If no APR_HAS_xxx_LDAPSDK is defined error out
81 * Define if the SDK supports the ldap_url_parse function
83 #if APR_HAS_NETSCAPE_LDAPSDK
84 #define APR_HAS_LDAP_URL_PARSE 1
85 #elif APR_HAS_NOVELL_LDAPSDK
86 #define APR_HAS_LDAP_URL_PARSE 1
87 #elif APR_HAS_OPENLDAP_LDAPSDK
88 #define APR_HAS_LDAP_URL_PARSE 1
89 #elif APR_HAS_MICROSOFT_LDAPSDK
90 #define APR_HAS_LDAP_URL_PARSE 0
91 #elif APR_HAS_OTHER_LDAPSDK
92 #define APR_HAS_LDAP_URL_PARSE 0
93 #else
94 #define APR_HAS_LDAP_URL_PARSE 0
95 #error "ERROR no LDAP SDK defined!"
96 #endif
98 /* These are garbage, our public macros are always APR_HAS_ prefixed,
99 * and use 0/1 values, not defined/undef semantics.
101 * Will be deprecated in APR 1.0
103 #if APR_HAS_LDAP
104 #define APU_HAS_LDAP
105 #endif
107 /* LDAP header files */
109 #if APR_HAS_NETSCAPE_LDAPSDK
112 #if APR_HAS_LDAP_SSL
114 #endif
115 #endif
117 #if APR_HAS_NOVELL_LDAPSDK
120 #if APR_HAS_LDAP_SSL
122 #endif
123 #endif
125 #if APR_HAS_OPENLDAP_LDAPSDK
126 #if !defined(LDAP_DEPRECATED)
127 /* Ensure that the "deprecated" interfaces are still exposed
128 * with OpenLDAP >= 2.3; these were exposed by default in earlier
129 * releases. */
130 #define LDAP_DEPRECATED 1
131 #endif
134 #endif
136 /* MS & v2 LDAP SDKs don't use const parameters in their prototypes,
137 * LDAPv3 SDKs mostly use const. Bridge the gap for clean compilation.
140 #if LDAP_VERSION_MAX <= 2 || APR_HAS_MICROSOFT_LDAPSDK || defined(DOXYGEN)
142 * Cast away constness to compile cleanly against v2 and MS LDAP SDKs
143 * @param conststr The value to un-constify on older LDAP SDKs
145 #define APR_LDAP_UNCONST(conststr) ((char *)(conststr))
146 #else
147 #define APR_LDAP_UNCONST(conststr) (conststr)
148 #endif
150 #ifndef __cplusplus
152 * Cast away constness to compile against v2 and MS LDAP SDKs
153 * @param conststr The value to un-constify on older LDAP SDKs
154 * @bug The apr_ldap.h macro const_cast violated three rules;
155 * it was a C++ reserved keyword, it violated the uppercase-only
156 * style guideline for apr macros, and it was not namespace protected.
157 * It exists here soley to avoid breaking legacy sources using APR 0.9.
158 * @deprecated @see APR_LDAP_UNCONST
160 #define const_cast(conststr) APR_LDAP_UNCONST(conststr)
161 #endif
163 #include "apr_ldap_url.h"
165 /* Define some errors that are mysteriously gone from OpenLDAP 2.x */
166 #ifndef LDAP_URL_ERR_NOTLDAP
167 #define LDAP_URL_ERR_NOTLDAP LDAP_URL_ERR_BADSCHEME
168 #endif
170 #ifndef LDAP_URL_ERR_NODN
171 #define LDAP_URL_ERR_NODN LDAP_URL_ERR_BADURL
172 #endif
174 /** @} */
175 #endif /* APR_HAS_LDAP */
176 #endif /* APU_LDAP_H */