1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[event] struct event -> struct el_event

This commit is contained in:
Witold Filipczyk 2022-07-21 10:14:13 +02:00
parent 3af1280501
commit 9cab4ceb94

View File

@ -40,7 +40,7 @@ struct event_handler {
void *data; void *data;
}; };
struct event { struct el_event {
/* The event name has to be unique. */ /* The event name has to be unique. */
char *name; char *name;
@ -52,7 +52,7 @@ struct event {
int id; int id;
}; };
static struct event *events = NULL; static struct el_event *events = NULL;
static unsigned int eventssize = 0; static unsigned int eventssize = 0;
static struct hash *event_hash = NULL; static struct hash *event_hash = NULL;
@ -77,7 +77,7 @@ int
register_event(const char *name) register_event(const char *name)
{ {
int id = get_event_id(name); int id = get_event_id(name);
struct event *event; struct el_event *event;
int namelen; int namelen;
if (id != EVENT_NONE) return id; if (id != EVENT_NONE) return id;
@ -130,7 +130,7 @@ get_event_id(const char *name)
namelen = strlen(name); namelen = strlen(name);
item = get_hash_item(event_hash, name, namelen); item = get_hash_item(event_hash, name, namelen);
if (item) { if (item) {
struct event *event = (struct event *)item->value; struct el_event *event = (struct el_event *)item->value;
assertm(event != NULL, "Hash item with no value"); assertm(event != NULL, "Hash item with no value");
if_assert_failed return EVENT_NONE; if_assert_failed return EVENT_NONE;
@ -192,7 +192,7 @@ trigger_event_name(const char *name, ...)
} }
static inline void static inline void
move_event_handler(struct event *event, int to, int from) move_event_handler(struct el_event *event, int to, int from)
{ {
int d = int_max(to, from); int d = int_max(to, from);
@ -203,7 +203,7 @@ move_event_handler(struct event *event, int to, int from)
int int
register_event_hook(int id, event_hook_T callback, int priority, void *data) register_event_hook(int id, event_hook_T callback, int priority, void *data)
{ {
struct event *event; struct el_event *event;
int i; int i;
assert(callback); assert(callback);
@ -245,7 +245,7 @@ register_event_hook(int id, event_hook_T callback, int priority, void *data)
void void
unregister_event_hook(int id, event_hook_T callback) unregister_event_hook(int id, event_hook_T callback)
{ {
struct event *event; struct el_event *event;
assert(callback); assert(callback);
if_assert_failed return; if_assert_failed return;