MCPcopy Create free account
hub / github.com/eggert/tz / tzload

Function tzload

localtime.c:1313–1330  ·  view source on GitHub ↗

Load tz data from the file named NAME into *SP. Respect TZLOADFLAGS. Return 0 on success, an errno value on failure. */

Source from the content-addressed store, hash-verified

1311/* Load tz data from the file named NAME into *SP. Respect TZLOADFLAGS.
1312 Return 0 on success, an errno value on failure. */
1313static int
1314tzload(char const *name, struct state *sp, char tzloadflags)
1315{
1316 int r;
1317 union local_storage *lsp0;
1318 union local_storage *lsp;
1319#if ALL_STATE
1320 lsp = NULL;
1321#else
1322 union local_storage ls;
1323 lsp = &ls;
1324#endif
1325 lsp0 = lsp;
1326 r = tzloadbody(name, sp, tzloadflags, &lsp);
1327 if (lsp != lsp0)
1328 free(lsp);
1329 return r;
1330}
1331
1332static const int mon_lengths[2][MONSPERYEAR] = {
1333 { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },

Callers 2

gmtloadFunction · 0.85
zoneinitFunction · 0.85

Calls 1

tzloadbodyFunction · 0.85

Tested by

no test coverage detected