+void
+fifo_expire_one(Fifo *f, struct timespec t, char *buf)
+{
+ struct timespec td;
+
+ timespecsub(&t, &(f->last_read), &td);
+ if (timespeccmp(&td, &(f->ttl), >=)) {
+ /* TODO: Maybe configurable expiry character. */
+ memset(buf + f->pos_init, '_', f->pos_final - f->pos_init);
+ warn("Data source expired: \"%s\"\n", f->name);
+ }
+}
+
+void
+fifo_expire_all(Config *cfg, struct timespec t, char *buf)
+{
+ Fifo *f;
+
+ for (f = cfg->fifos; f; f = f->next)
+ fifo_expire_one(f, t, buf);
+}
+