XmmsClient
Functions
IOFunctions

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...
 

Detailed Description

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).

Function Documentation

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.

Returns
underlaying filedescriptor, or -1 on error
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.

Returns
1 if everything is well, 0 if the connection is broken.
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 
)
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.

Returns
1 if everything is well, 0 if the connection is broken.
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.

Parameters
cconnection to check
Returns
1 output is requested, 0 otherwise
See Also
xmmsc_io_need_out_callback_set