2 * Copyright (c) 1990 Regents of the University of Michigan.
11 static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
18 #include <ac/socket.h>
19 #include <ac/string.h>
27 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber )
31 Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
33 if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
37 **ber = *entry->lm_ber;
40 * Skip past the sequence, dn, sequence of sequence, snarf the
41 * attribute type, and skip the set of values, leaving us
42 * positioned right before the next attribute type/value sequence.
45 len = LDAP_MAX_ATTR_LEN;
46 if ( ber_scanf( *ber, "{x{{sx}", ld->ld_attrbuffer, &len )
48 ld->ld_errno = LDAP_DECODING_ERROR;
53 return( ld->ld_attrbuffer );
58 ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
62 Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
64 /* skip sequence, snarf attribute type, skip values */
65 len = LDAP_MAX_ATTR_LEN;
66 if ( ber_scanf( ber, "{sx}", ld->ld_attrbuffer, &len )
68 ld->ld_errno = LDAP_DECODING_ERROR;
73 return( ld->ld_attrbuffer );