![]() |
Helixis 1.0
Task Programming API
|
Go to the source code of this file.
Defines | |
#define | HLX_CHAN_WRITE(chan, value, type) HLX_TASK_YIELD_UNTIL(__hlx_chan_write_##type(chan, (type)value) > 0); |
#define | HLX_CHAN_READ(chan, var_ptr, type) HLX_TASK_YIELD_UNTIL(__hlx_chan_read_##type(chan, (type *)var_ptr) > 0); |
#define | HLX_CHAN_WRITE_PTR(chan, value) HLX_TASK_YIELD_UNTIL(__hlx_chan_write_ptr(chan, (void *)value) > 0); |
#define | HLX_CHAN_READ_PTR(chan, var_ptr) HLX_TASK_YIELD_UNTIL(__hlx_chan_read_ptr(chan, (void **)var_ptr) > 0); |
Enumerations | |
enum | hlx_channel_errors { CHAN_ERROR_SUCCESS = 0, CHAN_ERROR_INTERNAL_ERROR = 1, CHAN_ERROR_MEMORY_EXHAUSTED = 2, CHAN_ERROR_ALREADY_EXISTS = 3, CHAN_ERROR_UNDEFINED = 4, CHAN_ERROR_NOT_EXISTS = 5 } |
Functions | |
hlx_channel_errors | hlx_chan_create (unsigned long id) |
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_short (unsigned long id, short value) |
int | __hlx_chan_read_short (unsigned long id, short *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) |
#define HLX_CHAN_READ | ( | chan, | |
var_ptr, | |||
type | |||
) | HLX_TASK_YIELD_UNTIL(__hlx_chan_read_##type(chan, (type *)var_ptr) > 0); |
Definition at line 54 of file channels.h.
#define HLX_CHAN_READ_PTR | ( | chan, | |
var_ptr | |||
) | HLX_TASK_YIELD_UNTIL(__hlx_chan_read_ptr(chan, (void **)var_ptr) > 0); |
Definition at line 57 of file channels.h.
#define HLX_CHAN_WRITE | ( | chan, | |
value, | |||
type | |||
) | HLX_TASK_YIELD_UNTIL(__hlx_chan_write_##type(chan, (type)value) > 0); |
Definition at line 53 of file channels.h.
#define HLX_CHAN_WRITE_PTR | ( | chan, | |
value | |||
) | HLX_TASK_YIELD_UNTIL(__hlx_chan_write_ptr(chan, (void *)value) > 0); |
Definition at line 56 of file channels.h.
enum hlx_channel_errors |
CHAN_ERROR_SUCCESS | |
CHAN_ERROR_INTERNAL_ERROR | |
CHAN_ERROR_MEMORY_EXHAUSTED | |
CHAN_ERROR_ALREADY_EXISTS | |
CHAN_ERROR_UNDEFINED | |
CHAN_ERROR_NOT_EXISTS |
Definition at line 39 of file channels.h.
{ CHAN_ERROR_SUCCESS = 0, CHAN_ERROR_INTERNAL_ERROR = 1, CHAN_ERROR_MEMORY_EXHAUSTED = 2, CHAN_ERROR_ALREADY_EXISTS = 3, CHAN_ERROR_UNDEFINED = 4, CHAN_ERROR_NOT_EXISTS = 5 } hlx_channel_errors;
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.
{
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); }