Functions for Managing Entries
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) {
}
slapi_ch_array_free(ary);
Returns
This function returns one of the following values:
•
A copy of all the values of the attribute.
•
NULL
values.
Memory Concerns
When you are done working with the values, free them from memory by calling
the
slapi_ch_array_free()
See Also
slapi_entry_attr_get_charptr()
slapi_entry_attr_get_int()
Gets the first value of an attribute in an entry as an integer.
Syntax
#include "slapi-plugin.h"
int slapi_entry_attr_get_int(const Slapi_Entry* e, const char
*type);
Parameters
This function takes the following parameters:
330
Netscape Directory Server Plug-in Programmer's Guide • October 2004
array for multi-valued attributes. The array and all values are
char**
char *strval = ary[ii];
...
if the entry does not contain the attribute or if the attribute has no
slapi_entry_attr_get_charptr()
function.
, except that it
Need help?
Do you have a question about the NETSCAPE DIRECTORY SERVER 7.0 - PLUG-IN and is the answer not in the manual?
Questions and answers