summaryrefslogtreecommitdiff
path: root/src/fcdbg.c
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2013-07-04 19:51:03 +0900
committerAkira TAGOH <akira@tagoh.org>2013-07-04 19:51:03 +0900
commitd420e1df983871ab18b0f07976596fdf0ce78847 (patch)
treef60d21a06f005a316497bfbc0d5d812127de7ecb /src/fcdbg.c
parent1162515a9819c7355890aad919e5b9daa448a3a4 (diff)
Rework to apply the intermixed test and edit elements in one-pass
Diffstat (limited to 'src/fcdbg.c')
-rw-r--r--src/fcdbg.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/fcdbg.c b/src/fcdbg.c
index ce64214..d74bc27 100644
--- a/src/fcdbg.c
+++ b/src/fcdbg.c
@@ -427,21 +427,38 @@ FcEditPrint (const FcEdit *edit)
void
FcSubstPrint (const FcSubst *subst)
{
- FcEdit *e;
- FcTest *t;
+ FcRule *r;
+ FcRuleType last_type = FcRuleUnknown;
printf ("match\n");
- for (t = subst->test; t; t = t->next)
- {
- printf ("\t");
- FcTestPrint (t);
- }
- printf ("edit\n");
- for (e = subst->edit; e; e = e->next)
+ for (r = subst->rule; r; r = r->next)
{
+ if (last_type != r->type)
+ {
+ switch (r->type) {
+ case FcRuleTest:
+ printf ("[test]\n");
+ break;
+ case FcRuleEdit:
+ printf ("[edit]\n");
+ break;
+ default:
+ break;
+ }
+ last_type = r->type;
+ }
printf ("\t");
- FcEditPrint (e);
- printf (";\n");
+ switch (r->type) {
+ case FcRuleTest:
+ FcTestPrint (r->u.test);
+ break;
+ case FcRuleEdit:
+ FcEditPrint (r->u.edit);
+ printf (";\n");
+ break;
+ default:
+ break;
+ }
}
printf ("\n");
}