diff options
author | J William Piggott | 2017-03-04 16:49:41 +0100 |
---|---|---|
committer | J William Piggott | 2017-03-04 16:49:41 +0100 |
commit | 7088bd88323fa9152ec9fbe4089fe76807445ed3 (patch) | |
tree | 6d36f7512e7fa6a2099263351479462822b3be21 /include/timeutils.h | |
parent | libsmartcols: allow to add column to already used table (diff) | |
download | kernel-qcow2-util-linux-7088bd88323fa9152ec9fbe4089fe76807445ed3.tar.gz kernel-qcow2-util-linux-7088bd88323fa9152ec9fbe4089fe76807445ed3.tar.xz kernel-qcow2-util-linux-7088bd88323fa9152ec9fbe4089fe76807445ed3.zip |
lib: add parse-date.y
* include/timeutils.h
Add parse-date API
* lib/parse-date.y - new file
Lib function that parses a date string into a timespec struct.
Derived from gnulib-dd7a871 parse-datetime.y with these changes:
* reduced to a single function API renamed to parse_date()
* removed gnulib dependencies
* removed debugging
* converted to util-linux coding style
* include/cctype.h - new file
Like ctype.h only hard coded to the 'C' locale.
Used by lib/parse-date.y.
Derived from gnulib-dd7a871 c-ctype.h with these changes:
* removed gnulib dependencies
* converted to util-linux coding style
* add requisite util-linux constants
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'include/timeutils.h')
-rw-r--r-- | include/timeutils.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/timeutils.h b/include/timeutils.h index 85fc228db..874f853b7 100644 --- a/include/timeutils.h +++ b/include/timeutils.h @@ -82,4 +82,6 @@ int strtime_short(const time_t *t, struct timeval *now, int flags, char *buf, si extern time_t timegm(struct tm *tm); #endif +int parse_date(struct timespec *, char const *, struct timespec const *); + #endif /* UTIL_LINUX_TIME_UTIL_H */ |