| /openbsd-src/lib/libc/time/ |
| H A D | strptime.c | 78 static int epoch_to_tm(const unsigned char **, struct tm *); 80 static char *_strptime(const char *, const char *, struct tm *, int); 86 strptime(const char *buf, const char *fmt, struct tm *tm) in strptime() argument 88 return(_strptime(buf, fmt, tm, 1)); in strptime() 93 _strptime(const char *buf, const char *fmt, struct tm *tm, int initialize) in _strptime() argument 153 if (!(bp = _strptime(bp, _ctloc(d_t_fmt), tm, 0))) in _strptime() 159 if (!(bp = _strptime(bp, "%m/%d/%y", tm, 0))) in _strptime() 165 if (!(bp = _strptime(bp, "%Y-%m-%d", tm, 0))) in _strptime() 171 if (!(bp = _strptime(bp, "%H:%M", tm, 0))) in _strptime() 177 if (!(bp = _strptime(bp, "%I:%M:%S %p", tm, 0))) in _strptime() [all …]
|
| /openbsd-src/usr.bin/at/ |
| H A D | parsetime.c | 292 dateadd(int minutes, struct tm *tm) in dateadd() argument 298 tm->tm_mday++; in dateadd() 304 tm->tm_hour++; in dateadd() 305 if (tm->tm_hour > 23) { in dateadd() 306 tm->tm_mday++; in dateadd() 307 tm->tm_hour = 0; in dateadd() 312 tm->tm_min += minutes; in dateadd() 314 if (tm->tm_min > 59) { in dateadd() 315 tm->tm_hour++; in dateadd() 316 tm->tm_min -= 60; in dateadd() [all …]
|
| /openbsd-src/lib/libcrypto/asn1/ |
| H A D | a_time_tm.c | 35 ASN1_time_tm_cmp(struct tm *tm1, struct tm *tm2) in ASN1_time_tm_cmp() 65 ASN1_time_tm_clamp_notafter(struct tm *tm) in ASN1_time_tm_clamp_notafter() argument 68 struct tm broken_os_epoch_tm; in ASN1_time_tm_clamp_notafter() 74 if (ASN1_time_tm_cmp(tm, &broken_os_epoch_tm) == 1) in ASN1_time_tm_clamp_notafter() 75 memcpy(tm, &broken_os_epoch_tm, sizeof(*tm)); in ASN1_time_tm_clamp_notafter() 82 tm_to_gentime(struct tm *tm, ASN1_TIME *atime) in tm_to_gentime() argument 86 if (tm->tm_year < -1900 || tm->tm_year > 9999 - 1900) { in tm_to_gentime() 91 if (asprintf(&time_str, "%04u%02u%02u%02u%02u%02uZ", tm->tm_year + 1900, in tm_to_gentime() 92 tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, in tm_to_gentime() 93 tm->tm_sec) == -1) { in tm_to_gentime() [all …]
|
| H A D | a_time_posix.c | 178 OPENSSL_tm_to_posix(const struct tm *tm, int64_t *out) in OPENSSL_tm_to_posix() argument 180 return posix_time_from_utc(tm->tm_year + (int64_t)1900, in OPENSSL_tm_to_posix() 181 tm->tm_mon + (int64_t)1, tm->tm_mday, tm->tm_hour, tm->tm_min, in OPENSSL_tm_to_posix() 182 tm->tm_sec, out); in OPENSSL_tm_to_posix() 187 OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm) in OPENSSL_posix_to_tm() 189 struct tm tmp_tm = {0}; in OPENSSL_posix_to_tm() 207 asn1_time_tm_to_time_t(const struct tm *tm, time_t *out) in asn1_time_tm_to_time_t() argument 211 if (!OPENSSL_tm_to_posix(tm, &posix_time)) in asn1_time_tm_to_time_t() 226 asn1_time_time_t_to_tm(const time_t *time, struct tm *out_tm) in asn1_time_time_t_to_tm() 234 OPENSSL_timegm(const struct tm *tm, time_t *out) { in OPENSSL_timegm() argument [all …]
|
| /openbsd-src/sbin/isakmpd/ |
| H A D | x509.c | 118 ASN1_TIME *tm; in x509_generate_kn() local 222 if (((tm = X509_get_notBefore(cert)) == NULL) || in x509_generate_kn() 223 (tm->type != V_ASN1_UTCTIME && in x509_generate_kn() 224 tm->type != V_ASN1_GENERALIZEDTIME)) { in x509_generate_kn() 225 struct tm *ltm; in x509_generate_kn() 236 if (tm->data[tm->length - 1] == 'Z') { in x509_generate_kn() 238 i = tm->length - 2; in x509_generate_kn() 241 i = tm->length - 1; in x509_generate_kn() 245 if (tm->data[i] < '0' || tm->data[i] > '9') { in x509_generate_kn() 253 if (tm->type == V_ASN1_UTCTIME) { in x509_generate_kn() [all …]
|
| /openbsd-src/regress/lib/libc/time/strptime/ |
| H A D | main.c | 53 struct tm tm; in main() local 84 tm.tm_sec = -1; in main() 85 tm.tm_min = -1; in main() 86 tm.tm_hour = -1; in main() 87 tm.tm_mday = -1; in main() 88 tm.tm_mon = -1; in main() 89 tm.tm_year = -1; in main() 90 tm.tm_wday = -1; in main() 91 tm.tm_yday = -1; in main() 93 p = strptime(buf, format, &tm); in main() [all …]
|
| /openbsd-src/gnu/usr.bin/cc/cc_tools/ |
| H A D | Makefile.dep | 7 tm.h options.h \ 12 tm.h options.h \ 18 tm.h options.h \ 22 tm.h options.h \ 29 tm.h options.h \ 34 tm.h options.h \ 38 tm.h options.h \ 43 tm.h options.h \ 47 tm.h options.h \ 52 tm.h options.h \ [all …]
|
| /openbsd-src/usr.bin/vi/common/ |
| H A D | delete.c | 33 del(SCR *sp, MARK *fm, MARK *tm, int lmode) in del() argument 44 for (lno = tm->lno; lno >= fm->lno; --lno) { in del() 60 if (tm->lno >= lno) { in del() 61 if (tm->lno == lno) { in del() 64 eof = tm->cno != -1 && tm->cno >= len ? 1 : 0; in del() 68 for (lno = tm->lno; lno > fm->lno; --lno) { in del() 87 if (tm->lno == fm->lno) { in del() 94 memcpy(bp + fm->cno, p + (tm->cno + 1), len - (tm->cno + 1)); in del() 96 bp, len - ((tm->cno - fm->cno) + 1))) in del() 115 if (db_get(sp, tm->lno, DBG_FATAL, &p, &len)) in del() [all …]
|
| /openbsd-src/include/ |
| H A D | time.h | 98 struct tm { struct 113 char *asctime(const struct tm *); 117 struct tm *gmtime(const time_t *); 118 struct tm *localtime(const time_t *); 119 time_t mktime(struct tm *); 121 const struct tm *__restrict) 131 struct tm *__restrict); 135 char *asctime_r(const struct tm *__restrict, char *__restrict) 139 struct tm *gmtime_r(const time_t *__restrict, struct tm *__restrict); 140 struct tm *localtime_r(const time_t *__restrict, struct tm *__restrict); [all …]
|
| /openbsd-src/usr.sbin/unbound/testcode/ |
| H A D | signit.c | 81 struct tm tm; in convert_timeval() local 82 memset(&tm, 0, sizeof(tm)); in convert_timeval() 85 if(sscanf(str, "%4d%2d%2d%2d%2d%2d", &tm.tm_year, &tm.tm_mon, in convert_timeval() 86 &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) in convert_timeval() 88 tm.tm_year -= 1900; in convert_timeval() 89 tm.tm_mon--; in convert_timeval() 91 if (tm.tm_year < 70) return 0; in convert_timeval() 92 if (tm.tm_mon < 0 || tm.tm_mon > 11) return 0; in convert_timeval() 93 if (tm.tm_mday < 1 || tm.tm_mday > 31) return 0; in convert_timeval() 94 if (tm.tm_hour < 0 || tm.tm_hour > 23) return 0; in convert_timeval() [all …]
|
| /openbsd-src/usr.bin/calendar/ |
| H A D | day.c | 52 struct tm *tp; 81 fill_print_date(struct match *m, struct tm *tm) in fill_print_date() argument 84 daynames ? "%a %b %d" : "%b %d", tm) == 0) in fill_print_date() 93 struct tm tm; in setnnames() local 96 tm.tm_wday = i; in setnnames() 97 l = strftime(buf, sizeof(buf), "%a", &tm); in setnnames() 106 l = strftime(buf, sizeof(buf), "%A", &tm); in setnnames() 117 tm.tm_mon = i; in setnnames() 118 l = strftime(buf, sizeof(buf), "%b", &tm); in setnnames() 127 l = strftime(buf, sizeof(buf), "%B", &tm); in setnnames() [all …]
|
| /openbsd-src/gnu/usr.bin/perl/cpan/Time-Piece/ |
| H A D | Piece.xs | 157 my_mini_mktime(struct tm *ptm) in my_mini_mktime() 316 static char * _strptime(pTHX_ const char *, const char *, struct tm *, 339 _strptime(pTHX_ const char *buf, const char *fmt, struct tm *tm, int *got_GMT) in _strptime() argument 379 buf = _strptime(aTHX_ buf, "%c", tm, got_GMT); in _strptime() 398 tm->tm_year = i * 100 - 1900; in _strptime() 404 buf = _strptime(aTHX_ buf, "%a %d %b %Y %I:%M:%S %p %Z", tm, got_GMT); in _strptime() 410 buf = _strptime(aTHX_ buf, "%m/%d/%y", tm, got_GMT); in _strptime() 428 buf = _strptime(aTHX_ buf, "%Y-%m-%d", tm, got_GMT); in _strptime() 434 buf = _strptime(aTHX_ buf, "%H:%M", tm, got_GMT); in _strptime() 440 buf = _strptime(aTHX_ buf, "%I:%M:%S %p", tm, got_GMT); in _strptime() [all …]
|
| /openbsd-src/gnu/usr.bin/perl/ |
| H A D | time64.c | 189 static int S_check_tm(const struct TM *tm) in S_check_tm() argument 192 assert(tm->tm_sec >= 0); in S_check_tm() 193 assert(tm->tm_sec <= 61); in S_check_tm() 195 assert(tm->tm_min >= 0); in S_check_tm() 196 assert(tm->tm_min <= 59); in S_check_tm() 198 assert(tm->tm_hour >= 0); in S_check_tm() 199 assert(tm->tm_hour <= 23); in S_check_tm() 201 assert(tm->tm_mday >= 1); in S_check_tm() 202 assert(tm->tm_mday <= days_in_month[IS_LEAP(tm->tm_year)][tm->tm_mon]); in S_check_tm() 204 assert(tm->tm_mon >= 0); in S_check_tm() [all …]
|
| /openbsd-src/gnu/usr.bin/binutils/opcodes/ |
| H A D | tic54x-dis.c | 52 const template* tm; in print_insn_tic54x() local 62 tm = tic54x_get_insn (info, memaddr, opcode, &size); in print_insn_tic54x() 69 if (tm->flags & FL_PAR) in print_insn_tic54x() 71 if (!print_parallel_instruction (info, memaddr, opcode, tm, size)) in print_insn_tic54x() 77 (char *) tm->name, in print_insn_tic54x() 78 tm->operand_types, in print_insn_tic54x() 79 size, (tm->flags & FL_EXT))) in print_insn_tic54x() 87 has_lkaddr (unsigned short memdata, const template *tm) in has_lkaddr() argument 90 && (OPTYPE (tm->operand_types[0]) == OP_Smem in has_lkaddr() 91 || OPTYPE (tm->operand_types[1]) == OP_Smem in has_lkaddr() [all …]
|
| H A D | tic30-dis.c | 65 template *tm; member 143 insn->tm = current_optab; 149 insn->tm = current_optab; 202 insn->tm = current_optab; 210 insn->tm = current_optab; 218 insn->tm = current_optab; 245 if (insn->tm == NULL) 247 strcpy (name, insn->tm->name); 248 if (insn->tm->opcode_modifier == AddressMode) 252 if ((insn->tm->operand_types[1] & (Direct | Indirect)) == (Direct | Indirect)) [all …]
|
| /openbsd-src/gnu/usr.bin/binutils-2.17/opcodes/ |
| H A D | tic54x-dis.c | 52 const template* tm; in print_insn_tic54x() local 62 tm = tic54x_get_insn (info, memaddr, opcode, &size); in print_insn_tic54x() 69 if (tm->flags & FL_PAR) in print_insn_tic54x() 71 if (!print_parallel_instruction (info, memaddr, opcode, tm, size)) in print_insn_tic54x() 77 (char *) tm->name, in print_insn_tic54x() 78 tm->operand_types, in print_insn_tic54x() 79 size, (tm->flags & FL_EXT))) in print_insn_tic54x() 87 has_lkaddr (unsigned short memdata, const template *tm) in has_lkaddr() argument 90 && (OPTYPE (tm->operand_types[0]) == OP_Smem in has_lkaddr() 91 || OPTYPE (tm->operand_types[1]) == OP_Smem in has_lkaddr() [all …]
|
| H A D | tic30-dis.c | 65 template *tm; member 89 insn->tm = current_optab; in get_tic30_instruction() 95 insn->tm = current_optab; in get_tic30_instruction() 157 insn->tm = current_optab; in get_tic30_instruction() 166 insn->tm = current_optab; in get_tic30_instruction() 175 insn->tm = current_optab; in get_tic30_instruction() 348 if (insn->tm == NULL) in print_two_operand() 350 strcpy (name, insn->tm->name); in print_two_operand() 351 if (insn->tm->opcode_modifier == AddressMode) in print_two_operand() 355 if ((insn->tm->operand_types[1] & (Direct | Indirect)) in print_two_operand() [all …]
|
| /openbsd-src/games/grdc/ |
| H A D | grdc.c | 31 struct tm *tm; variable 153 tm = localtime(&now.tv_sec); in main() 154 set(tm->tm_sec % 10, 0); in main() 155 set(tm->tm_sec / 10, 4); in main() 156 set(tm->tm_min % 10, 10); in main() 157 set(tm->tm_min / 10, 14); in main() 158 set(tm->tm_hour % 10, 20); in main() 159 set(tm->tm_hour / 10, 24); in main() 163 if (sigwinched || prev_tm_gmtoff != tm->tm_gmtoff) { in main() 166 prev_tm_gmtoff = tm->tm_gmtoff; in main() [all …]
|
| /openbsd-src/lib/libcrypto/x509/ |
| H A D | x509cset.c | 105 X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) in X509_CRL_set_lastUpdate() argument 112 if (in != tm) { in X509_CRL_set_lastUpdate() 113 in = ASN1_STRING_dup(tm); in X509_CRL_set_lastUpdate() 124 X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) in X509_CRL_set1_lastUpdate() argument 126 return X509_CRL_set_lastUpdate(x, tm); in X509_CRL_set1_lastUpdate() 131 X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) in X509_CRL_set_nextUpdate() argument 138 if (in != tm) { in X509_CRL_set_nextUpdate() 139 in = ASN1_STRING_dup(tm); in X509_CRL_set_nextUpdate() 150 X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) in X509_CRL_set1_nextUpdate() argument 152 return X509_CRL_set_nextUpdate(x, tm); in X509_CRL_set1_nextUpdate() [all …]
|
| /openbsd-src/usr.bin/newsyslog/ |
| H A D | newsyslog.c | 408 struct tm *tm; in parse_args() 415 tm = gmtime(&now.tv_sec); in parse_args() 416 l = strftime(daytime, sizeof(daytime), "%FT%T", tm); in parse_args() 1161 struct tm tm, *tmp; in parse8601() 1166 tm = *tmp; in parse8601() 1168 tm.tm_hour = tm.tm_min = tm in parse8601() 406 struct tm *tm; parse_args() local 1159 struct tm tm, *tmp; parse8601() local 1250 struct tm tm, *tmp; parseDWM() local [all...] |
| /openbsd-src/usr.bin/mandoc/ |
| H A D | mandoc.c | 101 struct tm tm; in a2time() local 104 memset(&tm, 0, sizeof(struct tm)); in a2time() 106 pp = strptime(p, fmt, &tm); in a2time() 108 *t = mktime(&tm); in a2time() 118 struct tm *tm; in time2a() local 124 tm = localtime(&t); in time2a() 125 if (tm == NULL) in time2a() 137 if ((ssz = strftime(p, 10 + 1, "%B ", tm)) == 0) in time2a() 150 isz = snprintf(p, 4 + 1, "%d, ", tm->tm_mday); in time2a() 155 if (strftime(p, 4 + 1, "%Y", tm) == 0) in time2a()
|
| /openbsd-src/usr.bin/chpass/ |
| H A D | util.c | 49 struct tm *tp = localtime(&tval); in ttoa() 61 struct tm tm; in atot() local 68 (void) memset(&tm, 0, sizeof(tm)); in atot() 71 t = strptime(p, "%B %d %Y", &tm); in atot() 74 tm.tm_isdst = -1; in atot() 75 *store = mktime(&tm); in atot()
|
| /openbsd-src/usr.sbin/zdump/ |
| H A D | zdump.c | 58 static char *abbr(struct tm *tmp); 60 static long delta(struct tm *newp, struct tm *oldp); 61 static void dumptime(const struct tm *tmp); 113 struct tm tm, newtm, *tmp, *newtmp; in main() local 201 tm = *tmp; in main() 202 strlcpy(buf, abbr(&tm), sizeof buf); in main() 212 (delta(&newtm, &tm) != (newt - t) || in main() 213 newtm.tm_isdst != tm.tm_isdst || in main() 223 tm = newtm; in main() 290 struct tm lotm, *lotmp; in hunt() [all …]
|
| /openbsd-src/gnu/usr.bin/perl/dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/ |
| H A D | Cmd.pm | 55 my $tm; 59 eval { $tm = $module->new } 60 and return $tm; 67 eval { $tm = $module->new } 68 and return $tm; 93 my $tm = $sources{$source}->($identifier); 94 return $tm if defined $tm;
|
| /openbsd-src/gnu/lib/libstdc++/libstdc++/testsuite/22_locale/ |
| H A D | time_get_members_wchar_t.cc | 66 const tm time_bday = { 0, 0, 12, 4, 3, 71 }; in test01() 86 tm time01; in test01() 96 tm time02; in test01() 106 tm time03; in test01() 114 tm time04; in test01() 125 tm time10; in test01() 140 tm time20; in test01() 185 const tm time_bday = { 0, 0, 12, 4, 3, 71 }; in test02() 199 tm time01; in test02() 207 tm time02; in test02() [all …]
|