#ifndef __TRACK_LIST_H__ #define __TRACK_LIST_H__ struct track_list; typedef struct track_list track_list; /** * Initializes a track list to be empty. * * @param l a pointer to an uninitialized track list, non-NULL */ track_list *track_list_create(); /** * 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 */ void track_list_add(track_list *l, int start, int end); /** * Frees the memory allocated to this track list and makes it empty. * * @param l a pointer to a track list, non-NULL */ void track_list_destroy(track_list *l); /** * Passes each track's start and endpoints, along with an array of ints * and a generic pointer, to the given function. * * @param l a pointer to a track list, non-NULL * @param f a pointer to a function that takes an index, start and end point, * array of ints, and generic pointer and returns void, non-NULL * @param samples an array to pass to f * @param info a pointer to pass to f */ void track_list_process(const track_list *l, void (*f)(int, int, int, const int*, void *), const int *samples, void *info); #endif