From a2595477869d5fee2f916bc857ca028e3b2fc677 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 22 Jan 2008 18:49:51 +0100 Subject: build: Remove support for DESCRIPTION setting that is now unused. (This used to be commit 91d7ba5202e6c375456a42c2c6861f63c7fcfc20) --- source4/lib/util/config.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/lib/util') diff --git a/source4/lib/util/config.mk b/source4/lib/util/config.mk index 53a55bf7af..f3e6cd7acf 100644 --- a/source4/lib/util/config.mk +++ b/source4/lib/util/config.mk @@ -1,7 +1,6 @@ [SUBSYSTEM::LIBSAMBA-UTIL] #VERSION = 0.0.1 #SO_VERSION = 0 -#DESCRIPTION = Generic utility functions PUBLIC_HEADERS = util.h \ attr.h \ byteorder.h \ -- cgit From 77a2870186d3b10ea15ba5e001e7a703f0a5ccaf Mon Sep 17 00:00:00 2001 From: Amin Azez Date: Fri, 1 Feb 2008 16:19:36 +0000 Subject: Samba4 poor mans debug_ctx() DEBUG(), DEBUGADD() and friends can now use debug_ctx() in the formatting expressions again, e.g. DEBUG(5,("Guid failed to match: %s\n", GUID_string(debug_ctx(), r->guid))); Sadly it's done with macros (again) but when we need to save the 8 or 16 bytes of object code per DEBUG() expression we can do it the Samba 3 way with added thread-safety for Samba 4. That could save up to 200K, allowing 12 bytes for each occurrance of DEBUG... Signed-off-by: Amin Azez (This used to be commit 9781967542b00c279563d435aec72dac1e8c7e9a) --- source4/lib/util/debug.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/util') diff --git a/source4/lib/util/debug.h b/source4/lib/util/debug.h index 1895ed53ad..605628174a 100644 --- a/source4/lib/util/debug.h +++ b/source4/lib/util/debug.h @@ -41,13 +41,17 @@ struct debug_ops { extern int DEBUGLEVEL; +#define debug_ctx() (_debug_ctx?_debug_ctx:(_debug_ctx=talloc_new(NULL))) + #define DEBUGLVL(level) ((level) <= DEBUGLEVEL) #define _DEBUG(level, body, header) do { \ if (DEBUGLVL(level)) { \ + void* _debug_ctx=NULL; \ if (header) { \ do_debug_header(level, __location__, __FUNCTION__); \ } \ do_debug body; \ + talloc_free(_debug_ctx); \ } \ } while (0) /** -- cgit From 3525f77e56966d688a11e3f4520e9cd799fd4f23 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 9 Feb 2008 14:24:24 +0100 Subject: Move nt_time_equal() to libutil. (This used to be commit 9705263a6c58d4ade556d17db2009dbb85291b22) --- source4/lib/util/time.c | 8 ++++++++ source4/lib/util/time.h | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'source4/lib/util') diff --git a/source4/lib/util/time.c b/source4/lib/util/time.c index fc51498009..a181885806 100644 --- a/source4/lib/util/time.c +++ b/source4/lib/util/time.c @@ -612,3 +612,11 @@ _PUBLIC_ int get_time_zone(time_t t) return 0; return tm_diff(&tm_utc,tm); } + +/** + check if 2 NTTIMEs are equal. +*/ +bool nt_time_equal(NTTIME *t1, NTTIME *t2) +{ + return *t1 == *t2; +} diff --git a/source4/lib/util/time.h b/source4/lib/util/time.h index 557c5d4eab..1ab976ca78 100644 --- a/source4/lib/util/time.h +++ b/source4/lib/util/time.h @@ -224,6 +224,9 @@ _PUBLIC_ void nttime_to_timeval(struct timeval *tv, NTTIME t); */ _PUBLIC_ int get_time_zone(time_t t); - +/** + check if 2 NTTIMEs are equal. +*/ +bool nt_time_equal(NTTIME *t1, NTTIME *t2); #endif /* _SAMBA_TIME_H_ */ -- cgit