Update copyright years
[m17n/m17n-lib.git] / src / m17n-core.c
index c400a83..6094427 100644 (file)
@@ -1,5 +1,5 @@
 /* m17n-core.c -- body of the CORE API.
 /* m17n-core.c -- body of the CORE API.
-   Copyright (C) 2003, 2004
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 /***en
    02111-1307, USA.  */
 
 /***en
 
     <em>API LEVELS</em>
 
 
     <em>API LEVELS</em>
 
-    The API of the m17n library is divided into these four.
+    The API of the m17n library is divided into these five.
 
     <ol>
     <li> CORE API
 
 
     <ol>
     <li> CORE API
 
-    It provides basic modules to handle M-texts.  They do not require
-    the m17n database.  To use this API, an application program must
-    include <m17n-core<EM></EM>.h> and be linked by -lm17n-core.
+    It provides basic modules to handle M-texts.  To use this API, an
+    application program must include <m17n-core<EM></EM>.h> and be
+    linked with -lm17n-core.
 
     <li> SHELL API
 
 
     <li> SHELL API
 
-    It provides modules that utilize the m17n database (code
-    conversion, character property, etc).  They load various kinds of
+    It provides modules for character properties, character set
+    handling, code conversion, etc.  They load various kinds of
     data from the database on demand.  To use this API, an application
     data from the database on demand.  To use this API, an application
-    program must include <m17n<EM></EM>.h> and be linked by
+    program must include <m17n<EM></EM>.h> and be linked with
     -lm17n-core -lm17n.
 
     When you use this API, CORE API is also available.
 
     -lm17n-core -lm17n.
 
     When you use this API, CORE API is also available.
 
+    <li> FLT API
+
+    It provides modules for text shaping using @ref mdbFLT.  To use
+    this API, an application program must include <m17n<EM></EM>.h>
+    and be linked with -lm17n-core -lm17n-flt.
+
+    When you use this API, CORE API is also available.
+
     <li> GUI API
 
     It provides GUI modules such as drawing and inputting M-texts on a
     <li> GUI API
 
     It provides GUI modules such as drawing and inputting M-texts on a
-    graphic device.  The API itself is independent on a graphic device
-    but most functions require an argument MFrame which is created for
-    a specific type of graphic device.  Currently, a null device, X
-    Window System, and an image date (gdImagePtr) of GD library are
-    supported as a graphic device.
+    graphic device.  This API itself is independent of graphic
+    devices, but most functions require an argument MFrame that is
+    created for a specific type of graphic devices.  The currently
+    supported graphic devices are null device, the X Window System,
+    and image data (gdImagePtr) of the GD library.
 
 
-    On a frame of the null device, you can't draw text nor use an
-    input method (but, for instance, the function mdraw_glyph_list ()
-    is available).
+    On a frame of a null device, you cannot draw text nor use input
+    methods.  However, functions like mdraw_glyph_list (), etc. are
+    available.
 
     On a frame of the X Window System, you can use the whole GUI API.
 
 
     On a frame of the X Window System, you can use the whole GUI API.
 
-    On a frame of GD library, you can use all drawing API but can't
-    use input method.
+    On a frame of the GD library, you can use all drawing API but
+    cannot use input methods.
 
 
-    To use this device, an application program must include
-    <m17n-gui<EM></EM>.h> and be linked by -lm17n-core -lm17n
+    To use this API, an application program must include
+    <m17n-gui<EM></EM>.h> and be linked with -lm17n-core -lm17n
     -lm17n-gui.
 
     -lm17n-gui.
 
-    When you use this API, CORE and SHELL API are also available.
+    When you use this API, CORE, SHELL, and FLT APIs are also
+    available.
 
     <li> MISC API
 
     It provides miscellaneous functions to support error handling and
 
     <li> MISC API
 
     It provides miscellaneous functions to support error handling and
-    debugging.  This API cannot be used by itself, but with one or
-    more APIs listed above.  To use the API, an application program
-    must include <m17n-misc<EM></EM>.h> in addition to one of a header
-    file described above.
+    debugging.  This API cannot be used standalone; it must be used
+    with one or more APIs listed above.  To use this API, an
+    application program must include <m17n-misc<EM></EM>.h> in
+    addition to one of the header files described above.
 
     </ol>
 
     See also the section @ref m17n-config "m17n-config(1)".
 
 
     </ol>
 
     See also the section @ref m17n-config "m17n-config(1)".
 
-    <em>ENVIRONMENT VARIABLE</em>
+    <em>ENVIRONMENT VARIABLES</em>
 
 
-    The m17n library pays attention to these environment variables.
+    The m17n library pays attention to the following environment
+    variables.
 
     <ul>
     <li> @c M17NDIR
 
 
     <ul>
     <li> @c M17NDIR
 
-    Name of a directory that contains data of the m17n database.  See
-    @ref m17nDatabase for more details.
+    The name of the directory that contains data of the m17n database.
+    See @ref m17nDatabase for details.
 
 
-    <li> @c MDEBUG_XXXX
+    <li> @c MDEBUG_XXX
 
 
-    Environment variables whose name start by "MDEBUG_" controls
-    printing of debug information.  See @ref m17nDebug for more
-    details.
+    Environment variables whose names start with "MDEBUG_" control
+    debug information output.  See @ref m17nDebug for details.
 
     </ul>
 
     <em>API NAMING CONVENTION</em>
 
 
     </ul>
 
     <em>API NAMING CONVENTION</em>
 
-    The library exports functions, variables, macros, and types.  All
-    of them start by the letter 'm' or 'M' followed by an object name
-    (e.g. "symbol" and "plist", but "mtext" object is given the name
-    "text" to avoid double 'm' at the head) or a module name
-    (e.g. draw, input).
-    
+    The m17n library exports functions, variables, macros, and types.
+    All of them start with the letter 'm' or 'M', and are followed by
+    an object name (e.g. "symbol", "plist") or a module name
+    (e.g. draw, input).  Note that the name of M-text objects start
+    with "mtext" and not with "mmtext".
+
     <ul>
 
     <li> functions -- mobject () or mobject_xxx ()
 
     <ul>
 
     <li> functions -- mobject () or mobject_xxx ()
 
-    They start with 'm' followed by lower case object name.  For
-    example, msymbol (), mtext_ref_char (), mdraw_text ().
+    They start with 'm' and are followed by an object name in lower
+    case.  Words are separated by '_'.  For example, msymbol (),
+    mtext_ref_char (), mdraw_text ().
 
     <li> non-symbol variables -- mobject, or mobject_xxx
     
 
     <li> non-symbol variables -- mobject, or mobject_xxx
     
 
     <li> symbol variables -- Mname
 
 
     <li> symbol variables -- Mname
 
-    Variables of type MSymbol start with 'M' followed by their names
-    (e.g. Mlanguage (name is "language"), Miso_2022 (name is
-    "iso-2022").
+    Variables of the type MSymbol start with 'M' and are followed by
+    their names.  Words are separated by '_'.  For example, Mlanguage
+    (the name is "language"), Miso_2022 (the name is "iso-2022").
 
     <li> macros -- MOBJECT_XXX
 
 
     <li> macros -- MOBJECT_XXX
 
-    They start by 'M' followed by upper case object names.
+    They start with 'M' and are followed by an object name in upper
+    case.  Words are separated by '_'.
 
     <li> types -- MObject or MObjectXxx
 
 
     <li> types -- MObject or MObjectXxx
 
-    They start by 'M' followed by capitalized object names (e.g.
-    MConverter, MInputDriver).
+    They start with 'M' and are followed by capitalized object names.
+    Words are concatenated directly and no '_' are used.  For example,
+    MConverter, MInputDriver.
 
     </ul>
 
 
     </ul>
 
     <ol>
     <li> ¥³¥¢ API
 
     <ol>
     <li> ¥³¥¢ API
 
-    M-text ¤ò°·¤¦¤¿¤á¤Î´ðËÜŪ¤Ê¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£¤³¤ÎʬÎà¤Î API ¤Ï
-    m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òɬÍפȤ·¤Ê¤¤¡£ÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï
-    <m17n-core<EM></EM>.h> ¤ò include ¤·¡¢ -lm17n-core ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+    M-text ¤ò°·¤¦¤¿¤á¤Î´ðËÜŪ¤Ê¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£
+    ¤³¤Î API ¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï
+    <m17n-core<EM></EM>.h> ¤ò include ¤·¡¢ -lm17n-core
+    ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
 
     <li> ¥·¥§¥ë API
 
 
     <li> ¥·¥§¥ë API
 
-    m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÍøÍѤ¹¤ë¥â¥¸¥å¡¼¥ë¡Ê¥³¡¼¥ÉÊÑ´¹¡¢Ê¸»ú¥×¥í¥Ñ¥Æ¥£Åù¡Ë
-    ¤òÄ󶡤¹¤ë¡£¥â¥¸¥å¡¼¥ë¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éɬÍפ˱þ¤¸¤Æ¿Íͤʥǡ¼¥¿¤ò¥í¡¼¥É¤¹¤ë¡£
-    ÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï <m17n<EM></EM>.h> ¤ò include
-    ¤·¡¢ -lm17n-core -lm17n ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+    Ê¸»ú¥×¥í¥Ñ¥Æ¥£¡¢Ê¸»ú½¸¹çÁàºî¡¢¥³¡¼¥ÉÊÑ´¹Åù¤Î¤¿¤á¤Î¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£
+    ¤³¤ì¤é¤Î¥â¥¸¥å¡¼¥ë¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éɬÍפ˱þ¤¸¤Æ¿Íͤʥǡ¼¥¿¤ò¥í¡¼¥É¤¹¤ë¡£
+    ¤³¤Î API ¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï
+    <m17n<EM></EM>.h> ¤ò include ¤·¡¢ -lm17n-core -lm17n
+    ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+
+    ¤³¤Î API ¤ò»ÈÍѤ¹¤ì¤Ð¡¢¥³¥¢ API ¤â¼«Æ°Åª¤Ë»ÈÍѲÄǽ¤È¤Ê¤ë¡£
 
 
-    ¤³¤Î API ¤ò»ÈÍѤ¹¤ëºÝ¤Ë¤Ï¥³¥¢ API ¤â»ÈÍѤǤ­¤ë¡£
+    <li> FLT API
+
+    Ê¸»úÎóɽ¼¨¤Ë @ref mdbFLT ¤òÍѤ¤¤ë¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£¤³¤Î API
+    ¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï <m17n<EM></EM>.h> 
+    ¤ò include ¤·¡¢ -lm17n-core -lm17n-flt ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+
+    ¤³¤Î API ¤ò»ÈÍѤ¹¤ì¤Ð¡¢¥³¥¢ API ¤â¼«Æ°Åª¤Ë»ÈÍѲÄǽ¤È¤Ê¤ë¡£
 
     <li> GUI API
 
 
     <li> GUI API
 
-    M-text ¤ò¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¾å¤Çɽ¼¨¤·¤¿¤êÆþÎϤ·¤¿¤ê¤¹¤ë¤È¤¤¤Ã¤¿¡¢¥°¥é¥Õ¥£¥Ã¥¯¥æ¡¼¥¶¥¤¥ó¥¿¥Õ¥§¡¼¥¹¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£
-    API ¼«ÂΤϥ°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¤È¤ÏÆÈΩ¤Ç¤¢¤ë¤¬¡¢Â¿¤¯¤Î´Ø¿ô¤ÏÆÃÄê¤Î¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¾å¤ËºîÀ®¤µ¤ì¤¿ 
-    MFrame ¤ò°ú¿ô¤Ë¼è¤ë¡£¸½»þÅÀ¤Ç¤Ï¡¢¥Ì¥ë¥Ç¥Ð¥¤¥¹¡¢X ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¡¢
-    GD ¥é¥¤¥Ö¥é¥ê¤Î¥¤¥á¡¼¥¸¡ÊgdImagePtr¡Ë¡¢¤¬¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¤È¤·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
+    ¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¾å¤Ç M-text ¤òɽ¼¨¤·¤¿¤êÆþÎϤ·¤¿¤ê¤¹¤ë¤¿¤á¤Î
+    GUI ¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£¤³¤Î API
+    ¼«ÂΤϥ°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¤È¤ÏÆÈΩ¤Ç¤¢¤ë¤¬¡¢
+    Â¿¤¯¤Î´Ø¿ô¤ÏÆÃÄê¤Î¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹ÍѤ˺îÀ®¤µ¤ì¤¿ 
+    MFrame ¤ò°ú¿ô¤Ë¼è¤ë¡£
+    ¸½»þÅÀ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ï¡¢¥Ì¥ë¥Ç¥Ð¥¤¥¹¡¢X
+    ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¡¢¤ª¤è¤Ó GD ¥é¥¤¥Ö¥é¥ê¤Î¥¤¥á¡¼¥¸¥Ç¡¼¥¿
+    (gdImagePtr) ¤Ç¤¢¤ë¡£
 
 
-    ¥Ì¥ë¥Ç¥Ð¥¤¥¹¾å¤Ç¤Ïɽ¼¨¤âÆþÎϤâ¤Ç¤­¤Ê¤¤¡Ê¤¿¤À¤·¤¿¤È¤¨¤Ð
-    mdraw_glyph_list () ¤Ê¤É¤Î´Ø¿ô¤Ï»ÈÍѲÄǽ¡Ë¡£
+    ¥Ì¥ë¥Ç¥Ð¥¤¥¹¤Î¥Õ¥ì¡¼¥à¾å¤Ç¤Ïɽ¼¨¤âÆþÎϤâ¤Ç¤­¤Ê¤¤¡£¤¿¤À¤·
+    mdraw_glyph_list () ¤Ê¤É¤Î´Ø¿ô¤Ï»ÈÍѲÄǽ¤Ç¤¢¤ë¡£
 
 
-    X ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤Ç¤Ï¤¹¤Ù¤Æ¤Î GUI API ¤¬»ÈÍѤǤ­¤ë¡£
+    X ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Î¥Õ¥ì¡¼¥à¾å¤Ç¤Ï¤¹¤Ù¤Æ¤Î GUI API ¤¬»ÈÍѤǤ­¤ë¡£
 
 
-    GD ¥é¥¤¥Ö¥é¥ê¤Î¥¤¥á¡¼¥¸¾å¤Ç¤Ï¡¢ÉÁ²èÍѤΠAPI ¤Ï¤¹¤Ù¤Æ»ÈÍѤǤ­¤ë¤¬ÆþÎϤϤǤ­¤Ê¤¤¡£
+    GD ¥é¥¤¥Ö¥é¥ê¤Î¥Õ¥ì¡¼¥à¾å¤Ç¤Ï¡¢ÉÁ²èÍѤΠAPI
+    ¤Ï¤¹¤Ù¤Æ»ÈÍѤǤ­¤ë¤¬¡¢ÆþÎϤϤǤ­¤Ê¤¤¡£
 
 
-    ¤³¤Î¥Ç¥Ð¥¤¥¹¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï
+    ¤³¤Î API ¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï
     <m17n-gui<EM></EM>.h> ¤ò include ¤·¡¢-lm17n-core -lm17n -lm17n-gui
     ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
 
     <m17n-gui<EM></EM>.h> ¤ò include ¤·¡¢-lm17n-core -lm17n -lm17n-gui
     ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
 
-    ¤³¤Î API ¤ò»ÈÍѤ¹¤ëºÝ¤Ë¤Ï¡¢¥³¥¢ API ¤È¥·¥§¥ë API ¤â»ÈÍѤǤ­¤ë¡£
+    ¤³¤Î API ¤ò»ÈÍѤ¹¤ì¤Ð¡¢¥³¥¢ API¡¢¥·¥§¥ë API¡¢¤ª¤è¤Ó FLT API
+    ¤â¼«Æ°Åª¤Ë»ÈÍѲÄǽ¤È¤Ê¤ë¡£
 
     <li> ¤½¤Î¾¤Î API
 
 
     <li> ¤½¤Î¾¤Î API
 
-    ¥¨¥é¡¼½èÍý¡¢¥Ç¥Ð¥Ã¥°ÍѤΤ½¤Î¾¤Î´Ø¿ô¤òÄ󶡤¹¤ë¡£¤³¤Î API 
-    ¤Ï¤½¤ì¤À¤±¤Ç¤Ï»ÈÍѤǤ­¤º¡¢¾åµ­¤Î¾¤Î¤â¤Î¤È¶¦¤Ë»È¤¦¡£ÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¾åµ­¤Î¤¤¤º¤ì¤«¤Î
-    include ¥Õ¥¡¥¤¥ë¤Ë²Ã¤¨¤Æ¡¢ <m17n-misc<EM></EM>.h> ¤ò include ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+    ¥¨¥é¡¼½èÍý¡¢¥Ç¥Ð¥Ã¥°ÍѤΤ½¤Î¾¤Î´Ø¿ô¤òÄ󶡤¹¤ë¡£¤³¤Î API
+    ¤Ï¤½¤ì¤À¤±¤Ç¤Ï»ÈÍѤǤ­¤º¡¢¾åµ­¤Î¾¤Î API
+    ¤È¶¦¤Ë»È¤¦¡£ÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¾åµ­¤Î¤¤¤º¤ì¤«¤Îinclude
+    ¥Õ¥¡¥¤¥ë¤Ë²Ã¤¨¤Æ¡¢ <m17n-misc<EM></EM>.h> ¤òinclude
+    ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
 
     </ol>
 
 
     </ol>
 
 
     @em ´Ä¶­ÊÑ¿ô
 
 
     @em ´Ä¶­ÊÑ¿ô
 
-    m17n ¥é¥¤¥Ö¥é¥ê¤Ï¼¡¤Î´Ä¶­ÊÑ¿ô¤ò¹Íθ¤¹¤ë¡£
+    m17n ¥é¥¤¥Ö¥é¥ê¤Ï°Ê²¼¤Î´Ä¶­ÊÑ¿ô¤ò»²¾È¤¹¤ë¡£
 
     <ul>
     <li> @c M17NDIR
 
 
     <ul>
     <li> @c M17NDIR
 
-    m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¡£¾ÜºÙ¤Ï @ref
+    m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¤ò³ÊǼ¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¡£¾ÜºÙ¤Ï @ref
     m17nDatabase »²¾È¡£
 
     m17nDatabase »²¾È¡£
 
-    <li> @c MDEBUG_XXXX
+    <li> @c MDEBUG_XXX
 
 
-    "MDEBUG_" ¤Ç»Ï¤Þ¤ë̾Á°¤ò»ý¤Ä´Ä¶­ÊÑ¿ô¤Ï¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ©¸æ¤¹¤ë¡£¾ÜºÙ¤Ï @ref m17nDebug »²¾È¡£
+    "MDEBUG_" ¤Ç»Ï¤Þ¤ë̾Á°¤ò»ý¤Ä´Ä¶­ÊÑ¿ô¤Ï¥Ç¥Ð¥Ã¥°¾ðÊó¤Î½ÐÎϤòÀ©¸æ¤¹¤ë¡£
+    ¾ÜºÙ¤Ï @ref m17nDebug »²¾È¡£
 
     </ul>
 
 
     </ul>
 
-    @em API @em ¤Î̿̾µ¬Â§ ¥³¥Þ¥ó¥É
+    @em API @em ¤Î̿̾µ¬Â§
 
 
-    ¥é¥¤¥Ö¥é¥ê¤Ï¡¢´Ø¿ô¡¢ÊÑ¿ô¡¢¥Þ¥¯¥í¡¢·¿¤ò export ¤¹¤ë¡£¤½¤ì¤é¤Ï'm' 
-    ¤Þ¤¿¤Ï 'M' ¤Î¤¢¤È¤Ë¥ª¥Ö¥¸¥§¥¯¥È̾("symbol" ¤ä "plist" ¤Ê¤É¡£¤¿¤À¤· 
-    "mtext" ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¤Ï¤¸¤á¤Î 'm' ¤Î½ÅÊ£¤òÈò¤±¤ë¤¿¤á "text" 
-    ¤òÍѤ¤¤ë¡£) ¤Þ¤¿¤Ï¥â¥¸¥å¡¼¥ë̾(draw, input ¤Ê¤É) ¤ò³¤±¤¿¤â¤Î¤Ç¤¢¤ë¡£
+    m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢´Ø¿ô¡¢ÊÑ¿ô¡¢¥Þ¥¯¥í¡¢·¿¤ò export ¤¹¤ë¡£¤½¤ì¤é¤Ï 'm' 
+    ¤Þ¤¿¤Ï 'M' ¤Î¤¢¤È¤Ë¥ª¥Ö¥¸¥§¥¯¥È̾ ("symbol"¡¢"plist" ¤Ê¤É)
+    ¤Þ¤¿¤Ï¥â¥¸¥å¡¼¥ë̾ (draw, input ¤Ê¤É) ¤ò³¤±¤¿¤â¤Î¤Ç¤¢¤ë¡£
+    M-text ¥ª¥Ö¥¸¥§¥¯¥È¤Î̾Á°¤Ï "mmtext" ¤Ç¤Ï¤Ê¤¯¤Æ "mtext"
+    ¤Ç»Ï¤Þ¤ë¤³¤È¤ËÃí°Õ¡£
     
     <ul>
 
     <li> ´Ø¿ô -- mobject () ¤Þ¤¿¤Ï mobject_xxx ()
 
     
     <ul>
 
     <li> ´Ø¿ô -- mobject () ¤Þ¤¿¤Ï mobject_xxx ()
 
-    'm' ¤Î¤¢¤È¤Ë¾®Ê¸»ú¤Ç¥ª¥Ö¥¸¥§¥¯¥È̾¤¬Â³¤¯¡£¤¿¤È¤¨¤Ð¡¢msymbol (),
+    'm' ¤Î¤¢¤È¤Ë¾®Ê¸»ú¤Ç¥ª¥Ö¥¸¥§¥¯¥È̾¤¬Â³¤¯¡£Ã±¸ì´Ö¤Ï '_'
+    ¤Ç¶èÀÚ¤é¤ì¤ë¡£¤¿¤È¤¨¤Ð¡¢msymbol (),
      mtext_ref_char (), mdraw_text () ¤Ê¤É¡£
 
     <li> ¥·¥ó¥Ü¥ë¤Ç¤Ê¤¤ÊÑ¿ô -- mobject,  ¤Þ¤¿¤Ï mobject_xxx
     
      mtext_ref_char (), mdraw_text () ¤Ê¤É¡£
 
     <li> ¥·¥ó¥Ü¥ë¤Ç¤Ê¤¤ÊÑ¿ô -- mobject,  ¤Þ¤¿¤Ï mobject_xxx
     
-    ´Ø¿ô¤ÈƱ¤¸Ì¿Ì¾µ¬Â§¤Ë½¾¤¦¡£(¤¿¤È¤¨¤Ð  mface_large)
+    ´Ø¿ô¤ÈƱ¤¸Ì¿Ì¾µ¬Â§¤Ë½¾¤¦¡£¤¿¤È¤¨¤Ð  mface_large ¤Ê¤É¡£
 
     <li> ¥·¥ó¥Ü¥ëÊÑ¿ô -- Mname
 
 
     <li> ¥·¥ó¥Ü¥ëÊÑ¿ô -- Mname
 
-    MSymbol ·¿ÊÑ¿ô¤Ï¡¢'M' ¤Î¸å¤Ë̾Á°¤¬Â³¤¯¡£¤¿¤È¤¨¤Ð Mlanguage (̾Á°¤Ï 
-    "language"), Miso_2022 (̾Á°¤Ï"iso-2022")¤Ê¤É¡£
+    MSymbol ·¿ÊÑ¿ô¤Ï¡¢'M' ¤Î¸å¤Ë̾Á°¤¬Â³¤¯¡£Ã±¸ì´Ö¤Ï '_'
+    ¤Ç¶èÀÚ¤é¤ì¤ë¡£¤¿¤È¤¨¤Ð Mlanguage (̾Á°¤Ï "language"), Miso_2022
+    (̾Á°¤Ï"iso-2022") ¤Ê¤É¡£
 
     <li> ¥Þ¥¯¥í -- MOBJECT_XXX
 
 
     <li> ¥Þ¥¯¥í -- MOBJECT_XXX
 
-    'M' ¤Î¸å¤ËÂçʸ»ú¤Ç¥ª¥Ö¥¸¥§¥¯¥È̾¤¬Â³¤¯¡£
+    'M' ¤Î¸å¤ËÂçʸ»ú¤Ç¥ª¥Ö¥¸¥§¥¯¥È̾¤¬Â³¤¯¡£Ã±¸ì´Ö¤Ï '_' ¤Ç¶èÀÚ¤é¤ì¤ë¡£
 
     <li> ¥¿¥¤¥× -- MObject ¤Þ¤¿¤Ï MObjectXxx
 
 
     <li> ¥¿¥¤¥× -- MObject ¤Þ¤¿¤Ï MObjectXxx
 
-    'M' ¤Î¸å¤ËÂçʸ»ú¤Ç»Ï¤á¤Æ¥ª¥Ö¥¸¥§¥¯¥È̾¤ò¤¬Â³¤¯¡£ (¤¿¤È¤¨¤Ð
-    MConverter, MInputDriver)
+    'M' ¤Î¸å¤ËÂçʸ»ú¤Ç»Ï¤Þ¤ë¥ª¥Ö¥¸¥§¥¯¥È̾¤¬Â³¤¯¡£Ã±¸ì¤ÏϢ³¤·¤Æ½ñ¤«¤ì¡¢
+    '_' ¤ÏÍѤ¤¤é¤ì¤Ê¤¤¡£¤¿¤È¤¨¤Ð MConverter, MInputDriver ¤Ê¤É¡£
 
     </ul>
     
 
     </ul>
     
     of the m17n library.  */
 /***ja
     ¥Þ¥¯¥í #M17NLIB_MAJOR_VERSION ¤Ï m17n 
     of the m17n library.  */
 /***ja
     ¥Þ¥¯¥í #M17NLIB_MAJOR_VERSION ¤Ï m17n 
-    ¥é¥¤¥Ö¥é¥ê¤Î¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë¡£  */
+    ¥é¥¤¥Ö¥é¥ê¤Î¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë.  */
 
 #define M17NLIB_MAJOR_VERSION
 
 
 #define M17NLIB_MAJOR_VERSION
 
 
 /***ja
     ¥Þ¥¯¥í #M17NLIB_MINOR_VERSION ¤Ï m17n 
 
 /***ja
     ¥Þ¥¯¥í #M17NLIB_MINOR_VERSION ¤Ï m17n 
-    ¥é¥¤¥Ö¥é¥ê¤Î¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë¡£  */
+    ¥é¥¤¥Ö¥é¥ê¤Î¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë.  */
 
 #define M17NLIB_MINOR_VERSION
 
 
 #define M17NLIB_MINOR_VERSION
 
 
 /***ja
     ¥Þ¥¯¥í #M17NLIB_PATCH_LEVEL ¤Ï m17n 
 
 /***ja
     ¥Þ¥¯¥í #M17NLIB_PATCH_LEVEL ¤Ï m17n 
-    ¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥Ã¥Á¥ì¥Ù¥ëÈÖ¹æ¤òÍ¿¤¨¤ë¡£  */
+    ¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥Ã¥Á¥ì¥Ù¥ëÈÖ¹æ¤òÍ¿¤¨¤ë.  */
 
 #define M17NLIB_PATCH_LEVEL
 
 
 #define M17NLIB_PATCH_LEVEL
 
 
 /***ja
     ¥Þ¥¯¥í #M17NLIB_VERSION_NAME ¤Ï m17n 
 
 /***ja
     ¥Þ¥¯¥í #M17NLIB_VERSION_NAME ¤Ï m17n 
-    ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó̾¤òʸ»úÎó¤È¤·¤ÆÍ¿¤¨¤ë¡£  */
+    ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó̾¤òʸ»úÎó¤È¤·¤ÆÍ¿¤¨¤ë.  */
 
 #define M17NLIB_VERSION_NAME
 
 
 #define M17NLIB_VERSION_NAME
 
