Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
DC_DEVICE_FOREACH(3)	    Library Functions Manual	  DC_DEVICE_FOREACH(3)

NAME
       dc_device_foreach -- iterate over dives in a dive computer

LIBRARY
       library "libdivecomputer"

SYNOPSIS
       #include	<libdivecomputer/device.h>

       typedef int
       (*dc_dive_callback_t)(const unsigned char *data,	    unsigned int size,
	   const unsigned char *fingerprint,		   unsigned int	fsize,
	   void	*userdata);

       dc_status_t
       dc_device_foreach(dc_device_t *device,	  dc_dive_callback_t callback,
	   void	*userdata);

DESCRIPTION
       Iterate over all	dives on device	by calling callback with userdata.

       Each dive invokes callback with the dive	data, which should  be	parsed
       with  dc_parser_set_data(3),  and  the  binary fingerprint of the dive.
       The fingerprint can be used to record the newest	dive and stop process-
       ing (on subsequent invocations) when the	same dive fingerprint  is  en-
       countered.

       The  callback  function	must  return  non-zero to continue downloading
       dives, or zero to stop.

RETURN VALUES
       This returns DC_STATUS_SUCCESS on success or one	of several error  val-
       ues  on error.  If callback returns zero, this will not be reflected in
       the return value	(usually DC_STATUS_SUCCESS).

SEE ALSO
       dc_parser_set_data(3)

AUTHORS
       The library "libdivecomputer"  library  was  written  by	 Jef  Driesen,
       jef@libdivecomputer.org.	 The manpages were written by
       Kristaps	Dzonsons, kristaps@bsd.lv.

FreeBSD	Ports 14.quarterly	January	5, 2017		  DC_DEVICE_FOREACH(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=dc_device_foreach&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help