return 0;
MDEBUG_PUSH_TIME ();
def_list = (MPlist *) mdatabase_load (mdb);
- MDEBUG_PRINT_TIME ("CHARSET", (stderr, " to load data."));
+ MDEBUG_PRINT_TIME ("CHARSET", (mdebug__output, " to load data."));
MDEBUG_POP_TIME ();
if (! def_list)
return -1;
}
M17N_OBJECT_UNREF (def_list);
- MDEBUG_PRINT_TIME ("CHARSET", (stderr, " to parse the loaded data."));
+ MDEBUG_PRINT_TIME ("CHARSET", (mdebug__output, " to parse the loaded data."));
MDEBUG_POP_TIME ();
return 0;
}
if (! table->contents.tables && table->default_value == default_value)
return;
- fprintf (stderr, "\n%s(sub%d (U+%04X U+%04X) ",
+ fprintf (mdebug__output, "\n%s(sub%d (U+%04X U+%04X) ",
prefix, depth, min_char, max_char);
if (key == Msymbol)
{
if (table->default_value)
- fprintf (stderr, "(default %s)",
+ fprintf (mdebug__output, "(default %s)",
((MSymbol) table->default_value)->name);
else
- fprintf (stderr, "(default nil)");
+ fprintf (mdebug__output, "(default nil)");
}
else
- fprintf (stderr, "(default #x%X)", (unsigned) table->default_value);
+ fprintf (mdebug__output, "(default #x%X)", (unsigned) table->default_value);
default_value = table->default_value;
if (table->contents.tables)
if (val == default_value)
continue;
default_value = *val;
- fprintf (stderr, "\n%s (U+%04X", prefix, min_char);
+ fprintf (mdebug__output, "\n%s (U+%04X", prefix, min_char);
while (i + 1 < chartab_slots[depth]
&& val[1] == default_value)
i++, val++, min_char++;
- fprintf (stderr, "-U+%04X ", min_char);
+ fprintf (mdebug__output, "-U+%04X ", min_char);
if (key == Msymbol)
{
if (default_value)
- fprintf (stderr, "%s)", ((MSymbol) default_value)->name);
+ fprintf (mdebug__output, "%s)",
+ ((MSymbol) default_value)->name);
else
- fprintf (stderr, "nil)");
+ fprintf (mdebug__output, "nil)");
}
else
- fprintf (stderr, " #xx%X)", (unsigned) default_value);
+ fprintf (mdebug__output, " #xx%X)", (unsigned) default_value);
}
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
\f
@brief Dump a chartable.
The mdebug_dump_chartab () function prints a chartable $TABLE in a
- human readable way to the stderr. $INDENT specifies how many
- columns to indent the lines but the first one.
+ human readable way to the stderr or to what specified by the
+ environment variable MDEBUG_OUTPUT_FILE. $INDENT specifies how
+ many columns to indent the lines but the first one.
@return
This function returns $TABLE. */
/***ja
@brief ʸ»ú¥Æ¡¼¥Ö¥ë¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_chartab () ¤Ïʸ»ú¥Æ¡¼¥Ö¥ë $TABLE ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_chartab () ¤Ïʸ»ú¥Æ¡¼¥Ö¥ë $TABLE ¤òɸ½à¥¨¥é¡¼½ÐÎÏ
+ ¤â¤·¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆÉ
+ ¤Ê·Á¤Ç°õºþ¤¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $TABLE ¤òÊÖ¤¹¡£ */
MCharTable *
mdebug_dump_chartab (MCharTable *table, int indent)
{
- fprintf (stderr, "(chartab (U+%04X U+%04X)",
+ fprintf (mdebug__output, "(chartab (U+%04X U+%04X)",
table->min_char, table->max_char);
dump_sub_chartab (&table->subtable, table->subtable.default_value,
table->key, indent + 2);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
return table;
}
return 0;
MDEBUG_PUSH_TIME ();
def_list = (MPlist *) mdatabase_load (mdb);
- MDEBUG_PRINT_TIME ("CODING", (stderr, " to load the data."));
+ MDEBUG_PRINT_TIME ("CODING", (mdebug__output, " to load the data."));
MDEBUG_POP_TIME ();
if (! def_list)
return -1;
}
M17N_OBJECT_UNREF (def_list);
- MDEBUG_PRINT_TIME ("CODING", (stderr, " to parse the loaded data."));
+ MDEBUG_PRINT_TIME ("CODING", (mdebug__output, " to parse the loaded data."));
MDEBUG_POP_TIME ();
return 0;
}
/***en
@brief Dump a face.
- The mdebug_dump_face () function prints face $FACE in a human readable
- way to the stderr. $INDENT specifies how many columns to indent
- the lines but the first one.
+ The mdebug_dump_face () function prints face $FACE in a human
+ readable way to the stderr or to what specified by the environment
+ variable MDEBUG_OUTPUT_FILE. $INDENT specifies how many columns
+ to indent the lines but the first one.
@return
This function returns $FACE. */
/***ja
@brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷¤¯¤Ï
+ ´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õ
+ ºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */
memset (prefix, 32, indent);
prefix[indent] = 0;
mfont__set_spec_from_face (&spec, face);
- fprintf (stderr, "(face font:\"");
+ fprintf (mdebug__output, "(face font:\"");
mdebug_dump_font (&spec);
- fprintf (stderr, "\"\n %s fore:%s back:%s", prefix,
+ fprintf (mdebug__output, "\"\n %s fore:%s back:%s", prefix,
msymbol_name ((MSymbol) face->property[MFACE_FOREGROUND]),
msymbol_name ((MSymbol) face->property[MFACE_BACKGROUND]));
if (face->property[MFACE_FONTSET])
- fprintf (stderr, " non-default-fontset");
- fprintf (stderr, " hline:%s", face->property[MFACE_HLINE] ? "yes" : "no");
- fprintf (stderr, " box:%s)", face->property[MFACE_BOX] ? "yes" : "no");
+ fprintf (mdebug__output, " non-default-fontset");
+ fprintf (mdebug__output, " hline:%s",
+ face->property[MFACE_HLINE] ? "yes" : "no");
+ fprintf (mdebug__output, " box:%s)",
+ face->property[MFACE_BOX] ? "yes" : "no");
return face;
}
for (i = 0; i < font_list->nfonts; i++)
{
- fprintf (stderr, "%04X - ", font_list->fonts[i].score);
+ fprintf (mdebug__output, "%04X - ", font_list->fonts[i].score);
mdebug_dump_font (font_list->fonts[i].font);
- fprintf (stderr, "\n");
+ fprintf (mdebug__output, "\n");
}
}
/***en
@brief Dump a font.
- The mdebug_dump_font () function prints font $FONT in a human readable
- way to the stderr.
+ The mdebug_dump_font () function prints font $FONT in a human
+ readable way to the stderr or to what specified by the environment
+ variable MDEBUG_OUTPUT_FILE.
@return
This function returns $FONT. */
/***ja
@brief ¥Õ¥©¥ó¥È¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_font () ¤Ï¥Õ¥©¥ó¥È $FONT ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£
+ ´Ø¿ô mdebug_dump_font () ¤Ï¥Õ¥©¥ó¥È $FONT ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷¤¯¤Ï
+ ´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç½Ð
+ ÎϤ¹¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $FONT ¤òÊÖ¤¹¡£ */
name = xlfd_unparse_name (font, 0);
if (name)
{
- fprintf (stderr, "%s", name);
+ fprintf (mdebug__output, "%s", name);
free (name);
}
if (font->file != Mnil)
if (*p == '/')
lastslash = p;
if (name)
- fprintf (stderr, ",");
- fprintf (stderr, "%s", lastslash + 1);
+ fprintf (mdebug__output, ",");
+ fprintf (mdebug__output, "%s", lastslash + 1);
}
if (font->capability != Mnil)
- fprintf (stderr, "%s", MSYMBOL_NAME (font->capability));
+ fprintf (mdebug__output, "%s", MSYMBOL_NAME (font->capability));
return font;
}
/***en
@brief Dump a fontset.
- The mdebug_dump_fontset () function prints fontset $FONTSET in a human readable
- way to the stderr. $INDENT specifies how many columns to indent
- the lines but the first one.
+ The mdebug_dump_fontset () function prints fontset $FONTSET in a
+ human readable way to the stderr or to what specified by the
+ environment variable MDEBUG_OUTPUT_FILE. $INDENT specifies how
+ many columns to indent the lines but the first one.
@return
This function returns $FONTSET. */
/***ja
@brief ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥©¥ó¥È¥»¥Ã¥È $FONTSET ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥©¥ó¥È¥»¥Ã¥È $FONTSET ¤òɸ½à¥¨¥é¡¼½ÐÎÏ
+ ¤â¤·¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆÉ
+ ¤Ê·Á¤Ç½ÐÎϤ¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $FONTSET ¤òÊÖ¤¹¡£ */
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "(fontset %s", fontset->name->name);
+ fprintf (mdebug__output, "(fontset %s", fontset->name->name);
if (fontset->per_script)
MPLIST_DO (plist, fontset->per_script)
{
- fprintf (stderr, "\n %s(%s", prefix, MPLIST_KEY (plist)->name);
+ fprintf (mdebug__output, "\n %s(%s", prefix, MPLIST_KEY (plist)->name);
MPLIST_DO (pl, MPLIST_PLIST (plist))
{
- fprintf (stderr, "\n %s(%s", prefix, MPLIST_KEY (pl)->name);
+ fprintf (mdebug__output, "\n %s(%s", prefix,
+ MPLIST_KEY (pl)->name);
MPLIST_DO (p, MPLIST_PLIST (pl))
{
- fprintf (stderr, "\n %s(0x%X %s ", prefix,
+ fprintf (mdebug__output, "\n %s(0x%X %s ", prefix,
(unsigned) MPLIST_VAL (p),
MPLIST_KEY (p)->name);
mdebug_dump_font (MPLIST_VAL (p));
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
if (fontset->per_charset)
MPLIST_DO (pl, fontset->per_charset)
{
- fprintf (stderr, "\n %s(%s", prefix, MPLIST_KEY (pl)->name);
+ fprintf (mdebug__output, "\n %s(%s", prefix, MPLIST_KEY (pl)->name);
MPLIST_DO (p, MPLIST_PLIST (pl))
{
- fprintf (stderr, "\n %s(%s ", prefix, MPLIST_KEY (p)->name);
+ fprintf (mdebug__output, "\n %s(%s ", prefix,
+ MPLIST_KEY (p)->name);
mdebug_dump_font (MPLIST_VAL (p));
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
if (fontset->fallback)
MPLIST_DO (p, fontset->fallback)
{
- fprintf (stderr, "\n %s(%s ", prefix, MPLIST_KEY (p)->name);
+ fprintf (mdebug__output, "\n %s(%s ", prefix, MPLIST_KEY (p)->name);
mdebug_dump_font (MPLIST_VAL (p));
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
return fontset;
}
memset (prefix, 32, indent);
prefix[indent] = '\0';
- fprintf (stderr, "(\"%s\" ", msymbol_name (key));
+ fprintf (mdebug__output, "(\"%s\" ", msymbol_name (key));
if (map->map_actions)
mdebug_dump_plist (map->map_actions, indent + 2);
if (map->submaps)
{
MPLIST_DO (map_list, map->submaps)
{
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
dump_im_map (map_list, indent + 2);
}
}
if (map->branch_actions)
{
- fprintf (stderr, "\n%s (branch\n%s ", prefix, prefix);
+ fprintf (mdebug__output, "\n%s (branch\n%s ", prefix, prefix);
mdebug_dump_plist (map->branch_actions, indent + 4);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
memset (prefix, 32, indent);
prefix[indent] = '\0';
- fprintf (stderr, "(%s", msymbol_name (state->name));
+ fprintf (mdebug__output, "(%s", msymbol_name (state->name));
if (state->map->submaps)
{
MPLIST_DO (map_list, state->map->submaps)
{
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
dump_im_map (map_list, indent + 2);
}
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
\f
@brief Dump an input method.
The mdebug_dump_im () function prints the input method $IM in a
- human readable way to the stderr. $INDENT specifies how many
- columns to indent the lines but the first one.
+ human readable way to the stderr or to what specified by the
+ environment variable MDEBUG_OUTPUT_FILE. $INDENT specifies how
+ many columns to indent the lines but the first one.
@return
This function returns $IM. */
/***ja
@brief ÆþÎϥ᥽¥Ã¥É¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_im () ¤ÏÆþÎϥ᥽¥Ã¥É $IM ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_im () ¤ÏÆþÎϥ᥽¥Ã¥É $IM ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷¤¯¤Ï
+ ´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç½Ð
+ ÎϤ¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $IM ¤òÊÖ¤¹¡£ */
memset (prefix, 32, indent);
prefix[indent] = '\0';
- fprintf (stderr, "(input-method %s %s ", msymbol_name (im->language),
+ fprintf (mdebug__output, "(input-method %s %s ", msymbol_name (im->language),
msymbol_name (im->name));
mdebug_dump_mtext (im_info->title, 0, 0);
if (im->name != Mnil)
MPLIST_DO (state, im_info->states)
{
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
dump_im_state (MPLIST_VAL (state), indent + 2);
}
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
return im;
}
{
XRectangle rect;
XClipBox (region, &rect);
- fprintf (stderr, "(%d %d %d %d)\n", rect.x, rect.y, rect.width, rect.height);
+ fprintf (mdebug__output, "(%d %d %d %d)\n", rect.x, rect.y, rect.width, rect.height);
}
default: event_name = "unknown";
}
- fprintf (stderr, "%s: %s\n", win_name, event_name);
+ fprintf (mdebug__output, "%s: %s\n", win_name, event_name);
}
#endif
for (i = 0; i <= GC_INVERSE; i++)
{
XGetGCValues (display, info->gc[i], valuemask, &values);
- fprintf (stderr, "GC%d: fore/#%lX back/#%lX", i,
+ fprintf (mdebug__output, "GC%d: fore/#%lX back/#%lX", i,
values.foreground, values.background);
- fprintf (stderr, "\n");
+ fprintf (mdebug__output, "\n");
}
}
static void
report_object_array ()
{
- fprintf (stderr, "%16s %7s %7s %7s\n",
+ fprintf (mdebug__output, "%16s %7s %7s %7s\n",
"object", "created", "freed", "alive");
- fprintf (stderr, "%16s %7s %7s %7s\n",
+ fprintf (mdebug__output, "%16s %7s %7s %7s\n",
"------", "-------", "-----", "-----");
for (; object_array_root; object_array_root = object_array_root->next)
{
M17NObjectArray *array = object_array_root;
- fprintf (stderr, "%16s %7d %7d %7d\n", array->name,
+ fprintf (mdebug__output, "%16s %7d %7d %7d\n", array->name,
array->used, array->used - array->count, array->count);
if (array->count > 0)
{
MText *mt = (MText *) array->objects[i];
if (mt->format <= MTEXT_FORMAT_UTF_8)
- fprintf (stderr, "\t\"%s\"\n", (char *) mt->data);
+ fprintf (mdebug__output, "\t\"%s\"\n", (char *) mt->data);
}
else if (strcmp (array->name, "Plist") == 0)
{
MPlist *plist = (MPlist *) array->objects[i];
mdebug_dump_plist (plist, 8);
- fprintf (stderr, "\n");
+ fprintf (mdebug__output, "\n");
}
}
gettimeofday (&tv, &tz);
diff = ((tv.tv_sec - time_stack[time_stack_index - 1].tv_sec) * 1000000
+ (tv.tv_usec - time_stack[time_stack_index - 1].tv_usec));
- fprintf (stderr, "%8ld ms.", diff);
+ fprintf (mdebug__output, "%8ld ms.", diff);
time_stack[time_stack_index - 1] = tv;
}
MDEBUG_PUSH_TIME ();
if (msymbol__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize symbol module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize symbol module."));
if (mplist__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize plist module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize plist module."));
if (mchar__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize character module."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize character module."));
if (mchartable__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize chartable module."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize chartable module."));
if (mtext__init () < 0 || mtext__prop_init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize mtext module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize mtext module."));
if (mdatabase__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize database module."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize database module."));
#if ENABLE_NLS
bindtextdomain ("m17n-lib", GETTEXTDIR);
err:
MDEBUG_POP_TIME ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize the core modules."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize the core modules."));
MDEBUG_POP_TIME ();
}
MDEBUG_PUSH_TIME ();
MDEBUG_PUSH_TIME ();
mchartable__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize chartable module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize chartable module."));
mtext__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize mtext module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize mtext module."));
msymbol__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize symbol module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize symbol module."));
mplist__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize plist module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize plist module."));
/* We must call this after the aboves because it frees interval
pools. */
mtext__prop_fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize textprop module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize textprop module."));
MDEBUG_POP_TIME ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the core modules."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize the core modules."));
MDEBUG_POP_TIME ();
if (mdebug__flags[MDEBUG_FINI])
report_object_array ();
<ul>
<li> Environment variables to control printing of various
- information.
+ information to stderr.
<ul>
<li> MDEBUG_ALL -- Setting this variable to 1 is equivalent to
setting all the above variables to 1.
+ <li> MDEBUG_OUTPUT_FILE -- If set to a file name, the above
+ debugging information is appended to the file. If set to
+ "stdout", the information is printed to stdout.
+
</ul>
<li> Functions to print various objects in a human readable way.
<ul>
- <li> ¤µ¤Þ¤¶¤Þ¤Ê¾ðÊó¤Î¥×¥ê¥ó¥È¤òÀ©¸æ¤¹¤ë´Ä¶ÊÑ¿ô¡£
+ <li> ¤µ¤Þ¤¶¤Þ¤Ê¾ðÊó¤Îɸ½à¥¨¥é¡¼½ÐÎϤؤΥץê¥ó¥È¤òÀ©¸æ¤¹¤ë´Ä¶ÊÑ¿ô¡£
<ul>
<li> MDEBUG_ALL -- 1 ¤Ê¤é¤Ð¡¢¾åµ¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤ò 1
¤Ë¤·¤¿¤Î¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¡£
+ <li> MDEBUG_OUTPUT_FILE -- ¤â¤·¥Õ¥¡¥¤¥ë̾¤Ê¤é¡¢¾åµ¥Ç¥Ð¥Ã¥°¾ðÊó¤Ï¤½
+ ¤Î¥Õ¥¡¥¤¥ë¤ËÄɲ䵤ì¤ë¡£¤â¤· "stdout" ¤Ê¤é¤½¤Î¾ðÊó¤Ïɸ½à½ÐÎϤ˽ÐÎÏ
+ ¤µ¤ì¤ë¡£
+
</ul>
<li> ¼ï¡¹¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç¥×¥ê¥ó¥È¤¹¤ë´Ø¿ô¡£¾ÜºÙ¤Ï´Ø¿ô
mflt_font_id = NULL;
mflt_try_otf = NULL;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize the flt modules."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize the flt modules."));
MDEBUG_POP_TIME ();
}
MDEBUG_PUSH_TIME ();
free_flt_list ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the flt modules."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize the flt modules."));
MDEBUG_POP_TIME ();
m17n_fini_core ();
}
prefix[indent] = 0;
if (id >= 0)
- fprintf (stderr, "0x%02X", id);
+ fprintf (mdebug__output, "0x%02X", id);
else if (id <= CMD_ID_OFFSET_INDEX)
{
int idx = CMD_ID_TO_INDEX (id);
FontLayoutCmdRule *rule = &cmd->body.rule;
int i;
- fprintf (stderr, "(rule ");
+ fprintf (mdebug__output, "(rule ");
if (rule->src_type == SRC_REGEX)
- fprintf (stderr, "\"%s\"", rule->src.re.pattern);
+ fprintf (mdebug__output, "\"%s\"", rule->src.re.pattern);
else if (rule->src_type == SRC_INDEX)
- fprintf (stderr, "%d", rule->src.match_idx);
+ fprintf (mdebug__output, "%d", rule->src.match_idx);
else if (rule->src_type == SRC_SEQ)
- fprintf (stderr, "(seq)");
+ fprintf (mdebug__output, "(seq)");
else if (rule->src_type == SRC_RANGE)
- fprintf (stderr, "(range)");
+ fprintf (mdebug__output, "(range)");
else
- fprintf (stderr, "(invalid src)");
+ fprintf (mdebug__output, "(invalid src)");
for (i = 0; i < rule->n_cmds; i++)
{
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
dump_flt_cmd (stage, rule->cmd_ids[i], indent + 2);
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
else if (cmd->type == FontLayoutCmdTypeCond)
{
FontLayoutCmdCond *cond = &cmd->body.cond;
int i;
- fprintf (stderr, "(cond");
+ fprintf (mdebug__output, "(cond");
for (i = 0; i < cond->n_cmds; i++)
{
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
dump_flt_cmd (stage, cond->cmd_ids[i], indent + 2);
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
else if (cmd->type == FontLayoutCmdTypeOTF)
{
- fprintf (stderr, "(otf)");
+ fprintf (mdebug__output, "(otf)");
}
else
- fprintf (stderr, "(error-command)");
+ fprintf (mdebug__output, "(error-command)");
}
else if (id <= CMD_ID_OFFSET_COMBINING)
- fprintf (stderr, "cominging-code");
+ fprintf (mdebug__output, "cominging-code");
else
- fprintf (stderr, "(predefiend %d)", id);
+ fprintf (mdebug__output, "(predefiend %d)", id);
}
/***en
@brief Dump a Font Layout Table.
The mdebug_dump_flt () function prints the Font Layout Table $FLT
- in a human readable way to the stderr. $INDENT specifies how many
- columns to indent the lines but the first one.
+ in a human readable way to the stderr or to what specified by the
+ environment variable MDEBUG_OUTPUT_FILE. $INDENT specifies how
+ many columns to indent the lines but the first one.
@return
This function returns $FLT. */
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "(flt");
+ fprintf (mdebug__output, "(flt");
MPLIST_DO (plist, flt->stages)
{
FontLayoutStage *stage = (FontLayoutStage *) MPLIST_VAL (plist);
int i;
- fprintf (stderr, "\n%s (stage %d", prefix, stage_idx);
+ fprintf (mdebug__output, "\n%s (stage %d", prefix, stage_idx);
for (i = 0; i < stage->used; i++)
{
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
dump_flt_cmd (stage, INDEX_TO_CMD_ID (i), indent + 4);
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
stage_idx++;
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
return flt;
}
{
int i;
- fprintf (stderr, "(flt-gstring");
+ fprintf (mdebug__output, "(flt-gstring");
for (i = 0; i < gstring->used; i++)
{
MFLTGlyph *g = GREF (gstring, i);
- fprintf (stderr, "\n (%02d pos:%d-%d c:%04X code:%04X cat:%c)",
+ fprintf (mdebug__output, "\n (%02d pos:%d-%d c:%04X code:%04X cat:%c)",
i, g->from, g->to, g->c, g->code, GET_CATEGORY_CODE (g));
}
- fprintf (stderr, ")\n");
+ fprintf (mdebug__output, ")\n");
}
/*** @} */
MDrawMetric rect;
gd_region_to_rect (region, &rect);
- fprintf (stderr, "(%d %d %d %d)\n", rect.x, rect.y, rect.width, rect.height);
+ fprintf (mdebug__output, "(%d %d %d %d)\n",
+ rect.x, rect.y, rect.width, rect.height);
}
static MDeviceDriver gd_driver =
MDEBUG_PUSH_TIME ();
if (mfont__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize font module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize font module."));
if (mfont__fontset_init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize fontset module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize fontset module."));
if (mface__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize face module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize face module."));
if (mdraw__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize draw module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize draw module."));
if (minput__win_init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize input-win module."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize input-win module."));
mframe_default = NULL;
register_device_library (Mx, "libm17n-X");
err:
MDEBUG_POP_TIME ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize the m17n GUI module."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize the m17n GUI module."));
MDEBUG_POP_TIME ();
}
MDEBUG_PUSH_TIME ();
MDEBUG_PUSH_TIME ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize device modules."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize device modules."));
MPLIST_DO (plist, device_library_list)
{
MDeviceLibraryInterface *interface = MPLIST_VAL (plist);
#endif /* not HAVE_FREETYPE */
M17N_OBJECT_UNREF (device_library_list);
minput__win_fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input-gui module."));
+ MDEBUG_PRINT_TIME ("FINI",
+ (mdebug__output, " to finalize input-gui module."));
mdraw__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize draw module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize draw module."));
mface__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize face module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize face module."));
mfont__fontset_fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize fontset module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize fontset module."));
mfont__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize font module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize font module."));
mframe_default = NULL;
MDEBUG_POP_TIME ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the gui modules."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize the gui modules."));
MDEBUG_POP_TIME ();
m17n_fini_flt ();
m17n_fini ();
MDEBUG_PUSH_TIME ();
if (mcharset__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize charset module."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize charset module."));
if (mcoding__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize conv module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize conv module."));
if (mcharset__load_from_database () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to load charset definitions."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to load charset definitions."));
if (mcoding__load_from_database () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to load coding definitions."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to load coding definitions."));
if (mlang__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize language module"));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize language module"));
if (mlocale__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize locale module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize locale module."));
if (minput__init () < 0)
goto err;
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize input module."));
+ MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize input module."));
err:
MDEBUG_POP_TIME ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize the shell modules."));
+ MDEBUG_PRINT_TIME ("INIT",
+ (mdebug__output, " to initialize the shell modules."));
MDEBUG_POP_TIME ();
}
MDEBUG_PUSH_TIME ();
MDEBUG_PUSH_TIME ();
minput__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize input module."));
mlocale__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize locale module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize locale module."));
mlang__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize language module."));
+ MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize language module."));
mchar__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize character module."));
+ MDEBUG_PRINT_TIME ("FINI",
+ (mdebug__output, " to finalize character module."));
mdatabase__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize database module."));
+ MDEBUG_PRINT_TIME ("FINI",
+ (mdebug__output, " to finalize database module."));
mcoding__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize coding module."));
+ MDEBUG_PRINT_TIME ("FINI",
+ (mdebug__output, " to finalize coding module."));
mcharset__fini ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize charset module."));
+ MDEBUG_PRINT_TIME ("FINI",
+ (mdebug__output, " to finalize charset module."));
MDEBUG_POP_TIME ();
- MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the shell modules."));
+ MDEBUG_PRINT_TIME ("FINI",
+ (mdebug__output, " to finalize the shell modules."));
MDEBUG_POP_TIME ();
m17n_fini_core ();
}
@brief Dump an M-text.
The mdebug_dump_mtext () function prints the M-text $MT in a human
- readable way to the stderr. $INDENT specifies how many columns to
- indent the lines but the first one. If $FULLP is zero, this
+ readable way to the stderr or to what specified by the environment
+ variable MDEBUG_OUTPUT_FILE. $INDENT specifies how many columns
+ to indent the lines but the first one. If $FULLP is zero, this
function prints only a character code sequence. Otherwise, it
prints the internal byte sequence and text properties as well.
/***ja
@brief M-text ¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_mtext () ¤Ï M-text $MT ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
- $FULLP ¤¬ 0 ¤Ê¤é¤Ð¡¢Ê¸»ú¥³¡¼¥ÉÎó¤À¤±¤ò°õºþ¤¹¤ë¡£
- ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢ÆâÉô¥Ð¥¤¥ÈÎó¤È¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤â°õºþ¤¹¤ë¡£
+ ´Ø¿ô mdebug_dump_mtext () ¤Ï M-text $MT ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷¤¯¤Ï´Ä
+ ¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ
+ ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£$FULLP ¤¬ 0 ¤Ê¤é
+ ¤Ð¡¢Ê¸»ú¥³¡¼¥ÉÎó¤À¤±¤ò°õºþ¤¹¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢ÆâÉô¥Ð¥¤¥ÈÎó¤È¥Æ¥
+ ¥¹¥È¥×¥í¥Ñ¥Æ¥£¤â°õºþ¤¹¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $MT ¤òÊÖ¤¹¡£ */
if (! fullp)
{
- fprintf (stderr, "\"");
+ fprintf (mdebug__output, "\"");
for (i = 0; i < mt->nchars; i++)
{
int c = mtext_ref_char (mt, i);
if (c == '"' || c == '\\')
- fprintf (stderr, "\\%c", c);
+ fprintf (mdebug__output, "\\%c", c);
else if ((c >= ' ' && c < 127) || c == '\n')
- fprintf (stderr, "%c", c);
+ fprintf (mdebug__output, "%c", c);
else
- fprintf (stderr, "\\x%02X", c);
+ fprintf (mdebug__output, "\\x%02X", c);
}
- fprintf (stderr, "\"");
+ fprintf (mdebug__output, "\"");
return mt;
}
- fprintf (stderr,
+ fprintf (mdebug__output,
"(mtext (size %d %d %d) (cache %d %d)",
mt->nchars, mt->nbytes, mt->allocated,
mt->cache_char_pos, mt->cache_byte_pos);
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "\n%s (bytes \"", prefix);
+ fprintf (mdebug__output, "\n%s (bytes \"", prefix);
for (i = 0; i < mt->nbytes; i++)
- fprintf (stderr, "\\x%02x", mt->data[i]);
- fprintf (stderr, "\")\n");
- fprintf (stderr, "%s (chars \"", prefix);
+ fprintf (mdebug__output, "\\x%02x", mt->data[i]);
+ fprintf (mdebug__output, "\")\n");
+ fprintf (mdebug__output, "%s (chars \"", prefix);
p = mt->data;
for (i = 0; i < mt->nchars; i++)
{
int c = STRING_CHAR_AND_BYTES (p, len);
if (c == '"' || c == '\\')
- fprintf (stderr, "\\%c", c);
+ fprintf (mdebug__output, "\\%c", c);
else if (c >= ' ' && c < 127)
- fputc (c, stderr);
+ fputc (c, mdebug__output);
else
- fprintf (stderr, "\\x%X", c);
+ fprintf (mdebug__output, "\\x%X", c);
p += len;
}
- fprintf (stderr, "\")");
+ fprintf (mdebug__output, "\")");
if (mt->plist)
{
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
dump_textplist (mt->plist, indent + 1);
}
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
return mt;
}
if (MT) \
mtext_cat_char ((MT), (C)); \
else \
- putc ((C), stderr); \
+ putc ((C), mdebug__output); \
} while (0);
#define PUTS(MT, STR) \
if (MT) \
MTEXT_CAT_ASCII ((MT), (STR)); \
else \
- fputs ((STR), stderr); \
+ fputs ((STR), mdebug__output); \
} while (0)
unsigned char *end = data + mtext__char_to_byte (this_mt, stop);
while (beg < end)
- putc (*beg, stderr), beg++;
+ putc (*beg, mdebug__output), beg++;
}
if (stop == to)
break;
M17N_OBJECT_UNREF (this_mt);
}
else
- fprintf (stderr, "%s", str);
+ fprintf (mdebug__output, "%s", str);
}
else
{
@brief Dump a property list.
The mdebug_dump_plist () function prints a property list $PLIST in
- a human readable way to the stderr. $INDENT specifies how many
- columns to indent the lines but the first one.
+ a human readable way to the stderr or to what specified by the
+ environment variable MDEBUG_OUTPUT_FILE. $INDENT specifies how
+ many columns to indent the lines but the first one.
@return
This function returns $PLIST. */
/***ja
@brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_plist () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_plist () ¤Ï¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È $PLIST ¤òɸ½à¥¨¥é¡¼½Ð
+ ÎϤ⤷¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²Ä
+ ÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $PLIST ¤òÊÖ¤¹¡£ */
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "(");
+ fprintf (mdebug__output, "(");
MPLIST_DO (pl, plist)
{
if (pl != plist)
- fprintf (stderr, "\n%s ", prefix);
+ fprintf (mdebug__output, "\n%s ", prefix);
write_element (NULL, pl, indent + 1);
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
return plist;
}
symbol_table[i] = NULL;
}
if (mdebug__flags[MDEBUG_FINI])
- fprintf (stderr, "%16s %7d %7d %7d\n", "Symbol",
+ fprintf (mdebug__output, "%16s %7d %7d %7d\n", "Symbol",
num_symbols, freed_symbols, num_symbols - freed_symbols);
num_symbols = 0;
}
/***en
@brief Dump a symbol.
- The mdebug_dump_symbol () function prints symbol $SYMBOL in a human
- readable way to the stderr. $INDENT specifies how many columns to
- indent the lines but the first one.
+ The mdebug_dump_symbol () function prints symbol $SYMBOL in a
+ human readable way to the stderr or to what specified by the
+ environment variable MDEBUG_OUTPUT_FILE. $INDENT specifies how
+ many columns to indent the lines but the first one.
@return
This function returns $SYMBOL.
/***ja
@brief ¥·¥ó¥Ü¥ë¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_symbol () ¤Ï¥·¥ó¥Ü¥ë $symbol ¤ò stderr
- ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_symbol () ¤Ï¥·¥ó¥Ü¥ë $symbol ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷
+ ¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ
+ ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï $SYMBOL ¤òÊÖ¤¹¡£
else
plist = &symbol->plist, name = symbol->name;
- fprintf (stderr, "%s%s", prefix, name);
+ fprintf (mdebug__output, "%s%s", prefix, name);
while (plist && MPLIST_KEY (plist) != Mnil)
{
- fprintf (stderr, ":%s", MPLIST_KEY (plist)->name);
+ fprintf (mdebug__output, ":%s", MPLIST_KEY (plist)->name);
plist = MPLIST_NEXT (plist);
}
return symbol;
@brief Dump all symbol names.
The mdebug_dump_all_symbols () function prints names of all
- symbols to the stderr. $INDENT specifies how many columns to
- indent the lines but the first one.
+ symbols to the stderr or to what specified by the environment
+ variable MDEBUG_OUTPUT_FILE. $INDENT specifies how many columns
+ to indent the lines but the first one.
@return
This function returns #Mnil.
/***ja
@brief ¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë̾¤ò¥À¥ó¥×¤¹¤ë.
- ´Ø¿ô mdebug_dump_all_symbols () ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë¤Î̾Á°¤ò
- stderr ¤Ë°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+ ´Ø¿ô mdebug_dump_all_symbols () ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë¤Î̾Á°¤òɸ½à¥¨
+ ¥é¡¼½ÐÎϤ⤷¤¯¤Ï´Ä¶ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë°õ
+ ºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
@return
¤³¤Î´Ø¿ô¤Ï #Mnil ¤òÊÖ¤¹¡£
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "(symbol-list");
+ fprintf (mdebug__output, "(symbol-list");
for (i = n = 0; i < SYMBOL_TABLE_SIZE; i++)
if ((sym = symbol_table[i]))
{
- fprintf (stderr, "\n%s (%4d", prefix, i);
+ fprintf (mdebug__output, "\n%s (%4d", prefix, i);
for (; sym; sym = sym->next, n++)
- fprintf (stderr, " '%s'", sym->name);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, " '%s'", sym->name);
+ fprintf (mdebug__output, ")");
}
- fprintf (stderr, "\n%s (total %d)", prefix, n);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, "\n%s (total %d)", prefix, n);
+ fprintf (mdebug__output, ")");
return Mnil;
}
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "(interval %d-%d (%d)", interval->start, interval->end,
- interval->nprops);
+ fprintf (mdebug__output, "(interval %d-%d (%d)",
+ interval->start, interval->end, interval->nprops);
for (i = 0; i < interval->nprops; i++)
- fprintf (stderr, "\n%s (%d %d/%d %d-%d 0x%x)",
+ fprintf (mdebug__output, "\n%s (%d %d/%d %d-%d 0x%x)",
prefix, i,
interval->stack[i]->control.ref_count,
interval->stack[i]->attach_count,
interval->stack[i]->start, interval->stack[i]->end,
(unsigned) interval->stack[i]->val);
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
}
void
memset (prefix, 32, indent);
prefix[indent] = 0;
- fprintf (stderr, "(properties");
+ fprintf (mdebug__output, "(properties");
if (! plist)
- fprintf (stderr, ")\n");
+ fprintf (mdebug__output, ")\n");
else
{
- fprintf (stderr, "\n");
+ fprintf (mdebug__output, "\n");
while (plist)
{
MInterval *interval = plist->head;
- fprintf (stderr, "%s (%s", prefix, msymbol_name (plist->key));
+ fprintf (mdebug__output, "%s (%s", prefix, msymbol_name (plist->key));
while (interval)
{
- fprintf (stderr, " (%d %d", interval->start, interval->end);
+ fprintf (mdebug__output, " (%d %d",
+ interval->start, interval->end);
if (interval->nprops > 0)
{
int i;
for (i = 0; i < interval->nprops; i++)
- fprintf (stderr, " 0x%x", (int) interval->stack[i]->val);
+ fprintf (mdebug__output, " 0x%x",
+ (int) interval->stack[i]->val);
}
- fprintf (stderr, ")");
+ fprintf (mdebug__output, ")");
interval = interval->next;
}
- fprintf (stderr, ")\n");
+ fprintf (mdebug__output, ")\n");
xassert (check_plist (plist, 0) == 0);
plist = plist->next;
}