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>
#include "charset.h"
#include "coding.h"
-static int shell_initialized;
+#if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
\f
/* Internal API */
{
int mdebug_mask = MDEBUG_INIT;
- if (shell_initialized)
+ merror_code = MERROR_NONE;
+ if (m17n__shell_initialized++)
return;
m17n_init_core ();
if (merror_code != MERROR_NONE)
- return;
+ {
+ m17n__shell_initialized--;
+ return;
+ }
MDEBUG_PUSH_TIME ();
MDEBUG_PUSH_TIME ();
if (mcharset__init () < 0)
if (minput__init () < 0)
goto err;
MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize input module."));
- shell_initialized = 1;
err:
MDEBUG_POP_TIME ();
{
int mdebug_mask = MDEBUG_FINI;
- if (shell_initialized)
- {
- MDEBUG_PUSH_TIME ();
- MDEBUG_PUSH_TIME ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize input module."));
- minput__fini ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize locale module."));
- mlocale__fini ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize language module."));
- mlang__fini ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize character module."));
- mchar__fini ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize database module."));
- mdatabase__fini ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize coding module."));
- mcoding__fini ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize charset module."));
- mcharset__fini ();
- MDEBUG_POP_TIME ();
- MDEBUG_PRINT_TIME ("INIT", (stderr, " to finalize the shell modules."));
- MDEBUG_POP_TIME ();
- shell_initialized = 0;
- }
+ if (m17n__shell_initialized == 0
+ || --m17n__shell_initialized > 0)
+ return;
+
+ MDEBUG_PUSH_TIME ();
+ MDEBUG_PUSH_TIME ();
+ minput__fini ();
+ MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input module."));
+ mlocale__fini ();
+ MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize locale module."));
+ mlang__fini ();
+ MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize language module."));
+ mchar__fini ();
+ MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize character module."));
+ mdatabase__fini ();
+ MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize database module."));
+ mcoding__fini ();
+ 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