LispBM
symrepr.h
Go to the documentation of this file.
1  /*
2  Copyright 2018, 2021, 2022 Joel Svensson svenssonjoel@yahoo.se
3  2022 Benjamin Vedder
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program 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
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
28 #ifndef SYMTAB_H_
29 #define SYMTAB_H_
30 
31 #include <stdint.h>
32 #include <stdbool.h>
33 
34 #include "lbm_types.h"
35 #include "lbm_defines.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 typedef void (*symrepr_name_iterator_fun)(const char *);
42 
47 
52 
57 
63 bool store_symbol_name_flash(char *name, lbm_uint *res);
64 
69 bool lbm_symrepr_init(void);
75 int lbm_add_symbol_base(char *name, lbm_uint *id);
82 int lbm_add_symbol(char *name, lbm_uint *id);
83 
90 int lbm_str_to_symbol(char *name, lbm_uint *sym_id);
98 int lbm_add_symbol_const_base(char *name, lbm_uint* id, bool link);
105 int lbm_add_symbol_const(char *name, lbm_uint *id);
118 int lbm_get_symbol_by_name(char *name, lbm_uint *id);
124 const char* lbm_get_name_by_symbol(lbm_uint id);
125 
144 
149 bool lbm_symbol_in_flash(char *str);
154 bool lbm_symbol_list_entry_in_flash(char *str);
155 
156 
157 extern lbm_value symbol_x;
158 extern lbm_value symbol_y;
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 #endif
uint32_t lbm_uint
Definition: lbm_types.h:48
uint32_t lbm_value
Definition: lbm_types.h:44
void lbm_symrepr_set_next_id(lbm_uint id)
Definition: symrepr.c:278
bool store_symbol_name_flash(char *name, lbm_uint *res)
Definition: symrepr.c:388
const char * lbm_get_name_by_symbol(lbm_uint id)
Definition: symrepr.c:314
int lbm_add_symbol_base(char *name, lbm_uint *id)
Definition: symrepr.c:427
int lbm_get_symbol_by_name(char *name, lbm_uint *id)
Definition: symrepr.c:355
int lbm_add_symbol_const_base(char *name, lbm_uint *id, bool link)
Definition: symrepr.c:453
void(* symrepr_name_iterator_fun)(const char *)
Definition: symrepr.h:41
void lbm_symrepr_name_iterator(symrepr_name_iterator_fun f)
Definition: symrepr.c:292
lbm_uint * lbm_get_symbol_list_entry_by_name(char *name)
Definition: symrepr.c:342
bool lbm_symrepr_init(void)
Definition: symrepr.c:282
lbm_value symbol_rest_args
int lbm_add_symbol_const(char *name, lbm_uint *id)
Definition: symrepr.c:470
lbm_uint lbm_symrepr_get_next_id(void)
Definition: symrepr.c:274
void lbm_symrepr_set_symlist(lbm_uint *ls)
Definition: symrepr.c:269
int lbm_add_symbol(char *name, lbm_uint *id)
Definition: symrepr.c:441
lbm_uint lbm_get_symbol_table_size_names(void)
Definition: symrepr.c:496
lbm_uint lbm_get_symbol_table_size_names_flash(void)
Definition: symrepr.c:500
lbm_uint lbm_get_symbol_table_size_flash(void)
Definition: symrepr.c:491
bool lbm_symbol_list_entry_in_flash(char *str)
Definition: symrepr.c:508
lbm_value symbol_y
Definition: eval_cps.c:176
int lbm_str_to_symbol(char *name, lbm_uint *sym_id)
Definition: symrepr.c:480
lbm_uint lbm_get_symbol_table_size(void)
Definition: symrepr.c:487
bool lbm_symbol_in_flash(char *str)
Definition: symrepr.c:504
lbm_value symbol_x
Definition: eval_cps.c:175