XMMS2
Modules | Typedefs | Enumerations | Functions
The type xmmsv_t

Modules

 Bitbuffer
 Easier building of lists and dictionaries
 Deprecated
 Dictionaries
 Lists
 Utilities

Typedefs

typedef struct xmmsv_St xmmsv_t

Enumerations

enum  xmmsv_type_t {
  XMMSV_TYPE_NONE, XMMSV_TYPE_ERROR, XMMSV_TYPE_INT32, XMMSV_TYPE_STRING,
  XMMSV_TYPE_COLL, XMMSV_TYPE_BIN, XMMSV_TYPE_LIST, XMMSV_TYPE_DICT,
  XMMSV_TYPE_BITBUFFER, XMMSV_TYPE_END
}

Functions

xmmsv_txmmsv_new_none (void)
 Allocates a new empty xmmsv_t.
xmmsv_txmmsv_new_error (const char *errstr)
 Allocates a new error xmmsv_t.
xmmsv_txmmsv_new_int (int32_t i)
 Allocates a new integer xmmsv_t.
xmmsv_txmmsv_new_string (const char *s)
 Allocates a new string xmmsv_t.
xmmsv_txmmsv_new_coll (xmmsv_coll_t *coll)
 Allocates a new collection xmmsv_t.
xmmsv_txmmsv_new_bin (const unsigned char *data, unsigned int len)
 Allocates a new binary data xmmsv_t.
xmmsv_txmmsv_ref (xmmsv_t *val)
 References the xmmsv_t.
void xmmsv_unref (xmmsv_t *val)
 Decreases the references for the xmmsv_t When the number of references reaches 0 it will be freed.
xmmsv_type_t xmmsv_get_type (const xmmsv_t *val)
 Get the type of the value.
int xmmsv_is_type (const xmmsv_t *val, xmmsv_type_t t)
 Check if value is of specified type.
int xmmsv_get_error (const xmmsv_t *val, const char **r)
 Retrieves an error string describing the server error from the value.
int xmmsv_get_int (const xmmsv_t *val, int32_t *r)
 Retrieves a signed integer from the value.
int xmmsv_get_string (const xmmsv_t *val, const char **r)
 Retrieves a string from the value.
int xmmsv_get_coll (const xmmsv_t *val, xmmsv_coll_t **coll)
 Retrieves a collection from the value.
int xmmsv_get_bin (const xmmsv_t *val, const unsigned char **r, unsigned int *rlen)
 Retrieves binary data from the value.
int xmmsv_is_error (const xmmsv_t *val)
 Check if the value stores an error.

Typedef Documentation

typedef struct xmmsv_St xmmsv_t

Definition at line 48 of file xmmsv_general.h.


Enumeration Type Documentation

Enumerator:
XMMSV_TYPE_NONE 
XMMSV_TYPE_ERROR 
XMMSV_TYPE_INT32 
XMMSV_TYPE_STRING 
XMMSV_TYPE_COLL 
XMMSV_TYPE_BIN 
XMMSV_TYPE_LIST 
XMMSV_TYPE_DICT 
XMMSV_TYPE_BITBUFFER 
XMMSV_TYPE_END 

Definition at line 35 of file xmmsv_general.h.


Function Documentation

int xmmsv_get_bin ( const xmmsv_t val,
const unsigned char **  r,
unsigned int *  rlen 
)

Retrieves binary data from the value.

Parameters:
vala xmmsv_t containing a string.
rthe return data. This data is owned by the value and will be freed when the value is freed.
rlenthe return length of data.
Returns:
1 upon success otherwise 0

Definition at line 904 of file value.c.

Referenced by xmms_bin_to_gstring(), xmms_xform_auxdata_get_bin(), xmmsv_bitbuffer_serialize_value(), and xmmsv_deserialize().

int xmmsv_get_coll ( const xmmsv_t val,
xmmsv_coll_t **  c 
)

Retrieves a collection from the value.

