• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/lib/libcalendar/

Lines Matching refs:idt

58 static date	*date2idt(date *idt, date *dt);
59 static date *idt2date(date *dt, date *idt);
60 static int ndaysji(date *idt);
61 static int ndaysgi(date *idt);
71 date idt; /* Internal date representation */
79 idt.y = ndays / 365;
80 idt.m = 0;
81 idt.d = 0;
82 while ((r = ndaysji(&idt)) > ndays)
83 idt.y--;
91 for (idt.m = 11; month1[idt.m] > r; idt.m--)
95 idt.d = r - month1[idt.m];
98 return (idt2date(dt, &idt));
108 date idt; /* Internal date representation */
110 if (date2idt(&idt, dt) == NULL)
113 return (ndaysji(&idt));
121 ndaysji(date * idt)
124 return (idt->d + month1[idt->m] + idt->y * 365 + idt->y / 4);
136 date idt; /* for internal date representation */
144 idt.y = ndays / 365;
145 idt.m = 0;
146 idt.d = 0;
147 while ((r = ndaysgi(&idt)) > ndays)
148 idt.y--;
161 if (idt.y == 1582)
166 for (idt.m = 11; montht[idt.m] > ndays; idt.m--)
169 idt.d = ndays - montht[idt.m]; /* the rest is the day in month */
172 if (idt.y == jiswitch.y && idt.m == jiswitch.m && jiswitch.d < idt.d)
173 idt.d += 10;
176 return (idt2date(dt, &idt));
187 date idt; /* Internal date representation */
189 if (date2idt(&idt, dt) == NULL)
191 return (ndaysgi(&idt));
199 ndaysgi(date *idt)
220 if ((nd = ndaysji(idt)) == -1)
222 if (idt->y >= 1600)
223 nd = (nd - 10 - (idt->y - 1600) / 100 + (idt->y - 1600) / 400);
253 date idt;
256 idt.y = y - 1; /* internal representation of y-1-1 */
257 idt.m = 10;
258 idt.d = 0;
260 nd = ndaysgi(&idt);
298 date2idt(date *idt, date *dt)
301 idt->d = dt->d - 1;
303 idt->m = dt->m - 3;
304 idt->y = dt->y;
306 idt->m = dt->m + 9;
307 idt->y = dt->y - 1;
309 if (idt->m < 0 || idt->m > 11 || idt->y < 0)
312 return idt;
317 idt2date(date *dt, date *idt)
320 dt->d = idt->d + 1;
321 if (idt->m < 10) {
322 dt->m = idt->m + 3;
323 dt->y = idt->y;
325 dt->m = idt->m - 9;
326 dt->y = idt->y + 1;