NJB_Get_Playlist3
Get playlist definitions from the njb
Usage
#include <libnjb.h>
extern int njb_error
void NJB_Reset_Get_Playlist(njb_t *njb)
playlist_t *NJB_Get_Playlist(njb_t *njb)
Library
libnjb
Overview
This function is used to fetch a playlist definition from the NJB. The playlists are returned in no particular order, with each NJB_Get_Playlist query returning a single playlist. The calling program should invoke NJB_Reset_Get_Playlist before making calls to NJB_Get_Playlist, to ensure that all playlists are returned.
Each call to NJB_Get_Playlist returns a playlist_t object, which lists all the songs in the playlist. It is the program's responsibility to free this memory when the playlist is no longer needed, using the playlist_destroy(3) function.
When all playlists have been fetched, NJB_Get_Playlist returns a NULL pointer, and sets njb_error to EO_NOMEM.
Return values
A playlist_t object is returned from a successful query. If no more playlists remain, or an error is encountered, a NULL pointer is returned and njb_error is set as follows:
EO_BADDATA
|
An invalid playlist was returned. |
|---|---|
EO_BADSTATUS
|
A non-zero status was encountered when attempting to get a tag. |
EO_EOM
|
No more playlists remain on the NJB. |
EO_NOMEM
|
There was not enough memory available to create the playlist_t object. |
EO_RDSHORT
|
The NJB returned fewer bytes than expected on the bulk data pipe. |
EO_USBBLK
|
An I/O error occurred on the bulk data pipe. |
EO_USBCTL
|
An I/O error occurred on the control pipe. |
Releases
Unchanged in 2 releases since Debian 3.1 (Sarge).