*** empty log message ***
[m17n/m17n-lib.git] / src / m17n.c
index 8c7c14d..d25a946 100644 (file)
@@ -1,5 +1,5 @@
 /* m17n.c -- body of the SHELL API.
-   Copyright (C) 2003, 2004
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
      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
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 #include <config.h>
@@ -29,6 +29,8 @@
 #include "charset.h"
 #include "coding.h"
 
+#if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
+
 \f
 /* Internal API */
 
@@ -38,8 +40,9 @@
 void
 m17n_init (void)
 {
-  int mdebug_mask = MDEBUG_INIT;
+  int mdebug_flag = MDEBUG_INIT;
 
+  merror_code = MERROR_NONE;
   if (m17n__shell_initialized++)
     return;
   m17n_init_core ();
@@ -56,18 +59,12 @@ m17n_init (void)
   if (mcoding__init () < 0)
     goto err;
   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize conv module."));
-  if (mdatabase__init () < 0)
-    goto err;
-  MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize database module."));
   if (mcharset__load_from_database () < 0)
     goto err;
   MDEBUG_PRINT_TIME ("INIT", (stderr, " to load charset definitions."));
   if (mcoding__load_from_database () < 0)
     goto err;
   MDEBUG_PRINT_TIME ("INIT", (stderr, " to load coding definitions."));
-  if (mchar__init () < 0)
-    goto err;
-  MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize character module."));
   if (mlang__init () < 0)
     goto err;
   MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize language module"));
@@ -87,7 +84,7 @@ m17n_init (void)
 void
 m17n_fini (void)
 {
-  int mdebug_mask = MDEBUG_FINI;
+  int mdebug_flag = MDEBUG_FINI;
 
   if (m17n__shell_initialized == 0
       || --m17n__shell_initialized > 0)
@@ -95,26 +92,28 @@ m17n_fini (void)
 
   MDEBUG_PUSH_TIME ();
   MDEBUG_PUSH_TIME ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input module."));
   minput__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize locale module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input module."));
   mlocale__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize language module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize locale module."));
   mlang__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize character module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize language module."));
   mchar__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize database module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize character module."));
   mdatabase__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize coding module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize database module."));
   mcoding__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize charset module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize coding module."));
   mcharset__fini ();
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize charset module."));
   MDEBUG_POP_TIME ();
   MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the shell modules."));
   MDEBUG_POP_TIME ();
   m17n_fini_core ();
 }
 
+#endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
+
 /*
   Local Variables:
   coding: euc-japan