Main Page | Modules | Namespace List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

apr_ldap.h

Go to the documentation of this file.
00001 /* Copyright 2002-2004 The Apache Software Foundation
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 /*
00017  * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
00018  */
00023 #ifndef APU_LDAP_H
00024 #define APU_LDAP_H
00025 
00033 /*
00034  * This switches LDAP support on or off.
00035  */
00036 
00037 /* this will be defined if LDAP support was compiled into apr-util */
00038 #define APR_HAS_LDAP              1
00039 
00040 /* this whole thing disappears if LDAP is not enabled */
00041 #if !APR_HAS_LDAP
00042 
00043 #define APR_HAS_NETSCAPE_LDAPSDK    0
00044 #define APR_HAS_NOVELL_LDAPSDK      0
00045 #define APR_HAS_OPENLDAP_LDAPSDK    0
00046 #define APR_HAS_MICROSOFT_LDAPSDK   0
00047 #define APR_HAS_OTHER_LDAPSDK       0
00048 
00049 #define APR_HAS_LDAP_SSL            0
00050 #define APR_HAS_LDAP_URL_PARSE    0
00051 
00052 
00053 #else /* ldap support available */
00054 
00055 #ifdef APR_NOT_READY_YET
00056 /* FIXME: this code awaits support from apu-conf.m4 */
00057 
00058    /* There a several LDAPv3 SDKs available on various platforms
00059     * define which LDAP SDK is used 
00060  */
00061 #define APR_HAS_NETSCAPE_LDAPSDK    @apu_has_ldap_netscape@
00062 #define APR_HAS_NOVELL_LDAPSDK      @apu_has_ldap_novell@
00063 #define APR_HAS_OPENLDAP_LDAPSDK    @apu_has_ldap_openldap@
00064 #define APR_HAS_MICROSOFT_LDAPSDK   @apu_has_ldap_microsoft@
00065 #define APR_HAS_OTHER_LDAPSDK       @apu_has_ldap_other@
00066 
00067    /* define if LDAP SSL support is available 
00068    */
00069 #define APR_HAS_LDAP_SSL            @apu_has_ldap_ssl@
00070 
00071 #else /* APR_NOT_READY_YET */
00072 
00073 /* FIXME: remove this when above code works.  Default to build with
00074  * OpenLDAP until apu-conf.m4 support exists */
00075 #define APR_HAS_OPENLDAP_LDAPSDK 1 
00076 #define APR_HAS_LDAP_SSL 1
00077 
00078 #endif /* APR_NOT_READY_YET */
00079 
00080    /* If no APR_HAS_xxx_LDAPSDK is defined error out
00081     * Define if the SDK supports the ldap_url_parse function 
00082    */
00083 #if APR_HAS_NETSCAPE_LDAPSDK 
00084    #define APR_HAS_LDAP_URL_PARSE      1
00085 #elif APR_HAS_NOVELL_LDAPSDK 
00086    #define APR_HAS_LDAP_URL_PARSE      1
00087 #elif APR_HAS_OPENLDAP_LDAPSDK
00088    #define APR_HAS_LDAP_URL_PARSE      1
00089 #elif APR_HAS_MICROSOFT_LDAPSDK
00090    #define APR_HAS_LDAP_URL_PARSE      0
00091 #elif APR_HAS_OTHER_LDAPSDK
00092    #define APR_HAS_LDAP_URL_PARSE      0
00093 #else 
00094    #define APR_HAS_LDAP_URL_PARSE      0
00095    #error "ERROR no LDAP SDK defined!"
00096 #endif
00097 
00098 /* These are garbage, our public macros are always APR_HAS_ prefixed,
00099  * and use 0/1 values, not defined/undef semantics.  
00100  *
00101  * Will be deprecated in APR 1.0
00102  */
00103 #if APR_HAS_LDAP
00104 #define APU_HAS_LDAP
00105 #endif
00106 
00107 /* LDAP header files */
00108 
00109 #if APR_HAS_NETSCAPE_LDAPSDK
00110 #include <lber.h>
00111 #include <ldap.h>
00112 #if APR_HAS_LDAP_SSL 
00113 
00114 #endif
00115 #endif
00116 
00117 #if APR_HAS_NOVELL_LDAPSDK
00118 #include <lber.h>
00119 #include <ldap.h>
00120 #if APR_HAS_LDAP_SSL 
00121 
00122 #endif
00123 #endif
00124 
00125 #if APR_HAS_OPENLDAP_LDAPSDK
00126 #include <lber.h>
00127 #include <ldap.h>
00128 #endif
00129 
00130 /* LDAPv2 SDKs don't use const parameters in their prototypes.  
00131  * LDAPv3 SDKs do use const.  When compiling with LDAPv2 SDKs, const_cast 
00132  * casts away the constness, but won't under LDAPv3 
00133  */
00134 #if LDAP_VERSION_MAX <= 2
00135 #define const_cast(x) ((char *)(x))
00136 #else
00137 #define const_cast(x) (x)
00138 #endif 
00139 
00140 #include "apr_ldap_url.h"
00141 
00142 /* Define some errors that are mysteriously gone from OpenLDAP 2.x */
00143 #ifndef LDAP_URL_ERR_NOTLDAP
00144 #define LDAP_URL_ERR_NOTLDAP LDAP_URL_ERR_BADSCHEME
00145 #endif
00146 
00147 #ifndef LDAP_URL_ERR_NODN
00148 #define LDAP_URL_ERR_NODN LDAP_URL_ERR_BADURL
00149 #endif
00150 
00152 #endif /* APR_HAS_LDAP */
00153 #endif /* APU_LDAP_H */

Generated on Fri Mar 4 05:10:30 2005 for Apache Portable Runtime Utility Library by  doxygen 1.4.1