FcPatternIterGetValue(3)

πŸ’… FcPatternIterGetValue β€” the manual page, but make it cute

okay so bestie, welcome to FcPatternIterGetValue(3) β€” yes that's the whole manual name, section 3, we're in C-library land now 🫢


✨ NAME ✨

FcPatternIterGetValue β€” hands you back a value that your iterator is currently pointing at πŸ’«


🌸 SYNOPSIS 🌸

#include <fontconfig/fontconfig.h>

FcResult FcPatternIterGetValue (const FcPattern *p, FcPatternIter *iter, int id, FcValue *v, FcValueBinding *b);

the way that signature is long β€” but like, every single piece is doing something, so let's not skip anybody πŸ™ˆ


πŸŽ€ DESCRIPTION πŸŽ€

So here's the vibe: your iterator is chilling somewhere inside a pattern, right? This function goes and grabs the id'th value that iter is pointing at, and drops it into v. Slay. ✨

And if you also hand it b, it'll write the binding in there too. Two for one, no cap πŸ’–

Now the important part, the part where you listen to me πŸ‘‘ β€” the value that comes back is not a copy. It literally refers to the data stored inside the pattern itself. So like...

⚠️ Applications must not free this value. Not even a little. Not even if you're being polite about it. That's not your memory to free, bestie, and freeing it is giving undefined-behaviour main character energy πŸ’€

think of it as borrowing your friend's hoodie β€” you wear it, you look cute, but you give it back by not setting it on fire πŸ”₯

Key bits to remember, fr fr:

  • the const FcPattern *p is the pattern you're poking at πŸ¦‹
  • FcPatternIter *iter is the iterator doing the pointing
  • int id is which value you want β€” the id'th one
  • FcValue *v is where that value lands
  • FcValueBinding *b gets the binding β€” but only if you actually pass it, otherwise it's skipped πŸŽ€
  • the return type is FcResult

⭐ SINCE ⭐

this one's been around since version 2.13.1 β€” an icon, an elder, a legend πŸ’…


<div align="center"></div>

okay that's the whole page!! no notes, you ate that πŸ“

🧚 signing off with the receipts: this is from Fontconfig 2.17.0, dated 27 June 2025. go forth and do not free that value πŸ˜­πŸ’œ
πŸ“¦ where this page comes from