X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fm17n-core.c;h=945745e01520a32a903df41a9418707e22239482;hb=f2834223388500696694f941b9dbc8200e8e795a;hp=e54b9e274c65346d620cdae903514949197336b4;hpb=8579dcc35ac4bc24804e0e29f5636720ca5651f3;p=m17n%2Fm17n-lib.git diff --git a/src/m17n-core.c b/src/m17n-core.c index e54b9e2..945745e 100644 --- a/src/m17n-core.c +++ b/src/m17n-core.c @@ -1,5 +1,5 @@ /* m17n-core.c -- body of the CORE API. - Copyright (C) 2003, 2004, 2005, 2006, 2007 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H15PRO112 @@ -26,7 +26,7 @@ API LEVELS - The API of the m17n library is divided into these four. + The API of the m17n library is divided into these five.
  1. CORE API @@ -284,7 +284,7 @@ of the m17n library. */ /***ja ¥Þ¥¯¥í #M17NLIB_MAJOR_VERSION ¤Ï m17n - ¥é¥¤¥Ö¥é¥ê¤Î¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë¡£ */ + ¥é¥¤¥Ö¥é¥ê¤Î¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë. */ #define M17NLIB_MAJOR_VERSION @@ -296,7 +296,7 @@ /***ja ¥Þ¥¯¥í #M17NLIB_MINOR_VERSION ¤Ï m17n - ¥é¥¤¥Ö¥é¥ê¤Î¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë¡£ */ + ¥é¥¤¥Ö¥é¥ê¤Î¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÍ¿¤¨¤ë. */ #define M17NLIB_MINOR_VERSION @@ -308,7 +308,7 @@ /***ja ¥Þ¥¯¥í #M17NLIB_PATCH_LEVEL ¤Ï m17n - ¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥Ã¥Á¥ì¥Ù¥ëÈÖ¹æ¤òÍ¿¤¨¤ë¡£ */ + ¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥Ã¥Á¥ì¥Ù¥ëÈÖ¹æ¤òÍ¿¤¨¤ë. */ #define M17NLIB_PATCH_LEVEL @@ -320,7 +320,7 @@ /***ja ¥Þ¥¯¥í #M17NLIB_VERSION_NAME ¤Ï m17n - ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó̾¤òʸ»úÎó¤È¤·¤ÆÍ¿¤¨¤ë¡£ */ + ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó̾¤òʸ»úÎó¤È¤·¤ÆÍ¿¤¨¤ë. */ #define M17NLIB_VERSION_NAME @@ -434,6 +434,27 @@ report_object_array () fprintf (stderr, "%16s %7d %7d %7d\n", array->name, 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 (stderr, "\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"); + } + } + if (array->used > 0) { free (array->objects); @@ -566,9 +587,12 @@ 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_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); + /* 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"); @@ -936,7 +960,7 @@ m17n_object_unref (void *object) /*** @} */ /***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 @@ -1064,11 +1088,9 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);
  2. MDEBUG_FONT -- If set to 1, print information about fonts being selected and opened. -
  3. MDEBUG_FONT_FLT -- If set to 1, print information about which - command of Font Layout Table are being executed. - -
  4. MDEBUG_FONT_OTF -- If set to 1, print information about which - feature of OpenType Layout Table are being executed. +
  5. 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.
  6. MDEBUG_INPUT -- If set to 1, print information about how an input method is running. @@ -1113,15 +1135,15 @@ void (*m17n_memory_full_handler) (enum MErrorCode err);
  7. MDEBUG_DATABASE -- 1 ¤Ê¤é¤Ð¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥í¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£ -
  8. MDEBUG_FONT -- 1 ¤Ê¤é¤Ð¡¢ÁªÂò¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥©¥ó¥È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£ - -
  9. MDEBUG_FONT_FLT -- 1 ¤Ê¤é¤Ð¡¢Font Layout Table - ¤Î¤É¤Î¥³¥Þ¥ó¥É¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£ +
  10. MDEBUG_FONT -- 1 ¤Ê¤é¤Ð¡¢ÁªÂò¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥©¥ó¥È¤Ë¤Ä + ¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£ -
  11. MDEBUG_FONT_OTF -- 1 ¤Ê¤é¤Ð¡¢OpenType Layout Table - ¤Î¤É¤Î°À­¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£ +
  12. MDEBUG_FLT -- 1¡¢2¡¢¤â¤·¤¯¤Ï 3 ¤Ê¤é¤Ð¡¢Font Layout Table ¤Î¤É + ¤Î¥³¥Þ¥ó¥É¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£¤è¤êÂ礭¤ÊÃÍÄø¤è¤ê¾Ü + ¤·¤¤¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£ -
  13. MDEBUG_INPUT -- 1 ¤Ê¤é¤Ð¡¢¼Â¹ÔÃæ¤ÎÆþÎϥ᥽¥Ã¥É¤Î¾õÂÖ¤ËÉÕ¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£ +
  14. MDEBUG_INPUT -- 1 ¤Ê¤é¤Ð¡¢¼Â¹ÔÃæ¤ÎÆþÎϥ᥽¥Ã¥É¤Î¾õÂÖ¤ËÉÕ¤¤¤Æ¤Î + ¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
  15. MDEBUG_ALL -- 1 ¤Ê¤é¤Ð¡¢¾åµ­¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤ò 1 ¤Ë¤·¤¿¤Î¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¡£