aboutsummaryrefslogblamecommitdiffstats
path: root/strtotimeval.c
blob: 4df56746b8147084d5bb5c1e1742478fdb0243f0 (plain) (tree)
1
2
3
4
5
6




                                                         
                                                                                                                






                                                       
/* See LICENSE file for copyright and license details. */
#include "libsimple.h"


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;
	return r | libsimple_timespec2timeval(tv, &ts);
}