1DC_DESCRIPTOR_ITERATO... BSD Library Functions Manual DC_DESCRIPTOR_ITERATO...
2
4 dc_descriptor_iterator — get all supported dive computers
5
7 library “libdivecomputer”
8
10 #include <libdivecomputer/descriptor.h>
11
12 dc_status_t
13 dc_descriptor_iterator(dc_iterator_t **iterator);
14
16 Gets all descriptors available to library “libdivecomputer”. It must be
17 matched with dc_iterator_free(3) if the return value is
18 DC_STATUS_SUCCESS. The dc_iterator_next(3) function must be used to
19 iterate over the iterator. You must use dc_descriptor_free(3) on the
20 returned descriptor value.
21
23 This returns DC_STATUS_SUCCESS and fills in the iterator pointer on suc‐
24 cess.
25
27 The following iterates over all descriptors, printing the vendor, then
28 frees the iterator. It does no error checking.
29
30 dc_descriptor_iterator(&iter));
31 while (dc_iterator_next(iter, &desc) == DC_STATUS_SUCCESS) {
32 printf("%s\n", dc_descriptor_get_vendor(desc));
33 dc_descriptor_free(desc);
34 }
35 dc_iterator_free(iter);
36
38 dc_descriptor_free(3), dc_iterator_free(3), dc_iterator_next(3)
39
41 The library “libdivecomputer” library was written by Jef Driesen,
42 jef@libdivecomputer.org. The manpages were written by
43 Kristaps Dzonsons, kristaps@bsd.lv.
44
45BSD January 5, 2017 BSD