aboutsummaryrefslogtreecommitdiffstats
path: root/epan/nstime.h
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-24 21:31:56 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-24 21:31:56 +0000
commite7e62591fe23566d2bb5685ade31d2a925ed726c (patch)
tree7be99a00405385c14e1606c31906463d60107655 /epan/nstime.h
parent6f063a4571dad2e3d8681d4ce6b1114bcc1b811b (diff)
EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15520 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/nstime.h')
-rw-r--r--epan/nstime.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/epan/nstime.h b/epan/nstime.h
index 25c10d6bef..60fec42e01 100644
--- a/epan/nstime.h
+++ b/epan/nstime.h
@@ -34,14 +34,20 @@ typedef struct {
/* functions */
-/* calculate the delta between two times
+/* set the given nstime_t to zero */
+extern void nstime_set_zero(nstime_t *nstime);
+
+/* is the given nstime_t currently zero? */
+extern gboolean nstime_is_zero(nstime_t *nstime);
+
+/* calculate the delta between two times (can be negative!)
*
* delta = b-a
*
* Note that it is acceptable for two or more of the arguments to point at the
* same structure.
*/
-extern void get_timedelta(nstime_t *delta, const nstime_t *b, const nstime_t *a );
+extern void nstime_delta(nstime_t *delta, const nstime_t *b, const nstime_t *a );
/* calculate the sum of two times
*
@@ -50,12 +56,15 @@ extern void get_timedelta(nstime_t *delta, const nstime_t *b, const nstime_t *a
* Note that it is acceptable for two or more of the arguments to point at the
* same structure.
*/
-extern void get_timesum(nstime_t *sum, const nstime_t *b, const nstime_t *a );
+extern void nstime_sum(nstime_t *sum, const nstime_t *b, const nstime_t *a );
/* sum += a */
-#define addtime(sum, a) get_timesum(sum, sum, a)
+#define nstime_add(sum, a) nstime_sum(sum, sum, a)
-/* converts nstime to double, time base is milli seconds*/
+/* converts nstime to double, time base is milli seconds */
extern double nstime_to_msec(const nstime_t *time);
+/* converts nstime to double, time base is seconds */
+extern double nstime_to_sec(const nstime_t *time);
+
#endif /* __NSTIME_H__ */