void _pfq_update_start_finish(struct pfq_impl *p, oskit_bool_t use_finish_time) { oskit_off_t size; oskit_error_t err; pfq_time_t prev_ftime; assert(p); p->p_stime = use_finish_time ? p->p_ftime : max(p->p_ftime, p->p_parent ? p->p_parent->p_vtime : 0); assert(p->p_logicalq); err = oskit_bufio_getsize(p->p_logicalq, &size); assert(! err); prev_ftime = p->p_ftime; p->p_ftime = p->p_stime + (oskit_u32_t)size * p->p_byte_charge; if (prev_ftime > p->p_ftime) /* Time wrapped. */ adjust_times(p); if (p->p_parent) do_update_queue(p->p_parent, p); }
/* compute prayer times at given julian date */ void compute_day_times(double times[]) { double default_times[] = { 5, 6, 12, 13, 18, 18, 18 }; // default times for (int i = 0; i < TimesCount; ++i) times[i] = default_times[i]; for (int i = 0; i < NUM_ITERATIONS; ++i) compute_times(times); adjust_times(times); }