NUTSCAN_NEW_DEVICE(3)

πŸ’– NUTSCAN_NEW_DEVICE πŸ’–

okay bestie, this one's from the NUT Manual (that's Network UPS Tools, not the snack, tho the acronym is giving snack energy ngl) and it's literally the babiest function in the whole device-handling family. it makes a new device struct. that's it. that's the whole vibe. πŸŽ€


✨ NAME ✨

nutscan_new_device β€” create a new nutscan_device_t structure.

like… it births a device struct. no cap. πŸ‘‘


✨ SYNOPSIS ✨

#include <nut-scan.h>

nutscan_device_t * nutscan_new_device(void);

no arguments, no drama, no parameters. she takes nothing and gives you a pointer. main character energy fr. πŸ’…


✨ DESCRIPTION ✨

so the nutscan_new_device() function allocates a new nutscan_device_type_t structure. that's the whole job description, bestie. she shows up, she mallocs, she hands it over. 🌸

yes, the manpage says nutscan_device_t in the name and the synopsis but nutscan_device_type_t in the description β€” that's just how the original rolls, and we do not fix what we do not own. πŸ’€

✨ RETURN VALUE ✨

nutscan_new_device() returns the newly allocated nutscan_device_type_t structure. fresh out of the box, brand new, never worn. πŸ›οΈβœ¨


✨ NOTES ✨

technically β€” and this is the iykyk part β€” the function is currently defined in the nutscan-device.h file. so if you're out here grepping nut-scan.h and getting nothing, that's why. not you being bad at grep. it's a header thing. πŸ™ˆ


✨ SEE ALSO ✨

the whole friend group, in the original order, no one left out 🫢:

pro tip from one bestie to another: if you call nutscan_new_device(), please go find nutscan_free_device(3) later. leaving structs un-freed is not the slay you think it is. 😭

okay that's the whole page!! this was Network UPS Tools 2.8.5, dated 10/07/2026, and it lives at NUTSCAN_NEW_DEVICE(3). go forth and allocate responsibly, mwah πŸ’‹πŸŒˆβ­

πŸ“¦ where this page comes from