Lines Matching +full:start +full:- +full:year
2 * CDDL HEADER START
43 * validate that hours and minutes of prime/non-prime read in
45 * Time is expected in the form and range of 0000-2400.
49 static int holidays[NHOLIDAYS]; /* holidays file day-of-year table */
78 * split interval of length etime, starting at start into prime/nonprime
83 pnpsplit(long start, ulong_t etime, long result[2]) in pnpsplit() argument
95 tcur = start; in pnpsplit()
96 tend = start + etime; in pnpsplit()
106 result[NONPRIME] += tend-tcur; in pnpsplit()
116 for (; hp->h_sec >= 0; hp++) { in pnpsplit()
119 result[hp->h_type] += tend-tcur; in pnpsplit()
123 hours.tm_sec = hp->h_sec; in pnpsplit()
124 hours.tm_min = hp->h_min; in pnpsplit()
125 hours.tm_hour = hp->h_hour; in pnpsplit()
127 result[hp->h_type] += tmp; in pnpsplit()
129 cur.tm_sec = hp->h_sec; in pnpsplit()
130 cur.tm_min = hp->h_min; in pnpsplit()
131 cur.tm_hour = hp->h_hour; in pnpsplit()
152 holidays[0] = -1; in checkhol()
157 tp->tm_year += 1900; in checkhol()
158 if ((tp->tm_year == thisyear && tp->tm_yday > 359) in checkhol()
159 || tp->tm_year > thisyear) in checkhol()
174 if (ltp->tm_wday == 0 || ltp->tm_wday == 6) in ssh()
177 if (ltp->tm_yday == holidays[i]) in ssh()
183 * inithol - read from an ascii file and initialize the "thisyear"
184 * variable, the times that prime and non-prime start, and the
196 int doy; /* day of the year */ in inithol()
216 else if(++line == 1) { /* format: year p-start np-start */ in inithol()
226 /* validate year */ in inithol()
228 fprintf(stderr, "pnpsplit: invalid year: %d\n", in inithol()
242 /* Set up start of prime time; 2400 == 0000 */ in inithol()
248 /* Set up start of non-prime time; 2400 == 2360 */ in inithol()
268 h[3].h_sec = -1; in inithol()
292 holidays[holindx++] = (doy - 1); in inithol()
296 holidays[holindx] = -1; in inithol()
312 return((t2->tm_sec - t1->tm_sec) + in tmsecs()
313 60*(t2->tm_min - t1->tm_min) + in tmsecs()
314 3600L*(t2->tm_hour - t1->tm_hour)); in tmsecs()
325 if (t1->tm_hour != t2->tm_hour) in tmless()
326 return(t1->tm_hour < t2->tm_hour); in tmless()
327 if (t1->tm_min != t2->tm_min) in tmless()
328 return(t1->tm_min < t2->tm_min); in tmless()
329 return(t1->tm_sec < t2->tm_sec); in tmless()
332 /* set day of year from month and day */
335 day_of_year(int year, int month, int day) in day_of_year() argument
339 leap = year%4 == 0 && year%100 || year%400 == 0; in day_of_year()