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

NAME

4     dc_device_set_cancel — callback to check whether processing should cancel
5

LIBRARY

7     library “libdivecomputer”
8

SYNOPSIS

10     #include <libdivecomputer/device.h>
11
12     typedef int
13     (*dc_cancel_callback_t)(void *userdata);
14
15     dc_status_t
16     dc_device_set_cancel(dc_device_t *device, dc_cancel_callback_t callback,
17         void *userdata);
18

DESCRIPTION

20     Provide a function that the underlying device will periodically call to
21     see if it should cancel its processing.  The callback will return zero if
22     the operation should not be cancelled, one if it should be cancelled.
23
24     The callback usually checks a value that is set during a signal handling
25     callback.  For example, one can invoke signal(3) to a function that sets
26     a volatile sig_atomic_t value checked by the callback handler.
27

RETURN VALUES

29     Returns DC_STATUS_UNSUPPORTED if the device is NULL, or DC_STATUS_SUCCESS
30     otherwise.
31

SEE ALSO

33     dc_device_open(3)
34

AUTHORS

36     The library “libdivecomputer” library was written by Jef Driesen,
37     jef@libdivecomputer.org.  These manpages were written by
38     Kristaps Dzonsons, kristaps@bsd.lv.
39
40BSD                             January 5, 2017                            BSD
Impressum