]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcdbg.c
Bump libtool revision in preparation for release
[fontconfig.git] / src / fcdbg.c
index 607ddc1e46fc916759df50b4fc4801a367ed576b..fd2d55a6b23b73394b8c332d99d85c269036999d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $RCSId: xc/lib/fontconfig/src/fcdbg.c,v 1.10 2002/08/22 18:53:22 keithp Exp $
+ * fontconfig/src/fcdbg.c
  *
  * Copyright © 2000 Keith Packard
  *
  * representations about the suitability of this software for any purpose.  It
  * is provided "as is" without express or implied warranty.
  *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "fcint.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include "fcint.h"
 
 void
 FcValuePrint (const FcValue v)
@@ -49,7 +49,8 @@ FcValuePrint (const FcValue v)
        printf (" (%f %f; %f %f)", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
        break;
     case FcTypeCharSet:        /* XXX */
-       printf (" set");
+       printf (" ");
+       FcCharSetPrint (v.u.c);
        break;
     case FcTypeLangSet:
        printf (" ");
@@ -64,10 +65,10 @@ FcValuePrint (const FcValue v)
 void
 FcValueListPrint (FcValueListPtr l)
 {
-    for (; FcValueListPtrU(l); l = FcValueListPtrU(l)->next)
+    for (; l != NULL; l = FcValueListNext(l))
     {
-       FcValuePrint (FcValueCanonicalize(&FcValueListPtrU(l)->value));
-       switch (FcValueListPtrU(l)->binding) {
+       FcValuePrint (FcValueCanonicalize(&l->value));
+       switch (l->binding) {
        case FcValueBindingWeak:
            printf ("(w)");
            break;
@@ -95,6 +96,40 @@ FcLangSetPrint (const FcLangSet *ls)
     FcStrBufDestroy (&buf);
 }
 
+void
+FcCharSetPrint (const FcCharSet *c)
+{
+    int        i, j;
+    intptr_t   *leaves = FcCharSetLeaves (c);
+    FcChar16   *numbers = FcCharSetNumbers (c);
+    
+#if 0
+    printf ("CharSet  0x%x\n", (intptr_t) c);
+    printf ("Leaves:  +%d = 0x%x\n", c->leaves_offset, (intptr_t) leaves);
+    printf ("Numbers: +%d = 0x%x\n", c->numbers_offset, (intptr_t) numbers);
+    
+    for (i = 0; i < c->num; i++)
+    {
+       printf ("Page %d: %04x +%d = 0x%x\n", 
+               i, numbers[i], leaves[i], 
+               (intptr_t) FcOffsetToPtr (leaves, leaves[i], FcCharLeaf));
+    }
+#endif
+               
+    printf ("\n");
+    for (i = 0; i < c->num; i++)
+    {
+       intptr_t        leaf_offset = leaves[i];
+       FcCharLeaf      *leaf = FcOffsetToPtr (leaves, leaf_offset, FcCharLeaf);
+       
+       printf ("\t");
+       printf ("%04x:", numbers[i]);
+       for (j = 0; j < 256/32; j++)
+           printf (" %08x", leaf->map[j]);
+       printf ("\n");
+    }
+}
+
 void
 FcPatternPrint (const FcPattern *p)
 {
@@ -109,9 +144,9 @@ FcPatternPrint (const FcPattern *p)
     printf ("Pattern has %d elts (size %d)\n", p->num, p->size);
     for (i = 0; i < p->num; i++)
     {
-       e = FcPatternEltU(p->elts) + i;
-       printf ("\t%s:", FcObjectPtrU(e->object));
-       FcValueListPrint (e->values);
+       e = &FcPatternElts(p)[i];
+       printf ("\t%s:", FcObjectName(e->object));
+       FcValueListPrint (FcPatternEltValues(e));
        printf ("\n");
     }
     printf ("\n");
@@ -178,7 +213,7 @@ FcExprPrint (const FcExpr *expr)
     case FcOpBool: printf ("%s", expr->u.bval ? "true" : "false"); break;
     case FcOpCharSet: printf ("charset\n"); break;
     case FcOpNil: printf ("nil\n"); break;
-    case FcOpField: printf ("%s", expr->u.field); break;
+    case FcOpField: printf ("%s", FcObjectName(expr->u.object)); break;
     case FcOpConst: printf ("%s", expr->u.constant); break;
     case FcOpQuest:
        FcExprPrint (expr->u.tree.left);
@@ -273,6 +308,9 @@ FcTestPrint (const FcTest *test)
     case FcMatchFont:
        printf ("font ");
        break;
+    case FcMatchScan:
+       printf ("scan ");
+       break;
     }
     switch (test->qual) {
     case FcQualAny:
@@ -288,7 +326,7 @@ FcTestPrint (const FcTest *test)
        printf ("not_first ");
        break;
     }
-    printf ("%s ", test->field);
+    printf ("%s ", FcObjectName (test->object));
     FcOpPrint (test->op);
     printf (" ");
     FcExprPrint (test->expr);
@@ -298,7 +336,7 @@ FcTestPrint (const FcTest *test)
 void
 FcEditPrint (const FcEdit *edit)
 {
-    printf ("Edit %s ", edit->field);
+    printf ("Edit %s ", FcObjectName (edit->object));
     FcOpPrint (edit->op);
     printf (" ");
     FcExprPrint (edit->expr);
@@ -355,3 +393,6 @@ FcInitDebug (void)
            FcDebugVal = 0;
     }
 }
+#define __fcdbg__
+#include "fcaliastail.h"
+#undef __fcdbg__