1DC_PARSER_NEW(3) BSD Library Functions Manual DC_PARSER_NEW(3)
2
4 dc_parser_new, dc_parser_new2 — create a parser for a single dive
5
7 library “libdivecomputer”
8
10 #include <libdivecomputer/parser.h>
11
12 dc_status_t
13 dc_parser_new(dc_parser_t **parser, dc_device_t *device);
14
15 dc_status_t
16 dc_parser_new2(dc_parser_t **parser, dc_context_t *context,
17 dc_descriptor_t *descriptor, unsigned int devtime,
18 dc_ticks_t systime);
19
21 Creates a parser for a single dive extracted from the dive computer with
22 dc_device_foreach(3). The parser operates on the data extracted: it does
23 not touch the device directly to acquire data. Thus, there are two forms
24 of invocation: dc_parser_new, which extracts relevant values from the
25 device parameter; and dc_parser_new2, which is given device values
26 (model, etc.) directly.
27
28 After filling in the parser parameter, one usually sets parser data with
29 dc_parser_set_data(3). The pointer must later be freed with
30 dc_parser_destroy(3).
31
33 These return DC_STATUS_OK, and fill in the parser pointer on success.
34 Otherwise, an error is returned.
35
37 dc_device_foreach(3), dc_parser_destroy(3)
38
40 The library “libdivecomputer” library was written by Jef Driesen,
41 jef@libdivecomputer.org. The manpages were written by
42 Kristaps Dzonsons, kristaps@bsd.lv.
43
44BSD January 5, 2017 BSD