+/** @brief Called when a rescan completes */
+static void log_rescanned(void attribute((unused)) *v) {
+ added_update();
+}
+
+/** @brief Add a monitor to the list
+ * @param callback Function to call
+ * @param u User data to pass to @p callback
+ * @param mask Mask of flags that @p callback cares about
+ *
+ * Pass @p mask as -1UL to match all flags.
+ */
+void register_monitor(monitor_callback *callback,
+ void *u,
+ unsigned long mask) {
+ struct monitor *m = xmalloc(sizeof *m);
+
+ m->next = monitors;
+ m->mask = mask;
+ m->callback = callback;
+ m->u = u;
+ monitors = m;
+}
+