From b1595f40c506bb180758b5ee60122de5e29e0ccd Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sun, 20 Feb 2011 15:23:27 +0300 Subject: ldb: controls marshalling/unmarshalling improvement Add a function to marshall a control to a string Refactor the code of ldb_control_parse_strings to allow to extract the core code into ldb_control_parse_from_string so that this function can be called for just 1 string --- source4/lib/ldb/include/ldb.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source4/lib/ldb/include') diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index b52921f4fa..81f1a73168 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -2162,6 +2162,25 @@ do { \ +/** + Convert a control into its string representation. + + \param mem_ctx TALLOC context to return result on, and to allocate error_string on + \param control A struct ldb_control to convert + + \return string representation of the control +*/ +char* ldb_control_to_string(TALLOC_CTX *mem_ctx, const struct ldb_control *control); +/** + Convert a string representing a control into a ldb_control structure + + \param ldb LDB context + \param mem_ctx TALLOC context to return result on, and to allocate error_string on + \param control_strings A string-formatted control + + \return a ldb_control element +*/ +struct ldb_control *ldb_parse_control_from_string(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char *control_strings); /** Convert an array of string represention of a control into an array of ldb_control structures -- cgit