From 3534b428629be185e096be99e3bd5fdfe32d5544 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 18 Sep 2014 18:55:44 +0000 Subject: initial commit with rc for skalibs-2.0.0.0 --- src/libstddjb/localtmn_scan.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/libstddjb/localtmn_scan.c (limited to 'src/libstddjb/localtmn_scan.c') diff --git a/src/libstddjb/localtmn_scan.c b/src/libstddjb/localtmn_scan.c new file mode 100644 index 0000000..f33ab51 --- /dev/null +++ b/src/libstddjb/localtmn_scan.c @@ -0,0 +1,21 @@ +/* ISC license. */ + +#include +#include + +unsigned int localtmn_scan (char const *s, localtmn_t_ref l) +{ + localtmn_t m ; + unsigned int n = localtm_scan(s, &m.tm) ; + if (!n) return 0 ; + s += n ; + if (*s++ != '.') m.nano = 0 ; + else + { + register unsigned int b = uint32_scan(s, &m.nano) ; + if (!b) return 0 ; + s += b ; n += b ; + } + *l = m ; + return n ; +} -- cgit v1.2.3