From 425386ff6141bba2e7b1d8f3c27e96aaf1c5cb95 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 26 Aug 2009 15:59:00 +1000 Subject: s4:ldb Add ldb_ldif_write_string() and python wrappers This allows us to turn a python LdbMessage back into a string. Andrew Bartlett --- source4/lib/ldb/include/ldb.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/lib/ldb/include') diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index 20f0f9cc5a..8972fc83e9 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -1449,6 +1449,20 @@ struct ldb_ldif *ldb_ldif_read_string(struct ldb_context *ldb, const char **s); */ int ldb_ldif_write_file(struct ldb_context *ldb, FILE *f, const struct ldb_ldif *msg); +/** + Write an LDIF message to a string + + \param ldb the ldb context (from ldb_init()) + \param mem_ctx the talloc context on which to attach the string) + \param msg the message to write out + + \return the string containing the LDIF, or NULL on error + + \sa ldb_ldif_read_string for the reader equivalent to this function. +*/ +char * ldb_ldif_write_string(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, + const struct ldb_ldif *msg); + /** Base64 encode a buffer -- cgit