Event function definitions. More...
Go to the source code of this file.
Data Structures | |
struct | qsc_event_handler |
The event handler structure. More... | |
Macros | |
#define | QSC_EVENT_NAME_SIZE 32ULL |
The character length of the event name. | |
Typedefs | |
typedef void(* | qsc_event_callback) (size_t,...) |
The event callback variadic prototype. | |
Functions | |
QSC_EXPORT_API int32_t | qsc_event_register (const char name[QSC_EVENT_NAME_SIZE], qsc_event_callback callback) |
Register an event and its callback. | |
QSC_EXPORT_API void | qsc_event_clear_listener (const char name[QSC_EVENT_NAME_SIZE]) |
Clear a listener for a specified event. | |
QSC_EXPORT_API qsc_event_callback | qsc_event_get_callback (const char name[QSC_EVENT_NAME_SIZE]) |
Retrieve a callback function by event name. | |
QSC_EXPORT_API void | qsc_event_destroy_listeners (void) |
Destroy all event listeners. | |
Event function definitions.
This file defines the API for registering, retrieving, and clearing event callbacks. It supports grouping events by name and provides search hints for advanced documentation navigation. Functions in this module allow for dynamic management of event listeners, making it easier to integrate event-driven programming features into applications.
typedef void(* qsc_event_callback) (size_t,...) |
The event callback variadic prototype.
This callback function takes a size_t indicating the number of arguments, followed by a variable list of arguments.
QSC_EXPORT_API void qsc_event_clear_listener | ( | const char | name[QSC_EVENT_NAME_SIZE] | ) |
Clear a listener for a specified event.
Clears the listener associated with the specified event name.
name | [const char[QSC_EVENT_NAME_SIZE]] The name of the event. |
QSC_EXPORT_API void qsc_event_destroy_listeners | ( | void | ) |
Destroy all event listeners.
Destroys the event handler state and frees all associated resources.
QSC_EXPORT_API qsc_event_callback qsc_event_get_callback | ( | const char | name[QSC_EVENT_NAME_SIZE] | ) |
Retrieve a callback function by event name.
Retrieves the callback function registered with the specified event name.
name | [const char[QSC_EVENT_NAME_SIZE]] The name of the event. |
QSC_EXPORT_API int32_t qsc_event_register | ( | const char | name[QSC_EVENT_NAME_SIZE], |
qsc_event_callback | callback ) |
Register an event and its callback.
Registers an event with the specified name and callback function.
name | [const char[QSC_EVENT_NAME_SIZE]] The name of the event. |
callback | [qsc_event_callback] The callback function. |