Logo Search packages:      
Sourcecode: ldb version File versions  Download package

int ldb_build_mod_req ( struct ldb_request **  ret_req,
struct ldb_context *  ldb,
void *  mem_ctx,
const struct ldb_message message,
struct ldb_control **  controls,
void *  context,
ldb_request_callback_t  callback 
)

Helper function to build a modify request

Parameters:
ret_req the request structure is returned here (talloced on mem_ctx)
ldb the context associated with the database (from ldb_init())
mem_ctx a talloc emmory context (used as parent of ret_req)
message contains the entry to be modified
controls an array of controls
context the callback function context
the callback function to handle the async replies
Returns:
result code (LDB_SUCCESS on success, or a failure code)

Definition at line 705 of file ldb.c.

References LDB_ERR_OPERATIONS_ERROR, and LDB_SUCCESS.

{
      struct ldb_request *req;

      *ret_req = NULL;

      req = talloc(mem_ctx, struct ldb_request);
      if (req == NULL) {
            ldb_set_errstring(ldb, "Out of Memory");
            return LDB_ERR_OPERATIONS_ERROR;
      }

      req->operation = LDB_MODIFY;
      req->op.mod.message = message;
      req->controls = controls;
      req->context = context;
      req->callback = callback;

      *ret_req = req;

      return LDB_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index