Lines Matching defs:tme

85  * .call	ret = local_to_gm(tme).
86 * .arg tme - ptr to struct tm (see time.h) containing local time.
90 local_to_gm(struct tm *tme)
100 r1secs = secs = tm_to_secs(tme);
160 * .call ret = tm_to_secs(tme).
161 * .arg tme - ptr to tm structure.
165 tm_to_secs(struct tm *tme)
171 int sec = tme->tm_sec;
172 int min = tme->tm_min;
173 int hour = tme->tm_hour;
174 int day = tme->tm_mday;
175 int month = tme->tm_mon;
176 int year = tme->tm_year + 1900;
204 * .call err = check_time(tme).
205 * .arg tme - ptr to struct tm (see time.h).
210 check_time(struct tm *tme)
214 if (tme->tm_sec < 0 || tme->tm_sec > 59) {
216 gettext("seconds out of range (%d)"), tme->tm_sec + 1);
218 } else if (tme->tm_min < 0 || tme->tm_min > 59) {
220 gettext("minutes out of range (%d)"), tme->tm_min + 1);
222 } else if (tme->tm_hour < 0 || tme->tm_hour > 23) {
224 gettext("hours out of range (%d)"), tme->tm_hour + 1);
226 } else if (tme->tm_mon < 0 || tme->tm_mon > 11) {
228 gettext("months out of range (%d)"), tme->tm_mon + 1);
230 } else if (tme->tm_year < 0) {
232 gettext("years out of range (%d)"), tme->tm_year);
234 } else if (tme->tm_mday < 1 || tme->tm_mday > days_month[tme->tm_mon]) {
235 if (!(days_in_year(tme->tm_year + 1900) == 366 &&
236 tme->tm_mon == 1 &&
237 tme->tm_mday == 29)) { /* leap year and February */
239 gettext("days out of range (%d)"), tme->tm_mday);
242 } else if (tme->tm_wday < 0 || tme->tm_wday > 6) {
244 gettext("weekday out of range (%d)"), tme->tm_wday);
246 } else if (tme->tm_yday < 0 || tme->tm_yday > 365) {
248 gettext("day of year out of range (%d)"), tme->tm_yday);
373 * .call ret = derive_date(str, tme).
375 * .arg tme - ptr to tm structure (time.h).
380 derive_date(char *str, struct tm *tme)
433 (void) memset((void *) tme, 0, (size_t)sizeof (*tme));
436 tme->tm_year = atoi(strs) - 1900; /* get the year */
439 tme->tm_mon = atoi(strs) - 1; /* get months */
442 tme->tm_mday = atoi(strs); /* get days */
446 tme->tm_hour = atoi(strs); /* get hours */
451 tme->tm_min = atoi(strs); /* get minutes */
456 tme->tm_sec = atoi(strs); /* get seconds */
459 return (check_time(tme)); /* lastly check the ranges */