---
name: "NJB_Get_Playlist"
section: "3"
platform: "linux"
package: "libnjb1-doc"
version: "1.1-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/NJB_Get_Playlist"
---

# NJB\_Get\_Playlist(3)

Get playlist definitions from the NJB

## NAME

NJB\_Get\_Playlist, NJB\_Reset\_Get\_Playlist - Get playlist definitions from  the NJB

## LIBRARY

libnjb

## SYNOPSIS

\#include \<libnjb.h\>

extern int njb\_error

void NJB\_Reset\_Get\_Playlist(njb\_t **\*njb**)

playlist\_t \*NJB\_Get\_Playlist(njb\_t **\*njb**)

## DESCRIPTION

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.

## SEE ALSO

playlist\_destroy(3)
