From 14741c26d90d6865bf7e7d6cdd4467d5eaf6895d Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 31 Dec 1998 20:32:03 +0000 Subject: [PATCH] Update copyright of build environment, includes, and liblber/libldap. --- COPYRIGHT | 2 +- Makefile.in | 11 +- acconfig.h | 3 + acinclude.m4 | 2 + aclocal.m4 | 2 + build/dir.mk | 3 + build/info.mk | 9 ++ build/lib-shared.mk | 3 + build/lib-static.mk | 3 + build/lib.mk | 3 + build/man.mk | 3 + build/openldap.m4 | 2 + build/rules.mk | 3 + build/srv.mk | 3 + build/top.mk | 10 +- configure.in | 5 +- include/ac/alloca.h | 33 +++++ include/ac/bytes.h | 9 ++ include/ac/ctype.h | 25 ++++ include/ac/dirent.h | 32 +++++ include/ac/errno.h | 28 ++++ include/ac/krb.h | 30 +++++ include/ac/regex.h | 32 +++++ include/ac/setproctitle.h | 9 ++ include/ac/signal.h | 9 ++ include/ac/socket.h | 9 ++ include/ac/stdarg.h | 9 ++ include/ac/string.h | 9 ++ include/ac/syslog.h | 32 +++++ include/ac/termios.h | 9 ++ include/ac/time.h | 24 ++++ include/ac/unistd.h | 9 ++ include/ac/wait.h | 34 +++++ include/avl.h | 11 +- include/disptmpl.h | 165 ++++++++++++------------ include/getopt-compat.h | 23 ++++ include/lber.h | 9 ++ include/ldap.h | 9 ++ include/ldap_cdefs.h | 9 ++ include/ldapconfig.h.edit | 9 ++ include/ldapconfig.h.nt | 9 ++ include/ldbm.h | 219 +++++++++++++++++++------------- include/ldif.h | 37 +++--- include/lthread.h | 9 ++ include/lthread_rdwr.h | 56 ++++++++ include/lutil.h | 10 ++ include/lutil_md5.h | 10 ++ include/lutil_sha1.h | 10 ++ include/portable.h.bot | 9 ++ include/portable.h.in | 44 +++---- include/portable.h.top | 35 ++--- include/srchpref.h | 58 ++++----- include/sysexits-compat.h | 9 ++ libraries/liblber/Makefile.in | 2 + libraries/liblber/Version.c | 4 + libraries/liblber/bprint.c | 33 +++-- libraries/liblber/decode.c | 4 + libraries/liblber/dtest.c | 4 + libraries/liblber/encode.c | 4 + libraries/liblber/etest.c | 4 + libraries/liblber/idtest.c | 4 + libraries/liblber/io.c | 4 + libraries/libldap/Makefile.in | 2 + libraries/libldap/Version.c | 4 + libraries/libldap/abandon.c | 48 +++---- libraries/libldap/add.c | 29 ++--- libraries/libldap/addentry.c | 26 ++-- libraries/libldap/bind.c | 33 ++--- libraries/libldap/cache.c | 119 +++++++++-------- libraries/libldap/charset.c | 48 +++---- libraries/libldap/cldap.c | 8 +- libraries/libldap/compare.c | 32 ++--- libraries/libldap/delete.c | 28 ++-- libraries/libldap/disptmpl.c | 4 + libraries/libldap/dsparse.c | 4 + libraries/libldap/error.c | 5 + libraries/libldap/free.c | 26 ++-- libraries/libldap/friendly.c | 8 +- libraries/libldap/getattr.c | 28 ++-- libraries/libldap/getdn.c | 8 +- libraries/libldap/getdxbyname.c | 4 + libraries/libldap/getentry.c | 26 ++-- libraries/libldap/getfilter.c | 8 +- libraries/libldap/getvalues.c | 26 ++-- libraries/libldap/init.c | 4 + libraries/libldap/kbind.c | 8 +- libraries/libldap/ldap-int.h | 4 + libraries/libldap/modify.c | 24 ++-- libraries/libldap/modrdn.c | 24 ++-- libraries/libldap/open.c | 8 +- libraries/libldap/os-ip.c | 4 + libraries/libldap/request.c | 8 +- libraries/libldap/result.c | 8 +- libraries/libldap/sbind.c | 28 ++-- libraries/libldap/search.c | 8 +- libraries/libldap/sort.c | 4 + libraries/libldap/srchpref.c | 4 + libraries/libldap/strdup.c | 5 + libraries/libldap/test.c | 5 + libraries/libldap/tmplout.c | 4 + libraries/libldap/tmpltest.c | 4 + libraries/libldap/ufn.c | 8 +- libraries/libldap/unbind.c | 49 +++---- libraries/libldap/url.c | 8 +- 104 files changed, 1272 insertions(+), 693 deletions(-) create mode 100644 build/info.mk create mode 100644 include/ac/alloca.h create mode 100644 include/ac/ctype.h create mode 100644 include/ac/dirent.h create mode 100644 include/ac/errno.h create mode 100644 include/ac/krb.h create mode 100644 include/ac/regex.h create mode 100644 include/ac/syslog.h create mode 100644 include/ac/time.h create mode 100644 include/ac/wait.h create mode 100644 include/getopt-compat.h create mode 100644 include/lthread_rdwr.h diff --git a/COPYRIGHT b/COPYRIGHT index 656e04b5ec..52e83ca31c 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA +Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA All rights reserved. Redistribution and use in source and binary forms are permitted only diff --git a/Makefile.in b/Makefile.in index 91866269b1..f564426626 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,13 @@ # Master Makefile for OpenLDAP -# Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. -# COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA +## All rights reserved. +## +## Redistribution and use in source and binary forms are permitted only +## as authorized by the OpenLDAP Public License. A copy of this +## license is available at http://www.OpenLDAP.org/license.html or +## in file LICENSE in the top-level directory of the distribution. +## SUBDIRS= include libraries clients servers # contrib CLEANDIRS= tests doc diff --git a/acconfig.h b/acconfig.h index f900d8952e..d5d43c58e2 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,7 @@ /* acconfig.h + Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. + COPYING RESTRICTIONS APPLY, See COPYRIGHT file + Descriptive text for the C preprocessor macros that the distributed Autoconf macros can define. diff --git a/acinclude.m4 b/acinclude.m4 index 2861ae0daa..0cb4fecf5e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,3 +1,5 @@ +dnl Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file dnl dnl OpenLDAP Autoconf Macros dnl diff --git a/aclocal.m4 b/aclocal.m4 index 73203f1438..65d59a0af8 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -10,6 +10,8 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. +dnl Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file dnl dnl OpenLDAP Autoconf Macros dnl diff --git a/build/dir.mk b/build/dir.mk index 70a8f6692b..ebf4d813e7 100644 --- a/build/dir.mk +++ b/build/dir.mk @@ -1,3 +1,6 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. ##--------------------------------------------------------------------------- ## ## Makes subdirectories diff --git a/build/info.mk b/build/info.mk new file mode 100644 index 0000000000..0fed4f8071 --- /dev/null +++ b/build/info.mk @@ -0,0 +1,9 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. +##--------------------------------------------------------------------------- +## +## Makefile Template for Non-Source Directories +## + +Makefile: $(top_srcdir)/build/info.mk diff --git a/build/lib-shared.mk b/build/lib-shared.mk index 76774428f8..59fc6e9637 100644 --- a/build/lib-shared.mk +++ b/build/lib-shared.mk @@ -1,3 +1,6 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. ##--------------------------------------------------------------------------- ## ## Makefile Template for Shared Libraries diff --git a/build/lib-static.mk b/build/lib-static.mk index a4862ff0a3..76bcee07aa 100644 --- a/build/lib-static.mk +++ b/build/lib-static.mk @@ -1,3 +1,6 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. ##--------------------------------------------------------------------------- ## ## Makefile Template for Static Libraries diff --git a/build/lib.mk b/build/lib.mk index d92d72503d..842967089c 100644 --- a/build/lib.mk +++ b/build/lib.mk @@ -1,3 +1,6 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. ##--------------------------------------------------------------------------- ## ## Makefile Template for Libraries diff --git a/build/man.mk b/build/man.mk index 3fd3bdfa99..f93c1e5fb3 100644 --- a/build/man.mk +++ b/build/man.mk @@ -1,3 +1,6 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. ##--------------------------------------------------------------------------- ## ## Makefile Template for Manual Pages diff --git a/build/openldap.m4 b/build/openldap.m4 index 31439d60da..7ef07906e8 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -1,3 +1,5 @@ +dnl Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file dnl dnl OpenLDAP Autoconf Macros dnl diff --git a/build/rules.mk b/build/rules.mk index 370a9c587a..6594584c2a 100644 --- a/build/rules.mk +++ b/build/rules.mk @@ -1,3 +1,6 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. ##--------------------------------------------------------------------------- ## ## Makefile Template for Programs diff --git a/build/srv.mk b/build/srv.mk index 5b4e373da9..4e5f819a64 100644 --- a/build/srv.mk +++ b/build/srv.mk @@ -1,3 +1,6 @@ +## Copyright 1998,1999 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. ##--------------------------------------------------------------------------- ## ## Makefile Template for Servers diff --git a/build/top.mk b/build/top.mk index 59f6732c2b..c0516a8e2d 100644 --- a/build/top.mk +++ b/build/top.mk @@ -1,7 +1,11 @@ ## -## Copyright 1998 The OpenLDAP Foundation -## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory -## of this package for details. +## Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA +## All rights reserved. +## +## Redistribution and use in source and binary forms are permitted only +## as authorized by the OpenLDAP Public License. A copy of this +## license is available at http://www.OpenLDAP.org/license.html or +## in file LICENSE in the top-level directory of the distribution. ## PACKAGE= @PACKAGE@ VERSION= @VERSION@ diff --git a/configure.in b/configure.in index 8b058b0e93..0bbb59347c 100644 --- a/configure.in +++ b/configure.in @@ -1,10 +1,11 @@ -dnl Copyright 1998 The OpenLDAP Foundation. All Rights Reserved. +dnl +dnl Copyright 1998,1999 The OpenLDAP Foundation. All Rights Reserved. dnl dnl Redistribution and use in source and binary forms are permitted only dnl as authorized by the OpenLDAP Public License. A copy of this dnl license is available at http://www.OpenLDAP.org/license.html or dnl in file LICENSE in the top-level directory of the distribution. -dnl ---- +dnl dnl Configure.in for OpenLDAP AC_INIT(include/ldap.h)dnl diff --git a/include/ac/alloca.h b/include/ac/alloca.h new file mode 100644 index 0000000000..69e823d841 --- /dev/null +++ b/include/ac/alloca.h @@ -0,0 +1,33 @@ +/* Generic alloca.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _AC_ALLOCA_H +#define _AC_ALLOCA_H + +/* AIX requires this to be the first thing in the file. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX +#pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + + +#endif /* _AC_ALLOCA_H */ diff --git a/include/ac/bytes.h b/include/ac/bytes.h index 5d479442c5..74265604a3 100644 --- a/include/ac/bytes.h +++ b/include/ac/bytes.h @@ -1,4 +1,13 @@ /* Generic bytes.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_BYTES_H #define _AC_BYTES_H diff --git a/include/ac/ctype.h b/include/ac/ctype.h new file mode 100644 index 0000000000..b58d96fc6f --- /dev/null +++ b/include/ac/ctype.h @@ -0,0 +1,25 @@ +/* Generic ctype.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _AC_CTYPE_H +#define _AC_CTYPE_H + +#include + +#ifdef C_UPPER_LOWER +# define TOUPPER(c) (islower(c) ? toupper(c) : (c)) +# define TOLOWER(c) (islower(c) ? toupper(c) : (c)) +#else +# define TOUPPER(c) toupper(c) +# define TOLOWER(c) tolower(c) +#endif + +#endif /* _AC_CTYPE_H */ diff --git a/include/ac/dirent.h b/include/ac/dirent.h new file mode 100644 index 0000000000..e58dda8bb2 --- /dev/null +++ b/include/ac/dirent.h @@ -0,0 +1,32 @@ +/* Generic dirent.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _AC_DIRENT_H +#define _AC_DIRENT_H + +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#endif /* _AC_DIRENT_H */ diff --git a/include/ac/errno.h b/include/ac/errno.h new file mode 100644 index 0000000000..49e03fb757 --- /dev/null +++ b/include/ac/errno.h @@ -0,0 +1,28 @@ +/* Generic errno.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _AC_ERRNO_H +#define _AC_ERRNO_H + +#if defined( HAVE_ERRNO_H ) +# include +#elif defined( HAVE_SYS_ERRNO_H ) +# include +#endif + +#ifdef DECL_SYS_ERRLIST +extern int sys_nerr; +extern char *sys_errlist[]; +#endif + +/* use _POSIX_VERSION for POSIX.1 code */ + +#endif /* _AC_ERRNO_H */ diff --git a/include/ac/krb.h b/include/ac/krb.h new file mode 100644 index 0000000000..05a2774a86 --- /dev/null +++ b/include/ac/krb.h @@ -0,0 +1,30 @@ +/* Generic krb.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _AC_KRB_H +#define _AC_KRB_H + +#if defined( HAVE_KERBEROS ) + +#if defined( HAVE_KERBEROSIV_KRB_H ) +#include +#elif defined( HAVE_KRB_H ) +#include +#endif + +#if defined( HAVE_KERBEROSIV_DES_H ) +#include +#elif defined( HAVE_DES_H ) +#include +#endif + +#endif /* HAVE_KERBEROS */ +#endif /* _AC_KRB_H */ diff --git a/include/ac/regex.h b/include/ac/regex.h new file mode 100644 index 0000000000..87033a8b7e --- /dev/null +++ b/include/ac/regex.h @@ -0,0 +1,32 @@ +/* + * Generic Regex + */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +#ifndef _AC_REGEX_H_ +#define _AC_REGEX_H_ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifndef HAVE_REGEX_H +/* NO POSIX REGEX!! + you'll need to install a POSIX compatible REGEX library. + Either Henry Spencer's or GNU regex will do. + + For NT: http://people.delphi.com/gjc/hs_regex.html +*/ +#else + /* have regex.h, assume it's POSIX compliant */ +# include +#endif /* regex.h */ + +#endif /* _AC_REGEX_H_ */ diff --git a/include/ac/setproctitle.h b/include/ac/setproctitle.h index ac1c6a2472..2866d211f5 100644 --- a/include/ac/setproctitle.h +++ b/include/ac/setproctitle.h @@ -1,4 +1,13 @@ /* Generic setproctitle.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_SETPROCTITLE_H #define _AC_SETPROCTITLE_H diff --git a/include/ac/signal.h b/include/ac/signal.h index b850e75894..3ab614f581 100644 --- a/include/ac/signal.h +++ b/include/ac/signal.h @@ -1,4 +1,13 @@ /* Generic signal.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_SIGNAL_H #define _AC_SIGNAL_H diff --git a/include/ac/socket.h b/include/ac/socket.h index ced2879abf..fff336918e 100644 --- a/include/ac/socket.h +++ b/include/ac/socket.h @@ -1,6 +1,15 @@ /* * Generic socket.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_SOCKET_H_ #define _AC_SOCKET_H_ diff --git a/include/ac/stdarg.h b/include/ac/stdarg.h index acd5483c0e..2f9671be08 100644 --- a/include/ac/stdarg.h +++ b/include/ac/stdarg.h @@ -1,4 +1,13 @@ /* Generic stdarg.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_STDARG_H #define _AC_STDARG_H 1 diff --git a/include/ac/string.h b/include/ac/string.h index 6a64074e6f..7a799e0d7f 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -1,4 +1,13 @@ /* Generic string.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_STRING_H #define _AC_STRING_H diff --git a/include/ac/syslog.h b/include/ac/syslog.h new file mode 100644 index 0000000000..0b2262429c --- /dev/null +++ b/include/ac/syslog.h @@ -0,0 +1,32 @@ +/* + * Generic syslog.h + */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +#ifndef _AC_SYSLOG_H_ +#define _AC_SYSLOG_H_ + +#if defined( HAVE_SYSLOG_H ) +#include +#elif defined ( HAVE_SYS_SYSLOG_H ) +#include +#endif + +#if defined( LOG_NDELAY ) && defined( LOG_NOWAIT ) +# define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY | LOG_NOWAIT ) +#elif defined( LOG_NDELAY ) +# define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY ) +#elif defined( LOG_NOWAIT ) +# define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT ) +#else +# define OPENLOG_OPTIONS ( LOG_PID ) +#endif + +#endif /* _AC_SYSLOG_H_ */ diff --git a/include/ac/termios.h b/include/ac/termios.h index 8788d73029..e56eedb0d3 100644 --- a/include/ac/termios.h +++ b/include/ac/termios.h @@ -1,4 +1,13 @@ /* Generic termios.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_TERMIOS_H #define _AC_TERMIOS_H diff --git a/include/ac/time.h b/include/ac/time.h new file mode 100644 index 0000000000..8bdf4c5d02 --- /dev/null +++ b/include/ac/time.h @@ -0,0 +1,24 @@ +/* Generic time.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _AC_TIME_H +#define _AC_TIME_H + +#if TIME_WITH_SYS_TIME +# include +# include +#elif HAVE_SYS_TIME_H +# include +#else +# include +#endif + +#endif /* _AC_TIME_H */ diff --git a/include/ac/unistd.h b/include/ac/unistd.h index 0e2f40acd2..f0d9c1ad72 100644 --- a/include/ac/unistd.h +++ b/include/ac/unistd.h @@ -1,4 +1,13 @@ /* Generic unistd.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _AC_UNISTD_H #define _AC_UNISTD_H diff --git a/include/ac/wait.h b/include/ac/wait.h new file mode 100644 index 0000000000..30da21643c --- /dev/null +++ b/include/ac/wait.h @@ -0,0 +1,34 @@ +/* Generic wait.h */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _AC_WAIT_H +#define _AC_WAIT_H + +#include + +#if HAVE_SYS_WAIT_H +# include +#endif + +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +#ifdef WCONTINUED +# define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED ) +#else +# define WAIT_FLAGS ( WNOHANG | WUNTRACED ) +#endif + +#endif /* _AC_WAIT_H */ diff --git a/include/avl.h b/include/avl.h index 651b9026d8..b514b3060f 100644 --- a/include/avl.h +++ b/include/avl.h @@ -1,5 +1,13 @@ -/* avl.h - avl tree definitions */ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1993 Regents of the University of Michigan. * All rights reserved. * @@ -10,6 +18,7 @@ * software without specific prior written permission. This software * is provided ``as is'' without express or implied warranty. */ +/* avl.h - avl tree definitions */ #ifndef _AVL diff --git a/include/disptmpl.h b/include/disptmpl.h index c4e06ef2fe..1ab3449b1b 100644 --- a/include/disptmpl.h +++ b/include/disptmpl.h @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1993, 1994 Regents of the University of Michigan. * All rights reserved. * @@ -16,10 +25,9 @@ #ifndef _DISPTMPL_H #define _DISPTMPL_H -#ifdef __cplusplus -extern "C" { -#endif +#include +LDAP_BEGIN_DECL #define LDAP_TEMPLATE_VERSION 1 @@ -126,13 +134,13 @@ struct ldap_tmplitem { #define NULLTMPLITEM ((struct ldap_tmplitem *)0) #define LDAP_SET_TMPLITEM_APPDATA( ti, datap ) \ - (ti)->ti_appdata = (void *)(datap) + ( (ti)->ti_appdata = (void *)(datap) ) #define LDAP_GET_TMPLITEM_APPDATA( ti, type ) \ - (type)((ti)->ti_appdata) + ( (type)((ti)->ti_appdata) ) #define LDAP_IS_TMPLITEM_OPTION_SET( ti, option ) \ - (((ti)->ti_options & option ) != 0 ) + ( ((ti)->ti_options & (option) ) != 0 ) /* @@ -202,13 +210,13 @@ struct ldap_disptmpl { #define NULLDISPTMPL ((struct ldap_disptmpl *)0) #define LDAP_SET_DISPTMPL_APPDATA( dt, datap ) \ - (dt)->dt_appdata = (void *)(datap) + ( (dt)->dt_appdata = (void *)(datap) ) #define LDAP_GET_DISPTMPL_APPDATA( dt, type ) \ - (type)((dt)->dt_appdata) + ( (type)((dt)->dt_appdata) ) #define LDAP_IS_DISPTMPL_OPTION_SET( dt, option ) \ - (((dt)->dt_options & option ) != 0 ) + ( ((dt)->dt_options & (option) ) != 0 ) #define LDAP_TMPL_ERR_VERSION 1 #define LDAP_TMPL_ERR_MEM 2 @@ -221,110 +229,95 @@ struct ldap_disptmpl { #define LDAP_DTMPL_BUFSIZ 8192 -#ifndef NEEDPROTOS +typedef int (*writeptype) LDAP_P(( void *writeparm, char *p, int len )); -typedef int (*writeptype)(); +LDAP_F int +ldap_init_templates LDAP_P(( char *file, struct ldap_disptmpl **tmpllistp )); -int ldap_init_templates(); -int ldap_init_templates_buf(); -void ldap_free_templates(); -struct ldap_disptmpl *ldap_first_disptmpl(); -struct ldap_disptmpl *ldap_next_disptmpl(); -struct ldap_disptmpl *ldap_name2template(); -struct ldap_disptmpl *ldap_oc2template(); -char **ldap_tmplattrs(); -struct ldap_tmplitem *ldap_first_tmplrow(); -struct ldap_tmplitem *ldap_next_tmplrow(); -struct ldap_tmplitem *ldap_first_tmplcol(); -struct ldap_tmplitem *ldap_next_tmplcol(); -int ldap_entry2text_search(); -int ldap_entry2text(); -int ldap_vals2text(); -int ldap_entry2html_search(); -int ldap_entry2html(); -int ldap_vals2html(); +LDAP_F int +ldap_init_templates_buf LDAP_P(( char *buf, + long buflen, + struct ldap_disptmpl **tmpllistp )); -#else /* !NEEDPROTOS */ +LDAP_F void +ldap_free_templates LDAP_P(( struct ldap_disptmpl *tmpllist )); -typedef int (*writeptype)( void *writeparm, char *p, int len ); +LDAP_F struct ldap_disptmpl * +ldap_first_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist )); -LDAPFUNCDECL int -ldap_init_templates( char *file, struct ldap_disptmpl **tmpllistp ); +LDAP_F struct ldap_disptmpl * +ldap_next_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist, + struct ldap_disptmpl *tmpl )); -LDAPFUNCDECL int -ldap_init_templates_buf( char *buf, long buflen, - struct ldap_disptmpl **tmpllistp ); +LDAP_F struct ldap_disptmpl * +ldap_name2template LDAP_P(( char *name, + struct ldap_disptmpl *tmpllist )); -LDAPFUNCDECL void -ldap_free_templates( struct ldap_disptmpl *tmpllist ); +LDAP_F struct ldap_disptmpl * +ldap_oc2template LDAP_P(( char **oclist, + struct ldap_disptmpl *tmpllist )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_first_disptmpl( struct ldap_disptmpl *tmpllist ); +LDAP_F char ** +ldap_tmplattrs LDAP_P(( struct ldap_disptmpl *tmpl, + char **includeattrs, + int exclude, + unsigned long syntaxmask )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_next_disptmpl( struct ldap_disptmpl *tmpllist, - struct ldap_disptmpl *tmpl ); +LDAP_F struct ldap_tmplitem * +ldap_first_tmplrow LDAP_P(( struct ldap_disptmpl *tmpl )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_name2template( char *name, struct ldap_disptmpl *tmpllist ); +LDAP_F struct ldap_tmplitem * +ldap_next_tmplrow LDAP_P(( struct ldap_disptmpl *tmpl, + struct ldap_tmplitem *row )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_oc2template( char **oclist, struct ldap_disptmpl *tmpllist ); +LDAP_F struct ldap_tmplitem * +ldap_first_tmplcol LDAP_P(( struct ldap_disptmpl *tmpl, + struct ldap_tmplitem *row )); -LDAPFUNCDECL char ** -ldap_tmplattrs( struct ldap_disptmpl *tmpl, char **includeattrs, int exclude, - unsigned long syntaxmask ); +LDAP_F struct ldap_tmplitem * +ldap_next_tmplcol LDAP_P(( struct ldap_disptmpl *tmpl, + struct ldap_tmplitem *row, + struct ldap_tmplitem *col )); -LDAPFUNCDECL struct ldap_tmplitem * -ldap_first_tmplrow( struct ldap_disptmpl *tmpl ); - -LDAPFUNCDECL struct ldap_tmplitem * -ldap_next_tmplrow( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row ); - -LDAPFUNCDECL struct ldap_tmplitem * -ldap_first_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row ); - -LDAPFUNCDECL struct ldap_tmplitem * -ldap_next_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row, - struct ldap_tmplitem *col ); - -LDAPFUNCDECL int -ldap_entry2text( LDAP *ld, char *buf, LDAPMessage *entry, +LDAP_F int +ldap_entry2text LDAP_P(( LDAP *ld, + char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts ); + unsigned long opts )); -LDAPFUNCDECL int -ldap_vals2text( LDAP *ld, char *buf, char **vals, char *label, int labelwidth, +LDAP_F int +ldap_vals2text LDAP_P(( LDAP *ld, + char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, - char *eol, int rdncount ); + char *eol, int rdncount )); -LDAPFUNCDECL int -ldap_entry2text_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry, +LDAP_F int +ldap_entry2text_search LDAP_P(( LDAP *ld, + char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts ); + unsigned long opts )); -LDAPFUNCDECL int -ldap_entry2html( LDAP *ld, char *buf, LDAPMessage *entry, +LDAP_F int +ldap_entry2html LDAP_P(( LDAP *ld, + char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts, char *urlprefix, char *base ); + unsigned long opts, char *urlprefix, char *base )); -LDAPFUNCDECL int -ldap_vals2html( LDAP *ld, char *buf, char **vals, char *label, int labelwidth, +LDAP_F int +ldap_vals2html LDAP_P(( LDAP *ld, + char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, - char *eol, int rdncount, char *urlprefix ); + char *eol, int rdncount, char *urlprefix )); -LDAPFUNCDECL int -ldap_entry2html_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry, +LDAP_F int +ldap_entry2html_search LDAP_P(( LDAP + *ld, char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts, char *urlprefix ); -#endif /* !NEEDPROTOS */ + unsigned long opts, char *urlprefix )); - -#ifdef __cplusplus -} -#endif +LDAP_END_DECL #endif /* _DISPTMPL_H */ diff --git a/include/getopt-compat.h b/include/getopt-compat.h new file mode 100644 index 0000000000..a32e8b5b36 --- /dev/null +++ b/include/getopt-compat.h @@ -0,0 +1,23 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* + * getopt(3) declarations + */ +#ifndef _GETOPT_COMPAT_H +#define _GETOPT_COMPAT_H + +#include + +extern char *optarg; +extern int optind, opterr, optopt; + +LDAP_F int getopt LDAP_P((int, char * const [], const char *)); + +#endif /* _GETOPT_COMPAT_H */ diff --git a/include/lber.h b/include/lber.h index 557b00d46b..b2e690681f 100644 --- a/include/lber.h +++ b/include/lber.h @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * diff --git a/include/ldap.h b/include/ldap.h index 54b956fb6c..8b93f57c32 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * diff --git a/include/ldap_cdefs.h b/include/ldap_cdefs.h index 96579288df..3fab219e5e 100644 --- a/include/ldap_cdefs.h +++ b/include/ldap_cdefs.h @@ -1,3 +1,12 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ /* LDAP C Defines */ #ifndef _LDAP_CDEFS_H diff --git a/include/ldapconfig.h.edit b/include/ldapconfig.h.edit index f384d3b046..4acdfd8cd4 100644 --- a/include/ldapconfig.h.edit +++ b/include/ldapconfig.h.edit @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1994 Regents of the University of Michigan. * All rights reserved. * diff --git a/include/ldapconfig.h.nt b/include/ldapconfig.h.nt index 6a5dbf5e52..94881f0082 100644 --- a/include/ldapconfig.h.nt +++ b/include/ldapconfig.h.nt @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1994 Regents of the University of Michigan. * All rights reserved. * diff --git a/include/ldbm.h b/include/ldbm.h index 95bd55ffa7..d1b93fb4a3 100644 --- a/include/ldbm.h +++ b/include/ldbm.h @@ -1,9 +1,123 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ /* ldbm.h - ldap dbm compatibility routine header file */ #ifndef _LDBM_H_ #define _LDBM_H_ -#ifdef LDBM_USE_GDBM +#ifdef LDBM_USE_DBBTREE + +/***************************************************************** + * * + * use berkeley db btree package * + * * + *****************************************************************/ + +#include +#include +#include + +#ifdef HAVE_DB185_H +# include +#else +# include +# ifdef HAVE_BERKELEY_DB2 +# define R_NOOVERWRITE DB_NOOVERWRITE +# define DEFAULT_DB_PAGE_SIZE 1024 +# endif +#endif + + +typedef DBT Datum; +#define dsize size +#define dptr data + +typedef DB *LDBM; + +#define DB_TYPE DB_BTREE + +/* for ldbm_open */ +#ifdef HAVE_BERKELEY_DB2 +# define LDBM_READER DB_RDONLY +# define LDBM_WRITER 0x00000 /* hopefully */ +# define LDBM_WRCREAT (DB_NOMMAP|DB_CREATE|DB_THREAD) +# define LDBM_NEWDB (DB_TRUNCATE|DB_CREATE|DB_THREAD) +#else +# define LDBM_READER O_RDONLY +# define LDBM_WRITER O_RDWR +# define LDBM_WRCREAT (O_RDWR|O_CREAT) +# define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) +#endif + +# define LDBM_FAST 0 + +#define LDBM_SUFFIX ".dbb" +#define LDBM_ORDERED 1 + +/* for ldbm_insert */ +#define LDBM_INSERT R_NOOVERWRITE +#define LDBM_REPLACE 0 +#define LDBM_SYNC 0x80000000 + +#elif defined( LDBM_USE_DBHASH ) + +/***************************************************************** + * * + * use berkeley db hash package * + * * + *****************************************************************/ + +#include +#include +#include + +#ifdef HAVE_DB185_H +# include +#else +# include +# ifdef LDBM_USE_DB2 +# define R_NOOVERWRITE DB_NOOVERWRITE +# define DEFAULT_DB_PAGE_SIZE 1024 +# endif +#endif + +typedef DBT Datum; +#define dsize size +#define dptr data + +typedef DB *LDBM; + +#define DB_TYPE DB_HASH + +/* for ldbm_open */ +#ifdef LDBM_USE_DB2 +# define LDBM_READER DB_RDONLY +# define LDBM_WRITER 0x00000 /* hopefully */ +# define LDBM_WRCREAT (DB_NOMMAP|DB_CREATE|DB_THREAD) +# define LDBM_NEWDB (DB_TRUNCATE|DB_CREATE|DB_THREAD) +#else +# define LDBM_READER O_RDONLY +# define LDBM_WRITER O_RDWR +# define LDBM_WRCREAT (O_RDWR|O_CREAT) +# define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) +# define LDBM_FAST 0 +#endif + +#define LDBM_SUFFIX ".dbh" + +/* for ldbm_insert */ +#define LDBM_INSERT R_NOOVERWRITE +#define LDBM_REPLACE 0 +#define LDBM_SYNC 0x80000000 + +#elif defined( HAVE_GDBM ) /***************************************************************** * * @@ -33,88 +147,8 @@ extern gdbm_error gdbm_errno; #define LDBM_REPLACE GDBM_REPLACE #define LDBM_SYNC 0x80000000 -#else /* end of gdbm */ -#ifdef LDBM_USE_DBHASH - -/***************************************************************** - * * - * use berkeley db hash package * - * * - *****************************************************************/ - -#include -#include -#include -#include - -typedef DBT Datum; -#define dsize size -#define dptr data - -typedef DB *LDBM; - -#define DB_TYPE DB_HASH - -/* for ldbm_open */ -#define LDBM_READER O_RDONLY -#define LDBM_WRITER O_RDWR -#define LDBM_WRCREAT (O_RDWR|O_CREAT) -#define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) -#define LDBM_FAST 0 - -#define LDBM_SUFFIX ".dbh" - -/* for ldbm_insert */ -#define LDBM_INSERT R_NOOVERWRITE -#define LDBM_REPLACE 0 -#define LDBM_SYNC 0x80000000 - -extern int errno; - -#else /* end of db hash */ - -#ifdef LDBM_USE_DBBTREE - -/***************************************************************** - * * - * use berkeley db btree package * - * * - *****************************************************************/ - -#include -#include -#include -#include - -typedef DBT Datum; -#define dsize size -#define dptr data - -typedef DB *LDBM; - -#define DB_TYPE DB_BTREE - -/* for ldbm_open */ -#define LDBM_READER O_RDONLY -#define LDBM_WRITER O_RDWR -#define LDBM_WRCREAT (O_RDWR|O_CREAT) -#define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) -#define LDBM_FAST 0 - -#define LDBM_SUFFIX ".dbb" -#define LDBM_ORDERED 1 - -/* for ldbm_insert */ -#define LDBM_INSERT R_NOOVERWRITE -#define LDBM_REPLACE 0 -#define LDBM_SYNC 0x80000000 - -extern int errno; - -#else /* end of db btree */ - -#ifdef LDBM_USE_NDBM +#elif defined( HAVE_NDBM ) /***************************************************************** * * @@ -123,7 +157,8 @@ extern int errno; *****************************************************************/ #include -#ifndef O_RDONLY + +#ifdef HAVE_FCNTL_H #include #endif @@ -145,11 +180,9 @@ typedef DBM *LDBM; #define LDBM_REPLACE DBM_REPLACE #define LDBM_SYNC 0 -#endif /* ndbm */ -#endif /* db hash */ -#endif /* db btree */ -#endif /* gdbm */ +#endif +int ldbm_errno( LDBM ldbm ); LDBM ldbm_open( char *name, int rw, int mode, int dbcachesize ); void ldbm_close( LDBM ldbm ); void ldbm_sync( LDBM ldbm ); @@ -158,8 +191,14 @@ Datum ldbm_datum_dup( LDBM ldbm, Datum data ); Datum ldbm_fetch( LDBM ldbm, Datum key ); int ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ); int ldbm_delete( LDBM ldbm, Datum key ); -Datum ldbm_firstkey( LDBM ldbm ); -Datum ldbm_nextkey( LDBM ldbm, Datum key ); -int ldbm_errno( LDBM ldbm ); + +#if HAVE_BERKELEY_DB2 + void *ldbm_malloc( size_t size ); + Datum ldbm_firstkey( LDBM ldbm, DBC **dbch ); + Datum ldbm_nextkey( LDBM ldbm, Datum key, DBC *dbcp ); +#else + Datum ldbm_firstkey( LDBM ldbm ); + Datum ldbm_nextkey( LDBM ldbm, Datum key ); +#endif #endif /* _ldbm_h_ */ diff --git a/include/ldif.h b/include/ldif.h index dd2b339193..e4e4ef33a9 100644 --- a/include/ldif.h +++ b/include/ldif.h @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1996 Regents of the University of Michigan. * All rights reserved. * @@ -13,9 +22,9 @@ #ifndef _LDIF_H #define _LDIF_H -#ifdef __cplusplus -extern "C" { -#endif +#include + +LDAP_BEGIN_DECL #define LINE_WIDTH 76 /* maximum length of LDIF lines */ @@ -34,23 +43,13 @@ extern "C" { */ #define LDIF_SIZE_NEEDED(tlen,vlen) \ ((tlen) + 4 + LDIF_BASE64_LEN(vlen) \ - + ((LDIF_BASE64_LEN(vlen) + tlen + 3) / LINE_WIDTH * 2 )) + + ((LDIF_BASE64_LEN(vlen) + (tlen) + 3) / LINE_WIDTH * 2 )) +int str_parse_line LDAP_P(( char *line, char **type, char **value, int *vlen)); +char * str_getline LDAP_P(( char **next )); +void put_type_and_value LDAP_P(( char **out, char *t, char *val, int vlen )); +char *ldif_type_and_value LDAP_P(( char *type, char *val, int vlen )); -#ifdef NEEDPROTOS -int str_parse_line( char *line, char **type, char **value, int *vlen); -char * str_getline( char **next ); -void put_type_and_value( char **out, char *t, char *val, int vlen ); -char *ldif_type_and_value( char *type, char *val, int vlen ); -#else /* NEEDPROTOS */ -int str_parse_line(); -char * str_getline(); -void put_type_and_value(); -char *ldif_type_and_value(); -#endif /* NEEDPROTOS */ - -#ifdef __cplusplus -} -#endif +LDAP_END_DECL #endif /* _LDIF_H */ diff --git a/include/lthread.h b/include/lthread.h index b97398dd08..974f717dcd 100644 --- a/include/lthread.h +++ b/include/lthread.h @@ -1,3 +1,12 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ /* lthread.h - ldap threads header file */ #ifndef _LTHREAD_H diff --git a/include/lthread_rdwr.h b/include/lthread_rdwr.h new file mode 100644 index 0000000000..c4beb36fa1 --- /dev/null +++ b/include/lthread_rdwr.h @@ -0,0 +1,56 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +#ifndef _LTHREAD_RDWR_H +#define _LTHREAD_RDWR_H 1 + +/******************************************************** + * An example source module to accompany... + * + * "Using POSIX Threads: Programming with Pthreads" + * by Brad nichols, Dick Buttlar, Jackie Farrell + * O'Reilly & Associates, Inc. + * + ******************************************************** + * + * Include file for reader/writer locks + * + */ + +#include + +LDAP_BEGIN_DECL + +typedef struct rdwr_var { + int readers_reading; + int writer_writing; + pthread_mutex_t mutex; + pthread_cond_t lock_free; +} pthread_rdwr_t; + +typedef void * pthread_rdwrattr_t; + +#define pthread_rdwrattr_default NULL; + +LDAP_F int pthread_rdwr_init_np LDAP_P((pthread_rdwr_t *rdwrp, pthread_rdwrattr_t *attrp)); +LDAP_F int pthread_rdwr_rlock_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_runlock_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_wlock_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_wunlock_np LDAP_P((pthread_rdwr_t *rdwrp)); + +#ifdef LDAP_DEBUG +LDAP_F int pthread_rdwr_rchk_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_wchk_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_rwchk_np LDAP_P((pthread_rdwr_t *rdwrp)); +#endif /* LDAP_DEBUG */ + +LDAP_END_DECL + +#endif /* _LTHREAD_RDWR_H */ diff --git a/include/lutil.h b/include/lutil.h index 7de0041a58..dfe1d9d9ad 100644 --- a/include/lutil.h +++ b/include/lutil.h @@ -1,3 +1,13 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + #ifndef _LUTIL_H #define _LUTIL_H 1 diff --git a/include/lutil_md5.h b/include/lutil_md5.h index c0a9ba48bf..892f30ba32 100644 --- a/include/lutil_md5.h +++ b/include/lutil_md5.h @@ -1,3 +1,13 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + /* See md5.c for explanation and copyright information. */ #ifndef _LUTIL_MD5_H_ diff --git a/include/lutil_sha1.h b/include/lutil_sha1.h index 8b3d81ee9d..cdcabf4e41 100644 --- a/include/lutil_sha1.h +++ b/include/lutil_sha1.h @@ -1,3 +1,13 @@ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + /* This version is based on: * $OpenBSD: sha1.h,v 1.8 1997/07/15 01:54:23 millert Exp $ */ diff --git a/include/portable.h.bot b/include/portable.h.bot index 5994b21299..c45e2ce833 100644 --- a/include/portable.h.bot +++ b/include/portable.h.bot @@ -1,4 +1,13 @@ /* portable.h.bot begin */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifdef HAVE_STDDEF_H # include diff --git a/include/portable.h.in b/include/portable.h.in index f531273a20..3a3c3f58c1 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -1,33 +1,14 @@ /* include/portable.h.in. Generated automatically from configure.in by autoheader. */ /* portable.h.top begin */ /* -Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA -All rights reserved. - -Redistribution and use in source and binary forms are permitted only -as authorized by the OpenLDAP Public License. A copy of this -license is available at http://www.OpenLDAP.org/license.html or -in file LICENSE in the top-level directory of the distribution. - -This work is derived from the University of Michigan LDAP v3.3 -distribution. Information concerning is available at - http://www.umich.edu/~dirsvcs/ldap/ldap.html. - -This work also contains materials derived from public sources. - ---- - -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. - -*/ + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _LDAP_PORTABLE_H #define _LDAP_PORTABLE_H @@ -612,6 +593,15 @@ is provided ``as is'' without express or implied warranty. /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET /* portable.h.bot begin */ +/* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifdef HAVE_STDDEF_H # include diff --git a/include/portable.h.top b/include/portable.h.top index 4f413c0da5..3a43d452d2 100644 --- a/include/portable.h.top +++ b/include/portable.h.top @@ -1,32 +1,13 @@ /* portable.h.top begin */ /* -Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA -All rights reserved. - -Redistribution and use in source and binary forms are permitted only -as authorized by the OpenLDAP Public License. A copy of this -license is available at http://www.OpenLDAP.org/license.html or -in file LICENSE in the top-level directory of the distribution. - -This work is derived from the University of Michigan LDAP v3.3 -distribution. Information concerning is available at - http://www.umich.edu/~dirsvcs/ldap/ldap.html. - -This work also contains materials derived from public sources. - ---- - -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. - -*/ + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ #ifndef _LDAP_PORTABLE_H #define _LDAP_PORTABLE_H diff --git a/include/srchpref.h b/include/srchpref.h index a1d65cffb0..cff3f95705 100644 --- a/include/srchpref.h +++ b/include/srchpref.h @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1993, 1994 Regents of the University of Michigan. * All rights reserved. * @@ -17,10 +26,9 @@ #ifndef _SRCHPREF_H #define _SRCHPREF_H -#ifdef __cplusplus -extern "C" { -#endif +#include +LDAP_BEGIN_DECL struct ldap_searchattr { char *sa_attrlabel; @@ -60,7 +68,7 @@ struct ldap_searchobj { #define LDAP_SEARCHOBJ_OPT_INTERNAL 0x00000001 #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option ) \ - (((so)->so_options & option ) != 0 ) + (((so)->so_options & (option) ) != 0 ) #define LDAP_SEARCHPREF_VERSION_ZERO 0 #define LDAP_SEARCHPREF_VERSION 1 @@ -71,36 +79,26 @@ struct ldap_searchobj { #define LDAP_SEARCHPREF_ERR_FILE 4 -#ifndef NEEDPROTOS -int ldap_init_searchprefs(); -int ldap_init_searchprefs_buf(); -void ldap_free_searchprefs(); -struct ldap_searchobj *ldap_first_searchobj(); -struct ldap_searchobj *ldap_next_searchobj(); +LDAP_F int +ldap_init_searchprefs LDAP_P(( char *file, + struct ldap_searchobj **solistp )); -#else /* !NEEDPROTOS */ +LDAP_F int +ldap_init_searchprefs_buf LDAP_P(( char *buf, + long buflen, + struct ldap_searchobj **solistp )); -LDAPFUNCDECL int -ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp ); +LDAP_F void +ldap_free_searchprefs LDAP_P(( struct ldap_searchobj *solist )); -LDAPFUNCDECL int -ldap_init_searchprefs_buf( char *buf, long buflen, - struct ldap_searchobj **solistp ); +LDAP_F struct ldap_searchobj * +ldap_first_searchobj LDAP_P(( struct ldap_searchobj *solist )); -LDAPFUNCDECL void -ldap_free_searchprefs( struct ldap_searchobj *solist ); - -LDAPFUNCDECL struct ldap_searchobj * -ldap_first_searchobj( struct ldap_searchobj *solist ); - -LDAPFUNCDECL struct ldap_searchobj * -ldap_next_searchobj( struct ldap_searchobj *sollist, - struct ldap_searchobj *so ); - -#endif /* !NEEDPROTOS */ +LDAP_F struct ldap_searchobj * +ldap_next_searchobj LDAP_P(( struct ldap_searchobj *sollist, + struct ldap_searchobj *so )); -#ifdef __cplusplus -} -#endif +LDAP_END_DECL + #endif /* _SRCHPREF_H */ diff --git a/include/sysexits-compat.h b/include/sysexits-compat.h index 9be67fa417..09f24cc756 100644 --- a/include/sysexits-compat.h +++ b/include/sysexits-compat.h @@ -1,4 +1,13 @@ /* + * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ +/* Portions * Copyright (c) 1987 Regents of the University of California. * All rights reserved. * diff --git a/libraries/liblber/Makefile.in b/libraries/liblber/Makefile.in index 1c0bfcb79b..40b08df2e8 100644 --- a/libraries/liblber/Makefile.in +++ b/libraries/liblber/Makefile.in @@ -1,3 +1,5 @@ +## Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, see COPYRIGHT file ## ## LIBLBER ## diff --git a/libraries/liblber/Version.c b/libraries/liblber/Version.c index ae3b655c4a..61093cd832 100644 --- a/libraries/liblber/Version.c +++ b/libraries/liblber/Version.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1991 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/liblber/bprint.c b/libraries/liblber/bprint.c index e4b6fd27ea..21c8cf83e3 100644 --- a/libraries/liblber/bprint.c +++ b/libraries/liblber/bprint.c @@ -1,20 +1,30 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + +#include "portable.h" + +#if defined( LDAP_DEBUG ) && defined( LDAP_LIBUI ) #include -#include -#include + +#include +#include +#endif /* LDAP_DEBUG && LDAP_LIBUI */ + #include "lber.h" /* * Print arbitrary stuff, for debugging. */ -#ifdef LDAP_DEBUG - -#ifndef NO_USERINTERFACE -#define BPLEN 48 void lber_bprint( char *data, int len ) { +#if defined( LDAP_DEBUG ) && defined( LDAP_LIBUI ) +#define BPLEN 48 + static char hexdig[] = "0123456789abcdef"; char out[ BPLEN ]; int i = 0; @@ -49,12 +59,7 @@ lber_bprint( char *data, int len ) } out[ i++ ] = ' '; } -} -#else /* NO_USERINTERFACE */ -void -lber_bprint( char *data, int len ) -{ -} -#endif /* NO_USERINTERFACE */ -#endif +#endif /* LDAP_DEBUG && LDAP_LIBUI */ +} + diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index aab9682007..2197139535 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -1,5 +1,9 @@ /* decode.c - ber input decoding routines */ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/liblber/dtest.c b/libraries/liblber/dtest.c index 6c9a33727f..07bab69896 100644 --- a/libraries/liblber/dtest.c +++ b/libraries/liblber/dtest.c @@ -1,5 +1,9 @@ /* dtest.c - lber decoding test program */ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index b320a2eb56..51b76912c4 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -1,5 +1,9 @@ /* encode.c - ber output encoding routines */ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/liblber/etest.c b/libraries/liblber/etest.c index e46d506450..46192aa883 100644 --- a/libraries/liblber/etest.c +++ b/libraries/liblber/etest.c @@ -1,5 +1,9 @@ /* test.c - lber encoding test program */ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. */ diff --git a/libraries/liblber/idtest.c b/libraries/liblber/idtest.c index 8d68fd6036..6a5f9b2ed3 100644 --- a/libraries/liblber/idtest.c +++ b/libraries/liblber/idtest.c @@ -1,5 +1,9 @@ /* idtest.c - ber decoding test program using isode libraries */ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 70e5651c88..378d2b685e 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -1,5 +1,9 @@ /* io.c - ber general i/o routines */ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/Makefile.in b/libraries/libldap/Makefile.in index f957929202..818e4f2be9 100644 --- a/libraries/libldap/Makefile.in +++ b/libraries/libldap/Makefile.in @@ -1,3 +1,5 @@ +## Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, see COPYRIGHT file ## ## Makefile.in for LDAP -lldap ## diff --git a/libraries/libldap/Version.c b/libraries/libldap/Version.c index 87512f7910..9a043d706b 100644 --- a/libraries/libldap/Version.c +++ b/libraries/libldap/Version.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1991 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index 18324260bd..51a12d2e54 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -1,41 +1,29 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * abandon.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif - -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#endif /* DOS */ - -#ifdef MACOS #include -#include "macos.h" -#endif /* MACOS */ + +#include +#include +#include #include "lber.h" #include "ldap.h" #include "ldap-int.h" -#ifdef NEEDPROTOS -static int do_abandon( LDAP *ld, int origid, int msgid ); -#else /* NEEDPROTOS */ -static int do_abandon(); -#endif /* NEEDPROTOS */ +static int do_abandon LDAP_P(( LDAP *ld, int origid, int msgid )); + /* * ldap_abandon - perform an ldap (and X.500) abandon operation. Parameters: * @@ -107,22 +95,22 @@ do_abandon( LDAP *ld, int origid, int msgid ) err = 0; if ( sendabandon ) { /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { err = -1; ld->ld_errno = LDAP_NO_MEMORY; } else { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( ld->ld_sb.sb_naddr > 0 ) { err = ber_printf( ber, "{isti}", ++ld->ld_msgid, ld->ld_cldapdn, LDAP_REQ_ABANDON, msgid ); } else { -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ err = ber_printf( ber, "{iti}", ++ld->ld_msgid, LDAP_REQ_ABANDON, msgid ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( err == -1 ) { ld->ld_errno = LDAP_ENCODING_ERROR; @@ -151,10 +139,10 @@ do_abandon( LDAP *ld, int origid, int msgid ) #ifdef LDAP_REFERRALS if ( lr != NULL ) { if ( sendabandon ) { - free_connection( ld, lr->lr_conn, 0, 1 ); + ldap_free_connection( ld, lr->lr_conn, 0, 1 ); } if ( origid == msgid ) { - free_request( ld, lr ); + ldap_free_request( ld, lr ); } } #endif /* LDAP_REFERRALS */ diff --git a/libraries/libldap/add.c b/libraries/libldap/add.c index b79cd09b9d..53d766a63c 100644 --- a/libraries/libldap/add.c +++ b/libraries/libldap/add.c @@ -1,30 +1,21 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * add.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#endif /* DOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif /* !MACOS && !DOS */ +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -69,7 +60,7 @@ ldap_add( LDAP *ld, char *dn, LDAPMod **attrs ) Debug( LDAP_DEBUG_TRACE, "ldap_add\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -103,7 +94,7 @@ ldap_add( LDAP *ld, char *dn, LDAPMod **attrs ) } /* send the message */ - return( send_initial_request( ld, LDAP_REQ_ADD, dn, ber )); + return( ldap_send_initial_request( ld, LDAP_REQ_ADD, dn, ber )); } int diff --git a/libraries/libldap/addentry.c b/libraries/libldap/addentry.c index a0fc4174e6..0b4e054569 100644 --- a/libraries/libldap/addentry.c +++ b/libraries/libldap/addentry.c @@ -1,29 +1,23 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * addentry.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/bind.c b/libraries/libldap/bind.c index 0a0487349e..3d0278fc8b 100644 --- a/libraries/libldap/bind.c +++ b/libraries/libldap/bind.c @@ -1,31 +1,22 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * bind.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include "msdos.h" -#ifdef NCSA -#include "externs.h" -#endif /* NCSA */ -#else /* DOS */ -#include -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -54,7 +45,7 @@ ldap_bind( LDAP *ld, char *dn, char *passwd, int authmethod ) * name DistinguishedName, -- who * authentication CHOICE { * simple [0] OCTET STRING -- passwd -#ifdef KERBEROS +#ifdef HAVE_KERBEROS * krbv42ldap [1] OCTET STRING * krbv42dsa [2] OCTET STRING #endif @@ -69,7 +60,7 @@ ldap_bind( LDAP *ld, char *dn, char *passwd, int authmethod ) case LDAP_AUTH_SIMPLE: return( ldap_simple_bind( ld, dn, passwd ) ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case LDAP_AUTH_KRBV41: return( ldap_kerberos_bind1( ld, dn ) ); @@ -106,7 +97,7 @@ ldap_bind_s( LDAP *ld, char *dn, char *passwd, int authmethod ) case LDAP_AUTH_SIMPLE: return( ldap_simple_bind_s( ld, dn, passwd ) ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case LDAP_AUTH_KRBV4: return( ldap_kerberos_bind_s( ld, dn ) ); diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index 197f4fb9e3..1a021cbc71 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -1,63 +1,43 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1993 The Regents of the University of Michigan. * All rights reserved. * * cache.c - local caching support for LDAP */ -#ifndef NO_CACHE - -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1993 The Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS #include -#include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#ifdef NCSA -#include "externs.h" -#endif /* NCSA */ -#ifdef WINSOCK -#include -#endif /* WINSOCK */ -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include + #include "lber.h" #include "ldap.h" #include "ldap-int.h" -#ifdef NEEDPROTOS -static int cache_hash( BerElement *ber ); -static LDAPMessage *msg_dup( LDAPMessage *msg ); -static int request_cmp( BerElement *req1, BerElement *req2 ); -static int chain_contains_dn( LDAPMessage *msg, char *dn ); -static long msg_size( LDAPMessage *msg ); -static void check_cache_memused( LDAPCache *lc ); -static void uncache_entry_or_req( LDAP *ld, char *dn, int msgid ); -#else /* NEEDPROTOS */ -static int cache_hash(); -static LDAPMessage *msg_dup(); -static int request_cmp(); -static int chain_contains_dn(); -static long msg_size(); -static void check_cache_memused(); -static void uncache_entry_or_req(); -#endif /* NEEDPROTOS */ +#ifndef LDAP_NOCACHE +static int cache_hash LDAP_P(( BerElement *ber )); +static LDAPMessage *msg_dup LDAP_P(( LDAPMessage *msg )); +static int request_cmp LDAP_P(( BerElement *req1, BerElement *req2 )); +static int chain_contains_dn LDAP_P(( LDAPMessage *msg, char *dn )); +static long msg_size LDAP_P(( LDAPMessage *msg )); +static void check_cache_memused LDAP_P(( LDAPCache *lc )); +static void uncache_entry_or_req LDAP_P(( LDAP *ld, char *dn, int msgid )); + +#endif int ldap_enable_cache( LDAP *ld, long timeout, long maxmem ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache == NULLLDCACHE ) { if (( ld->ld_cache = (LDAPCache *)malloc( sizeof( LDAPCache ))) == NULLLDCACHE ) { @@ -73,15 +53,20 @@ ldap_enable_cache( LDAP *ld, long timeout, long maxmem ) check_cache_memused( ld->ld_cache ); ld->ld_cache->lc_enabled = 1; return( 0 ); +#else + return( -1 ); +#endif } void ldap_disable_cache( LDAP *ld ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULLLDCACHE ) { ld->ld_cache->lc_enabled = 0; } +#endif } @@ -89,26 +74,31 @@ ldap_disable_cache( LDAP *ld ) void ldap_set_cache_options( LDAP *ld, unsigned long opts ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULLLDCACHE ) { ld->ld_cache->lc_options = opts; } +#endif } void ldap_destroy_cache( LDAP *ld ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULLLDCACHE ) { ldap_flush_cache( ld ); free( (char *)ld->ld_cache ); ld->ld_cache = NULLLDCACHE; } +#endif } void ldap_flush_cache( LDAP *ld ) { +#ifndef LDAP_NOCACHE int i; LDAPMessage *m, *next; @@ -133,29 +123,36 @@ ldap_flush_cache( LDAP *ld ) } ld->ld_cache->lc_memused = sizeof( LDAPCache ); } +#endif } void ldap_uncache_request( LDAP *ld, int msgid ) { - Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %x\n", - msgid, ld->ld_cache, 0 ); +#ifndef LDAP_NOCACHE + Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %lx\n", + msgid, (long) ld->ld_cache, 0 ); uncache_entry_or_req( ld, NULL, msgid ); +#endif } void ldap_uncache_entry( LDAP *ld, char *dn ) { - Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %x\n", - dn, ld->ld_cache, 0 ); +#ifndef LDAP_NOCACHE + Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %lx\n", + dn, (long) ld->ld_cache, 0 ); uncache_entry_or_req( ld, dn, 0 ); +#endif } +#ifndef LDAP_NOCACHE + static void uncache_entry_or_req( LDAP *ld, char *dn, /* if non-NULL, uncache entry */ @@ -165,8 +162,8 @@ uncache_entry_or_req( LDAP *ld, LDAPMessage *m, *prev, *next; Debug( LDAP_DEBUG_TRACE, - "ldap_uncache_entry_or_req dn %s msgid %d ld_cache %x\n", - dn, msgid, ld->ld_cache ); + "ldap_uncache_entry_or_req dn %s msgid %d ld_cache %lx\n", + dn, msgid, (long) ld->ld_cache ); if ( ld->ld_cache == NULLLDCACHE ) { return; @@ -212,14 +209,16 @@ uncache_entry_or_req( LDAP *ld, } } +#endif void -add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) +ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) { +#ifndef LDAP_NOCACHE LDAPMessage *new; long len; - Debug( LDAP_DEBUG_TRACE, "add_request_to_cache\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_add_request_to_cache\n", 0, 0, 0 ); ld->ld_errno = LDAP_SUCCESS; if ( ld->ld_cache == NULLLDCACHE || @@ -229,7 +228,7 @@ add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) if (( new = (LDAPMessage *) calloc( 1, sizeof(LDAPMessage) )) != NULL ) { - if (( new->lm_ber = alloc_ber_with_options( ld )) == NULLBER ) { + if (( new->lm_ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { free( (char *)new ); return; } @@ -252,16 +251,18 @@ add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) } else { ld->ld_errno = LDAP_NO_MEMORY; } +#endif } void -add_result_to_cache( LDAP *ld, LDAPMessage *result ) +ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) { +#ifndef LDAP_NOCACHE LDAPMessage *m, **mp, *req, *new, *prev; int err, keep; - Debug( LDAP_DEBUG_TRACE, "add_result_to_cache: id %d, type %d\n", + Debug( LDAP_DEBUG_TRACE, "ldap_add_result_to_cache: id %d, type %d\n", result->lm_msgid, result->lm_msgtype, 0 ); if ( ld->ld_cache == NULLLDCACHE || @@ -358,6 +359,7 @@ add_result_to_cache( LDAP *ld, LDAPMessage *result ) Debug( LDAP_DEBUG_TRACE, "artc: msgid not in request list\n", 0, 0, 0 ); } +#endif } @@ -369,14 +371,15 @@ add_result_to_cache( LDAP *ld, LDAPMessage *result ) * will find them. */ int -check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) +ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) { +#ifndef LDAP_NOCACHE LDAPMessage *m, *new, *prev, *next; BerElement reqber; int first, hash; unsigned long validtime; - Debug( LDAP_DEBUG_TRACE, "check_cache\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_check_cache\n", 0, 0, 0 ); if ( ld->ld_cache == NULLLDCACHE || ( ld->ld_cache->lc_enabled == 0 )) { @@ -444,8 +447,12 @@ check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) Debug( LDAP_DEBUG_TRACE, "cc: result returned from cache\n", 0, 0, 0 ); return( 0 ); +#else + return( -1 ); +#endif } +#ifndef LDAP_NOCACHE static int cache_hash( BerElement *ber ) @@ -524,7 +531,9 @@ request_cmp( BerElement *req1, BerElement *req2 ) /* * check remaining length and bytes if necessary */ - if (( len = r1.ber_end - r1.ber_ptr ) != r2.ber_end - r2.ber_ptr ) { + if (( len = r1.ber_end - r1.ber_ptr ) != + (unsigned long) (r2.ber_end - r2.ber_ptr) ) + { return( -1 ); /* different lengths */ } return( memcmp( r1.ber_ptr, r2.ber_ptr, (size_t)len )); diff --git a/libraries/libldap/charset.c b/libraries/libldap/charset.c index d5b74006f5..d5832930dc 100644 --- a/libraries/libldap/charset.c +++ b/libraries/libldap/charset.c @@ -1,38 +1,29 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * * charset.c */ -#if defined( DOS ) || defined( _WIN32 ) -/* - * This MUST precede "#ifdef STR_TRANSLATION" - * because STR_TRANSLATION and friends are defined in msdos.h. - */ -#include "msdos.h" -#endif /* DOS */ +#include "portable.h" #ifdef STR_TRANSLATION -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include -#include - -#ifdef MACOS #include -#include "macos.h" -#endif /* MACOS */ -#if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 ) && !defined(VMS) -#include -#include -#include +#include +#include +#include + +#ifdef HAVE_SYS_PARAM_H #include #endif + #include "lber.h" #include "ldap.h" #include "ldap-int.h" @@ -159,7 +150,7 @@ ldap_translate_to_t61( LDAP *ld, char **bufp, unsigned long *lenp, #include #include -#include +#include /* Character set used: ISO 8859-1, ISO 8859-2, ISO 8859-3, ... */ /* #define ISO_8859 1 */ @@ -171,17 +162,10 @@ ldap_translate_to_t61( LDAP *ld, char **bufp, unsigned long *lenp, typedef unsigned char Byte; typedef struct { Byte a, b; } Couple; -#ifdef NEEDPROTOS -static Byte *c_to_hh( Byte *o, Byte c ); -static Byte *c_to_cc( Byte *o, Couple *cc, Byte c ); -static int hh_to_c( Byte *h ); -static Byte *cc_to_t61( Byte *o, Byte *s ); -#else /* NEEDPROTOS */ -static Byte *c_to_hh(); -static Byte *c_to_cc(); -static int hh_to_c(); -static Byte *cc_to_t61(); -#endif /* NEEDPROTOS */ +static Byte *c_to_hh LDAP_P(( Byte *o, Byte c )); +static Byte *c_to_cc LDAP_P(( Byte *o, Couple *cc, Byte c )); +static int hh_to_c LDAP_P(( Byte *h )); +static Byte *cc_to_t61 LDAP_P(( Byte *o, Byte *s )); /* Character choosed as base in diacritics alone: NO-BREAK SPACE. diff --git a/libraries/libldap/cldap.c b/libraries/libldap/cldap.c index 7a6081712d..a41643a883 100644 --- a/libraries/libldap/cldap.c +++ b/libraries/libldap/cldap.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990, 1994 Regents of the University of Michigan. * All rights reserved. * @@ -9,10 +13,6 @@ #ifdef LDAP_CONNECTIONLESS -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990, 1994 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/compare.c b/libraries/libldap/compare.c index 74388f1cea..148de5d949 100644 --- a/libraries/libldap/compare.c +++ b/libraries/libldap/compare.c @@ -1,25 +1,21 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * compare.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -52,7 +48,7 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value ) Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -63,19 +59,19 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value ) return( -1 ); } -#ifndef NO_CACHE +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULL ) { - if ( check_cache( ld, LDAP_REQ_COMPARE, ber ) == 0 ) { + if ( ldap_check_cache( ld, LDAP_REQ_COMPARE, ber ) == 0 ) { ber_free( ber, 1 ); ld->ld_errno = LDAP_SUCCESS; return( ld->ld_msgid ); } - add_request_to_cache( ld, LDAP_REQ_COMPARE, ber ); + ldap_add_request_to_cache( ld, LDAP_REQ_COMPARE, ber ); } -#endif /* NO_CACHE */ +#endif /* LDAP_NOCACHE */ /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_COMPARE, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_COMPARE, dn, ber )); } int diff --git a/libraries/libldap/delete.c b/libraries/libldap/delete.c index 47e240ea6a..dce4cfac88 100644 --- a/libraries/libldap/delete.c +++ b/libraries/libldap/delete.c @@ -1,29 +1,21 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * delete.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if defined( DOS ) || defined( _WIN32 ) -#include "msdos.h" -#endif /* DOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -51,7 +43,7 @@ ldap_delete( LDAP *ld, char *dn ) Debug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -63,7 +55,7 @@ ldap_delete( LDAP *ld, char *dn ) } /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_DELETE, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_DELETE, dn, ber )); } diff --git a/libraries/libldap/disptmpl.c b/libraries/libldap/disptmpl.c index ee97405e7e..f2325e4c87 100644 --- a/libraries/libldap/disptmpl.c +++ b/libraries/libldap/disptmpl.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1993, 1994 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/dsparse.c b/libraries/libldap/dsparse.c index 365f343a63..13451a4de1 100644 --- a/libraries/libldap/dsparse.c +++ b/libraries/libldap/dsparse.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1993, 1994 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index 4a9a9a4ebd..f7dfb6d412 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -1,3 +1,8 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + #include "portable.h" #include diff --git a/libraries/libldap/free.c b/libraries/libldap/free.c index d7a13228e6..b76216380f 100644 --- a/libraries/libldap/free.c +++ b/libraries/libldap/free.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1994 The Regents of the University of Michigan. * All rights reserved. * @@ -6,26 +10,14 @@ * link in lots of extra code when not using certain features */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1994 The Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - +#include "portable.h" #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/friendly.c b/libraries/libldap/friendly.c index 2e09325fd9..4e40f17ca1 100644 --- a/libraries/libldap/friendly.c +++ b/libraries/libldap/friendly.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/getattr.c b/libraries/libldap/getattr.c index 50caa774c5..68bb3458c3 100644 --- a/libraries/libldap/getattr.c +++ b/libraries/libldap/getattr.c @@ -1,29 +1,23 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * getattr.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -36,7 +30,7 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber ) Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 ); - if ( (*ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( NULL ); } diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 82736d092c..2291a121db 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1994 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/getdxbyname.c b/libraries/libldap/getdxbyname.c index 26c79bf6a1..f48a3269bb 100644 --- a/libraries/libldap/getdxbyname.c +++ b/libraries/libldap/getdxbyname.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/getentry.c b/libraries/libldap/getentry.c index f3f896e7b8..7930925882 100644 --- a/libraries/libldap/getentry.c +++ b/libraries/libldap/getentry.c @@ -1,29 +1,23 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * getentry.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/getfilter.c b/libraries/libldap/getfilter.c index cf5215ceaf..e46dda3503 100644 --- a/libraries/libldap/getfilter.c +++ b/libraries/libldap/getfilter.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1993 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/getvalues.c b/libraries/libldap/getvalues.c index 55102be8ab..d9e8961dff 100644 --- a/libraries/libldap/getvalues.c +++ b/libraries/libldap/getvalues.c @@ -1,29 +1,23 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * getvalues.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index 036ca8d232..4ff58daf2e 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -1,3 +1,7 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ #include "portable.h" #include diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index 8bf63e912d..4417a129b4 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1993 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #ifdef HAVE_KERBEROS #include diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index 15c1d4acf0..0e8ac97b73 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/modify.c b/libraries/libldap/modify.c index 316dde787f..551a84e2b7 100644 --- a/libraries/libldap/modify.c +++ b/libraries/libldap/modify.c @@ -1,25 +1,21 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * modify.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -69,7 +65,7 @@ ldap_modify( LDAP *ld, char *dn, LDAPMod **mods ) Debug( LDAP_DEBUG_TRACE, "ldap_modify\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -105,7 +101,7 @@ ldap_modify( LDAP *ld, char *dn, LDAPMod **mods ) } /* send the message */ - return( send_initial_request( ld, LDAP_REQ_MODIFY, dn, ber )); + return( ldap_send_initial_request( ld, LDAP_REQ_MODIFY, dn, ber )); } int diff --git a/libraries/libldap/modrdn.c b/libraries/libldap/modrdn.c index f4624a919a..a172f2989a 100644 --- a/libraries/libldap/modrdn.c +++ b/libraries/libldap/modrdn.c @@ -1,25 +1,21 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * modrdn.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -53,7 +49,7 @@ ldap_modrdn2( LDAP *ld, char *dn, char *newrdn, int deleteoldrdn ) Debug( LDAP_DEBUG_TRACE, "ldap_modrdn\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -65,7 +61,7 @@ ldap_modrdn2( LDAP *ld, char *dn, char *newrdn, int deleteoldrdn ) } /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_MODRDN, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_MODRDN, dn, ber )); } int diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 624d06bdfa..ef64cf3ed3 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index b2bcfafc2e..4459d46d22 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index f747d65e60..fbb09a1bab 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index e5b4baaee5..c8c7b71260 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/sbind.c b/libraries/libldap/sbind.c index 656c722f15..5121f713fe 100644 --- a/libraries/libldap/sbind.c +++ b/libraries/libldap/sbind.c @@ -1,25 +1,21 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1993 Regents of the University of Michigan. * All rights reserved. * * sbind.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -61,7 +57,7 @@ ldap_simple_bind( LDAP *ld, char *dn, char *passwd ) passwd = ""; /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -73,14 +69,14 @@ ldap_simple_bind( LDAP *ld, char *dn, char *passwd ) return( -1 ); } -#ifndef NO_CACHE +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULL ) { ldap_flush_cache( ld ); } -#endif /* !NO_CACHE */ +#endif /* !LDAP_NOCACHE */ /* send the message */ - return( send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); + return( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); } /* diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index 4963948584..794831fc9a 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include diff --git a/libraries/libldap/sort.c b/libraries/libldap/sort.c index 272e84db23..0e2996cac0 100644 --- a/libraries/libldap/sort.c +++ b/libraries/libldap/sort.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1994 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/srchpref.c b/libraries/libldap/srchpref.c index 50af66a2a2..45cf8a59fe 100644 --- a/libraries/libldap/srchpref.c +++ b/libraries/libldap/srchpref.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1993, 1994 Regents of the University of Michigan. * All rights reserved. * diff --git a/libraries/libldap/strdup.c b/libraries/libldap/strdup.c index 42385b6468..614bec6fb1 100644 --- a/libraries/libldap/strdup.c +++ b/libraries/libldap/strdup.c @@ -1,3 +1,8 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + #include "portable.h" #include diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index cbcd88b2fb..35f03d94a2 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -1,3 +1,8 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + #include "portable.h" #include diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index e596a9b947..5c8bf0ba3a 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -1,3 +1,7 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ /* * tmplout.c: display template library output routines for LDAP clients * 12 April 1994 by Mark C Smith diff --git a/libraries/libldap/tmpltest.c b/libraries/libldap/tmpltest.c index 9855317b56..9d9f5b3d14 100644 --- a/libraries/libldap/tmpltest.c +++ b/libraries/libldap/tmpltest.c @@ -1,3 +1,7 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ #include "portable.h" #include diff --git a/libraries/libldap/ufn.c b/libraries/libldap/ufn.c index 02ac4d0a75..b269bd0344 100644 --- a/libraries/libldap/ufn.c +++ b/libraries/libldap/ufn.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * @@ -7,10 +11,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include #include diff --git a/libraries/libldap/unbind.c b/libraries/libldap/unbind.c index e7b5c401e6..5cbeec9061 100644 --- a/libraries/libldap/unbind.c +++ b/libraries/libldap/unbind.c @@ -1,31 +1,22 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * unbind.c */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif +#include "portable.h" #include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include "msdos.h" -#ifdef NCSA -#include "externs.h" -#endif /* NCSA */ -#else /* DOS */ -#include -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -55,17 +46,17 @@ ldap_ld_free( LDAP *ld, int close ) /* free LDAP structure and outstanding requests/responses */ for ( lr = ld->ld_requests; lr != NULL; lr = nextlr ) { nextlr = lr->lr_next; - free_request( ld, lr ); + ldap_free_request( ld, lr ); } /* free and unbind from all open connections */ while ( ld->ld_conns != NULL ) { - free_connection( ld, ld->ld_conns, 1, close ); + ldap_free_connection( ld, ld->ld_conns, 1, close ); } #else /* LDAP_REFERRALS */ if ( close ) { - err = send_unbind( ld, &ld->ld_sb ); - close_connection( &ld->ld_sb ); + err = ldap_send_unbind( ld, &ld->ld_sb ); + ldap_close_connection( &ld->ld_sb ); } #endif /* LDAP_REFERRALS */ } else { @@ -83,10 +74,10 @@ ldap_ld_free( LDAP *ld, int close ) ldap_msgfree( lm ); } -#ifndef NO_CACHE +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULL ) ldap_destroy_cache( ld ); -#endif /* !NO_CACHE */ +#endif /* !LDAP_NOCACHE */ if ( ld->ld_error != NULL ) free( ld->ld_error ); if ( ld->ld_matched != NULL ) @@ -106,7 +97,7 @@ ldap_ld_free( LDAP *ld, int close ) #ifdef LDAP_REFERRALS if ( ld->ld_selectinfo != NULL ) - free_select_info( ld->ld_selectinfo ); + ldap_free_select_info( ld->ld_selectinfo ); #endif /* LDAP_REFERRALS */ if ( ld->ld_defhost != NULL ) @@ -114,6 +105,8 @@ ldap_ld_free( LDAP *ld, int close ) free( (char *) ld ); + WSACleanup(); + return( err ); } @@ -125,14 +118,14 @@ ldap_unbind_s( LDAP *ld ) int -send_unbind( LDAP *ld, Sockbuf *sb ) +ldap_send_unbind( LDAP *ld, Sockbuf *sb ) { BerElement *ber; - Debug( LDAP_DEBUG_TRACE, "send_unbind\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( ld->ld_errno ); } diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 69f8da2389..0c22d74782 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -1,4 +1,8 @@ /* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ +/* Portions * Copyright (c) 1996 Regents of the University of Michigan. * All rights reserved. * @@ -19,10 +23,6 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1996 Regents of the University of Michigan.\nAll rights reserved.\n"; -#endif - #include #include