XMMS2
|
Functions | |
s4_index_data_t * | _index_create_data () |
void | _index_free_data (s4_index_data_t *data) |
s4_index_t * | _index_get_a (s4_t *s4, const char *key, int create) |
Gets the a-index associated with key. More... | |
s4_index_t * | _index_get_b (s4_t *s4, const char *key) |
Gets the b-index associated with key. More... | |
GList * | _index_get_all_a (s4_t *s4) |
Gets all a-indexes. More... | |
GList * | _index_get_all_b (s4_t *s4) |
Gets all b-indexes. More... | |
s4_index_t * | _index_create () |
Creates a new index. More... | |
int | _index_add (s4_t *s4, const char *key, s4_index_t *index) |
Adds an index to a database. More... | |
int | _index_insert (s4_index_t *index, const s4_val_t *val, void *new_data) |
Inserts a new value-data pair into the index. More... | |
int | _index_delete (s4_index_t *index, const s4_val_t *val, void *data) |
Removes a value-data pair from the index. More... | |
GList * | _index_search (s4_index_t *index, index_function_t func, void *func_data) |
Searches an index. More... | |
GList * | _index_lsearch (s4_index_t *index, index_function_t func, void *func_data) |
Searches an index using a linear search. More... | |
void | _index_free (s4_index_t *index) |
Frees an index. More... | |
int | _index_lock_shared (s4_index_t *index, s4_transaction_t *trans) |
int | _index_lock_exclusive (s4_index_t *index, s4_transaction_t *trans) |
int _index_add | ( | s4_t * | s4, |
const char * | key, | ||
s4_index_t * | index | ||
) |
Adds an index to a database.
s4 | The database to add the index to |
key | The key to associate the index with |
index | The index to insert |
Referenced by s4_open().
s4_index_t* _index_create | ( | void | ) |
s4_index_data_t* _index_create_data | ( | void | ) |
Referenced by _reread_file().
int _index_delete | ( | s4_index_t * | index, |
const s4_val_t * | val, | ||
void * | data | ||
) |
Removes a value-data pair from the index.
index | The index to remove from |
val | The value to remove |
data | The data to remove |
Referenced by _s4_del().
void _index_free | ( | s4_index_t * | index | ) |
Frees an index.
The values and data is NOT freed
index | The index to free |
Referenced by _index_create_data().
void _index_free_data | ( | s4_index_data_t * | data | ) |
Referenced by _reread_file().
s4_index_t* _index_get_a | ( | s4_t * | s4, |
const char * | key, | ||
int | create | ||
) |
Gets the a-index associated with key.
A a-index is used to lookup entries by the a-value. If an index has not yet been created for this key and create is non-zero, one will be created and returned.
s4 | The database to look for the index in |
key | The key the index should be indexing |
create | Creates the index if it does not exist |
Referenced by _s4_add(), _s4_add_internal(), _s4_del(), and _s4_query().
GList* _index_get_all_a | ( | s4_t * | s4 | ) |
Gets all a-indexes.
s4 | The database to get the index of. |
Referenced by _free_relations(), and _s4_query().
GList* _index_get_all_b | ( | s4_t * | s4 | ) |
Gets all b-indexes.
s4 | The database to get the index of. |
s4_index_t* _index_get_b | ( | s4_t * | s4, |
const char * | key | ||
) |
Gets the b-index associated with key.
A b-index is used to lookup entries by the b-value.
s4 | The database to look for the index in |
key | The key the index should be indexing |
Referenced by _s4_add(), _s4_add_internal(), _s4_del(), and _s4_query().
int _index_insert | ( | s4_index_t * | index, |
const s4_val_t * | val, | ||
void * | new_data | ||
) |
Inserts a new value-data pair into the index.
index | The index to insert into |
val | The value to associate the data with |
new_data | The data |
Referenced by _s4_add(), and _s4_add_internal().
int _index_lock_exclusive | ( | s4_index_t * | index, |
s4_transaction_t * | trans | ||
) |
int _index_lock_shared | ( | s4_index_t * | index, |
s4_transaction_t * | trans | ||
) |
Referenced by _s4_add(), _s4_del(), and _s4_query().
GList* _index_lsearch | ( | s4_index_t * | index, |
index_function_t | func, | ||
void * | func_data | ||
) |
Searches an index using a linear search.
index | The index to search |
func | The function to use when searching. It should return 0 if the value matches, -1 if the value is too small and 1 if the value is too big, |
func_data | Data passed as the second argument to func |
Referenced by _s4_query().
GList* _index_search | ( | s4_index_t * | index, |
index_function_t | func, | ||
void * | func_data | ||
) |
Searches an index.
index | The index to search |
func | The function to use when searching. It must be monotonic, It should return 0 if the value matches, -1 if the value is too small and 1 if the value is too big, |
func_data | Data passed as the second argument to func |
Referenced by _free_relations(), _s4_add(), _s4_add_internal(), _s4_del(), and _s4_query().