XMMS2
Modules | Macros | Typedefs | Enumerations | Functions
The type xmmsv_t

Modules

 Bitbuffer
 
 Easier building of lists and dictionaries
 
 Deprecated
 
 Dictionaries
 
 Lists
 
 Utilities
 
 Collections
 The API to be used to work with collection structures.
 

Macros

#define XMMSV_TYPE_INT32   XMMSV_TYPE_INT64
 
#define xmmsv_get_int   xmmsv_get_int32
 

Typedefs

typedef struct xmmsv_St xmmsv_t
 

Enumerations

enum  xmmsv_type_t {
  XMMSV_TYPE_NONE, XMMSV_TYPE_ERROR, XMMSV_TYPE_INT64, XMMSV_TYPE_STRING,
  XMMSV_TYPE_COLL, XMMSV_TYPE_BIN, XMMSV_TYPE_LIST, XMMSV_TYPE_DICT,
  XMMSV_TYPE_BITBUFFER, XMMSV_TYPE_FLOAT, 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 (int64_t i)
 Allocates a new integer xmmsv_t. More...
 
xmmsv_txmmsv_new_float (float i)
 Allocates a new float xmmsv_t. More...
 
xmmsv_txmmsv_new_string (const char *s)
 Allocates a new string xmmsv_t. More...
 
xmmsv_txmmsv_new_bin (const unsigned char *data, unsigned int len)
 Allocates a new binary data xmmsv_t. More...
 
xmmsv_txmmsv_copy (xmmsv_t *val)
 Return a new value object which is a deep copy of the input value. More...
 
xmmsv_txmmsv_coll_copy (xmmsv_t *orig_coll)
 
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_int32 (const xmmsv_t *val, int32_t *r)
 Retrieves a signed integer from the value. More...
 
int xmmsv_get_int64 (const xmmsv_t *val, int64_t *r)
 Retrieves a signed integer from the value. More...
 
int xmmsv_get_float (const xmmsv_t *val, float *r)
 Retrieves a float 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_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

Macro Definition Documentation

#define xmmsv_get_int   xmmsv_get_int32
#define XMMSV_TYPE_INT32   XMMSV_TYPE_INT64

Typedef Documentation

typedef struct xmmsv_St xmmsv_t

Enumeration Type Documentation

Enumerator
XMMSV_TYPE_NONE 
XMMSV_TYPE_ERROR 
XMMSV_TYPE_INT64 
XMMSV_TYPE_STRING 
XMMSV_TYPE_COLL 
XMMSV_TYPE_BIN 
XMMSV_TYPE_LIST 
XMMSV_TYPE_DICT 
XMMSV_TYPE_BITBUFFER 
XMMSV_TYPE_FLOAT 
XMMSV_TYPE_END 

Function Documentation

xmmsv_t* xmmsv_coll_copy ( xmmsv_t orig_coll)
xmmsv_t* xmmsv_copy ( xmmsv_t val)

Return a new value object which is a deep copy of the input value.

Parameters
valxmmsv_t to copy.
Returns
1 the address to the new copy of the value.

Referenced by xmms_collection_snapshot().

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

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

int xmmsv_get_coll ( const xmmsv_t val,
xmmsv_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
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

Referenced by xmmsv_copy().

int xmmsv_get_float ( const xmmsv_t val,
float *  r 
)

Retrieves a float from the value.

Parameters
vala xmmsv_t containing a float value.
rthe return float.
Returns
1 upon success otherwise 0

Referenced by xmmsv_copy(), and xmmsv_dict_format().

int xmmsv_get_int32 ( 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
int xmmsv_get_int64 ( const xmmsv_t val,
int64_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
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

Referenced by xmms_collection_restore(), xmms_xform_metadata_get_str(), xmmsv_copy(), xmmsv_decode_url(), xmmsv_dict_format(), and xmmsv_encode_url_full().

xmmsv_type_t xmmsv_get_type ( const xmmsv_t val)
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.
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.

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

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.

Referenced by xmmsv_copy().

xmmsv_t* xmmsv_new_float ( float  i)

Allocates a new float xmmsv_t.

Parameters
iThe value to store in the xmmsv_t.
Returns
The new xmmsv_t. Must be unreferenced with xmmsv_unref.

Referenced by xmmsv_copy().

xmmsv_t* xmmsv_new_int ( int64_t  i)

Allocates a new integer xmmsv_t.

Parameters
iThe value to store in the xmmsv_t.
Returns
The new xmmsv_t. Must be unreferenced with xmmsv_unref.

Referenced by xmms_medialib_entry_property_get_value(), xmms_medialib_query_to_xmmsv(), xmms_xform_auxdata_set_int(), xmms_xform_browse_add_entry_property_int(), xmms_xform_metadata_set_int(), and xmmsv_copy().

xmmsv_t* xmmsv_new_none ( void  )

Allocates a new empty xmmsv_t.

Returns
The new xmmsv_t. Must be unreferenced with xmmsv_unref.

Referenced by xmms_xform_auxdata_barrier(), and xmmsv_copy().

xmmsv_t* xmmsv_new_string ( const char *  s)

Allocates a new string xmmsv_t.

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

Referenced by xmms_config_property_set_data(), xmms_convert_and_kill_string(), xmms_medialib_entry_property_get_value(), xmms_xform_auxdata_set_str(), xmms_xform_browse_add_entry_property_str(), xmms_xform_metadata_set_str(), xmmsv_copy(), and xmmsv_make_stringlist().

xmmsv_t* xmmsv_ref ( xmmsv_t val)
void xmmsv_unref ( xmmsv_t val)