src/lib/xmmsipc/msg.c File Reference

#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <time.h>
#include <assert.h>
#include "xmmspriv/xmms_list.h"
#include "xmmsc/xmmsc_ipc_transport.h"
#include "xmmsc/xmmsc_ipc_msg.h"
#include "xmmsc/xmmsc_util.h"
#include "xmmsc/xmmsc_sockets.h"
#include "xmmsc/xmmsc_stdint.h"
#include "xmmsc/xmmsv_coll.h"

Go to the source code of this file.

Functions

void xmms_ipc_append_coll_attr (const char *key, const char *value, void *userdata)
void xmms_ipc_count_coll_attr (const char *key, const char *value, void *userdata)
xmms_ipc_msg_txmms_ipc_msg_alloc (void)
xmms_ipc_msg_txmms_ipc_msg_new (uint32_t object, uint32_t cmd)
void xmms_ipc_msg_destroy (xmms_ipc_msg_t *msg)
void xmms_ipc_msg_set_length (xmms_ipc_msg_t *msg, uint32_t len)
uint32_t xmms_ipc_msg_get_length (const xmms_ipc_msg_t *msg)
uint32_t xmms_ipc_msg_get_object (const xmms_ipc_msg_t *msg)
void xmms_ipc_msg_set_object (xmms_ipc_msg_t *msg, uint32_t object)
uint32_t xmms_ipc_msg_get_cmd (const xmms_ipc_msg_t *msg)
void xmms_ipc_msg_set_cmd (xmms_ipc_msg_t *msg, uint32_t cmd)
void xmms_ipc_msg_set_cookie (xmms_ipc_msg_t *msg, uint32_t cookie)
uint32_t xmms_ipc_msg_get_cookie (const xmms_ipc_msg_t *msg)
bool xmms_ipc_msg_write_transport (xmms_ipc_msg_t *msg, xmms_ipc_transport_t *transport, bool *disconnected)
 Try to write message to transport.
bool xmms_ipc_msg_read_transport (xmms_ipc_msg_t *msg, xmms_ipc_transport_t *transport, bool *disconnected)
 Try to read message from transport into msg.
uint32_t xmms_ipc_msg_put_bin (xmms_ipc_msg_t *msg, const unsigned char *data, unsigned int len)
uint32_t xmms_ipc_msg_put_error (xmms_ipc_msg_t *msg, const char *errmsg)
uint32_t xmms_ipc_msg_put_uint32 (xmms_ipc_msg_t *msg, uint32_t v)
void xmms_ipc_msg_store_uint32 (xmms_ipc_msg_t *msg, uint32_t offset, uint32_t v)
uint32_t xmms_ipc_msg_put_int32 (xmms_ipc_msg_t *msg, int32_t v)
uint32_t xmms_ipc_msg_put_float (xmms_ipc_msg_t *msg, float v)
uint32_t xmms_ipc_msg_put_string (xmms_ipc_msg_t *msg, const char *str)
uint32_t xmms_ipc_msg_put_collection (xmms_ipc_msg_t *msg, xmmsv_coll_t *coll)
uint32_t xmms_ipc_msg_put_value (xmms_ipc_msg_t *msg, xmmsv_t *v)
uint32_t xmms_ipc_msg_put_value_data (xmms_ipc_msg_t *msg, xmmsv_t *v)
uint32_t xmms_ipc_msg_put_value_list (xmms_ipc_msg_t *msg, xmmsv_t *v)
uint32_t xmms_ipc_msg_put_value_dict (xmms_ipc_msg_t *msg, xmmsv_t *v)
bool xmms_ipc_msg_get_error_alloc (xmms_ipc_msg_t *msg, char **buf, unsigned int *len)
bool xmms_ipc_msg_get_uint32 (xmms_ipc_msg_t *msg, uint32_t *v)
bool xmms_ipc_msg_get_int32 (xmms_ipc_msg_t *msg, int32_t *v)
bool xmms_ipc_msg_get_float (xmms_ipc_msg_t *msg, float *v)
bool xmms_ipc_msg_get_string_alloc (xmms_ipc_msg_t *msg, char **buf, unsigned int *len)
bool xmms_ipc_msg_get_bin_alloc (xmms_ipc_msg_t *msg, unsigned char **buf, unsigned int *len)
bool xmms_ipc_msg_get_string (xmms_ipc_msg_t *msg, char *buf, unsigned int maxlen)
bool xmms_ipc_msg_get_collection_alloc (xmms_ipc_msg_t *msg, xmmsv_coll_t **coll)
bool xmms_ipc_msg_get_value_alloc (xmms_ipc_msg_t *msg, xmmsv_t **val)
bool xmms_ipc_msg_get_value_of_type_alloc (xmms_ipc_msg_t *msg, xmmsv_type_t type, xmmsv_t **val)

