mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-05 14:42:10 -05:00
Add entry_dup(); make slapi_entry_dup() use it
This commit is contained in:
parent
7094fd6c08
commit
7a1c94acd3
3 changed files with 18 additions and 11 deletions
|
|
@ -745,3 +745,19 @@ int entry_decode(struct berval *bv, Entry **e)
|
|||
*e = x;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Entry *entry_dup( Entry *e )
|
||||
{
|
||||
Entry *ret;
|
||||
|
||||
ret = (Entry *)ch_calloc( 1, sizeof(*ret) );
|
||||
|
||||
ret->e_id = e->e_id;
|
||||
ber_dupbv( &ret->e_name, &e->e_name );
|
||||
ber_dupbv( &ret->e_nname, &e->e_nname );
|
||||
ret->e_attrs = attrs_dup( e->e_attrs );
|
||||
ret->e_ocflags = e->e_ocflags;
|
||||
ber_dupbv( &ret->e_bv, &e->e_bv );
|
||||
ret->e_private = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -465,6 +465,7 @@ LDAP_SLAPD_F (void) entry_free LDAP_P(( Entry *e ));
|
|||
LDAP_SLAPD_F (int) entry_cmp LDAP_P(( Entry *a, Entry *b ));
|
||||
LDAP_SLAPD_F (int) entry_dn_cmp LDAP_P(( const void *v_a, const void *v_b ));
|
||||
LDAP_SLAPD_F (int) entry_id_cmp LDAP_P(( const void *v_a, const void *v_b ));
|
||||
LDAP_SLAPD_F (Entry *) entry_dup LDAP_P(( Entry *e ));
|
||||
|
||||
/*
|
||||
* extended.c
|
||||
|
|
|
|||
|
|
@ -166,17 +166,7 @@ Slapi_Entry *
|
|||
slapi_entry_dup( Slapi_Entry *e )
|
||||
{
|
||||
#ifdef LDAP_SLAPI
|
||||
Slapi_Entry *ret;
|
||||
|
||||
ret = (Slapi_Entry *)slapi_ch_calloc( 1, sizeof(*ret) );
|
||||
|
||||
ret->e_id = e->e_id;
|
||||
ber_dupbv( &ret->e_name, &e->e_name );
|
||||
ber_dupbv( &ret->e_nname, &e->e_nname );
|
||||
ret->e_attrs = attrs_dup( e->e_attrs );
|
||||
ret->e_ocflags = e->e_ocflags;
|
||||
ber_dupbv( &ret->e_bv, &e->e_bv );
|
||||
ret->e_private = NULL;
|
||||
return entry_dup( e );
|
||||
#else /* LDAP_SLAPI */
|
||||
return NULL;
|
||||
#endif /* LDAP_SLAPI */
|
||||
|
|
|
|||
Loading…
Reference in a new issue