@@ -390,16 +424,37 @@ static M17NObjectArray *object_array_root;
 static void
 report_object_array ()
 {
 static void
 report_object_array ()
 {
-  fprintf (stderr, "%16s %7s %7s %7s\n",
+  fprintf (mdebug__output, "%16s %7s %7s %7s\n",
           "object", "created", "freed", "alive");
           "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;
 
           "------", "-------", "-----", "-----");
   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);
               array->used, array->used - array->count, array->count);
+      if (array->count > 0)
+       {
+         int i;
+         for (i = 0; i < array->used && ! array->objects[i]; i++);
+
+         if (strcmp (array->name, "M-text") == 0)
+           {
+             MText *mt = (MText *) array->objects[i];
+
+             if (mt->format <= MTEXT_FORMAT_UTF_8)
+               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 (mdebug__output, "\n");
+           }
+       }
+
       if (array->used > 0)
        {
          free (array->objects);
       if (array->used > 0)
        {
          free (array->objects);
@@ -416,11 +471,7 @@ int m17n__core_initialized;
 int m17n__shell_initialized;
 int m17n__gui_initialized;
 
 int m17n__shell_initialized;
 int m17n__gui_initialized;
 
-void *(*mdatabase__finder) (MSymbol tag1, MSymbol tag2,
-                          MSymbol tag3, MSymbol tag4);
-void *(*mdatabase__loader) (void *);
-
-int mdebug__flag;
+int mdebug__flags[MDEBUG_MAX];
 FILE *mdebug__output;
 
 void
 FILE *mdebug__output;
 
 void
@@ -447,23 +498,29 @@ 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));
   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;
 }
 
   time_stack[time_stack_index - 1] = tv;
 }
 
-#define SET_DEBUG_FLAG(env_name, mask)         \
-  do {                                         \
-    char *env_value = getenv (env_name);       \
-                                               \
-    if (env_value)                             \
-      {                                                \
-       if (env_value[0] == '1')                \
-         mdebug__flag |= (mask);               \
-       else if (env_value[0] == '0')           \
-         mdebug__flag &= ~(mask);              \
-      }                                                \
-  } while (0)
+static void
+SET_DEBUG_FLAG (char *env_name, enum MDebugFlag flag)
+{
+  char *env_value = getenv (env_name);
 
 
+  if (env_value)
+    {
+      int int_value = atoi (env_value);
+
+      if (flag == MDEBUG_ALL)
+       {
+         int i;
+         for (i = 0; i < MDEBUG_MAX; i++)
+           mdebug__flags[i] = int_value;
+       }
+      else
+       mdebug__flags[flag] = int_value;
+    }
+}
 
 void
 mdebug__add_object_array (M17NObjectArray *array, char *name)
 
 void
 mdebug__add_object_array (M17NObjectArray *array, char *name)
@@ -490,11 +547,15 @@ mdebug__unregister_object (M17NObjectArray *array, void *object)
   array->count--;
   if (array->count >= 0)
     {
   array->count--;
   if (array->count >= 0)
     {
-      int i = 0;
+      int i;
 
 
-      while (i < array->used && array->objects[i] != object) i++;
-      if (i < array->used)
-       array->objects[i] = NULL;
+      for (i = array->used - 1; i >= 0 && array->objects[i] != object; i--);
+      if (i >= 0)
+       {
+         if (i == array->used - 1)
+           array->used--;
+         array->objects[i] = NULL;
+       }
       else
        mdebug_hook ();
     }
       else
        mdebug_hook ();
     }
@@ -511,7 +572,7 @@ mdebug__unregister_object (M17NObjectArray *array, void *object)
 void
 m17n_init_core (void)
 {
 void
 m17n_init_core (void)
 {
-  int mdebug_mask = MDEBUG_INIT;
+  int mdebug_flag = MDEBUG_INIT;
 
   merror_code = MERROR_NONE;
   if (m17n__core_initialized++)
 
   merror_code = MERROR_NONE;
   if (m17n__core_initialized++)
@@ -519,7 +580,6 @@ m17n_init_core (void)
 
   m17n_memory_full_handler = default_error_handler;
 
 
   m17n_memory_full_handler = default_error_handler;
 
-  mdebug__flag = 0;
   SET_DEBUG_FLAG ("MDEBUG_ALL", MDEBUG_ALL);
   SET_DEBUG_FLAG ("MDEBUG_INIT", MDEBUG_INIT);
   SET_DEBUG_FLAG ("MDEBUG_FINI", MDEBUG_FINI);
   SET_DEBUG_FLAG ("MDEBUG_ALL", MDEBUG_ALL);
   SET_DEBUG_FLAG ("MDEBUG_INIT", MDEBUG_INIT);
   SET_DEBUG_FLAG ("MDEBUG_FINI", MDEBUG_FINI);
@@ -527,16 +587,19 @@ m17n_init_core (void)
   SET_DEBUG_FLAG ("MDEBUG_CODING", MDEBUG_CODING);
   SET_DEBUG_FLAG ("MDEBUG_DATABASE", MDEBUG_DATABASE);
   SET_DEBUG_FLAG ("MDEBUG_FONT", MDEBUG_FONT); 
   SET_DEBUG_FLAG ("MDEBUG_CODING", MDEBUG_CODING);
   SET_DEBUG_FLAG ("MDEBUG_DATABASE", MDEBUG_DATABASE);
   SET_DEBUG_FLAG ("MDEBUG_FONT", MDEBUG_FONT); 
-  SET_DEBUG_FLAG ("MDEBUG_FONT_FLT", MDEBUG_FONT_FLT);
-  SET_DEBUG_FLAG ("MDEBUG_FONT_OTF", MDEBUG_FONT_OTF);
+  SET_DEBUG_FLAG ("MDEBUG_FLT", MDEBUG_FLT);
+  SET_DEBUG_FLAG ("MDEBUG_FONTSET", MDEBUG_FONTSET);
   SET_DEBUG_FLAG ("MDEBUG_INPUT", MDEBUG_INPUT);
   SET_DEBUG_FLAG ("MDEBUG_INPUT", MDEBUG_INPUT);
+  /* for backward compatibility... */
+  SET_DEBUG_FLAG ("MDEBUG_FONT_FLT", MDEBUG_FLT);
+  SET_DEBUG_FLAG ("MDEBUG_FONT_OTF", MDEBUG_FLT);
   {
     char *env_value = getenv ("MDEBUG_OUTPUT_FILE");
 
     mdebug__output = NULL;
     if (env_value)
       {
   {
     char *env_value = getenv ("MDEBUG_OUTPUT_FILE");
 
     mdebug__output = NULL;
     if (env_value)
       {
-       if (strcmp (env_value, "stdout"))
+       if (strcmp (env_value, "stdout") == 0)
          mdebug__output = stdout;
        else
          mdebug__output = fopen (env_value, "a");
          mdebug__output = stdout;
        else
          mdebug__output = fopen (env_value, "a");
@@ -549,32 +612,46 @@ m17n_init_core (void)
   MDEBUG_PUSH_TIME ();
   if (msymbol__init () < 0)
     goto err;
   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;
   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",
+                    (mdebug__output, " to initialize character module."));
   if  (mchartable__init () < 0)
     goto err;
   if  (mchartable__init () < 0)
     goto err;
-  MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize chartable module."));
-  if (mtext__init () < 0)
+  MDEBUG_PRINT_TIME ("INIT",
+                    (mdebug__output, " to initialize chartable module."));
+  if (mtext__init () < 0 || mtext__prop_init () < 0)
     goto err;
     goto err;
-  if (mtext__prop_init () < 0)
+  MDEBUG_PRINT_TIME ("INIT", (mdebug__output, " to initialize mtext module."));
+  if (mdatabase__init () < 0)
     goto err;
     goto err;
-  MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize mtext module."));
-
-  mdatabase__finder = NULL;
-  mdatabase__loader = NULL;
+  MDEBUG_PRINT_TIME ("INIT",
+                    (mdebug__output, " to initialize database module."));
+
+#if ENABLE_NLS
+  bindtextdomain ("m17n-lib", GETTEXTDIR);
+  bindtextdomain ("m17n-db", GETTEXTDIR);
+  bindtextdomain ("m17n-contrib", GETTEXTDIR);
+  bind_textdomain_codeset ("m17n-lib", "UTF-8");
+  bind_textdomain_codeset ("m17n-db", "UTF-8");
+  bind_textdomain_codeset ("m17n-contrib", "UTF-8");
+#endif
 
  err:
   MDEBUG_POP_TIME ();
 
  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 ();
 }
 
 void
 m17n_fini_core (void)
 {
   MDEBUG_POP_TIME ();
 }
 
 void
 m17n_fini_core (void)
 {
-  int mdebug_mask = MDEBUG_FINI;
+  int mdebug_flag = MDEBUG_FINI;
 
   if (m17n__core_initialized == 0
       || --m17n__core_initialized > 0)
 
   if (m17n__core_initialized == 0
       || --m17n__core_initialized > 0)
@@ -583,21 +660,21 @@ m17n_fini_core (void)
   MDEBUG_PUSH_TIME ();
   MDEBUG_PUSH_TIME ();
   mchartable__fini ();
   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 ();
   mtext__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize mtext module."));
+  MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize mtext module."));
   msymbol__fini ();
   msymbol__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize symbol module."));
+  MDEBUG_PRINT_TIME ("FINI", (mdebug__output, " to finalize symbol module."));
   mplist__fini ();
   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 ();
   /* 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_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 ();
   MDEBUG_POP_TIME ();
-  if (mdebug__flag & MDEBUG_FINI)
+  if (mdebug__flags[MDEBUG_FINI])
     report_object_array ();
   msymbol__free_table ();
   if (mdebug__output != stderr)
     report_object_array ();
   msymbol__free_table ();
   if (mdebug__output != stderr)
@@ -887,7 +964,7 @@ m17n_object_unref (void *object)
 /*** @} */
 
 /***en
 /*** @} */
 
 /***en
-    @addtogroup m17nError Error handling
+    @addtogroup m17nError Error Handling
     @brief Error handling of the m17n library.
 
     There are two types of errors that may happen in a function of
     @brief Error handling of the m17n library.
 
     There are two types of errors that may happen in a function of
@@ -993,7 +1070,7 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);
     <ul>
 
     <li> Environment variables to control printing of various
     <ul>
 
     <li> Environment variables to control printing of various
-    information.
+    information to stderr.
 
     <ul>
 
 
     <ul>
 
@@ -1015,11 +1092,9 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);
     <li> MDEBUG_FONT -- If set to 1, print information about fonts
     being selected and opened.
 
     <li> MDEBUG_FONT -- If set to 1, print information about fonts
     being selected and opened.
 
-    <li> MDEBUG_FONT_FLT -- If set to 1, print information about which
-    command of Font Layout Table are being executed.
-
-    <li> MDEBUG_FONT_OTF -- If set to 1, print information about which
-    feature of OpenType Layout Table are being executed.
+    <li> MDEBUG_FLT -- If set to 1, 2, or 3, print information about
+    which command of Font Layout Table are being executed.  The bigger
+    number prints the more detailed information.
 
     <li> MDEBUG_INPUT -- If set to 1, print information about how an
     input method is running.
 
     <li> MDEBUG_INPUT -- If set to 1, print information about how an
     input method is running.
@@ -1027,6 +1102,10 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);
     <li> MDEBUG_ALL -- Setting this variable to 1 is equivalent to
     setting all the above variables to 1.
 
     <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> Functions to print various objects in a human readable way.
@@ -1045,7 +1124,7 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);
 
     <ul>
 
 
     <ul>
 
-    <li> ¤µ¤Þ¤¶¤Þ¤Ê¾ðÊó¤Î¥×¥ê¥ó¥È¤òÀ©¸æ¤¹¤ë´Ä¶­ÊÑ¿ô¡£
+    <li> ¤µ¤Þ¤¶¤Þ¤Ê¾ðÊó¤Îɸ½à¥¨¥é¡¼½ÐÎϤؤΥץê¥ó¥È¤òÀ©¸æ¤¹¤ë´Ä¶­ÊÑ¿ô¡£
 
     <ul>
 
 
     <ul>
 
@@ -1064,19 +1143,23 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);
     <li> MDEBUG_DATABASE -- 1 ¤Ê¤é¤Ð¡¢m17n
     ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥í¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
 
     <li> MDEBUG_DATABASE -- 1 ¤Ê¤é¤Ð¡¢m17n
     ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥í¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
 
-    <li> MDEBUG_FONT -- 1 ¤Ê¤é¤Ð¡¢ÁªÂò¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥©¥ó¥È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
+    <li> MDEBUG_FONT -- 1 ¤Ê¤é¤Ð¡¢ÁªÂò¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥©¥ó¥È¤Ë¤Ä
+    ¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
 
 
-    <li> MDEBUG_FONT_FLT -- 1 ¤Ê¤é¤Ð¡¢Font Layout Table 
-    ¤Î¤É¤Î¥³¥Þ¥ó¥É¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
+    <li> MDEBUG_FLT -- 1¡¢2¡¢¤â¤·¤¯¤Ï 3 ¤Ê¤é¤Ð¡¢Font Layout Table ¤Î¤É
+    ¤Î¥³¥Þ¥ó¥É¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£¤è¤êÂ礭¤ÊÃÍÄø¤è¤ê¾Ü
+    ¤·¤¤¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
 
 
-    <li> MDEBUG_FONT_OTF -- 1 ¤Ê¤é¤Ð¡¢OpenType Layout Table 
-    ¤Î¤É¤Î°À­¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
-
-    <li> MDEBUG_INPUT -- 1 ¤Ê¤é¤Ð¡¢¼Â¹ÔÃæ¤ÎÆþÎϥ᥽¥Ã¥É¤Î¾õÂÖ¤ËÉÕ¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
+    <li> MDEBUG_INPUT -- 1 ¤Ê¤é¤Ð¡¢¼Â¹ÔÃæ¤ÎÆþÎϥ᥽¥Ã¥É¤Î¾õÂÖ¤ËÉÕ¤¤¤Æ¤Î
+    ¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
 
     <li> MDEBUG_ALL -- 1 ¤Ê¤é¤Ð¡¢¾åµ­¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤ò 1 
     ¤Ë¤·¤¿¤Î¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¡£
 
 
     <li> MDEBUG_ALL -- 1 ¤Ê¤é¤Ð¡¢¾åµ­¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤ò 1 
     ¤Ë¤·¤¿¤Î¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¡£
 
+    <li> MDEBUG_OUTPUT_FILE -- ¤â¤·¥Õ¥¡¥¤¥ë̾¤Ê¤é¡¢¾åµ­¥Ç¥Ð¥Ã¥°¾ðÊó¤Ï¤½
+    ¤Î¥Õ¥¡¥¤¥ë¤ËÄɲ䵤ì¤ë¡£¤â¤· "stdout" ¤Ê¤é¤½¤Î¾ðÊó¤Ïɸ½à½ÐÎϤ˽ÐÎÏ
+    ¤µ¤ì¤ë¡£
+
     </ul>
 
     <li> ¼ï¡¹¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç¥×¥ê¥ó¥È¤¹¤ë´Ø¿ô¡£¾ÜºÙ¤Ï´Ø¿ô
     </ul>
 
     <li> ¼ï¡¹¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç¥×¥ê¥ó¥È¤¹¤ë´Ø¿ô¡£¾ÜºÙ¤Ï´Ø¿ô