r20596: add prototypes for the ldb_extended functions
authorStefan Metzmacher <metze@samba.org>
Sun, 7 Jan 2007 15:26:35 +0000 (15:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:37:12 +0000 (14:37 -0500)
metze
(This used to be commit 8d3a3117c313c2950381e8d21eb92469a82c3afe)

source4/lib/ldb/include/ldb.h

index 78d5bba06e67beea308b0449bf4ac172c0c3507c..7b37b50468df036b197c64100d1f7e4b4dfcb7e2 100644 (file)
@@ -852,10 +852,10 @@ struct ldb_dn *ldb_get_schema_basedn(struct ldb_context *ldb);
 struct ldb_dn *ldb_get_default_basedn(struct ldb_context *ldb);
 
 /**
-  The Default iasync search callback function 
+  The default async search callback function 
 
   \param ldb the context associated with the database (from ldb_init())
-  \param context the callback context
+  \param context the callback context (struct ldb_result *)
   \param ares a single reply from the async core
 
   \return result code (LDB_SUCCESS on success, or a failure code)
@@ -1092,6 +1092,66 @@ int ldb_rename(struct ldb_context *ldb, struct ldb_dn *olddn, struct ldb_dn *new
 */
 int ldb_delete(struct ldb_context *ldb, struct ldb_dn *dn);
 
+/**
+  The default async extended operation callback function 
+
+  \param ldb the context associated with the database (from ldb_init())
+  \param context the callback context (struct ldb_result *)
+  \param ares a single reply from the async core
+
+  \return result code (LDB_SUCCESS on success, or a failure code)
+
+  \note this function expects the context to always be an struct ldb_result pointer
+  AND a talloc context, this function will steal on the context each message
+  from the ares reply passed on by the async core so that in the end all the
+  messages will be in the context (ldb_result)  memory tree.
+  Freeing the passed context (ldb_result tree) will free all the resources
+  (the request need to be freed separately and the result doe not depend on the
+  request that can be freed as sson as the search request is finished)
+*/
+int ldb_extended_default_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares);
+
+/**
+  Helper function to build a extended request
+
+  \param ret_req the request structure is returned here (talloced on mem_ctx)
+  \param ldb the context associated with the database (from ldb_init())
+  \param mem_ctx a talloc emmory context (used as parent of ret_req)
+  \param oid the OID of the extended operation.
+  \param data void pointer a the extended operation specific parameters
+  \param controls an array of controls
+  \param context the callback function context
+  \param the callback function to handle the async replies
+
+  \return result code (LDB_SUCCESS on success, or a failure code)
+*/
+int ldb_build_extended_req(struct ldb_request **ret_req,
+                          struct ldb_context *ldb,
+                          void *mem_ctx,
+                          const char *oid,
+                          void *data,
+                          struct ldb_control **controls,
+                          void *context,
+                          ldb_request_callback_t callback);
+
+/**
+  call an extended operation
+
+  This function deletes a record from the database.
+
+  \param ldb the context associated with the database (from ldb_init())
+  \param oid the OID of the extended operation.
+  \param data void pointer a the extended operation specific parameters
+  \param res the result of the extended operation
+
+  \return result code (LDB_SUCCESS if the extended operation returned fine,
+  otherwise a failure code)
+*/
+int ldb_extended(struct ldb_context *ldb, 
+                const char *oid,
+                void *data,
+                struct ldb_result **res);
+
 /**
   start a transaction
 */