IOFunctions
[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.
int xmmsc_io_out_handle (xmmsc_connection_t *c)
 Write pending data.
int xmmsc_io_in_handle (xmmsc_connection_t *c)
 Read available data.
int xmmsc_io_fd_get (xmmsc_connection_t *c)
 Retrieve filedescriptor for connection.
void xmmsc_io_need_out_callback_set (xmmsc_connection_t *c, void(*callback)(int, void *), void *userdata)
 Set callback for enabling/disabling writing.
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.

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.

Definition at line 564 of file xmmsclient.c.

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

Definition at line 525 of file xmmsclient.c.

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.

Definition at line 506 of file xmmsclient.c.

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.

Definition at line 542 of file xmmsclient.c.

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 
)

Definition at line 548 of file xmmsclient.c.

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.

Returns:
1 if everything is well, 0 if the connection is broken.

Definition at line 489 of file xmmsclient.c.

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:
c connection to check
Returns:
1 output is requested, 0 otherwise
See also:
xmmsc_io_need_out_callback_set

Definition at line 473 of file xmmsclient.c.


Generated on Tue Feb 23 18:17:57 2010 for XmmsClient by  doxygen 1.6.1