---
name: "NJB_Get_Track_Tag"
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_Track_Tag"
---

# NJB\_Get\_Track\_Tag(3)

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

[songid(3)](/songid/3.md) NJB\_Get\_Extended\_Track\_Tags(3)
