[Fontconfig] RFC: new API proposal for FcPattern iterator

Akira TAGOH akira at tagoh.org
Wed Sep 12 18:33:23 PDT 2012


I'm working on adding new API to iterate things in FcPattern now:

and proposing following APIs:
int FcPatternObjectCount (const FcPattern *pat)
  Returns the number of the object in FcPattern.

void FcPatternIterStart (const FcPattern *pat, FcPatternIter *iter)
  Initialize the iterator with the first iterator in FcPattern.

FcBool FcPatternIterNext (const FcPattern *pat, FcPatternIter *iter)
  Set the iterator to point to the next object in FcPattern.

FcBool FcPatternIterEqual (const FcPattern *p1, FcPatternIter *i1,
const FcPattern *p2, FcPatternIter *i2)
  Check if both iterators point to same object and contain same value.

FcBool FcPatternFindIter (const FcPattern *pat, FcPatternIter *iter,
const char *object)
  Set the iterator to point to the object in FcPattern if any and
return FcTrue. return FcFalse otherwise.

FcBool FcPatternIterIsValid (const FcPattern *pat, FcPatternIter *iter)
  Check if the iterator point to the valid entry in FcPattern. return
FcFalse otherwise.

const char *FcPatternIterGetObject (const FcPattern *pat, FcPatternIter *iter)
  Return the object name in FcPattern which the iterator point to.

int FcPatternIterValueCount (const FcPattern *pat, FcPatternIter *iter)
  Return the number of the values in the object which the iterator point to.

void FcPatternIterGetValue (const FcPattern *pat, FcPatternIter *iter,
int id, FcValue *v)
  Return in FcValue nth value which the iterator point to.

Any comments and suggestions etc are welcome.


More information about the Fontconfig mailing list