3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 * Copyright (c) 1990 Regents of the University of Michigan.
16 #include <ac/stdlib.h>
19 #include <ac/socket.h>
20 #include <ac/string.h>
26 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber )
30 Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
33 assert( LDAP_VALID( ld ) );
34 assert( entry != NULL );
35 assert( ber != NULL );
37 if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULL ) {
42 **ber = *entry->lm_ber;
45 * Skip past the sequence, dn, sequence of sequence, snarf the
46 * attribute type, and skip the set of values, leaving us
47 * positioned right before the next attribute type/value sequence.
50 if ( ber_scanf( *ber, "{x{{ax}" /*}}*/, &attr )
52 ld->ld_errno = LDAP_DECODING_ERROR;
63 ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
67 Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
70 assert( LDAP_VALID( ld ) );
71 assert( entry != NULL );
72 assert( ber != NULL );
74 /* skip sequence, snarf attribute type, skip values */
75 if ( ber_scanf( ber, "{ax}", &attr )
77 ld->ld_errno = LDAP_DECODING_ERROR;