summaryrefslogtreecommitdiff
path: root/slack-timedate.h
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-04-14 10:49:28 +0200
committerEugen Wissner <belka@caraus.de>2024-04-14 10:49:28 +0200
commit5f35df67c2c1685c932453ea27518dcf729c859a (patch)
tree040b5e09782cd4241c2fffd896e6734e78f5cbdf /slack-timedate.h
parent729e175e6b96099323a4e3266faad9af0958112e (diff)
downloadslack-timedate-5f35df67c2c1685c932453ea27518dcf729c859a.tar.gz
Support relative time in SetTime
Diffstat (limited to 'slack-timedate.h')
-rw-r--r--slack-timedate.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/slack-timedate.h b/slack-timedate.h
index c990013..49f0209 100644
--- a/slack-timedate.h
+++ b/slack-timedate.h
@@ -17,6 +17,7 @@
*/
#include <dbus/dbus.h>
+#include <gio/gio.h>
#define BUS_NAME "org.freedesktop.timedate1"
#define BUS_PATH "/org/freedesktop/timedate1"
@@ -50,7 +51,9 @@
"</node>\n"
#define DEFAULT_EXIT_SEC 300
-#define USEC_PER_SEC 1000000ULL
+
+constexpr gint32 USEC_PER_SEC = 1000000ULL;
+constexpr gint32 NSEC_PER_USEC = 1000ULL;
// Returns the system time zone
gchar *slack_get_timezone ();
@@ -62,8 +65,7 @@ gboolean slack_set_timezone (gchar *);
// Changes the date/time
// Takes the amount of seconds since UNIX epoche and
// Returns true on success, false otherwise
-gboolean slack_set_time (gint64);
-//gboolean slack_set_time (gint64, gboolean);
+gboolean slack_set_time(gint64 seconds_since_epoch, gboolean relative);
// Returns if the hardware clock is set to local time or not
gboolean slack_get_is_localtime ();