From ee4cc41fafaac0a2d76c1c791f6d43a6b6d937a7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 16 Aug 2005 01:29:28 +0000 Subject: * start implementing error handling in avahi-client * doxygen document timeval.h * add two more AVAHI_GCC_SENTINELs git-svn-id: file:///home/lennart/svn/public/avahi/trunk@350 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/timeval.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'avahi-common/timeval.h') diff --git a/avahi-common/timeval.h b/avahi-common/timeval.h index c046a19..5bbe1a7 100644 --- a/avahi-common/timeval.h +++ b/avahi-common/timeval.h @@ -27,17 +27,32 @@ #include +#ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_BEGIN +#endif +/** A numeric data type for storing microsecond values. (signed 64bit integer) */ typedef int64_t AvahiUsec; +/** Compare two timeval structures and return a ngeative value when a < b, 0 when a == b and a positive value otherwise */ int avahi_timeval_compare(const struct timeval *a, const struct timeval *b); + +/** Calculate the difference between to timeval structures as microsecond value */ AvahiUsec avahi_timeval_diff(const struct timeval *a, const struct timeval *b); + +/** Add a number of microseconds to the specified timeval structure and return it. *a is modified. */ struct timeval* avahi_timeval_add(struct timeval *a, AvahiUsec usec); +/** Return the difference between the current time and *a. Positive if *a was earlier */ AvahiUsec avahi_age(const struct timeval *a); -struct timeval *avahi_elapse_time(struct timeval *tv, unsigned msec, unsigned jitter); +/** Fill *tv with the current time plus "ms" milliseconds plus an + * extra jitter of "j" milliseconds. Pass 0 for j if you don't want + * the jitter */ +struct timeval *avahi_elapse_time(struct timeval *tv, unsigned ms, unsigned j); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_END +#endif #endif -- cgit