1 /*
2  * The Spar Library -  A comprehensive
3  * Copyright (C) 2000,2001 Davide Angelocola <davide178@inwind.it>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA  02111-1307, USA.
19  *
20  */
21 
22 #include <spar/sl_init.h>
23 #include <spar/sl_parser.h>
24 #include <spar/sl_module_manager.h>
25 
26 #ifdef DEBUG
27 #include <spar/sl_util.h>
28 #endif
29 
30 static bool __init = false;
31 
32 int
sl_init(void)33 sl_init (void)
34 {
35   sl_assert (__init != true);
36 
37   sl_variable_init ();
38   sl_module_manager_init ();
39   sl_function_init ();
40   sl_constant_init ();
41 
42   __init = true;
43 
44   return SL_SUCCESS;
45 }
46 
47 int
sl_de_init(void)48 sl_de_init (void)
49 {
50   sl_assert (__init == true);
51 
52   sl_variable_remove_all ();
53   sl_module_manager_remove_all ();
54 
55 #ifdef DEBUG
56   sl_memory_stats ();
57 #endif
58 
59   __init = false;
60 
61   return SL_SUCCESS;
62 }
63