Classes | |
union | ix_qio_ctrl_t |
Typedefs | |
typedef ix_qio_s | ix_qio_t |
typedef ix_qio_hook_e(*) | IX_QIO_SAVE_FCT (unsigned char *input, int len, void *userarg) |
Enumerations | |
enum | ix_qio_ctrl_e { IX_QIO_MAXLEN = 0x01, IX_QIO_DELIM = 0x02 } |
enum | ix_qio_hook_e { IX_QIO_HOOK_BUFFER_REUSE = 0x01, IX_QIO_HOOK_BUFFER_LOCKED = 0x02, IX_QIO_HOOK_ERROR = 0xF0000 } |
Functions | |
ix_qio_t * | ix_qio_new (int fd, int ctrl_tag, ix_qio_ctrl_t ctrl_info, size_t maxlen) |
int | ix_qio_reopen (ix_qio_t *pqio, int fd) |
int | ix_qio_receive (ix_qio_t *pqio, IX_QIO_SAVE_FCT save_fct, void *userarg) |
int | ix_qio_msg (ix_qio_t *pqio, ix_msg_queue_t *pmq) |
ix_msg_queue_t * | ix_qio_getmsg (ix_qio_t *pqio) |
int | ix_qio_issetup (ix_qio_t *pqio) |
int | ix_qio_isvalid (ix_qio_t *pqio) |
int | ix_qio_getfd (ix_qio_t *pqio) |
void | ix_qio_free (ix_qio_t *pqio) |
typedef ix_qio_hook_e( *) IX_QIO_SAVE_FCT(unsigned char *input, int len, void *userarg) |
Hook function to receive QIO buffered data, see ix_qio_receive If the hook function returns IX_QIO_BUFFER_REUSE , the input buffer is again used internally. If return value is IX_QIO_BUFFER_LOCKED, the caller has to deal with the memory pointer !!! If input is NULL, error occured and file will be closed. You can signal your thread to reopen QIO but !!not!! in this callback
userarg | User argument for hook function |
typedef struct ix_qio_s ix_qio_t |
handler for queued IO
enum ix_qio_ctrl_e |
tag for QIO control structure
enum ix_qio_hook_e |
return codes for QIO hook
void ix_qio_free | ( | ix_qio_t * | pqio | ) |
free QIO object
pqio | handle of QIO object |
int ix_qio_getfd | ( | ix_qio_t * | pqio | ) |
Get the file descriptor of the qio object
pqio | Handle of QIO object |
ix_msg_queue_t* ix_qio_getmsg | ( | ix_qio_t * | pqio | ) |
Get the message queue of the qio object
pqio | Handle of QIO object |
int ix_qio_issetup | ( | ix_qio_t * | pqio | ) |
Returns true if the qio object is setup via qio_msg or qio_receive
pqio | Handle of QIO object |
int ix_qio_isvalid | ( | ix_qio_t * | pqio | ) |
Returns true if the qio object's file descriptor is valid
pqio | Handle of QIO object |
int ix_qio_msg | ( | ix_qio_t * | pqio, | |
ix_msg_queue_t * | pmq | |||
) |
Set up and kick receiving on QIO. Store to message queue when input is complete, The entries in the message queue are of type ix_buffer_t and have to be freed using ix_buffer_free(). An empty buffer signals error on file input.
pqio | Handle of QIO object | |
pmq | Handle of message queue to feed when input complete |
ix_qio_t* ix_qio_new | ( | int | fd, | |
int | ctrl_tag, | |||
ix_qio_ctrl_t | ctrl_info, | |||
size_t | maxlen | |||
) |
Creates new queued IO object
fd | File descriptor to buffer input from | |
ctrl_tag | Type of control structure see ix_qio_ctrl_e, ix_qio_ctrl_t | |
pctrl_info | Address of control info structure | |
maxlen | maximal size of data queued |
int ix_qio_receive | ( | ix_qio_t * | pqio, | |
IX_QIO_SAVE_FCT | save_fct, | |||
void * | userarg | |||
) |
Set up and kick receiving on QIO handle. Call hook when input is complete. Note: Don't mix calls to ix_qio_receive() and ix_qio_msg().
pqio | Handle of QIO object | |
save_fct | This hook function is called internally when input is complete. Note: This function should only be used to save the input buffer and e.g. trigger some event, processing of input should then take elsewhere. e.g. in event receive loop. |
int ix_qio_reopen | ( | ix_qio_t * | pqio, | |
int | fd | |||
) |
Reopens QIO object after file error
pqio | Handle of QIO object | |
fd | File descriptor to buffer input from |