s4-ldb: Add ldb_msg_canonicalize_ex() to accept a memory context from client
[kamenim/samba.git] / source4 / lib / ldb / include / ldb.h
index 2b75d449d9ef83d9ad5838636881f78306b2de5b..bcb852f2adee7cbcdc0d8421fbeab25e3f65710f 100644 (file)
@@ -527,6 +527,13 @@ typedef int (*ldb_qsort_cmp_fn_t) (void *v1, void *v2, void *opaque);
 */
 #define LDB_CONTROL_NOTIFICATION_OID   "1.2.840.113556.1.4.528"
 
+/**
+   OID for performing subtree deletes
+
+   \sa <a href="http://msdn.microsoft.com/en-us/library/aa366991(v=VS.85).aspx">Microsoft documentation of this OID</a>
+*/
+#define LDB_CONTROL_TREE_DELETE_OID    "1.2.840.113556.1.4.805"
+
 /**
    OID for getting deleted objects
 
@@ -1847,11 +1854,34 @@ struct ldb_message *ldb_msg_copy(TALLOC_CTX *mem_ctx,
 struct ldb_message *ldb_msg_canonicalize(struct ldb_context *ldb, 
                                         const struct ldb_message *msg);
 
+int ldb_msg_canonicalize_ex(struct ldb_context *ldb,
+                           const struct ldb_message *msg,
+                           TALLOC_CTX *mem_ctx,
+                           struct ldb_message **_msg_out);
+
 
 struct ldb_message *ldb_msg_diff(struct ldb_context *ldb, 
                                 struct ldb_message *msg1,
                                 struct ldb_message *msg2);
 
+/**
+ * return a ldb_message representing the differences between msg1 and msg2.
+ * If you then use this in a ldb_modify() call it can be used to save edits to a message
+ *
+ * Result message is constructed as follows:
+ * - LDB_FLAG_MOD_ADD     - elements found only in msg2
+ * - LDB_FLAG_MOD_REPLACE - elements in msg2 that have different value in msg1
+ *                          Value for msg2 element is used
+ * - LDB_FLAG_MOD_DELETE  - elements found only in msg2
+ *
+ * @return LDB_SUCCESS or LDB_ERR_OPERATIONS_ERROR
+ */
+int ldb_msg_diff_ex(struct ldb_context *ldb,
+                   struct ldb_message *msg1,
+                   struct ldb_message *msg2,
+                   TALLOC_CTX *mem_ctx,
+                   struct ldb_message **_msg_out);
+
 /**
    Tries to find a certain string attribute in a message