summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-10 04:38:49 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-10 18:00:14 +0200
commit8b6c71206d32b11683e5e7cebc9acb467ba01b38 (patch)
tree62c81c0d8fa9fdc1f8027ba4cce0fd123395f684 /util.h
parentbbd671356647d9d2c7d6c2c0401e907e169c7576 (diff)
util: introduce format_timestamp()
Diffstat (limited to 'util.h')
-rw-r--r--util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/util.h b/util.h
index b22074edec..df2f3f7966 100644
--- a/util.h
+++ b/util.h
@@ -41,6 +41,8 @@ typedef uint64_t usec_t;
#define WHITESPACE " \t\n\r"
#define NEWLINE "\n\r"
+#define FORMAT_TIMESTAMP_MAX 64
+
usec_t now(clockid_t clock);
usec_t timespec_load(const struct timespec *ts);
@@ -166,6 +168,8 @@ bool ignore_file(const char *filename);
bool chars_intersect(const char *a, const char *b);
+char *format_timestamp(char *buf, size_t l, usec_t t);
+
#define DEFINE_STRING_TABLE_LOOKUP(name,type) \
const char *name##_to_string(type i) { \
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \