diff options
Diffstat (limited to 'source4/lib/util')
-rw-r--r-- | source4/lib/util/config.mk | 1 | ||||
-rw-r--r-- | source4/lib/util/debug.h | 4 | ||||
-rw-r--r-- | source4/lib/util/time.c | 8 | ||||
-rw-r--r-- | source4/lib/util/time.h | 5 |
4 files changed, 16 insertions, 2 deletions
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 \ 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) /** 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_ */ |