1 /* m17n.c -- body of the SHELL API.
2 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H15PRO112
6 This file is part of the m17n library.
8 The m17n library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public License
10 as published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.
13 The m17n library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with the m17n library; if not, write to the Free
20 Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 #include "m17n-misc.h"
32 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
43 int mdebug_flag = MDEBUG_INIT;
45 merror_code = MERROR_NONE;
46 if (m17n__shell_initialized++)
49 if (merror_code != MERROR_NONE)
51 m17n__shell_initialized--;
56 if (mcharset__init () < 0)
58 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize charset module."));
59 if (mcoding__init () < 0)
61 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize conv module."));
62 if (mcharset__load_from_database () < 0)
64 MDEBUG_PRINT_TIME ("INIT", (stderr, " to load charset definitions."));
65 if (mcoding__load_from_database () < 0)
67 MDEBUG_PRINT_TIME ("INIT", (stderr, " to load coding definitions."));
68 if (mlang__init () < 0)
70 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize language module"));
71 if (mlocale__init () < 0)
73 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize locale module."));
74 if (minput__init () < 0)
76 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize input module."));
80 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize the shell modules."));
87 int mdebug_flag = MDEBUG_FINI;
89 if (m17n__shell_initialized == 0
90 || --m17n__shell_initialized > 0)
96 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input module."));
98 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize locale module."));
100 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize language module."));
102 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize character module."));
104 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize database module."));
106 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize coding module."));
108 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize charset module."));
110 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the shell modules."));
115 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */