Skip to content
Snippets Groups Projects
Commit 02e52db7 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard
Browse files

libs: Import code from upstream openldap 2.5.13.

Minimal set of files to compile libldap and liblber client libraries.
parent 0b09db59
No related branches found
No related tags found
No related merge requests found
Showing
with 1205 additions and 0 deletions
......@@ -1558,6 +1558,7 @@ enable_gsm
enable_jpeg
enable_jxr
enable_lcms2
enable_ldap
enable_mfuuid
enable_mpg123
enable_png
......@@ -22160,6 +22161,7 @@ wine_fn_config_makefile libs/gsm enable_gsm
wine_fn_config_makefile libs/jpeg enable_jpeg
wine_fn_config_makefile libs/jxr enable_jxr
wine_fn_config_makefile libs/lcms2 enable_lcms2
wine_fn_config_makefile libs/ldap enable_ldap
wine_fn_config_makefile libs/mfuuid enable_mfuuid
wine_fn_config_makefile libs/mpg123 enable_mpg123
wine_fn_config_makefile libs/png enable_png
......
......@@ -3327,6 +3327,7 @@ WINE_CONFIG_MAKEFILE(libs/gsm)
WINE_CONFIG_MAKEFILE(libs/jpeg)
WINE_CONFIG_MAKEFILE(libs/jxr)
WINE_CONFIG_MAKEFILE(libs/lcms2)
WINE_CONFIG_MAKEFILE(libs/ldap)
WINE_CONFIG_MAKEFILE(libs/mfuuid)
WINE_CONFIG_MAKEFILE(libs/mpg123)
WINE_CONFIG_MAKEFILE(libs/png)
......
Copyright 1998-2022 The OpenLDAP Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted only as authorized by the OpenLDAP
Public License.
A copy of this license is available in the file LICENSE in the
top-level directory of the distribution or, alternatively, at
<http://www.OpenLDAP.org/license.html>.
OpenLDAP is a registered trademark of the OpenLDAP Foundation.
Individual files and/or contributed packages may be copyright by
other parties and/or subject to additional restrictions.
This work is derived from the University of Michigan LDAP v3.3
distribution. Information concerning this software is available
at <http://www.umich.edu/~dirsvcs/ldap/ldap.html>.
This work also contains materials derived from public sources.
Additional information about OpenLDAP can be obtained at
<http://www.openldap.org/>.
---
Portions Copyright 1998-2013 Kurt D. Zeilenga.
Portions Copyright 1998-2006 Net Boolean Incorporated.
Portions Copyright 2001-2006 IBM Corporation.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted only as authorized by the OpenLDAP
Public License.
---
Portions Copyright 1999-2008 Howard Y.H. Chu.
Portions Copyright 1999-2008 Symas Corporation.
Portions Copyright 1998-2003 Hallvard B. Furuseth.
Portions Copyright 2007-2011 Gavin Henry.
Portions Copyright 2007-2011 Suretec Systems Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that this notice is preserved.
The names of the copyright holders may not be used to endorse or
promote products derived from this software without their specific
prior written permission. This software is provided ``as is''
without express or implied warranty.
---
Portions Copyright (c) 1992-1996 Regents of the University of Michigan.
All rights reserved.
Redistribution and use in source and binary forms are permitted
provided that this notice is preserved and that due credit is given
to the University of Michigan at Ann Arbor. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission. This
software is provided ``as is'' without express or implied warranty.
The OpenLDAP Public License
Version 2.8, 17 August 2003
Redistribution and use of this software and associated documentation
("Software"), with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions in source form must retain copyright statements
and notices,
2. Redistributions in binary form must reproduce applicable copyright
statements and notices, this list of conditions, and the following
disclaimer in the documentation and/or other materials provided
with the distribution, and
3. Redistributions must contain a verbatim copy of this document.
The OpenLDAP Foundation may revise this license from time to time.
Each revision is distinguished by a version number. You may use
this Software under terms of this license revision or under the
terms of any subsequent revision of the license.
THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
The names of the authors and copyright holders must not be used in
advertising or otherwise to promote the sale, use or other dealing
in this Software without specific, written prior permission. Title
to copyright in this Software shall at all times remain with copyright
holders.
OpenLDAP is a registered trademark of the OpenLDAP Foundation.
Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
California, USA. All Rights Reserved. Permission to copy and
distribute verbatim copies of this document is granted.
EXTLIB = libldap.a
EXTRAINCL = -I$(srcdir)/include
EXTRADEFS = -D_TIMEVAL_DEFINED
C_SRCS = \
liblber/bprint.c \
liblber/decode.c \
liblber/encode.c \
liblber/io.c \
liblber/memory.c \
liblber/nt_err.c \
liblber/options.c \
liblber/sockbuf.c \
libldap/abandon.c \
libldap/add.c \
libldap/avl.c \
libldap/bind.c \
libldap/charray.c \
libldap/compare.c \
libldap/controls.c \
libldap/cyrus.c \
libldap/delete.c \
libldap/error.c \
libldap/extended.c \
libldap/fetch.c \
libldap/filter.c \
libldap/free.c \
libldap/getattr.c \
libldap/getdn.c \
libldap/getentry.c \
libldap/getvalues.c \
libldap/init.c \
libldap/lbase64.c \
libldap/ldif.c \
libldap/modify.c \
libldap/modrdn.c \
libldap/open.c \
libldap/options.c \
libldap/os-ip.c \
libldap/pagectrl.c \
libldap/print.c \
libldap/references.c \
libldap/request.c \
libldap/result.c \
libldap/sasl.c \
libldap/sasl_w.c \
libldap/schema.c \
libldap/search.c \
libldap/sortctrl.c \
libldap/string.c \
libldap/tavl.c \
libldap/thr_nt.c \
libldap/tls2.c \
libldap/tls_w.c \
libldap/unbind.c \
libldap/url.c \
libldap/utf-8.c \
libldap/util-int.c \
libldap/vlvctrl.c
/* Generic assert.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_ASSERT_H
#define _AC_ASSERT_H
#undef assert
#ifdef LDAP_DEBUG
#if defined( HAVE_ASSERT_H ) || defined( STDC_HEADERS )
#undef NDEBUG
#include <assert.h>
#else /* !(HAVE_ASSERT_H || STDC_HEADERS) */
#define LDAP_NEED_ASSERT 1
/*
* no assert()... must be a very old compiler.
* create a replacement and hope it works
*/
LBER_F (void) ber_pvt_assert LDAP_P(( const char *file, int line,
const char *test ));
/* Can't use LDAP_STRING(test), that'd expand to "test" */
#if defined(__STDC__) || defined(__cplusplus)
#define assert(test) \
((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, #test ) )
#else
#define assert(test) \
((test) ? (void)0 : ber_pvt_assert( __FILE__, __LINE__, "test" ) )
#endif
#endif /* (HAVE_ASSERT_H || STDC_HEADERS) */
#else /* !LDAP_DEBUG */
/* no asserts */
#define assert(test) ((void)0)
#endif /* LDAP_DEBUG */
#endif /* _AC_ASSERT_H */
/* Generic bytes.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_BYTES_H
#define _AC_BYTES_H
/* cross compilers should define both AC_INT{2,4}_TYPE in CPPFLAGS */
#if !defined( AC_INT4_TYPE )
/* use autoconf defines to provide sized typedefs */
# if SIZEOF_LONG == 4
# define AC_INT4_TYPE long
# elif SIZEOF_INT == 4
# define AC_INT4_TYPE int
# elif SIZEOF_SHORT == 4
# define AC_INT4_TYPE short
# else
# error "AC_INT4_TYPE?"
# endif
#endif
typedef AC_INT4_TYPE ac_int4;
typedef signed AC_INT4_TYPE ac_sint4;
typedef unsigned AC_INT4_TYPE ac_uint4;
#if !defined( AC_INT2_TYPE )
# if SIZEOF_SHORT == 2
# define AC_INT2_TYPE short
# elif SIZEOF_INT == 2
# define AC_INT2_TYPE int
# elif SIZEOF_LONG == 2
# define AC_INT2_TYPE long
# else
# error "AC_INT2_TYPE?"
# endif
#endif
#if defined( AC_INT2_TYPE )
typedef AC_INT2_TYPE ac_int2;
typedef signed AC_INT2_TYPE ac_sint2;
typedef unsigned AC_INT2_TYPE ac_uint2;
#endif
#ifndef BYTE_ORDER
/* cross compilers should define BYTE_ORDER in CPPFLAGS */
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
/* assume autoconf's AC_C_BIGENDIAN has been ran */
/* if it hasn't, we assume (maybe falsely) the order is LITTLE ENDIAN */
# ifdef WORDS_BIGENDIAN
# define BYTE_ORDER BIG_ENDIAN
# else
# define BYTE_ORDER LITTLE_ENDIAN
# endif
#endif /* BYTE_ORDER */
#endif /* _AC_BYTES_H */
/* Generic ctype.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_CTYPE_H
#define _AC_CTYPE_H
#include <ctype.h>
#undef TOUPPER
#undef TOLOWER
#ifdef C_UPPER_LOWER
# define TOUPPER(c) (islower(c) ? toupper(c) : (c))
# define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
#else
# define TOUPPER(c) toupper(c)
# define TOLOWER(c) tolower(c)
#endif
#endif /* _AC_CTYPE_H */
/* Generic dirent.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_DIRENT_H
#define _AC_DIRENT_H
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#elif defined(_MSC_VER)
#include <windows.h>
#ifndef MAX_PATH
#define MAX_PATH 260
#endif
struct dirent {
char *d_name;
};
typedef struct DIR {
HANDLE dir;
struct dirent data;
int first;
char buf[MAX_PATH+1];
} DIR;
DIR *opendir(const char *name);
struct dirent *readdir(DIR *dir);
int closedir(DIR *dir);
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif
#endif
#endif /* _AC_DIRENT_H */
/* Generic errno.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_ERRNO_H
#define _AC_ERRNO_H
#if defined( HAVE_ERRNO_H )
# include <errno.h>
#elif defined( HAVE_SYS_ERRNO_H )
# include <sys/errno.h>
#endif
#if defined( HAVE_SYS_ERRLIST ) && defined( DECL_SYS_ERRLIST )
/* have sys_errlist but need declaration */
LDAP_LIBC_V(int) sys_nerr;
LDAP_LIBC_V(char) *sys_errlist[];
#endif
#endif /* _AC_ERRNO_H */
/* redefine FD_SET */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
/*
* This header is to be included by portable.h to ensure
* tweaking of FD_SETSIZE is done early enough to be effective.
*/
#ifndef _AC_FDSET_H
#define _AC_FDSET_H
#if !defined( OPENLDAP_FD_SETSIZE ) && !defined( FD_SETSIZE )
# define OPENLDAP_FD_SETSIZE 4096
#endif
#ifdef OPENLDAP_FD_SETSIZE
/* assume installer desires to enlarge fd_set */
# ifdef HAVE_BITS_TYPES_H
# include <bits/types.h>
# endif
# ifdef __FD_SETSIZE
# undef __FD_SETSIZE
# define __FD_SETSIZE OPENLDAP_FD_SETSIZE
# else
# define FD_SETSIZE OPENLDAP_FD_SETSIZE
# endif
#endif
#endif /* _AC_FDSET_H */
/* localize.h (i18n/l10n) */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_LOCALIZE_H
#define _AC_LOCALIZE_H
#ifdef LDAP_LOCALIZE
# include <locale.h>
# include <libintl.h>
/* enable i18n/l10n */
# define gettext_noop(s) s
# define _(s) gettext(s)
# define N_(s) gettext_noop(s)
# define ldap_pvt_setlocale(c,l) ((void) setlocale(c, l))
# define ldap_pvt_textdomain(d) ((void) textdomain(d))
# define ldap_pvt_bindtextdomain(p,d) ((void) bindtextdomain(p, d))
#else
/* disable i18n/l10n */
# define _(s) s
# define N_(s) s
# define ldap_pvt_setlocale(c,l) ((void) 0)
# define ldap_pvt_textdomain(d) ((void) 0)
# define ldap_pvt_bindtextdomain(p,d) ((void) 0)
#endif
#endif /* _AC_LOCALIZE_H */
/* Generic param.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_PARAM_H
#define _AC_PARAM_H
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
/* MAXPATHLEN should come from <unistd.h> */
#include <ac/unistd.h>
#ifndef MAXPATHLEN
# if defined(PATH_MAX)
# define MAXPATHLEN PATH_MAX
# elif defined(_MAX_PATH)
# define MAXPATHLEN _MAX_PATH
# else
# define MAXPATHLEN 4096
# endif
#endif
#endif /* _AC_PARAM_H */
/* Generic signal.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_SIGNAL_H
#define _AC_SIGNAL_H
#include <signal.h>
#undef SIGNAL
#if defined( HAVE_SIGACTION )
#define SIGNAL lutil_sigaction
typedef void (*lutil_sig_t)(int);
LDAP_LUTIL_F(lutil_sig_t) lutil_sigaction( int sig, lutil_sig_t func );
#define SIGNAL_REINSTALL(sig,act) (void)0
#elif defined( HAVE_SIGSET )
#define SIGNAL sigset
#define SIGNAL_REINSTALL sigset
#else
#define SIGNAL signal
#define SIGNAL_REINSTALL signal
#endif
#if !defined( LDAP_SIGUSR1 ) || !defined( LDAP_SIGUSR2 )
#undef LDAP_SIGUSR1
#undef LDAP_SIGUSR2
# if defined(WINNT) || defined(_WINNT) || defined(_WIN32)
# define LDAP_SIGUSR1 SIGILL
# define LDAP_SIGUSR2 SIGTERM
# elif !defined(HAVE_LINUX_THREADS)
# define LDAP_SIGUSR1 SIGUSR1
# define LDAP_SIGUSR2 SIGUSR2
# else
/*
* Some versions of LinuxThreads unfortunately uses the only
* two signals reserved for user applications. This forces
* OpenLDAP to use other signals reserved for other uses.
*/
# if defined( SIGSTKFLT )
# define LDAP_SIGUSR1 SIGSTKFLT
# elif defined ( SIGSYS )
# define LDAP_SIGUSR1 SIGSYS
# endif
# if defined( SIGUNUSED )
# define LDAP_SIGUSR2 SIGUNUSED
# elif defined ( SIGINFO )
# define LDAP_SIGUSR2 SIGINFO
# elif defined ( SIGEMT )
# define LDAP_SIGUSR2 SIGEMT
# endif
# endif
#endif
#ifndef LDAP_SIGCHLD
#ifdef SIGCHLD
#define LDAP_SIGCHLD SIGCHLD
#elif SIGCLD
#define LDAP_SIGCHLD SIGCLD
#endif
#endif
#endif /* _AC_SIGNAL_H */
/* Generic socket.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_SOCKET_H_
#define _AC_SOCKET_H_
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#include <netinet/in.h>
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
#include <netdb.h>
#ifdef HAVE_RESOLV_H
#include <resolv.h>
#endif
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_WINSOCK2
#include <winsock2.h>
#include <ws2tcpip.h>
#elif HAVE_WINSOCK
#include <winsock.h>
#endif
#ifdef HAVE_PCNFS
#include <tklib.h>
#endif /* HAVE_PCNFS */
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK (0x7f000001UL)
#endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
#undef sock_errno
#undef sock_errstr
#define sock_errno() errno
#define sock_errstr(e, b, l) AC_STRERROR_R(e, b, l)
#define sock_errset(e) ((void) (errno = (e)))
#ifdef HAVE_WINSOCK
# define tcp_read( s, buf, len ) recv( s, buf, len, 0 )
# define tcp_write( s, buf, len ) send( s, buf, len, 0 )
# define ioctl( s, c, a ) ioctlsocket( (s), (c), (a) )
# define ioctl_t u_long
# define AC_SOCKET_INVALID ((unsigned int) -1)
# ifdef SD_BOTH
# define tcp_close( s ) (shutdown( s, SD_BOTH ), closesocket( s ))
# else
# define tcp_close( s ) closesocket( s )
# endif
#undef EWOULDBLOCK
#undef EINPROGRESS
#undef ETIMEDOUT
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS
#define ETIMEDOUT WSAETIMEDOUT
#undef sock_errno
#undef sock_errstr
#undef sock_errset
#define sock_errno() WSAGetLastError()
#define sock_errstr(e, b, l) ber_pvt_wsa_err2string(e)
#define sock_errset(e) WSASetLastError(e)
LBER_F( char * ) ber_pvt_wsa_err2string LDAP_P((int));
#elif MACOS
# define tcp_close( s ) tcpclose( s )
# define tcp_read( s, buf, len ) tcpread( s, buf, len )
# define tcp_write( s, buf, len ) tcpwrite( s, buf, len )
#elif DOS
# ifdef PCNFS
# define tcp_close( s ) close( s )
# define tcp_read( s, buf, len ) recv( s, buf, len, 0 )
# define tcp_write( s, buf, len ) send( s, buf, len, 0 )
# endif /* PCNFS */
# ifdef NCSA
# define tcp_close( s ) do { netclose( s ); netshut() } while(0)
# define tcp_read( s, buf, len ) nread( s, buf, len )
# define tcp_write( s, buf, len ) netwrite( s, buf, len )
# endif /* NCSA */
#elif defined(HAVE_CLOSESOCKET)
# define tcp_close( s ) closesocket( s )
# ifdef __BEOS__
# define tcp_read( s, buf, len ) recv( s, buf, len, 0 )
# define tcp_write( s, buf, len ) send( s, buf, len, 0 )
# endif
#else
# define tcp_read( s, buf, len) read( s, buf, len )
# define tcp_write( s, buf, len) write( s, buf, len )
# ifdef SHUT_RDWR
# define tcp_close( s ) (shutdown( s, SHUT_RDWR ), close( s ))
# else
# define tcp_close( s ) close( s )
# endif
#ifdef HAVE_PIPE
/*
* Only use pipe() on systems where file and socket descriptors
* are interchangeable
*/
# define USE_PIPE HAVE_PIPE
#endif
#endif /* MACOS */
#ifndef ioctl_t
# define ioctl_t int
#endif
#ifndef AC_SOCKET_INVALID
# define AC_SOCKET_INVALID (-1)
#endif
#ifndef AC_SOCKET_ERROR
# define AC_SOCKET_ERROR (-1)
#endif
#if !defined( HAVE_INET_ATON ) && !defined( inet_aton )
# define inet_aton ldap_pvt_inet_aton
struct in_addr;
LDAP_F (int) ldap_pvt_inet_aton LDAP_P(( const char *, struct in_addr * ));
#endif
#if defined(__WIN32) && defined(_ALPHA)
/* NT on Alpha is hosed. */
# define AC_HTONL( l ) \
((((l)&0xffU)<<24) + (((l)&0xff00U)<<8) + \
(((l)&0xff0000U)>>8) + (((l)&0xff000000U)>>24))
# define AC_NTOHL(l) AC_HTONL(l)
#else
# define AC_HTONL( l ) htonl( l )
# define AC_NTOHL( l ) ntohl( l )
#endif
/* htons()/ntohs() may be broken much like htonl()/ntohl() */
#define AC_HTONS( s ) htons( s )
#define AC_NTOHS( s ) ntohs( s )
#ifdef LDAP_PF_LOCAL
# if !defined( AF_LOCAL ) && defined( AF_UNIX )
# define AF_LOCAL AF_UNIX
# endif
# if !defined( PF_LOCAL ) && defined( PF_UNIX )
# define PF_LOCAL PF_UNIX
# endif
#endif
#ifndef INET_ADDRSTRLEN
# define INET_ADDRSTRLEN 16
#endif
#ifndef INET6_ADDRSTRLEN
# define INET6_ADDRSTRLEN 46
#endif
#if defined( HAVE_GETADDRINFO ) || defined( HAVE_GETNAMEINFO )
# ifdef HAVE_GAI_STRERROR
# define AC_GAI_STRERROR(x) (gai_strerror((x)))
# else
# define AC_GAI_STRERROR(x) (ldap_pvt_gai_strerror((x)))
LDAP_F (char *) ldap_pvt_gai_strerror( int );
# endif
#endif
#if defined(LDAP_PF_LOCAL) && \
!defined(HAVE_GETPEEREID) && \
!defined(HAVE_GETPEERUCRED) && \
!defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTSLEN) || \
defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL))
# define LDAP_PF_LOCAL_SENDMSG 1
#endif
#ifdef HAVE_GETPEEREID
#define LUTIL_GETPEEREID( s, uid, gid, bv ) getpeereid( s, uid, gid )
#elif defined(LDAP_PF_LOCAL_SENDMSG)
struct berval;
LDAP_LUTIL_F( int ) lutil_getpeereid( int s, uid_t *, gid_t *, struct berval *bv );
#define LUTIL_GETPEEREID( s, uid, gid, bv ) lutil_getpeereid( s, uid, gid, bv )
#else
LDAP_LUTIL_F( int ) lutil_getpeereid( int s, uid_t *, gid_t * );
#define LUTIL_GETPEEREID( s, uid, gid, bv ) lutil_getpeereid( s, uid, gid )
#endif
typedef union Sockaddr {
struct sockaddr sa_addr;
struct sockaddr_in sa_in_addr;
#ifdef LDAP_PF_INET6
struct sockaddr_storage sa_storage;
struct sockaddr_in6 sa_in6_addr;
#endif
#ifdef LDAP_PF_LOCAL
struct sockaddr_un sa_un_addr;
#endif
} Sockaddr;
/* DNS RFC defines max host name as 255. New systems seem to use 1024 */
#ifndef NI_MAXHOST
#define NI_MAXHOST 256
#endif
#ifdef HAVE_POLL
# ifndef INFTIM
# define INFTIM (-1)
# endif
#undef POLL_OTHER
#define POLL_OTHER (POLLERR|POLLHUP)
#undef POLL_READ
#define POLL_READ (POLLIN|POLLPRI|POLL_OTHER)
#undef POLL_WRITE
#define POLL_WRITE (POLLOUT|POLL_OTHER)
#endif
#endif /* _AC_SOCKET_H_ */
/* Generic stdarg.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_STDARG_H
#define _AC_STDARG_H 1
/* require STDC variable argument support */
#include <stdarg.h>
#ifndef HAVE_STDARG
# define HAVE_STDARG 1
#endif
#endif /* _AC_STDARG_H */
/* Generic stdlib.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_STDLIB_H
#define _AC_STDLIB_H
#if defined( HAVE_CSRIMALLOC )
#include <stdio.h>
#define MALLOC_TRACE
#include <libmalloc.h>
#endif
#include <stdlib.h>
/* Ignore malloc.h if we have STDC_HEADERS */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# define EXIT_FAILURE 1
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#if defined(LINE_MAX)
# define AC_LINE_MAX LINE_MAX
#else
# define AC_LINE_MAX 2048 /* POSIX MIN */
#endif
#endif /* _AC_STDLIB_H */
/* Generic string.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_STRING_H
#define _AC_STRING_H
#ifdef STDC_HEADERS
# include <string.h>
#else
# ifdef HAVE_STRING_H
# include <string.h>
# endif
# if defined(HAVE_STRINGS_H) && (!defined(HAVE_STRING_H) || defined(BOTH_STRINGS_H))
# include <strings.h>
# endif
# ifdef HAVE_MEMORY_H
# include <memory.h>
# endif
# ifndef HAVE_STRRCHR
# undef strchr
# define strchr index
# undef strrchr
# define strrchr rindex
# endif
# ifndef HAVE_MEMCPY
# undef memcpy
# define memcpy(d, s, n) ((void) bcopy ((s), (d), (n)))
# undef memmove
# define memmove(d, s, n) ((void) bcopy ((s), (d), (n)))
# endif
#endif
/* use ldap_pvt_strtok instead of strtok or strtok_r! */
LDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str,
const char *delim, char **pos ));
#ifndef HAVE_STRDUP
/* strdup() is missing, declare our own version */
# undef strdup
# define strdup(s) ber_strdup(s)
#elif !defined(_WIN32)
/* some systems fail to declare strdup */
/* Windows does not require this declaration */
LDAP_LIBC_F(char *) (strdup)();
#endif
/*
* some systems fail to declare strcasecmp() and strncasecmp()
* we need them declared so we can obtain pointers to them
*/
/* we don't want these declared for Windows or Mingw */
#ifndef _WIN32
int (strcasecmp)();
int (strncasecmp)();
#endif
#ifndef SAFEMEMCPY
# if defined( HAVE_MEMMOVE )
# define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n))
# elif defined( HAVE_BCOPY )
# define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n))
# else
/* nothing left but memcpy() */
# define SAFEMEMCPY( d, s, n ) memcpy((d), (s), (n))
# endif
#endif
#define AC_MEMCPY( d, s, n ) (SAFEMEMCPY((d),(s),(n)))
#define AC_FMEMCPY( d, s, n ) do { \
if((n) == 1) *((char*)(d)) = *((char*)(s)); \
else AC_MEMCPY( (d), (s), (n) ); \
} while(0)
#ifdef NEED_MEMCMP_REPLACEMENT
int (lutil_memcmp)(const void *b1, const void *b2, size_t len);
#define memcmp lutil_memcmp
#endif
void *(lutil_memrchr)(const void *b, int c, size_t n);
/* GNU extension (glibc >= 2.1.91), only declared when defined(_GNU_SOURCE) */
#if defined(HAVE_MEMRCHR) && defined(_GNU_SOURCE)
#define lutil_memrchr(b, c, n) memrchr(b, c, n)
#endif /* ! HAVE_MEMRCHR */
#define STRLENOF(s) (sizeof(s)-1)
#if defined( HAVE_NONPOSIX_STRERROR_R )
# define AC_STRERROR_R(e,b,l) (strerror_r((e), (b), (l)))
#elif defined( HAVE_STRERROR_R )
# define AC_STRERROR_R(e,b,l) (strerror_r((e), (b), (l)) == 0 ? (b) : "Unknown error")
#elif defined( HAVE_SYS_ERRLIST )
# define AC_STRERROR_R(e,b,l) ((e) > -1 && (e) < sys_nerr \
? sys_errlist[(e)] : "Unknown error" )
#elif defined( HAVE_STRERROR )
# define AC_STRERROR_R(e,b,l) (strerror(e)) /* NOTE: may be NULL */
#else
# define AC_STRERROR_R(e,b,l) ("Unknown error")
#endif
#endif /* _AC_STRING_H */
/* Generic time.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_TIME_H
#define _AC_TIME_H
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#elif defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
# ifdef HAVE_SYS_TIMEB_H
# include <sys/timeb.h>
# endif
#else
# include <time.h>
#endif
#if defined(_WIN32) && !defined(HAVE_CLOCK_GETTIME)
struct timespec {
time_t tv_sec;
int tv_nsec;
};
#endif
#endif /* _AC_TIME_H */
/* Generic unistd.h */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2022 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _AC_UNISTD_H
#define _AC_UNISTD_H
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_PROCESS_H
# include <process.h>
#endif
/* note: callers of crypt(3) should include <ac/crypt.h> */
#if defined(HAVE_GETPASSPHRASE)
LDAP_LIBC_F(char*)(getpassphrase)();
#else
#define getpassphrase(p) lutil_getpass(p)
LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
#endif
/* getopt() defines may be in separate include file */
#ifdef HAVE_GETOPT_H
# include <getopt.h>
#elif !defined(HAVE_GETOPT)
/* no getopt, assume we need getopt-compat.h */
# include <getopt-compat.h>
#else
/* assume we need to declare these externs */
LDAP_LIBC_V (char *) optarg;
LDAP_LIBC_V (int) optind, opterr, optopt;
#endif
/* use lutil file locking */
#define ldap_lockf(x) lutil_lockf(x)
#define ldap_unlockf(x) lutil_unlockf(x)
#include <lutil_lockf.h>
/*
* Windows: although sleep() will be resolved by both MSVC and Mingw GCC
* linkers, the function is not declared in header files. This is
* because Windows' version of the function is called _sleep(), and it
* is declared in stdlib.h
*/
#ifdef _WIN32
#define sleep _sleep
#endif
#endif /* _AC_UNISTD_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment