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