slapi_entry2str()
slapi_entry2str() generates a description
of an entry as a string.
dn: <dn>\n
*[<attr>: <value>\n]
*[<attr>:: <base_64_encoded_value>]where:- *
- The operator "*" when it precedes an element indicates repetition.
The full form is: <a>*<b> where <a> and <b>
are optional decimal values, indicating at least <a> and at
most <b> occurrences of element.
Default values are 0 and infinity so that * allows any number, including zero; 1* requires at least one; 3*3 allows exactly 3 and 1*2 allows one or two.
- dn
- Distinguished name
- attr
- Attribute name
- \n
- New line
- value
- Attribute value
dn: uid=rbrown2, ou=People, o=airius.com
cn: Robert Brown
sn: Brown
...When you do not use the string, you can free it from memory by calling the slapi_ch_free() function.
Call
the slapi_str2entry() function
to convert a string description in this format to an entry of the Slapi_Entry data
type.
- Syntax
#include "slapi-plugin.h" char *slapi_entry2str( Slapi_Entry *e, int *len );- Parameters
-
- e
- Address of the entry that you want to generate a description for.
- len
- Address of the length of the returned string.
- Returns
- The description of the entry as a string is returned or NULL if an error occurs.