DC_DEVICE_SET_CANCEL(3) Library Functions Manual DC_DEVICE_SET_CANCEL(3)

dc_device_set_cancel
callback to check whether processing should cancel

library “libdivecomputer”

#include <libdivecomputer/device.h>
typedef int
(*dc_cancel_callback_t)(void *userdata);
dc_status_t
dc_device_set_cancel(dc_device_t *device, dc_cancel_callback_t callback, void *userdata);

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

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

dc_device_open(3)

The library “libdivecomputer” library was written by Jef Driesen, jef@libdivecomputer.org. These manpages were written by
Kristaps Dzonsons, kristaps@bsd.lv.
January 5, 2017 Debian