]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_first_attribute.3
Generate man page date from version.sh
[openldap] / doc / man / man3 / ldap_first_attribute.3
1 .TH LDAP_FIRST_ATTRIBUTE 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2002 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_first_attribute, ldap_next_attribute \- step through LDAP entry attributes
7 .SH SYNOPSIS
8 .nf
9 .ft B
10 #include <ldap.h>
11 .LP
12 .ft B
13 char *ldap_first_attribute(
14         LDAP *ld, LDAPMessage entry, BerElement **berptr )
15 .LP
16 .ft B
17 char *ldap_next_attribute(
18         LDAP *ld, LDAPMessage entry, BerElement *ber )
19 .SH DESCRIPTION
20 The
21 .B ldap_first_attribute()
22 and
23 .B ldap_next_attribute()
24 routines are used
25 to step through the attributes in an LDAP entry.
26 .B ldap_first_attribute()
27 takes an \fIentry\fP as returned by
28 .BR ldap_first_entry (3)
29 or
30 .BR ldap_next_entry (3)
31 and returns a pointer to character string
32 containing the first attribute description in the entry.
33 .B ldap_next_attribute()
34 returns the next attribute description in the entry.
35 .LP
36 It also returns, in \fIberptr\fP, a pointer to a BerElement it has
37 allocated to keep track of its current position.  This pointer should
38 be passed to subsequent calls to
39 .B ldap_next_attribute()
40 and is used used
41 to effectively step through the entry's attributes.  The caller is
42 solely responsible for freeing the BerElement pointed to by \fIberptr\fP
43 when it is no longer needed by calling
44 .BR ber_free (3).
45 When calling
46 .BR ber_free (3)
47 in this instance, be sure the second argument is 0.
48 .LP
49 The attribute names returned are suitable for inclusion in a call
50 to
51 .BR ldap_get_values (3)
52 to retrieve the attribute's values.
53 .SH ERRORS
54 If an error occurs, NULL is returned and the ld_errno field in the
55 \fIld\fP parameter is set to indicate the error.  See
56 .BR ldap_error (3)
57 for a description of possible error codes.
58 .SH NOTES
59 The
60 .B ldap_first_attribute()
61 and
62 .B ldap_next_attribute()
63 return dynamically allocated memory that must be freed by the caller via
64 .BR ldap_memfree (3).   
65 .SH SEE ALSO
66 .BR ldap (3),
67 .BR ldap_first_entry (3),
68 .BR ldap_get_values (3),
69 .BR ldap_error (3)
70 .SH ACKNOWLEDGEMENTS
71 .B      OpenLDAP
72 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
73 .B      OpenLDAP
74 is derived from University of Michigan LDAP 3.3 Release.