+static void every_schedule(Every *e, struct timeval base) {
+ struct timeval when;
+ timeradd(&base, &e->interval, &when);
+ loop->on_time(loop, when, every_happens, e);
+}
+
+static void every(int interval, int fixed_rate, void (*f)(void)) {
+ Every *e= xmalloc(sizeof(*e));
+ e->interval.tv_sec= interval;
+ e->interval.tv_usec= 0;
+ e->fixed_rate= fixed_rate;
+ e->f= f;
+ struct timeval now;
+ xgettimeofday(&now);
+ every_schedule(e, now);
+}
+
+static void filepoll(void) {
+ filemon_callback(main_input_file);
+ filemon_callback(flushing_input_file);
+}