Sun Directory Server Enterprise Edition 7.0 Developer's Guide


Converts an LDIF description of a directory entry (a string value) into an entry of the Slapi_Entry type.


#include "slapi-plugin.h"
Slapi_Entry *slapi_str2entry( char *s, int flags );


This function takes the following parameters:


Description of an entry that you want to convert to Slapi_Entry.


One or more flags specifying how the entry should be generated

The value of the flags argument can be one of the following values:


Removes any duplicate values in the attributes of the entry.


Adds the relative distinguished name (RDN) components (for example, uid=bjensen) as attributes of the entry.


Pointer to the Slapi_Entry structure representing the entry, or NULL if the string cannot be converted (for example, if no DN is specified in the string).


A directory entry can be described by a string in LDIF format.

Calling the slapi_str2entry() function converts a string description in this format to a Slapi_Entry structure, which you can pass to other API functions.

Note –

This function modifies the string argument s. If you must use the string value again, make a copy of this string before calling slapi_str2entry().

If an error occurred during the conversion process, the function returns NULL instead of the entry.

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

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

Memory Concerns

Do not use free() or slapi_ch_free() to free the entry. Always use slapi_entry_free() instead.

See Also