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

apr_ldap.h

Go to the documentation of this file.
00001 /* ====================================================================
00002  * The Apache Software License, Version 1.1
00003  *
00004  * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
00005  * reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in
00016  *    the documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  * 3. The end-user documentation included with the redistribution,
00020  *    if any, must include the following acknowledgment:
00021  *       "This product includes software developed by the
00022  *        Apache Software Foundation (http://www.apache.org/)."
00023  *    Alternately, this acknowledgment may appear in the software itself,
00024  *    if and wherever such third-party acknowledgments normally appear.
00025  *
00026  * 4. The names "Apache" and "Apache Software Foundation" must
00027  *    not be used to endorse or promote products derived from this
00028  *    software without prior written permission. For written
00029  *    permission, please contact apache@apache.org.
00030  *
00031  * 5. Products derived from this software may not be called "Apache",
00032  *    nor may "Apache" appear in their name, without prior written
00033  *    permission of the Apache Software Foundation.
00034  *
00035  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00036  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00037  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00038  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00039  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00040  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00041  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00042  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00043  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00044  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00045  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00046  * SUCH DAMAGE.
00047  * ====================================================================
00048  *
00049  * This software consists of voluntary contributions made by many
00050  * individuals on behalf of the Apache Software Foundation.  For more
00051  * information on the Apache Software Foundation, please see
00052  * <http://www.apache.org/>.
00053  */
00054 
00055 /*
00056  * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h
00057  */
00062 #ifndef APU_LDAP_H
00063 #define APU_LDAP_H
00064 
00072 /*
00073  * This switches LDAP support on or off.
00074  */
00075 
00076 /* this will be defined if LDAP support was compiled into apr-util */
00077 #define APR_HAS_LDAP              1
00078 
00079 /* this whole thing disappears if LDAP is not enabled */
00080 #if !APR_HAS_LDAP
00081 
00082 #define APR_HAS_NETSCAPE_LDAPSDK    0
00083 #define APR_HAS_NOVELL_LDAPSDK      0
00084 #define APR_HAS_OPENLDAP_LDAPSDK    0
00085 #define APR_HAS_MICROSOFT_LDAPSDK   0
00086 #define APR_HAS_OTHER_LDAPSDK       0
00087 
00088 #define APR_HAS_LDAP_SSL            0
00089 #define APR_HAS_LDAP_URL_PARSE    0
00090 
00091 
00092 #else /* ldap support available */
00093 
00094 #ifdef APR_NOT_READY_YET
00095 /* FIXME: this code awaits support from apu-conf.m4 */
00096 
00097    /* There a several LDAPv3 SDKs available on various platforms
00098     * define which LDAP SDK is used 
00099  */
00100 #define APR_HAS_NETSCAPE_LDAPSDK    @apu_has_ldap_netscape@
00101 #define APR_HAS_NOVELL_LDAPSDK      @apu_has_ldap_novell@
00102 #define APR_HAS_OPENLDAP_LDAPSDK    @apu_has_ldap_openldap@
00103 #define APR_HAS_MICROSOFT_LDAPSDK   @apu_has_ldap_microsoft@
00104 #define APR_HAS_OTHER_LDAPSDK       @apu_has_ldap_other@
00105 
00106    /* define if LDAP SSL support is available 
00107    */
00108 #define APR_HAS_LDAP_SSL            @apu_has_ldap_ssl@
00109 
00110 #else /* APR_NOT_READY_YET */
00111 
00112 /* FIXME: remove this when above code works.  Default to build with
00113  * OpenLDAP until apu-conf.m4 support exists */
00114 #define APR_HAS_OPENLDAP_LDAPSDK 1 
00115 #define APR_HAS_LDAP_SSL 1
00116 
00117 #endif /* APR_NOT_READY_YET */
00118 
00119    /* If no APR_HAS_xxx_LDAPSDK is defined error out
00120     * Define if the SDK supports the ldap_url_parse function 
00121    */
00122 #if APR_HAS_NETSCAPE_LDAPSDK 
00123    #define APR_HAS_LDAP_URL_PARSE      1
00124 #elif APR_HAS_NOVELL_LDAPSDK 
00125    #define APR_HAS_LDAP_URL_PARSE      1
00126 #elif APR_HAS_OPENLDAP_LDAPSDK
00127    #define APR_HAS_LDAP_URL_PARSE      1
00128 #elif APR_HAS_MICROSOFT_LDAPSDK
00129    #define APR_HAS_LDAP_URL_PARSE      0
00130 #elif APR_HAS_OTHER_LDAPSDK
00131    #define APR_HAS_LDAP_URL_PARSE      0
00132 #else 
00133    #define APR_HAS_LDAP_URL_PARSE      0
00134    #error "ERROR no LDAP SDK defined!"
00135 #endif
00136 
00137 /* These are garbage, our public macros are always APR_HAS_ prefixed,
00138  * and use 0/1 values, not defined/undef semantics.  
00139  *
00140  * Will be deprecated in APR 1.0
00141  */
00142 #if APR_HAS_LDAP
00143 #define APU_HAS_LDAP
00144 #endif
00145 
00146 /* LDAP header files */
00147 
00148 #if APR_HAS_NETSCAPE_LDAPSDK
00149 #include <ldap.h>
00150 #include <lber.h>
00151 #if APR_HAS_LDAP_SSL 
00152 
00153 #endif
00154 #endif
00155 
00156 #if APR_HAS_NOVELL_LDAPSDK
00157 #include <ldap.h>
00158 #include <lber.h>
00159 #if APR_HAS_LDAP_SSL 
00160 
00161 #endif
00162 #endif
00163 
00164 #if APR_HAS_OPENLDAP_LDAPSDK
00165 #include <ldap.h>
00166 #include <lber.h>
00167 #endif
00168 
00169 /* LDAPv2 SDKs don't use const parameters in their prototypes.  
00170  * LDAPv3 SDKs do use const.  When compiling with LDAPv2 SDKs, const_cast 
00171  * casts away the constness, but won't under LDAPv3 
00172  */
00173 #if LDAP_VERSION_MAX <= 2
00174 #define const_cast(x) ((char *)(x))
00175 #else
00176 #define const_cast(x) (x)
00177 #endif 
00178 
00179 #include "apr_ldap_url.h"
00180 
00181 /* Define some errors that are mysteriously gone from OpenLDAP 2.x */
00182 #ifndef LDAP_URL_ERR_NOTLDAP
00183 #define LDAP_URL_ERR_NOTLDAP LDAP_URL_ERR_BADSCHEME
00184 #endif
00185 
00186 #ifndef LDAP_URL_ERR_NODN
00187 #define LDAP_URL_ERR_NODN LDAP_URL_ERR_BADURL
00188 #endif
00189 
00191 #endif /* APR_HAS_LDAP */
00192 #endif /* APU_LDAP_H */

Generated on Tue Dec 7 18:34:56 2010 for Apache Portable Runtime Utility Library by  doxygen 1.3.9.1