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 
43 
48 int lbm_symrepr_init(void);
54 int lbm_add_symbol_base(char *name, lbm_uint *id, bool flash);
61 int lbm_add_symbol(char *name, lbm_uint *id);
68 int lbm_add_symbol_flash(char *name, lbm_uint* id);
75 int lbm_str_to_symbol(char *name, lbm_uint *sym_id);
76 int lbm_add_symbol_const_base(char *name, lbm_uint* id);
83 int lbm_add_symbol_const(char *name, lbm_uint *id);
96 int lbm_get_symbol_by_name(char *name, lbm_uint *id);
102 const char* lbm_get_name_by_symbol(lbm_uint id);
103 
122 
127 bool lbm_symbol_in_flash(char *str);
132 bool lbm_symbol_list_entry_in_flash(char *str);
133 
134 
135 extern lbm_value symbol_x;
136 extern lbm_value symbol_y;
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 #endif
lbm_defines.h
lbm_symrepr_name_iterator
void lbm_symrepr_name_iterator(symrepr_name_iterator_fun f)
Definition: symrepr.c:275
lbm_symbol_in_flash
bool lbm_symbol_in_flash(char *str)
Definition: symrepr.c:515
lbm_get_symbol_table_size
lbm_uint lbm_get_symbol_table_size(void)
Definition: symrepr.c:497
symrepr_name_iterator_fun
void(* symrepr_name_iterator_fun)(const char *)
Definition: symrepr.h:41
lbm_uint
uint32_t lbm_uint
Definition: lbm_types.h:48
lbm_add_symbol_const
int lbm_add_symbol_const(char *name, lbm_uint *id)
Definition: symrepr.c:478
lbm_get_name_by_symbol
const char * lbm_get_name_by_symbol(lbm_uint id)
Definition: symrepr.c:297
lbm_add_symbol_const_base
int lbm_add_symbol_const_base(char *name, lbm_uint *id)
Definition: symrepr.c:466
lbm_add_symbol
int lbm_add_symbol(char *name, lbm_uint *id)
Definition: symrepr.c:444
lbm_get_symbol_by_name
int lbm_get_symbol_by_name(char *name, lbm_uint *id)
Definition: symrepr.c:335
lbm_get_symbol_table_size_names
lbm_uint lbm_get_symbol_table_size_names(void)
Definition: symrepr.c:507
lbm_symrepr_init
int lbm_symrepr_init(void)
Definition: symrepr.c:258
symbol_rest_args
lbm_value symbol_rest_args
symbol_x
lbm_value symbol_x
Definition: symrepr.c:255
lbm_str_to_symbol
int lbm_str_to_symbol(char *name, lbm_uint *sym_id)
Definition: symrepr.c:489
lbm_types.h
lbm_get_symbol_table_size_flash
lbm_uint lbm_get_symbol_table_size_flash(void)
Definition: symrepr.c:502
lbm_add_symbol_flash
int lbm_add_symbol_flash(char *name, lbm_uint *id)
Definition: symrepr.c:455
lbm_value
uint32_t lbm_value
Definition: lbm_types.h:44
symbol_y
lbm_value symbol_y
Definition: symrepr.c:256
lbm_get_symbol_table_size_names_flash
lbm_uint lbm_get_symbol_table_size_names_flash(void)
Definition: symrepr.c:511
lbm_symbol_list_entry_in_flash
bool lbm_symbol_list_entry_in_flash(char *str)
Definition: symrepr.c:519
lbm_add_symbol_base
int lbm_add_symbol_base(char *name, lbm_uint *id, bool flash)
Definition: symrepr.c:430
lbm_get_symbol_list_entry_by_name
lbm_uint * lbm_get_symbol_list_entry_by_name(char *name)
Definition: symrepr.c:322