Lines Matching defs:idt

56 static date	*date2idt(date *idt, date *dt);
57 static date *idt2date(date *dt, date *idt);
58 static int ndaysji(date *idt);
59 static int ndaysgi(date *idt);
69 date idt; /* Internal date representation */
77 idt.y = ndays / 365;
78 idt.m = 0;
79 idt.d = 0;
80 while ((r = ndaysji(&idt)) > ndays)
81 idt.y--;
89 for (idt.m = 11; month1[idt.m] > r; idt.m--)
93 idt.d = r - month1[idt.m];
96 return (idt2date(dt, &idt));
106 date idt; /* Internal date representation */
108 if (date2idt(&idt, dt) == NULL)
111 return (ndaysji(&idt));
119 ndaysji(date * idt)
122 return (idt->d + month1[idt->m] + idt->y * 365 + idt->y / 4);
134 date idt; /* for internal date representation */
142 idt.y = ndays / 365;
143 idt.m = 0;
144 idt.d = 0;
145 while ((r = ndaysgi(&idt)) > ndays)
146 idt.y--;
159 if (idt.y == 1582)
164 for (idt.m = 11; montht[idt.m] > ndays; idt.m--)
167 idt.d = ndays - montht[idt.m]; /* the rest is the day in month */
170 if (idt.y == jiswitch.y && idt.m == jiswitch.m && jiswitch.d < idt.d)
171 idt.d += 10;
174 return (idt2date(dt, &idt));
185 date idt; /* Internal date representation */
187 if (date2idt(&idt, dt) == NULL)
189 return (ndaysgi(&idt));
197 ndaysgi(date *idt)
218 if ((nd = ndaysji(idt)) == -1)
220 if (idt->y >= 1600)
221 nd = (nd - 10 - (idt->y - 1600) / 100 + (idt->y - 1600) / 400);
251 date idt;
254 idt.y = y - 1; /* internal representation of y-1-1 */
255 idt.m = 10;
256 idt.d = 0;
258 nd = ndaysgi(&idt);
296 date2idt(date *idt, date *dt)
299 idt->d = dt->d - 1;
301 idt->m = dt->m - 3;
302 idt->y = dt->y;
304 idt->m = dt->m + 9;
305 idt->y = dt->y - 1;
307 if (idt->m < 0 || idt->m > 11 || idt->y < 0)
310 return idt;
315 idt2date(date *dt, date *idt)
318 dt->d = idt->d + 1;
319 if (idt->m < 10) {
320 dt->m = idt->m + 3;
321 dt->y = idt->y;
323 dt->m = idt->m - 9;
324 dt->y = idt->y + 1;