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

Function main

zdump.c:407–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407int
408main(int argc, char *argv[])
409{
410 /* These are static so that they're initially zero. */
411 static char * abbrev;
412 static ptrdiff_t abbrevsize;
413
414 register int i;
415 register bool vflag;
416 register bool Vflag;
417 register char * cutarg;
418 register char * cuttimes;
419 register time_t cutlotime;
420 register time_t cuthitime;
421 time_t now;
422 bool iflag = false;
423 size_t arglenmax = 0;
424
425 cutlotime = absolute_min_time;
426 cuthitime = absolute_max_time;
427#if HAVE_GETTEXT
428 setlocale(LC_ALL, "");
429# ifdef TZ_DOMAINDIR
430 bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
431# endif /* defined TEXTDOMAINDIR */
432 textdomain(TZ_DOMAIN);
433#endif /* HAVE_GETTEXT */
434 progname = argv[0] ? argv[0] : "zdump";
435 for (i = 1; i < argc; ++i)
436 if (strcmp(argv[i], "--version") == 0) {
437 printf("zdump %s%s\n", PKGVERSION, TZVERSION);
438 return EXIT_SUCCESS;
439 } else if (strcmp(argv[i], "--help") == 0) {
440 usage(stdout, EXIT_SUCCESS);
441 }
442 vflag = Vflag = false;
443 cutarg = cuttimes = NULL;
444 for (;;)
445 switch (getopt(argc, argv, "c:it:vV")) {
446 case 'c': cutarg = optarg; break;
447 case 't': cuttimes = optarg; break;
448 case 'i': iflag = true; break;
449 case 'v': vflag = true; break;
450 case 'V': Vflag = true; break;
451 case -1:
452 if (! (optind == argc - 1 && strcmp(argv[optind], "=") == 0))
453 goto arg_processing_done;
454 ATTRIBUTE_FALLTHROUGH;
455 default:
456 usage(stderr, EXIT_FAILURE);
457 }
458 arg_processing_done:;
459
460 if (iflag | vflag | Vflag) {
461 intmax_t lo;
462 intmax_t hi;
463 char *loend, *hiend;
464 register intmax_t cutloyear = ZDUMP_LO_YEAR;

Callers

nothing calls this directly

Calls 15

yeartotFunction · 0.85
gmtzinitFunction · 0.85
timeFunction · 0.85
showFunction · 0.85
showextremaFunction · 0.85
saveabbrFunction · 0.85
showtransFunction · 0.85
deltaFunction · 0.85
abbrFunction · 0.85
huntFunction · 0.85
usageFunction · 0.70
size_overflowFunction · 0.70

Tested by

no test coverage detected