2 * Copyright (c) 1990 Regents of the University of Michigan.
9 static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
19 #if defined( DOS ) || defined( _WIN32 )
23 #include <sys/types.h>
24 #include <sys/socket.h>
33 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber )
37 Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
39 if ( (*ber = alloc_ber_with_options( ld )) == NULLBER ) {
43 **ber = *entry->lm_ber;
46 * Skip past the sequence, dn, sequence of sequence, snarf the
47 * attribute type, and skip the set of values, leaving us
48 * positioned right before the next attribute type/value sequence.
51 len = LDAP_MAX_ATTR_LEN;
52 if ( ber_scanf( *ber, "{x{{sx}", ld->ld_attrbuffer, &len )
54 ld->ld_errno = LDAP_DECODING_ERROR;
59 return( ld->ld_attrbuffer );
64 ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
68 Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
70 /* skip sequence, snarf attribute type, skip values */
71 len = LDAP_MAX_ATTR_LEN;
72 if ( ber_scanf( ber, "{sx}", ld->ld_attrbuffer, &len )
74 ld->ld_errno = LDAP_DECODING_ERROR;
79 return( ld->ld_attrbuffer );