DC_DESCRIPTOR_ITERATOR(3)
πΈ NAME πΈ
okay bestie, welcome to the Library Functions Manual page for DC_DESCRIPTOR_ITERATOR(3) π. This is all about dc_descriptor_iterator_new β get all supported dive computers β¨.
π LIBRARY π
library βlibdivecomputerβ π«Ά β thatβs the whole vibe.
β¨ SYNOPSIS β¨
#include <libdivecomputer/descriptor.h>
dc_status_t
dc_descriptor_iterator_new(dc_iterator_t **iterator,
dc_descriptor_t *descriptor);
π¦ DESCRIPTION π¦
So dc_descriptor_iterator_new gets all the descriptors available to library βlibdivecomputerβ. No cap, thatβs the whole job π
.
If the return value is DC_STATUS_SUCCESS, it must be matched with dc_iterator_free(3) β periodt. Then the dc_iterator_next(3) function must be used to iterate over the iterator. And bestie, you must use dc_descriptor_free(3) on the returned descriptor value. Cleanup is main character energy, okay? π
π RETURN VALUES π
On success this returns DC_STATUS_SUCCESS and fills in the iterator pointer. Thatβs the tea ββ¨.
π₯ EXAMPLES π₯
This code iterates over all descriptors, prints the vendor, then frees the iterator. It does no error checking β literally none, bestie π.
dc_descriptor_iterator_new(&iter, context));
while (dc_iterator_next(iter, &desc) == DC_STATUS_SUCCESS) {
printf("%s\n", dc_descriptor_get_vendor(desc));
dc_descriptor_free(desc);
}
dc_iterator_free(iter);
π SEE ALSO π
π AUTHORS π
The library βlibdivecomputerβ library was written by Jef Driesen, jef@libdivecomputer.org. The manpages were written by Kristaps Dzonsons, kristaps@bsd.lv. Absolute icons πβ¨.
xoxo, your Debian bestie π
β this page is dated January 5, 2017, and the footer title is DC_DESCRIPTOR_ITERATOR(3) π.
π¦ where this page comes from
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2017 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms