DC_IRDA_ITERATOR_NEW(3)

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

✨ dc_irda_iterator_new(3) ✨

okay bestie, so this is a page from the libdivecomputer manual and honestly it's giving "niche but iconic" πŸ’… buckle up.


πŸŽ€ NAME πŸŽ€

dc_irda_iterator_new β€” literally makes you an iterator so you can go enumerate all your IrDA devices. no cap.


πŸ“š LIBRARY πŸ“š

library β€œlibdivecomputer” 🫢


🌸 SYNOPSIS 🌸

#include <libdivecomputer/irda.h>

dc_status_t
dc_irda_iterator_new(dc_iterator_t **iterator, dc_context_t *context,
    dc_descriptor_t *descriptor);

πŸ’– DESCRIPTION πŸ’–

So basically this one iterates through all the available IrDA devices that match the descriptor you hand it. it takes a context that you opened with dc_context_new(3), plus a descriptor β€” and like, you usually find that descriptor by searching through dc_descriptor_iterator_new(3). iykyk πŸ”βœ¨

When it comes back with DC_STATUS_SUCCESS, the iterator gets set to a dc_iterator_t, and you can use that to iterate over all the available IrDA devices with dc_iterator_next(3). slay.

the value type of this iterator is dc_irda_device_t ⭐ that value is what you feed into the functions that pull info about this specific IrDA device, namely dc_irda_device_get_name(3) and dc_irda_device_get_address(3). and when you're done with the IrDA device, it needs to be freed with dc_irda_device_free(3). don't forget, bestie, that's a memory leak waiting to happen 😭

after you finish iterating, the iterator itself needs to be freed using dc_iterator_free(3) πŸ’€


πŸ”₯ RETURN VALUES πŸ”₯

Returns DC_STATUS_SUCCESS on success, or another dc_status_t code on failure. that's it, that's the vibe check.

on DC_STATUS_SUCCESS the returned iterator needs to be freed when you're done using dc_iterator_free(3) πŸ‘‘


🌈 SEE ALSO 🌈

dc_context_new(3), dc_usbhid_iterator_new(3), dc_serial_iterator_new(3), dc_bluetooth_iterator_new(3), dc_irda_device_get_name(3), dc_irda_device_get_address(3), dc_irda_device_free(3).


πŸ¦‹ AUTHORS πŸ¦‹

the library β€œlibdivecomputer” library was written by Jef Driesen, jef@libdivecomputer.org. 🫑

this manpage is written by Vincent Hagen, vinnie@script4web.nl. ✨


and that's the whole page, bestie πŸ’œ this one's from Debian, dated June 5, 2020 β€” periodt. go forth and iterate responsibly πŸ§šβ€β™€οΈπŸŒΈ

πŸ“¦ where this page comes from