Add FcLangSetPrint

This commit is contained in:
Keith Packard 2003-03-05 05:52:51 +00:00
parent 793e946c2f
commit 55ef7dac64
1 changed files with 18 additions and 11 deletions

View File

@ -1,7 +1,7 @@
/* /*
* $XFree86: xc/lib/fontconfig/src/fcdbg.c,v 1.10 2002/08/22 18:53:22 keithp Exp $ * $RCSId: xc/lib/fontconfig/src/fcdbg.c,v 1.10 2002/08/22 18:53:22 keithp Exp $
* *
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * Copyright © 2000 Keith Packard
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that * documentation for any purpose is hereby granted without fee, provided that
@ -29,9 +29,6 @@
void void
FcValuePrint (const FcValue v) FcValuePrint (const FcValue v)
{ {
FcStrBuf buf;
FcChar8 init_buf[1024];
switch (v.type) { switch (v.type) {
case FcTypeVoid: case FcTypeVoid:
printf (" <void>"); printf (" <void>");
@ -55,12 +52,8 @@ FcValuePrint (const FcValue v)
printf (" set"); printf (" set");
break; break;
case FcTypeLangSet: case FcTypeLangSet:
FcStrBufInit (&buf, init_buf, sizeof (init_buf)); printf (" ");
if (FcNameUnparseLangSet (&buf, v.u.l) && FcStrBufChar (&buf,'\0')) FcLangSetPrint (v.u.l);
printf (" %s", buf.buf);
else
printf ("langset (alloc error)");
FcStrBufDestroy (&buf);
break; break;
case FcTypeFTFace: case FcTypeFTFace:
printf (" face"); printf (" face");
@ -88,6 +81,20 @@ FcValueListPrint (const FcValueList *l)
} }
} }
void
FcLangSetPrint (const FcLangSet *ls)
{
FcStrBuf buf;
FcChar8 init_buf[1024];
FcStrBufInit (&buf, init_buf, sizeof (init_buf));
if (FcNameUnparseLangSet (&buf, ls) && FcStrBufChar (&buf,'\0'))
printf ("%s", buf.buf);
else
printf ("langset (alloc error)");
FcStrBufDestroy (&buf);
}
void void
FcPatternPrint (const FcPattern *p) FcPatternPrint (const FcPattern *p)
{ {