Lines Matching refs:pt
116 leap_table_t * pt)
118 if (pt == &_ltab[0] || pt == &_ltab[1])
119 _lptr = pt;
120 return _lptr == pt;
151 leap_table_t * pt)
153 memset(&pt->lsig, 0, sizeof(pt->lsig));
154 memset(&pt->head, 0, sizeof(pt->head));
155 reset_times(pt);
163 leap_table_t * pt,
174 leapsec_clear(pt);
191 pt->head.expire = strtouv64(cp, &ep, 10);
194 pt->lsig.etime = pt->head.expire.D_s.lo;
197 pt->head.update = strtouv64(cp, &ep, 10);
211 if (!leapsec_raw(pt, &ttime,
215 pt->head.base_tai = (int16_t)taiof;
217 pt->lsig.ttime = ttime.D_s.lo;
218 pt->lsig.taiof = (int16_t)taiof;
226 leapsec_clear(pt);
236 const leap_table_t * pt ,
244 ntpcal_ntp64_to_date(&ttb, &pt->head.expire);
246 pt->head.size,
248 idx = pt->head.size;
250 ts = pt->info[idx].ttime;
252 ts = subv64u32(&ts, pt->info[idx].stime);
257 "-*"[pt->info[idx].dynls != 0],
259 pt->info[idx].taiof);
273 leap_table_t * pt;
281 pt = leapsec_get_table(FALSE);
284 if (ucmpv64(&ts64, &pt->head.ebase) < 0) {
289 reload_limits(pt, &ts64);
290 } else if (ucmpv64(&ts64, &pt->head.dtime) >= 0) {
306 last = addv64i32(&pt->head.dtime, 3); /* get boundary */
309 reload_limits(pt, &ts64);
312 last = pt->head.ttime;
314 pt->head.dtime.D_s.lo);
316 reload_limits(pt, &next);
317 fired = ucmpv64(&pt->head.ebase, &last) == 0;
327 qr->tai_offs = pt->head.this_tai;
328 qr->ebase = pt->head.ebase;
329 qr->ttime = pt->head.ttime;
332 if (ucmpv64(&ts64, &pt->head.stime) < 0)
336 due32 = pt->head.dtime.D_s.lo;
338 qr->tai_diff = pt->head.next_tai - pt->head.this_tai;
340 qr->dynamic = pt->head.dynls;
363 const leap_table_t * pt;
366 pt = leapsec_get_table(FALSE);
368 fetch_leap_era(qr, pt, &ts64);
377 const leap_table_t * pt;
380 pt = leapsec_get_table(FALSE);
382 qr->tai_offs = pt->head.this_tai;
383 qr->tai_diff = pt->head.next_tai - pt->head.this_tai;
384 qr->ebase = pt->head.ebase;
385 qr->ttime = pt->head.ttime;
386 qr->dynamic = pt->head.dynls;
388 return ucmpv64(&pt->head.ttime, &pt->head.stime) >= 0;
411 leap_table_t *pt;
448 pt = leapsec_get_table(TRUE);
449 if (!leapsec_load(pt, (leapsec_reader)getc, ifp, TRUE)) {
467 if (pt->head.size)
469 logPrefix, fname, lstostr(&pt->head.expire),
470 lstostr(&pt->info[0].ttime), pt->info[0].taiof);
474 logPrefix, fname, lstostr(&pt->head.expire),
475 pt->head.base_tai);
477 return leapsec_set_table(pt);
550 const leap_table_t * pt;
552 pt = leapsec_get_table(FALSE);
553 memcpy(psig, &pt->lsig, sizeof(leap_signature_t));
562 const leap_table_t * pt;
565 pt = leapsec_get_table(FALSE);
567 return ucmpv64(&limit, &pt->head.expire) >= 0;
576 const leap_table_t * pt;
579 pt = leapsec_get_table(FALSE);
581 limit = subv64(&pt->head.expire, &limit);
595 leap_table_t * pt;
605 pt = leapsec_get_table(TRUE);
607 if ( ucmpv64(&et64, &pt->head.expire) <= 0
608 || !leapsec_raw(pt, &tt64, total, FALSE) )
611 pt->lsig.etime = etime;
612 pt->lsig.ttime = ttime;
613 pt->lsig.taiof = (int16_t)total;
615 pt->head.expire = et64;
617 return leapsec_set_table(pt);
628 leap_table_t * pt;
631 pt = leapsec_get_table(TRUE);
633 return ( leapsec_add(pt, &now64, (insert != 0))
634 && leapsec_set_table(pt));
644 leap_table_t * pt;
650 pt = leapsec_get_table(FALSE);
656 if (pt->head.base_tai != 0 || tai_offset < 10)
668 for (idx = 0; idx != pt->head.size; idx++)
669 if ( ! pt->info[idx].dynls)
674 fetch_leap_era(&era, pt, &now64);
689 pt->head.base_tai += tai_offset;
690 pt->head.this_tai += tai_offset;
691 pt->head.next_tai += tai_offset;
694 for (idx = 0; idx != pt->head.size; idx++)
695 pt->info[idx].taiof += tai_offset;
715 leap_table_t * pt)
717 memset(&pt->head.ebase, 0xFF, sizeof(vint64));
718 pt->head.stime = pt->head.ebase;
719 pt->head.ttime = pt->head.ebase;
720 pt->head.dtime = pt->head.ebase;
728 leap_table_t * pt,
745 if (pt->head.size == 0) {
747 pt->head.base_tai = pi->taiof - 1;
749 pt->head.base_tai = pi->taiof + 1;
750 } else if (pt->head.size >= MAX_HIST) {
751 pt->head.size = MAX_HIST - 1;
752 pt->head.base_tai = pt->info[pt->head.size].taiof;
756 memmove(pt->info+1, pt->info, pt->head.size*sizeof(*pt->info));
757 pt->info[0] = *pi;
758 pt->head.size++;
767 reset_times(pt);
842 leap_table_t * pt,
852 for (idx = 0; idx != pt->head.size; idx++)
853 if (ucmpv64(ts, &pt->info[idx].ttime) >= 0)
860 if (idx >= pt->head.size) {
861 memset(&pt->head.ebase, 0x00, sizeof(vint64));
862 pt->head.this_tai = pt->head.base_tai;
864 pt->head.ebase = pt->info[idx].ttime;
865 pt->head.this_tai = pt->info[idx].taiof;
868 pt->head.next_tai = pt->info[idx].taiof;
869 pt->head.dynls = pt->info[idx].dynls;
870 pt->head.ttime = pt->info[idx].ttime;
873 pt->head.dtime = pt->head.ttime;
875 pt->head.dtime = addv64i32(
876 &pt->head.ttime,
877 pt->head.next_tai - pt->head.this_tai);
879 pt->head.stime = subv64u32(
880 &pt->head.ttime, pt->info[idx].stime);
883 memset(&pt->head.ttime, 0xFF, sizeof(vint64));
884 pt->head.stime = pt->head.ttime;
885 pt->head.dtime = pt->head.ttime;
886 pt->head.next_tai = pt->head.this_tai;
887 pt->head.dynls = 0;
899 const leap_table_t * pt ,
905 for (idx = 0; idx != pt->head.size; idx++)
906 if (ucmpv64(ts, &pt->info[idx].ttime) >= 0)
909 if (idx >= pt->head.size) {
911 into->taiof = pt->head.base_tai;
913 into->ebase = pt->info[idx].ttime;
914 into->taiof = pt->info[idx].taiof;
917 into->ttime = pt->info[idx].ttime;
934 leap_table_t* pt ,
946 if ( ucmpv64(now64, &pt->head.expire) < 0
947 || (pt->head.size && ucmpv64(now64, &pt->info[0].ttime) <= 0)) {
972 li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai)
975 return add_range(pt, &li);
985 leap_table_t * pt,
1000 if (pt->head.size) {
1001 int cmp = ucmpv64(ttime, &pt->info[0].ttime);
1003 cmp -= (taiof != pt->info[0].taiof);
1024 return add_range(pt, &li);