2 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6 * Copyright (c) 1990 Regents of the University of Michigan.
15 #include <ac/stdlib.h>
18 #include <ac/socket.h>
19 #include <ac/string.h>
25 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber )
29 Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
32 assert( LDAP_VALID( ld ) );
33 assert( entry != NULL );
34 assert( ber != NULL );
36 if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
41 **ber = *entry->lm_ber;
44 * Skip past the sequence, dn, sequence of sequence, snarf the
45 * attribute type, and skip the set of values, leaving us
46 * positioned right before the next attribute type/value sequence.
49 if ( ber_scanf( *ber, "{x{{ax}", &attr )
51 ld->ld_errno = LDAP_DECODING_ERROR;
62 ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
66 Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
69 assert( LDAP_VALID( ld ) );
70 assert( entry != NULL );
71 assert( ber != NULL );
73 /* skip sequence, snarf attribute type, skip values */
74 if ( ber_scanf( ber, "{ax}", &attr )
76 ld->ld_errno = LDAP_DECODING_ERROR;