|
Concord - C Discord API library
A Discord API wrapper library written in C
|
Initialized once. More...
#include "concord-error.h"Go to the source code of this file.
Typedefs | |
| typedef CCORDcode(* | ccord_once_cb) (long flags) |
Functions | |
| CCORDcode | ccord_once_set_callback (ccord_once_cb callback, long flags) |
| Register a user callback for initialization. More... | |
| CCORDcode | ccord_once (_Bool *once) |
| Initialize context once. More... | |
| void | ccord_once_cleanup (void) |
| Cleanup once context. More... | |
Initialized once.
| typedef CCORDcode(* ccord_once_cb) (long flags) |
Callback function type for user initialization
| CCORDcode ccord_once_set_callback | ( | ccord_once_cb | callback, |
| long | flags | ||
| ) |
Register a user callback for initialization.
This callback will be executed exactly once during initialization after all internal initializations have been performed. Multiple callbacks can be registered from different modules, and they will be executed in the order they were registered.
| callback | The function to call during initialization |
| flags | Flag to pass to the callback, that will be passed to the callback function |
| CCORDcode ccord_once | ( | _Bool * | once | ) |
Initialize context once.
| once | Pointer to a static boolean flag that will be set to true if the initialization was successful. This flag should be used to ensure that the initialization is only performed once. |
| void ccord_once_cleanup | ( | void | ) |
Cleanup once context.
This function will be called to cleanup the once context. It will be called when the program is exiting, and it will cleanup all registered callbacks.