gre_io_open
gre_io_t* gre_io_open(
const char * io_name,
int flag
)
Open a Storyboard IO communication channel using a named connection.
Parameters
| Parameter | Type | Description |
|---|---|---|
io_name | const char * | The name of the io-channel to use. |
flag | int | The mode to open the channel in. See below for possible flags. |
Flags
Flags define how the connection is opened. Possible flags are:
| Flag | Description |
|---|---|
GRE_IO_TYPE_RDONLY | open read only, creating the channel if it doesn't exist. |
GRE_IO_TYPE_XRDONLY | open for exclusive read, unlinking an existing channel and creating a new one. |
GRE_IO_TYPE_WRONLY | open write only. |
GRE_IO_FLAG_NONBLOCK | open non-blocking. |
Returns
| Type | Description |
|---|---|
gre_io_t* | Returns a valid Storyboard IO handle or NULL if no channel can be created. |
Example
To pass multiple flags in the same aregument, just separate by a bitwise-or. i.e:
gre_io_open(THERMOSTAT_RECEIVE_CHANNEL, GRE_IO_TYPE_RDONLY | GRE_IO_FLAG_NONBLOCK);