Lines Matching +full:1 +full:d

10  * 1. Redistributions of source code must retain the above copyright
71 /* 1-based month, 0-based days, cumulative */
73 {0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364},
74 {0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
76 /* 1-based month, individual */
86 createdate(int y, int m, int d) in createdate() argument
105 py = (struct cal_year *)calloc(1, sizeof(struct cal_year)); in createdate()
112 td.tm_mday = 1; in createdate()
135 pm = (struct cal_month *)calloc(1, sizeof(struct cal_month)); in createdate()
141 (py->firstdayofweek + pm->firstdayjulian -1) % 7; in createdate()
156 pd = (struct cal_day *)calloc(1, sizeof(struct cal_day)); in createdate()
159 pd->dayofmonth = d; in createdate()
160 pd->julianday = pm->firstdayjulian + d - 1; in createdate()
161 pd->dayofweek = (pm->firstdayofweek + d - 1) % 7; in createdate()
174 int y, m, d; in generatedates() local
177 m1 = tp1->tm_mon + 1; in generatedates()
180 m2 = tp2->tm_mon + 1; in generatedates()
186 for (d = d1; d <= d2; d++) in generatedates()
187 createdate(y1, m1, d); in generatedates()
197 for (d = d1; d <= monthdays[m1]; d++) in generatedates()
198 createdate(y1, m1, d); in generatedates()
199 for (m = m1 + 1; m < m2; m++) in generatedates()
200 for (d = 1; d <= monthdays[m]; d++) in generatedates()
201 createdate(y1, m, d); in generatedates()
202 for (d = 1; d <= d2; d++) in generatedates()
203 createdate(y1, m2, d); in generatedates()
211 * - Take all days from y2-[1 .. m2> in generatedates()
215 for (d = d1; d <= monthdays[m1]; d++) in generatedates()
216 createdate(y1, m1, d); in generatedates()
217 for (m = m1 + 1; m <= 12; m++) in generatedates()
218 for (d = 1; d <= monthdays[m]; d++) in generatedates()
219 createdate(y1, m, d); in generatedates()
220 for (y = y1 + 1; y < y2; y++) { in generatedates()
222 for (m = 1; m <= 12; m++) in generatedates()
223 for (d = 1; d <= monthdays[m]; d++) in generatedates()
224 createdate(y, m, d); in generatedates()
227 for (m = 1; m < m2; m++) in generatedates()
228 for (d = 1; d <= monthdays[m]; d++) in generatedates()
229 createdate(y2, m, d); in generatedates()
230 for (d = 1; d <= d2; d++) in generatedates()
231 createdate(y2, m2, d); in generatedates()
239 struct cal_day *d; in dumpdates() local
243 printf("%-5d (wday:%d)\n", y->year, y->firstdayofweek); in dumpdates()
246 printf("-- %-5d (julian:%d, dow:%d)\n", m->month, in dumpdates()
248 d = m->days; in dumpdates()
249 while (d != NULL) { in dumpdates()
250 printf(" -- %-5d (julian:%d, dow:%d)\n", in dumpdates()
251 d->dayofmonth, d->julianday, d->dayofweek); in dumpdates()
252 d = d->nextday; in dumpdates()
265 struct cal_day *d; in remember_ymd() local
268 printf("remember_ymd: %d - %d - %d\n", yy, mm, dd); in remember_ymd()
282 d = m->days; in remember_ymd()
283 while (d != NULL) { in remember_ymd()
284 if (d->dayofmonth == dd) in remember_ymd()
285 return (1); in remember_ymd()
286 d = d->nextday; in remember_ymd()
301 struct cal_day *d; in remember_yd() local
304 printf("remember_yd: %d - %d\n", yy, dd); in remember_yd()
314 d = m->days; in remember_yd()
315 while (d != NULL) { in remember_yd()
316 if (d->julianday == dd) { in remember_yd()
318 *rd = d->dayofmonth; in remember_yd()
319 return (1); in remember_yd()
321 d = d->nextday; in remember_yd()
343 return (-1); in first_dayofweek_of_year()
365 return (-1); in first_dayofweek_of_month()
369 return (-1); in first_dayofweek_of_month()
377 static struct cal_day *d = NULL; in walkthrough_dates() local
382 d = m->days; in walkthrough_dates()
383 *e = d->events; in walkthrough_dates()
384 return (1); in walkthrough_dates()
386 if (d->nextday != NULL) { in walkthrough_dates()
387 d = d->nextday; in walkthrough_dates()
388 *e = d->events; in walkthrough_dates()
389 return (1); in walkthrough_dates()
393 d = m->days; in walkthrough_dates()
394 *e = d->events; in walkthrough_dates()
395 return (1); in walkthrough_dates()
400 d = m->days; in walkthrough_dates()
401 *e = d->events; in walkthrough_dates()
402 return (1); in walkthrough_dates()
413 struct cal_day *d; in find_day() local
416 printf("remember_ymd: %d - %d - %d\n", yy, mm, dd); in find_day()
430 d = m->days; in find_day()
431 while (d != NULL) { in find_day()
432 if (d->dayofmonth == dd) in find_day()
433 return (d); in find_day()
434 d = d->nextday; in find_day()
447 struct cal_day *d; in addtodate() local
450 d = find_day(e->year, e->month, e->day); in addtodate()
451 ee = d->lastevent; in addtodate()
455 d->events = e; in addtodate()
456 d->lastevent = e; in addtodate()