HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
true | false
yes | no
An integer
Comparisons are case-insensitive (TRUE, true, and true are all the same), and unique substrings
can be matched (t and tr will be interpreted as true). If the attribute value is a number, then
nonzero numbers are interpreted as true, and 0 is interpreted as false.
24.13 slapi_entry_attr_get_charptr()
Gets the first value of an attribute of an entry as a string.
Syntax
#include "slapi-plugin.h"
char *slapi_entry_attr_get_charptr(const Slapi_Entry* e,
const char *type);
Parameters This function takes the following parameters:
Entry from which you want to get the string value.
e
Attribute type from which you want to get the value.
type
Returns This function returns one of the following values:
A copy of the first value in the attribute.
NULL if the entry does not contain the attribute.
Memory concerns When you are done working with this value, free it from memory by calling
the “slapi_ch_free()” function.
24.14 slapi_entry_attr_get_charray()
Gets the values of a multi-valued attribute of an entry.
Description This function is very similar to “slapi_entry_attr_get_charptr()”, except that it
returns a char** array for multi-valued attributes. The array and all values are 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);
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:
Entry from which you want to get the values.
e
Attribute type from which you want to get the values.
type
Returns This function returns one of the following values:
A copy of all the values of the attribute.
NULL if the entry does not contain the attribute or if the attribute has no values.
218 Functions for managing entries