/* Support functions for mdebug_dump_plist. */
-static void
+static int
dump_string (char *str)
{
char *p = str, *pend = p + strlen (p), *new, *p1;
p++;
}
*p1 = '\0';
- fprintf (stderr, "%s", new);
+ return fprintf (stderr, "%s", new);
}
static void
prefix[indent] = 0;
key = MPLIST_KEY (plist);
- fprintf (stderr, "(%s(#%d) ", msymbol_name (MPLIST_KEY (plist)),
- plist->control.ref_count);
if (key == Msymbol)
dump_string (msymbol_name (MPLIST_SYMBOL (plist)));
else if (key == Mtext)
mdebug_dump_mtext (MPLIST_MTEXT (plist), indent, 0);
else if (key == Minteger)
- fprintf (stderr, "%x", MPLIST_INTEGER (plist));
+ fprintf (stderr, "0x%x", MPLIST_INTEGER (plist));
else if (key == Mstring)
fprintf (stderr, "\"%s\"", MPLIST_STRING (plist));
- else if (MPLIST_NESTED_P (plist))
+ else if (key == Mplist)
+ mdebug_dump_plist (MPLIST_PLIST (plist), indent);
+ else
{
- fprintf (stderr, "\n%s", prefix);
- mdebug_dump_plist (MPLIST_PLIST (plist), indent);
+ indent = dump_string (msymbol_name (MPLIST_SYMBOL (plist))) + 1;
+ fprintf (stderr, ":");
+ if (MPLIST_NESTED_P (plist))
+ mdebug_dump_plist (MPLIST_PLIST (plist), indent);
+ else
+ fprintf (stderr, "0x%X", (unsigned) MPLIST_VAL (plist));
}
- else
- fprintf (stderr, "0x%X", (unsigned) MPLIST_VAL (plist));
- fprintf (stderr, ")");
}
\f