DC_DESCRIPTOR_GET_VENDOR(3)
π dc_descriptor_get_vendor(3) β the library functions manual, bestie edition
okay so this is a page from the libdivecomputer manual, section 3 (library functions), and it's about one smol function that gets you the vendor name off a dive computer descriptor. yes. that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
dc_descriptor_get_vendor β literally just gets the vendor of a dive computer descriptor. that's it. that's the function. π
π LIBRARY π
the library is libdivecomputer, bestie. that's where all this lives. π
π§ SYNOPSIS π§
like this:
#include <libdivecomputer/descriptor.h>
const char *
dc_descriptor_get_vendor(const dc_descriptor_t *descriptor);
so you pull in that header, and then you call the function with a pointer to a dc_descriptor_t. simple as. β¨
πΈ DESCRIPTION πΈ
the way this works is: you hand it a dive computer descriptor, and it gives you back the vendor β think stuff like "Suunto" β as a string. iconic.
and if nobody ever declared a vendor for that descriptor? you get NULL. no vendor, no problem. π
π¦ RETURN VALUES π¦
so what comes back out:
- a nil-terminated vendor string β that's your friendship bracelet of text π
- or
NULLif none exists at all
β οΈ real talk tho, bestie: the returned pointer is not valid after the descriptor has been freed. like, it's not yours anymore. reading it after a free is giving undefined-behavior main character energy, and not in a good way. do not do it. π
π SEE ALSO π
dc_descriptor_get_product(3)β the sibling function, the other half of the descriptor info duo π
π AUTHORS π
the library libdivecomputer was written by Jef Driesen β jef@libdivecomputer.org. π§
the manpages were written by Kristaps Dzonsons β kristaps@bsd.lv. π§
absolute legends, both of them. no cap. π₯
okay that's the whole page, you're officially educated π and this cutie dropped on Debian, January 5, 2017 β that's the source and the date, sign-off complete, mwah πβ¨
π¦ where this page comes from
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2017 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms