/freebsd/contrib/netbsd-tests/lib/libutil/ |
H A D | t_parsedate.c | 58 struct tm * time_to_tm(const time_t *, struct tm *), in parsecheck() argument 62 struct tm tm; in parsecheck() local 87 ATF_CHECK(time_to_tm(&t, &tm) != NULL); in parsecheck() 89 ATF_CHECK_MSG(tm.tm_year + 1900 == year, in parsecheck() 91 argstr, year, (int)tm.tm_year); in parsecheck() 93 ATF_CHECK_MSG(tm.tm_mon + 1 == month, in parsecheck() 95 argstr, month, (int)tm.tm_mon); in parsecheck() 97 ATF_CHECK_MSG(tm.tm_mday == day, in parsecheck() 99 argstr, day, (int)tm.tm_mday); in parsecheck() 101 ATF_CHECK_MSG(tm.tm_hour == hour, in parsecheck() [all …]
|
/freebsd/sys/kern/ |
H A D | subr_terminal.c | 55 #define TERMINAL_LOCK(tm) do { \ argument 56 if ((tm)->tm_flags & TF_CONS) \ 57 mtx_lock_spin(&(tm)->tm_mtx); \ 58 else if ((tm)->tm_tty != NULL) \ 59 tty_lock((tm)->tm_tty); \ 61 #define TERMINAL_UNLOCK(tm) do { \ argument 62 if ((tm)->tm_flags & TF_CONS) \ 63 mtx_unlock_spin(&(tm)->tm_mtx); \ 64 else if ((tm)->tm_tty != NULL) \ 65 tty_unlock((tm)->tm_tty); \ [all …]
|
/freebsd/usr.sbin/newsyslog/ |
H A D | ptimes.c | 72 struct tm basetm; /* Base Time expanded into fields */ 73 struct tm tm; /* Time expanded into fields */ member 131 struct tm tm; in parse8601() local 142 tm = ptime->tm; in parse8601() 146 tm.tm_year = ((l / 1000000) - 19) * 100; in parse8601() 151 tm.tm_year -= tm.tm_year % 100; in parse8601() 152 tm.tm_year += l / 10000; in parse8601() 157 tm.tm_mon = (l / 100) - 1; in parse8601() 162 tm.tm_mday = l; in parse8601() 171 if (tm.tm_year < 70 || tm.tm_mon < 0 || tm.tm_mon > 12 in parse8601() [all …]
|
/freebsd/crypto/heimdal/lib/roken/ |
H A D | strftime.c | 124 week_number_sun (const struct tm *tm) in week_number_sun() argument 126 return (tm->tm_yday + 7 - (tm->tm_yday % 7 - tm->tm_wday + 7) % 7) / 7; in week_number_sun() 135 week_number_mon (const struct tm *tm) in week_number_mon() argument 137 int wday = (tm->tm_wday + 6) % 7; in week_number_mon() 139 return (tm->tm_yday + 7 - (tm->tm_yday % 7 - wday + 7) % 7) / 7; in week_number_mon() 149 week_number_mon4 (const struct tm *tm) in week_number_mon4() argument 151 int wday = (tm->tm_wday + 6) % 7; in week_number_mon4() 152 int w1day = (wday - tm->tm_yday % 7 + 7) % 7; in week_number_mon4() 155 ret = (tm->tm_yday + w1day) / 7; in week_number_mon4() 171 const struct tm *tm) in strftime() argument [all …]
|
H A D | timegm.c | 51 rk_timegm (struct tm *tm) in rk_timegm() argument 59 if (tm->tm_year < 0) in rk_timegm() 61 if (tm->tm_mon < 0 || tm->tm_mon > 11) in rk_timegm() 63 if (tm->tm_mday < 1 || tm->tm_mday > ndays[is_leap(tm->tm_year)][tm->tm_mon]) in rk_timegm() 65 if (tm->tm_hour < 0 || tm->tm_hour > 23) in rk_timegm() 67 if (tm->tm_min < 0 || tm->tm_min > 59) in rk_timegm() 69 if (tm->tm_sec < 0 || tm->tm_sec > 59) in rk_timegm() 72 for (i = 70; i < tm->tm_year; ++i) in rk_timegm() 75 for (i = 0; i < tm->tm_mon; ++i) in rk_timegm() 76 res += ndays[is_leap(tm->tm_year)][i]; in rk_timegm() [all …]
|
/freebsd/crypto/heimdal/lib/asn1/ |
H A D | timegm.c | 56 _der_timegm (struct tm *tm) in _der_timegm() argument 64 if (tm->tm_year > ASN1_MAX_YEAR) in _der_timegm() 67 if (tm->tm_year < 0) in _der_timegm() 69 if (tm->tm_mon < 0 || tm->tm_mon > 11) in _der_timegm() 71 if (tm->tm_mday < 1 || tm->tm_mday > (int)ndays[is_leap(tm->tm_year)][tm->tm_mon]) in _der_timegm() 73 if (tm->tm_hour < 0 || tm->tm_hour > 23) in _der_timegm() 75 if (tm->tm_min < 0 || tm->tm_min > 59) in _der_timegm() 77 if (tm->tm_sec < 0 || tm->tm_sec > 59) in _der_timegm() 80 for (i = 70; i < tm->tm_year; ++i) in _der_timegm() 83 for (i = 0; i < tm->tm_mon; ++i) in _der_timegm() [all …]
|
H A D | check-timegm.c | 42 struct tm tm; in test_timegm() local 45 memset(&tm, 0, sizeof(tm)); in test_timegm() 46 tm.tm_year = 106; in test_timegm() 47 tm.tm_mon = 9; in test_timegm() 48 tm.tm_mday = 1; in test_timegm() 49 tm.tm_hour = 10; in test_timegm() 50 tm.tm_min = 3; in test_timegm() 52 t = _der_timegm(&tm); in test_timegm() 56 tm.tm_mday = 0; in test_timegm() 57 t = _der_timegm(&tm); in test_timegm() [all …]
|
/freebsd/usr.bin/localedef/ |
H A D | time.c | 45 struct lc_time_T tm; variable 50 (void) memset(&tm, 0, sizeof (tm)); in init_time() 66 tm.c_fmt = str; in add_time_str() 69 tm.x_fmt = str; in add_time_str() 72 tm.X_fmt = str; in add_time_str() 75 tm.ampm_fmt = str; in add_time_str() 82 tm.date_fmt = str; in add_time_str() 123 add_list(tm.mon, str, 12); in add_time_list() 126 add_list(tm.month, str, 12); in add_time_list() 129 add_list(tm.wday, str, 7); in add_time_list() [all …]
|
/freebsd/usr.bin/at/ |
H A D | parsetime.c | 286 plus_or_minus(struct tm *tm, int delay) in plus_or_minus() argument 294 tm->tm_year += delay; in plus_or_minus() 297 tm->tm_mon += delay; in plus_or_minus() 302 tm->tm_mday += delay; in plus_or_minus() 305 tm->tm_hour += delay; in plus_or_minus() 308 tm->tm_min += delay; in plus_or_minus() 318 tm->tm_isdst = -1; in plus_or_minus() 319 if (mktime(tm) < 0) in plus_or_minus() 331 plus(struct tm *tm) in plus() argument 338 plus_or_minus(tm, delay); in plus() [all …]
|
/freebsd/crypto/openssh/openbsd-compat/ |
H A D | strptime.c | 57 static char *_strptime(const char *, const char *, struct tm *, int); 61 strptime(const char *buf, const char *fmt, struct tm *tm) in strptime() argument 63 return(_strptime(buf, fmt, tm, 1)); in strptime() 67 _strptime(const char *buf, const char *fmt, struct tm *tm, int initialize) in _strptime() argument 126 if (!(bp = _strptime(bp, _ctloc(d_t_fmt), tm, 0))) in _strptime() 132 if (!(bp = _strptime(bp, "%m/%d/%y", tm, 0))) in _strptime() 138 if (!(bp = _strptime(bp, "%H:%M", tm, 0))) in _strptime() 144 if (!(bp = _strptime(bp, "%I:%M:%S %p", tm, 0))) in _strptime() 150 if (!(bp = _strptime(bp, "%H:%M:%S", tm, 0))) in _strptime() 156 if (!(bp = _strptime(bp, _ctloc(t_fmt), tm, 0))) in _strptime() [all …]
|
H A D | bsd-timegm.c | 50 time_t timegm(struct tm *tm) in timegm() argument 58 if (tm->tm_mon > 12 || in timegm() 59 tm->tm_mon < 0 || in timegm() 60 tm->tm_mday > 31 || in timegm() 61 tm->tm_min > 60 || in timegm() 62 tm->tm_sec > 60 || in timegm() 63 tm->tm_hour > 24) { in timegm() 68 for (i = 70; i < tm->tm_year; ++i) in timegm() 71 for (i = 0; i < tm->tm_mon; ++i) in timegm() 72 res += ndays[is_leap(tm->tm_year)][i]; in timegm() [all …]
|
/freebsd/contrib/unbound/compat/ |
H A D | strptime.c | 107 unbound_strptime(const char *s, const char *format, struct tm *tm) in unbound_strptime() argument 139 tm->tm_wday = ret; in unbound_strptime() 150 tm->tm_mon = ret; in unbound_strptime() 153 if (!(s = unbound_strptime(s, "%x %X", tm))) { in unbound_strptime() 164 tm->tm_year = ret*100 + (tm->tm_year%100); in unbound_strptime() 167 tm->tm_year = ret*100 - TM_YEAR_BASE; in unbound_strptime() 177 tm->tm_mday = ret; in unbound_strptime() 180 if (!(s = unbound_strptime(s, "%m/%d/%y", tm))) { in unbound_strptime() 189 tm->tm_hour = ret; in unbound_strptime() 198 tm->tm_hour = ret; in unbound_strptime() [all …]
|
/freebsd/lib/libc/stdtime/ |
H A D | strptime.c | 53 static char * _strptime(const char *, const char *, struct tm *, int *, locale_t); 79 _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, in _strptime() argument 125 buf = _strptime(buf, tptr->date_fmt, tm, GMTp, locale); in _strptime() 150 buf = _strptime(buf, tptr->c_fmt, tm, GMTp, locale); in _strptime() 157 buf = _strptime(buf, "%m/%d/%y", tm, GMTp, locale); in _strptime() 176 buf = _strptime(buf, "%Y-%m-%d", tm, GMTp, locale); in _strptime() 183 buf = _strptime(buf, "%H:%M", tm, GMTp, locale); in _strptime() 189 buf = _strptime(buf, tptr->ampm_fmt, tm, GMTp, locale); in _strptime() 195 buf = _strptime(buf, "%H:%M:%S", tm, GMTp, locale); in _strptime() 201 buf = _strptime(buf, tptr->X_fmt, tm, GMTp, locale); in _strptime() [all …]
|
/freebsd/contrib/ntp/libntp/ |
H A D | humandate.c | 20 struct tm * tm; in humanlogtime() 23 tm = localtime(&cursec); in humanlogtime() 24 if (!tm) in humanlogtime() 30 tm->tm_mday, months[tm->tm_mon], in humanlogtime() 31 tm->tm_hour, tm->tm_min, tm->tm_sec); in humanlogtime() 47 struct tm * t in humantime() 21 struct tm * tm; humanlogtime() local 48 struct tm * tm; humantime() local [all...] |
H A D | prettydate.c | 61 static struct tm * 66 struct tm *tm = NULL; in get_struct_tm() 130 while ((tm = (*(local ? localtime : gmtime))(&ts)) == NULL) in get_struct_tm() 142 /* 'tm' surely not NULL here! */ in get_struct_tm() 143 INSIST(tm != NULL); in get_struct_tm() 145 tm->tm_year += folds * SOLAR_CYCLE_YEARS; in get_struct_tm() 146 if (tm->tm_year <= 0 || tm->tm_year >= 200) in get_struct_tm() 150 return tm; in get_struct_tm() 67 struct tm *tm = NULL; get_struct_tm() local 166 struct tm *tm; common_prettydate() local [all...] |
H A D | uglydate.c | 20 struct tm *tm; in uglydate() 29 tm = gmtime(&sec); in uglydate() 35 tm->tm_yday = 0; in uglydate() 36 tm->tm_hour = 0; in uglydate() 37 tm->tm_min = 0; in uglydate() 38 tm->tm_sec = 0; in uglydate() 40 year = tm->tm_year; in uglydate() 46 tm->tm_yday, tm in uglydate() 21 struct tm *tm; uglydate() local [all...] |
/freebsd/crypto/openssl/crypto/ |
H A D | o_time.c | 14 struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) in OPENSSL_gmtime() 16 struct tm *ts = NULL; in OPENSSL_gmtime() 31 struct tm data, *ts2 = &data; in OPENSSL_gmtime() 37 memcpy(result, ts2, sizeof(struct tm)); in OPENSSL_gmtime() 53 memcpy(result, ts, sizeof(struct tm)); in OPENSSL_gmtime() 69 static int julian_adj(const struct tm *tm, int off_day, long offset_sec, 72 int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec) in OPENSSL_gmtime_adj() argument 78 if (!julian_adj(tm, off_day, offset_sec, &time_jd, &time_sec)) in OPENSSL_gmtime_adj() 90 tm->tm_year = time_year - 1900; in OPENSSL_gmtime_adj() 91 tm->tm_mon = time_month - 1; in OPENSSL_gmtime_adj() [all …]
|
/freebsd/contrib/file/src/ |
H A D | cdf_time.c | 101 struct tm tm; in cdf_timestamp_to_timespec() local 111 tm.tm_sec = CAST(int, t % 60); in cdf_timestamp_to_timespec() 114 tm.tm_min = CAST(int, t % 60); in cdf_timestamp_to_timespec() 117 tm.tm_hour = CAST(int, t % 24); in cdf_timestamp_to_timespec() 121 tm.tm_year = CAST(int, CDF_BASE_YEAR + (t / 365)); in cdf_timestamp_to_timespec() 123 rdays = cdf_getdays(tm.tm_year); in cdf_timestamp_to_timespec() 125 tm.tm_mday = cdf_getday(tm.tm_year, CAST(int, t)); in cdf_timestamp_to_timespec() 126 tm.tm_mon = cdf_getmonth(tm.tm_year, CAST(int, t)); in cdf_timestamp_to_timespec() 127 tm.tm_wday = 0; in cdf_timestamp_to_timespec() 128 tm.tm_yday = 0; in cdf_timestamp_to_timespec() [all …]
|
/freebsd/sys/dev/efidev/ |
H A D | efirtc.c | 64 struct efi_tm tm; in efirtc_probe() local 72 if ((error = efi_get_time(&tm)) != 0) { in efirtc_probe() 132 struct efi_tm tm; in efirtc_gettime() local 135 error = efi_get_time(&tm); in efirtc_gettime() 139 ct.sec = tm.tm_sec; in efirtc_gettime() 140 ct.min = tm.tm_min; in efirtc_gettime() 141 ct.hour = tm.tm_hour; in efirtc_gettime() 142 ct.day = tm.tm_mday; in efirtc_gettime() 143 ct.mon = tm.tm_mon; in efirtc_gettime() 144 ct.year = tm.tm_year; in efirtc_gettime() [all …]
|
/freebsd/crypto/openssl/crypto/asn1/ |
H A D | a_time.c | 50 static void determine_days(struct tm *tm) in determine_days() argument 55 int y = tm->tm_year + 1900; in determine_days() 56 int m = tm->tm_mon; in determine_days() 57 int d = tm->tm_mday; in determine_days() 60 tm->tm_yday = ydays[m] + d - 1; in determine_days() 63 tm->tm_yday += leap_year(y); in determine_days() 73 tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7; in determine_days() 76 int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d) in ossl_asn1_time_to_tm() argument 83 struct tm tmp; in ossl_asn1_time_to_tm() 243 if (tm != NULL) { in ossl_asn1_time_to_tm() [all …]
|
/freebsd/usr.bin/calendar/ |
H A D | day.c | 43 const struct tm tm0; 49 settimes(time_t now, int before, int after, int friday, struct tm *tp1, struct tm *tp2) in settimes() 51 struct tm tp; in settimes() 79 struct tm tm, tp; in Mktime() local 84 tm = tm0; in Mktime() 85 tm.tm_mday = tp.tm_mday; in Mktime() 86 tm.tm_mon = tp.tm_mon; in Mktime() 87 tm.tm_year = tp.tm_year; in Mktime() 93 tm.tm_year = y; in Mktime() 96 tm.tm_mon = m - 1; in Mktime() [all …]
|
/freebsd/sys/sys/ |
H A D | terminal.h | 144 typedef void tc_cursor_t(struct terminal *tm, const term_pos_t *p); 145 typedef void tc_putchar_t(struct terminal *tm, const term_pos_t *p, 147 typedef void tc_fill_t(struct terminal *tm, const term_rect_t *r, 149 typedef void tc_copy_t(struct terminal *tm, const term_rect_t *r, 151 typedef void tc_pre_input_t(struct terminal *tm); 152 typedef void tc_post_input_t(struct terminal *tm); 153 typedef void tc_param_t(struct terminal *tm, int cmd, unsigned int arg); 154 typedef void tc_done_t(struct terminal *tm); 156 typedef void tc_cnprobe_t(struct terminal *tm, struct consdev *cd); 157 typedef int tc_cngetc_t(struct terminal *tm); [all …]
|
/freebsd/contrib/tzcode/ |
H A D | zdump.c | 91 static char const *abbr(struct tm const *); 92 static intmax_t delta(struct tm *, struct tm *); 93 static void dumptime(struct tm const *); 96 static void showextrema(timezone_t, char *, time_t, struct tm *, time_t); 97 static void showtrans(char const *, struct tm const *, time_t, char const *, 189 static struct tm * 190 gmtime_r(time_t *tp, struct tm *tmp) in gmtime_r() 192 struct tm *r = gmtime(tp); in gmtime_r() 216 static struct tm * 365 struct tm tm; my_localtime_rz() local 602 struct tm tm, newtm; main() local 741 struct tm tm; hunt() local 852 struct tm tm, gmtm; show() local 975 format_local_time(char * buf,ptrdiff_t size,struct tm const * tm) format_local_time() argument 998 format_utc_offset(char * buf,ptrdiff_t size,struct tm const * tm,time_t t) format_utc_offset() argument 1070 istrftime(char * buf,ptrdiff_t size,char const * time_fmt,struct tm const * tm,time_t t,char const * ab,char const * zone_name) istrftime() argument 1147 showtrans(char const * time_fmt,struct tm const * tm,time_t t,char const * ab,char const * zone_name) showtrans() argument [all...] |
/freebsd/contrib/ntp/ntpd/ |
H A D | refclock_pcf.c | 137 struct tm tm, *tp; in pcf_poll() local 148 ZERO(tm); in pcf_poll() 150 tm.tm_mday = buf[11] * 10 + buf[10]; in pcf_poll() 151 tm.tm_mon = buf[13] * 10 + buf[12] - 1; in pcf_poll() 152 tm.tm_year = buf[15] * 10 + buf[14]; in pcf_poll() 153 tm.tm_hour = buf[7] * 10 + buf[6]; in pcf_poll() 154 tm.tm_min = buf[5] * 10 + buf[4]; in pcf_poll() 155 tm.tm_sec = buf[3] * 10 + buf[2]; in pcf_poll() 156 tm in pcf_poll() [all...] |
/freebsd/contrib/nvi/common/ |
H A D | delete.c | 32 del(SCR *sp, MARK *fm, MARK *tm, int lmode) in del() argument 43 for (lno = tm->lno; lno >= fm->lno; --lno) { in del() 59 if (tm->lno >= lno) { in del() 60 if (tm->lno == lno) { in del() 63 eof = tm->cno != ENTIRE_LINE && tm->cno >= len ? 1 : 0; in del() 67 for (lno = tm->lno; lno > fm->lno; --lno) { in del() 86 if (tm->lno == fm->lno) { in del() 93 MEMCPY(bp + fm->cno, p + (tm->cno + 1), in del() 94 len - (tm->cno + 1)); in del() 96 bp, len - ((tm->cno - fm->cno) + 1))) in del() [all …]
|