summaryrefslogtreecommitdiff
path: root/src/time/tzset.c
blob: 694a0731fc7577342dc66b37406737642a7c193d (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#if 0

#include <time.h>
#include <stdlib.h>
#include <string.h>
#include "_time.h"

void tzset(void)
{
	char buf[TZNAMELEN * 3]; /* one for std, one for dst, plus dst rule */
	char *tzstr = getenv("TZ");
	if (tzstr == NULL) {
		tzstr = "UTC0";
	}

	if (strlen(tzstr) > sizeof(buf)) {
		return;
	}

	tzname[0] = __time.stdtz;
	tzname[1] = __time.dsttz;
	strcpy(tzname[0], tzstr);

	/* TODO:
	no spaces in actual string

	stdname hh[:mm[:ss]] [dstname [hh[:mm[:ss]]] [,start[/time],end[/time]]

	stdname and dstname are either
		all isalpha()
		'<' [[:alnum:]+-]* '>'

	hh may be prefixed by + or -
	*/

	#ifdef _XOPEN_SOURCE
	/* TODO */
	daylight = 0;
	#endif
}

/*
POSIX(1)
*/


#endif