From 80cf83ace8f0728398ba5b660ee005ef267c3096 Mon Sep 17 00:00:00 2001 From: Stuart Lynne Date: Tue, 27 Oct 1998 07:10:20 +0000 Subject: [PATCH] 1. add ldap_get_lderrno(), required if struct ldap is private --- include/ldap.h | 1 + libraries/libldap/error.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/ldap.h b/include/ldap.h index 2486fe07fb..b919b6bbc6 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -523,6 +523,7 @@ LDAP_F int ldap_delete_s LDAP_P(( LDAP *ld, char *dn )); LDAP_F int ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit )); LDAP_F char *ldap_err2string LDAP_P(( int err )); LDAP_F void ldap_perror LDAP_P(( LDAP *ld, char *s )); +LDAP_F int ldap_get_lderrno LDAP_P((LDAP *ld, char **matched, char **msg)); /* * in modify.c: diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index d7b96c7ebe..04d9f255a7 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -164,3 +164,14 @@ ldap_result2error( LDAP *ld, LDAPMessage *r, int freeit ) return( ld->ld_errno ); } + + +int +ldap_get_lderrno(LDAP *ld, char **matched, char **msg) +{ + if ( matched ) + *matched = ld->ld_matched; + if ( msg ) + *msg = NULL; + return( ld->ld_errno ); +} -- 2.39.5