|
Cyclone Scheme
0.28.0
|
Go to the documentation of this file.
9 #ifndef CYCLONE_RUNTIME_H
10 #define CYCLONE_RUNTIME_H
69 #define Cyc_check_num_args(data, fnc_name, num_args, args) { \
70 object l = Cyc_length(data, args); \
71 if (num_args > obj_obj2int(l)) { \
73 snprintf(buf, 127, "Expected %d arguments to %s but received %ld", \
74 num_args, fnc_name, obj_obj2int(l)); \
75 Cyc_rt_raise_msg(data, buf); \
79 #define Cyc_check_argc(data, fnc_name, argc, expected) { \
80 if (expected > argc) { \
82 snprintf(buf, 127, "Expected %d arguments to %s but received %ld", \
83 expected, fnc_name, argc); \
84 Cyc_rt_raise_msg(data, buf); \
93 #define Cyc_verify_mutable(data, obj) { \
94 if (immutable(obj)) Cyc_immutable_obj_error(data, obj); }
101 #define Cyc_verify_immutable(data, obj) { \
102 if (boolean_f == Cyc_is_immutable(obj)) Cyc_mutable_obj_error(data, obj); }
111 #define Cyc_check_type(data, fnc_test, tag, obj) { \
112 if ((boolean_f == fnc_test(obj))) Cyc_invalid_type_error(data, tag, obj); }
113 #define Cyc_check_type2(data, fnc_test, tag, obj) { \
114 if ((boolean_f == fnc_test(data, obj))) Cyc_invalid_type_error(data, tag, obj); }
121 #define Cyc_check_pair_or_null(d,obj) { if (obj != NULL) { Cyc_check_pair(d,obj); }}
127 #define Cyc_check_pair(d,obj) Cyc_check_type(d,Cyc_is_pair, pair_tag, obj)
133 #define Cyc_check_proc(d,obj) Cyc_check_type2(d,Cyc_is_procedure, closureN_tag, obj)
139 #define Cyc_check_num(d,obj) Cyc_check_type(d,Cyc_is_number, integer_tag, obj)
145 #define Cyc_check_fixnum(d,obj) Cyc_check_type(d,Cyc_is_fixnum, integer_tag, obj)
151 #define Cyc_check_int(d,obj) Cyc_check_type(d,Cyc_is_integer, integer_tag, obj)
157 #define Cyc_check_double(d,obj) Cyc_check_type(d,Cyc_is_double, double_tag, obj)
163 #define Cyc_check_str(d,obj) Cyc_check_type(d,Cyc_is_string, string_tag, obj)
169 #define Cyc_check_sym(d,obj) Cyc_check_type(d,Cyc_is_symbol, symbol_tag, obj)
175 #define Cyc_check_vec(d,obj) Cyc_check_type(d,Cyc_is_vector, vector_tag, obj)
181 #define Cyc_check_bvec(d,obj) Cyc_check_type(d,Cyc_is_bytevector, bytevector_tag, obj)
187 #define Cyc_check_port(d,obj) Cyc_check_type(d,Cyc_is_port, port_tag, obj)
193 #define Cyc_check_mutex(d,obj) Cyc_check_type(d,Cyc_is_mutex, mutex_tag, obj)
199 #define Cyc_check_cond_var(d,obj) Cyc_check_type(d,Cyc_is_cond_var, cond_var_tag, obj)
205 #define Cyc_check_atomic(d,obj) Cyc_check_type(d,Cyc_is_atomic, atomic_tag, obj)
211 #define Cyc_check_opaque(d,obj) Cyc_check_type(d,Cyc_is_opaque, c_opaque_tag, obj)
229 #define global_set(glo,value) Cyc_global_set(data, NULL, (object *)&glo, value)
230 #define global_set_id(id,glo,value) Cyc_global_set(data, id, (object *)&glo, value)
231 object Cyc_global_set(
void *thd,
object sym,
object * glo,
object value);
233 #define global_set_cps(thd,k,glo,value) Cyc_global_set_cps(thd, k, NULL, (object *)&glo, value)
234 #define global_set_cps_id(thd,k,id,glo,value) Cyc_global_set_cps(thd, k, id, (object *)&glo, value)
235 object Cyc_global_set_cps(
void *thd,
object cont,
object sym,
object * glo,
object value);
252 #define load_varargs(var, args_var, start, count) \
253 list var = ((count) > 0) ? alloca(sizeof(pair_type)*(count)) : NULL; \
258 for (i = 0; i < (count); i++) { \
259 tmp = args_var[start + i]; \
260 var[i].hdr.mark = gc_color_red; \
261 var[i].hdr.grayed = 0; \
262 var[i].hdr.immutable = 0; \
263 var[i].tag = pair_tag; \
264 var[i].pair_car = tmp; \
265 var[i].pair_cdr = (i == ((count)-1)) ? NULL : &var[i + 1]; \
277 object apply(
void *data,
object cont,
object func,
object args);
278 void Cyc_apply(
void *data,
object cont,
int argc,
object *args);
280 object apply_va(
void *data,
object cont,
int argc,
object func, ...);
300 object Cyc_substring(
void *data,
object cont,
object str,
object start,
303 object Cyc_string_set(
void *data,
object str,
object k,
object chr);
345 object Cyc_display(
void *data,
object, FILE * port);
350 object Cyc_write(
void *data,
object, FILE * port);
352 object Cyc_write_va(
void *data,
int argc,
object x, ...);
390 #define return_inexact_double_op_no_cps(data, ptr, OP, z) \
392 Cyc_check_num(data, z); \
393 if (obj_is_int(z)) { \
394 unboxed = OP(obj_obj2int(z)); \
395 } else if (type_of(z) == integer_tag) { \
396 unboxed = OP(((integer_type *)z)->value); \
397 } else if (type_of(z) == bignum_tag) { \
398 unboxed = OP(mp_get_double(&bignum_value(z))); \
400 unboxed = OP(((double_type *)z)->value); \
402 assign_double(ptr, unboxed); \
408 #define return_inexact_double_op(data, cont, OP, z) \
409 make_double(d, 0.0); \
410 Cyc_check_num(data, z); \
411 if (obj_is_int(z)) { \
412 d.value = OP(obj_obj2int(z)); \
413 } else if (type_of(z) == integer_tag) { \
414 d.value = OP(((integer_type *)z)->value); \
415 } else if (type_of(z) == bignum_tag) { \
416 d.value = OP(mp_get_double(&bignum_value(z))); \
418 d.value = OP(((double_type *)z)->value); \
420 return_closcall1(data, cont, &d)
425 #define return_inexact_double_or_cplx_op_no_cps(data, ptr, OP, CPLX_OP, z) \
427 Cyc_check_num(data, z); \
428 if (obj_is_int(z)) { \
429 unboxed = OP(obj_obj2int(z)); \
430 } else if (type_of(z) == integer_tag) { \
431 unboxed = OP(((integer_type *)z)->value); \
432 } else if (type_of(z) == bignum_tag) { \
433 unboxed = OP(mp_get_double(&bignum_value(z))); \
434 } else if (type_of(z) == complex_num_tag) { \
435 double complex unboxed = CPLX_OP(complex_num_value(z)); \
436 assign_complex_num(ptr, unboxed); \
439 unboxed = OP(((double_type *)z)->value); \
441 assign_double(ptr, unboxed); \
447 #define return_inexact_double_or_cplx_op(data, cont, OP, CPLX_OP, z) \
448 make_double(d, 0.0); \
449 Cyc_check_num(data, z); \
450 if (obj_is_int(z)) { \
451 d.value = OP(obj_obj2int(z)); \
452 } else if (type_of(z) == integer_tag) { \
453 d.value = OP(((integer_type *)z)->value); \
454 } else if (type_of(z) == bignum_tag) { \
455 d.value = OP(mp_get_double(&bignum_value(z))); \
456 } else if (type_of(z) == complex_num_tag) { \
457 complex_num_type cn; \
458 double complex unboxed = CPLX_OP(complex_num_value(z)); \
459 assign_complex_num((&cn), unboxed); \
460 return_closcall1(data, cont, &cn); \
462 d.value = OP(((double_type *)z)->value); \
464 return_closcall1(data, cont, &d)
469 #define return_exact_double_op(data, cont, OP, z) \
471 Cyc_check_num(data, z); \
472 if (obj_is_int(z)) { \
473 i = obj_obj2int(z); \
474 } else if (type_of(z) == integer_tag) { \
475 i = (int)OP(((integer_type *)z)->value); \
476 } else if (type_of(z) == bignum_tag) { \
477 return_closcall1(data, cont, z); \
479 i = (int)OP(((double_type *)z)->value); \
481 return_closcall1(data, cont, obj_int2obj(i))
486 #define return_exact_double_op_no_cps(data, ptr, OP, z) \
488 Cyc_check_num(data, z); \
489 if (obj_is_int(z)) { \
490 i = obj_obj2int(z); \
491 } else if (type_of(z) == integer_tag) { \
492 i = (int)OP(((integer_type *)z)->value); \
493 } else if (type_of(z) == bignum_tag) { \
496 i = (int)OP(((double_type *)z)->value); \
498 return obj_int2obj(i);
503 #define unbox_number(n) \
504 ((obj_is_int(n) ? obj_obj2int(n) : \
505 ((type_of(n) == integer_tag) ? \
506 ((integer_type *)n)->value : \
507 ((double_type *)n)->value)))
509 object Cyc_num_eq(
void *,
object cont,
int argc,
object n, ...);
510 object Cyc_num_gt(
void *,
object cont,
int argc,
object n, ...);
511 object Cyc_num_lt(
void *,
object cont,
int argc,
object n, ...);
512 object Cyc_num_gte(
void *,
object cont,
int argc,
object n, ...);
513 object Cyc_num_lte(
void *,
object cont,
int argc,
object n, ...);
525 int (fn_op(
void *,
object,
object)),
object n,
527 void Cyc_expt(
void *data,
object cont,
object x,
object y);
528 void Cyc_remainder(
void *data,
object cont,
object num1,
object num2);
535 object Cyc_sum(
void *data,
object cont,
int argc,
object n, ...);
536 object Cyc_sub(
void *data,
object cont,
int argc,
object n, ...);
537 object Cyc_mul(
void *data,
object cont,
int argc,
object n, ...);
538 object Cyc_div(
void *data,
object cont,
int argc,
object n, ...);
540 #define Cyc_if(c,t,e) ((boolean_f != c) ? (t) : (e))
541 object Cyc_fast_sum(
void *data,
object ptr,
object x,
object y);
542 object Cyc_fast_sub(
void *data,
object ptr,
object x,
object y);
543 object Cyc_fast_mul(
void *data,
object ptr,
object x,
object y);
544 object Cyc_fast_div(
void *data,
object ptr,
object x,
object y);
547 object Cyc_fast_list_4(
object ptr,
object a1,
object a2,
object a3,
object a4);
550 object Cyc_fast_vector_4(
object ptr,
object a1,
object a2,
object a3,
object a4);
551 object Cyc_fast_vector_5(
object ptr,
object a1,
object a2,
object a3,
object a4,
object a5);
553 object Cyc_bit_set(
void *data,
object n1,
object n2);
556 int default_no_args,
int default_one_arg,
object n,
560 int default_no_args,
int default_one_arg,
574 object Cyc_eqv(
object x,
object y);
575 #define Cyc_eq(x, y) (make_boolean(x == y))
576 int equal(
object,
object);
577 object equalp(
object,
object);
581 #define Cyc_is_boolean(o) (make_boolean(o == boolean_f || o == boolean_t))
582 #define Cyc_is_pair(o) ((is_object_type(o) && ((list) o)->tag == pair_tag) ? boolean_t : boolean_f)
583 #define Cyc_is_null(o) (make_boolean(o == NULL))
588 #define Cyc_is_fixnum(o) (make_boolean(obj_is_int(o)))
590 #define Cyc_is_double(o) (make_boolean(is_object_type(o) && ((list) o)->tag == double_tag))
591 #define Cyc_is_bignum(o) (make_boolean(is_object_type(o) && ((list) o)->tag == bignum_tag))
593 #define Cyc_is_complex(o) (make_boolean(is_object_type(o) && ((list) o)->tag == complex_num_tag))
603 #define Cyc_is_vector_not_record_type(o) \
604 (make_boolean(is_object_type(o) && \
605 ((vector) o)->tag == vector_tag && \
606 ( ((vector) o)->num_elements == 0 || \
607 ((vector) o)->elements[0] != Cyc_RECORD_MARKER ) \
609 #define Cyc_is_vector(o) (make_boolean(is_object_type(o) && ((vector) o)->tag == vector_tag))
610 #define Cyc_is_bytevector(o) (make_boolean(is_object_type(o) && ((list) o)->tag == bytevector_tag))
611 #define Cyc_is_port(o) (make_boolean(is_object_type(o) && ((list) o)->tag == port_tag))
612 #define Cyc_is_mutex(o) (make_boolean(is_object_type(o) && ((list) o)->tag == mutex_tag))
613 #define Cyc_is_atomic(o) (make_boolean(is_object_type(o) && ((list) o)->tag == atomic_tag))
614 #define Cyc_is_cond_var(o) (make_boolean(is_object_type(o) && ((list) o)->tag == cond_var_tag))
615 #define Cyc_is_symbol(o) (make_boolean(is_object_type(o) && ((list) o)->tag == symbol_tag))
616 #define Cyc_is_string(o) (make_boolean(is_object_type(o) && ((list) o)->tag == string_tag))
618 #define Cyc_is_char(o) (make_boolean(obj_is_char(o)))
624 #define Cyc_is_macro(o) (make_boolean(is_object_type(o) && ((list) o)->tag == macro_tag))
625 #define Cyc_is_eof_object(o) (make_boolean(is_object_type(o) && ((list) o)->tag == eof_tag))
626 #define Cyc_is_void_object(o) (make_boolean(is_object_type(o) && ((list) o)->tag == void_tag))
627 #define Cyc_is_cvar(o) (make_boolean(is_object_type(o) && ((list) o)->tag == cvar_tag))
628 #define Cyc_is_opaque(o) (make_boolean(is_object_type(o) && ((list) o)->tag == c_opaque_tag))
639 #define Cyc_vector_ref_unsafe(d, v, k) \
640 ((vector) v)->elements[obj_obj2int(k)]
645 object Cyc_make_vector(
void *data,
object cont,
int argc,
object len, ...);
654 object Cyc_bytevector(
void *data,
object cont,
int argc,
object bval, ...);
662 object Cyc_utf82string(
void *data,
object cont,
object bv,
object start,
664 object Cyc_string2utf8(
void *data,
object cont,
object str,
object start,
679 void Cyc_halt(
void *data,
object clo,
int argc,
object *args);
680 object __halt(
object obj);
707 object copy2heap(
void *data,
object obj);
723 #define Cyc_st_add(data, frame) \
725 gc_thread_data *thd = (gc_thread_data *) data; \
727 if ((char *)frame != thd->stack_prev_frame) { \
728 thd->stack_prev_frame = frame; \
729 thd->stack_traces[thd->stack_trace_idx] = frame; \
730 thd->stack_trace_idx = (thd->stack_trace_idx + 1) % MAX_STACK_TRACES; \
890 #define __glo_eval_91from_91c_scheme_eval Cyc_glo_eval_from_c
891 #define __glo_call_95cc_scheme_base Cyc_glo_call_cc
938 void add_global(
const char *identifier,
object * glo);
950 #define CYC_UTF8_ACCEPT 0
953 #define CYC_UTF8_REJECT 1
958 #define Cyc_utf8_encode_char(dest, dest_size, char_value) \
959 Cyc_utf8_encode(dest, dest_size, &char_value, 1)
974 static inline object Cyc_car(
void *data,
object lis)
980 static inline object Cyc_cdr(
void *data,
object lis)
986 #define Cyc_car_unsafe(d, lis) car(lis)
987 #define Cyc_cdr_unsafe(d, lis) cdr(lis)
1000 object memqp(
void *data,
object x,
list l);
object Cyc_vector_set_cps(void *d, object cont, object v, object k, object obj)
Definition: runtime.c:2130
object Cyc_num_fast_gte_op(void *data, object x, object y)
object Cyc_set_cell(void *, object l, object val)
Definition: runtime.c:1989
object Cyc_set_cdr(void *, object l, object val)
Definition: runtime.c:2010
object Cyc_fast_list_3(object ptr, object a1, object a2, object a3)
Definition: runtime.c:1496
const object primitive_memq
Definition: runtime.c:6568
const object primitive_Cyc_91utf8_91_125string
Definition: runtime.c:6638
const object primitive_port_127
Definition: runtime.c:6653
const object primitive_string_91cmp
Definition: runtime.c:6621
const object primitive__87
Definition: runtime.c:6542
void Cyc_immutable_obj_error(void *data, object obj)
Definition: runtime.c:69
const object primitive_cddar
Definition: runtime.c:6589
const object primitive_real_127
Definition: runtime.c:6646
object Cyc_is_integer(object o)
Definition: runtime.c:1919
object Cyc_get_global_variables()
Definition: runtime.c:873
void Cyc_check_obj(void *data, int tag, object obj)
Definition: runtime.c:79
const object primitive_close_91port
Definition: runtime.c:6661
const object primitive_cdar
Definition: runtime.c:6581
A closed-over function with no variables.
Definition: types.h:1405
const object primitive_caar
Definition: runtime.c:6579
object Cyc_list2vector(void *data, object cont, object l)
Definition: runtime.c:3389
list assoc_cdr(void *data, object x, list l)
Definition: runtime.c:1474
#define cdr(x)
Definition: types.h:1327
const object primitive_Cyc_91write_91char
Definition: runtime.c:6671
const object primitive_Cyc_91flush_91output_91port
Definition: runtime.c:6664
void Cyc_expt(void *data, object cont, object x, object y)
Definition: runtime.c:4379
int Cyc_num_lte_op(void *, object x, object y)
const object primitive_procedure_127
Definition: runtime.c:6649
object Cyc_list2string(void *d, object cont, object lst)
Definition: runtime.c:2357
void pack_env_variables(void *data, object k)
Definition: runtime.c:214
object Cyc_fast_sum(void *data, object ptr, object x, object y)
Definition: runtime.c:3663
void Cyc_int2bignum(int n, mp_int *bn)
Definition: runtime.c:1723
const object primitive_string_91length
Definition: runtime.c:6610
const object primitive_cdadar
Definition: runtime.c:6601
object Cyc_io_read_char(void *data, object cont, object port)
Definition: runtime.c:7783
const object primitive_open_91input_91file
Definition: runtime.c:6657
const object primitive_cell
Definition: runtime.c:6562
const object primitive_integer_127
Definition: runtime.c:6647
object Cyc_bytevector_length(void *data, object bv)
Definition: runtime.c:3379
const object primitive_caddar
Definition: runtime.c:6597
void Cyc_halt(void *data, object clo, int argc, object *args)
Definition: runtime.c:3476
const object primitive_cdaadr
Definition: runtime.c:6600
const object primitive_caaar
Definition: runtime.c:6583
object Cyc_fast_mul(void *data, object ptr, object x, object y)
Definition: runtime.c:3864
const object primitive_cadaar
Definition: runtime.c:6595
const object primitive_cdddr
Definition: runtime.c:6590
const object primitive_caaadr
Definition: runtime.c:6592
const object primitive_list_91_125string
Definition: runtime.c:6623
object Cyc_eqv(object x, object y)
Definition: runtime.c:1963
object Cyc_string_ref(void *data, object str, object k)
Definition: runtime.c:2744
object Cyc_write_va(void *data, int argc, object x,...)
Definition: runtime.c:1210
const object primitive_Cyc_91macro_127
Definition: runtime.c:6651
const object primitive_cdaddr
Definition: runtime.c:6602
object register_library(const char *name)
Definition: runtime.c:504
const object primitive__125
Definition: runtime.c:6547
bn_cmp_type
Definition: types.h:922
const object primitive_Cyc_91read_91line
Definition: runtime.c:6670
object Cyc_string2symbol(void *d, object str)
Definition: runtime.c:2346
double MRG32k3a(double seed)
Definition: runtime.c:6958
port_type Cyc_stdout(void)
Definition: runtime.c:4517
object Cyc_string_set(void *data, object str, object k, object chr)
Definition: runtime.c:2650
The port object type.
Definition: types.h:1096
const object primitive_symbol_127
Definition: runtime.c:6656
object Cyc_sub_op(void *data, common_type *x, object y)
object Cyc_char2integer(object chr)
Definition: runtime.c:3462
void Cyc_apply(void *data, object cont, int argc, object *args)
Definition: runtime.c:5771
object Cyc_io_close_output_port(void *data, object port)
Definition: runtime.c:4590
#define car(x)
Definition: types.h:1325
object Cyc_fast_vector_3(object ptr, object a1, object a2, object a3)
Definition: runtime.c:1529
void Cyc_io_get_output_string(void *data, object cont, object port)
Definition: mstreams.c:94
object Cyc_char_gt_op(void *data, object a, object b)
object Cyc_bytevector_append(void *data, object cont, int _argc, object bv,...)
Definition: runtime.c:3130
object find_or_add_symbol(const char *name)
Definition: runtime.c:482
object Cyc_num_op_args(void *data, int argc, object(fn_op(void *, common_type *, object)), int default_no_args, int default_one_arg, object *args, common_type *buf)
Definition: runtime.c:4177
object Cyc_compilation_environment(void *data, object cont, object var)
Definition: runtime.c:2876
time_t Cyc_file_last_modified_time(char *path)
Definition: runtime.c:4661
void dispatch_apply_va(void *data, object clo, int argc, object *args)
Definition: runtime.c:5650
const object primitive_delete_91file
Definition: runtime.c:6667
const object primitive_open_91output_91file
Definition: runtime.c:6658
object Cyc_display_va(void *data, int argc, object x,...)
Definition: runtime.c:998
void Cyc_start_trampoline(gc_thread_data *thd)
Definition: runtime.c:5831
void Cyc_rt_raise_msg(void *data, const char *err)
Raise an exception from the runtime code.
Definition: runtime.c:770
object Cyc_num_fast_lte_op(void *data, object x, object y)
object Cyc_thread_sleep(void *data, object timeout)
Accept a number of seconds to sleep according to SRFI-18.
Definition: runtime.c:6835
port_type * Cyc_io_open_output_string(void *data)
Definition: mstreams.c:78
port_type Cyc_io_open_binary_output_file(void *data, object str)
Definition: runtime.c:4578
object Cyc_num_cmp_va_list(void *data, int argc, int(fn_op(void *, object, object)), object n, va_list ns)
Definition: runtime.c:1651
The pair (cons) type.
Definition: types.h:1247
const object primitive_cddaar
Definition: runtime.c:6603
object Cyc_global_set_cps(void *thd, object cont, object sym, object *glo, object value)
Definition: runtime.c:367
object Cyc_set_cvar(object var, object value)
Definition: runtime.c:886
object memqp(void *data, object x, list l)
Definition: runtime.c:1433
const object primitive_set_91car_67
Definition: runtime.c:6575
object Cyc_write(void *data, object, FILE *port)
Definition: runtime.c:1350
object Cyc_substring(void *data, object cont, object str, object start, object end)
Definition: runtime.c:2780
char ** get_env_variables()
Definition: runtime.c:209
object Cyc_io_delete_file(void *data, object filename)
Definition: runtime.c:4637
int binstr2int(const char *str)
Definition: runtime.c:2547
object Cyc_string2utf8(void *data, object cont, object str, object start, object end)
Definition: runtime.c:3246
object Cyc_char_lte_op(void *data, object a, object b)
object Cyc_spawn_thread(object thunk)
Definition: runtime.c:6769
int Cyc_num_gt_op(void *, object x, object y)
const object primitive_vector_91set_67
Definition: runtime.c:6574
object Cyc_write_bytevector(void *data, object bvec, object port, object start, object end)
Definition: runtime.c:1389
object Cyc_length(void *d, object l)
Definition: runtime.c:2217
const object primitive_cddr
Definition: runtime.c:6582
const object primitive_string_127
Definition: runtime.c:6652
const object primitive_apply
Definition: runtime.c:6551
const object primitive_Cyc_91write
Definition: runtime.c:6672
const object primitive_cons
Definition: runtime.c:6558
object Cyc_is_record(object o)
Definition: runtime.c:1930
const object primitive__121_123
Definition: runtime.c:6550
const object Cyc_RECORD_MARKER
Definition: runtime.c:202
void dispatch_string_91append(void *data, object clo, int _argc, object *args)
Definition: runtime.c:2576
const object primitive_null_127
Definition: runtime.c:6644
void Cyc_remainder(void *data, object cont, object num1, object num2)
Definition: runtime.c:4441
object Cyc_io_close_port(void *data, object port)
Definition: runtime.c:4595
int Cyc_bignum_cmp(bn_cmp_type type, object x, int tx, object y, int ty)
Definition: runtime.c:1731
object Cyc_system(object cmd)
Definition: runtime.c:3441
object Cyc_display_va_list(void *data, object x, object opts)
Definition: runtime.c:1012
object Cyc_bytevector_u8_ref(void *data, object bv, object k)
Definition: runtime.c:3339
void Cyc_set_globals_changed(gc_thread_data *thd)
Definition: runtime.c:548
const object primitive_caddr
Definition: runtime.c:6586
object add_symbol(symbol_type *psym)
Definition: runtime.c:459
const object primitive_car
Definition: runtime.c:6577
C-variable integration type - wrapper around a Cyclone object pointer.
Definition: types.h:677
object Cyc_string2number_(void *d, object cont, object str)
Definition: runtime.c:2513
object Cyc_is_list(object lst)
Definition: runtime.c:939
object Cyc_bytevector_u8_set(void *data, object bv, object k, object b)
Definition: runtime.c:3359
object Cyc_make_bytevector(void *data, object cont, int argc, object len,...)
Definition: runtime.c:3004
object Cyc_make_vector(void *data, object cont, int argc, object len,...)
Definition: runtime.c:2941
const object primitive_make_91bytevector
Definition: runtime.c:6627
int equal(object, object)
Definition: runtime.c:778
const object primitive_string_91ref
Definition: runtime.c:6612
void Cyc_mutable_obj_error(void *data, object obj)
Definition: runtime.c:74
object Cyc_global_variables
Definition: runtime.c:192
const object primitive__95
Definition: runtime.c:6545
const object primitive_Cyc_91display
Definition: runtime.c:6673
object Cyc_write_u8(void *data, object c, object port)
Definition: runtime.c:1374
const object primitive_Cyc_91set_91cvar_67
Definition: runtime.c:6535
list malloc_make_pair(object, object)
Definition: runtime.c:4669
const object quote_void
Definition: runtime.c:398
object Cyc_char_eq_op(void *data, object a, object b)
const object primitive_set_91cdr_67
Definition: runtime.c:6576
const object primitive_Cyc_91default_91exception_91handler
Definition: runtime.c:6556
object Cyc_fast_vector_2(object ptr, object a1, object a2)
Definition: runtime.c:1515
const object primitive_open_91binary_91output_91file
Definition: runtime.c:6660
const object primitive_cdr
Definition: runtime.c:6578
void add_global(const char *identifier, object *glo)
Definition: runtime.c:521
const object primitive_string_91append
Definition: runtime.c:6622
const object primitive_number_91_125string
Definition: runtime.c:6626
const object primitive_Cyc_91bytevector_91copy
Definition: runtime.c:6631
object Cyc_glo_call_cc
Definition: runtime.c:670
object Cyc_num_gt(void *, object cont, int argc, object n,...)
const object primitive_close_91input_91port
Definition: runtime.c:6662
const object primitive__121
Definition: runtime.c:6548
object Cyc_write_va_list(void *data, object x, object opts)
Definition: runtime.c:1224
object Cyc_io_read_line(void *data, object cont, object port)
Definition: runtime.c:7826
void gc_init_heap(long heap_size)
Perform one-time heap initializations for the program.
Definition: runtime.c:319
object Cyc_io_read_u8(void *data, object cont, object port)
Definition: runtime.c:7807
object Cyc_io_file_exists(void *data, object filename)
Definition: runtime.c:4647
const object primitive_Cyc_91end_91thread_67
Definition: runtime.c:6541
char ** _cyc_argv
Definition: runtime.c:194
const object primitive_file_91exists_127
Definition: runtime.c:6666
const object primitive_caadar
Definition: runtime.c:6593
void Cyc_end_thread(gc_thread_data *thd)
Definition: runtime.c:6805
const object primitive__123
Definition: runtime.c:6546
const object primitive_Cyc_91opaque_127
Definition: runtime.c:6537
const object primitive_equal_127
Definition: runtime.c:6565
const object Cyc_VOID
Definition: runtime.c:201
const object primitive_open_91binary_91input_91file
Definition: runtime.c:6659
const object primitive_char_127
Definition: runtime.c:6642
object Cyc_string2number2_(void *data, object cont, int argc, object str,...)
Definition: runtime.c:2407
object Cyc_is_immutable(object obj)
Definition: runtime.c:1975
const object primitive_vector_91length
Definition: runtime.c:6572
void Cyc_make_rectangular(void *data, object k, object r, object i)
Definition: runtime.c:6928
const object primitive_caaaar
Definition: runtime.c:6591
object Cyc_set_car_cps(void *, object cont, object l, object val)
Definition: runtime.c:2062
const object primitive_call_95cc
Definition: runtime.c:6674
port_type Cyc_io_open_output_file(void *data, object str)
Definition: runtime.c:4566
const object primitive_eof_91object_127
Definition: runtime.c:6643
object __halt(object obj)
Definition: runtime.c:3496
void dispatch_display_va(void *data, object clo, int argc, object *args)
Definition: runtime.c:986
object cell_get(object cell)
Definition: runtime.c:343
object Cyc_integer2char(void *data, object n)
Definition: runtime.c:3467
object apply_va(void *data, object cont, int argc, object func,...)
Definition: runtime.c:5679
const object primitive_read_91char
Definition: runtime.c:6668
object Cyc_io_close_input_port(void *data, object port)
Definition: runtime.c:4585
object Cyc_number2string2(void *data, object cont, int argc, object n,...)
Definition: runtime.c:2262
Symbols are similar to strings, but only one instance of each unique symbol is created,...
Definition: types.h:788
object Cyc_mul_op(void *data, common_type *x, object y)
const object primitive_eq_127
Definition: runtime.c:6563
const object primitive__75halt
Definition: runtime.c:6552
object Cyc_fast_vector_5(object ptr, object a1, object a2, object a3, object a4, object a5)
Definition: runtime.c:1560
object Cyc_vector_set_unsafe_cps(void *d, object cont, object v, object k, object obj)
Definition: runtime.c:2158
const object primitive_bytevector_91u8_91set_67
Definition: runtime.c:6634
list assq(void *data, object x, list l)
Definition: runtime.c:1443
int octstr2int(const char *str)
Definition: runtime.c:2558
void Cyc_rt_raise2(void *data, const char *msg, object err)
Raise an exception from the runtime code.
Definition: runtime.c:752
const object primitive_cadddr
Definition: runtime.c:6598
const object primitive_vector_127
Definition: runtime.c:6654
const object primitive_bytevector_91u8_91ref
Definition: runtime.c:6633
object Cyc_vector_set(void *d, object v, object k, object obj)
Definition: runtime.c:2022
const object primitive_cdddar
Definition: runtime.c:6605
const object primitive_string_91_125number
Definition: runtime.c:6609
object Cyc_is_number(object o)
Definition: runtime.c:1896
object Cyc_string_length(void *data, object str)
Definition: runtime.c:2638
const object primitive_assv
Definition: runtime.c:6567
const object primitive_vector_91ref
Definition: runtime.c:6573
object Cyc_is_real(object o)
Definition: runtime.c:1907
const object primitive_system
Definition: runtime.c:6620
object Cyc_set_car(void *, object l, object val)
Definition: runtime.c:1998
object Cyc_fast_div(void *data, object ptr, object x, object y)
Definition: runtime.c:3964
const object primitive_bytevector
Definition: runtime.c:6629
const object primitive_exit
Definition: runtime.c:6553
object Cyc_num_lt(void *, object cont, int argc, object n,...)
object Cyc_num_op_va_list(void *data, int argc, object(fn_op(void *, common_type *, object)), int default_no_args, int default_one_arg, object n, va_list ns, common_type *buf)
Definition: runtime.c:4277
const object primitive_list_91_125vector
Definition: runtime.c:6640
void Cyc_io_read_token(void *data, object cont, object port)
Read next token from the input port.
Definition: runtime.c:7886
object Cyc_string_cmp(void *data, object str1, object str2)
Definition: runtime.c:2568
const object primitive_memv
Definition: runtime.c:6569
const object primitive_macro_127
Definition: runtime.c:6650
object Cyc_has_cycle(object lst)
Definition: runtime.c:906
const object primitive_cdaaar
Definition: runtime.c:6599
const object primitive__125_123
Definition: runtime.c:6549
object Cyc_display(void *data, object, FILE *port)
Definition: runtime.c:1026
object Cyc_char_lt_op(void *data, object a, object b)
port_type Cyc_io_open_binary_input_file(void *data, object str)
Definition: runtime.c:4571
object Cyc_char_gte_op(void *data, object a, object b)
A union of all the constant-size objects.
Definition: types.h:1497
const object primitive_cadr
Definition: runtime.c:6580
const object primitive_Cyc_91installation_91dir
Definition: runtime.c:6614
const object primitive_Cyc_91string_91_125utf8
Definition: runtime.c:6636
object Cyc_fast_sub(void *data, object ptr, object x, object y)
Definition: runtime.c:3764
object Cyc_string_byte_length(void *data, object str)
Definition: runtime.c:2644
const object primitive_set_91global_67
Definition: runtime.c:6560
const object primitive_bytevector_127
Definition: runtime.c:6655
const object boolean_t
Definition: runtime.c:396
const object primitive_eqv_127
Definition: runtime.c:6564
const object primitive_close_91output_91port
Definition: runtime.c:6663
const object primitive_boolean_127
Definition: runtime.c:6641
int Cyc_num_gte_op(void *, object x, object y)
const object primitive_string_91_125symbol
Definition: runtime.c:6624
object Cyc_mul(void *data, object cont, int argc, object n,...)
const object primitive__91
Definition: runtime.c:6543
uint32_t Cyc_utf8_validate(char *str, size_t len)
Simplified version of Cyc_utf8_validate_stream that must always be called with a complete string buff...
Definition: runtime.c:8149
const object Cyc_EOF
Definition: runtime.c:200
object Cyc_default_exception_handler(void *data, object _, int argc, object *args)
The default exception handler.
Definition: runtime.c:680
const object primitive_cadar
Definition: runtime.c:6585
int Cyc_num_lt_op(void *, object x, object y)
object Cyc_glo_eval_from_c
Definition: runtime.c:671
port_type * Cyc_io_open_input_bytevector(void *data, object bv)
Definition: mstreams.c:57
const object primitive_integer_91_125char
Definition: runtime.c:6608
object Cyc_num_fast_gt_op(void *data, object x, object y)
object Cyc_trigger_minor_gc(void *data, object cont)
Trigger a minor GC for the calling thread.
Definition: runtime.c:6018
port_type Cyc_stdin(void)
Definition: runtime.c:4523
void Cyc_invalid_type_error(void *data, int tag, object found)
Definition: runtime.c:57
object Cyc_symbol2string(void *d, object cont, object sym)
Definition: runtime.c:2337
object Cyc_div(void *data, object cont, int argc, object n,...)
Definition: runtime.c:4153
const object primitive_char_91_125integer
Definition: runtime.c:6607
const object primitive_symbol_91_125string
Definition: runtime.c:6625
const object primitive__85
Definition: runtime.c:6544
const object primitive_Cyc_91cvar_127
Definition: runtime.c:6536
const object primitive_peek_91char
Definition: runtime.c:6669
object Cyc_io_peek_char(void *data, object cont, object port)
Definition: runtime.c:7688
object Cyc_utf82string(void *data, object cont, object bv, object start, object end)
Definition: runtime.c:3212
object Cyc_sub(void *data, object cont, int argc, object n,...)
const object primitive_caadr
Definition: runtime.c:6584
object Cyc_num_fast_lt_op(void *data, object x, object y)
void set_env_variables(char **vars)
Definition: runtime.c:260
int Cyc_num_eq_op(void *, object x, object y)
object Cyc_fast_list_2(object ptr, object x, object y)
Definition: runtime.c:1488
object Cyc_io_flush_output_port(void *data, object port)
Definition: runtime.c:4623
object Cyc_sum(void *data, object cont, int argc, object n,...)
object Cyc_num_gte(void *, object cont, int argc, object n,...)
object Cyc_bytevector_copy(void *data, object cont, object bv, object start, object end)
Definition: runtime.c:3166
const object primitive_make_91vector
Definition: runtime.c:6628
const object primitive_bytevector_91length
Definition: runtime.c:6571
const object primitive_assq
Definition: runtime.c:6566
void Cyc_check_bounds(void *data, const char *label, int len, int index)
Definition: runtime.c:86
void GC(void *, closure, object *, int)
Definition: runtime.c:6182
const object primitive_Cyc_91has_91cycle_127
Definition: runtime.c:6538
void dispatch_write_va(void *data, object clo, int argc, object *args)
Definition: runtime.c:1198
object memberp(void *data, object x, list l)
Definition: runtime.c:1423
object Cyc_write_char(void *data, object c, object port)
Definition: runtime.c:1357
object Cyc_bit_unset(void *data, object n1, object n2)
Definition: runtime.c:6907
void Cyc_rt_raise(void *data, object err)
Raise an exception from the runtime code.
Definition: runtime.c:735
port_type * Cyc_io_open_input_string(void *data, object str)
Definition: mstreams.c:36
object Cyc_is_procedure(void *data, object o)
Definition: runtime.c:1942
object Cyc_global_set(void *thd, object sym, object *glo, object value)
Definition: runtime.c:349
object Cyc_get_cvar(object var)
Definition: runtime.c:878
object copy2heap(void *data, object obj)
Copy given object to the heap, if it is from the stack. This function is intended to be called direct...
Definition: runtime.c:6855
const object primitive_set_91cell_67
Definition: runtime.c:6561
void Cyc_io_get_output_bytevector(void *data, object cont, object port)
Definition: mstreams.c:111
void Cyc_st_print(void *data, FILE *out)
Print the contents of the given thread's stack trace buffer.
Definition: runtime.c:407
const object primitive_cddddr
Definition: runtime.c:6606
object Cyc_length_unsafe(void *d, object l)
Definition: runtime.c:2230
void dispatch(void *data, int argc, function_type func, object clo, object cont, object args)
Definition: runtime.c:6258
void(* function_type)(void *data, object clo, int argc, object *args)
Definition: types.h:666
list assoc(void *data, object x, list l)
Definition: runtime.c:1457
list global_table
Definition: runtime.c:519
object Cyc_fast_vector_4(object ptr, object a1, object a2, object a3, object a4)
Definition: runtime.c:1544
const object primitive_caaddr
Definition: runtime.c:6594
const object primitive_length
Definition: runtime.c:6570
int _cyc_argc
Definition: runtime.c:193
const object primitive_Cyc_91spawn_91thread_67
Definition: runtime.c:6539
const object boolean_f
Definition: runtime.c:397
object Cyc_num_eq(void *, object cont, int argc, object n,...)
const object primitive_cdadr
Definition: runtime.c:6588
object Cyc_bignum_normalize(void *data, object n)
Definition: runtime.c:1702
object Cyc_fast_list_4(object ptr, object a1, object a2, object a3, object a4)
Definition: runtime.c:1505
const object primitive_cell_91get
Definition: runtime.c:6559
object Cyc_io_peek_u8(void *data, object cont, object port)
Definition: runtime.c:7743
#define Cyc_check_pair(d, obj)
Definition: runtime.h:127
void Cyc_exit_thread(void *data, object _, int argc, object *args)
Definition: runtime.c:6814
object Cyc_num_lte(void *, object cont, int argc, object n,...)
object is_library_loaded(const char *name)
Definition: runtime.c:495
const object primitive_string_91set_67
Definition: runtime.c:6613
const object primitive_Cyc_91get_91cvar
Definition: runtime.c:6534
object Cyc_vector_length(void *data, object v)
Definition: runtime.c:2207
object Cyc_installation_dir(void *data, object cont, object type)
Definition: runtime.c:2841
const object primitive_bytevector_91append
Definition: runtime.c:6630
const object primitive_pair_127
Definition: runtime.c:6648
port_type Cyc_io_open_input_file(void *data, object str)
Definition: runtime.c:4561
object Cyc_num_fast_eq_op(void *data, object x, object y)
const object primitive_cdaar
Definition: runtime.c:6587
object Cyc_vector_set_unsafe(void *d, object v, object k, object obj)
Definition: runtime.c:2041
const object primitive_cadadr
Definition: runtime.c:6596
const object primitive_number_127
Definition: runtime.c:6645
object Cyc_div_op(void *data, common_type *x, object y)
Definition: runtime.c:4055
object Cyc_current_exception_handler(void *data)
Return the current exception handler.
Definition: runtime.c:720
object Cyc_command_line_arguments(void *data, object cont)
Definition: runtime.c:2921
const object primitive_substring
Definition: runtime.c:6611
int Cyc_utf8_count_code_points(uint8_t *s)
Count the number of code points in a string. Based on example code from Bjoern Hoehrmann.
Definition: runtime.c:8082
const object primitive_Cyc_91current_91exception_91handler
Definition: runtime.c:6554
int Cyc_utf8_encode(char *dest, int sz, uint32_t *src, int srcsz)
Definition: runtime.c:8194
const object primitive_cddadr
Definition: runtime.c:6604
object Cyc_vector_ref(void *d, object v, object k)
Definition: runtime.c:2176
object Cyc_set_cdr_cps(void *, object cont, object l, object val)
Definition: runtime.c:2095
const object primitive_Cyc_91compilation_91environment
Definition: runtime.c:6616
object apply(void *data, object cont, object func, object args)
Definition: runtime.c:5694
uint32_t Cyc_utf8_validate_stream(uint32_t *state, char *str, size_t len)
Use this when validating from a stream, as it may be that the stream stopped in the middle of a codep...
Definition: runtime.c:8129
const object primitive_Cyc_91global_91vars
Definition: runtime.c:6533
cvar_type * mcvar(object *var)
Definition: runtime.c:4681
object Cyc_bytevector(void *data, object cont, int argc, object bval,...)
Definition: runtime.c:3073
object Cyc_bit_set(void *data, object n1, object n2)
Definition: runtime.c:6915
const object primitive_command_91line_91arguments
Definition: runtime.c:6618
object Cyc_string_append(void *data, object cont, int argc, object str1,...)
Definition: runtime.c:2603
object equalp(object, object)
Definition: runtime.c:1593
object Cyc_sum_op(void *data, common_type *x, object y)
port_type Cyc_stderr(void)
Definition: runtime.c:4529