XMMS2
Functions
Result Set

A set of results. More...

Functions

void s4_resultset_add_row (s4_resultset_t *set, const s4_resultrow_t *row)
 Adds a row to a resultset. More...
 
int s4_resultset_get_row (const s4_resultset_t *set, int row_no, const s4_resultrow_t **row)
 Gets a row from a resultset. More...
 
const s4_result_ts4_resultset_get_result (const s4_resultset_t *set, int row, int col)
 Gets a result from a resultset. More...
 
int s4_resultset_get_colcount (const s4_resultset_t *set)
 Gets the column count for a resultset. More...
 
int s4_resultset_get_rowcount (const s4_resultset_t *set)
 Gets the row count for a resultset. More...
 
void s4_resultset_sort (s4_resultset_t *set, s4_order_t *order)
 Sorts a resultset. More...
 
void s4_resultset_shuffle (s4_resultset_t *set)
 Shuffles the resultset into a pseudo-random order. More...
 
void s4_resultset_free (s4_resultset_t *set)
 Frees a resultset and all the results in it. More...
 
s4_resultset_ts4_resultset_ref (s4_resultset_t *set)
 
void s4_resultset_unref (s4_resultset_t *set)
 
s4_resultrow_ts4_resultrow_create (int col_count)
 Creates a new row. More...
 
void s4_resultrow_set_col (s4_resultrow_t *row, int col_no, s4_result_t *col)
 Sets a column in a resultrow. More...
 
int s4_resultrow_get_col (const s4_resultrow_t *row, int col_no, const s4_result_t **col)
 Gets the value of a column in a resultrow. More...
 
s4_resultrow_ts4_resultrow_ref (s4_resultrow_t *row)
 References a resultrow. More...
 
void s4_resultrow_unref (s4_resultrow_t *row)
 Unreferences a resultrow. More...
 
s4_order_ts4_order_create (void)
 
s4_order_entry_ts4_order_add_column (s4_order_t *order, s4_cmp_mode_t collation, s4_order_direction_t direction)
 
s4_order_entry_ts4_order_add_random (s4_order_t *order, int seed)
 
void s4_order_entry_add_choice (s4_order_entry_t *entry, int column)
 
void s4_order_free (s4_order_t *order)
 
s4_resultset_ts4_resultset_create (int col_count)
 Creates a new resultset. More...
 

Detailed Description

A set of results.

Function Documentation

s4_order_entry_t* s4_order_add_column ( s4_order_t order,
s4_cmp_mode_t  collation,
s4_order_direction_t  direction 
)
s4_order_entry_t* s4_order_add_random ( s4_order_t order,
int  seed 
)
s4_order_t* s4_order_create ( void  )
void s4_order_entry_add_choice ( s4_order_entry_t entry,
int  column 
)
void s4_order_free ( s4_order_t order)
s4_resultrow_t* s4_resultrow_create ( int  col_count)

Creates a new row.

Parameters
col_countThe number of columns in the row
Returns
A new resultrow
int s4_resultrow_get_col ( const s4_resultrow_t row,
int  col_no,
const s4_result_t **  col 
)

Gets the value of a column in a resultrow.

Parameters
rowThe row to get the column from
col_noThe index of the column to get
colA pointer to where the column will be saved
Returns
0 if col_no is out of bounds or the column is NULL, 1 otherwise
s4_resultrow_t* s4_resultrow_ref ( s4_resultrow_t row)

References a resultrow.

Parameters
rowThe row to reference

Referenced by s4_resultset_add_row().

void s4_resultrow_set_col ( s4_resultrow_t row,
int  col_no,
s4_result_t col 
)

Sets a column in a resultrow.

Parameters
rowThe row to set the column in
col_noThe index of the column to set
colThe new value of the column
void s4_resultrow_unref ( s4_resultrow_t row)

Unreferences a resultrow.

If the refcount hits 0 the row will be freed

Parameters
rowThe row to unrefperence

Referenced by s4_resultset_create().

void s4_resultset_add_row ( s4_resultset_t set,
const s4_resultrow_t row 
)

Adds a row to a resultset.

Parameters
setThe resultset to add to
rowThe row to add

Referenced by _s4_query().

s4_resultset_t* s4_resultset_create ( int  col_count)

Creates a new resultset.

Parameters
col_countThe number of columns in every result
Returns
A new resultset with the column count set to col_count

Referenced by _s4_query(), and s4_query().

void s4_resultset_free ( s4_resultset_t set)
int s4_resultset_get_colcount ( const s4_resultset_t set)

Gets the column count for a resultset.

Parameters
setThe set to find the column count of
Returns
The column count

Referenced by CASE(), find_column(), and print_result().

const s4_result_t* s4_resultset_get_result ( const s4_resultset_t set,
int  row,
int  col 
)

Gets a result from a resultset.

Parameters
setThe set to get the result from
rowThe row
colThe column
Returns
The result at (row,col), or NULL if it does not exist

Referenced by CASE(), print_result(), xmms_medialib_entry_cleanup(), xmms_medialib_entry_not_resolved_get(), xmms_medialib_entry_remove(), and xmms_medialib_session_property_set().

int s4_resultset_get_row ( const s4_resultset_t set,
int  row_no,
const s4_resultrow_t **  row 
)

Gets a row from a resultset.

Parameters
setThe resultset to get the row from
row_noThe index of the row to fetch
rowA pointer to where the row will be saved
Returns
0 if row_no was out of bounds, 1 otherwise
int s4_resultset_get_rowcount ( const s4_resultset_t set)

Gets the row count for a resultset.

Parameters
setThe set to find the row count of
Returns
The row count

Referenced by CASE(), print_result(), xmms_medialib_entry_cleanup(), xmms_medialib_entry_remove(), xmms_medialib_num_not_resolved(), and xmms_medialib_query_to_xmmsv().

s4_resultset_t* s4_resultset_ref ( s4_resultset_t set)
void s4_resultset_shuffle ( s4_resultset_t set)

Shuffles the resultset into a pseudo-random order.

Parameters
setThe resultset to shuffle
void s4_resultset_sort ( s4_resultset_t set,
s4_order_t order 
)

Sorts a resultset.

Parameters
setThe set to sort
orderThe columns to order the result by
void s4_resultset_unref ( s4_resultset_t set)