NUTSCAN_ADD_DEVICE_T(3)
π NUTSCAN_ADD_DEVICE_T(3) π
okay bestie, welcome to the NUT Manual β¨ today we're learning about nutscan_add_device_to_device, which is literally the "and they were roommates" of device structs. sit down, grab a strawberry π, let's go.
πΈ NAME πΈ
nutscan_add_device_to_device β concatenate two devices structure π«Ά
β¨ SYNOPSIS β¨
#include <nut-scan.h>
nutscan_device_t * nutscan_add_device_to_device(
nutscan_device_t * first,
nutscan_device_t * second);
no cap, that's the whole vibe. two pointers in, one pointer out π
π¦ DESCRIPTION π¦
so the nutscan_device_t is carrying these variables around like it's got main character energy:
nutscan_device_type_t type;
char * driver;
char * alt_driver_names;
char * port;
nutscan_options_t opt;
struct nutscan_device * prev;
struct nutscan_device * next;
it's giving double linked list of device. every single device is described by its type, its driver name, its port, and then any number of optional data on top. iconic honestly.
and what does nutscan_add_device_to_device() actually do? it concatenates first and second devices into one unique device. and the way that it does thisβ¦ okay so listen. no new device is created. none. zero. the two linked lists are simply linked to each other. that's it, that's the whole trick π
which means first and second devices are likely to be modified by this function. yes fr fr, it's touching your stuff. not a copy situation. not a clone situation. it's rearranging the actual originals. be aware π
π RETURN VALUE π
nutscan_add_device_to_device() returns a pointer to a device containing both passed devices. but bestie β heads up β it's not a new device. so what you get back is either first or second which is returned. one of them. no third mystery device. sorry to disappoint π
π NOTES π
technically (iykyk), the function is currently defined in nutscan-device.h file. yeah, not where you'd expect. it's fine. we move.
π SEE ALSO π
nutscan_scan_usb(3)nutscan_scan_xml_http_range(3)nutscan_scan_nut(3)nutscan_scan_avahi(3)nutscan_scan_ipmi(3)nutscan_scan_snmp(3)nutscan_display_ups_conf(3)nutscan_display_parsable(3)nutscan_new_device(3)nutscan_free_device(3)nutscan_add_option_to_device(3)
go read those next, they're all bangers π₯
and that's the whole page bestie, you ate π β¨ this was Network UPS Tools 2.8.5, dated 10/07/2026 β go forth and link those lists, mwah ππ¦π
π¦ where this page comes from
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms