Code

Read-only store types: const char ** → const char * const *.
[sysdb.git] / src / include / core / time.h
index 7515af3244720513a8b32d5628b718866a2d4d2b..a9ca72f01a2dbfecc34a9251011f1b3afccb0994 100644 (file)
@@ -74,11 +74,24 @@ 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, sdb_time_t);
 
 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