Summary: Isode provides a number of APIs which allow integrators and product developers to build components that allow client programs to connect to, query and modify data in the directory.
dsapi_ldif.h File Reference

API methods for reading and writing LDIF files. More...

#include <stddef.h>
#include <sys/stat.h>
#include <isode/ds/dsapi/dsapi_cdecl.h>
#include <isode/ds/dsapi/dsapi_types.h>

Go to the source code of this file.

Functions

DS_Status DS_LDIF_Open (const char *in_fnam, const char *out_fnam, DS_LDIF **ldif_p)
 Open an LDIF stream handle with input and/or output LDIF files. More...
 
DS_Status DS_LDIF_Close (DS_LDIF *ldif)
 Close the input/output LDIF files and release all associated resources. More...
 
DS_Status DS_LDIF_Get (DS_LDIF *ldif, DS_Entry **entry_p)
 Get the next entry from the input LDIF file. More...
 
DS_Status DS_LDIF_GetDN (DS_LDIF *ldif, DS_DN **dn_p)
 Get the DN of the next entry from the input LDIF file. More...
 
DS_Status DS_LDIF_GetPut (DS_LDIF *ldif1, DS_LDIF *ldif2)
 Copy an entry across from one LDIF file to another. More...
 
DS_Status DS_LDIF_Put (DS_LDIF *ldif, const DS_Entry *entry)
 Write an entry to the output LDIF file. More...
 
DS_Status DS_LDIF_TellOutput (DS_LDIF *ldif, off_t *offset_p)
 Return the current write-offset in the output file. More...
 
DS_Status DS_LDIF_Tell (DS_LDIF *ldif, off_t *offset_p)
 Return the current read-offset in the input file. More...
 
DS_Status DS_LDIF_Seek (DS_LDIF *ldif, off_t offset)
 Seek the input file to the given file-offset. More...
 
DS_Status DS_LDIF_ErrorString (DS_LDIF *ldif, char **errstr_p)
 Return a plain-text report of all errors encountered. More...
 
DS_Status DS_LDIF_PutComment (DS_LDIF *ldif, const char *str)
 Write a comment to the output LDIF file. More...
 
DS_Status DS_LDIF_Entry2LDIFString (const DS_Entry *entry, char **str_p)
 Convert an entry to an LDIF-encoded record in memory. More...
 
DS_Status DS_LDIF_LDIFString2Entry (const char **str_p, DS_Entry **entry_p, int allow_unknown)
 Convert an LDIF-encoded record in memory into a DS_Entry. More...
 
DS_Status DS_LDIF_AllowUnknownAttrs (DS_LDIF *ldif, int allow_unknown)
 Turn on or off the flag that allows unknown attributes to be read. More...
 
DS_Status DS_LDIF_GetAllowUnknownAttrs (DS_LDIF *ldif, int *allow_unknown_p)
 Get the state of the flag that allows unknown attributes to be read. More...
 

Detailed Description

API methods for reading and writing LDIF files.

These API methods allow LDIF files to be read and written. Random access is permitted to input files after the first read-through, via DS_LDIF_Tell() and DS_LDIF_Seek().

Reading and writing change-records is supported. However, note that a single LDIF stream can either handle all change-records, or all normal-records, but not both at the same time. This applies to writing as well as reading.

Definition in file dsapi_ldif.h.