#ifndef __TRACK_LIST__ #define __TRACK_LIST__ #include struct track_list; typedef struct track_list track_list; /** * Creates an empty track list. * * @return a pointer to a track list, or NULL if one couldn't be created */ track_list *track_list_create(); /** * Destroys the given track list. * * @param l a pointer to a track list */ void track_list_destroy(track_list *l); /** * Returns the size of the given track list. * * @param l a pointer to a track list * @return the size of that list */ int track_list_size(const track_list *l); /** * Adds a track with the given endpoints to this track list. * * @param l a pointer to a track list * @param start an integer not less than the endpoint of the last track * on this list and not greater than end * @param end an integer * @return true if and only if the track was added */ bool track_list_add(track_list *l, int start, int end); /** * Returns the endpoints of the track with the given index on this list. * The endpoints are returned via the pointers start and end. The * corresponding endpoint is skipped if one of those is NULL. * * @param l a pointer to a track list * @param i a valid track index for that list * @param start a pointer to an int * @param end a pointer to an int * @return true if and only if the track was valid */ bool track_list_get(const track_list *l, int i, int *start, int *end); #endif