aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcdbg.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-07 12:17:07 +0100
committermarha <marha@users.sourceforge.net>2013-01-07 12:17:07 +0100
commit0e950715b62dcf30ffbf69831bf932fd348537e5 (patch)
tree83fdafc455e9906f029e2e1ad926fb35c98e7be9 /fontconfig/src/fcdbg.c
parent506537495e6d808f219361a5b270510c752e7a2e (diff)
parent3f553aaceddc9b09363c73d9bea40eaea8164fc4 (diff)
downloadvcxsrv-0e950715b62dcf30ffbf69831bf932fd348537e5.tar.gz
vcxsrv-0e950715b62dcf30ffbf69831bf932fd348537e5.tar.bz2
vcxsrv-0e950715b62dcf30ffbf69831bf932fd348537e5.zip
Merge remote-tracking branch 'origin/released'
* origin/released: pixman xkbcomp libX11 libXau mesa fontconfig xserver xkeyboard-config git update 7 jan 2013 Conflicts: fontconfig/src/fcatomic.c pixman/pixman/pixman-mmx.c pixman/pixman/pixman-sse2.c xorg-server/dix/dispatch.c xorg-server/hw/xwin/wincursor.c xorg-server/hw/xwin/winmsg.c xorg-server/hw/xwin/winscrinit.c xorg-server/hw/xwin/winsetsp.c xorg-server/hw/xwin/winwin32rootless.c xorg-server/xfixes/cursor.c
Diffstat (limited to 'fontconfig/src/fcdbg.c')
-rw-r--r--fontconfig/src/fcdbg.c75
1 files changed, 50 insertions, 25 deletions
diff --git a/fontconfig/src/fcdbg.c b/fontconfig/src/fcdbg.c
index a1ed2b2dd..270d79179 100644
--- a/fontconfig/src/fcdbg.c
+++ b/fontconfig/src/fcdbg.c
@@ -27,44 +27,52 @@
#include <stdlib.h>
static void
-_FcValuePrint (const FcValue v)
+_FcValuePrintFile (FILE *f, const FcValue v)
{
switch (v.type) {
case FcTypeVoid:
- printf ("<void>");
+ fprintf (f, "<void>");
break;
case FcTypeInteger:
- printf ("%d(i)", v.u.i);
+ fprintf (f, "%d(i)", v.u.i);
break;
case FcTypeDouble:
- printf ("%g(f)", v.u.d);
+ fprintf (f, "%g(f)", v.u.d);
break;
case FcTypeString:
- printf ("\"%s\"", v.u.s);
+ fprintf (f, "\"%s\"", v.u.s);
break;
case FcTypeBool:
- printf ("%s", v.u.b ? "FcTrue" : "FcFalse");
+ fprintf (f, "%s", v.u.b ? "True" : "False");
break;
case FcTypeMatrix:
- printf ("(%f %f; %f %f)", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
+ fprintf (f, "[%g %g; %g %g]", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
break;
case FcTypeCharSet: /* XXX */
- FcCharSetPrint (v.u.c);
+ if (f == stdout)
+ FcCharSetPrint (v.u.c);
break;
case FcTypeLangSet:
FcLangSetPrint (v.u.l);
break;
case FcTypeFTFace:
- printf ("face");
+ fprintf (f, "face");
break;
}
}
void
+FcValuePrintFile (FILE *f, const FcValue v)
+{
+ fprintf (f, " ");
+ _FcValuePrintFile (f, v);
+}
+
+void
FcValuePrint (const FcValue v)
{
printf (" ");
- _FcValuePrint (v);
+ _FcValuePrintFile (stdout, v);
}
void
@@ -74,7 +82,7 @@ FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark)
printf (" [insert here] ");
else
printf (" ");
- _FcValuePrint (v);
+ _FcValuePrintFile (stdout, v);
}
static void
@@ -249,11 +257,17 @@ FcExprPrint (const FcExpr *expr)
case FcOpInteger: printf ("%d", expr->u.ival); break;
case FcOpDouble: printf ("%g", expr->u.dval); break;
case FcOpString: printf ("\"%s\"", expr->u.sval); break;
- case FcOpMatrix: printf ("[%g %g %g %g]",
- expr->u.mval->xx,
- expr->u.mval->xy,
- expr->u.mval->yx,
- expr->u.mval->yy); break;
+ case FcOpMatrix:
+ printf ("[");
+ FcExprPrint (expr->u.mexpr->xx);
+ printf (" ");
+ FcExprPrint (expr->u.mexpr->xy);
+ printf ("; ");
+ FcExprPrint (expr->u.mexpr->yx);
+ printf (" ");
+ FcExprPrint (expr->u.mexpr->yy);
+ printf ("]");
+ break;
case FcOpRange: break;
case FcOpBool: printf ("%s", expr->u.bval ? "true" : "false"); break;
case FcOpCharSet: printf ("charset\n"); break;
@@ -263,7 +277,16 @@ FcExprPrint (const FcExpr *expr)
printf ("\n");
break;
case FcOpNil: printf ("nil\n"); break;
- case FcOpField: printf ("%s", FcObjectName(expr->u.object)); break;
+ case FcOpField: printf ("%s ", FcObjectName(expr->u.name.object));
+ switch ((int) expr->u.name.kind) {
+ case FcMatchPattern:
+ printf ("(pattern) ");
+ break;
+ case FcMatchFont:
+ printf ("(font) ");
+ break;
+ }
+ break;
case FcOpConst: printf ("%s", expr->u.constant); break;
case FcOpQuest:
FcExprPrint (expr->u.tree.left);
@@ -432,15 +455,17 @@ int FcDebugVal;
void
FcInitDebug (void)
{
- char *e;
+ if (!FcDebugVal) {
+ char *e;
- e = getenv ("FC_DEBUG");
- if (e)
- {
- printf ("FC_DEBUG=%s\n", e);
- FcDebugVal = atoi (e);
- if (FcDebugVal < 0)
- FcDebugVal = 0;
+ e = getenv ("FC_DEBUG");
+ if (e)
+ {
+ printf ("FC_DEBUG=%s\n", e);
+ FcDebugVal = atoi (e);
+ if (FcDebugVal < 0)
+ FcDebugVal = 0;
+ }
}
}
#define __fcdbg__