vf_get_property(3)

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

πŸ’– vf_get_property(3) πŸ’–

okay bestie, settle in, because we're reading a page straight out of the Library Functions Manual and it's genuinely a whole vibe ✨


✨ NAME ✨

vf_get_property β€” literally vf_get_property(), that's it, that's the name πŸŽ€


🌸 SYNOPSIS 🌸

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

extern bool_t vf_get_property
(
     VF_PROP_T **pp_prop,
     VF_OBJECT_T *p_object,
     vf_get_t ops,
     const char *p_group,
     const char *p_name,
     const char *p_qualifier,
     ...
);

πŸ¦‹ PARAMETERS πŸ¦‹

  • VF_PROP_T **pp_prop β€” the output pointer, where your prize gets handed back to you πŸ’…
  • VF_OBJECT_T *p_object β€” the object we're adding to, bestie
  • vf_get_t ops β€” the search flags, aka your little mood ring for this call
  • const char *p_group β€” group name, if there even is one
  • const char *p_name β€” name of the tag
  • const char *p_qualifier β€” first qualifier, if any
  • ... β€” subsequent qualifiers (yes there's more, keep reading πŸ“–)

πŸ’œ DESCRIPTION πŸ’œ

So this is the basic searching function, and what it does is locate elements of the VOBJECT by qualified name. It's a varargs function, like sprintf, which means the argument list must be NULL terminated β€” and that is exactly why p_qualifier shows up in the arglist like that. no cap.

Valid calls might be:

vf_get_property(&p_out, p_object, VFGP_FIND, NULL, "N", NULL);
  • Find and return "N" properties. If there are none, return FALSE.
Vf_get_property(&p_out, p_object, VFGP_FIND, NULL, "TEL", "WORK", NULL);
  • Find and return "TEL" entries qualified by the "work" attribute (ie. work phone numbers). If there are none, return FALSE.
Vf_get_property(&p_out, p_object, VFGP_GET, NULL, "TEL", "WORK", NULL);
  • Find and return work phone number. The entry is automatically added if not pre-existing.
Vf_get_property(&p_out, p_object, VFGP_GET, NULL, "TEL", "WORK", NULL);
  • Find and return work phone numbers in the group identifier by the "ME" identifier. The entry is automatically added if not pre-existing.
Vf_get_property(&p_out, p_object, VFGP_FIND, "ME", "*", NULL);
  • Effectively enumerates all entries in the "ME" group.

A pointer to the first property matching the search criteria comes back to you through the pp_prop argument 🫢. The search actually locates all such matches, and a pointer to the subsequent entries (if there are more than one, iykyk) may be found by calling the vf_get_next_property() function.

The tags may occur in any order except that the p_name must be first. periodt.

Note that the VF_PROP_T returned by pp_prop is an opaque type, so the functions vf_get_prop_xxxx() etc. must be used to locate the real "values". no peeking behind the curtain, bestie πŸ™ˆ
⚠️ Cached search results (the list enumerated by subsequent calls to the vf_get_next_property() function) are maintained through the use of a single internal pointer, therefore this method is not thread safe. πŸ’€ be so careful.

🌈 RETURNS 🌈

TRUE iff found/added successfully. Ptr to prop returned via pp_prop. slay. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

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


mwah πŸ’‹ that's the whole page, and before you go: this little masterpiece was generated by c2man from vf_iface.h, dated 30 April 2003 β€” a true vintage icon, main character energy since '03 πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from