XMMS2
|
Functions to create and use S4 search conditions. More...
Functions | |
s4_condition_t * | s4_cond_new_combiner (s4_combine_type_t type) |
Creates a new combiner. More... | |
s4_condition_t * | s4_cond_new_custom_combiner (combine_function_t func) |
Creates a new combiner with a user specified combiner function. More... | |
void | s4_cond_add_operand (s4_condition_t *cond, s4_condition_t *operand) |
Adds and references an operand to a combiner condition. More... | |
s4_condition_t * | s4_cond_get_operand (s4_condition_t *cond, int operand) |
Gets an operand from a combiner condition. More... | |
s4_condition_t * | s4_cond_new_filter (s4_filter_type_t type, const char *key, const s4_val_t *value, s4_sourcepref_t *sourcepref, s4_cmp_mode_t cmp_mode, int flags) |
Creates a new filter condition. More... | |
s4_condition_t * | s4_cond_new_custom_filter (filter_function_t func, void *userdata, free_func_t free, const char *key, s4_sourcepref_t *sourcepref, s4_cmp_mode_t cmp_mode, int monotonic, int flags) |
Creates a new filter condition with a user specified filter function. More... | |
int | s4_cond_is_filter (s4_condition_t *cond) |
Checks if this condition is a filter condition. More... | |
int | s4_cond_is_combiner (s4_condition_t *cond) |
Checks if this condition is a combiner condition. More... | |
s4_filter_type_t | s4_cond_get_filter_type (s4_condition_t *cond) |
s4_combine_type_t | s4_cond_get_combiner_type (s4_condition_t *cond) |
int | s4_cond_get_flags (s4_condition_t *cond) |
Gets the flags for a condition. More... | |
const char * | s4_cond_get_key (s4_condition_t *cond) |
Gets the key for a condition. More... | |
s4_sourcepref_t * | s4_cond_get_sourcepref (s4_condition_t *cond) |
Gets the source preference that should be used. More... | |
void * | s4_cond_get_funcdata (s4_condition_t *cond) |
Returns the data that should be fed to the filter function. More... | |
void | s4_cond_free (s4_condition_t *cond) |
Frees a condition and operands recursively. More... | |
s4_condition_t * | s4_cond_ref (s4_condition_t *cond) |
Increments the reference count of a condition. More... | |
void | s4_cond_unref (s4_condition_t *cond) |
Decrements the reference count of a condition. More... | |
filter_function_t | s4_cond_get_filter_function (s4_condition_t *cond) |
Gets the filter function for the condition. More... | |
combine_function_t | s4_cond_get_combine_function (s4_condition_t *cond) |
Gets the combine function for the condition. More... | |
int | s4_cond_is_monotonic (s4_condition_t *cond) |
Checks if the condition is a monotonic filter. More... | |
int | s4_cond_get_cmp_mode (s4_condition_t *cond) |
Gets the comparison mode used by the filter condition. More... | |
void | s4_cond_update_key (s4_condition_t *cond, s4_t *s4) |
Change the key with a constant key for faster checking. More... | |
Functions to create and use S4 search conditions.
void s4_cond_add_operand | ( | s4_condition_t * | cond, |
s4_condition_t * | operand | ||
) |
Adds and references an operand to a combiner condition.
cond | The condition to add to |
operand | The operand to add |
Referenced by CASE().
void s4_cond_free | ( | s4_condition_t * | cond | ) |
Frees a condition and operands recursively.
cond | The condition to free |
Referenced by CASE(), s4_cond_unref(), xmms_medialib_query_recurs(), and xmms_medialib_session_property_set().
int s4_cond_get_cmp_mode | ( | s4_condition_t * | cond | ) |
Gets the comparison mode used by the filter condition.
cond | The condition to check |
combine_function_t s4_cond_get_combine_function | ( | s4_condition_t * | cond | ) |
Gets the combine function for the condition.
This function does not check if the condition is actually a combine condition, if it's called on a condition that is not a combiner it will return bogus data
cond | The condition to get the combine function of |
s4_combine_type_t s4_cond_get_combiner_type | ( | s4_condition_t * | cond | ) |
Referenced by print_cond().
filter_function_t s4_cond_get_filter_function | ( | s4_condition_t * | cond | ) |
Gets the filter function for the condition.
This function does not check if the condition is actually a filter condition, if it is called on a condition that is not a filter it will return bogus data
cond | The condition to get the filter function of |
Referenced by _s4_query(), and CASE().
s4_filter_type_t s4_cond_get_filter_type | ( | s4_condition_t * | cond | ) |
Referenced by print_cond().
int s4_cond_get_flags | ( | s4_condition_t * | cond | ) |
Gets the flags for a condition.
cond | The condition to get the flags of |
Referenced by _s4_query().
void* s4_cond_get_funcdata | ( | s4_condition_t * | cond | ) |
Returns the data that should be fed to the filter function.
cond | The condition to get the function data of |
Referenced by print_cond().
const char* s4_cond_get_key | ( | s4_condition_t * | cond | ) |
Gets the key for a condition.
cond | The condition to get the key of |
Referenced by _s4_query(), and print_cond().
s4_condition_t* s4_cond_get_operand | ( | s4_condition_t * | cond, |
int | operand | ||
) |
Gets an operand from a combiner condition.
cond | The condition to get the operand from |
operand | The index of the operand to get |
Referenced by print_cond().
s4_sourcepref_t* s4_cond_get_sourcepref | ( | s4_condition_t * | cond | ) |
Gets the source preference that should be used.
cond | The condition to get the source preference of |
int s4_cond_is_combiner | ( | s4_condition_t * | cond | ) |
Checks if this condition is a combiner condition.
cond | The condition to check |
int s4_cond_is_filter | ( | s4_condition_t * | cond | ) |
Checks if this condition is a filter condition.
cond | The condition to check |
Referenced by _s4_query(), and print_cond().
int s4_cond_is_monotonic | ( | s4_condition_t * | cond | ) |
Checks if the condition is a monotonic filter.
A monotonic filter is a filter that preserves the order, and it can thus be used to search in an index.
cond | The condition to check |
Referenced by _s4_query().
s4_condition_t* s4_cond_new_combiner | ( | s4_combine_type_t | type | ) |
Creates a new combiner.
type | The combiner type |
s4_condition_t* s4_cond_new_custom_combiner | ( | combine_function_t | func | ) |
Creates a new combiner with a user specified combiner function.
func | The combiner function to use |
Referenced by CASE().
s4_condition_t* s4_cond_new_custom_filter | ( | filter_function_t | func, |
void * | userdata, | ||
free_func_t | free, | ||
const char * | key, | ||
s4_sourcepref_t * | sourcepref, | ||
s4_cmp_mode_t | cmp_mode, | ||
int | monotonic, | ||
int | flags | ||
) |
Creates a new filter condition with a user specified filter function.
The filter function should return 0 if the value meets the condition, non-zero otherwise.
func | The filter function to use |
userdata | The data that will be passed to the function along with the value to check |
free | The function that should be called to free userdata |
key | The key the condition should check |
sourcepref | The source preference |
cmp_mode | The comparison mode to use |
flags | Condition flags, or 0 |
Referenced by CASE().
s4_condition_t* s4_cond_new_filter | ( | s4_filter_type_t | type, |
const char * | key, | ||
const s4_val_t * | value, | ||
s4_sourcepref_t * | sourcepref, | ||
s4_cmp_mode_t | cmp_mode, | ||
int | flags | ||
) |
Creates a new filter condition.
type | The type of the filter |
key | The key the condition should check |
value | The value to check against |
sourcepref | The source preference |
cmp_mode | The comparison mode to use |
flags | Condition flags, or 0 |
Referenced by CASE(), and xmms_medialib_session_property_set().
s4_condition_t* s4_cond_ref | ( | s4_condition_t * | cond | ) |
Increments the reference count of a condition.
cond | The condition to reference |
Referenced by s4_cond_add_operand().
void s4_cond_unref | ( | s4_condition_t * | cond | ) |
Decrements the reference count of a condition.
If the reference count is 0 after this, the condition is freed.
cond | The condition to decrement the count of |
Referenced by CASE(), s4_cond_new_combiner(), and s4_cond_new_custom_combiner().
void s4_cond_update_key | ( | s4_condition_t * | cond, |
s4_t * | s4 | ||
) |
Change the key with a constant key for faster checking.
s4 | The database to optimize for |
cond | The condition to update |
Referenced by _s4_query().