Loading...
Searching...
No Matches
callback_list.h
Go to the documentation of this file.
1
11#pragma once
12#include <stdbool.h>
13
18
20typedef void (*CallbackListFn)(void);
21
23typedef struct
24{
26 int max;
27 int count;
29
38
44void callback_list_fire(const CallbackList *list);
45
void callback_list_fire(const CallbackList *list)
Runs every callback in the order it was added.
Definition callback_list.c:35
void(*) CallbackListFn(void)
One callback in a list.
Definition callback_list.h:20
bool callback_list_add(CallbackList *list, CallbackListFn cb)
Adds a callback to the end of the list. Adding one that is already there does nothing.
Definition callback_list.c:11
A list over storage its owner provides. Start it as {entries, max, 0}.
Definition callback_list.h:24
CallbackListFn * entries
The owner's array, max long.
Definition callback_list.h:25
int count
How many are in use.
Definition callback_list.h:27
int max
How many the array holds.
Definition callback_list.h:26