aboutsummaryrefslogtreecommitdiffstats
path: root/strtotimeval.c
blob: 6c30c887ad503dd5ebbbe9801abf5f24be62efdb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* See LICENSE file for copyright and license details. */
#include "libsimple.h"
#ifndef TEST


int
libsimple_strtotimeval(struct timeval *restrict tv, const char *restrict s, char **restrict end) /* TODO test */
{
	struct timespec ts;
	int r = libsimple_strtotimespec(&ts, s, end);
	if (r && errno != ERANGE)
		return r;
	if (libsimple_timespec2timeval(tv, &ts) && r)
		errno = ERANGE;
	return r;
}


#else
#include "test.h"

int
main(void)
{
	return 0;
}

#endif