man NJB_Get_Track_Tag (Fonctions bibliothèques) - Get a song tag from the NJB music library

NAME

NJB_Get_Track_Tag, NJB_Reset_Get_Track_Tag - Get a song tag from the NJB music library

LIBRARY

libnjb

SYNOPSIS

#include <libnjb.h>

extern int njb_error

void NJB_Reset_Get_Track_Tag(njb_t *njb)

songid_t *NJB_Get_Track_Tag(njb_t *njb)

DESCRIPTION

NJB_Get_Track_Tag is used to fetch the song "tags" for music stored on the NJB. Tags are returned in no particular order, with each call to NJB_Get_Track_Tag returning a single tag. To ensure that all tags are fetched, the calling program should invoke NJB_Reset_Get_Track_Tag before the first NJB_Get_Track_Tag call.

The return value is a songid_t object with the complete tag information. It is the user's responsibility to free up this memory when the song tag is no longer needed via the songid_destroy(3) function in order to prevent memory leaks. When the last song tag has been fetched, NJB_Get_Track_Tag returns a NULL pointer, and sets njb_error to EO_EOM.

RETURN VALUES

A songid_t object is returned from a successful query. If no more tags remain, or an error is encountered, a NULL pointer is returned and njb_error is set as follows:

EO_BADDATA
An invalid tag was returned.
EO_BADSTATUS
A non-zero status was encountered when attempting to get a tag.
EO_EOM
No more tracks/tags remain on the NJB.
EO_NOMEM
There was not enough memory available to create the songid_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.

SEE ALSO