slapi_str2entry()

slapi_str2entry() converts an LDIF description of a directory entry (a string value) into an entry of the Slapi_Entry data type that can be passed to other API functions.

Note: The function modifies the s string argument, and you must make a copy of this string before it is called.
If there are errors during the conversion process, the function returns a NULL instead of the entry.

When you are through working with the entry, call the slapi_entry_free() function.

To convert an entry to a string description, call slapi_entry2str().

Syntax
#include "slapi-plugin.h"
Slapi_Entry *slapi_str2entry( char *s, int flags );
Parameters
s
The description of an entry that you want to convert.
flags
Specifies how the entry must be generated.
The flags argument can be one of the following values:
  • SLAPI_STR2ENTRY_REMOVEDUPVALS - Removes any duplicate values in the attributes of the entry.
  • SLAPI_STR2ENTRY_ADDRDNVALS - Adds the relative distinguished name (RDN) components.
Returns
A pointer to the Slapi_Entry structure that represents the entry is returned, or a NULL is returned if the string cannot be converted, for example, if no DN is specified in the string.