vf_get_prop_value(3)

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

πŸ’– vf_get_prop_value(3) πŸ’–

okay bestie, so this one lives in the Library Functions Manual β€” it's vf_get_prop_value, a little function that goes and grabs the raw fields hanging off a property for you. yes it's giving "middle of a big vformat stack" energy, but it's honestly iconic once you get it. let's go 🫢


✨ SYNOPSIS ✨

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

extern bool_t vf_get_prop_value
(
     VF_PROP_T *p_prop,
     void **pp_value,
     uint32_t *p_size,
     vf_encoding_t *p_encoding
);

like look at her. four args, no notes. πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • VF_PROP_T *p_prop β€” the property. the actual thing you're snooping on. no property, no vibes.
  • void **pp_value β€” pointer value. this is where the good stuff gets handed back to you.
  • uint32_t *p_size β€” integer value. size info goes here, and what "size" means depends on the encoding (more on that below, don't skip it πŸ™ˆ).
  • vf_encoding_t *p_encoding β€” type of return values. this one tells you which flavour of raw field you're actually holding.

🌸 DESCRIPTION 🌸

so the whole point of this function is: get hold of the raw fields associated with the property. and bestie, those raw fields come in several different types, so you gotta know which one you're dealing with. here's the whole tea β˜•:

VF_ENC_VOBJECT

  • *Pp_value = pointer to contained VF_OBJECT_T which can be passed back to any of the object manipulation functions. cute, right? it's a whole object and you can just... hand it back to the object crew. πŸ¦‹

VF_ENC_7BIT, VF_ENC_QUOTEDPRINTABLE

  • *Pp_value = ptr to array of char*, *p_size = number of elts.

VF_ENC_8BIT, VF_BASE64

  • *Pp_value = ptr to bytes, *p_size = number of bytes.

see what i mean?? the same p_size pointer means elements in one world and bytes in the other. so please please PLEASE read p_encoding first, i am literally begging 😭 (respectfully πŸ’–).


⭐ RETURNS ⭐

TRUE <=> encoding is valid, FALSE else.

that's it. that's the whole return. valid encoding = TRUE, anything else = FALSE. vibe check passed or not passed, no in-between. periodt. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, obviously. these are all in the same vf_iface.h cinematic universe:

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_set_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)


lowkey a whole ecosystem, highkey worth reading through. iykyk 🌈

and that's the page!! this one was generated by c2man from vf_iface.h, dated 30 April 2003 β€” so yeah, she's an elder but she still slays πŸ’…βœ¨ bye bestie, go get those raw fields πŸ¦‹πŸ’–

πŸ“¦ where this page comes from