HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Memory concerns When you no longer need to use the string, you should free it from memory
by calling the “slapi_ch_free()” function.
See also
“slapi_entry2str_with_options()”
“slapi_str2entry()”
24.2 slapi_entry2str_with_options()
Generates a description of an entry as an LDIF string. This function behaves much like
slapi_entry2str(); however, you can specify output options with this function.
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, dc=example,dc=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.
Syntax
#include "slapi-plugin.h"
char *slapi_entry2str_with_options( Slapi_Entry *e, int *len, int options );
Parameters This function takes the following parameters:
Entry that you want to convert into an LDIF string.
e
Length of the LDIF string returned by this function.
len
An option set that specifies how you want the string converted.
options
The options parameter You can OR together any of the following options when you call this
function:
DescriptionFlag value
This is only used internally by replication. This allows access to the internal
data used by multi-master replication.
SLAPI_DUMP_STATEINFO
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_UNIQUEID
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_NOOPATTRS
By default, lines will be wrapped as defined in the LDIF specification. With
this option, line wrapping is disabled.
SLAPI_DUMP_NOWRAP
Returns This function returns one of the following values:
The LDIF string representation of the entry you specify.
NULL if an error occurs.
Memory concerns When you no longer need to use the string, you should free it from memory
by calling the “slapi_ch_free()” function.
See also
24.2 slapi_entry2str_with_options() 213