ldb: Mark _DEPRECATED_ ldb_msg_diff() and ldb_msg_canonicalize() functions ldb-mem-fix-1
authorKamen Mazdrashki <kamenim@samba.org>
Sun, 11 Jul 2010 18:27:55 +0000 (21:27 +0300)
committerKamen Mazdrashki <kamenim@samba.org>
Sun, 11 Jul 2010 18:27:55 +0000 (21:27 +0300)
They are not quite safe to use (requires caller to steal
resulting message in own context) and may lead to holding
memory for too long.

source4/lib/ldb/include/ldb.h

index bcb852f2adee7cbcdc0d8421fbeab25e3f65710f..b9dfe0acc5481bd0cdd55ac2be328f2793ecfa8d 100644 (file)
@@ -86,6 +86,14 @@ struct ldb_val {
 #ifndef PRINTF_ATTRIBUTE
 #define PRINTF_ATTRIBUTE(a,b)
 #endif
+
+#ifndef _DEPRECATED_
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#define _DEPRECATED_ __attribute__ ((deprecated))
+#else
+#define _DEPRECATED_
+#endif
+#endif
 /*! \endcond */
 
 /* opaque ldb_dn structures, see ldb_dn.c for internals */
@@ -1851,8 +1859,12 @@ struct ldb_message *ldb_msg_copy_shallow(TALLOC_CTX *mem_ctx,
 struct ldb_message *ldb_msg_copy(TALLOC_CTX *mem_ctx, 
                                 const struct ldb_message *msg);
 
+/*
+ * ldb_msg_canonicalize() is now deprecated
+ * Please use ldb_msg_canonicalize_ex() instead
+ */
 struct ldb_message *ldb_msg_canonicalize(struct ldb_context *ldb, 
-                                        const struct ldb_message *msg);
+                                        const struct ldb_message *msg) _DEPRECATED_;
 
 int ldb_msg_canonicalize_ex(struct ldb_context *ldb,
                            const struct ldb_message *msg,
@@ -1860,9 +1872,13 @@ int ldb_msg_canonicalize_ex(struct ldb_context *ldb,
                            struct ldb_message **_msg_out);
 
 
+/*
+ * ldb_msg_diff() is now deprecated
+ * Please use ldb_msg_diff_ex() instead
+ */
 struct ldb_message *ldb_msg_diff(struct ldb_context *ldb, 
                                 struct ldb_message *msg1,
-                                struct ldb_message *msg2);
+                                struct ldb_message *msg2) _DEPRECATED_;
 
 /**
  * return a ldb_message representing the differences between msg1 and msg2.