Parameters:
vala xmmsv_t containing a collection.
cthe return collection. This collection is owned by the value and will be unref'd when the value is freed.
Returns:
1 upon success otherwise 0

Definition at line 883 of file value.c.

Referenced by xmmsv_bitbuffer_serialize_value().

int xmmsv_get_error ( const xmmsv_t val,
const char **  r 
)

Retrieves an error string describing the server error from the value.

Parameters:
vala xmmsv_t containing a integer.
rthe return error.
Returns:
1 upon success otherwise 0

Definition at line 804 of file value.c.

Referenced by xmmsv_bitbuffer_serialize_value().

int xmmsv_get_int ( const xmmsv_t val,
int32_t *  r 
)

Retrieves a signed integer from the value.

Parameters:
vala xmmsv_t containing an integer.
rthe return integer.
Returns:
1 upon success otherwise 0

Definition at line 823 of file value.c.

Referenced by xmms_collection_get_random_media(), xmms_collection_query_ids(), xmms_playlist_changed_msg_send(), xmms_xform_auxdata_get_int(), xmms_xform_metadata_get_int(), xmmsv_bitbuffer_serialize_value(), and xmmsv_dict_format().

int xmmsv_get_string ( const xmmsv_t val,
const char **  r 
)

Retrieves a string from the value.

Parameters:
vala xmmsv_t containing a string.
rthe return string. This string is owned by the value and will be freed when the value is freed.
Returns:
1 upon success otherwise 0

Definition at line 863 of file value.c.

Referenced by xmms_playlist_changed_msg_send(), xmms_xform_auxdata_get_str(), xmms_xform_metadata_get_str(), xmmsv_bitbuffer_serialize_value(), xmmsv_decode_url(), xmmsv_dict_format(), xmmsv_dict_iter_find(), and xmmsv_dict_iter_pair().

int xmmsv_is_error ( const xmmsv_t val)

Check if the value stores an error.

Parameters:
vala xmmsv_t
Returns:
1 if error was encountered, 0 otherwise.

Definition at line 425 of file value.c.

int xmmsv_is_type ( const xmmsv_t val,
xmmsv_type_t  t 
)
xmmsv_t* xmmsv_new_bin ( const unsigned char *  data,
unsigned int  len 
)

Allocates a new binary data xmmsv_t.

Parameters:
dataThe data to store in the xmmsv_t.
lenThe size of the data.
Returns:
The new xmmsv_t. Must be unreferenced with

xmmsv_unref.

Definition at line 225 of file value.c.

Referenced by xmms_xform_auxdata_set_bin(), xmmsv_decode_url(), and xmmsv_serialize().

Allocates a new collection xmmsv_t.

Parameters:
sThe value to store in the xmmsv_t.
Returns:
The new xmmsv_t. Must be unreferenced with

xmmsv_unref.

Definition at line 202 of file value.c.

Referenced by xmmsv_coll_add_operand().

xmmsv_t* xmmsv_new_error ( const char *  errstr)

Allocates a new error xmmsv_t.

Parameters:
sThe error message to store in the xmmsv_t. The string is copied in the value.
Returns:
The new xmmsv_t. Must be unreferenced with

xmmsv_unref.

Definition at line 143 of file value.c.

xmmsv_t* xmmsv_new_int ( int32_t  i)
xmmsv_t* xmmsv_new_none ( void  )

Allocates a new empty xmmsv_t.

Returns:
The new xmmsv_t. Must be unreferenced with

xmmsv_unref.

Definition at line 129 of file value.c.

Referenced by xmms_object_emit_f(), and xmms_xform_auxdata_barrier().

xmmsv_t* xmmsv_new_string ( const char *  s)
xmmsv_t* xmmsv_ref ( xmmsv_t val)

References the xmmsv_t.

Parameters:
valthe value to reference.
Returns:
val

Definition at line 288 of file value.c.

Referenced by xmmsv_list_set().

void xmmsv_unref ( xmmsv_t val)