Lines Matching +full:pre +full:- +full:packaged

5 ** 2009-05-17 by Arthur David Olson.
34 # define ZDUMP_LO_YEAR (-500)
44 + SECSPERLYEAR * (intmax_t) (100 - 3))
72 enum { atime_shift = CHAR_BIT * sizeof(time_t) - 2 };
74 ((time_t) -1 < 0
75 ? (- ((time_t) ~ (time_t) 0 < 0)
76 - (((time_t) 1 << atime_shift) - 1 + ((time_t) 1 << atime_shift)))
79 ((time_t) -1 < 0
80 ? (((time_t) 1 << atime_shift) - 1 + ((time_t) 1 << atime_shift))
81 : -1);
141 if (a <= INDEX_MAX && b <= INDEX_MAX - a) in sumsize()
246 return &optarg; /* Any valid non-null char ** will do. */ in tzalloc()
311 the "Zone GMT 0 - GMT" line in the "etcetera" file. If "GMT" in gmtzinit()
332 /* Convert *TP to UT, storing the broken-down time into *TMP.
359 fprintf(stderr, " ->"); in my_localtime_rz()
360 fprintf(stderr, " year=%d", tmp->tm_year); in my_localtime_rz()
361 fprintf(stderr, " mon=%d", tmp->tm_mon); in my_localtime_rz()
362 fprintf(stderr, " mday=%d", tmp->tm_mday); in my_localtime_rz()
363 fprintf(stderr, " hour=%d", tmp->tm_hour); in my_localtime_rz()
364 fprintf(stderr, " min=%d", tmp->tm_min); in my_localtime_rz()
365 fprintf(stderr, " sec=%d", tmp->tm_sec); in my_localtime_rz()
366 fprintf(stderr, " isdst=%d", tmp->tm_isdst); in my_localtime_rz()
367 fprintf(stderr, " -> "); in my_localtime_rz()
386 while (is_alpha(*cp) || is_digit(*cp) || *cp == '-' || *cp == '+') in abbrok()
389 wp = _("has characters other than ASCII alphanumerics, '-' or '+'"); in abbrok()
390 else if (cp - abbrp < 3) in abbrok()
392 else if (cp - abbrp > 6) in abbrok()
446 " -c [L,]U Start at year L (default -500), end before year U (default 2500)\n" in usage()
447 " -t [L,]U Start at time L, end before time U (in seconds since 1970)\n" in usage()
448 " -i List transitions briefly (format is experimental)\n" \ in usage()
449 " -v List transitions verbosely\n" in usage()
450 " -V List transitions a bit less verbosely\n" in usage()
451 " --help Output this help\n" in usage()
452 " --version Output version info\n" in usage()
490 if (strcmp(argv[i], "--version") == 0) { in main()
493 } else if (strcmp(argv[i], "--help") == 0) { in main()
505 case -1: in main()
506 if (! (optind == argc - 1 && strcmp(argv[optind], "=") == 0)) in main()
531 fprintf(stderr, _("%s: wild -c argument %s\n"), in main()
564 _("%s: wild -t argument %s\n"), in main()
584 longest = min(arglenmax, INT_MAX - 2); in main()
587 /* Treat "-" as standard input on platforms with /dev/stdin. in main()
588 It's not worth the bother of supporting "-" on other in main()
590 timezone_t tz = tzalloc(strcmp(argv[i], "-") == 0 in main()
619 t = cutlotime - 1; in main()
625 showtrans("-\t-\t%Q", &tm, t, ab, argv[i]); in main()
629 while (t < cuthitime - 1) { in main()
630 time_t newt = ((t < absolute_max_time - SECSPERDAY / 2 in main()
631 && t + SECSPERDAY / 2 < cuthitime - 1) in main()
633 : cuthitime - 1); in main()
637 || (ab && (delta(&newtm, &tm) != newt - t in main()
644 showtrans("%Y-%m-%d\t%L\t%Q", newtmp, newt, in main()
647 show(tz, argv[i], newt - 1, true); in main()
686 if (SECSPER400YEARS_FITS && 400 <= y - myy) { in yeartot()
687 intmax_t diff400 = (y - myy) / 400; in yeartot()
697 if (t > absolute_max_time - seconds) in yeartot()
703 intmax_t diff400 = (myy - y) / 400; in yeartot()
709 seconds = isleap(myy - 1) ? SECSPERLYEAR : SECSPERNYEAR; in yeartot()
712 myy -= years; in yeartot()
715 t -= seconds; in yeartot()
735 /* Convert LOT into a broken-down time here, even though our in hunt()
747 time_t t = (rem_sum == 2) - (rem_sum < 0) + lot / 2 + hit / 2; in hunt()
754 && delta(&tm, &lotm) == t - lot in hunt()
771 intmax_t oldy = oldp->tm_year; in delta_nonneg()
772 int cycles = (newp->tm_year - oldy) / YEARSPERREPEAT; in delta_nonneg()
774 int tmy = oldp->tm_year + cycles * YEARSPERREPEAT; in delta_nonneg()
775 for ( ; tmy < newp->tm_year; ++tmy) in delta_nonneg()
777 result += newp->tm_yday - oldp->tm_yday; in delta_nonneg()
779 result += newp->tm_hour - oldp->tm_hour; in delta_nonneg()
781 result += newp->tm_min - oldp->tm_min; in delta_nonneg()
783 result += newp->tm_sec - oldp->tm_sec; in delta_nonneg()
790 return (newp->tm_year < oldp->tm_year in delta()
791 ? -delta_nonneg(oldp, newp) in delta()
796 /* Return A->tm_yday, adjusted to compare it fairly to B->tm_yday.
801 int yday = a->tm_yday; in adjusted_yday()
802 if (b->tm_year < a->tm_year) in adjusted_yday()
803 yday += 365 + isleap_sum(b->tm_year, TM_YEAR_BASE); in adjusted_yday()
808 /* If A is the broken-down local time and B the broken-down UT for
820 return a->TM_GMTOFF; in gmtoff()
830 int days = ayday - byday; in gmtoff()
831 long hours = a->tm_hour - b->tm_hour + 24 * days; in gmtoff()
832 long minutes = a->tm_min - b->tm_min + 60 * hours; in gmtoff()
833 long seconds = a->tm_sec - b->tm_sec + 60 * minutes; in gmtoff()
846 printf("%-*s ", (int)longest, zone); in show()
868 printf(" isdst=%d", tmp->tm_isdst); in show()
881 the range from LO (with broken-down time LOTMP if that is nonnull)
890 hi = (SECSPERDAY < hi - boundary in showextrema()
893 if (SECSPERDAY < boundary - lo) { in showextrema()
894 lo = boundary - SECSPERDAY; in showextrema()
900 localtm[old].tm_sec = -1; in showextrema()
902 gmtm[old].tm_sec = -1; in showextrema()
911 localtm[new].tm_sec = -1; in showextrema()
913 gmtm[new].tm_sec = -1; in showextrema()
916 show(tz, zone, t - 1, true); in showextrema()
923 /* On pre-C99 platforms, a snprintf substitute good enough for us. */
947 slen = arglen < size ? arglen : size - 1; in my_snprintf()
950 n = arglen <= INT_MAX ? arglen : -1; in my_snprintf()
967 int ss = tm->tm_sec, mm = tm->tm_min, hh = tm->tm_hour; in format_local_time()
977 +HHMMSS, or -HHMMSS for timestamps west of Greenwich; use the
978 format -00 for unknown UT offsets. If the hour needs more than
983 Return the length of the resulting string, or -1 if the result is
993 && (*abbr(tm) == '-' || strcmp(abbr(tm), "zzz") == 0))) in format_utc_offset()
994 ? '-' : '+'); in format_utc_offset()
1000 return -1; in format_utc_offset()
1001 off = -off; in format_utc_offset()
1024 *b++ = '"', s--; in format_quoted_string()
1030 default: *b++ = c, s--; continue; in format_quoted_string()
1031 case '\0': *b++ = '"', s--; return size - s; in format_quoted_string()
1040 *b++ = '\\', *b++ = c, s -= 2; in format_quoted_string()
1045 TM is the broken-down time, T the seconds count, AB the time zone
1073 ptrdiff_t f_prefix_len = p - f; in istrftime()
1085 formatted_len--; in istrftime()
1086 b += formatted_len, s -= formatted_len; in istrftime()
1103 b += offlen, s -= offlen; in istrftime()
1109 *b++ = '\t', s--; in istrftime()
1117 b += len, s -= len; in istrftime()
1120 = (tm->tm_isdst in istrftime()
1121 ? snprintf(b, s, &"\t\t%d"[show_abbr], tm->tm_isdst) in istrftime()
1128 b += formatted_len, s -= formatted_len; in istrftime()
1162 return tmp->TM_ZONE; in abbr()
1165 if (0 <= tmp->tm_isdst && tzname[0 < tmp->tm_isdst]) in abbr()
1166 return tzname[0 < tmp->tm_isdst]; in abbr()
1174 ** it works on all known real-world systems as of 2022-01-25.
1181 /* C11-style _Generic is more likely to return the correct in tformat()
1197 if (0 > (time_t) -1) { /* signed */ in tformat()
1232 ** The packaged localtime_rz and gmtime_r never put out-of-range in dumptime()
1237 ((0 <= timeptr->tm_wday in dumptime()
1238 && timeptr->tm_wday < (int)(sizeof wday_name / sizeof wday_name[0])) in dumptime()
1239 ? wday_name[timeptr->tm_wday] : "???"), in dumptime()
1240 ((0 <= timeptr->tm_mon in dumptime()
1241 && timeptr->tm_mon < (int)(sizeof mon_name / sizeof mon_name[0])) in dumptime()
1242 ? mon_name[timeptr->tm_mon] : "???"), in dumptime()
1243 timeptr->tm_mday, timeptr->tm_hour, in dumptime()
1244 timeptr->tm_min, timeptr->tm_sec); in dumptime()
1245 trail = timeptr->tm_year % DIVISOR + TM_YEAR_BASE % DIVISOR; in dumptime()
1246 lead = timeptr->tm_year / DIVISOR + TM_YEAR_BASE / DIVISOR + in dumptime()
1251 --lead; in dumptime()
1253 trail -= DIVISOR; in dumptime()
1258 else printf("%d%d", lead, ((trail < 0) ? -trail : trail)); in dumptime()