From: Kamen Mazdrashki Date: Sun, 11 Jul 2010 18:27:55 +0000 (+0300) Subject: ldb: Mark _DEPRECATED_ ldb_msg_diff() and ldb_msg_canonicalize() functions X-Git-Url: http://git.samba.org/?p=kamenim%2Fsamba.git;a=commitdiff_plain;h=13c649c67f113b4ed8d6a9de7217f8d633db2ce1 ldb: Mark _DEPRECATED_ ldb_msg_diff() and ldb_msg_canonicalize() functions 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. --- diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index bcb852f2ad..b9dfe0acc5 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -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.