vf_find_prop_qual_index(3)

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

πŸ’– vf_find_prop_qual_index β€” library functions manual, but make it cute πŸ’–

okay bestie, welcome to vf_find_prop_qual_index(3) from the vformat vibes. yes it's a whole mouthful, no we're not skipping any of it. sit down, hydrate, let's go 🫢


✨ SYNOPSIS ✨

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

extern bool_t vf_find_prop_qual_index
(
     VF_PROP_T *p_prop,
     uint32_t *p_qualifier_index,
     uint32_t *p_found_value_index,
     const char **pp_possible_values,
     const char *p_token,
     vf_search_flags_t match
);

like. look at her. six params. main character energy fr πŸ’…


🌸 PARAMETERS 🌸

okay so every single one, no skips, let's meet the cast:

  • VF_PROP_T *p_prop β€” the property we're querying. that's the one you're interrogating bestie πŸ”
  • uint32_t *p_qualifier_index β€” a pointer to the output name index. it's where the answer goes, it's giving "output slot" energy ✨
  • uint32_t *p_found_value_index β€” a pointer to the output index in the array. also an output slot, also important πŸŽ€
  • const char **pp_possible_values β€” the array of possible values. the whole lil roster of candidates 🌈
  • const char *p_token β€” the token we're searching for. the one specific girlie you're looking for πŸ‘‘
  • vf_search_flags_t match β€” the string comparison flags. controls how the comparing goes down πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she actually do? she locates a property qualifier β€” and she does it one of two ways: either from an array of possible values, or from a single token that's either present or absent. literally either/or, no in-between, that's the vibe 😌

for example, say we have a property that looks like this:

NAME;THIRD;TIME;LUCKY:VALUE1;VALUE2;VALUE3

then there are two possible searches you can run. two flavors. two paths. pick your fighter 🧚

firstly, we can look for the property qualifier that takes values from the array { "FIRST", "SECOND", THIRD" } β€” in which case that array gets passed in as pp_possible_values, and the function comes back with:

  • *p_found_value_index=2
  • p_qualifier_index=1

secondly, we can look for the token with the value "TIME" β€” in which case p_token is set to "TIME" and the function comes back with *p_qualifier_index=2. that's it, that's the whole thing 🎯

ngl, if you read those two examples carefully you're already 90% of the way to understanding this function. the other 10% is just remembering which pointer is which. good luck bestie 😭

⭐ RETURNS ⭐

TRUE iff found, FALSE else.

that's it. found or not found. yes/no. slay or not slay. periodt πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

the whole squad, the entire friend group, no one left behind:

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


πŸ’€ one more thing before you go: this page came from c2man out of vf_iface.h, and the date on it is 30 April 2003. iconic behavior honestly. go forth and find those qualifier indices, bestie, you got this πŸ«ΆπŸ’–βœ¨
πŸ“¦ where this page comes from