![]() |
SCTC
the soundcloud.com terminal client
|
Functions for handling tracks and track_lists. More...
Functions | |
| bool | track_list_add (struct track_list *list, struct track *track) |
| Add a single track to an existing track_list. More... | |
| bool | track_list_del (struct track_list *list, size_t track_id) |
| static int | entry_compare (const void *v1, const void *v2) |
| struct track_list * | track_list_merge (struct track_list **lists) |
| Merge an array of track_lists. More... | |
| void | track_list_sort (struct track_list *list) |
| Sort a track_list by creation time. More... | |
| bool | track_list_append (struct track_list *target, struct track_list *source) |
| Append a list to another list. More... | |
| struct track * | track_list_get (struct track_list *list, char *permalink) |
| Check if list contains a track, identified by its permalink and return it. More... | |
| void | track_destroy (struct track *track) |
| void | track_list_destroy (struct track_list *list, bool free_trackdata) |
| Free the memory occupied by a track_list. More... | |
Functions for handling tracks and track_lists.
|
static |
| void track_destroy | ( | struct track * | track | ) |
| bool track_list_add | ( | struct track_list * | list, |
| struct track * | track | ||
| ) |
Add a single track to an existing track_list.
| list | The list receiving the new track |
| track | The track, which will be added to list |
| bool track_list_append | ( | struct track_list * | target, |
| struct track_list * | source | ||
| ) |
Append a list to another list.
| bool track_list_del | ( | struct track_list * | list, |
| size_t | track_id | ||
| ) |
| void track_list_destroy | ( | struct track_list * | list, |
| bool | free_trackdata | ||
| ) |
Free the memory occupied by a track_list.
Do not use the list after calling this function. Do not use any of the tracks within the list if free_trackdata is set to true.
| list | the list to free |
| free_trackdata | if true every single track within the list will be freed too |
| struct track* track_list_get | ( | struct track_list * | list, |
| char * | permalink | ||
| ) |
Check if list contains a track, identified by its permalink and return it.
| list | The list to search in |
| permalink | The permalink to use for searching |
NULL otherwise | struct track_list* track_list_merge | ( | struct track_list ** | lists | ) |
Merge an array of track_lists.
The resulting list is not sorted, entries from all lists are simply concatinated. Both input lists are not modified, call track_list_destroy() if they are no longer needed. The struct tracks within the list are duplicated, the struct tracks' members are not - set free_trackdata to false!
| lists | A NULL-terminated array containing the track_lists to be merged into one |
| void track_list_sort | ( | struct track_list * | list | ) |
Sort a track_list by creation time.
| list | The list to be sorted |
1.8.9.1