chiark / gitweb /
Use format patterns for usec_t, pid_t, nsec_t, usec_t
[elogind.git] / src / shared / time-util.h
index 0a3a98b1879f2b4b4427034f7916e1275167faaa..96f2ec8fa39b2f019d965ac210ae6e18fa534649 100644 (file)
@@ -27,6 +27,9 @@
 typedef uint64_t usec_t;
 typedef uint64_t nsec_t;
 
+#define NSEC_FMT "%" PRIu64
+#define USEC_FMT "%" PRIu64
+
 #include "macro.h"
 
 typedef struct dual_timestamp {
@@ -58,6 +61,8 @@ typedef struct dual_timestamp {
 #define FORMAT_TIMESTAMP_RELATIVE_MAX 256
 #define FORMAT_TIMESPAN_MAX 64
 
+#define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0, 0 })
+
 usec_t now(clockid_t clock);
 
 dual_timestamp* dual_timestamp_get(dual_timestamp *ts);