Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_entry2str_with_options()

Generates a description of an entry as an LDIF string. This function behaves much like slapi_str2entry(). You can however specify output options with this function.

Syntax

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

Parameters

This function takes the following parameters:

e

Entry that you want to convert into an LDIF string.

len

Length of the LDIF string returned by this function.

options

An option set that specifies how you want the string converted.

The Options Parameter

You can OR together any of the following options when you call this function:

Flag Value 

Description 

SLAPI_DUMP_STATEINFO

This is only used internally by replication. This allows access to the internal data used by multi-master replication. 

SLAPI_DUMP_UNIQUEID

This option is used when creating an LDIF file to be used to initialize a replica. Each entry will contain the nsuniqueID operational attribute.

SLAPI_DUMP_NOOPATTRS

By default, certain operational attributes (such as creatorName, modifiersName, createTimestamp, modifyTimestamp ) may be included in the output. With this option, no operational attributes will be included.

SLAPI_DUMP_NOWRAP

By default, lines will be wrapped as defined in the LDIF specification. With this option, line wrapping is disabled. 

Returns

This function returns the LDIF string representation of the entry you specify or NULL if an error occurs.

Description

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

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

For example:

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

To convert an entry described in LDIF string format to an LDAP entry using 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()

slapi_str2entry()