Netscape DIRECTORY SERVER 6.02 - PLUG-IN Manual page 277

Table of Contents

Advertisement

slapi_entry_attr_get_charray()
Gets the values of a multi-valued attribute of an entry.
Syntax
#include "slapi-plugin.h"
char ** slapi_entry_attr_get_charray( const Slapi_Entry* e,
const char *type);
Parameters
This function takes the following parameters:
e
type
Description
This function is very similar to
returns a
copies. Even if the attribute values are not strings, they will still be null terminated,
so that they can be used safely in a string context. If there are no values, NULL will
be returned. Because the array is NULL terminated, the usage should be similar to
the sample shown below:
char **ary = slapi_entry_attr_get_charray(e, someattr);
int ii;
for (ii = 0; ary && ary[ii]; ++ii) {
char *strval = ary[ii];
...
}
slapi_ch_array_free(ary);
Returns
This function returns one of the following values:
A copy of all the values of the attribute.
NULL
Memory Concerns
When you are done working with the values, free them from memory by calling
the
slapi_ch_array_free()
Entry from which you want to get the values.
Attribute type from which you want to get the values.
array for multi-valued attributes. The array and all values are
char**
if the entry does not contain the attribute or if the attribute has no values.
function.
slapi_entry_attr_get_charptr()
Functions for Managing Entries
, except that it
Chapter 14
Function Reference
277

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.02

Table of Contents