-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
# 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
/* 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.
+dnl Copyright 1998 The OpenLDAP Foundation, All Rights Reserved.
+dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file
dnl
dnl OpenLDAP Autoconf Macros
dnl
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
+## Copyright 1998,1999 The OpenLDAP Foundation
+## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory
+## of this package for details.
##---------------------------------------------------------------------------
##
## Makes subdirectories
--- /dev/null
+## 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
+## 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
+## 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
+## 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
+## 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
+dnl Copyright 1998 The OpenLDAP Foundation, All Rights Reserved.
+dnl COPYING RESTRICTIONS APPLY, See COPYRIGHT file
dnl
dnl OpenLDAP Autoconf Macros
dnl
+## 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
+## 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
##
-## 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@
-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
--- /dev/null
+/* 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 <alloca.h>
+# else
+# ifdef _AIX
+#pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+
+#endif /* _AC_ALLOCA_H */
/* 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
--- /dev/null
+/* 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 <ctype.h>
+
+#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 */
--- /dev/null
+/* 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 <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+
+#endif /* _AC_DIRENT_H */
--- /dev/null
+/* 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 <errno.h>
+#elif defined( HAVE_SYS_ERRNO_H )
+# include <sys/errno.h>
+#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 */
--- /dev/null
+/* 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 <kerberosIV/krb.h>
+#elif defined( HAVE_KRB_H )
+#include <krb.h>
+#endif
+
+#if defined( HAVE_KERBEROSIV_DES_H )
+#include <kerberosIV/des.h>
+#elif defined( HAVE_DES_H )
+#include <des.h>
+#endif
+
+#endif /* HAVE_KERBEROS */
+#endif /* _AC_KRB_H */
--- /dev/null
+/*
+ * 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 <sys/types.h>
+#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 <regex.h>
+#endif /* regex.h */
+
+#endif /* _AC_REGEX_H_ */
/* 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
/* 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
/*
* 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_
/* 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
/* 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
--- /dev/null
+/*
+ * 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 <syslog.h>
+#elif defined ( HAVE_SYS_SYSLOG_H )
+#include <sys/syslog.h>
+#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_ */
/* 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
--- /dev/null
+/* 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 <sys/time.h>
+# include <time.h>
+#elif HAVE_SYS_TIME_H
+# include <sys/time.h>
+#else
+# include <time.h>
+#endif
+
+#endif /* _AC_TIME_H */
/* 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
--- /dev/null
+/* 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 <sys/types.h>
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#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 */
-/* 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.
*
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
+/* avl.h - avl tree definitions */
#ifndef _AVL
/*
+ * 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.
*
#ifndef _DISPTMPL_H
#define _DISPTMPL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <ldap_cdefs.h>
+LDAP_BEGIN_DECL
#define LDAP_TEMPLATE_VERSION 1
#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 )
/*
#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
#define LDAP_DTMPL_BUFSIZ 8192
-#ifndef NEEDPROTOS
-
-typedef int (*writeptype)();
+typedef int (*writeptype) LDAP_P(( void *writeparm, char *p, int len ));
-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 LDAP_P(( char *file, struct ldap_disptmpl **tmpllistp ));
-#else /* !NEEDPROTOS */
+LDAP_F int
+ldap_init_templates_buf LDAP_P(( char *buf,
+ long buflen,
+ struct ldap_disptmpl **tmpllistp ));
-typedef int (*writeptype)( void *writeparm, char *p, int len );
+LDAP_F void
+ldap_free_templates LDAP_P(( struct ldap_disptmpl *tmpllist ));
-LDAPFUNCDECL int
-ldap_init_templates( char *file, struct ldap_disptmpl **tmpllistp );
+LDAP_F struct ldap_disptmpl *
+ldap_first_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist ));
-LDAPFUNCDECL int
-ldap_init_templates_buf( char *buf, long buflen,
- struct ldap_disptmpl **tmpllistp );
+LDAP_F struct ldap_disptmpl *
+ldap_next_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist,
+ struct ldap_disptmpl *tmpl ));
-LDAPFUNCDECL void
-ldap_free_templates( struct ldap_disptmpl *tmpllist );
+LDAP_F struct ldap_disptmpl *
+ldap_name2template LDAP_P(( char *name,
+ struct ldap_disptmpl *tmpllist ));
-LDAPFUNCDECL struct ldap_disptmpl *
-ldap_first_disptmpl( struct ldap_disptmpl *tmpllist );
+LDAP_F struct ldap_disptmpl *
+ldap_oc2template LDAP_P(( char **oclist,
+ struct ldap_disptmpl *tmpllist ));
-LDAPFUNCDECL struct ldap_disptmpl *
-ldap_next_disptmpl( struct ldap_disptmpl *tmpllist,
- struct ldap_disptmpl *tmpl );
+LDAP_F char **
+ldap_tmplattrs LDAP_P(( struct ldap_disptmpl *tmpl,
+ char **includeattrs,
+ int exclude,
+ unsigned long syntaxmask ));
-LDAPFUNCDECL struct ldap_disptmpl *
-ldap_name2template( char *name, struct ldap_disptmpl *tmpllist );
+LDAP_F struct ldap_tmplitem *
+ldap_first_tmplrow LDAP_P(( struct ldap_disptmpl *tmpl ));
-LDAPFUNCDECL struct ldap_disptmpl *
-ldap_oc2template( char **oclist, struct ldap_disptmpl *tmpllist );
+LDAP_F struct ldap_tmplitem *
+ldap_next_tmplrow 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_first_tmplcol LDAP_P(( struct ldap_disptmpl *tmpl,
+ struct ldap_tmplitem *row ));
-LDAPFUNCDECL struct ldap_tmplitem *
-ldap_first_tmplrow( struct ldap_disptmpl *tmpl );
+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_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 */
--- /dev/null
+/*
+ * 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 <ldap_cdefs.h>
+
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+LDAP_F int getopt LDAP_P((int, char * const [], const char *));
+
+#endif /* _GETOPT_COMPAT_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.
+ */
+/* Portions
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
/*
+ * 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.
*
+/*
+ * 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
/*
+ * 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.
*
/*
+ * 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.
*
+/*
+ * 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 gdbm if possible *
+ * use berkeley db btree package *
* *
*****************************************************************/
-#include <gdbm.h>
+#include <sys/types.h>
+#include <limits.h>
+#include <fcntl.h>
-typedef datum Datum;
+#ifdef HAVE_DB185_H
+# include <db_185.h>
+#else
+# include <db.h>
+# ifdef HAVE_BERKELEY_DB2
+# define R_NOOVERWRITE DB_NOOVERWRITE
+# define DEFAULT_DB_PAGE_SIZE 1024
+# endif
+#endif
-typedef GDBM_FILE LDBM;
-extern gdbm_error gdbm_errno;
+typedef DBT Datum;
+#define dsize size
+#define dptr data
+
+typedef DB *LDBM;
+
+#define DB_TYPE DB_BTREE
/* for ldbm_open */
-#define LDBM_READER GDBM_READER
-#define LDBM_WRITER GDBM_WRITER
-#define LDBM_WRCREAT GDBM_WRCREAT
-#define LDBM_NEWDB GDBM_NEWDB
-#define LDBM_FAST GDBM_FAST
+#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_SUFFIX ".gdbm"
+# define LDBM_FAST 0
+
+#define LDBM_SUFFIX ".dbb"
+#define LDBM_ORDERED 1
/* for ldbm_insert */
-#define LDBM_INSERT GDBM_INSERT
-#define LDBM_REPLACE GDBM_REPLACE
+#define LDBM_INSERT R_NOOVERWRITE
+#define LDBM_REPLACE 0
#define LDBM_SYNC 0x80000000
-#else /* end of gdbm */
-
-#ifdef LDBM_USE_DBHASH
+#elif defined( LDBM_USE_DBHASH )
/*****************************************************************
* *
#include <sys/types.h>
#include <limits.h>
#include <fcntl.h>
-#include <db.h>
+
+#ifdef HAVE_DB185_H
+# include <db_185.h>
+#else
+# include <db.h>
+# ifdef LDBM_USE_DB2
+# define R_NOOVERWRITE DB_NOOVERWRITE
+# define DEFAULT_DB_PAGE_SIZE 1024
+# endif
+#endif
typedef DBT Datum;
#define dsize size
#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
+#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"
#define LDBM_REPLACE 0
#define LDBM_SYNC 0x80000000
-extern int errno;
-
-#else /* end of db hash */
-
-#ifdef LDBM_USE_DBBTREE
+#elif defined( HAVE_GDBM )
/*****************************************************************
* *
- * use berkeley db btree package *
+ * use gdbm if possible *
* *
*****************************************************************/
-#include <sys/types.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <db.h>
+#include <gdbm.h>
-typedef DBT Datum;
-#define dsize size
-#define dptr data
+typedef datum Datum;
-typedef DB *LDBM;
+typedef GDBM_FILE LDBM;
-#define DB_TYPE DB_BTREE
+extern gdbm_error gdbm_errno;
/* 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_READER GDBM_READER
+#define LDBM_WRITER GDBM_WRITER
+#define LDBM_WRCREAT GDBM_WRCREAT
+#define LDBM_NEWDB GDBM_NEWDB
+#define LDBM_FAST GDBM_FAST
-#define LDBM_SUFFIX ".dbb"
-#define LDBM_ORDERED 1
+#define LDBM_SUFFIX ".gdbm"
/* for ldbm_insert */
-#define LDBM_INSERT R_NOOVERWRITE
-#define LDBM_REPLACE 0
+#define LDBM_INSERT GDBM_INSERT
+#define LDBM_REPLACE GDBM_REPLACE
#define LDBM_SYNC 0x80000000
-extern int errno;
-#else /* end of db btree */
-
-#ifdef LDBM_USE_NDBM
+#elif defined( HAVE_NDBM )
/*****************************************************************
* *
*****************************************************************/
#include <ndbm.h>
-#ifndef O_RDONLY
+
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#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 );
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_ */
/*
+ * 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.
*
#ifndef _LDIF_H
#define _LDIF_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <ldap_cdefs.h>
+
+LDAP_BEGIN_DECL
#define LINE_WIDTH 76 /* maximum length of LDIF lines */
*/
#define LDIF_SIZE_NEEDED(tlen,vlen) \
((tlen) + 4 + LDIF_BASE64_LEN(vlen) \
- + ((LDIF_BASE64_LEN(vlen) + tlen + 3) / LINE_WIDTH * 2 ))
-
-
-#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
+ + ((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 ));
+
+LDAP_END_DECL
#endif /* _LDIF_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.
+ */
/* lthread.h - ldap threads header file */
#ifndef _LTHREAD_H
--- /dev/null
+/*
+ * 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_cdefs.h>
+
+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 */
+/*
+ * 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
+/*
+ * 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_
+/*
+ * 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 $ */
/* 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 <stddef.h>
/* 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
/* 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 <stddef.h>
/* 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
/*
+ * 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.
*
#ifndef _SRCHPREF_H
#define _SRCHPREF_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <ldap_cdefs.h>
+LDAP_BEGIN_DECL
struct ldap_searchattr {
char *sa_attrlabel;
#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
#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();
-
-#else /* !NEEDPROTOS */
-
-LDAPFUNCDECL int
-ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp );
+LDAP_F int
+ldap_init_searchprefs LDAP_P(( char *file,
+ struct ldap_searchobj **solistp ));
-LDAPFUNCDECL int
-ldap_init_searchprefs_buf( char *buf, long buflen,
- struct ldap_searchobj **solistp );
+LDAP_F int
+ldap_init_searchprefs_buf LDAP_P(( char *buf,
+ long buflen,
+ struct ldap_searchobj **solistp ));
-LDAPFUNCDECL void
-ldap_free_searchprefs( struct ldap_searchobj *solist );
+LDAP_F void
+ldap_free_searchprefs LDAP_P(( struct ldap_searchobj *solist ));
-LDAPFUNCDECL struct ldap_searchobj *
-ldap_first_searchobj( struct ldap_searchobj *solist );
+LDAP_F struct ldap_searchobj *
+ldap_first_searchobj LDAP_P(( struct ldap_searchobj *solist ));
-LDAPFUNCDECL struct ldap_searchobj *
-ldap_next_searchobj( struct ldap_searchobj *sollist,
- struct ldap_searchobj *so );
+LDAP_F struct ldap_searchobj *
+ldap_next_searchobj LDAP_P(( struct ldap_searchobj *sollist,
+ struct ldap_searchobj *so ));
-#endif /* !NEEDPROTOS */
+LDAP_END_DECL
-#ifdef __cplusplus
-}
-#endif
#endif /* _SRCHPREF_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.
+ */
+/* Portions
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
*
+## Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+## COPYING RESTRICTIONS APPLY, see COPYRIGHT file
##
## LIBLBER
##
/*
+ * 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.
*
+/*
+ * 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 <stdio.h>
-#include <string.h>
-#include <ctype.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#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;
}
out[ i++ ] = ' ';
}
+
+#endif /* LDAP_DEBUG && LDAP_LIBUI */
}
-#else /* NO_USERINTERFACE */
-void
-lber_bprint( char *data, int len )
-{
-}
-#endif /* NO_USERINTERFACE */
-#endif
/* 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.
*
/* 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.
*
/* 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.
*
/* 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.
*/
/* 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.
*
/* 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.
*
+## Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+## COPYING RESTRICTIONS APPLY, see COPYRIGHT file
##
## Makefile.in for LDAP -lldap
##
/*
+ * 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.
*
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#if !defined( MACOS ) && !defined( DOS )
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
-
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#endif /* DOS */
-
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#endif /* MACOS */
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#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:
*
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;
#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 */
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
-#include "macos.h"
-#endif /* MACOS */
-
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#endif /* DOS */
-#if !defined( MACOS ) && !defined( DOS )
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* !MACOS && !DOS */
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
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 );
}
}
/* 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
/*
+ * 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 <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
/*
+ * 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 <stdio.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include "msdos.h"
-#ifdef NCSA
-#include "externs.h"
-#endif /* NCSA */
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
* name DistinguishedName, -- who
* authentication CHOICE {
* simple [0] OCTET STRING -- passwd
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
* krbv42ldap [1] OCTET STRING
* krbv42dsa [2] OCTET STRING
#endif
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 ) );
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 ) );
/*
+ * 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 <stdio.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include <time.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#ifdef NCSA
-#include "externs.h"
-#endif /* NCSA */
-#ifdef WINSOCK
-#include <time.h>
-#endif /* WINSOCK */
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
#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 ) {
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
}
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;
}
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 */
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;
}
}
+#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 ||
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;
}
} 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 ||
Debug( LDAP_DEBUG_TRACE, "artc: msgid not in request list\n",
0, 0, 0 );
}
+#endif
}
* 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 )) {
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 )
/*
* 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 ));
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#endif /* MACOS */
-#if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 ) && !defined(VMS)
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
+
#include "lber.h"
#include "ldap.h"
#include "ldap-int.h"
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <ac/string.h>
/* Character set used: ISO 8859-1, ISO 8859-2, ISO 8859-3, ... */
/* #define ISO_8859 1 */
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.
/*
+ * 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.
*
#ifdef LDAP_CONNECTIONLESS
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1990, 1994 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
-#include "macos.h"
-#endif /* MACOS */
-#if !defined( MACOS ) && !defined( DOS )
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
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 );
}
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
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
-#include "macos.h"
-#endif /* MACOS */
-
-#if defined( DOS ) || defined( _WIN32 )
-#include "msdos.h"
-#endif /* DOS */
-#if !defined( MACOS ) && !defined( DOS )
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
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 );
}
}
/* send the message */
- return ( send_initial_request( ld, LDAP_REQ_DELETE, dn, ber ));
+ return ( ldap_send_initial_request( ld, LDAP_REQ_DELETE, dn, ber ));
}
/*
+ * 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.
*
/*
+ * 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.
*
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
#include "portable.h"
#include <stdio.h>
/*
+ * 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.
*
* 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 <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
-#include <stdlib.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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 <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
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 );
}
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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.
*
/*
+ * 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 <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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 <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
#include "portable.h"
#include <stdio.h>
/*
+ * 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.
*
#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 <stdio.h>
/*
+ * 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.
*
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
-#include "macos.h"
-#endif /* MACOS */
-#if !defined( MACOS ) && !defined( DOS )
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
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 );
}
}
/* 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
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
-#include "macos.h"
-#endif /* MACOS */
-#if !defined( MACOS ) && !defined( DOS )
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
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 );
}
}
/* 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
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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.
*
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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 <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
-#include "macos.h"
-#endif /* MACOS */
-#if !defined( MACOS ) && !defined( DOS )
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
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 );
}
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 ));
}
/*
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
/*
+ * 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.
*
/*
+ * 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.
*
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
#include "portable.h"
#include <stdlib.h>
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
#include "portable.h"
#include <stdio.h>
+/*
+ * 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
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
#include "portable.h"
#include <stdio.h>
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <ac/string.h>
#include <ctype.h>
/*
+ * 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 <stdio.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include "msdos.h"
-#ifdef NCSA
-#include "externs.h"
-#endif /* NCSA */
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
/* 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 {
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 )
#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 )
free( (char *) ld );
+ WSACleanup();
+
return( err );
}
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 );
}
/*
+ * 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.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1996 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>