VF_GET_PROP_VALUE_STRING(3)

πŸ“¦ version 1.13, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– vf_get_prop_value_string(3) πŸ’–

okay bestie, welcome to the Library Functions Manual β€” yes that's the section name, we're in section 3, we're doing library function things, and this one is a little cutie. πŸŽ€


✨ NAME ✨

vf_get_prop_value_string β€” the function formerly known as... itself. it's literally just vf_get_prop_value_string(). no cap. that's the whole name. iconic behaviour honestly. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <../vformat/vf_iface.h>

extern char *vf_get_prop_value_string
(
     VF_PROP_T *p_prop,
     uint32_t n_string
);

look at that include path. <../vformat/vf_iface.h> β€” yes it really does start with ../, that's not a typo, that's just how it is, we don't question the ancestors. 🧚


πŸ¦‹ PARAMETERS πŸ¦‹

  • VF_PROP_T *p_prop β€” the property we're digging a string out of. this is the thing you're locating a string from. it's giving "source of truth" energy. πŸ’…
  • uint32_t n_string β€” the index of the string you want. zero-based, because of course it is, we live in a zero-based world. πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so basically: you hand it a VF_PROP_T and it hands you back a string pointer value from inside it. easy. slay.

let's say a property is defined like this:

THING;THIS=STUFF;WITH-QUALIFIERS:fred-fred-fred;gogogo;baabaabaa

see those semicolon-separated values after the colon? fred-fred-fred, then gogogo, then baabaabaa. they're numbered 0, 1, 2, bestie. so when you call vf_get_prop_value_string() and specify n_string=1, you get back a pointer to the gogogo value. the way that index 1 is just sitting there holding gogogo... obsessed. 😭

⚠️ and here's the part where you have to be careful: it returns NULL if you ask for something out of range. i.e. N_string=3 for N:0;1;2. there is no index 3. there is no fourth value. do not go looking for it. it will give you NULL and you will have to deal with that. πŸ’€

πŸ”₯ RETURNS πŸ”₯

a pointer to the string value if the value is present. and NULL if the index is too large. that's it, that's the whole deal. simple. clean. main character. ✨


🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” go read these too:

vf_parse_init(3), vf_parse_text(3), vf_parse_end(3), vf_read_file(3), vf_write_file(3), vf_get_next_object(3), vf_create_object(3), vf_get_object_type(3), vf_get_property(3), vf_get_property_ex(3), vf_get_next_property(3), vf_get_prop_value(3), vf_set_prop_value(3), vf_get_prop_name_string(3), vf_set_prop_name_string(3), vf_get_prop_name(3), vf_get_prop_value_object(3), vf_set_prop_value_object(3), vf_set_prop_value_string(3), vf_set_prop_value_base64(3), vf_get_prop_value_base64(3), vf_set_property_from_file(3), vf_delete_object(3), vf_delete_prop(3), vf_find_prop_qual_index(3), vf_is_modified(3), vf_find_charset(3), vf_date_string_to_time(3), vf_period_string_to_time(3), vf_period_time_to_string(3), vf_set_prop_value_time(3), vf_get_prop_value_time(3)


and that's the page!! 🫢 this whole thing came to you via c2man, out of the header vf_iface.h, dated 30 April 2003 β€” and the page itself is vf_get_prop_value_string(3). mwah. bye bestie, go forth and index responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from