blob: f33ab518af682c2dbdf082b20137d15acdff5612 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/* ISC license. */
#include <skalibs/uint32.h>
#include <skalibs/djbtime.h>
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 ;
}
|