summaryrefslogtreecommitdiff
path: root/src/shared/time-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-08 22:37:45 +0200
committerLennart Poettering <lennart@poettering.net>2014-10-08 22:37:45 +0200
commit5ab99e076c72a44f2e174e48abd9945cd0180d76 (patch)
tree7d766229e37a2a2cd26ee77001ffd9f45c31ddcc /src/shared/time-util.c
parent5329ab10ffaf5b4a3fd6ebd9380b1ec09d05cfc8 (diff)
time: functions named "internal" really shouldn't be exported
Also, let's try to make function names descriptive, instead of using bools for flags.
Diffstat (limited to 'src/shared/time-util.c')
-rw-r--r--src/shared/time-util.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index 09f4a21354..433c262dfa 100644
--- a/src/shared/time-util.c
+++ b/src/shared/time-util.c
@@ -152,7 +152,7 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u) {
return tv;
}
-char *format_timestamp_internal(char *buf, size_t l, usec_t t, bool utc) {
+static char *format_timestamp_internal(char *buf, size_t l, usec_t t, bool utc) {
struct tm tm;
time_t sec;
@@ -178,7 +178,11 @@ char *format_timestamp(char *buf, size_t l, usec_t t) {
return format_timestamp_internal(buf, l, t, false);
}
-char *format_timestamp_us(char *buf, size_t l, usec_t t, bool utc) {
+char *format_timestamp_utc(char *buf, size_t l, usec_t t) {
+ return format_timestamp_internal(buf, l, t, true);
+}
+
+static char *format_timestamp_internal_us(char *buf, size_t l, usec_t t, bool utc) {
struct tm tm;
time_t sec;
@@ -203,6 +207,14 @@ char *format_timestamp_us(char *buf, size_t l, usec_t t, bool utc) {
return buf;
}
+char *format_timestamp_us(char *buf, size_t l, usec_t t) {
+ return format_timestamp_internal_us(buf, l, t, false);
+}
+
+char *format_timestamp_us_utc(char *buf, size_t l, usec_t t) {
+ return format_timestamp_internal_us(buf, l, t, true);
+}
+
char *format_timestamp_relative(char *buf, size_t l, usec_t t) {
const char *s;
usec_t n, d;