XMMS2
Macros | Functions
Easier building of lists and dictionaries

Macros

#define XMMSV_DICT_ENTRY(k, v)   __xmmsv_identity_const_charp (k), __xmmsv_identity_xmmsv (v)
 
#define XMMSV_DICT_ENTRY_STR(k, v)   XMMSV_DICT_ENTRY (k, __xmmsv_null_to_none (xmmsv_new_string (v)))
 
#define XMMSV_DICT_ENTRY_INT(k, v)   XMMSV_DICT_ENTRY (k, xmmsv_new_int (v))
 
#define XMMSV_DICT_ENTRY_FLOAT(k, v)   XMMSV_DICT_ENTRY (k, xmmsv_new_float (v))
 
#define XMMSV_DICT_END   NULL
 
#define XMMSV_LIST_ENTRY(v)   __xmmsv_identity_xmmsv (v)
 
#define XMMSV_LIST_ENTRY_STR(v)   XMMSV_LIST_ENTRY (__xmmsv_null_to_none (xmmsv_new_string (v)))
 
#define XMMSV_LIST_ENTRY_INT(v)   XMMSV_LIST_ENTRY (xmmsv_new_int (v))
 
#define XMMSV_LIST_ENTRY_FLOAT(v)   XMMSV_LIST_ENTRY (xmmsv_new_float (v))
 
#define XMMSV_LIST_ENTRY_COLL(v)   XMMSV_LIST_ENTRY (__xmmsv_null_to_none (xmmsv_new_coll (v)))
 
#define XMMSV_LIST_END   NULL
 

Functions

xmmsv_txmmsv_make_stringlist (char *array[], int num)
 Helper function to build a list xmmsv_t containing the strings from the input array. More...
 
xmmsv_txmmsv_build_dict (const char *firstkey,...)
 
xmmsv_txmmsv_build_dict_va (const char *firstkey, va_list ap)
 
xmmsv_txmmsv_build_list (xmmsv_t *first_entry,...)
 
xmmsv_txmmsv_build_list_va (xmmsv_t *first_entry, va_list ap)
 
xmmsv_txmmsv_build_empty_organize (void)
 
xmmsv_txmmsv_build_organize (xmmsv_t *data)
 Creates an organize fetch specification that may be passed to xmmsc_coll_query. More...
 
xmmsv_txmmsv_build_metadata (xmmsv_t *keys, xmmsv_t *get, const char *aggregate, xmmsv_t *sourcepref)
 Creates a metadata fetch specification. More...
 
xmmsv_txmmsv_build_cluster_list (xmmsv_t *cluster_by, xmmsv_t *cluster_field, xmmsv_t *cluster_data)
 Creates a cluster-list fetch specification. More...
 
xmmsv_txmmsv_build_cluster_dict (xmmsv_t *cluster_by, xmmsv_t *cluster_field, xmmsv_t *cluster_data)
 Creates a cluster-dict fetch specification. More...
 
xmmsv_txmmsv_build_count (void)
 Creates a count fetch specification. More...
 

Detailed Description

Macro Definition Documentation

#define XMMSV_DICT_END   NULL
#define XMMSV_DICT_ENTRY (   k,
 
)    __xmmsv_identity_const_charp (k), __xmmsv_identity_xmmsv (v)
#define XMMSV_DICT_ENTRY_FLOAT (   k,
 
)    XMMSV_DICT_ENTRY (k, xmmsv_new_float (v))
#define XMMSV_DICT_ENTRY_INT (   k,
 
)    XMMSV_DICT_ENTRY (k, xmmsv_new_int (v))
#define XMMSV_DICT_ENTRY_STR (   k,
 
)    XMMSV_DICT_ENTRY (k, __xmmsv_null_to_none (xmmsv_new_string (v)))
#define XMMSV_LIST_END   NULL
#define XMMSV_LIST_ENTRY (   v)    __xmmsv_identity_xmmsv (v)
#define XMMSV_LIST_ENTRY_COLL (   v)    XMMSV_LIST_ENTRY (__xmmsv_null_to_none (xmmsv_new_coll (v)))
#define XMMSV_LIST_ENTRY_FLOAT (   v)    XMMSV_LIST_ENTRY (xmmsv_new_float (v))
#define XMMSV_LIST_ENTRY_INT (   v)    XMMSV_LIST_ENTRY (xmmsv_new_int (v))
#define XMMSV_LIST_ENTRY_STR (   v)    XMMSV_LIST_ENTRY (__xmmsv_null_to_none (xmmsv_new_string (v)))

Function Documentation

xmmsv_t* xmmsv_build_cluster_dict ( xmmsv_t cluster_by,
xmmsv_t cluster_field,
xmmsv_t cluster_data 
)

Creates a cluster-dict fetch specification.

Parameters
cluster_byA list of attributes to cluster by
cluster_dataThe fetch specifcation to use when filling the list
Returns
A cluster-list fetch specification
xmmsv_t* xmmsv_build_cluster_list ( xmmsv_t cluster_by,
xmmsv_t cluster_field,
xmmsv_t cluster_data 
)

Creates a cluster-list fetch specification.

Parameters
cluster_byA list of attributes to cluster by
cluster_dataThe fetch specifcation to use when filling the list
Returns
A cluster-list fetch specification
xmmsv_t* xmmsv_build_count ( void  )

Creates a count fetch specification.

Returns
A new count fetch specification
xmmsv_t* xmmsv_build_dict ( const char *  firstkey,
  ... 
)
xmmsv_t* xmmsv_build_dict_va ( const char *  firstkey,
va_list  ap 
)

Referenced by xmmsv_build_dict().

xmmsv_t* xmmsv_build_empty_organize ( void  )
xmmsv_t* xmmsv_build_list ( xmmsv_t first_entry,
  ... 
)
xmmsv_t* xmmsv_build_list_va ( xmmsv_t first_entry,
va_list  ap 
)

Referenced by xmmsv_build_list().

xmmsv_t* xmmsv_build_metadata ( xmmsv_t fields,
xmmsv_t get,
const char *  aggregate,
xmmsv_t sourcepref 
)

Creates a metadata fetch specification.

Parameters
fieldsA list of fields to fetch, or NULL to fetch everything
getA list of what to get ("id", "key", "value", "source")
aggregateThe aggregation function to use
sourceprefA list of sources, first one has the highest priority
Returns
A metadata fetch specification
xmmsv_t* xmmsv_build_organize ( xmmsv_t data)

Creates an organize fetch specification that may be passed to xmmsc_coll_query.

It takes a dict with key-value pairs where the values are fetch specifications.

Returns
An organize fetch specification
xmmsv_t* xmmsv_make_stringlist ( char *  array[],
int  num 
)

Helper function to build a list xmmsv_t containing the strings from the input array.

Parameters
arrayAn array of C strings. Must be NULL-terminated if num is -1.
numThe optional number of elements to read from the array. Set to -1 if the array is NULL-terminated.
Returns
An xmmsv_t containing the list of strings. Must be unreffed manually when done.