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>
26 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber )
30 Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
32 if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
36 **ber = *entry->lm_ber;
39 * Skip past the sequence, dn, sequence of sequence, snarf the
40 * attribute type, and skip the set of values, leaving us
41 * positioned right before the next attribute type/value sequence.
44 len = LDAP_MAX_ATTR_LEN;
45 if ( ber_scanf( *ber, "{x{{sx}", ld->ld_attrbuffer, &len )
47 ld->ld_errno = LDAP_DECODING_ERROR;
52 return( ld->ld_attrbuffer );
57 ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
61 Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
63 /* skip sequence, snarf attribute type, skip values */
64 len = LDAP_MAX_ATTR_LEN;
65 if ( ber_scanf( ber, "{sx}", ld->ld_attrbuffer, &len )
67 ld->ld_errno = LDAP_DECODING_ERROR;
72 return( ld->ld_attrbuffer );