vf_set_prop_value(3)

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

πŸ’– vf_set_prop_value β€” bestie, we're setting property values πŸ’–

okay so real talk, this is vf_set_prop_value(3) from the <../vformat/vf_iface.h> cinematic universe, and it's literally the girl who puts values into your properties. no cap.


✨ SYNOPSIS ✨

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

extern bool_t vf_set_prop_value
(
     VF_PROP_T *p_prop,
     void *p_value,
     uint32_t n_param,
     vf_encoding_t encoding,
     bool_t copy
);

like. look at her. five whole arguments. main character energy fr fr πŸŽ€


🌸 PARAMETERS 🌸

  • VF_PROP_T *p_prop β€” the property itself, bestie. the one we're setting values on. the moment.
  • void *p_value β€” pointer to the data. yes it's void *, no we don't talk about it, she contains multitudes πŸ’…
  • uint32_t n_param β€” the data size or the index, depending on the situation. she's flexible like that.
  • vf_encoding_t encoding β€” the encoding in use. keep this in your notes, it's gonna matter in a sec πŸ‘€
  • bool_t copy β€” do we copy the data? asking for a friend. (the friend is you. you're asking.)

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does she do? She sets values associated with a property. That's it. That's the job. Iconic of her honestly.

But here's the tea, and it's important tea, so listen up: if you pass in a value of encoding that is not the same as the current property encoding, the property contents get freed before the indicated value is set. Like, obliterated. Gone. Prior to setting. So if you were attached to what was in there... 😭 that's on you for not checking the encoding first, bestie.

not me warning you that mismatched encodings will free your property contents β€” that's a real caveat, don't sleep on it 🫢

πŸ”₯ RETURNS πŸ”₯

TRUE <=> re-allocation success & encoding correct, FALSE else.

so like. TRUE means both things went right (re-allocation succeeded AND the encoding was correct), and FALSE is the catch-all for everything else. vibe check: passed or failed, no in-between, periodt.


πŸ’œ SEE ALSO πŸ’œ

the whole friend group showed up, we love a supportive squad:

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_get_prop_value_string(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 whole page, bestie!! this lil masterpiece came out of c2man vf_iface.h, dated 30 April 2003 β€” yes she's a vintage queen and she still slays πŸ’–βœ¨ go forth and set those property values responsibly, mwah πŸŽ€

πŸ“¦ where this page comes from