Lines Matching defs:tm
48 * if week<0 then return week for tm
49 * if day<0 then set tm to first day of week
50 * otherwise set tm to day in week
51 * and return tm->tm_yday
55 tmweek(Tm_t* tm, int type, int week, int day)
61 if ((day = tm->tm_wday - tm->tm_yday % 7) < 0)
63 week = (tm->tm_yday + offset[day][type]) / 7;
67 week = (day > 0 && day < 6 || tmisleapyear(tm->tm_year - 1)) ? 53 : 52;
68 else if (week == 53 && (tm->tm_wday + (31 - tm->tm_mday)) < 4)
75 tm->tm_mon = 0;
76 tm->tm_mday = 1;
77 tmfix(tm);
78 d = tm->tm_wday;
79 tm->tm_mday = week * 7 - offset[d][type] + ((day || type != 2) ? day : 7);
80 tmfix(tm);
81 if (d = tm->tm_wday - day)
83 tm->tm_mday -= d;
84 tmfix(tm);
86 return tm->tm_yday;