- return func (c, pat, buf)
-#if 0
- BUILTIN ("unparse", FcNameUnparse);
- BUILTIN ("verbose", FcPatternPrint);
- BUILTIN2 ("fcmatch", FcStrDirname);
- BUILTIN2 ("fclist", FcStrDirname);
- BUILTIN2 ("pkgkit", FcStrDirname);
-#endif
-
- message ("unknown builtin \"%s\"",
- c->word);
- return FcFalse;
+ do { new_str = func (pat); ret = FcTrue; } while (0)
+ BUILTIN ("unparse", FcNameUnparse);
+ /* BUILTIN ("verbose", FcPatternPrint); */
+#undef BUILTIN
+ else
+ ret = FcFalse;
+
+ if (ret)
+ {
+ if (new_str)
+ {
+ FcStrBufString (buf, new_str);
+ free (new_str);
+ return FcTrue;
+ }
+ else
+ return FcFalse;
+ }
+
+ /* now try our custom formats */
+ if (0) { }
+#define BUILTIN(name, format) \
+ else if (0 == strcmp ((const char *) c->word, name))\
+ ret = FcPatternFormatToBuf (pat, (const FcChar8 *) format, buf)
+ BUILTIN ("fcmatch", FCMATCH_FORMAT);
+ BUILTIN ("fclist", FCLIST_FORMAT);
+#undef BUILTIN
+ else
+ ret = FcFalse;
+
+ if (!ret)
+ message ("unknown builtin \"%s\"",
+ c->word);
+
+ return ret;