Function Documentation

void xmms_ipc_append_coll_attr ( const char *  key,
const char *  value,
void *  userdata 
)

Definition at line 54 of file msg.c.

Referenced by xmms_ipc_msg_put_collection().

void xmms_ipc_count_coll_attr ( const char *  key,
const char *  value,
void *  userdata 
)

Definition at line 61 of file msg.c.

Referenced by xmms_ipc_msg_put_collection().

xmms_ipc_msg_t* xmms_ipc_msg_alloc ( void   ) 

Definition at line 68 of file msg.c.

Referenced by xmms_ipc_msg_new().

void xmms_ipc_msg_destroy ( xmms_ipc_msg_t msg  ) 

Definition at line 94 of file msg.c.

bool xmms_ipc_msg_get_bin_alloc ( xmms_ipc_msg_t msg,
unsigned char **  buf,
unsigned int *  len 
)

Definition at line 674 of file msg.c.

Referenced by xmms_ipc_msg_get_value_of_type_alloc().

uint32_t xmms_ipc_msg_get_cmd ( const xmms_ipc_msg_t msg  ) 

Definition at line 135 of file msg.c.

bool xmms_ipc_msg_get_collection_alloc ( xmms_ipc_msg_t msg,
xmmsv_coll_t **  coll 
)
uint32_t xmms_ipc_msg_get_cookie ( const xmms_ipc_msg_t msg  ) 

Definition at line 157 of file msg.c.

bool xmms_ipc_msg_get_error_alloc ( xmms_ipc_msg_t msg,
char **  buf,
unsigned int *  len 
)

Definition at line 599 of file msg.c.

Referenced by xmms_ipc_msg_get_value_of_type_alloc().

bool xmms_ipc_msg_get_float ( xmms_ipc_msg_t msg,
float *  v 
)

Todo:
do we need to convert?

Definition at line 635 of file msg.c.

bool xmms_ipc_msg_get_int32 ( xmms_ipc_msg_t msg,
int32_t *  v 
)

Definition at line 621 of file msg.c.

Referenced by xmms_ipc_msg_get_value_alloc(), and xmms_ipc_msg_get_value_of_type_alloc().

uint32_t xmms_ipc_msg_get_length ( const xmms_ipc_msg_t msg  ) 
uint32_t xmms_ipc_msg_get_object ( const xmms_ipc_msg_t msg  ) 

Definition at line 119 of file msg.c.

bool xmms_ipc_msg_get_string ( xmms_ipc_msg_t msg,
char *  buf,
unsigned int  maxlen 
)

Definition at line 705 of file msg.c.

bool xmms_ipc_msg_get_string_alloc ( xmms_ipc_msg_t msg,
char **  buf,
unsigned int *  len 
)
bool xmms_ipc_msg_get_uint32 ( xmms_ipc_msg_t msg,
uint32_t *  v 
)
bool xmms_ipc_msg_get_value_alloc ( xmms_ipc_msg_t msg,
xmmsv_t **  val 
)

Definition at line 895 of file msg.c.

bool xmms_ipc_msg_get_value_of_type_alloc ( xmms_ipc_msg_t msg,
xmmsv_type_t  type,
xmmsv_t **  val 
)

Definition at line 907 of file msg.c.

Referenced by xmms_ipc_msg_get_value_alloc().

xmms_ipc_msg_t* xmms_ipc_msg_new ( uint32_t  object,
uint32_t  cmd 
)

Definition at line 81 of file msg.c.

