Sun Java System Directory Server Enterprise Edition 6.2 Developer's Guide

slapi_entry2str()

Generates an LDIF string description of an LDAP entry.

Syntax

#include "slapi-plugin.h"
 char *slapi_entry2str( Slapi_Entry const *e, int *len );

Parameters

This function takes the following parameters:

e

Entry that you want to convert into an LDIF string.

len

Length of the returned LDIF string.

Returns

Returns the LDIF string representation of the entry you specify. If an error occurs, the function returns NULL.

Description

This function generates an LDIF string value conforming to the following format:

dn: dn\n
 [attr: value\n]*

For example:

dn: uid=jdoe, ou=People, o=example.com
cn: Jane Doe
sn: Doe
...

To convert a string description in LDIF format to an entry of the Slapi_Entry data type, call the slapi_str2entry() function.

Memory Concerns

When you no longer need to use the string, you should free it from memory by calling the slapi_ch_free_string() function.

See Also

slapi_entry2str_with_options()

slapi_str2entry()