![]() |
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_errors _hlx_event_register_callback_task_with_callback | ( | hlx_event_manager * | public_manager, |
| unsigned long | id, | ||
| hlx_task_func | task, | ||
| void * | user_data, | ||
| hlx_task_callback | task_callback | ||
| ) |
Definition at line 133 of file events.c.
References _hlx_event_register_callback_task_with_callback_and_group().
{
return _hlx_event_register_callback_task_with_callback_and_group(public_manager, id, task, user_data, task_callback, 0);
}
| hlx_event_errors _hlx_event_register_callback_task_with_callback_and_group | ( | hlx_event_manager * | public_manager, |
| unsigned long | id, | ||
| hlx_task_func | user_callback, | ||
| void * | user_data, | ||
| hlx_task_callback | task_callback, | ||
| hlx_group_id | group_id | ||
| ) |
Definition at line 115 of file events.c.
References _hlx_event_register_callback_with_group(), _hlx_event_return_handler(), _hlx_event_params::callback, EV_ERROR_MEMORY_EXHAUSTED, EV_ERROR_UNDEFINED, _hlx_event_callback::func, hlx_api::malloc_entry, _hlx_event_callback::params, _hlx_event_callback::task, and _hlx_event_params::user_data.
Referenced by _hlx_event_register_callback_task_with_callback(), hlx_event_register_callback_task(), and hlx_event_register_callback_task_with_group().
{
_hlx_event_manager* manager;
_hlx_event_handler* handler;
_hlx_event_callback* callback;
manager = (_hlx_event_manager*)public_manager;
if ((handler = _hlx_event_return_handler(manager, id)) == 0)
return (EV_ERROR_UNDEFINED);
if ((callback = gl_api.malloc_entry(sizeof(*callback))) == 0)
return (EV_ERROR_MEMORY_EXHAUSTED);
callback->task = user_callback;
callback->params.callback = task_callback;
callback->params.user_data = user_data;
callback->func = 0;
return (_hlx_event_register_callback_with_group(manager, handler, id, callback, group_id));
}
| _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));
}
| 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_manager* hlx_event_get_default_manager | ( | void | ) |
Get the default event manager (Never call hlx_event_manager_destroy() for this manager)
Definition at line 70 of file events.c.
References hlx_event_manager_create().
Referenced by hlx_scheduler_destruct().
{
if (gl_event_manager == 0)
gl_event_manager = hlx_event_manager_create();
return (gl_event_manager);
}
| hlx_event_errors hlx_event_handler_create | ( | hlx_event_manager * | manager, |
| unsigned long | id, | ||
| unsigned int | size | ||
| ) |
Create a new event in the given manager
| manager | The event manager where the event will be attached |
| id | The event Id (you can use hlx_hash) |
| size | The size of the user data (for hlx_event_notify). HLX_EVENT_NO_ARGS for no user arg. |
Definition at line 77 of file events.c.
References _hlx_event_handler_create_by_hash().
{
return (_hlx_event_handler_create_by_hash((_hlx_event_manager*)public_manager, id, size));
}
| hlx_event_errors hlx_event_handler_destroy | ( | hlx_event_manager * | manager, |
| unsigned long | id | ||
| ) |
Destroy The given event
| manager | The event manager where the event is attached |
| id | The event Id (you can use hlx_hash) |
Definition at line 82 of file events.c.
References _hlx_event_handler_destroy(), _hlx_event_return_handler(), EV_ERROR_SUCCESS, and EV_ERROR_UNDEFINED.
{
_hlx_event_handler* handler;
if ((handler = _hlx_event_return_handler((_hlx_event_manager*)public_manager, id)) == 0)
return (EV_ERROR_UNDEFINED);
_hlx_event_handler_destroy(handler);
return (EV_ERROR_SUCCESS);
}
| hlx_event_errors hlx_event_register_callback_func | ( | hlx_event_manager * | manager, |
| unsigned long | id, | ||
| hlx_event_user_callback | func, | ||
| void * | user_data | ||
| ) |
Attach a callback to the given event
| manager | The event manager where the event is attached |
| id | The event Id (you can use hlx_hash) |
| func | The user callback. |
| user_data | User data in addition to the event data. |
Definition at line 110 of file events.c.
References hlx_event_register_callback_func_with_group().
{
return hlx_event_register_callback_func_with_group(public_manager, id, user_callback, user_data, 0);
}
| hlx_event_errors hlx_event_register_callback_func_with_group | ( | hlx_event_manager * | manager, |
| unsigned long | id, | ||
| hlx_event_user_callback | func, | ||
| void * | user_data, | ||
| hlx_group_id | group_id | ||
| ) |
Attach a callback to the given event. the callback will be called from the given group
| manager | The event manager where the event is attached |
| id | The event Id (you can use hlx_hash) |
| func | The user callback. |
| user_data | User data in addition to the event data. |
| group_id | The group where the callback will be called |
Definition at line 92 of file events.c.
References _hlx_event_register_callback_with_group(), _hlx_event_return_handler(), _hlx_event_params::callback, EV_ERROR_MEMORY_EXHAUSTED, EV_ERROR_UNDEFINED, _hlx_event_callback::func, hlx_api::malloc_entry, _hlx_event_callback::params, _hlx_event_callback::task, and _hlx_event_params::user_data.
Referenced by hlx_event_register_callback_func().
{
_hlx_event_manager* manager;
_hlx_event_handler* handler;
_hlx_event_callback* callback;
manager = (_hlx_event_manager*)public_manager;
if ((handler = _hlx_event_return_handler(manager, id)) == 0)
return (EV_ERROR_UNDEFINED);
if ((callback = gl_api.malloc_entry(sizeof(*callback))) == 0)
return (EV_ERROR_MEMORY_EXHAUSTED);
callback->func = user_callback;
callback->params.callback = 0;
callback->params.user_data = user_data;
callback->task = 0;
return (_hlx_event_register_callback_with_group(manager, handler, id, callback, group_id));
}
| hlx_event_errors hlx_event_register_callback_task | ( | hlx_event_manager * | manager, |
| unsigned long | id, | ||
| hlx_task_func | task, | ||
| void * | user_data | ||
| ) |
Attach a task to the given event
| manager | The event manager where the event is attached |
| id | The event Id (you can use hlx_hash) |
| task | The user task. |
| user_data | User data in addition to the event data. |
Definition at line 143 of file events.c.
References _hlx_event_register_callback_task_with_callback_and_group().
{
return _hlx_event_register_callback_task_with_callback_and_group(public_manager, id, user_callback, user_data, 0, 0);
}
| hlx_event_errors hlx_event_register_callback_task_with_group | ( | hlx_event_manager * | manager, |
| unsigned long | id, | ||
| hlx_task_func | task, | ||
| void * | user_data, | ||
| hlx_group_id | group_id | ||
| ) |
Attach a task to the given event. the task will be pushed in the given group
| manager | The event manager where the event is attached |
| id | The event Id (you can use hlx_hash) |
| task | The user task. |
| user_data | User data in addition to the event data. |
| group_id | The group where the task will be pushed |
Definition at line 138 of file events.c.
References _hlx_event_register_callback_task_with_callback_and_group().
{
return _hlx_event_register_callback_task_with_callback_and_group(public_manager, id, user_callback, user_data, 0, group_id);
}
hlx_event_manager* gl_event_manager = 0 [static] |
1.7.4