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

# XferCallback(3)

transfer callback for Nomad Jukebox library

## NAME

XferCallback - transfer callback for Nomad Jukebox library

## LIBRARY

libnjb

## SYNOPSIS

\#include \<sys/types.h\> #include \<libnjb.h\>

extern int njb\_error

typedef int XferCallback(u\_int64\_t  **sent**, u\_int64\_t **total,**const char\* **buf,**unsigned **len,**void **\*data);**

## DESCRIPTION

The **sent** and **total** 64-bit integers may be used to determine how far this transfer has advanced in number of bytes, eg the ratio can easily be determined for updating progress bars and the like.

The **buf** and **len** points to the current buffer and states its length, this is usually  only used for debugging purposes and should normally not be  dereferenced by the user program.

The  **data** parameter is a pointer to user data of any kind that the user of the library wants to associate with this transfer. This pointer is used for example when accessing several different jukeboxes from withing one program. If it has been set to point to some meaningful data in the "NJB\_Send..." or "NJB\_Get..." functions preceding the  callback, it may be dereferenced and cast to retrieve the data  associated with this very transfer.

## SEE ALSO

[NJB\_Send\_Track(3)](/NJB_Send_Track/3.md), [NJB\_Get\_Track(3)](/NJB_Get_Track/3.md), [NJB\_Send\_File(3)](/NJB_Send_File/3.md), [NJB\_Get\_File(3)](/NJB_Get_File/3.md)
