17 #ifndef __EST_SIOD_DEFS_H__ 18 #define __EST_SIOD_DEFS_H__ 29 #define DEFAULT_HEAP_SIZE -1 30 #define ACTUAL_DEFAULT_HEAP_SIZE 210000 40 struct {
const char *
name;
42 struct {
const char *
name;
44 struct {
const char *
name;
45 struct obj * (*f)(
struct obj *,
struct obj *,
struct obj *);
47 struct {
const char *
name;
48 struct obj * (*f)(
struct obj *,
struct obj *,
49 struct obj *,
struct obj *);
51 struct {
const char *
name;
53 struct {
const char *
name;
54 struct obj * (*f)(
void *,...);}
subr;
76 #define CAR(x) ((*x).storage_as.cons.car) 77 #define CDR(x) ((*x).storage_as.cons.cdr) 78 #define PNAME(x) ((*x).storage_as.symbol.pname) 79 #define VCELL(x) ((*x).storage_as.symbol.vcell) 80 #define SUBR0(x) (*((*x).storage_as.subr0.f)) 81 #define SUBR1(x) (*((*x).storage_as.subr1.f)) 82 #define SUBR2(x) (*((*x).storage_as.subr2.f)) 83 #define SUBR3(x) (*((*x).storage_as.subr3.f)) 84 #define SUBR4(x) (*((*x).storage_as.subr4.f)) 85 #define SUBRM(x) (*((*x).storage_as.subrm.f)) 86 #define SUBRF(x) (*((*x).storage_as.subr.f)) 87 #define FLONM(x) ((*x).storage_as.flonum.data) 88 #define FLONMPNAME(x) ((*x).pname) 89 #define USERVAL(x) ((*x).storage_as.user.p) 90 #define UNTYPEDVAL(x) ((*x).storage_as.user.p) 92 #define NIL ((struct obj *) 0) 93 #define EQ(x,y) ((x) == (y)) 94 #define NEQ(x,y) ((x) != (y)) 95 #define NULLP(x) EQ(x,NIL) 96 #define NNULLP(x) NEQ(x,NIL) 98 #define TYPE(x) (((x) == NIL) ? 0 : ((*(x)).type)) 100 #define TYPEP(x,y) (TYPE(x) == (y)) 101 #define NTYPEP(x,y) (TYPE(x) != (y)) 114 #define tc_closure 11 115 #define tc_free_cell 12 117 #define tc_double_array 14 118 #define tc_long_array 15 119 #define tc_lisp_array 16 121 #define tc_untyped 18 131 #define tc_application_1 41 132 #define tc_application_2 42 133 #define tc_application_3 43 134 #define tc_application_4 44 135 #define tc_application_5 45 136 #define tc_application_6 46 137 #define tc_application_7 47 141 #define tc_first_user_type 50 143 #define tc_table_dim 100 150 typedef struct obj* LISP;
153 #define CONSP(x) TYPEP(x,tc_cons) 154 #define FLONUMP(x) TYPEP(x,tc_flonum) 155 #define SYMBOLP(x) TYPEP(x,tc_symbol) 156 #define STRINGP(x) TYPEP(x,tc_string) 158 #define NCONSP(x) NTYPEP(x,tc_cons) 159 #define NFLONUMP(x) NTYPEP(x,tc_flonum) 160 #define NSYMBOLP(x) NTYPEP(x,tc_symbol) 165 #define CAR1(x) CAR(x) 166 #define CDR1(x) CDR(x) 167 #define CAR2(x) CAR(CDR1(x)) 168 #define CDR2(x) CDR(CDR1(x)) 169 #define CAR3(x) CAR(CDR2(x)) 170 #define CDR3(x) CDR(CDR2(x)) 171 #define CAR4(x) CAR(CDR3(x)) 172 #define CDR4(x) CDR(CDR3(x)) 173 #define CAR5(x) CAR(CDR4(x)) 174 #define CDR5(x) CDR(CDR4(x)) 176 #define LISTP(x) (NULLP(x) || CONSP(x)) 177 #define LIST1P(x) (CONSP(x) && NULLP(CDR(x))) 178 #define LIST2P(x) (CONSP(x) && CONSP(CDR1(x)) && NULLP(CDR2(x))) 179 #define LIST3P(x) (CONSP(x) && CONSP(CDR1(x)) && CONSP(CDR2(x)) && NULLP(CDR3(x))) 180 #define LIST4P(x) (CONSP(x) && CONSP(CDR1(x)) && CONSP(CDR2(x)) && CONSP(CDR3(x)) && NULLP(CDR4(x))) 181 #define LIST5P(x) (CONSP(x) && CONSP(CDR1(x)) && CONSP(CDR2(x)) && CONSP(CDR3(x)) && CONSP(CDR4(x)) && NULLP(CDR5(x))) 183 #define MKPTR(x) (siod_make_ptr((void *)x)) 187 void (*ungetc_fcn)(
int,
char *);
190 #define GETC_FCN(x) (*((*x).getc_fcn))((*x).cb_argument) 191 #define UNGETC_FCN(c,x) (*((*x).ungetc_fcn))(c,(*x).cb_argument) 200 #define SIOD_REGISTER_CLASS_DCLS(NAME,CLASS) \ 201 class CLASS *NAME(LISP x); \ 202 int NAME##_p(LISP x); \ 203 EST_Val est_val(const class CLASS *v); \ 204 LISP siod(const class CLASS *v); 207 #define SIOD_REGISTER_CLASS(NAME,CLASS) \ 208 class CLASS *NAME(LISP x) \ 210 return NAME(val(x)); \ 213 int NAME##_p(LISP x) \ 216 (val_type_##NAME == val(x).type())) \ 222 LISP siod(const class CLASS *v) \ 227 return siod(est_val(v)); \ 232 #define SIOD_REGISTER_TYPE_DCLS(NAME,CLASS) \ 233 CLASS *NAME(LISP x); \ 234 int NAME##_p(LISP x); \ 235 EST_Val est_val(const CLASS *v); \ 236 LISP siod(const CLASS *v); 239 #define SIOD_REGISTER_TYPE(NAME,CLASS) \ 240 CLASS *NAME(LISP x) \ 242 return NAME(val(x)); \ 245 int NAME##_p(LISP x) \ 248 (val_type_##NAME == val(x).type())) \ 254 LISP siod(const CLASS *v) \ 259 return siod(est_val(v)); \ 264 #define SIOD_REGISTER_FUNCPTR(NAME,CLASS) \ 267 return NAME(val(x)); \ 270 int NAME##_p(LISP x) \ 273 (val_type_##NAME == val(x).type())) \ 279 LISP siod(const CLASS v) \ 284 return siod(est_val(v)); \
struct obj::@1::@12 closure
struct obj::@1::@15 string
struct obj::@1::@3 flonum
struct obj::@1::@17 c_file
struct obj::@1::@14 double_array
struct obj::@1::@10 subrm
struct obj::@1::@16 lisp_array
struct obj::@1::@13 long_array
struct obj::@1::@4 symbol
void(* repl_puts)(char *)