uint32_t xmms_ipc_msg_put_bin ( xmms_ipc_msg_t msg,
const unsigned char *  data,
unsigned int  len 
)

Definition at line 313 of file msg.c.

Referenced by xmms_ipc_msg_put_value_data().

uint32_t xmms_ipc_msg_put_collection ( xmms_ipc_msg_t msg,
xmmsv_coll_t coll 
)

Definition at line 386 of file msg.c.

Referenced by xmms_ipc_msg_put_collection(), and xmms_ipc_msg_put_value_data().

uint32_t xmms_ipc_msg_put_error ( xmms_ipc_msg_t msg,
const char *  errmsg 
)

Definition at line 322 of file msg.c.

Referenced by xmms_ipc_msg_put_value_data().

uint32_t xmms_ipc_msg_put_float ( xmms_ipc_msg_t msg,
float  v 
)

Todo:
do we need to convert ?

Definition at line 363 of file msg.c.

uint32_t xmms_ipc_msg_put_int32 ( xmms_ipc_msg_t msg,
int32_t  v 
)

Definition at line 355 of file msg.c.

Referenced by xmms_ipc_msg_put_value(), and xmms_ipc_msg_put_value_data().

uint32_t xmms_ipc_msg_put_string ( xmms_ipc_msg_t msg,
const char *  str 
)
uint32_t xmms_ipc_msg_put_uint32 ( xmms_ipc_msg_t msg,
uint32_t  v 
)
uint32_t xmms_ipc_msg_put_value ( xmms_ipc_msg_t msg,
xmmsv_t *  v 
)

Definition at line 441 of file msg.c.

Referenced by xmms_ipc_msg_put_value_dict(), and xmms_ipc_msg_put_value_list().

uint32_t xmms_ipc_msg_put_value_data ( xmms_ipc_msg_t msg,
xmmsv_t *  v 
)

Definition at line 452 of file msg.c.

Referenced by xmms_ipc_msg_put_value().

uint32_t xmms_ipc_msg_put_value_dict ( xmms_ipc_msg_t msg,
xmmsv_t *  v 
)

Definition at line 550 of file msg.c.

Referenced by xmms_ipc_msg_put_value_data().

uint32_t xmms_ipc_msg_put_value_list ( xmms_ipc_msg_t msg,
xmmsv_t *  v 
)

Definition at line 522 of file msg.c.

Referenced by xmms_ipc_msg_put_value_data().

bool xmms_ipc_msg_read_transport ( xmms_ipc_msg_t msg,
xmms_ipc_transport_t transport,
bool *  disconnected 
)

Try to read message from transport into msg.

Returns:
TRUE if message is fully read.

Definition at line 218 of file msg.c.

void xmms_ipc_msg_set_cmd ( xmms_ipc_msg_t msg,
uint32_t  cmd 
)

Definition at line 143 of file msg.c.

Referenced by xmms_ipc_msg_new().

void xmms_ipc_msg_set_cookie ( xmms_ipc_msg_t msg,
uint32_t  cookie 
)

Definition at line 151 of file msg.c.

void xmms_ipc_msg_set_length ( xmms_ipc_msg_t msg,
uint32_t  len 
)

Definition at line 103 of file msg.c.

void xmms_ipc_msg_set_object ( xmms_ipc_msg_t msg,
uint32_t  object 
)

Definition at line 127 of file msg.c.

Referenced by xmms_ipc_msg_new().

void xmms_ipc_msg_store_uint32 ( xmms_ipc_msg_t msg,
uint32_t  offset,
uint32_t  v 
)

Definition at line 346 of file msg.c.

Referenced by xmms_ipc_msg_put_value_dict(), and xmms_ipc_msg_put_value_list().

bool xmms_ipc_msg_write_transport ( xmms_ipc_msg_t msg,
xmms_ipc_transport_t transport,
bool *  disconnected 
)

Try to write message to transport.

If full message isn't written the message will keep track of the amount of data written and not write already written data next time.

Returns:
TRUE if full message was written, FALSE otherwise. disconnected is set if transport was disconnected

Definition at line 173 of file msg.c.


Generated on 29 Dec 2009 for XMMS2 by  doxygen 1.6.1