21 #ifndef __EDELIB_SCHEME_H__
22 #define __EDELIB_SCHEME_H__
25 # include "ts/scheme.h"
26 # include "ts/scheme-private.h"
70 #define edelib_scheme_init_raw scheme_init_new
76 #define edelib_scheme_deinit scheme_deinit
82 #define edelib_scheme_load_file scheme_load_file
88 #define edelib_scheme_load_named_file scheme_load_named_file
94 #define edelib_scheme_load_string scheme_load_string
100 #define edelib_scheme_eval scheme_eval
106 #define edelib_scheme_apply0 scheme_apply0
112 #define edelib_scheme_set_external_data scheme_set_external_data
118 #define edelib_scheme_get_external_data(sc) (sc)->ext_data
124 #define edelib_scheme_define scheme_define
130 #define edelib_scheme_call scheme_call
136 #define edelib_scheme_set_input_port_file scheme_set_input_port_file
142 #define edelib_scheme_set_output_port_file scheme_set_output_port_file
148 #define edelib_scheme_set_input_port_string scheme_set_input_port_string
154 #define edelib_scheme_set_output_port_string scheme_set_output_port_string
160 #define edelib_scheme_gensym(sc) (sc)->vptr->gensym(sc)
166 #define edelib_scheme_cons(sc, a, b) _cons((sc), a, b, 0)
172 #define edelib_scheme_immutable_cons(sc, a, b) _cons((sc), a, b, 1)
178 #define edelib_scheme_reserve_cells(sc, n) (sc)->vptr->reserve_cells(sc, n)
184 #define edelib_scheme_mk_int(sc, num) (sc)->vptr->mk_integer(sc, num)
190 #define edelib_scheme_mk_double(sc, num) (sc)->vptr->mk_real(sc, num)
196 #define edelib_scheme_mk_symbol(sc, sym) (sc)->vptr->mk_symbol(sc, sym)
202 #define edelib_scheme_mk_string(sc, str) (sc)->vptr->mk_string(sc, str)
208 #define edelib_scheme_mk_string_counted(sc, str) (sc)->vptr->mk_counted_string(sc, str)
209 #define edelib_scheme_mk_character(sc, c) (sc)->vptr->mk_character(sc, c)
210 #define edelib_scheme_mk_vector(sc, len) (sc)->vptr->mk_vector(sc, len)
211 #define edelib_scheme_mk_foreign_func(sc, func) (sc)->vptr->mk_foreign_func(sc, func)
212 #define edelib_scheme_putstr(sc, str) (sc)->vptr->putstr(sc, str)
213 #define edelib_scheme_putcharacter(sc, c) (sc)->vptr->putcharacter(sc, c)
215 #define edelib_scheme_is_string(sc, p) (sc)->vptr->is_string(p)
216 #define edelib_scheme_string_value(sc, p) (sc)->vptr->string_value(p)
217 #define edelib_scheme_is_int(sc, p) (sc)->vptr->is_number(p)
218 #define edelib_scheme_int_value(sc, p) (int)((sc)->vptr->ivalue(p))
219 #define edelib_scheme_is_double(sc, p) (sc)->vptr->is_real(p)
220 #define edelib_scheme_double_value(sc, p) (sc)->vptr->rvalue(p)
221 #define edelib_scheme_is_char(sc, p) (sc)->vptr->is_character(p)
222 #define edelib_scheme_char_value(sc, p) (sc)->vptr->charvalue(p)
223 #define edelib_scheme_is_vector(sc, p) (sc)->vptr->is_vector(p)
224 #define edelib_scheme_vector_len(sc, p) (sc)->vptr->vector_length(p)
225 #define edelib_scheme_vector_fill(sc, vec, v) (sc)->vptr->fill_vector(vec, v)
226 #define edelib_scheme_vector_elem(sc, vec, i) (sc)->vptr->vector_elem(vec, i)
227 #define edelib_scheme_vector_elem_set(sc, vec, i, newel) (sc)->vptr->set_vector_elem(vec, i, newel)
228 #define edelib_scheme_is_port(sc, p) (sc)->vptr->is_port(p)
229 #define edelib_scheme_is_pair(sc, p) (sc)->vptr->is_pair(p)
230 #define edelib_scheme_pair_car(sc, p) (sc)->vptr->pair_car(p)
231 #define edelib_scheme_pair_cdr(sc, p) (sc)->vptr->pair_cdr(p)
232 #define edelib_scheme_car_set(sc, p, q) (sc)->vptr->set_car(p, q)
233 #define edelib_scheme_cdr_set(sc, p, q) (sc)->vptr->set_cdr(p, q)
234 #define edelib_scheme_is_symbol(sc, p) (sc)->vptr->is_symbol(p)
235 #define edelib_scheme_symname(sc, p) (sc)->vptr->symname(p)
236 #define edelib_scheme_is_syntax(sc, p) (sc)->vptr->is_syntax(p)
237 #define edelib_scheme_syntaxname(sc, p) (sc)->vptr->syntaxname(p)
238 #define edelib_scheme_is_proc(sc, p) (sc)->vptr->is_proc(p)
239 #define edelib_scheme_is_macro(sc, p) (sc)->vptr->is_macro(p)
240 #define edelib_scheme_is_foreign(sc, p) (sc)->vptr->is_foreign(p)
241 #define edelib_scheme_closure_code(sc, p) (sc)->vptr->closure_code(p)
242 #define edelib_scheme_closure_env(sc, p) (sc)->vptr->closure_env(p)
244 #define edelib_scheme_is_continuation(sc, p) (sc)->vptr->is_continuation(p)
245 #define edelib_scheme_is_promise(sc, p) (sc)->vptr->is_promise(p)
246 #define edelib_scheme_is_environment(sc, p) (sc)->vptr->is_environment(p)
248 #define edelib_scheme_is_immutable(sc, p) (sc)->vptr->is_immutable(p)
249 #define edelib_scheme_set_immutable(sc, p) (sc)->vptr->setimmutable(p)
256 #define EDELIB_SCHEME_DEFINE(sc, func_ptr, func_name) \
257 sc->vptr->scheme_define(sc, sc->global_env, \
258 sc->vptr->mk_symbol(sc, func_name), \
259 sc->vptr->mk_foreign_func(sc, func_ptr))
266 #define EDELIB_SCHEME_DEFINE2(sc, func_ptr, func_name, doc) \
268 scheme_load_string(sc, "(add-doc " #func_name " " #doc ")"); \
269 EDELIB_SCHEME_DEFINE(sc, func_ptr, func_name); \
272 #define EDELIB_SCHEME_OBJECT(sc) ((sc)->vptr)
273 #define EDELIB_SCHEME_GLOBAL_ENV(sc) ((sc)->global_env)
280 #define EDELIB_SCHEME_IS_NIL(sc, var) ((var) == sc->NIL)
scheme * edelib_scheme_init(void)
scheme edelib_scheme_t
Definition: Scheme.h:49
pointer edelib_scheme_pointer_t
Definition: Scheme.h:55