Storyboard IO API
This section details the functions available in the Storyboard IO library, libgreio.a. They are also documented in the Storyboard IO header file
gre/greio.h>.
gre_io_close
Close an io connection. Any pending clients will return with an error on their pending actions. This call should be serialized with other clients that are referencing the same greiot handle to avoid race conditions. A common technique for closing handles where a receiving thread may be blocked on the handle is to generate a termination event and have the receiving thread perform the close and channel cleanup.
gre_io_free_buffer
This de-allocates the memory associated with a buffer created through the Storyboard IO API.
gre_io_get_error_codes
This gets the error codes if greio experiences an error.
gre_io_get_error_message
This gets the error message for an error code returned by a call to greiogeterrorcodes.
gre_io_grow_buffer
This function attempts to expand the internal capacity of the Storyboard IO transport to ensure that the payload contained within serialized buffer can be transmitted.
gre_io_open
Open a Storyboard IO communication channel using a named connection.
gre_io_receive
Receive a serialized event from a channel. By default this call blocks until an event is received or until the channel is destroyed unless the GREIOFLAGNONBLOCK flag was passed to the greio_open()call.
gre_io_send
Send a serialized event buffer to a channel. In order to send events, the handle must have been opened for writing using GREIOWRONLY.
gre_io_serialize
Serialize individual event items (see gre/io_mgr.h) into a single buffer for transmission using Storyboard IO.
gre_io_size_buffer
This function ensures that the specified buffer has enough internal storage capacity for a payload of nbytes size. If the buffer is NULL or the existing capacity is not large enough then a new memory buffer will be assigned to the buffer object.
gre_io_unserialize
Transform a serialized buffer into individual event items (see gre/io_mgr.h). The pointers returned point back into the content of the serialized buffer so the buffer can't be de-allocated until clients are finished referencing the event items returned from this call.
gre_io_zero_buffer
This clears the internal byte count of the buffer, but does not de-allocate the buffer's memory.