Update copyright years
[m17n/m17n-lib.git] / src / symbol.c
index faf97fe..36a544c 100644 (file)
@@ -1,5 +1,5 @@
 /* symbol.c -- symbol module.
-   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -180,7 +180,7 @@ msymbol__free_table ()
       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;
 }
@@ -735,9 +735,10 @@ msymbol_get_func (MSymbol symbol, MSymbol key)
 /***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.
@@ -747,8 +748,9 @@ msymbol_get_func (MSymbol symbol, MSymbol key)
 /***ja
     @brief ¥·¥ó¥Ü¥ë¤ò¥À¥ó¥×¤¹¤ë.
 
-    ´Ø¿ô mdebug_dump_symbol () ¤Ï¥·¥ó¥Ü¥ë $symbol ¤ò stderr 
-    ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+    ´Ø¿ô mdebug_dump_symbol () ¤Ï¥·¥ó¥Ü¥ë $symbol ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷
+    ¤¯¤Ï´Ä¶­ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ
+    ¤Ç°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
 
     @return
     ¤³¤Î´Ø¿ô¤Ï $SYMBOL ¤òÊÖ¤¹¡£ 
@@ -774,10 +776,10 @@ mdebug_dump_symbol (MSymbol symbol, int indent)
   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;
@@ -787,8 +789,9 @@ mdebug_dump_symbol (MSymbol symbol, int indent)
     @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.
@@ -798,8 +801,9 @@ mdebug_dump_symbol (MSymbol symbol, int indent)
 /***ja
     @brief ¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë̾¤ò¥À¥ó¥×¤¹¤ë.
 
-    ´Ø¿ô mdebug_dump_all_symbols () ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë¤Î̾Á°¤ò 
-    stderr ¤Ë°õºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
+    ´Ø¿ô mdebug_dump_all_symbols () ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥·¥ó¥Ü¥ë¤Î̾Á°¤òɸ½à¥¨
+    ¥é¡¼½ÐÎϤ⤷¤¯¤Ï´Ä¶­ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë°õ
+    ºþ¤¹¤ë¡£ $INDENT ¤Ï£²¹ÔÌܰʹߤΥ¤¥ó¥Ç¥ó¥È¤ò»ØÄꤹ¤ë¡£
 
     @return
     ¤³¤Î´Ø¿ô¤Ï #Mnil ¤òÊÖ¤¹¡£ 
@@ -821,17 +825,17 @@ mdebug_dump_all_symbols (int indent)
   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;
 }