1 |
|
|
/* |
2 |
|
|
Copyright 2018, 2020, 2024 Joel Svensson svenssonjoel@yahoo.se |
3 |
|
|
|
4 |
|
|
This program is free software: you can redistribute it and/or modify |
5 |
|
|
it under the terms of the GNU General Public License as published by |
6 |
|
|
the Free Software Foundation, either version 3 of the License, or |
7 |
|
|
(at your option) any later version. |
8 |
|
|
|
9 |
|
|
This program is distributed in the hope that it will be useful, |
10 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
|
|
GNU General Public License for more details. |
13 |
|
|
|
14 |
|
|
You should have received a copy of the GNU General Public License |
15 |
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 |
|
|
*/ |
17 |
|
|
|
18 |
|
|
#include "lispbm.h" |
19 |
|
|
|
20 |
|
21672 |
int lbm_init(lbm_cons_t *heap_storage, lbm_uint heap_size, |
21 |
|
|
lbm_uint *memory, lbm_uint memory_size, |
22 |
|
|
lbm_uint *memory_bitmap, lbm_uint bitmap_size, |
23 |
|
|
lbm_uint gc_stack_size, |
24 |
|
|
lbm_uint print_stack_size, |
25 |
|
|
lbm_extension_t *extension_storage, |
26 |
|
|
lbm_uint extension_storage_size) { |
27 |
|
|
|
28 |
✗✓ |
21672 |
if (lbm_memory_init(memory, memory_size, |
29 |
|
|
memory_bitmap, bitmap_size) == 0) |
30 |
|
|
return 0; |
31 |
|
|
|
32 |
✗✓ |
21672 |
if (lbm_symrepr_init() == 0) |
33 |
|
|
return 0; |
34 |
|
|
|
35 |
✗✓ |
21672 |
if (lbm_heap_init(heap_storage, heap_size, gc_stack_size) == 0) |
36 |
|
|
return 0; |
37 |
|
|
|
38 |
✗✓ |
21672 |
if (lbm_print_init(print_stack_size) == 0) |
39 |
|
|
return 0; |
40 |
|
|
|
41 |
✗✓ |
21672 |
if (lbm_extensions_init(extension_storage, extension_storage_size) == 0) |
42 |
|
|
return 0; |
43 |
|
|
|
44 |
✗✓ |
21672 |
if (lbm_init_env() == 0) |
45 |
|
|
return 0; |
46 |
|
|
|
47 |
✗✓ |
21672 |
if (lbm_eval_init() == 0) |
48 |
|
|
return 0; |
49 |
|
|
|
50 |
|
21672 |
return 1; |
51 |
|
|
} |
52 |
|
|
|