DC_IRDA_ITERATOR_NEW(3)
β¨ 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
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2020 Vincent Hagen <vinnie@script4web.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms