man XferCallback (Fonctions bibliothèques) - 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