From: handa Date: Fri, 10 Sep 2010 15:38:54 +0000 (+0000) Subject: Print debug information to mdebug__output instead of stderr. X-Git-Tag: REL-1-6-2~22 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3628173afa3d3f97a9fd07277382fa08c9de8970;p=m17n%2Fm17n-lib.git Print debug information to mdebug__output instead of stderr. --- diff --git a/src/charset.c b/src/charset.c index cd9012d..4168ad0 100644 --- a/src/charset.c +++ b/src/charset.c @@ -673,7 +673,7 @@ mcharset__load_from_database () 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; @@ -699,7 +699,7 @@ mcharset__load_from_database () } 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; } diff --git a/src/chartab.c b/src/chartab.c index 947b575..3411999 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -547,18 +547,18 @@ dump_sub_chartab (MSubCharTable *table, void *default_value, 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) @@ -575,23 +575,24 @@ dump_sub_chartab (MSubCharTable *table, void *default_value, 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, ")"); } @@ -975,8 +976,9 @@ mchartable_map (MCharTable *table, void *ignore, @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. */ @@ -984,8 +986,9 @@ mchartable_map (MCharTable *table, void *ignore, /***ja @brief ʸ»ú¥Æ¡¼¥Ö¥ë¤ò¥À¥ó¥×¤¹¤ë. - ´Ø¿ô mdebug_dump_chartab () ¤Ïʸ»ú¥Æ¡¼¥Ö¥ë $TABLE ¤ò stderr - ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£ + ´Ø¿ô mdebug_dump_chartab () ¤Ïʸ»ú¥Æ¡¼¥Ö¥ë $TABLE ¤òɸ½à¥¨¥é¡¼½ÐÎÏ + ¤â¤·¤¯¤Ï´Ä¶­ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆÉ + ¤Ê·Á¤Ç°õºþ¤¹¤ë¡£$INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£ @return ¤³¤Î´Ø¿ô¤Ï $TABLE ¤òÊÖ¤¹¡£ */ @@ -993,11 +996,11 @@ mchartable_map (MCharTable *table, void *ignore, 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; } diff --git a/src/coding.c b/src/coding.c index 5fb2c07..61e8d1a 100644 --- a/src/coding.c +++ b/src/coding.c @@ -3049,7 +3049,7 @@ mcoding__load_from_database () 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; @@ -3083,7 +3083,7 @@ mcoding__load_from_database () } 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; } diff --git a/src/face.c b/src/face.c index f5d2ebf..d2ebdb1 100644 --- a/src/face.c +++ b/src/face.c @@ -2051,9 +2051,10 @@ mface_update (MFrame *frame, MFace *face) /***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. */ @@ -2061,8 +2062,9 @@ mface_update (MFrame *frame, MFace *face) /***ja @brief ¥Õ¥§¡¼¥¹¤ò¥À¥ó¥×¤¹¤ë. - ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤ò stderr - ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£ + ´Ø¿ô mdebug_dump_face () ¤Ï¥Õ¥§¡¼¥¹ $FACE ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷¤¯¤Ï + ´Ä¶­ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õ + ºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£ @return ¤³¤Î´Ø¿ô¤Ï $FACE ¤òÊÖ¤¹¡£ */ @@ -2076,15 +2078,17 @@ mdebug_dump_face (MFace *face, int indent) 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; } diff --git a/src/font.c b/src/font.c index 5ebdaa0..7643712 100644 --- a/src/font.c +++ b/src/font.c @@ -1446,9 +1446,9 @@ mdebug_dump_font_list (MFontList *font_list) 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"); } } @@ -3184,16 +3184,18 @@ mfont_close (MFont *font) /***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 ¤òÊÖ¤¹¡£ */ @@ -3206,7 +3208,7 @@ mdebug_dump_font (MFont *font) name = xlfd_unparse_name (font, 0); if (name) { - fprintf (stderr, "%s", name); + fprintf (mdebug__output, "%s", name); free (name); } if (font->file != Mnil) @@ -3218,11 +3220,11 @@ mdebug_dump_font (MFont *font) 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; } diff --git a/src/fontset.c b/src/fontset.c index 2f2ca55..6cb9d7d 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1450,17 +1450,19 @@ mfontset_lookup (MFontset *fontset, /***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 ¤òÊÖ¤¹¡£ */ @@ -1474,48 +1476,50 @@ mdebug_dump_fontset (MFontset *fontset, int indent) 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; } diff --git a/src/input.c b/src/input.c index c9c6fc1..61baa7a 100644 --- a/src/input.c +++ b/src/input.c @@ -4011,24 +4011,24 @@ dump_im_map (MPlist *map_list, int indent) 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, ")"); } @@ -4042,16 +4042,16 @@ dump_im_state (MIMState *state, int indent) 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, ")"); } @@ -6353,16 +6353,18 @@ minput_callback (MInputContext *ic, MSymbol command) @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 ¤òÊÖ¤¹¡£ */ @@ -6377,7 +6379,7 @@ mdebug_dump_im (MInputMethod *im, int indent) 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) @@ -6386,11 +6388,11 @@ mdebug_dump_im (MInputMethod *im, int indent) 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; } diff --git a/src/m17n-X.c b/src/m17n-X.c index 09f57ca..58cbf49 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -1821,7 +1821,7 @@ mwin__dump_region (MDrawRegion region) { 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); } @@ -1918,7 +1918,7 @@ mwin__print_event (void *arg, char *win_name) default: event_name = "unknown"; } - fprintf (stderr, "%s: %s\n", win_name, event_name); + fprintf (mdebug__output, "%s: %s\n", win_name, event_name); } #endif @@ -2077,9 +2077,9 @@ mwin__dump_gc (MFrame *frame, MRealizedFace *rface) 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"); } } diff --git a/src/m17n-core.c b/src/m17n-core.c index f29f2e6..db825a4 100644 --- a/src/m17n-core.c +++ b/src/m17n-core.c @@ -424,15 +424,15 @@ static M17NObjectArray *object_array_root; 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) { @@ -444,14 +444,14 @@ report_object_array () 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"); } } @@ -498,7 +498,7 @@ mdebug__print_time () 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; } @@ -612,22 +612,25 @@ m17n_init_core (void) 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); @@ -640,7 +643,8 @@ m17n_init_core (void) 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 (); } @@ -656,19 +660,19 @@ m17n_fini_core (void) 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 (); @@ -1066,7 +1070,7 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);