aboutsummaryrefslogtreecommitdiffstats
path: root/lib/timeval.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/timeval.h')
-rw-r--r--lib/timeval.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/timeval.h b/lib/timeval.h
index 1ee4b30..fb3f680 100644
--- a/lib/timeval.h
+++ b/lib/timeval.h
@@ -22,19 +22,20 @@
*
***************************************************************************/
-/*
- * CAUTION: this header is designed to work when included by the app-side
- * as well as the library. Do not mix with library internals!
- */
-
#include "curl_setup.h"
+#if SIZEOF_TIME_T < 8
+typedef int timediff_t;
+#else
+typedef curl_off_t timediff_t;
+#endif
+
struct curltime {
- time_t tv_sec; /* seconds */
- unsigned int tv_usec; /* microseconds */
+ time_t tv_sec; /* seconds */
+ int tv_usec; /* microseconds */
};
-struct curltime curlx_tvnow(void);
+struct curltime Curl_now(void);
/*
* Make sure that the first argument (t1) is the more recent time and t2 is
@@ -42,7 +43,7 @@ struct curltime curlx_tvnow(void);
*
* Returns: the time difference in number of milliseconds.
*/
-time_t curlx_tvdiff(struct curltime t1, struct curltime t2);
+timediff_t Curl_timediff(struct curltime t1, struct curltime t2);
/*
* Make sure that the first argument (t1) is the more recent time and t2 is
@@ -50,12 +51,6 @@ time_t curlx_tvdiff(struct curltime t1, struct curltime t2);
*
* Returns: the time difference in number of microseconds.
*/
-time_t Curl_tvdiff_us(struct curltime newer, struct curltime older);
-
-/* These two defines below exist to provide the older API for library
- internals only. */
-#define Curl_tvnow() curlx_tvnow()
-#define Curl_tvdiff(x,y) curlx_tvdiff(x,y)
+timediff_t Curl_timediff_us(struct curltime newer, struct curltime older);
#endif /* HEADER_CURL_TIMEVAL_H */
-