|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | |
| DS_Status | DS_LDIF_Close (DS_LDIF *ldif) |
| Close the input/output LDIF files and release all associated resources. | |
| DS_Status | DS_LDIF_Get (DS_LDIF *ldif, DS_Entry **entry_p) |
| Get the next entry from the input LDIF file. | |
| DS_Status | DS_LDIF_GetDN (DS_LDIF *ldif, DS_DN **dn_p) |
| Get the DN of the next entry from the input LDIF file. | |
| DS_Status | DS_LDIF_GetPut (DS_LDIF *ldif1, DS_LDIF *ldif2) |
| Copy an entry across from one LDIF file to another. | |
| DS_Status | DS_LDIF_Put (DS_LDIF *ldif, const DS_Entry *entry) |
| Write an entry to the output LDIF file. | |
| DS_Status | DS_LDIF_TellOutput (DS_LDIF *ldif, off_t *offset_p) |
| Return the current write-offset in the output file. | |
| DS_Status | DS_LDIF_Tell (DS_LDIF *ldif, off_t *offset_p) |
| Return the current read-offset in the input file. | |
| DS_Status | DS_LDIF_Seek (DS_LDIF *ldif, off_t offset) |
| Seek the input file to the given file-offset. | |
| DS_Status | DS_LDIF_ErrorString (DS_LDIF *ldif, char **errstr_p) |
| Return a plain-text report of all errors encountered. | |
| DS_Status | DS_LDIF_PutComment (DS_LDIF *ldif, const char *str) |
| Write a comment to the output LDIF file. | |
| DS_Status | DS_LDIF_Entry2LDIFString (const DS_Entry *entry, char **str_p) |
| Convert an entry to an LDIF-encoded record in memory. | |
| 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. | |
| DS_Status | DS_LDIF_AllowUnknownAttrs (DS_LDIF *ldif, int allow_unknown) |
| Turn on or off the flag that allows unknown attributes to be read. | |
| 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. | |
Open an LDIF stream handle with input and/or output LDIF files.
| in_fnam | [in] Name of file to read as input, or NULL for no input | |
| out_fnam | [in] Name of file to write as output, or NULL for no output | |
| ldif_p | [out] Returned handle to be used in other DS_LDIF_* calls, or NULL on error |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_OPFAILED | If either the input or output file could not be opened | |
| DS_E_BADPARAM | If both in_fnam and out_fnam parameters are NULL, or if ldif_p is NULL | |
| DS_E_NOERROR | A valid handle was returned |
If the input filename has the same string value as the output filename, then a blank file is created for writing, and the input stream is also attached to the new file, allowing it to read back entries already written to the output stream. Note that the seek position is moved to the end of the file every time a new entry is added with DS_LDIF_Put(), so normally DS_LDIF_Seek() would be called before calling DS_LDIF_Get() one or more times, using file-offsets previously obtained with DS_LDIF_TellOutput().
Close the input/output LDIF files and release all associated resources.
| ldif | [in] LDIF stream handle |
| DS_E_NOERROR | Resources were released without problem |
Get the next entry from the input LDIF file.
| ldif | [in] LDIF stream handle | |
| entry_p | [out] Newly-read entry, or NULL on error or EOF |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_OPFAILED | The stream was not opened for reading | |
| DS_E_BADDN | The DN could not be converted | |
| DS_E_BADENTRY | Badly-formed data was found in the LDIF file | |
| DS_E_BADATTRTYPE | An attribute could not be converted | |
| DS_E_BADATTRVALUE | An attribute could not be converted | |
| DS_E_BADATTRSYNTAX | An attribute could not be converted | |
| DS_E_NOTFOUND | End-of-file was reached | |
| DS_E_NOERROR | An entry was read without problem |
Get the DN of the next entry from the input LDIF file.
| ldif | [in] LDIF stream handle | |
| dn_p | [out] Newly-read DN, or NULL on error or EOF |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_OPFAILED | The stream was not opened for reading | |
| DS_E_BADDN | The DN could not be converted | |
| DS_E_BADENTRY | Badly-formed data was found in the LDIF file | |
| DS_E_NOTFOUND | End-of-file was reached | |
| DS_E_NOERROR | An entry was read without problem |
Copy an entry across from one LDIF file to another.
| ldif1 | [in] LDIF stream handle for Get operation | |
| ldif2 | [in] LDIF stream handle for Put operation |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_OPFAILED | The first stream was not opened for reading or the second wasn't open for writing, or there was a problem writing the entry. | |
| DS_E_BADENTRY | Badly-formed data was found in the source LDIF file | |
| DS_E_NOTFOUND | End-of-file was reached | |
| DS_E_NOERROR | An entry was read without problem |
Write an entry to the output LDIF file.
Both normal entries and the four types of change-entries are handled. However, a single LDIF stream can handle only all normal-records or all change-records, selected by the first entry read from or written to the stream. Attempting to write a record of the other type will result in DS_E_BADENTRY.
| ldif | [in] LDIF stream handle | |
| entry | [in] Entry to write |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_OPFAILED | There was an error writing the data to the file, or the stream was not set up for writing | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_BADENTRY | The entry could not be converted to LDIF | |
| DS_E_BADATTRTYPE | An attribute could not be converted | |
| DS_E_BADATTRVALUE | An attribute could not be converted | |
| DS_E_BADATTRSYNTAX | An attribute could not be converted | |
| DS_E_BADDN | Some part of the DN could not be converted | |
| DS_E_NOERROR | Entry was written without problem |
Return the current write-offset in the output file.
| ldif | [in] LDIF stream handle | |
| offset_p | [out] Current write-offset |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_OPFAILED | The stream was not opened for writing | |
| DS_E_NOERROR | Offset was read without problem |
Return the current read-offset in the input file.
| ldif | [in] LDIF stream handle | |
| offset_p | [out] Current read-offset |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_OPFAILED | The stream was not opened for reading | |
| DS_E_NOERROR | Offset was read without problem |
Seek the input file to the given file-offset.
| ldif | [in] LDIF stream handle | |
| offset | [out] Offset to seek to |
| DS_E_OPFAILED | Error seeking to the given offset, or the stream was not opened for reading | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_NOERROR | Seek completed without problem |
Return a plain-text report of all errors encountered.
| ldif | [in] LDIF stream handle | |
| errstr_p | [out] Error string, or NULL for no new errors |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_NOERROR | An error string or NULL has been returned |
Write a comment to the output LDIF file.
| ldif | [in] LDIF stream handle | |
| str | [in] String to write |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_NOERROR | Success |
Convert an entry to an LDIF-encoded record in memory.
| entry | [in] DS_Entry to convert | |
| str_p | [out] Output string |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_OPFAILED | There was an error writing the data | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_BADENTRY | The entry could not be converted to LDIF | |
| DS_E_BADATTRTYPE | An attribute could not be converted | |
| DS_E_BADATTRVALUE | An attribute could not be converted | |
| DS_E_BADATTRSYNTAX | An attribute could not be converted | |
| DS_E_BADDN | Some part of the DN could not be converted | |
| DS_E_NOERROR | Entry was written without problem |
Convert an LDIF-encoded record in memory into a DS_Entry.
| str_p | [in/out] Variable pointing to string to convert | |
| entry_p | [out] Output DS_Entry | |
| allow_unknown | [in] Allow unknown attributes to be converted? (1 yes, 0 no) |
| DS_E_NOMEMORY | Out of memory | |
| DS_E_BADPARAM | A NULL argument was passed to the function | |
| DS_E_BADDN | The DN could not be converted | |
| DS_E_BADENTRY | Badly-formed data was found in the LDIF file | |
| DS_E_BADATTRTYPE | An attribute could not be converted | |
| DS_E_BADATTRVALUE | An attribute could not be converted | |
| DS_E_BADATTRSYNTAX | An attribute could not be converted | |
| DS_E_NOTFOUND | End-of-file was reached | |
| DS_E_NOERROR | An entry was read without problem |
Turn on or off the flag that allows unknown attributes to be read.
| ldif | [in] DS_LDIF stream to modify | |
| allow_unknown | [in] Allow unknown attributes? (1 yes, 0 no) |
| DS_E_NOERROR | Success | |
| DS_E_BADPARAM | If ldif is NULL or allow_unknown is something other than 0 or 1 |
Get the state of the flag that allows unknown attributes to be read.
| ldif | [in] DS_LDIF stream to modify | |
| allow_unknown_p | [out] Variable to place result |
| DS_E_NOERROR | Success | |
| DS_E_BADPARAM | If ldif or allow_unknown_p is NULL |