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

Function outzone

zic.c:3409–3767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3407 if (compat < c)
3408 compat = c;
3409 len += strlen(result + len);
3410 result[len++] = ',';
3411 c = stringrule(result + len, stdrp, dstrp->r_save, stdzp->z_stdoff);
3412 if (c < 0) {
3413 result[0] = '\0';
3414 return -1;
3415 }
3416 if (compat < c)
3417 compat = c;
3418 return compat;
3419}
3420
3421static void
3422outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
3423{
3424 register ptrdiff_t i, j;
3425 register zic_t starttime, untiltime;
3426 register bool startttisstd;
3427 register bool startttisut;
3428 register char * startbuf;
3429 register char * ab;
3430 register char * envvar;
3431 register int max_abbr_len;
3432 register int max_envvar_len;
3433 register int compat;
3434 register bool do_extend;
3435 register char version;
3436 zic_t nonTZlimtime = ZIC_MIN;
3437 int nonTZlimtype = -1;
3438 zic_t max_year0;
3439 int defaulttype = -1;
3440 int max_stringoffset_len = sizeof "-167:59:59" - 1;
3441 int max_comma_stringrule_len = (sizeof ",M12.5.6/" - 1
3442 + max_stringoffset_len);
3443
3444 check_for_signal();
3445
3446 /* This cannot overflow; see FORMAT_LEN_GROWTH_BOUND. */
3447 max_abbr_len = 2 + max_format_len + max_abbrvar_len;
3448 max_envvar_len = 2 * (max_abbr_len + max_stringoffset_len
3449 + max_comma_stringrule_len);
3450
3451 startbuf = xmalloc(max_abbr_len + 1);
3452 ab = xmalloc(max_abbr_len + 1);
3453 envvar = xmalloc(max_envvar_len + 1);
3454 INITIALIZE(untiltime);
3455 INITIALIZE(starttime);
3456 /*
3457 ** Now. . .finally. . .generate some useful data!
3458 */
3459 timecnt = 0;
3460 typecnt = 0;
3461 charcnt = 0;
3462 /*
3463 ** Thanks to Earl Chew
3464 ** for noting the need to unconditionally initialize startttisstd.
3465 */
3466 startttisstd = false;

Callers 1

mainFunction · 0.85

Calls 15

check_for_signalFunction · 0.85
updateminmaxFunction · 0.85
stringzoneFunction · 0.85
warningFunction · 0.85
want_bloatFunction · 0.85
addtypeFunction · 0.85
eatFunction · 0.85
doabbrFunction · 0.85
addttFunction · 0.85
eatsFunction · 0.85
rpytimeFunction · 0.85
taddFunction · 0.85

Tested by

no test coverage detected