XmmsClient
|
Functions for integrating the xmms client library with an existing mainloop. More...
Functions | |
int | xmmsc_io_want_out (xmmsc_connection_t *c) |
Check for pending output. More... | |
int | xmmsc_io_out_handle (xmmsc_connection_t *c) |
Write pending data. More... | |
int | xmmsc_io_in_handle (xmmsc_connection_t *c) |
Read available data. More... | |
int | xmmsc_io_fd_get (xmmsc_connection_t *c) |
Retrieve filedescriptor for connection. More... | |
void | xmmsc_io_need_out_callback_set (xmmsc_connection_t *c, void(*callback)(int, void *), void *userdata) |
Set callback for enabling/disabling writing. More... | |
void | xmmsc_io_need_out_callback_set_full (xmmsc_connection_t *c, void(*callback)(int, void *), void *userdata, xmmsc_user_data_free_func_t free_func) |
void | xmmsc_io_disconnect (xmmsc_connection_t *c) |
Flag connection as disconnected. More... | |
Functions for integrating the xmms client library with an existing mainloop.
Only to be used if there isn't already integration written (glib, corefoundation or ecore).
void xmmsc_io_disconnect | ( | xmmsc_connection_t * | c | ) |
Flag connection as disconnected.
To be called when the mainloop signals disconnection of the connection. This is optional, any call to xmmsc_io_out_handle or xmmsc_io_in_handle will notice the disconnection and handle it accordingly.
int xmmsc_io_fd_get | ( | xmmsc_connection_t * | c | ) |
Retrieve filedescriptor for connection.
Gets the underlaying filedescriptor for this connection, or -1 upon error. To be used in a mainloop to do poll/select on. Reading writing should NOT be done on this fd, xmmsc_io_in_handle and xmmsc_io_out_handle MUST be used to handle reading and writing.
int xmmsc_io_in_handle | ( | xmmsc_connection_t * | c | ) |
Read available data.
Should be called when the mainloop flags that reading is available on the socket.
void xmmsc_io_need_out_callback_set | ( | xmmsc_connection_t * | c, |
void(*)(int, void *) | callback, | ||
void * | userdata | ||
) |
Set callback for enabling/disabling writing.
If the mainloop doesn't provide a mechanism to run code before each iteration this function allows registration of a callback to be called when output is needed or not needed any more. The arguments to the callback are flag and userdata; flag is 1 if output is wanted, 0 if not.
void xmmsc_io_need_out_callback_set_full | ( | xmmsc_connection_t * | c, |
void(*)(int, void *) | callback, | ||
void * | userdata, | ||
xmmsc_user_data_free_func_t | free_func | ||
) |
Referenced by xmmsc_io_need_out_callback_set().
int xmmsc_io_out_handle | ( | xmmsc_connection_t * | c | ) |
Write pending data.
Should be called when the mainloop flags that writing is available on the socket.
int xmmsc_io_want_out | ( | xmmsc_connection_t * | c | ) |
Check for pending output.
Used to determine if there is any outgoing data enqueued and the mainloop should flag this socket for writing.
c | connection to check |