X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Finclude%2Fcore%2Ftime.h;h=a9ca72f01a2dbfecc34a9251011f1b3afccb0994;hb=0c9e3aa9ba3948e88a0241861b75a002085eeccd;hp=7515af3244720513a8b32d5628b718866a2d4d2b;hpb=1b899f6e899047a521d473d00492bcf699f44ede;p=sysdb.git diff --git a/src/include/core/time.h b/src/include/core/time.h index 7515af3..a9ca72f 100644 --- a/src/include/core/time.h +++ b/src/include/core/time.h @@ -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