16 typedef int (*repl_getc_fn)(FILE *);
17 typedef void (*repl_ungetc_fn)(int,FILE *);
20 extern repl_getc_fn siod_fancy_getc;
21 extern repl_ungetc_fn siod_fancy_ungetc;
22 extern "C" const char *repl_prompt;
24 extern char *tkbuffer;
25 extern LISP heap,heap_end,heap_org;
26 extern LISP oblistvar;
27 extern LISP open_files;
29 extern LISP siod_docstrings;
30 extern int siod_interactive;
31 void sock_acknowledge_error();
33 extern LISP unbound_marker;
34 extern long gc_kind_copying;
36 extern long gc_cells_allocated;
37 extern int siod_server_socket;
38 extern "C" int rl_pos;
44 LISP (*gc_relocate)(LISP);
45 void (*gc_scan)(LISP);
46 LISP (*gc_mark)(LISP);
47 void (*gc_free)(LISP);
48 void (*gc_clear)(LISP);
49 void (*prin1)(LISP, FILE *);
50 void (*print_string)(LISP,
char *);
51 LISP (*leval)(LISP, LISP *, LISP *);
52 long (*c_sxhash)(LISP,long);
53 LISP (*fast_print)(LISP,LISP);
54 LISP (*fast_read)(int,LISP);
55 LISP (*equal)(LISP,LISP);};
68 #define NEWCELL(_into,_type) \
69 {if (gc_kind_copying == 1) \
70 {if ((_into = heap) >= heap_end) \
77 freelist = CDR(freelist); \
78 ++gc_cells_allocated;} \
79 (*_into).gc_mark = 0; \
80 (*_into).type = (short) _type;}
82 #define NEWCELL(_into,_type) NNEWCELL(&_into,_type)
83 void NNEWCELL (LISP *_into,
long _type);
87 extern int ipoll_counter;
88 void full_interrupt_poll(
int *counter);
89 #define INTERRUPT_CHECK() if (--ipoll_counter < 0) full_interrupt_poll(&ipoll_counter)
91 #define INTERRUPT_CHECK()
94 extern char *stack_limit_ptr;
96 #define STACK_LIMIT(_ptr,_amt) (((char *)_ptr) - (_amt))
99 #define STACK_CHECK(_ptr) \
100 if (((char *) (_ptr)) < stack_limit_ptr) err_stack((char *) _ptr);
102 #define TKBUFFERN 256
104 void err_stack(
char *);
106 #if defined(VMS) && defined(VAX)
107 #define SIG_restargs ,...
112 void init_storage(
int init_heap_size);
113 void init_subrs_base(
void);
114 void init_subrs_core(
void);
115 void init_subrs_doc(
void);
116 void init_subrs_file(
void);
117 void init_subrs_format(
void);
118 void init_subrs_list(
void);
119 void init_subrs_math(
void);
120 void init_subrs_sys(
void);
121 void init_subrs_srv(
void);
122 void init_subrs_str(
void);
123 void init_subrs_xtr(
void);
125 void need_n_cells(
int n);
127 char *must_malloc(
unsigned long size);
129 LISP gc_relocate(LISP x);
130 void gc_fatal_error(
void);
131 void gc_for_newcell(
void);
133 void gc_mark(LISP ptr);
134 LISP newcell(
long type);
136 void put_st(
const char *st);
138 void f_ungetc(
int c, FILE *f);
139 long no_interrupt(
long n);
141 long repl_driver(
long want_sigint,
long want_init,
struct repl_hooks *);
143 LISP leval_args(LISP l,LISP env);
144 LISP extend_env(LISP actuals,LISP formals,LISP env);
145 LISP envlookup(LISP var,LISP env);
146 LISP closure(LISP env,LISP code);
148 void close_open_files(
void);
149 void close_open_files_upto(LISP end);
150 void pprintf(FILE *fd,LISP exp,
int indent,
int width,
int depth,
int length);
153 void handle_sigfpe(
int sig SIG_restargs);
154 void handle_sigint(
int sig SIG_restargs);
155 void err_ctrl_c(
void);
156 double myruntime(
void);
157 void grepl_puts(
char *,
void (*)(
char *));
158 LISP gen_intern(
char *name,
int freeable);
159 void scan_registers(
void);
160 void init_storage_1(
int heap_size);
161 LISP get_newspace(
void);
162 void scan_newspace(LISP newspace);
163 void free_oldspace(LISP space,LISP end);
164 void gc_stop_and_copy(
void);
165 void gc_mark_and_sweep(
void);
166 void gc_ms_stats_start(
void);
167 void gc_ms_stats_end(
void);
168 void mark_protected_registers(
void);
169 void mark_locations(LISP *start,LISP *end);
170 void mark_locations_array(LISP *x,
long n);
172 LISP leval_setq(LISP args,LISP env);
173 LISP syntax_define(LISP args);
174 LISP leval_define(LISP args,LISP env);
175 LISP leval_if(LISP *pform,LISP *penv);
176 LISP leval_lambda(LISP args,LISP env);
177 LISP leval_progn(LISP *pform,LISP *penv);
178 LISP leval_or(LISP *pform,LISP *penv);
179 LISP leval_and(LISP *pform,LISP *penv);
180 LISP leval_catch(LISP args,LISP env);
181 LISP lthrow(LISP tag,LISP value);
182 LISP leval_let(LISP *pform,LISP *penv);
183 LISP reverse(LISP l);
184 LISP let_macro(LISP form);
185 LISP leval_quote(LISP args,LISP env);
186 LISP leval_tenv(LISP args,LISP env);
187 int flush_ws(
struct gen_readio *f,
const char *eoferr);
190 LISP arglchk(LISP x);
192 int rfs_getc(
unsigned char **p);
193 void rfs_ungetc(
unsigned char c,
unsigned char **p);
196 void file_gc_free(LISP ptr);
197 void file_prin1(LISP ptr,FILE *f);
198 LISP fd_to_scheme_file(
int fd,
199 const char *name,
const char *how,
202 LISP lputc(LISP c,LISP p);
203 LISP lputs(LISP str,LISP p);
205 LISP lftell(LISP file);
206 LISP lfseek(LISP file,LISP offset,LISP direction);
207 LISP lfread(LISP size,LISP file);
208 LISP lfwrite(LISP
string,LISP file);
211 LISP leval_while(LISP args,LISP env);
213 void init_subrs_a(
void);
214 void init_subrs_1(
void);
216 LISP stack_limit(LISP,LISP);
222 LISP closure_code(LISP exp);
223 LISP closure_env(LISP exp);
224 LISP lwhile(LISP form,LISP env);
226 LISP siod_send_lisp_to_client(LISP x);