Code

Added __attribute__((format(printf, ...))) where appropriate.
[sysdb.git] / src / include / core / time.h
index 7515af3244720513a8b32d5628b718866a2d4d2b..c48a2e1329b6bb8371507fa382dcf90601591a18 100644 (file)
@@ -74,11 +74,25 @@ int
 sdb_sleep(sdb_time_t reg, sdb_time_t *rem);
 
 size_t
-sdb_strftime(char *s, size_t len, const char *format, sdb_time_t);
+sdb_strftime(char *s, size_t len, const char *format, sdb_time_t)
+               __attribute__((format(strftime, 3, 0)));
 
 size_t
 sdb_strfinterval(char *s, size_t len, sdb_time_t interval);
 
+/*
+ * sdb_strpunit:
+ * Parse the specified string as a time unit.
+ * "Y" (year), "M" (month), "D" (day), "h" (hour), "m" (minute), "s" (second),
+ * "ms" (milli-second), "us" (micro-second), "ns" (nano-second).
+ *
+ * Returns:
+ *  - the time interval corresponding to the specified unit on success
+ *  - 0 else
+ */
+sdb_time_t
+sdb_strpunit(const char *s);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif