diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-01-07 15:26:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:37:12 -0500 |
commit | b931e6683508ddbd77a34725913f706870ed8eb7 (patch) | |
tree | 2d1ed89b19d4544475a5b8f38de74d610b81b027 | |
parent | 3bc9704ce0210ea86c916eacc1755f3d0308ff00 (diff) | |
download | samba-b931e6683508ddbd77a34725913f706870ed8eb7.tar.gz samba-b931e6683508ddbd77a34725913f706870ed8eb7.tar.bz2 samba-b931e6683508ddbd77a34725913f706870ed8eb7.zip |
r20596: add prototypes for the ldb_extended functions
metze
(This used to be commit 8d3a3117c313c2950381e8d21eb92469a82c3afe)
-rw-r--r-- | source4/lib/ldb/include/ldb.h | 64 |
1 files changed, 62 insertions, 2 deletions
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index 78d5bba06e..7b37b50468 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -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) @@ -1093,6 +1093,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 */ int ldb_transaction_start(struct ldb_context *ldb); |