static int periodic_events_initialized = 0;
/* Declare all the timer callback functions... */
+#ifndef COCCI
#undef CALLBACK
#define CALLBACK(name) \
static int name ## _callback(time_t, const or_options_t *)
+
CALLBACK(add_entropy);
CALLBACK(check_expired_networkstatus);
CALLBACK(clean_caches);
#undef CALLBACK
/* Now we declare an array of periodic_event_item_t for each periodic event */
-#ifndef COCCI
#define CALLBACK(name, r, f) \
PERIODIC_EVENT(name, PERIODIC_EVENT_ROLE_ ## r, f)
-#endif
#define FL(name) (PERIODIC_EVENT_FLAG_ ## name)
+#endif
STATIC periodic_event_item_t mainloop_periodic_events[] = {
END_OF_PERIODIC_EVENTS
};
+#ifndef COCCI
#undef CALLBACK
#undef FL
+#endif
/* These are pointers to members of periodic_events[] that are used to
* implement particular callbacks. We keep them separate here so that we
/* Set up all periodic events. We'll launch them by roles. */
+#ifndef COCCI
#define NAMED_CALLBACK(name) \
STMT_BEGIN name ## _event = periodic_events_find( #name ); STMT_END
+#endif
NAMED_CALLBACK(prune_old_routers);
NAMED_CALLBACK(fetch_networkstatus);