}
}
+/* Linked list containing the functions to call upon each update interval.
+ * Populated while initialising text objects in construct_text_object(). */
static struct update_cb {
struct update_cb *next;
void (*func)(void);
.next = NULL,
};
+/* Register an update callback. Don't allow duplicates, to minimise side
+ * effects and overhead. */
void add_update_callback(void (*func)(void))
{
struct update_cb *uc = &update_cb_head;
uc->next->func = func;
}
+/* Free the list element uc and all decendants recursively. */
static void __free_update_callbacks(struct update_cb *uc)
{
if (uc->next)
free(uc);
}
+/* Free the whole list of update callbacks. */
void free_update_callbacks(void)
{
if (update_cb_head.next)