1ldap_get_values(3LDAP)      LDAP Library Functions      ldap_get_values(3LDAP)
2
3
4

NAME

6       ldap_get_values,         ldap_get_values_len,        ldap_count_values,
7       ldap_count_values_len,  ldap_value_free,  ldap_value_free_len  -   LDAP
8       attribute value handling functions
9

SYNOPSIS

11       cc[ flag... ] file... -lldap[ library... ]
12       #include <lber.h>
13       #include <ldap.h>
14
15       char **ldap_get_values(LDAP *ld, LDAPMessage *entry, char *attr);
16
17
18       struct berval **ldap_get_values_len(LDAP *ld, LDAPMessage *entry,
19            char *attr);
20
21
22       ldap_count_values(char **vals);
23
24
25       ldap_count_values_len(struct berval **vals);
26
27
28       ldap_value_free(char **vals);
29
30
31       ldap_value_free_len(struct berval **vals);
32
33

DESCRIPTION

35       These  functions  are  used to retrieve and manipulate attribute values
36       from  an  LDAP  entry  as  returned   by   ldap_first_entry(3LDAP)   or
37       ldap_next_entry(3LDAP).  ldap_get_values()  takes  the  entry  and  the
38       attribute attr whose values are desired and returns  a  null-terminated
39       array  of  the  attribute's  values.   attr may be an attribute type as
40       returned          from          ldap_first_attribute(3LDAP)          or
41       ldap_next_attribute(3LDAP),  or  if  the attribute type is known it can
42       simply be given.
43
44
45       The  number  of  values  in  the  array  can  be  counted  by   calling
46       ldap_count_values(). The array of values returned can be freed by call‐
47       ing ldap_value_free().
48
49
50       If the attribute values are binary in nature, and thus not suitable  to
51       be returned as an array of char *'s, the ldap_get_values_len() function
52       can be used instead.  It takes the  same  parameters  as  ldap_get_val‐
53       ues(), but returns a null-terminated array of pointers to berval struc‐
54       tures, each containing the length of and a pointer to a value.
55
56
57       The  number  of  values  in  the  array  can  be  counted  by   calling
58       ldap_count_values_len().  The  array of values returned can be freed by
59       calling ldap_value_free_len().
60

ERRORS

62       If an error occurs in ldap_get_values() or ldap_get_values_len(),  NULL
63       returned  and the ld_errno field in the ld parameter is set to indicate
64       the error.  See ldap_error(3LDAP) for a description of  possible  error
65       codes.
66

ATTRIBUTES

68       See attributes(5) for a description of the following attributes:
69
70
71
72
73       ┌─────────────────────────────┬─────────────────────────────┐
74       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
75       │Availability                 │SUNWcsl (32-bit)             │
76       │                             │SUNWcslx (64-bit)            │
77       │Interface Stability          │Evolving                     │
78       └─────────────────────────────┴─────────────────────────────┘
79

SEE ALSO

81       ldap(3LDAP),    ldap_first_entry(3LDAP),   ldap_first_attribute(3LDAP),
82       ldap_error(3LDAP), attributes(5)
83

NOTES

85       These functions allocates memory that the caller must free.
86
87
88
89SunOS 5.11                        28 Jan 2002           ldap_get_values(3LDAP)
Impressum