Lines Matching defs:pt

114 	leap_table_t * pt)
116 if (pt == &_ltab[0] || pt == &_ltab[1])
117 _lptr = pt;
118 return _lptr == pt;
149 leap_table_t * pt)
151 memset(&pt->lsig, 0, sizeof(pt->lsig));
152 memset(&pt->head, 0, sizeof(pt->head));
153 reset_times(pt);
161 leap_table_t * pt,
172 leapsec_clear(pt);
189 pt->head.expire = strtouv64(cp, &ep, 10);
192 pt->lsig.etime = pt->head.expire.D_s.lo;
195 pt->head.update = strtouv64(cp, &ep, 10);
209 if (!leapsec_raw(pt, &ttime,
213 pt->head.base_tai = (int16_t)taiof;
215 pt->lsig.ttime = ttime.D_s.lo;
216 pt->lsig.taiof = (int16_t)taiof;
224 leapsec_clear(pt);
234 const leap_table_t * pt ,
242 ntpcal_ntp64_to_date(&ttb, &pt->head.expire);
244 pt->head.size,
246 idx = pt->head.size;
248 ts = pt->info[idx].ttime;
250 ts = subv64u32(&ts, pt->info[idx].stime);
255 "-*"[pt->info[idx].dynls != 0],
257 pt->info[idx].taiof);
271 leap_table_t * pt;
279 pt = leapsec_get_table(FALSE);
282 if (ucmpv64(&ts64, &pt->head.ebase) < 0) {
287 reload_limits(pt, &ts64);
288 } else if (ucmpv64(&ts64, &pt->head.dtime) >= 0) {
304 last = addv64i32(&pt->head.dtime, 3); /* get boundary */
307 reload_limits(pt, &ts64);
310 last = pt->head.ttime;
312 pt->head.dtime.D_s.lo);
314 reload_limits(pt, &next);
315 fired = ucmpv64(&pt->head.ebase, &last) == 0;
325 qr->tai_offs = pt->head.this_tai;
326 qr->ebase = pt->head.ebase;
327 qr->ttime = pt->head.ttime;
330 if (ucmpv64(&ts64, &pt->head.stime) < 0)
334 due32 = pt->head.dtime.D_s.lo;
336 qr->tai_diff = pt->head.next_tai - pt->head.this_tai;
338 qr->dynamic = pt->head.dynls;
361 const leap_table_t * pt;
364 pt = leapsec_get_table(FALSE);
366 fetch_leap_era(qr, pt, &ts64);
375 const leap_table_t * pt;
378 pt = leapsec_get_table(FALSE);
380 qr->tai_offs = pt->head.this_tai;
381 qr->tai_diff = pt->head.next_tai - pt->head.this_tai;
382 qr->ebase = pt->head.ebase;
383 qr->ttime = pt->head.ttime;
384 qr->dynamic = pt->head.dynls;
386 return ucmpv64(&pt->head.ttime, &pt->head.stime) >= 0;
409 leap_table_t *pt;
446 pt = leapsec_get_table(TRUE);
447 if (!leapsec_load(pt, (leapsec_reader)getc, ifp, TRUE)) {
465 if (pt->head.size)
467 logPrefix, fname, lstostr(&pt->head.expire),
468 lstostr(&pt->info[0].ttime), pt->info[0].taiof);
472 logPrefix, fname, lstostr(&pt->head.expire),
473 pt->head.base_tai);
475 return leapsec_set_table(pt);
548 const leap_table_t * pt;
550 pt = leapsec_get_table(FALSE);
551 memcpy(psig, &pt->lsig, sizeof(leap_signature_t));
560 const leap_table_t * pt;
563 pt = leapsec_get_table(FALSE);
565 return ucmpv64(&limit, &pt->head.expire) >= 0;
574 const leap_table_t * pt;
577 pt = leapsec_get_table(FALSE);
579 limit = subv64(&pt->head.expire, &limit);
593 leap_table_t * pt;
603 pt = leapsec_get_table(TRUE);
605 if ( ucmpv64(&et64, &pt->head.expire) <= 0
606 || !leapsec_raw(pt, &tt64, total, FALSE) )
609 pt->lsig.etime = etime;
610 pt->lsig.ttime = ttime;
611 pt->lsig.taiof = (int16_t)total;
613 pt->head.expire = et64;
615 return leapsec_set_table(pt);
626 leap_table_t * pt;
629 pt = leapsec_get_table(TRUE);
631 return ( leapsec_add(pt, &now64, (insert != 0))
632 && leapsec_set_table(pt));
642 leap_table_t * pt;
648 pt = leapsec_get_table(FALSE);
654 if (pt->head.base_tai != 0 || tai_offset < 10)
666 for (idx = 0; idx != pt->head.size; idx++)
667 if ( ! pt->info[idx].dynls)
672 fetch_leap_era(&era, pt, &now64);
687 pt->head.base_tai += tai_offset;
688 pt->head.this_tai += tai_offset;
689 pt->head.next_tai += tai_offset;
692 for (idx = 0; idx != pt->head.size; idx++)
693 pt->info[idx].taiof += tai_offset;
713 leap_table_t * pt)
715 memset(&pt->head.ebase, 0xFF, sizeof(vint64));
716 pt->head.stime = pt->head.ebase;
717 pt->head.ttime = pt->head.ebase;
718 pt->head.dtime = pt->head.ebase;
726 leap_table_t * pt,
743 if (pt->head.size == 0) {
745 pt->head.base_tai = pi->taiof - 1;
747 pt->head.base_tai = pi->taiof + 1;
748 } else if (pt->head.size >= MAX_HIST) {
749 pt->head.size = MAX_HIST - 1;
750 pt->head.base_tai = pt->info[pt->head.size].taiof;
754 memmove(pt->info+1, pt->info, pt->head.size*sizeof(*pt->info));
755 pt->info[0] = *pi;
756 pt->head.size++;
765 reset_times(pt);
840 leap_table_t * pt,
850 for (idx = 0; idx != pt->head.size; idx++)
851 if (ucmpv64(ts, &pt->info[idx].ttime) >= 0)
858 if (idx >= pt->head.size) {
859 memset(&pt->head.ebase, 0x00, sizeof(vint64));
860 pt->head.this_tai = pt->head.base_tai;
862 pt->head.ebase = pt->info[idx].ttime;
863 pt->head.this_tai = pt->info[idx].taiof;
866 pt->head.next_tai = pt->info[idx].taiof;
867 pt->head.dynls = pt->info[idx].dynls;
868 pt->head.ttime = pt->info[idx].ttime;
871 pt->head.dtime = pt->head.ttime;
873 pt->head.dtime = addv64i32(
874 &pt->head.ttime,
875 pt->head.next_tai - pt->head.this_tai);
877 pt->head.stime = subv64u32(
878 &pt->head.ttime, pt->info[idx].stime);
881 memset(&pt->head.ttime, 0xFF, sizeof(vint64));
882 pt->head.stime = pt->head.ttime;
883 pt->head.dtime = pt->head.ttime;
884 pt->head.next_tai = pt->head.this_tai;
885 pt->head.dynls = 0;
897 const leap_table_t * pt ,
903 for (idx = 0; idx != pt->head.size; idx++)
904 if (ucmpv64(ts, &pt->info[idx].ttime) >= 0)
907 if (idx >= pt->head.size) {
909 into->taiof = pt->head.base_tai;
911 into->ebase = pt->info[idx].ttime;
912 into->taiof = pt->info[idx].taiof;
915 into->ttime = pt->info[idx].ttime;
932 leap_table_t* pt ,
944 if ( ucmpv64(now64, &pt->head.expire) < 0
945 || (pt->head.size && ucmpv64(now64, &pt->info[0].ttime) <= 0)) {
970 li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai)
973 return add_range(pt, &li);
983 leap_table_t * pt,
998 if (pt->head.size) {
999 int cmp = ucmpv64(ttime, &pt->info[0].ttime);
1001 cmp -= (taiof != pt->info[0].taiof);
1022 return add_range(pt, &li);