---
name: "NJB_Update_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_Update_Playlist"
---

# NJB\_Update\_Playlist(3)

Create or update a playlist on the NJB

## NAME

NJB\_Update\_Playlist - Create or update a playlist on the NJB

## LIBRARY

libnjb

## SYNOPSIS

\#include \<libnjb.h\>

extern int njb\_error

int NJB\_Update\_Playlist (njb\_t **\*njb**, playlist\_t **\*pl**)

## DESCRIPTION

This command creates, renames or updates a playlist on the NJB.  The operation is dependant upon the  **pl** parameter, which defines the playlist, and how it was created.

If the playlist was created by the host via the  **playlist\_new**(3) function, then a new playlist is created on the NJB.  The playlist ID is stored in **pl-\>plid** so that the host can update any local cache files.

If  **pl** points to a playlist structure that was obtained via a  **Get\_Playlist**(3) function, then the playlist is updated on the NJB.  Whether a rename or a rewrite of the playlist takes place is based on whether or not the tracks were modified in the playlist, itself.  If only the name is changed, the a rename is done.  If the track list was modified, then the old playlist is deleted and a new playlist is written out.

## RETURN VALUES

This function returns 0 on success.  If an error occurs, it returns -1 and sets  **njb\_error**

- EO\_BADSTATUS

  A non-zero status was returned when updating the playlist EO\_BADSTATUS Could not delete the old playlist from the NJB EO\_NOMEM Couldn't allocate memory for the playlist block EO\_RDSHORT Fewer bytes than expected were received on the bulk data pipe EO\_TOOBIG The playlist is too large. EO\_USBBLK An I/O error occurred on the bulk data pipe EO\_USBCTL An I/O error occurred on the control pipe EO\_WRSHORT Fewer bytes than requested were written to the bulk data pipe

## SEE ALSO

[playlist(3)](/playlist/3.md)

## BUGS
