![]() |
Helixis 1.0
Task Programming API
|
Go to the source code of this file.
| void _hlx_event_default_manager_destroy | ( | void | ) |
Definition at line 63 of file events.c.
References hlx_api::free_entry.
Referenced by hlx_event_manager_destroy().
{
if (gl_event_manager != 0)
gl_api.free_entry(gl_event_manager);
gl_event_manager = 0;
}
| void _hlx_event_delete_callback | ( | void * | data, |
| void * | state | ||
| ) |
Definition at line 54 of file events.c.
References hlx_api::free_entry.
Referenced by _hlx_event_handler_create_by_hash().
{
_hlx_event_callback* callback;
(void)state;
callback = (_hlx_event_callback*)data;
gl_api.free_entry(callback);
}
| _hlx_event_handler* _hlx_event_handler_create | ( | unsigned long | id | ) |
| hlx_event_errors _hlx_event_handler_create_by_hash | ( | _hlx_event_manager * | manager, |
| unsigned long | id, | ||
| unsigned int | size | ||
| ) |
Definition at line 78 of file parallel_events.c.
References _hlx_event_delete_callback(), _hlx_event_return_handler_by_hash(), _hlx_event_handler::callbacks, EV_ERROR_ALREADY_EXISTS, EV_ERROR_MEMORY_EXHAUSTED, EV_ERROR_SUCCESS, _hlx_event_manager::handlers, _hlx_event_handler::hash_code, hlx_api::malloc_entry, _hlx_event_handler::param_size, slist_new(), and slist_new_head().
Referenced by hlx_event_handler_create().
{
_hlx_event_handler* handler;
if (_hlx_event_return_handler_by_hash(manager, id))
return (EV_ERROR_ALREADY_EXISTS);
if ((handler = gl_api.malloc_entry(sizeof(*handler))) == 0)
return (EV_ERROR_MEMORY_EXHAUSTED);
handler->hash_code = id;
if (slist_new(&handler->callbacks, _hlx_event_delete_callback, 0) == 0 || slist_new_head(manager->handlers, handler) == 0)
return (EV_ERROR_MEMORY_EXHAUSTED);
handler->param_size = size;
return (EV_ERROR_SUCCESS);
}
| void _hlx_event_handler_destroy | ( | _hlx_event_handler * | handler | ) |
Definition at line 93 of file parallel_events.c.
References _hlx_event_handler::callbacks, and slist_delete_all_elements().
Referenced by hlx_event_handler_destroy(), and hlx_event_manager_destroy().
{
slist_delete_all_elements(handler->callbacks);
}
| hlx_event_errors _hlx_event_register_callback_with_group | ( | _hlx_event_manager * | manager, |
| _hlx_event_handler * | handler, | ||
| unsigned long | id, | ||
| _hlx_event_callback * | callback, | ||
| hlx_group_id | group_id | ||
| ) |
Definition at line 98 of file parallel_events.c.
References _hlx_event_handler::callbacks, EV_ERROR_MEMORY_EXHAUSTED, EV_ERROR_SUCCESS, hlx_api::free_entry, _hlx_event_callback::group_id, HLX_UNUSED, and slist_new_head().
Referenced by _hlx_event_register_callback_task_with_callback_and_group(), and hlx_event_register_callback_func_with_group().
{
HLX_UNUSED(id);
HLX_UNUSED(manager);
callback->group_id = group_id;
if (slist_new_head(handler->callbacks, callback) == 0)
{
gl_api.free_entry(callback);
return (EV_ERROR_MEMORY_EXHAUSTED);
}
return (EV_ERROR_SUCCESS);
}
| _hlx_event_handler* _hlx_event_return_handler | ( | _hlx_event_manager * | manager, |
| unsigned long | id | ||
| ) |
Definition at line 148 of file events.c.
References _hlx_event_return_handler_by_hash().
Referenced by _hlx_event_register_callback_task_with_callback_and_group(), hlx_event_handler_destroy(), hlx_event_notify(), and hlx_event_register_callback_func_with_group().
{
return (_hlx_event_return_handler_by_hash(manager, id));
}
| _hlx_event_handler* _hlx_event_return_handler_by_hash | ( | _hlx_event_manager * | manager, |
| unsigned long | id | ||
| ) |
Definition at line 111 of file parallel_events.c.
References _hlx_event_manager::handlers, slist_get_head_and_then_next(), and slist_get_user_data_from_element().
Referenced by _hlx_event_handler_create_by_hash(), and _hlx_event_return_handler().
{
_hlx_event_handler* handler;
struct slist_element* it;
it = 0;
while (slist_get_head_and_then_next(manager->handlers, &it))
if (slist_get_user_data_from_element(it, (void **)&handler) && handler->hash_code == id)
return (handler);
return (0);
}
| void _hlx_event_task_callback | ( | void * | param, |
| hlx_group_id | group_id, | ||
| int | status | ||
| ) |
Definition at line 153 of file events.c.
References hlx_event_args::callback, hlx_event_args::event_data, and hlx_api::free_entry.
Referenced by hlx_event_notify().
{
hlx_event_args* args;
args = (hlx_event_args*)param;
if (args->callback)
args->callback(param, group_id, status);
if (args->event_data)
gl_api.free_entry(args->event_data);
gl_api.free_entry(args);
}
| hlx_event_errors _hlx_event_unregister_callback | ( | _hlx_event_manager * | manager, |
| unsigned long | id, | ||
| void * | user_callback | ||
| ) |
| hlx_event_errors _hlx_event_unregister_callback_through_handler | ( | _hlx_event_handler * | handler, |
| void * | user_callback | ||
| ) |
1.7.4