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

NAME

4     dc_context_new — create a new device-handling context
5

LIBRARY

7     library “libdivecomputer”
8

SYNOPSIS

10     #include <libdivecomputer/context.h>
11
12     dc_status_t
13     dc_context_new(dc_context_t **context);
14

DESCRIPTION

16     Create a context in which dive computers may be queried.  The “context”
17     supplies logging messages and so on, and may be re-used for multiple dive
18     computer query sessions.  It is usually passed to dc_device_open(3) to
19     query a specific dive computer device.
20
21     On success, the context must be freed with dc_context_free(3).  You may
22     configure the context with dc_context_set_loglevel(3) and
23     dc_context_set_logfunc(3).  This is highly recommended as the default
24     logging behaviour of dc_context_new depends upon compile-time values.
25

RETURN VALUES

27     This returns DC_STATUS_OK on success, in which case context is filled in,
28     or an error code on failure.
29

SEE ALSO

31     dc_context_free(3), dc_context_set_logfunc(3),
32     dc_context_set_loglevel(3), dc_device_open(3)
33

AUTHORS

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