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

NAME

4     dc_parser_get_field — extract a field from a parsed dive
5

LIBRARY

7     library “libdivecomputer”
8

SYNOPSIS

10     #include <libdivecomputer/parser.h>
11
12     dc_status_t
13     dc_parser_get_field(dc_parser_t *parser, dc_field_type_t type,
14         unsigned int flags, void *value);
15

DESCRIPTION

17     Extract a field from a dive, parser, previously initialised with
18     dc_parser_set_data(3).  The value field type depends upon the type.  The
19     flags field is ignored for all types but DC_FIELD_GASMIX and
20     DC_FIELD_TANK.
21
22     The type may be one of the following values:
23
24     DC_FIELD_DIVETIME
25             Time (duration) of dive in seconds.  The value must be an
26             unsigned int.
27
28     DC_FIELD_MAXDEPTH
29             Maximum depth in metres.  The value must be a double.
30
31     DC_FIELD_AVGDEPTH
32             Average depth (over all samples) in metres.  The value must be a
33             double.
34
35     DC_FIELD_GASMIX_COUNT
36             Number of different gas mixes used in this dive.  The value must
37             be a unsigned int.
38
39     DC_FIELD_GASMIX
40             Mixture for a particular gas.  The value must be a dc_gasmix_t,
41             which has double fields for oxygen, helium, and nitrogen.  These
42             are set to the unit fraction of gas (not percentage).  The flags
43             value is interpreted as the gas mixture index, which must be less
44             than the value of DC_FIELD_GASMIX_COUNT.
45
46     DC_FIELD_SALINITY
47             The water salinity as a dc_salinity_t field, which consists of a
48             type, DC_WATER_FRESH or DC_WATER_SALT, and the salinity density.
49
50     DC_FIELD_ATMOSPHERIC
51             Atmospheric pressure in bar.  The value field must be a double.
52
53     DC_FIELD_TEMPERATURE_SURFACE
54             Air temperature (at the surface) in Celsius.  The value field
55             must be a double.
56
57     DC_FIELD_TEMPERATURE_MINIMUM
58             Minimum water temperature surface in Celsius.  The value field
59             must be a double.
60
61     DC_FIELD_TEMPERATURE_MAXIMUM
62             Maximum water temperature in Celsius.  The value field must be a
63             double.
64
65     DC_FIELD_TANK_COUNT
66             The number of tanks as an unsigned int.
67
68     DC_FIELD_TANK
69             Tank configuration as a dc_tank_t.  This structure consists of a
70             gasmix, which may be retrieved with DC_FIELD_GASMIX; type, the
71             tank volume units as DC_TANKVOLUME_NONE, DC_TANKVOLUME_IMPERIAL,
72             or DC_TANKVOLUME_METRIC; volume, the tank volume in bar or zero
73             if the tank is DC_TANKVOLUME_NONE; workpressure, the work pres‐
74             sure in bar or zero if DC_TANKVOLUME_NONE and maybe zero if
75             DC_TANKVOLUME_METRIC; beginpressure and endpressure being the
76             pressures at start and finish in bar.  The flags value is the
77             tank index.
78
79     DC_FIELD_DIVEMODE
80             Mode of the dive: DC_DIVEMODE_FREEDIVE for free-diving,
81             DC_DIVEMODE_GAUGE for gauge (i.e., running as a record and not
82             computing, say, decompression events), DC_DIVEMODE_OC for stan‐
83             dard open-circuit diving, and DC_DIVEMODE_CC for closed-circuit
84             “rebreather” diving.
85

RETURN VALUES

87     Returns DC_STATUS_SUCCESS if the field was retrieved,
88     DC_STATUS_UNSUPPORTED if the field is not supported by the device, or
89     other error messages on further failure.
90

SEE ALSO

92     dc_parser_set_data(3)
93

AUTHORS

95     The library “libdivecomputer” library was written by Jef Driesen,
96     jef@libdivecomputer.org.  The manpages were written by
97     Kristaps Dzonsons, kristaps@bsd.lv.
98
99BSD                             January 5, 2017                            BSD
Impressum