DC_DESCRIPTOR_ITERATOR(3)

πŸ“¦ version 0.9.0, in nixos 26.05, nixpkgs unstable

🌸 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