![]() |
Helixis 1.0
Task Programming API
|
Go to the source code of this file.
Functions | |
static _hlx_channel * | _hlx_get_channel_by_hash (unsigned long id) |
int | __hlx_chan_write_short (unsigned long id, short value) |
int | __hlx_chan_read_short (unsigned long id, short *value) |
int | __hlx_chan_write_int (unsigned long id, int value) |
int | __hlx_chan_read_int (unsigned long id, int *value) |
int | __hlx_chan_write_char (unsigned long id, char value) |
int | __hlx_chan_read_char (unsigned long id, char *value) |
int | __hlx_chan_write_float (unsigned long id, float value) |
int | __hlx_chan_read_float (unsigned long id, float *value) |
int | __hlx_chan_write_ptr (unsigned long id, void *value) |
int | __hlx_chan_read_ptr (unsigned long id, void **value) |
hlx_channel_errors | hlx_chan_create (unsigned long id) |
void | _init_channel_manager (void) |
void | _destroy_channel_manager (void) |
Variables | |
hlx_api | gl_api |
static _hlx_channel_manager | gl_channel_manager |
int __hlx_chan_read_char | ( | unsigned long | id, |
char * | value | ||
) |
Definition at line 75 of file parallel_channels.c.
{
int __hlx_chan_read_float | ( | unsigned long | id, |
float * | value | ||
) |
Definition at line 78 of file parallel_channels.c.
{
int __hlx_chan_read_int | ( | unsigned long | id, |
int * | value | ||
) |
Definition at line 72 of file parallel_channels.c.
{
int __hlx_chan_read_ptr | ( | unsigned long | id, |
void ** | value | ||
) |
Definition at line 81 of file parallel_channels.c.
{
int __hlx_chan_read_short | ( | unsigned long | id, |
short * | value | ||
) |
Definition at line 69 of file parallel_channels.c.
{
int __hlx_chan_write_char | ( | unsigned long | id, |
char | value | ||
) |
Definition at line 74 of file parallel_channels.c.
{
int __hlx_chan_write_float | ( | unsigned long | id, |
float | value | ||
) |
Definition at line 77 of file parallel_channels.c.
{
int __hlx_chan_write_int | ( | unsigned long | id, |
int | value | ||
) |
Definition at line 71 of file parallel_channels.c.
{
int __hlx_chan_write_ptr | ( | unsigned long | id, |
void * | value | ||
) |
Definition at line 80 of file parallel_channels.c.
{
int __hlx_chan_write_short | ( | unsigned long | id, |
short | value | ||
) |
Definition at line 68 of file parallel_channels.c.
{
void _destroy_channel_manager | ( | void | ) |
Definition at line 107 of file parallel_channels.c.
References _hlx_channel_manager::channels, hlx_api::free_entry, slist_delete(), slist_get_head_and_then_next(), and slist_get_user_data_from_element().
Referenced by hlx_core_destroy().
{ struct slist_element* it; _hlx_channel* chan; it = 0; while (slist_get_head_and_then_next(gl_channel_manager.channels, &it)) { slist_get_user_data_from_element(it, (void **)&chan); gl_api.free_entry(chan); } slist_delete(gl_channel_manager.channels); }
static _hlx_channel* _hlx_get_channel_by_hash | ( | unsigned long | id | ) | [static] |
Definition at line 56 of file parallel_channels.c.
References _hlx_channel_manager::channels, slist_get_head_and_then_next(), and slist_get_user_data_from_element().
Referenced by hlx_chan_create().
{ _hlx_channel* chan; struct slist_element* it; it = 0; while (slist_get_head_and_then_next(gl_channel_manager.channels, &it)) if (slist_get_user_data_from_element(it, (void **)&chan) && chan->hash_code == id) return (chan); return (0); }
void _init_channel_manager | ( | void | ) |
Definition at line 102 of file parallel_channels.c.
References _hlx_channel_manager::channels, and slist_new().
Referenced by hlx_core_init().
{ slist_new(&gl_channel_manager.channels, 0, 0); }
hlx_channel_errors hlx_chan_create | ( | unsigned long | id | ) |
Create a new channel
id | Channel ID. |
Definition at line 83 of file parallel_channels.c.
References _hlx_get_channel_by_hash(), CHAN_ERROR_ALREADY_EXISTS, CHAN_ERROR_MEMORY_EXHAUSTED, CHAN_ERROR_SUCCESS, _hlx_channel_manager::channels, EV_ERROR_MEMORY_EXHAUSTED, hlx_api::free_entry, _hlx_channel::hash_code, HLX_CHAN_AVAILABLE, hlx_api::malloc_entry, slist_new(), slist_new_head(), and _hlx_channel::status.
{ _hlx_channel *chan; chan = _hlx_get_channel_by_hash(id); if (chan != 0) return (CHAN_ERROR_ALREADY_EXISTS); if ((chan = gl_api.malloc_entry(sizeof(_hlx_channel))) == 0) return (CHAN_ERROR_MEMORY_EXHAUSTED); chan->hash_code = id; chan->status = HLX_CHAN_AVAILABLE; if (slist_new(&gl_channel_manager.channels, 0, 0) == 0 || slist_new_head(gl_channel_manager.channels, chan) == 0) { gl_api.free_entry(chan); return (EV_ERROR_MEMORY_EXHAUSTED); } return (CHAN_ERROR_SUCCESS); }
_hlx_channel_manager gl_channel_manager [static] |
Definition at line 50 of file parallel_channels.c.