1DC_DEVICE_FOREACH(3)     BSD Library Functions Manual     DC_DEVICE_FOREACH(3)
2

NAME

4     dc_device_foreach — iterate over dives in a dive computer
5

LIBRARY

7     library “libdivecomputer”
8

SYNOPSIS

10     #include <libdivecomputer/device.h>
11
12     typedef int
13     (*dc_dive_callback_t)(const unsigned char *data, unsigned int size,
14         const unsigned char *fingerprint, unsigned int fsize,
15         void *userdata);
16
17     dc_status_t
18     dc_device_foreach(dc_device_t *device, dc_dive_callback_t callback,
19         void *userdata);
20

DESCRIPTION

22     Iterate over all dives on device by calling callback with userdata.
23
24     Each dive invokes callback with the dive data, which should be parsed
25     with dc_parser_set_data(3), and the binary fingerprint of the dive.  The
26     fingerprint can be used to record the newest dive and stop processing (on
27     subsequent invocations) when the same dive fingerprint is encountered.
28
29     The callback function must return non-zero to continue downloading dives,
30     or zero to stop.
31

RETURN VALUES

33     This returns DC_STATUS_SUCCESS on success or one of several error values
34     on error.  If callback returns zero, this will not be reflected in the
35     return value (usually DC_STATUS_SUCCESS).
36

SEE ALSO

38     dc_parser_set_data(3)
39

AUTHORS

41     The library “libdivecomputer” library was written by Jef Driesen,
42     jef@libdivecomputer.org.  The manpages were written by
43     Kristaps Dzonsons, kristaps@bsd.lv.
44
45BSD                             January 5, 2017                            BSD
Impressum