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

Detailed Description

Typedef Documentation

◆ xmmsv_t

typedef struct xmmsv_St xmmsv_t

Definition at line 48 of file xmmsv_general.h.

Enumeration Type Documentation

◆ xmmsv_type_t

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

◆ xmmsv_get_bin()

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(), and xmmsv_deserialize().

◆ xmmsv_get_coll()

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.

◆ xmmsv_get_error()

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.

◆ xmmsv_get_int()

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_playlist_changed_msg_send(), and xmmsv_dict_format().

◆ xmmsv_get_string()

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(), xmmsv_decode_url(), xmmsv_dict_format(), xmmsv_dict_iter_find(), and xmmsv_dict_iter_pair().

◆ xmmsv_get_type()

xmmsv_type_t xmmsv_get_type ( const xmmsv_t val)

Get the type of the value.

Parameters
vala xmmsv_t to get the type from.
Returns
The data type in the value.

Definition at line 392 of file value.c.

Referenced by check_string_list(), xmmsv_bitbuffer_serialize_value(), xmmsv_dict_entry_get_type(), xmmsv_dict_format(), and xmmsv_is_type().

◆ xmmsv_is_error()

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.

◆ xmmsv_is_type()

int xmmsv_is_type ( const xmmsv_t val,
xmmsv_type_t  t 
)

◆ xmmsv_new_bin()

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

◆ xmmsv_new_coll()

xmmsv_t* xmmsv_new_coll ( xmmsv_coll_t c)

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.

◆ xmmsv_new_error()

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_new_int()

xmmsv_t* xmmsv_new_int ( int32_t  i)

◆ xmmsv_new_none()

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_new_string()

xmmsv_t* xmmsv_new_string ( const char *  s)

◆ xmmsv_ref()

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.

◆ xmmsv_unref()

void xmmsv_unref ( xmmsv_t val)