Debian Codegraph @

src/h/external.h

raw symbols SCIP
1 /* -*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*- */
2 /* vim: set filetype=c tabstop=8 shiftwidth=4 expandtab: */
3
4 #ifndef ECL_EXTERNAL_H
5 #define ECL_EXTERNAL_H
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 #define _ECL_ARGS(x) x
12
13 /* The runtime stack, which is used mainly for keeping the arguments of a
14 * function before it is invoked, and also by the compiler and by the reader
15 * when they are building some data structure. */
16 struct ecl_runtime_stack {
17 cl_index size;
18 cl_index limit_size;
19 cl_object *org;
20 cl_object *top;
21 cl_object *limit;
22 };
23
24 /* The BinDing Stack stores the bindings of special variables. */
25 struct ecl_binding_stack {
26 cl_index size;
27 cl_index limit_size;
28 struct ecl_bds_frame *org;
29 struct ecl_bds_frame *top;
30 struct ecl_bds_frame *limit;
31 #ifdef ECL_THREADS
32 cl_index tl_bindings_size;
33 cl_object *tl_bindings;
34 #endif
35 };
36
37 struct ecl_frames_stack {
38 cl_index size;
39 cl_index limit_size;
40 struct ecl_frame *org;
41 struct ecl_frame *top;
42 struct ecl_frame *limit;
43 /* extra */
44 struct ecl_frame *nlj_fr;
45 cl_index frame_id;
46 };
47
48 struct ecl_history_stack {
49 struct ecl_ihs_frame *top;
50 };
51
52 struct ecl_c_stack {
53 cl_index size; /* current size */
54 cl_index limit_size; /* maximum size minus safety area */
55 char *org; /* origin address */
56 char *max; /* overflow address (real maximum address) */
57 char *limit; /* overflow address (spares recovery area) */
58 /* extra */
59 cl_index max_size; /* maximum possible size */
60 };
61
62
63 /*
64 * Per-thread data.
65 */
66
67 typedef struct cl_env_struct *cl_env_ptr;
68 struct cl_env_struct {
69 /* Flag for disabling interrupts while we call C library functions. */
70 volatile int disable_interrupts;
71
72 /* -- ECL runtime ---------------------------------------------------- */
73 /* Array where values are returned. */
74 cl_index nvalues;
75 cl_object values[ECL_MULTIPLE_VALUES_LIMIT];
76
77 /* ECL stacks. */
78
79 /* The Runtime Stack is used mainly for keeping the arguments of a
80 * function before it is invoked, and also by the compiler and by the
81 * reader when they are building some data structure. */
82 struct ecl_runtime_stack run_stack;
83 /* The BinDing Stack stores the bindings of special variables. */
84 struct ecl_binding_stack bds_stack;
85 /* The FRames Stack (FRS) is a list of frames or jump points, and it is
86 * used by different high-level constructs (BLOCK, TAGBODY, CATCH...)
87 * to set return points. */
88 struct ecl_frames_stack frs_stack;
89 /* The Invocation History Stack (IHS) keeps a list of the names of the
90 * functions that are invoked with their lexical environments. */
91 struct ecl_history_stack ihs_stack;
92 /* The following pointers to the C Stack are used to ensure that a
93 * recursive function does not enter an infinite loop and exhausts all
94 * memory. They will eventually disappear, because most operating
95 * systems already take care of this. */
96 struct ecl_c_stack c_stack; /* shadow stack */
97
98 /* -- Invocation of closures, generic function, etc ------------------ */
99 cl_object function;
100 cl_object stepper; /* Hook invoked by ByteVM */
101 cl_object stack_frame; /* Current stack frame */
102
103 /* -- System Processes (native threads) ------------------------------ */
104 cl_object own_process; /* Backpointer to the host process. */
105 #ifdef ECL_THREADS
106 int cleanup;
107 #endif
108
109 /* -- System Interrupts ---------------------------------------------- */
110 /* The objects in this struct need to be writeable from a different
111 thread, if environment is write-protected by mprotect. Hence they
112 have to be allocated seperately. */
113 struct ecl_interrupt_struct *interrupt_struct;
114 void *default_sigmask;
115 /* Floating point interrupts which are trapped */
116 int trap_fpe_bits;
117 /* Segmentation fault address */
118 void *fault_address;
119
120 /* -- Private variables used by different parts of ECL ---------------- */
121 /* ... the reader and printer ... */
122 cl_object string_pool;
123 /* ... the compiler ... */
124 struct cl_compiler_env *c_env;
125 /* ... the formatter ... */
126 #if !defined(ECL_CMU_FORMAT)
127 cl_object fmt_aux_stream;
128 #endif
129 /* ... arithmetics ... */
130 cl_object big_register[ECL_BIGNUM_REGISTER_NUMBER];
131 /* The following is a hash table for caching invocations of generic
132 functions. In a multithreaded environment we must queue operations in
133 which the hash is cleared from updated generic functions. */
134 struct ecl_cache *method_cache;
135 struct ecl_cache *slot_cache;
136 /* foreign function interface */
137 #ifdef HAVE_LIBFFI
138 cl_index ffi_args_limit;
139 struct _ffi_type **ffi_types;
140 union ecl_ffi_values *ffi_values;
141 union ecl_ffi_values **ffi_values_ptrs;
142 #endif
143 /* List of packages interned when loading a FASL but which have
144 * to be explicitely created by the compiled code itself. */
145 cl_object packages_to_be_created;
146 cl_object packages_to_be_created_p;
147 };
148
149 struct ecl_interrupt_struct {
150 cl_object pending_interrupt;
151 cl_object signal_queue;
152 #ifdef ECL_THREADS
153 ecl_mutex_t signal_queue_lock;
154 #endif
155 };
156
157 #ifndef __GNUC__
158 #define __attribute__(x)
159 #endif
160 #if defined(ECL_THREADS)
161 # define cl_env (*ecl_process_env())
162 extern ECL_API cl_env_ptr ecl_process_env(void) __attribute__((const));
163 extern ECL_API cl_env_ptr ecl_process_env_unsafe(void);
164 extern ECL_API void ecl_set_process_env(cl_env_ptr env);
165 #else
166 # define cl_env (*cl_env_p)
167 # define ecl_process_env() cl_env_p
168 # define ecl_process_env_unsafe() cl_env_p
169 # define ecl_set_process_env(env) cl_env_p = env
170 extern ECL_API cl_env_ptr cl_env_p;
171 #endif
172
173 /*
174 * Per-process data. Modify main.d accordingly.
175 */
176
177 struct cl_core_struct {
178 cl_object packages;
179 cl_object lisp_package;
180 cl_object user_package;
181 cl_object keyword_package;
182 cl_object system_package;
183 cl_object ext_package;
184 cl_object clos_package;
185 # ifdef ECL_CLOS_STREAMS
186 cl_object gray_package;
187 # endif
188 cl_object mp_package;
189 cl_object c_package;
190 cl_object ffi_package;
191
192 cl_object pathname_translations;
193 cl_object library_pathname;
194
195 cl_object terminal_io;
196 cl_object null_stream;
197 cl_object standard_input;
198 cl_object standard_output;
199 cl_object error_output;
200 cl_object standard_readtable;
201 cl_object dispatch_reader;
202
203 cl_object char_names;
204 cl_object null_string;
205
206 cl_object plus_half;
207 cl_object minus_half;
208 cl_object imag_unit;
209 cl_object minus_imag_unit;
210 cl_object imag_two;
211 cl_object singlefloat_zero;
212 cl_object doublefloat_zero;
213 cl_object singlefloat_minus_zero;
214 cl_object doublefloat_minus_zero;
215 cl_object longfloat_zero;
216 cl_object longfloat_minus_zero;
217
218 cl_object gensym_prefix;
219 cl_object gentemp_prefix;
220 cl_object gentemp_counter;
221
222 cl_object Jan1st1970UT;
223
224 cl_object system_properties;
225
226 cl_env_ptr first_env;
227 #ifdef ECL_THREADS
228 cl_object processes;
229 ecl_mutex_t processes_lock;
230 ecl_mutex_t global_lock;
231 ecl_mutex_t error_lock;
232 ecl_rwlock_t global_env_lock;
233 #endif
234 cl_object libraries;
235
236 size_t max_heap_size;
237 cl_object bytes_consed;
238 cl_object gc_counter;
239 bool gc_stats;
240 int path_max;
241 #ifdef GBC_BOEHM
242 char *safety_region;
243 #endif
244 void *default_sigmask;
245 cl_index default_sigmask_bytes;
246
247 #ifdef ECL_THREADS
248 cl_index last_var_index;
249 cl_object reused_indices;
250 #endif
251 cl_object slash;
252
253 cl_object compiler_dispatch;
254
255 cl_object rehash_size;
256 cl_object rehash_threshold;
257
258 cl_object known_signals;
259 };
260
261 extern ECL_API struct cl_core_struct cl_core;
262
263 /* memory.c */
264 extern ECL_API void *ecl_malloc(cl_index n);
265 extern ECL_API void *ecl_realloc(void *ptr, cl_index o, cl_index n);
266 extern ECL_API void ecl_free(void *ptr);
267 extern ECL_API void ecl_copy(void *dst, void *src, cl_index ndx);
268 #define ecl_free_unsafe(x) ecl_free(x);
269
270 /* alloc.c / alloc_2.c */
271
272 extern ECL_API cl_object ecl_alloc_object(cl_type t);
273 extern ECL_API cl_object ecl_alloc_instance(cl_index slots);
274 extern ECL_API cl_object ecl_alloc_weak_pointer(cl_object o);
275 extern ECL_API cl_object ecl_alloc_compact_object(cl_type t, cl_index extra_space);
276 extern ECL_API cl_object ecl_cons(cl_object a, cl_object d);
277 #define ecl_list1(x) ecl_cons(x, ECL_NIL)
278
279 extern ECL_API cl_object si_make_weak_pointer(cl_object o);
280 extern ECL_API cl_object si_weak_pointer_value(cl_object o);
281
282 #ifdef GBC_BOEHM
283 extern ECL_API void *ecl_alloc_unprotected(cl_index n);
284 extern ECL_API void *ecl_alloc_atomic_unprotected(cl_index n);
285 extern ECL_API void *ecl_alloc(cl_index n);
286 extern ECL_API void *ecl_alloc_atomic(cl_index n);
287 extern ECL_API void *ecl_alloc_uncollectable(size_t size);
288 extern ECL_API void ecl_free_uncollectable(void *);
289 extern ECL_API void ecl_dealloc(void *);
290 #define ecl_alloc_align(s,d) ecl_alloc(s)
291 #define ecl_alloc_atomic_align(s,d) ecl_alloc_atomic(s)
292 #else /* Ideally the core would not depend on these. */
293 # error "IMPLEMENT ME!"
294 #endif /* GBC_BOEHM */
295
296 /* all_symbols */
297
298 extern ECL_API cl_object si_mangle_name _ECL_ARGS((cl_narg narg, cl_object symbol, ...));
299
300 typedef union {
301 struct {
302 const char *name;
303 const char *translation;
304 void *fun;
305 int narg;
306 int type;
307 cl_object value;
308 } init;
309 struct ecl_symbol data;
310 } cl_symbol_initializer;
311 extern ECL_API cl_symbol_initializer cl_symbols[];
312 extern ECL_API cl_index cl_num_symbols_in_core;
313
314 #define ECL_SYM(name,code) ((cl_object)(cl_symbols+(code)))
315
316 /* apply.c */
317
318 extern ECL_API cl_object APPLY_fixed(cl_narg n, cl_object (*f)(), cl_object *x);
319 extern ECL_API cl_object APPLY(cl_narg n, cl_objectfn, cl_object *x);
320
321 /* atomic.d */
322
323 extern ECL_API cl_object ecl_atomic_get(cl_object *slot);
324 extern ECL_API cl_object ecl_atomic_psh(cl_object *slot, cl_object cons);
325 extern ECL_API cl_object ecl_atomic_pop(cl_object *slot);
326 extern ECL_API cl_index ecl_atomic_index_incf(cl_index *slot);
327 #define ecl_atomic_push(slot, obj) ecl_atomic_psh(slot, ecl_list1(obj));
328
329 /* stack.c */
330 extern ECL_API cl_object ecl_make_stack(cl_index dim);
331 extern ECL_API cl_object ecl_stack_push(cl_object stack, cl_object elt);
332 extern ECL_API cl_object ecl_stack_del(cl_object stack, cl_object elt);
333 extern ECL_API cl_object ecl_stack_popu(cl_object stack);
334
335 /* array.c */
336
337 extern ECL_API cl_object ecl_make_vector(cl_index dim);
338 extern ECL_API cl_object cl_row_major_aref(cl_object x, cl_object i);
339 extern ECL_API cl_object si_row_major_aset(cl_object x, cl_object i, cl_object v);
340 extern ECL_API cl_object si_make_vector(cl_object etype, cl_object dim, cl_object adj, cl_object fillp, cl_object displ, cl_object disploff);
341 extern ECL_API cl_object si_adjust_vector(cl_object vector, cl_object dim);
342
343 /* for open-coding the access while preserving the bounds and type check: */
344 extern ECL_API void *ecl_row_major_ptr(cl_object arr, cl_index index, cl_index bytes);
345
346 extern ECL_API cl_object cl_array_element_type(cl_object a);
347 extern ECL_API cl_object cl_array_rank(cl_object a);
348 extern ECL_API cl_object cl_array_dimension(cl_object a, cl_object index);
349 extern ECL_API cl_object cl_array_total_size(cl_object a);
350 extern ECL_API cl_object cl_adjustable_array_p(cl_object a);
351 extern ECL_API cl_object cl_array_displacement(cl_object a);
352 extern ECL_API cl_object si_array_raw_data(cl_object array);
353 extern ECL_API cl_object si_array_element_type_byte_size(cl_object type);
354 extern ECL_API cl_object cl_svref(cl_object x, cl_object index);
355 extern ECL_API cl_object si_svset(cl_object x, cl_object index, cl_object v);
356 extern ECL_API cl_object cl_array_has_fill_pointer_p(cl_object a);
357 extern ECL_API cl_object cl_fill_pointer(cl_object a);
358 extern ECL_API cl_object si_fill_pointer_set(cl_object a, cl_object fp);
359 extern ECL_API cl_object si_replace_array(cl_object old_obj, cl_object new_obj);
360 extern ECL_API cl_object cl_aref _ECL_ARGS((cl_narg narg, cl_object x, ...));
361 extern ECL_API cl_object si_aset _ECL_ARGS((cl_narg narg, cl_object x, ...));
362 extern ECL_API cl_object si_make_pure_array(cl_object etype, cl_object dims, cl_object adj, cl_object fillp, cl_object displ, cl_object disploff);
363 extern ECL_API cl_object si_copy_subarray(cl_object dest, cl_object start0, cl_object orig, cl_object start1, cl_object length);
364 extern ECL_API cl_object si_fill_array_with_elt(cl_object array, cl_object elt, cl_object start, cl_object end);
365
366 extern ECL_API void FEwrong_dimensions(cl_object a, cl_index rank) ecl_attr_noreturn;
367 extern ECL_API cl_index ecl_to_index(cl_object n);
368 extern ECL_API cl_index ecl_array_dimension(cl_object x, cl_index n);
369 extern ECL_API cl_index ecl_array_rank(cl_object x);
370 extern ECL_API cl_object ecl_aref_unsafe(cl_object x, cl_index index);
371 extern ECL_API cl_object ecl_aset_unsafe(cl_object x, cl_index index, cl_object value);
372 extern ECL_API cl_object ecl_aref(cl_object x, cl_index index);
373 extern ECL_API cl_object ecl_aref1(cl_object v, cl_index index);
374 extern ECL_API cl_object ecl_aset(cl_object x, cl_index index, cl_object value);
375 extern ECL_API cl_object ecl_aset1(cl_object v, cl_index index, cl_object val);
376 extern ECL_API void ecl_array_allocself(cl_object x);
377 extern ECL_API cl_object ecl_alloc_simple_vector(cl_index l, cl_elttype aet);
378 extern ECL_API cl_elttype ecl_array_elttype(cl_object x);
379 extern ECL_API cl_elttype ecl_symbol_to_elttype(cl_object x);
380 extern ECL_API cl_object ecl_elttype_to_symbol(cl_elttype aet);
381 extern ECL_API void ecl_copy_subarray(cl_object dest, cl_index i0, cl_object orig, cl_index i1, cl_index l);
382 extern ECL_API void ecl_reverse_subarray(cl_object dest, cl_index i0, cl_index i1);
383
384 #ifdef ECL_THREADS
385 extern ECL_API cl_object mp_compare_and_swap_svref(cl_object x, cl_object index, cl_object old_val, cl_object new_val);
386 extern ECL_API cl_object mp_atomic_incf_svref(cl_object x, cl_object index, cl_object increment);
387 #endif
388
389 /* assignment.c */
390
391 extern ECL_API cl_object cl_set(cl_object var, cl_object val);
392 extern ECL_API cl_object cl_makunbound(cl_object sym);
393 extern ECL_API cl_object cl_fmakunbound(cl_object sym);
394 extern ECL_API cl_object si_fset _ECL_ARGS((cl_narg narg, cl_object fun, cl_object def, ...));
395 extern ECL_API cl_object si_get_sysprop(cl_object sym, cl_object prop);
396 extern ECL_API cl_object si_put_sysprop(cl_object sym, cl_object prop, cl_object value);
397 extern ECL_API cl_object si_rem_sysprop(cl_object sym, cl_object prop);
398 extern ECL_API cl_object si_copy_sysprop(cl_object sym_old, cl_object sym_new);
399 extern ECL_API cl_object ecl_setf_definition(cl_object fname, cl_object createp);
400 extern ECL_API cl_object si_setf_definition(cl_object fname, cl_object createp);
401
402 extern ECL_API void ecl_clear_compiler_properties(cl_object sym);
403
404 #ifdef ECL_THREADS
405 extern ECL_API cl_object mp_compare_and_swap_symbol_value(cl_object x, cl_object old_val, cl_object new_val);
406 extern ECL_API cl_object mp_atomic_incf_symbol_value(cl_object x, cl_object increment);
407 #endif
408
409 /* big.c */
410
411 /* Note: Needs to be adapted if ECL_BIGNUM_REGISTER_NUMBER changes */
412 #define _ecl_big_register0() ecl_process_env()->big_register[0]
413 #define _ecl_big_register1() ecl_process_env()->big_register[1]
414 #define _ecl_big_register2() ecl_process_env()->big_register[2]
415 extern ECL_API cl_object _ecl_fix_times_fix(cl_fixnum x, cl_fixnum y);
416 extern ECL_API cl_object _ecl_big_register_copy(cl_object x);
417 extern ECL_API cl_object _ecl_big_register_normalize(cl_object x);
418 extern ECL_API cl_object _ecl_big_times_fix(cl_object x, cl_fixnum y);
419 extern ECL_API cl_object _ecl_big_times_big(cl_object x, cl_object y);
420 extern ECL_API cl_object _ecl_big_plus_fix(cl_object x, cl_fixnum y);
421 extern ECL_API cl_object _ecl_big_plus_big(cl_object x, cl_object y);
422 extern ECL_API cl_object _ecl_fix_minus_big(cl_fixnum x, cl_object y);
423 extern ECL_API cl_object _ecl_big_minus_big(cl_object x, cl_object y);
424 extern ECL_API cl_object _ecl_fix_divided_by_big(cl_fixnum x, cl_object y);
425 extern ECL_API cl_object _ecl_big_divided_by_fix(cl_object x, cl_fixnum y);
426 extern ECL_API cl_object _ecl_big_divided_by_big(cl_object x, cl_object y);
427 extern ECL_API cl_object _ecl_big_gcd(cl_object x, cl_object y);
428 extern ECL_API cl_object _ecl_big_ceiling(cl_object x, cl_object y, cl_object *r);
429 extern ECL_API cl_object _ecl_big_floor(cl_object x, cl_object y, cl_object *r);
430 extern ECL_API cl_object _ecl_big_negate(cl_object x);
431 extern ECL_API void _ecl_big_register_free(cl_object x);
432
433 /* cfun.c */
434
435 extern ECL_API cl_object si_compiled_function_name(cl_object fun);
436 extern ECL_API cl_object si_compiled_function_block(cl_object fun);
437 extern ECL_API cl_object cl_function_lambda_expression(cl_object fun);
438 extern ECL_API cl_object si_compiled_function_file(cl_object fun);
439
440 extern ECL_API cl_object ecl_make_cfun(cl_objectfn_fixed c_function, cl_object name, cl_object block, int narg);
441 extern ECL_API cl_object ecl_make_cfun_va(cl_objectfn c_function, cl_object name, cl_object block, int narg_fixed);
442 extern ECL_API cl_object ecl_make_cclosure_va(cl_objectfn c_function, cl_object env, cl_object block, int narg_fixed);
443 extern ECL_API void ecl_def_c_function(cl_object sym, cl_objectfn_fixed c_function, int narg);
444 extern ECL_API void ecl_def_c_macro(cl_object sym, cl_objectfn_fixed c_function, int narg);
445 extern ECL_API void ecl_def_c_macro_va(cl_object sym, cl_objectfn c_function, int narg_fixed);
446 extern ECL_API void ecl_def_c_function_va(cl_object sym, cl_objectfn c_function, int narg_fixed);
447 extern ECL_API void ecl_set_function_source_file_info(cl_object fun, cl_object source, cl_object position);
448 extern ECL_API void ecl_cmp_defmacro(cl_object data);
449 extern ECL_API void ecl_cmp_defun(cl_object data);
450
451
452 /* character.c */
453
454 extern ECL_API cl_object cl_digit_char_p _ECL_ARGS((cl_narg narg, cl_object c, ...));
455 extern ECL_API cl_object cl_charE _ECL_ARGS((cl_narg narg, cl_object c, ...));
456 extern ECL_API cl_object cl_charNE _ECL_ARGS((cl_narg narg, ...));
457 extern ECL_API cl_object cl_charL _ECL_ARGS((cl_narg narg, ...));
458 extern ECL_API cl_object cl_charG _ECL_ARGS((cl_narg narg, ...));
459 extern ECL_API cl_object cl_charLE _ECL_ARGS((cl_narg narg, ...));
460 extern ECL_API cl_object cl_charGE _ECL_ARGS((cl_narg narg, ...));
461 extern ECL_API cl_object cl_char_equal _ECL_ARGS((cl_narg narg, cl_object c, ...));
462 extern ECL_API cl_object cl_char_not_equal _ECL_ARGS((cl_narg narg, ...));
463 extern ECL_API cl_object cl_char_lessp _ECL_ARGS((cl_narg narg, ...));
464 extern ECL_API cl_object cl_char_greaterp _ECL_ARGS((cl_narg narg, ...));
465 extern ECL_API cl_object cl_char_not_greaterp _ECL_ARGS((cl_narg narg, ...));
466 extern ECL_API cl_object cl_char_not_lessp _ECL_ARGS((cl_narg narg, ...));
467 extern ECL_API cl_object cl_digit_char _ECL_ARGS((cl_narg narg, cl_object w, ...));
468
469 extern ECL_API cl_object cl_alpha_char_p(cl_object c);
470 extern ECL_API cl_object cl_alphanumericp(cl_object c);
471 extern ECL_API cl_object cl_both_case_p(cl_object c);
472 extern ECL_API cl_object cl_char_code(cl_object c);
473 extern ECL_API cl_object cl_char_downcase(cl_object c);
474 extern ECL_API cl_object cl_char_int(cl_object c);
475 extern ECL_API cl_object cl_char_name(cl_object c);
476 extern ECL_API cl_object cl_char_upcase(cl_object c);
477 extern ECL_API cl_object cl_character(cl_object x);
478 extern ECL_API cl_object cl_code_char(cl_object c);
479 extern ECL_API cl_object cl_graphic_char_p(cl_object c);
480 extern ECL_API cl_object cl_lower_case_p(cl_object c);
481 extern ECL_API cl_object cl_name_char(cl_object s);
482 extern ECL_API cl_object cl_standard_char_p(cl_object c);
483 extern ECL_API cl_object cl_upper_case_p(cl_object c);
484 extern ECL_API int ecl_string_case(cl_object s);
485
486 extern ECL_API bool ecl_alpha_char_p(ecl_character c);
487 extern ECL_API bool ecl_alphanumericp(ecl_character c);
488 extern ECL_API bool ecl_both_case_p(ecl_character c);
489 extern ECL_API ecl_character ecl_char_downcase(ecl_character c);
490 extern ECL_API ecl_character ecl_char_upcase(ecl_character c);
491 extern ECL_API bool ecl_graphic_char_p(ecl_character c);
492 extern ECL_API bool ecl_lower_case_p(ecl_character c);
493 extern ECL_API bool ecl_standard_char_p(ecl_character c);
494 extern ECL_API bool ecl_base_char_p(ecl_character c);
495 extern ECL_API bool ecl_upper_case_p(ecl_character c);
496
497 extern ECL_API int ecl_base_string_case(cl_object s);
498 extern ECL_API ecl_character ecl_char_code(cl_object c);
499 extern ECL_API ecl_base_char ecl_base_char_code(cl_object c);
500 extern ECL_API int ecl_digitp(ecl_character i, int r);
501 extern ECL_API bool ecl_char_eq(cl_object x, cl_object y);
502 extern ECL_API int ecl_char_cmp(cl_object x, cl_object y);
503 extern ECL_API bool ecl_char_equal(cl_object x, cl_object y);
504 extern ECL_API int ecl_char_compare(cl_object x, cl_object y);
505 extern ECL_API short ecl_digit_char(cl_fixnum w, cl_fixnum r);
506
507 /* clos.c */
508
509 extern ECL_API cl_object cl_find_class _ECL_ARGS((cl_narg narg, cl_object name, ...));
510 extern ECL_API cl_object cl_class_of(cl_object x);
511
512 /* cmpaux.c */
513
514 extern ECL_API cl_object si_specialp(cl_object sym);
515 extern ECL_API cl_object si_constp(cl_object sym);
516
517 extern ECL_API cl_fixnum ecl_ifloor(cl_fixnum x, cl_fixnum y);
518 extern ECL_API cl_fixnum ecl_imod(cl_fixnum x, cl_fixnum y);
519 extern ECL_API char ecl_to_char(cl_object x);
520 extern ECL_API cl_fixnum ecl_to_fixnum(cl_object x);
521 extern ECL_API cl_index ecl_to_unsigned_integer(cl_object x);
522 extern ECL_API int ecl_aref_bv(cl_object x, cl_index index);
523 extern ECL_API int ecl_aset_bv(cl_object x, cl_index index, int value);
524 extern ECL_API void cl_throw(cl_object tag) /*ecl_attr_noreturn*/;
525 extern ECL_API void cl_return_from(cl_object block_id, cl_object block_name) /*ecl_attr_noreturn*/;
526 extern ECL_API void cl_go(cl_object tag_id, cl_object label) /*ecl_attr_noreturn*/;
527 extern ECL_API void cl_parse_key(ecl_va_list args, int nkey, cl_object *keys, cl_object *vars, cl_object *rest, bool allow_other_keys);
528 extern ECL_API cl_object cl_grab_rest_args(ecl_va_list args);
529
530 /* compiler.c */
531
532 extern ECL_API cl_object si_macrolet_function(cl_object form, cl_object env);
533 extern ECL_API cl_object si_need_to_make_load_form_p(cl_object object);
534 extern ECL_API cl_object si_process_lambda_list(cl_object lambda_list, cl_object context);
535 extern ECL_API cl_object si_process_lambda(cl_object lambda);
536 extern ECL_API cl_object si_make_lambda(cl_object name, cl_object body);
537 extern ECL_API cl_object si_function_block_name(cl_object name);
538 extern ECL_API cl_object si_valid_function_name_p(cl_object name);
539 extern ECL_API cl_object si_process_declarations _ECL_ARGS((cl_narg narg, cl_object body, ...));
540
541 extern ECL_API cl_object si_bc_compile_from_stream (cl_object input);
542
543 extern ECL_API cl_object si_eval_with_env _ECL_ARGS((cl_narg narg, cl_object form, ...));
544
545 /* interpreter.c */
546
547 extern ECL_API cl_object si_interpreter_stack();
548 extern ECL_API cl_object ecl_stack_frame_open(cl_env_ptr env, cl_object f, cl_index size);
549 extern ECL_API void ecl_stack_frame_push(cl_object f, cl_object o);
550 extern ECL_API cl_object ecl_stack_frame_pop(cl_object f);
551 extern ECL_API void ecl_stack_frame_push_values(cl_object f);
552 extern ECL_API cl_object ecl_stack_frame_pop_values(cl_object f);
553 extern ECL_API void ecl_stack_frame_close(cl_object f);
554 #define si_apply_from_stack_frame ecl_apply_from_stack_frame
555
556 extern ECL_API cl_object *ecl_data_stack_grow(cl_env_ptr env);
557 extern ECL_API cl_object *ecl_data_stack_set_size(cl_env_ptr env, cl_index new_size);
558 extern ECL_API cl_index ecl_data_stack_push_values(cl_env_ptr env);
559 extern ECL_API void ecl_data_stack_pop_values(cl_env_ptr env, cl_index n);
560 extern ECL_API cl_object ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes);
561 extern ECL_API cl_object _ecl_bytecodes_dispatch(cl_narg narg, ...);
562 extern ECL_API cl_object _ecl_bclosure_dispatch(cl_narg narg, ...);
563
564 /* disassembler.c */
565
566 extern ECL_API cl_object si_bc_disassemble(cl_object v);
567 extern ECL_API cl_object si_bc_split(cl_object v);
568 extern ECL_API cl_object si_bc_join(cl_object lex, cl_object code, cl_object data, cl_object name);
569
570 /* error.c */
571
572 extern ECL_API cl_object cl_error _ECL_ARGS((cl_narg narg, cl_object eformat, ...)) ecl_attr_noreturn;
573 extern ECL_API cl_object cl_cerror _ECL_ARGS((cl_narg narg, cl_object cformat, cl_object eformat, ...));
574
575 extern ECL_API void ecl_internal_error(const char *s) ecl_attr_noreturn;
576 #ifdef ECL_THREADS
577 extern ECL_API void ecl_thread_internal_error(const char *s) ecl_attr_noreturn;
578 #endif
579 extern ECL_API void ecl_unrecoverable_error(cl_env_ptr the_env, const char *message) ecl_attr_noreturn;
580 extern ECL_API void ecl_miscompilation_error(void) ecl_attr_noreturn;
581 extern ECL_API void ecl_cs_overflow(void) /*ecl_attr_noreturn*/;
582 extern ECL_API void FEprogram_error(const char *s, int narg, ...) ecl_attr_noreturn;
583 extern ECL_API void FEcontrol_error(const char *s, int narg, ...) ecl_attr_noreturn;
584 extern ECL_API void FEreader_error(const char *s, cl_object stream, int narg, ...) ecl_attr_noreturn;
585 #define FEparse_error FEreader_error
586 extern ECL_API void FEerror(const char *s, int narg, ...) ecl_attr_noreturn;
587 extern ECL_API void FEcannot_open(cl_object fn) ecl_attr_noreturn;
588 extern ECL_API void FEend_of_file(cl_object strm) ecl_attr_noreturn;
589 extern ECL_API void FEclosed_stream(cl_object strm) ecl_attr_noreturn;
590 extern ECL_API void FEwrong_type_argument(cl_object type, cl_object value) ecl_attr_noreturn;
591 extern ECL_API void FEwrong_type_only_arg(cl_object function, cl_object type, cl_object value) ecl_attr_noreturn;
592 extern ECL_API void FEwrong_type_nth_arg(cl_object function, cl_narg narg, cl_object value, cl_object type) ecl_attr_noreturn;
593 extern ECL_API void FEwrong_type_key_arg(cl_object function, cl_object keyo, cl_object type, cl_object value) ecl_attr_noreturn;
594 extern ECL_API void FEwrong_num_arguments(cl_object fun) ecl_attr_noreturn;
595 extern ECL_API void FEwrong_num_arguments_anonym(void) ecl_attr_noreturn;
596 extern ECL_API void FEwrong_index(cl_object function, cl_object a, int which, cl_object ndx, cl_index nonincl_limit) ecl_attr_noreturn;
597 extern ECL_API void FEunbound_variable(cl_object sym) ecl_attr_noreturn;
598 extern ECL_API void FEinvalid_macro_call(cl_object obj) ecl_attr_noreturn;
599 extern ECL_API void FEinvalid_variable(const char *s, cl_object obj) ecl_attr_noreturn;
600 extern ECL_API void FEillegal_variable_name(cl_object) ecl_attr_noreturn;
601 extern ECL_API void FEassignment_to_constant(cl_object v) ecl_attr_noreturn;
602 extern ECL_API void FEbinding_a_constant(cl_object v) ecl_attr_noreturn;
603 extern ECL_API void FEundefined_function(cl_object fname) ecl_attr_noreturn;
604 extern ECL_API void FEinvalid_function(cl_object obj) ecl_attr_noreturn;
605 extern ECL_API void FEinvalid_function_name(cl_object obj) ecl_attr_noreturn;
606 extern ECL_API void FEprint_not_readable(cl_object obj) ecl_attr_noreturn;
607 extern ECL_API void FEtimeout() ecl_attr_noreturn;
608 extern ECL_API void FEerror_not_owned(cl_object lock) ecl_attr_noreturn;
609 extern ECL_API void FEunknown_lock_error(cl_object lock) ecl_attr_noreturn;
610 extern ECL_API cl_object CEerror(cl_object c, const char *err_str, int narg, ...);
611 extern ECL_API void CEstack_overflow(cl_object type, cl_object limit, cl_object resume);
612 extern ECL_API void FElibc_error(const char *msg, int narg, ...) ecl_attr_noreturn;
613 #if defined(ECL_MS_WINDOWS_HOST) || defined(cygwin)
614 extern ECL_API void FEwin32_error(const char *msg, int narg, ...) ecl_attr_noreturn;
615 #endif
616 extern ECL_API cl_object si_signal_type_error(cl_object value, cl_object type) ecl_attr_noreturn;
617
618
619 /* eval.c */
620
621 extern ECL_API cl_object cl_funcall _ECL_ARGS((cl_narg narg, cl_object fun, ...));
622 extern ECL_API cl_object cl_apply _ECL_ARGS((cl_narg narg, cl_object fun, cl_object arg, ...));
623 extern ECL_API cl_object si_safe_eval _ECL_ARGS((cl_narg narg, cl_object form, cl_object env, ...));
624 #define cl_safe_eval(form,env,value) si_safe_eval(3,form,env,value)
625 extern ECL_API cl_object *_ecl_va_sp(cl_narg narg);
626 extern ECL_API cl_object si_unlink_symbol(cl_object s);
627 extern ECL_API cl_object cl_eval(cl_object form);
628 extern ECL_API cl_object cl_constantp _ECL_ARGS((cl_narg narg, cl_object arg, ...));
629
630 #define funcall cl_funcall
631 extern ECL_API cl_object cl_apply_from_stack(cl_index narg, cl_object fun);
632 extern ECL_API cl_object ecl_apply_from_stack_frame(cl_object f, cl_object o);
633 extern ECL_API cl_objectfn ecl_function_dispatch(cl_env_ptr env, cl_object f);
634 extern ECL_API cl_object _ecl_link_call(cl_object sym, cl_objectfn *pLK, cl_object cblock, int narg, ecl_va_list args);
635
636 /* ffi/cdata.d */
637 extern ECL_API cl_object si_get_cdata(cl_object filename);
638 extern ECL_API cl_object si_add_cdata(cl_object filename, cl_object cdata);
639
640 /* ffi/libraries.d */
641 extern ECL_API cl_object ecl_make_codeblock();
642 extern ECL_API cl_object ecl_library_open(cl_object filename, bool force_reload);
643 extern ECL_API void *ecl_library_symbol(cl_object block, const char *symbol, bool lock);
644 extern ECL_API cl_object ecl_library_error(cl_object block);
645 extern ECL_API bool ecl_library_close(cl_object block);
646 extern ECL_API void ecl_library_close_all(void);
647
648 /* ffi/mmap.d */
649 extern ECL_API cl_object si_mmap _ECL_ARGS((cl_narg narg, cl_object filename, ...));
650 extern ECL_API cl_object si_munmap(cl_object map);
651 extern ECL_API cl_object si_mmap_array(cl_object map);
652
653 /* ffi/backtrace.d */
654 extern ECL_API cl_object si_dump_c_backtrace(cl_object size);
655
656 /* ffi.c */
657
658 extern ECL_API cl_object si_allocate_foreign_data(cl_object tag, cl_object size);
659 extern ECL_API cl_object si_foreign_elt_type_p(cl_object f);
660 extern ECL_API cl_object si_foreign_data_p(cl_object f);
661 extern ECL_API cl_object si_foreign_data_address(cl_object f);
662 extern ECL_API cl_object si_foreign_data_equal(cl_object f1, cl_object f2);
663 extern ECL_API cl_object si_foreign_data_pointer(cl_object f, cl_object ndx, cl_object size, cl_object tag);
664 extern ECL_API cl_object si_foreign_data_ref(cl_object f, cl_object ndx, cl_object size, cl_object tag);
665 extern ECL_API cl_object si_foreign_data_ref_elt(cl_object f, cl_object ndx, cl_object tag);
666 extern ECL_API cl_object si_foreign_data_set(cl_object f, cl_object ndx, cl_object value);
667 extern ECL_API cl_object si_foreign_data_set_elt(cl_object f, cl_object ndx, cl_object tag, cl_object value);
668 extern ECL_API cl_object si_foreign_data_tag(cl_object x);
669 extern ECL_API cl_object si_foreign_data_recast(cl_object f, cl_object size, cl_object tag);
670 extern ECL_API cl_object si_free_foreign_data(cl_object x);
671 extern ECL_API cl_object si_make_foreign_data_from_array(cl_object x);
672 extern ECL_API cl_object si_null_pointer_p(cl_object f);
673 extern ECL_API cl_object si_size_of_foreign_elt_type(cl_object tag);
674 extern ECL_API cl_object si_alignment_of_foreign_elt_type(cl_object tag);
675 extern ECL_API cl_object si_load_foreign_module(cl_object module);
676 extern ECL_API cl_object si_unload_foreign_module(cl_object module);
677 extern ECL_API cl_object si_find_foreign_symbol(cl_object var, cl_object module, cl_object type, cl_object size);
678 extern ECL_API cl_object si_call_cfun(cl_narg, cl_object fun, cl_object return_type, cl_object arg_types, cl_object args, ...);
679 extern ECL_API cl_object si_make_dynamic_callback(cl_narg, cl_object fun, cl_object sym, cl_object return_type, cl_object arg_types, ...);
680 extern ECL_API cl_object si_free_ffi_closure(cl_object closure);
681
682 /* Only foreign data types can be coerced to a pointer */
683 #define ecl_make_pointer(x) ecl_make_foreign_data(ECL_NIL,0,(x))
684 #define ecl_to_pointer(x) ecl_foreign_data_pointer_safe(x)
685 extern ECL_API cl_object ecl_make_foreign_data(cl_object tag, cl_index size, void *data);
686 extern ECL_API cl_object ecl_allocate_foreign_data(cl_object tag, cl_index size);
687 extern ECL_API void *ecl_foreign_data_pointer_safe(cl_object f);
688 extern ECL_API char *ecl_base_string_pointer_safe(cl_object f);
689 extern ECL_API cl_object ecl_null_terminated_base_string(cl_object s);
690 extern ECL_API cl_object ecl_foreign_data_ref_elt(void *p, enum ecl_ffi_tag type);
691 extern ECL_API void ecl_foreign_data_set_elt(void *p, enum ecl_ffi_tag type, cl_object value);
692
693 /* stream.c */
694 cl_object si_unread_byte(cl_object strm, cl_object byte);
695 cl_object si_peek_byte(cl_object strm, cl_object eof_value);
696
697 /* file.c */
698
699 #define ECL_LISTEN_NO_CHAR 0
700 #define ECL_LISTEN_AVAILABLE 1
701 #define ECL_LISTEN_EOF -1
702 #define ECL_LISTEN_FALLBACK -3
703
704 extern ECL_API cl_object cl_make_synonym_stream(cl_object sym);
705 extern ECL_API cl_object cl_synonym_stream_symbol(cl_object strm);
706 extern ECL_API cl_object cl_make_two_way_stream(cl_object strm1, cl_object strm2);
707 extern ECL_API cl_object cl_two_way_stream_input_stream(cl_object strm);
708 extern ECL_API cl_object cl_two_way_stream_output_stream(cl_object strm);
709 extern ECL_API cl_object cl_make_echo_stream(cl_object strm1, cl_object strm2);
710 extern ECL_API cl_object cl_echo_stream_input_stream(cl_object strm);
711 extern ECL_API cl_object cl_echo_stream_output_stream(cl_object strm);
712 extern ECL_API cl_object cl_make_string_output_stream _ECL_ARGS((cl_narg narg, ...));
713 extern ECL_API cl_object cl_get_output_stream_string(cl_object strm);
714 extern ECL_API cl_object cl_streamp(cl_object strm);
715 extern ECL_API cl_object cl_input_stream_p(cl_object strm);
716 extern ECL_API cl_object cl_output_stream_p(cl_object strm);
717 extern ECL_API cl_object cl_stream_element_type(cl_object strm);
718 extern ECL_API cl_object cl_stream_external_format(cl_object strm);
719 extern ECL_API cl_object cl_file_length(cl_object strm);
720 extern ECL_API cl_object si_get_string_input_stream_index(cl_object strm);
721 extern ECL_API cl_object si_make_string_output_stream_from_string(cl_object strng);
722 extern ECL_API cl_object si_copy_stream(cl_object in, cl_object out, cl_object wait);
723 extern ECL_API cl_object cl_open_stream_p(cl_object strm);
724 extern ECL_API cl_object cl_make_broadcast_stream _ECL_ARGS((cl_narg narg, ...));
725 extern ECL_API cl_object cl_broadcast_stream_streams(cl_object strm);
726 extern ECL_API cl_object cl_make_concatenated_stream _ECL_ARGS((cl_narg narg, ...));
727 extern ECL_API cl_object cl_concatenated_stream_streams(cl_object strm);
728 extern ECL_API cl_object cl_make_string_input_stream _ECL_ARGS((cl_narg narg, cl_object strng, ...));
729 extern ECL_API cl_object si_make_sequence_input_stream _ECL_ARGS((cl_narg narg, cl_object vector, ...));
730 extern ECL_API cl_object si_make_sequence_output_stream _ECL_ARGS((cl_narg narg, cl_object vector, ...));
731 extern ECL_API cl_object cl_close _ECL_ARGS((cl_narg narg, cl_object strm, ...));
732 extern ECL_API cl_object cl_open _ECL_ARGS((cl_narg narg, cl_object filename, ...));
733 extern ECL_API cl_object cl_file_position _ECL_ARGS((cl_narg narg, cl_object file_stream, ...));
734 extern ECL_API cl_object cl_file_string_length(cl_object stream, cl_object string);
735 extern ECL_API cl_object si_do_write_sequence(cl_object string, cl_object stream, cl_object start, cl_object end);
736 extern ECL_API cl_object si_do_read_sequence(cl_object string, cl_object stream, cl_object start, cl_object end);
737 extern ECL_API cl_object si_file_column(cl_object strm);
738 extern ECL_API cl_object cl_interactive_stream_p(cl_object strm);
739 #if defined(ECL_MS_WINDOWS_HOST)
740 extern ECL_API cl_object si_windows_codepage_encoding();
741 #endif
742 extern ECL_API cl_object si_set_buffering_mode(cl_object strm, cl_object mode);
743 extern ECL_API cl_object si_stream_external_format_set(cl_object strm, cl_object format);
744
745 extern ECL_API bool ecl_input_stream_p(cl_object strm);
746 extern ECL_API bool ecl_output_stream_p(cl_object strm);
747 extern ECL_API cl_object ecl_stream_element_type(cl_object strm);
748 extern ECL_API bool ecl_interactive_stream_p(cl_object strm);
749 extern ECL_API cl_object ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, cl_object if_does_not_exist, cl_fixnum byte_size, int flags, cl_object external_format);
750 extern ECL_API cl_object ecl_make_string_input_stream(cl_object strng, cl_index istart, cl_index iend);
751 extern ECL_API cl_object ecl_make_string_output_stream(cl_index line_length, int extended);
752 extern ECL_API cl_object ecl_read_byte(cl_object strm);
753 extern ECL_API void ecl_write_byte(cl_object byte, cl_object strm);
754 extern ECL_API void ecl_unread_byte(cl_object byte, cl_object strm);
755 extern ECL_API cl_object ecl_peek_byte(cl_object strm);
756 extern ECL_API ecl_character ecl_read_char_noeof(cl_object strm);
757 extern ECL_API ecl_character ecl_read_char(cl_object strm);
758 extern ECL_API void ecl_unread_char(ecl_character c, cl_object strm);
759 extern ECL_API ecl_character ecl_peek_char(cl_object strm);
760 extern ECL_API ecl_character ecl_write_char(ecl_character c, cl_object strm);
761 extern ECL_API void writestr_stream(const char *s, cl_object strm);
762 extern ECL_API void ecl_force_output(cl_object strm);
763 extern ECL_API void ecl_finish_output(cl_object strm);
764 extern ECL_API void ecl_clear_input(cl_object strm);
765 extern ECL_API void ecl_clear_output(cl_object strm);
766 extern ECL_API int ecl_listen_stream(cl_object strm);
767 extern ECL_API cl_object ecl_file_position(cl_object strm);
768 extern ECL_API cl_object ecl_file_position_set(cl_object strm, cl_object disp);
769 extern ECL_API cl_object ecl_file_length(cl_object strm);
770 extern ECL_API cl_object ecl_file_string_length(cl_object strm, cl_object string);
771 extern ECL_API int ecl_file_column(cl_object strm);
772 extern ECL_API cl_object ecl_stream_pathname(cl_object strm);
773 extern ECL_API cl_object ecl_stream_truename(cl_object strm);
774 extern ECL_API cl_fixnum ecl_normalize_stream_element_type(cl_object element);
775 extern ECL_API cl_object ecl_make_stream_from_FILE(cl_object fname, void *fd, enum ecl_smmode smm, cl_fixnum byte_size, int flags, cl_object external_format);
776 extern ECL_API cl_object ecl_make_stream_from_fd(cl_object fname, int fd, enum ecl_smmode smm, cl_fixnum byte_size, int flags, cl_object external_format);
777 extern ECL_API cl_object si_file_stream_fd(cl_object s);
778 extern ECL_API int ecl_stream_to_handle(cl_object s, bool output);
779
780 /* finalize.c */
781
782 extern ECL_API void ecl_set_finalizer_unprotected(cl_object o, cl_object finalizer);
783 extern ECL_API cl_object si_get_finalizer(cl_object o);
784 extern ECL_API cl_object si_set_finalizer(cl_object o, cl_object finalizer);
785
786 /* format.c */
787
788 extern ECL_API cl_object cl_format _ECL_ARGS((cl_narg narg, cl_object stream, cl_object string, ...));
789
790 /* gbc.c */
791
792 #ifdef GBC_BOEHM
793 #define GC_enabled() !GC_is_disabled()
794 #define GC_enable() GC_enable()
795 #define GC_disable() GC_disable()
796 extern ECL_API void ecl_register_root(cl_object *p);
797 extern ECL_API cl_object si_gc(cl_narg narg, ...);
798 extern ECL_API cl_object si_gc_dump(void);
799 extern ECL_API cl_object si_gc_stats(cl_object enable);
800 #else
801 # error "IMPLEMENT ME!"
802 #endif /* GBC_BOEHM */
803
804
805 /* gfun.c */
806
807 extern ECL_API void _ecl_set_method_hash_size(cl_env_ptr env, cl_index size);
808 extern ECL_API cl_object si_clear_gfun_hash(cl_object what);
809 extern ECL_API cl_object clos_set_funcallable_instance_function(cl_object x, cl_object function_or_t);
810 extern ECL_API cl_object si_generic_function_p(cl_object instance);
811
812 extern ECL_API cl_object _ecl_standard_dispatch(cl_object frame, cl_object fun);
813
814
815 /* hash.c */
816
817 extern ECL_API cl_object cl__make_hash_table(cl_object test, cl_object size, cl_object rehash_size, cl_object rehash_threshold);
818 extern ECL_API cl_object cl_hash_table_p(cl_object ht);
819 extern ECL_API cl_object si_hash_set(cl_object key, cl_object ht, cl_object val);
820 extern ECL_API cl_object cl_remhash(cl_object key, cl_object ht);
821 extern ECL_API cl_object cl_clrhash(cl_object ht);
822 extern ECL_API cl_object cl_hash_table_count(cl_object ht);
823 extern ECL_API cl_object cl_sxhash(cl_object key);
824 extern ECL_API cl_object cl_maphash(cl_object fun, cl_object ht);
825 extern ECL_API cl_object cl_hash_table_rehash_size(cl_object ht);
826 extern ECL_API cl_object cl_hash_table_rehash_threshold(cl_object ht);
827 extern ECL_API cl_object cl_hash_table_size(cl_object ht);
828 extern ECL_API cl_object cl_hash_table_test(cl_object ht);
829 extern ECL_API cl_object si_hash_table_iterator(cl_object ht);
830 extern ECL_API cl_object cl_make_hash_table _ECL_ARGS((cl_narg narg, ...));
831 extern ECL_API cl_object cl_gethash _ECL_ARGS((cl_narg narg, cl_object key, cl_object ht, ...));
832 extern ECL_API cl_object si_copy_hash_table(cl_object orig);
833 extern ECL_API cl_object si_hash_eql _ECL_ARGS((cl_narg narg, ...));
834 extern ECL_API cl_object si_hash_equal _ECL_ARGS((cl_narg narg, ...));
835 extern ECL_API cl_object si_hash_equalp _ECL_ARGS((cl_narg narg, ...));
836 extern ECL_API cl_object si_hash_table_content(cl_object ht);
837 extern ECL_API cl_object si_hash_table_fill(cl_object ht, cl_object values);
838 extern ECL_API cl_object si_hash_table_weakness(cl_object ht);
839 extern ECL_API cl_object si_hash_table_synchronized_p(cl_object ht);
840
841 extern ECL_API cl_object ecl_sethash(cl_object key, cl_object hashtable, cl_object value);
842 extern ECL_API cl_object ecl_gethash(cl_object key, cl_object hash);
843 extern ECL_API cl_object ecl_gethash_safe(cl_object key, cl_object hash, cl_object def);
844 extern ECL_API bool ecl_remhash(cl_object key, cl_object hash);
845 extern ECL_API cl_object _ecl_sethash(cl_object key, cl_object hashtable, cl_object value);
846 extern ECL_API cl_index ecl_hash_table_count(cl_object hash);
847
848 /* instance.c */
849
850 extern ECL_API cl_object si_allocate_raw_instance(cl_object orig, cl_object clas, cl_object size);
851 extern ECL_API cl_object si_instance_class(cl_object x);
852 extern ECL_API cl_object si_instance_class_set(cl_object x, cl_object y);
853 extern ECL_API cl_object si_instance_ref(cl_object x, cl_object index);
854 extern ECL_API cl_object clos_safe_instance_ref(cl_object x, cl_object index);
855 extern ECL_API cl_object si_instance_set(cl_object x, cl_object index, cl_object value);
856 extern ECL_API cl_object si_instancep(cl_object x);
857 extern ECL_API cl_object si_unbound(void);
858 extern ECL_API cl_object si_sl_boundp(cl_object x);
859 extern ECL_API cl_object si_sl_makunbound(cl_object x, cl_object index);
860 extern ECL_API cl_object si_instance_obsolete_p(cl_object x);
861 extern ECL_API cl_object si_instance_new_stamp(cl_object x);
862 extern ECL_API cl_object si_instance_get_stamp(cl_object x);
863 extern ECL_API cl_object si_instance_slotds(cl_object x);
864 extern ECL_API cl_object si_instance_sig_set(cl_object x);
865
866 extern ECL_API cl_object ecl_allocate_instance(cl_object clas, cl_index size);
867 extern ECL_API cl_object ecl_instance_ref(cl_object x, cl_fixnum i);
868 extern ECL_API cl_object ecl_instance_set(cl_object x, cl_fixnum i, cl_object v);
869 extern ECL_API cl_object si_copy_instance(cl_object x);
870
871 extern ECL_API cl_object ecl_slot_value(cl_object x, const char *slot);
872 extern ECL_API cl_object ecl_slot_value_set(cl_object x, const char *slot, cl_object y);
873
874 #ifdef ECL_THREADS
875 extern ECL_API cl_object ecl_compare_and_swap_instance(cl_object x, cl_fixnum i, cl_object old_val, cl_object new_val);
876 extern ECL_API cl_object mp_compare_and_swap_instance(cl_object x, cl_object index, cl_object old_val, cl_object new_val);
877 extern ECL_API cl_object ecl_atomic_incf_instance(cl_object x, cl_fixnum i, cl_object increment);
878 extern ECL_API cl_object mp_atomic_incf_instance(cl_object x, cl_object index, cl_object increment);
879 #endif
880
881 /* list.c */
882
883 #define cl_rest cl_cdr
884 #define cl_first cl_car
885 #define cl_second cl_cadr
886 #define cl_third cl_caddr
887 #define cl_fourth cl_cadddr
888
889 extern ECL_API cl_object cl_fifth(cl_object x);
890 extern ECL_API cl_object cl_sixth(cl_object x);
891 extern ECL_API cl_object cl_seventh(cl_object x);
892 extern ECL_API cl_object cl_eighth(cl_object x);
893 extern ECL_API cl_object cl_ninth(cl_object x);
894 extern ECL_API cl_object cl_tenth(cl_object x);
895 extern ECL_API cl_object cl_endp(cl_object x);
896 extern ECL_API cl_object cl_list_length(cl_object x);
897 extern ECL_API cl_object cl_nth(cl_object n, cl_object x);
898 extern ECL_API cl_object cl_nthcdr(cl_object n, cl_object x);
899 extern ECL_API cl_object cl_copy_list(cl_object x);
900 extern ECL_API cl_object cl_copy_alist(cl_object x);
901 extern ECL_API cl_object cl_copy_tree(cl_object x);
902 extern ECL_API cl_object cl_revappend(cl_object x, cl_object y);
903 extern ECL_API cl_object cl_ldiff(cl_object x, cl_object y);
904 extern ECL_API cl_object cl_rplaca(cl_object x, cl_object v);
905 extern ECL_API cl_object cl_rplacd(cl_object x, cl_object v);
906 extern ECL_API cl_object cl_tailp(cl_object y, cl_object x);
907 extern ECL_API cl_object si_memq(cl_object x, cl_object l);
908 extern ECL_API cl_object cl_nreconc(cl_object x, cl_object y);
909 extern ECL_API cl_object cl_cons(cl_object x, cl_object y);
910 extern ECL_API cl_object cl_acons(cl_object x, cl_object y, cl_object z);
911 extern ECL_API cl_object cl_list _ECL_ARGS((cl_narg narg, ...));
912 extern ECL_API cl_object cl_listX _ECL_ARGS((cl_narg narg, ...));
913 extern ECL_API cl_object cl_append _ECL_ARGS((cl_narg narg, ...));
914 extern ECL_API cl_object cl_tree_equal _ECL_ARGS((cl_narg narg, cl_object x, cl_object y, ...));
915 extern ECL_API cl_object cl_last _ECL_ARGS((cl_narg narg, cl_object x, ...));
916 extern ECL_API cl_object cl_make_list _ECL_ARGS((cl_narg narg, cl_object size, ...));
917 extern ECL_API cl_object cl_nconc _ECL_ARGS((cl_narg narg, ...));
918 extern ECL_API cl_object cl_butlast _ECL_ARGS((cl_narg narg, cl_object lis, ...));
919 extern ECL_API cl_object cl_nbutlast _ECL_ARGS((cl_narg narg, cl_object lis, ...));
920 extern ECL_API cl_object cl_subst _ECL_ARGS((cl_narg narg, cl_object new_obj, cl_object old_obj, cl_object tree, ...));
921 extern ECL_API cl_object cl_nsubst _ECL_ARGS((cl_narg narg, cl_object new_obj, cl_object old_obj, cl_object tree, ...));
922 extern ECL_API cl_object cl_sublis _ECL_ARGS((cl_narg narg, cl_object alist, cl_object tree, ...));
923 extern ECL_API cl_object cl_nsublis _ECL_ARGS((cl_narg narg, cl_object alist, cl_object tree, ...));
924 extern ECL_API cl_object cl_member _ECL_ARGS((cl_narg narg, cl_object item, cl_object list, ...));
925 extern ECL_API cl_object si_member1 (cl_object item, cl_object list, cl_object test, cl_object test_not, cl_object key);
926 extern ECL_API cl_object cl_adjoin _ECL_ARGS((cl_narg narg, cl_object item, cl_object list, ...));
927 extern ECL_API cl_object cl_pairlis _ECL_ARGS((cl_narg narg, cl_object keys, cl_object data, ...));
928 extern ECL_API cl_object cl_rassoc _ECL_ARGS((cl_narg narg, cl_object item, cl_object alist, ...));
929 extern ECL_API cl_object cl_assoc _ECL_ARGS((cl_narg narg, cl_object item, cl_object alist, ...));
930 extern ECL_API cl_object si_proper_list_p(cl_object V1);
931
932 extern ECL_API cl_object ecl_last(cl_object x, cl_index n);
933 extern ECL_API cl_object ecl_butlast(cl_object x, cl_index n);
934 extern ECL_API cl_object ecl_nbutlast(cl_object x, cl_index n);
935 extern ECL_API cl_object ecl_append(cl_object x, cl_object y);
936 extern ECL_API bool ecl_endp(cl_object x);
937 extern ECL_API cl_object ecl_nth(cl_fixnum n, cl_object x);
938 extern ECL_API cl_object ecl_nthcdr(cl_fixnum n, cl_object x);
939 extern ECL_API cl_object ecl_nconc(cl_object x, cl_object y);
940 extern ECL_API bool ecl_member_eq(cl_object x, cl_object l);
941 extern ECL_API cl_object ecl_memql(cl_object x, cl_object l);
942 extern ECL_API cl_object ecl_member(cl_object x, cl_object l);
943 extern ECL_API cl_object ecl_assq(cl_object x, cl_object l);
944 extern ECL_API cl_object ecl_assql(cl_object x, cl_object l);
945 extern ECL_API cl_object ecl_assoc(cl_object x, cl_object l);
946 extern ECL_API cl_object ecl_assqlp(cl_object x, cl_object l);
947 extern ECL_API cl_object ecl_remove_eq(cl_object x, cl_object l);
948 extern ECL_API cl_object ecl_delete_eq(cl_object x, cl_object l);
949 #define si_cons_car cl_car
950 #define si_cons_cdr cl_cdr
951
952 #ifdef ECL_THREADS
953 extern ECL_API cl_object mp_compare_and_swap_car(cl_object x, cl_object old_val, cl_object new_val);
954 extern ECL_API cl_object mp_atomic_incf_car(cl_object x, cl_object increment);
955 extern ECL_API cl_object mp_compare_and_swap_cdr(cl_object x, cl_object old_val, cl_object new_val);
956 extern ECL_API cl_object mp_atomic_incf_cdr(cl_object x, cl_object increment);
957 #endif
958
959 /* load.c */
960
961 extern ECL_API cl_object si_load_bytecodes(cl_object file, cl_object verbose, cl_object print, cl_object format);
962 extern ECL_API cl_object si_load_source(cl_object file, cl_object verbose, cl_object print, cl_object format);
963 extern ECL_API cl_object si_load_binary(cl_object file, cl_object verbose, cl_object print, cl_object format);
964 extern ECL_API cl_object cl_load _ECL_ARGS((cl_narg narg, cl_object pathname, ...));
965
966 /* macros.c */
967
968 extern ECL_API cl_object cl_macroexpand _ECL_ARGS((cl_narg narg, cl_object form, ...));
969 extern ECL_API cl_object cl_macroexpand_1 _ECL_ARGS((cl_narg narg, cl_object form, ...));
970 extern ECL_API cl_object cl_macro_function _ECL_ARGS((cl_narg narg, cl_object sym, ...));
971
972
973 /* main.c */
974
975 extern ECL_API cl_object si_argc(void);
976 extern ECL_API cl_object si_argv(cl_object index);
977 extern ECL_API cl_object si_getenv(cl_object var);
978 extern ECL_API cl_object si_setenv(cl_object var, cl_object value);
979 extern ECL_API cl_object si_environ(void);
980 extern ECL_API cl_object si_pointer(cl_object x);
981 extern ECL_API cl_object si_quit _ECL_ARGS((cl_narg narg, ...)) /*ecl_attr_noreturn*/;
982 extern ECL_API cl_object si_exit _ECL_ARGS((cl_narg narg, ...)) ecl_attr_noreturn;
983
984 typedef enum {
985 ECL_OPT_INCREMENTAL_GC = 0,
986 ECL_OPT_TRAP_SIGSEGV,
987 ECL_OPT_TRAP_SIGFPE,
988 ECL_OPT_TRAP_SIGINT,
989 ECL_OPT_TRAP_SIGILL,
990 ECL_OPT_TRAP_SIGBUS,
991 ECL_OPT_TRAP_SIGPIPE,
992 ECL_OPT_TRAP_INTERRUPT_SIGNAL,
993 ECL_OPT_SIGNAL_HANDLING_THREAD,
994 ECL_OPT_SIGNAL_QUEUE_SIZE,
995 ECL_OPT_BOOTED,
996 ECL_OPT_BIND_STACK_SIZE,
997 ECL_OPT_BIND_STACK_SAFETY_AREA,
998 ECL_OPT_FRAME_STACK_SIZE,
999 ECL_OPT_FRAME_STACK_SAFETY_AREA,
1000 ECL_OPT_LISP_STACK_SIZE,
1001 ECL_OPT_LISP_STACK_SAFETY_AREA,
1002 ECL_OPT_C_STACK_SIZE,
1003 ECL_OPT_C_STACK_SAFETY_AREA,
1004 ECL_OPT_HEAP_SIZE,
1005 ECL_OPT_HEAP_SAFETY_AREA,
1006 ECL_OPT_THREAD_INTERRUPT_SIGNAL,
1007 ECL_OPT_SET_GMP_MEMORY_FUNCTIONS,
1008 ECL_OPT_USE_SETMODE_ON_FILES,
1009 ECL_OPT_LIMIT
1010 } ecl_option;
1011
1012 extern ECL_API const char *ecl_self;
1013 extern ECL_API void ecl_set_option(int option, cl_fixnum value);
1014 extern ECL_API cl_fixnum ecl_get_option(int option);
1015 extern ECL_API int cl_boot(int argc, char **argv);
1016 extern ECL_API void cl_shutdown(void);
1017 #if defined(ECL_MS_WINDOWS_HOST)
1018 extern ECL_API void ecl_get_commandline_args(int* argc, char*** argv);
1019 #endif
1020
1021
1022 /* mapfun.c */
1023
1024 extern ECL_API cl_object cl_mapcar _ECL_ARGS((cl_narg narg, cl_object fun, ...));
1025 extern ECL_API cl_object cl_maplist _ECL_ARGS((cl_narg narg, cl_object fun, ...));
1026 extern ECL_API cl_object cl_mapc _ECL_ARGS((cl_narg narg, cl_object fun, ...));
1027 extern ECL_API cl_object cl_mapl _ECL_ARGS((cl_narg narg, cl_object fun, ...));
1028 extern ECL_API cl_object cl_mapcan _ECL_ARGS((cl_narg narg, cl_object fun, ...));
1029 extern ECL_API cl_object cl_mapcon _ECL_ARGS((cl_narg narg, cl_object fun, ...));
1030
1031
1032 /* multival.c */
1033
1034 extern ECL_API cl_object cl_values_list(cl_object list);
1035 extern ECL_API cl_object cl_values _ECL_ARGS((cl_narg narg, ...));
1036
1037
1038 /* num_arith.c */
1039
1040 extern ECL_API cl_object cl_conjugate(cl_object c);
1041 extern ECL_API cl_object cl_1P(cl_object x);
1042 extern ECL_API cl_object cl_1M(cl_object x);
1043 extern ECL_API cl_object cl_X _ECL_ARGS((cl_narg narg, ...));
1044 extern ECL_API cl_object cl_P _ECL_ARGS((cl_narg narg, ...));
1045 extern ECL_API cl_object cl_M _ECL_ARGS((cl_narg narg, cl_object num, ...));
1046 extern ECL_API cl_object cl_N _ECL_ARGS((cl_narg narg, cl_object num, ...));
1047 extern ECL_API cl_object cl_gcd _ECL_ARGS((cl_narg narg, ...));
1048 extern ECL_API cl_object cl_lcm _ECL_ARGS((cl_narg narg, ...));
1049
1050 extern ECL_API cl_object ecl_times(cl_object x, cl_object y);
1051 extern ECL_API cl_object number_to_complex(cl_object x);
1052 extern ECL_API cl_object ecl_plus(cl_object x, cl_object y);
1053 extern ECL_API cl_object ecl_minus(cl_object x, cl_object y);
1054 extern ECL_API cl_object ecl_negate(cl_object x);
1055 extern ECL_API cl_object ecl_divide(cl_object x, cl_object y);
1056 extern ECL_API cl_object ecl_integer_divide(cl_object x, cl_object y);
1057 extern ECL_API cl_object ecl_gcd(cl_object x, cl_object y);
1058 extern ECL_API cl_object ecl_one_plus(cl_object x);
1059 extern ECL_API cl_object ecl_one_minus(cl_object x);
1060 extern ECL_API cl_object ecl_conjugate(cl_object x);
1061
1062
1063 /* number.c */
1064
1065 extern ECL_API cl_fixnum fixint(cl_object x);
1066 extern ECL_API cl_index fixnnint(cl_object x);
1067 extern ECL_API cl_object ecl_make_integer(cl_fixnum i);
1068 extern ECL_API cl_object ecl_make_unsigned_integer(cl_index i);
1069 extern ECL_API int ecl_to_bit(cl_object o);
1070 extern ECL_API ecl_uint8_t ecl_to_uint8_t(cl_object o);
1071 extern ECL_API ecl_int8_t ecl_to_int8_t(cl_object o);
1072 #define ecl_make_uint8_t(i) ecl_make_fixnum(i)
1073 #define ecl_make_int8_t(i) ecl_make_fixnum(i)
1074 #if ECL_FIXNUM_BITS < 32
1075 # error "Unsupported platforms with ECL_FIXNUM_BITS < 32"
1076 #endif
1077 #ifdef ecl_uint16_t
1078 extern ECL_API ecl_uint16_t ecl_to_uint16_t(cl_object o);
1079 extern ECL_API ecl_int16_t ecl_to_int16_t(cl_object o);
1080 # define ecl_make_uint16_t(i) ecl_make_fixnum(i)
1081 # define ecl_make_int16_t(i) ecl_make_fixnum(i)
1082 #endif /* ecl_uint16_t */
1083 extern ECL_API unsigned short ecl_to_ushort(cl_object o);
1084 extern ECL_API short ecl_to_short(cl_object o);
1085 #define ecl_make_short(n) ecl_make_fixnum(n)
1086 #define ecl_make_ushort(n) ecl_make_fixnum(n)
1087 #ifdef ecl_uint32_t
1088 # if ECL_FIXNUM_BITS == 32
1089 # define ecl_to_uint32_t fixnnint
1090 # define ecl_to_int32_t fixint
1091 # define ecl_make_uint32_t ecl_make_unsigned_integer
1092 # define ecl_make_int32_t ecl_make_integer
1093 # else
1094 # define ecl_make_uint32_t(i) ecl_make_fixnum(i)
1095 # define ecl_make_int32_t(i) ecl_make_fixnum(i)
1096 extern ECL_API ecl_uint32_t ecl_to_uint32_t(cl_object o);
1097 extern ECL_API ecl_int32_t ecl_to_int32_t(cl_object o);
1098 # endif
1099 #endif /* ecl_uint32_t */
1100 #ifdef ecl_uint64_t
1101 # if ECL_FIXNUM_BITS >= 64
1102 # define ecl_to_uint64_t fixnnint
1103 # define ecl_to_int64_t fixint
1104 # define ecl_make_uint64_t ecl_make_unsigned_integer
1105 # define ecl_make_int64_t ecl_make_integer
1106 # else
1107 extern ECL_API ecl_uint64_t ecl_to_uint64_t(cl_object p);
1108 extern ECL_API ecl_int64_t ecl_to_int64_t(cl_object p);
1109 extern ECL_API cl_object ecl_make_uint64_t(ecl_uint64_t i);
1110 extern ECL_API cl_object ecl_make_int64_t(ecl_int64_t i);
1111 # endif
1112 #endif /* ecl_uint64_t */
1113 #if ECL_INT_BITS == 32
1114 # define ecl_to_uint ecl_to_uint32_t
1115 # define ecl_to_int ecl_to_int32_t
1116 # define ecl_make_uint ecl_make_uint32_t
1117 # define ecl_make_int ecl_make_int32_t
1118 #else
1119 # if ECL_INT_BITS == 64
1120 # define ecl_to_uint ecl_to_uint64_t
1121 # define ecl_to_int ecl_to_int64_t
1122 # define ecl_make_uint ecl_make_uint64_t
1123 # define ecl_make_int ecl_make_int64_t
1124 # else
1125 # error "Currently ECL expects 'int' type to have 32 or 64 bits"
1126 # endif
1127 #endif
1128 #if ECL_LONG_BITS == 32
1129 # define ecl_to_ulong ecl_to_uint32_t
1130 # define ecl_to_long ecl_to_int32_t
1131 # define ecl_make_ulong ecl_make_uint32_t
1132 # define ecl_make_long ecl_make_int32_t
1133 #else
1134 # if ECL_LONG_BITS == 64
1135 # define ecl_to_ulong ecl_to_uint64_t
1136 # define ecl_to_long ecl_to_int64_t
1137 # define ecl_make_ulong ecl_make_uint64_t
1138 # define ecl_make_long ecl_make_int64_t
1139 # else
1140 # error "Currently ECL expects 'long' type to have 32 or 64 bits"
1141 # endif
1142 #endif
1143 #ifdef ecl_long_long_t
1144 extern ECL_API ecl_ulong_long_t ecl_to_ulong_long(cl_object p);
1145 extern ECL_API ecl_long_long_t ecl_to_long_long(cl_object p);
1146 extern ECL_API cl_object ecl_make_ulong_long(ecl_ulong_long_t i);
1147 extern ECL_API cl_object ecl_make_long_long(ecl_long_long_t i);
1148 #endif /* ecl_long_long_t */
1149
1150 extern ECL_API cl_object ecl_make_ratio(cl_object num, cl_object den);
1151 extern ECL_API cl_object ecl_make_single_float(float f);
1152 extern ECL_API cl_object ecl_make_double_float(double f);
1153 extern ECL_API cl_object ecl_make_complex(cl_object r, cl_object i);
1154 extern ECL_API cl_object cl_rational(cl_object x);
1155 #define cl_rationalize cl_rational
1156 extern ECL_API float ecl_to_float(cl_object x);
1157 extern ECL_API double ecl_to_double(cl_object x);
1158 extern ECL_API long double ecl_to_long_double(cl_object x);
1159 extern ECL_API cl_object ecl_make_long_float(long double f);
1160 #ifdef ECL_COMPLEX_FLOAT
1161 extern ECL_API cl_object ecl_make_csfloat(float _Complex x);
1162 extern ECL_API cl_object ecl_make_cdfloat(double _Complex x);
1163 extern ECL_API cl_object ecl_make_clfloat(long double _Complex x);
1164 extern ECL_API cl_object si_complex_float_p(cl_object o);
1165 extern ECL_API cl_object si_complex_float(cl_object r, cl_object i);
1166 extern ECL_API float _Complex ecl_to_csfloat(cl_object x);
1167 extern ECL_API double _Complex ecl_to_cdfloat(cl_object x);
1168 extern ECL_API long double _Complex ecl_to_clfloat(cl_object x);
1169 #endif
1170 #ifdef ECL_IEEE_FP
1171 extern ECL_API cl_object si_nan();
1172 #endif /* ECL_IEEE_FP */
1173
1174 /* num_co.c */
1175
1176 extern ECL_API cl_object cl_numerator(cl_object x);
1177 extern ECL_API cl_object cl_denominator(cl_object x);
1178 extern ECL_API cl_object cl_mod(cl_object x, cl_object y);
1179 extern ECL_API cl_object cl_rem(cl_object x, cl_object y);
1180 extern ECL_API cl_object cl_decode_float(cl_object x);
1181 extern ECL_API cl_object cl_scale_float(cl_object x, cl_object y);
1182 extern ECL_API cl_object cl_float_radix(cl_object x);
1183 extern ECL_API cl_object cl_float_digits(cl_object x);
1184 extern ECL_API cl_object cl_float_precision(cl_object x);
1185 extern ECL_API cl_object cl_integer_decode_float(cl_object x);
1186 extern ECL_API cl_object cl_realpart(cl_object x);
1187 extern ECL_API cl_object cl_imagpart(cl_object x);
1188 extern ECL_API cl_object cl_float _ECL_ARGS((cl_narg narg, cl_object x, ...));
1189 extern ECL_API cl_object cl_floor _ECL_ARGS((cl_narg narg, cl_object x, ...));
1190 extern ECL_API cl_object cl_ceiling _ECL_ARGS((cl_narg narg, cl_object x, ...));
1191 extern ECL_API cl_object cl_truncate _ECL_ARGS((cl_narg narg, cl_object x, ...));
1192 extern ECL_API cl_object cl_round _ECL_ARGS((cl_narg narg, cl_object x, ...));
1193 extern ECL_API cl_object cl_float_sign _ECL_ARGS((cl_narg narg, cl_object x, ...));
1194 extern ECL_API cl_object cl_complex _ECL_ARGS((cl_narg narg, cl_object r, ...));
1195
1196 extern ECL_API cl_object ecl_floor1(cl_object x);
1197 extern ECL_API cl_object ecl_ceiling1(cl_object x);
1198 extern ECL_API cl_object ecl_truncate1(cl_object x);
1199 extern ECL_API cl_object ecl_round1(cl_object x);
1200 extern ECL_API int ecl_signbit(cl_object x);
1201 extern ECL_API cl_object ecl_floor2(cl_object x, cl_object y);
1202 extern ECL_API cl_object ecl_ceiling2(cl_object x, cl_object y);
1203 extern ECL_API cl_object ecl_truncate2(cl_object x, cl_object y);
1204 extern ECL_API cl_object ecl_round2(cl_object x, cl_object y);
1205
1206 extern ECL_API uint32_t ecl_float_bits(float num);
1207 extern ECL_API float ecl_bits_float(uint32_t num);
1208 extern ECL_API uint64_t ecl_double_bits(double num);
1209 extern ECL_API double ecl_bits_double(uint64_t num);
1210
1211 /* num_comp.c */
1212
1213 extern ECL_API cl_object cl_E _ECL_ARGS((cl_narg narg, cl_object num, ...));
1214 extern ECL_API cl_object cl_NE _ECL_ARGS((cl_narg narg, ...));
1215 extern ECL_API cl_object cl_L _ECL_ARGS((cl_narg narg, ...));
1216 extern ECL_API cl_object cl_G _ECL_ARGS((cl_narg narg, ...));
1217 extern ECL_API cl_object cl_GE _ECL_ARGS((cl_narg narg, ...));
1218 extern ECL_API cl_object cl_LE _ECL_ARGS((cl_narg narg, ...));
1219 extern ECL_API cl_object cl_max _ECL_ARGS((cl_narg narg, cl_object max, ...));
1220 extern ECL_API cl_object cl_min _ECL_ARGS((cl_narg narg, cl_object min, ...));
1221
1222 extern ECL_API int ecl_number_equalp(cl_object x, cl_object y);
1223 extern ECL_API int ecl_number_compare(cl_object x, cl_object y);
1224 #ifdef ECL_IEEE_FP
1225 #define ecl_lowereq(x,y) (!ecl_float_nan_p(x) && !ecl_float_nan_p(y) && ecl_number_compare((x),(y)) <= 0)
1226 #define ecl_greatereq(x,y) (!ecl_float_nan_p(x) && !ecl_float_nan_p(y) && ecl_number_compare((x),(y)) >= 0)
1227 #define ecl_lower(x,y) (!ecl_float_nan_p(x) && !ecl_float_nan_p(y) && ecl_number_compare((x),(y)) < 0)
1228 #define ecl_greater(x,y) (!ecl_float_nan_p(x) && !ecl_float_nan_p(y) && ecl_number_compare((x),(y)) > 0)
1229 #else
1230 #define ecl_lowereq(x,y) (ecl_number_compare((x),(y)) <= 0)
1231 #define ecl_greatereq(x,y) (ecl_number_compare((x),(y)) >= 0)
1232 #define ecl_lower(x,y) (ecl_number_compare((x),(y)) < 0)
1233 #define ecl_greater(x,y) (ecl_number_compare((x),(y)) > 0)
1234 #endif
1235
1236 /* num_log.c */
1237
1238 #define ECL_BOOLCLR 0
1239 #define ECL_BOOLAND 01
1240 #define ECL_BOOLANDC2 02
1241 #define ECL_BOOL1 03
1242 #define ECL_BOOLANDC1 04
1243 #define ECL_BOOL2 05
1244 #define ECL_BOOLXOR 06
1245 #define ECL_BOOLIOR 07
1246 #define ECL_BOOLNOR 010
1247 #define ECL_BOOLEQV 011
1248 #define ECL_BOOLC2 012
1249 #define ECL_BOOLORC2 013
1250 #define ECL_BOOLC1 014
1251 #define ECL_BOOLORC1 015
1252 #define ECL_BOOLNAND 016
1253 #define ECL_BOOLSET 017
1254
1255 extern ECL_API cl_object cl_lognand(cl_object x, cl_object y);
1256 extern ECL_API cl_object cl_lognor(cl_object x, cl_object y);
1257 extern ECL_API cl_object cl_logandc1(cl_object x, cl_object y);
1258 extern ECL_API cl_object cl_logandc2(cl_object x, cl_object y);
1259 extern ECL_API cl_object cl_logorc1(cl_object x, cl_object y);
1260 extern ECL_API cl_object cl_logorc2(cl_object x, cl_object y);
1261 extern ECL_API cl_object cl_lognot(cl_object x);
1262 extern ECL_API cl_object cl_boole(cl_object o, cl_object x, cl_object y);
1263 extern ECL_API cl_object cl_logbitp(cl_object p, cl_object x);
1264 extern ECL_API cl_object cl_ash(cl_object x, cl_object y);
1265 extern ECL_API cl_object cl_logcount(cl_object x);
1266 extern ECL_API cl_object cl_integer_length(cl_object x);
1267 extern ECL_API cl_object si_bit_array_op(cl_object o, cl_object x, cl_object y, cl_object r);
1268 extern ECL_API cl_object cl_logior _ECL_ARGS((cl_narg narg, ...));
1269 extern ECL_API cl_object cl_logxor _ECL_ARGS((cl_narg narg, ...));
1270 extern ECL_API cl_object cl_logand _ECL_ARGS((cl_narg narg, ...));
1271 extern ECL_API cl_object cl_logeqv _ECL_ARGS((cl_narg narg, ...));
1272
1273 extern ECL_API cl_fixnum ecl_logand_index(cl_object n, cl_index i);
1274 extern ECL_API cl_object ecl_boole(int op, cl_object x, cl_object y);
1275 extern ECL_API cl_object ecl_ash(cl_object x, cl_fixnum w);
1276 extern ECL_API int ecl_fixnum_bit_length(cl_fixnum l);
1277 extern ECL_API cl_index ecl_integer_length(cl_object i);
1278
1279 /* num_pred.c */
1280
1281 extern ECL_API cl_object cl_zerop(cl_object x);
1282 extern ECL_API cl_object cl_plusp(cl_object x);
1283 extern ECL_API cl_object cl_minusp(cl_object x);
1284 extern ECL_API cl_object cl_oddp(cl_object x);
1285 extern ECL_API cl_object cl_evenp(cl_object x);
1286 extern ECL_API cl_object si_float_nan_p(cl_object x);
1287 extern ECL_API cl_object si_float_infinity_p(cl_object x);
1288
1289 extern ECL_API int ecl_zerop(cl_object x);
1290 extern ECL_API int ecl_plusp(cl_object x);
1291 extern ECL_API int ecl_minusp(cl_object x);
1292 extern ECL_API int ecl_oddp(cl_object x);
1293 extern ECL_API int ecl_evenp(cl_object x);
1294 extern ECL_API bool ecl_float_nan_p(cl_object x);
1295 extern ECL_API bool ecl_float_infinity_p(cl_object x);
1296
1297
1298 /* num_rand.c */
1299
1300 extern ECL_API cl_object cl_random_state_p(cl_object x);
1301 extern ECL_API cl_object cl_random _ECL_ARGS((cl_narg narg, cl_object x, ...));
1302 extern ECL_API cl_object cl_make_random_state _ECL_ARGS((cl_narg narg, ...));
1303 extern ECL_API cl_object ecl_make_random_state(cl_object rs);
1304 extern ECL_API cl_object si_random_state_array(cl_object rs);
1305
1306 /* num_sfun.c */
1307
1308 extern ECL_API cl_fixnum ecl_fixnum_expt(cl_fixnum x, cl_fixnum y);
1309 extern ECL_API cl_object cl_abs(cl_object x);
1310 extern ECL_API cl_object cl_exp(cl_object x);
1311 extern ECL_API cl_object cl_expt(cl_object x, cl_object y);
1312 extern ECL_API cl_object cl_sqrt(cl_object x);
1313 extern ECL_API cl_object cl_sin(cl_object x);
1314 extern ECL_API cl_object cl_cos(cl_object x);
1315 extern ECL_API cl_object cl_tan(cl_object x);
1316 extern ECL_API cl_object cl_sinh(cl_object x);
1317 extern ECL_API cl_object cl_cosh(cl_object x);
1318 extern ECL_API cl_object cl_tanh(cl_object x);
1319 extern ECL_API cl_object cl_atan _ECL_ARGS((cl_narg narg, cl_object x, ...));
1320 extern ECL_API cl_object cl_log _ECL_ARGS((cl_narg narg, cl_object x, ...));
1321 extern ECL_API cl_object si_log1p(cl_object x);
1322
1323 extern ECL_API cl_object ecl_log1p(cl_object x);
1324 extern ECL_API cl_object ecl_log1(cl_object x);
1325 extern ECL_API cl_object ecl_log2(cl_object x, cl_object y);
1326 extern ECL_API cl_object ecl_atan2(cl_object y, cl_object x);
1327 extern ECL_API cl_object ecl_atan1(cl_object y);
1328
1329 extern ECL_API cl_object ecl_abs(cl_object x);
1330 extern ECL_API cl_object ecl_exp(cl_object x);
1331 extern ECL_API cl_object ecl_expt(cl_object x, cl_object y);
1332 extern ECL_API cl_object ecl_sqrt(cl_object x);
1333 extern ECL_API cl_object ecl_sin(cl_object x);
1334 extern ECL_API cl_object ecl_cos(cl_object x);
1335 extern ECL_API cl_object ecl_tan(cl_object x);
1336 extern ECL_API cl_object ecl_sinh(cl_object x);
1337 extern ECL_API cl_object ecl_cosh(cl_object x);
1338 extern ECL_API cl_object ecl_tanh(cl_object x);
1339
1340 /* package.c */
1341
1342 extern ECL_API void CEpackage_error(const char *message, const char *continue_message, cl_object package, int narg, ...);
1343 extern ECL_API cl_object si_select_package(cl_object pack_name);
1344 extern ECL_API cl_object cl_find_package(cl_object p);
1345 extern ECL_API cl_object cl_package_name(cl_object p);
1346 extern ECL_API cl_object cl_package_nicknames(cl_object p);
1347 extern ECL_API cl_object cl_package_use_list(cl_object p);
1348 extern ECL_API cl_object cl_package_used_by_list(cl_object p);
1349 extern ECL_API cl_object cl_package_shadowing_symbols(cl_object p);
1350 extern ECL_API cl_object si_package_local_nicknames(cl_object p);
1351 extern ECL_API cl_object si_package_locally_nicknamed_by_list(cl_object p);
1352 extern ECL_API cl_object si_add_package_local_nickname(cl_object n, cl_object p1, cl_object p2);
1353 extern ECL_API cl_object si_remove_package_local_nickname(cl_object n, cl_object p);
1354 extern ECL_API cl_object cl_list_all_packages(void);
1355 extern ECL_API cl_object si_package_hash_tables(cl_object p);
1356 extern ECL_API cl_object si_package_lock(cl_object p, cl_object t);
1357 extern ECL_API cl_object si_package_locked_p(cl_object p);
1358 extern ECL_API cl_object cl_delete_package(cl_object p);
1359 extern ECL_API cl_object cl_make_package _ECL_ARGS((cl_narg narg, cl_object pack_name, ...));
1360 extern ECL_API cl_object cl_intern _ECL_ARGS((cl_narg narg, cl_object strng, ...));
1361 extern ECL_API cl_object cl_find_symbol _ECL_ARGS((cl_narg narg, cl_object strng, ...));
1362 extern ECL_API cl_object cl_unintern _ECL_ARGS((cl_narg narg, cl_object symbl, ...));
1363 extern ECL_API cl_object cl_export _ECL_ARGS((cl_narg narg, cl_object symbols, ...));
1364 extern ECL_API cl_object cl_unexport _ECL_ARGS((cl_narg narg, cl_object symbols, ...));
1365 extern ECL_API cl_object cl_import _ECL_ARGS((cl_narg narg, cl_object symbols, ...));
1366 extern ECL_API cl_object cl_rename_package _ECL_ARGS((cl_narg narg, cl_object pack, cl_object new_name, ...));
1367 extern ECL_API cl_object cl_shadowing_import _ECL_ARGS((cl_narg narg, cl_object symbols, ...));
1368 extern ECL_API cl_object cl_shadow _ECL_ARGS((cl_narg narg, cl_object symbols, ...));
1369 extern ECL_API cl_object cl_use_package _ECL_ARGS((cl_narg narg, cl_object pack, ...));
1370 extern ECL_API cl_object cl_unuse_package _ECL_ARGS((cl_narg narg, cl_object pack, ...));
1371
1372 extern ECL_API cl_object ecl_make_package(cl_object n, cl_object ns, cl_object ul, cl_object lns);
1373 extern ECL_API cl_object ecl_rename_package(cl_object x, cl_object n, cl_object ns);
1374 extern ECL_API cl_object ecl_find_package_nolock(cl_object n);
1375 extern ECL_API cl_object ecl_find_package(const char *p);
1376 extern ECL_API cl_object si_coerce_to_package(cl_object p);
1377 extern ECL_API cl_object ecl_current_package(void);
1378 extern ECL_API cl_object ecl_find_symbol(cl_object n, cl_object p, int *intern_flag);
1379 extern ECL_API cl_object ecl_intern(cl_object name, cl_object p, int *intern_flag);
1380 extern ECL_API cl_object _ecl_intern(const char *s, cl_object p);
1381 extern ECL_API bool ecl_unintern(cl_object s, cl_object p);
1382 extern ECL_API void cl_export2(cl_object s, cl_object p);
1383 extern ECL_API void cl_unexport2(cl_object s, cl_object p);
1384 extern ECL_API void cl_import2(cl_object s, cl_object p);
1385 extern ECL_API void ecl_shadowing_import(cl_object s, cl_object p);
1386 extern ECL_API void ecl_shadow(cl_object s, cl_object p);
1387 extern ECL_API void ecl_use_package(cl_object x0, cl_object p);
1388 extern ECL_API void ecl_unuse_package(cl_object x0, cl_object p);
1389
1390
1391 /* pathname.c */
1392
1393 extern ECL_API bool ecl_string_match(cl_object s, cl_index j, cl_index ls, cl_object p, cl_index i, cl_index lp);
1394
1395 extern ECL_API cl_object cl_pathname(cl_object name);
1396 extern ECL_API cl_object cl_logical_pathname(cl_object pname);
1397 extern ECL_API cl_object cl_pathnamep(cl_object pname);
1398 extern ECL_API cl_object cl_pathname_host _ECL_ARGS((cl_narg narg, cl_object pname, ...));
1399 extern ECL_API cl_object cl_pathname_device _ECL_ARGS((cl_narg narg, cl_object pname, ...));
1400 extern ECL_API cl_object cl_pathname_directory _ECL_ARGS((cl_narg narg, cl_object pname, ...));
1401 extern ECL_API cl_object cl_pathname_name _ECL_ARGS((cl_narg narg, cl_object pname, ...));
1402 extern ECL_API cl_object cl_pathname_type _ECL_ARGS((cl_narg narg, cl_object pname, ...));
1403 extern ECL_API cl_object cl_pathname_version(cl_object pname);
1404 extern ECL_API cl_object cl_namestring(cl_object pname);
1405 extern ECL_API cl_object cl_file_namestring(cl_object pname);
1406 extern ECL_API cl_object cl_directory_namestring(cl_object pname);
1407 extern ECL_API cl_object cl_host_namestring(cl_object pname);
1408 extern ECL_API cl_object si_logical_pathname_p(cl_object pname);
1409 extern ECL_API cl_object cl_pathname_match_p(cl_object path, cl_object mask);
1410 extern ECL_API cl_object cl_translate_pathname _ECL_ARGS((cl_narg narg, cl_object source, cl_object from, cl_object to, ...));
1411 extern ECL_API cl_object cl_translate_logical_pathname _ECL_ARGS((cl_narg narg, cl_object source, ...));
1412 extern ECL_API cl_object cl_parse_namestring _ECL_ARGS((cl_narg narg, cl_object thing, ...));
1413 extern ECL_API cl_object cl_parse_logical_namestring _ECL_ARGS((cl_narg narg, cl_object thing, ...));
1414 extern ECL_API cl_object cl_merge_pathnames _ECL_ARGS((cl_narg narg, cl_object path, ...));
1415 extern ECL_API cl_object cl_make_pathname _ECL_ARGS((cl_narg narg, ...));
1416 extern ECL_API cl_object cl_enough_namestring _ECL_ARGS((cl_narg narg, cl_object path, ...));
1417 extern ECL_API cl_object si_pathname_translations _ECL_ARGS((cl_narg narg, cl_object host, ...));
1418 extern ECL_API cl_object si_default_pathname_defaults(void);
1419 extern ECL_API cl_object cl_wild_pathname_p _ECL_ARGS((cl_narg narg, cl_object pathname, ...));
1420
1421 extern ECL_API cl_object ecl_make_pathname(cl_object host, cl_object device, cl_object directory, cl_object name, cl_object type, cl_object version, cl_object scase);
1422 extern ECL_API cl_object ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep, cl_object default_host);
1423 extern ECL_API cl_object si_coerce_to_physical_pathname(cl_object x);
1424 extern ECL_API cl_object si_coerce_to_file_pathname(cl_object pathname);
1425 #define ECL_NAMESTRING_TRUNCATE_IF_ERROR 1
1426 #define ECL_NAMESTRING_FORCE_BASE_STRING 2
1427 extern ECL_API cl_object ecl_namestring(cl_object pname, int truncate_if_impossible);
1428 extern ECL_API cl_object si_coerce_to_filename(cl_object pathname);
1429 extern ECL_API cl_object ecl_merge_pathnames(cl_object path, cl_object defaults, cl_object default_version);
1430 extern ECL_API bool ecl_logical_hostname_p(cl_object host);
1431
1432
1433 /* predicate.c */
1434
1435 extern ECL_API cl_object cl_identity(cl_object x);
1436 extern ECL_API cl_object cl_null(cl_object x);
1437 #define cl_not cl_null
1438 extern ECL_API cl_object cl_symbolp(cl_object x);
1439 extern ECL_API cl_object cl_atom(cl_object x);
1440 extern ECL_API cl_object cl_consp(cl_object x);
1441 extern ECL_API cl_object cl_listp(cl_object x);
1442 extern ECL_API cl_object cl_numberp(cl_object x);
1443 extern ECL_API cl_object cl_integerp(cl_object x);
1444 extern ECL_API cl_object cl_rationalp(cl_object x);
1445 extern ECL_API cl_object cl_floatp(cl_object x);
1446 extern ECL_API cl_object cl_realp(cl_object x);
1447 extern ECL_API cl_object cl_complexp(cl_object x);
1448 extern ECL_API cl_object cl_characterp(cl_object x);
1449 extern ECL_API cl_object cl_stringp(cl_object x);
1450 extern ECL_API cl_object cl_bit_vector_p(cl_object x);
1451 extern ECL_API cl_object cl_vectorp(cl_object x);
1452 extern ECL_API cl_object cl_simple_string_p(cl_object x);
1453 extern ECL_API cl_object cl_simple_bit_vector_p(cl_object x);
1454 extern ECL_API cl_object cl_simple_vector_p(cl_object x);
1455 extern ECL_API cl_object cl_arrayp(cl_object x);
1456 extern ECL_API cl_object cl_packagep(cl_object x);
1457 extern ECL_API cl_object cl_functionp(cl_object x);
1458 extern ECL_API cl_object cl_compiled_function_p(cl_object x);
1459 extern ECL_API cl_object cl_eq(cl_object x, cl_object y);
1460 extern ECL_API cl_object cl_eql(cl_object x, cl_object y);
1461 extern ECL_API cl_object cl_equal(cl_object x, cl_object y);
1462 extern ECL_API cl_object cl_equalp(cl_object x, cl_object y);
1463 extern ECL_API cl_object si_fixnump(cl_object x);
1464
1465 extern ECL_API bool floatp(cl_object x);
1466 extern ECL_API bool ecl_numberp(cl_object x);
1467 extern ECL_API bool ecl_realp(cl_object x);
1468 extern ECL_API bool ecl_eql(cl_object x, cl_object y);
1469 extern ECL_API bool ecl_equal(cl_object x, cl_object y);
1470 extern ECL_API bool ecl_equalp(cl_object x, cl_object y);
1471 extern ECL_API bool ecl_stringp(cl_object x);
1472
1473 /* print.c */
1474
1475 extern ECL_API cl_object cl_write_byte(cl_object integer, cl_object binary_output_stream);
1476 extern ECL_API cl_object cl_write_sequence _ECL_ARGS((cl_narg narg, cl_object seq, cl_object stream, ...));
1477 extern ECL_API cl_object cl_write _ECL_ARGS((cl_narg narg, cl_object x, ...));
1478 extern ECL_API cl_object cl_prin1 _ECL_ARGS((cl_narg narg, cl_object obj, ...));
1479 extern ECL_API cl_object cl_print _ECL_ARGS((cl_narg narg, cl_object obj, ...));
1480 extern ECL_API cl_object cl_pprint _ECL_ARGS((cl_narg narg, cl_object obj, ...));
1481 extern ECL_API cl_object cl_princ _ECL_ARGS((cl_narg narg, cl_object obj, ...));
1482 extern ECL_API cl_object cl_write_char _ECL_ARGS((cl_narg narg, cl_object c, ...));
1483 extern ECL_API cl_object cl_write_string _ECL_ARGS((cl_narg narg, cl_object strng, ...));
1484 extern ECL_API cl_object cl_write_line _ECL_ARGS((cl_narg narg, cl_object strng, ...));
1485 extern ECL_API cl_object cl_terpri _ECL_ARGS((cl_narg narg, ...));
1486 extern ECL_API cl_object cl_finish_output _ECL_ARGS((cl_narg narg, ...));
1487 extern ECL_API cl_object cl_fresh_line _ECL_ARGS((cl_narg narg, ...));
1488 extern ECL_API cl_object cl_force_output _ECL_ARGS((cl_narg narg, ...));
1489 extern ECL_API cl_object cl_clear_output _ECL_ARGS((cl_narg narg, ...));
1490 extern ECL_API cl_object si_search_print_circle(cl_object x);
1491 extern ECL_API cl_object si_write_object_with_circle(cl_object object, cl_object stream, cl_object print_function);
1492 extern ECL_API cl_object si_write_object(cl_object object, cl_object stream);
1493 extern ECL_API cl_object si_write_ugly_object(cl_object object, cl_object stream);
1494
1495 extern ECL_API cl_object ecl_princ(cl_object obj, cl_object strm);
1496 extern ECL_API cl_object ecl_prin1(cl_object obj, cl_object strm);
1497 extern ECL_API cl_object ecl_print(cl_object obj, cl_object strm);
1498 extern ECL_API cl_object ecl_terpri(cl_object strm);
1499 extern ECL_API void ecl_write_string(cl_object strng, cl_object strm);
1500 extern ECL_API void ecl_princ_str(const char *s, cl_object sym);
1501 extern ECL_API int ecl_princ_char(int c, cl_object sym);
1502
1503 extern ECL_API cl_fixnum ecl_print_level(void);
1504 extern ECL_API cl_fixnum ecl_print_length(void);
1505 extern ECL_API int ecl_print_base(void);
1506 extern ECL_API bool ecl_print_radix(void);
1507 extern ECL_API cl_object ecl_print_case(void);
1508 extern ECL_API bool ecl_print_gensym(void);
1509 extern ECL_API bool ecl_print_array(void);
1510 extern ECL_API bool ecl_print_readably(void);
1511 extern ECL_API bool ecl_print_escape(void);
1512 extern ECL_API bool ecl_print_circle(void);
1513
1514 /* printer/integer_to_string.d */
1515 extern ECL_API cl_object si_integer_to_string(cl_object buffer, cl_object integer, cl_object base, cl_object radix, cl_object decimalp);
1516
1517 /* printer/float_string.d */
1518 extern ECL_API cl_object si_float_string(cl_narg narg, cl_object string, cl_object x, ...);
1519
1520 /* printer/float_to_digits.d */
1521 extern ECL_API cl_object si_float_to_digits(cl_object digits, cl_object number, cl_object position, cl_object relativep);
1522
1523 /* printer/float_to_string.d */
1524 extern ECL_API cl_object si_float_to_string_free(cl_object buffer, cl_object number, cl_object e_min, cl_object e_max);
1525
1526 /* printer/print_unreadable.d */
1527 extern ECL_API cl_object si_print_unreadable_object_function(cl_object o, cl_object stream, cl_object type, cl_object id, cl_object fn);
1528
1529 /* profile.c */
1530 #ifdef PROFILE
1531 extern ECL_API cl_object si_profile _ECL_ARGS((cl_narg narg, cl_object scale, cl_object start_address, ...));
1532 extern ECL_API cl_object si_clear_profile _ECL_ARGS((cl_narg narg, ...));
1533 extern ECL_API cl_object si_display_profile _ECL_ARGS((cl_narg narg, ...));
1534 extern ECL_API int total_ticks(unsigned short *aar, unsigned int dim);
1535 extern ECL_API int init_profile(void);
1536 #endif
1537
1538
1539 /* read.c */
1540
1541 extern ECL_API cl_object si_get_buffer_string();
1542 extern ECL_API cl_object si_put_buffer_string(cl_object string);
1543 extern ECL_API cl_object cl_read_sequence _ECL_ARGS((cl_narg narg, cl_object seq, cl_object stream, ...));
1544 extern ECL_API cl_object cl_readtablep(cl_object readtable);
1545 extern ECL_API cl_object si_standard_readtable(void);
1546 extern ECL_API cl_object cl_read _ECL_ARGS((cl_narg narg, ...));
1547 extern ECL_API cl_object cl_read_preserving_whitespace _ECL_ARGS((cl_narg narg, ...));
1548 extern ECL_API cl_object cl_read_delimited_list _ECL_ARGS((cl_narg narg, cl_object d, ...));
1549 extern ECL_API cl_object cl_read_line _ECL_ARGS((cl_narg narg, ...));
1550 extern ECL_API cl_object cl_read_char _ECL_ARGS((cl_narg narg, ...));
1551 extern ECL_API cl_object cl_unread_char _ECL_ARGS((cl_narg narg, cl_object c, ...));
1552 extern ECL_API cl_object cl_peek_char _ECL_ARGS((cl_narg narg, ...));
1553 extern ECL_API cl_object cl_listen _ECL_ARGS((cl_narg narg, ...));
1554 extern ECL_API cl_object cl_read_char_no_hang _ECL_ARGS((cl_narg narg, ...));
1555 extern ECL_API cl_object cl_clear_input _ECL_ARGS((cl_narg narg, ...));
1556 extern ECL_API cl_object cl_parse_integer _ECL_ARGS((cl_narg narg, cl_object strng, ...));
1557 extern ECL_API cl_object cl_read_byte _ECL_ARGS((cl_narg narg, cl_object binary_input_stream, ...));
1558 extern ECL_API cl_object cl_copy_readtable _ECL_ARGS((cl_narg narg, ...));
1559 extern ECL_API cl_object cl_readtable_case(cl_object r);
1560 extern ECL_API cl_object si_readtable_case_set(cl_object r, cl_object mode);
1561 extern ECL_API cl_object cl_set_syntax_from_char _ECL_ARGS((cl_narg narg, cl_object tochr, cl_object fromchr, ...));
1562 extern ECL_API cl_object cl_set_macro_character _ECL_ARGS((cl_narg narg, cl_object chr, cl_object fnc, ...));
1563 extern ECL_API cl_object cl_get_macro_character _ECL_ARGS((cl_narg narg, cl_object chr, ...));
1564 extern ECL_API cl_object cl_make_dispatch_macro_character _ECL_ARGS((cl_narg narg, cl_object chr, ...));
1565 extern ECL_API cl_object cl_set_dispatch_macro_character _ECL_ARGS((cl_narg narg, cl_object dspchr, cl_object subchr, cl_object fnc, ...));
1566 extern ECL_API cl_object cl_get_dispatch_macro_character _ECL_ARGS((cl_narg narg, cl_object dspchr, cl_object subchr, ...));
1567 extern ECL_API cl_object si_read_object_or_ignore(cl_object stream, cl_object eof);
1568 extern ECL_API cl_object si_readtable_lock _ECL_ARGS((cl_narg narg, cl_object readtable, ...));
1569 extern ECL_API cl_object si_make_backq_vector(cl_object dim, cl_object data, cl_object stream);
1570
1571 extern ECL_API int ecl_readtable_get(cl_object rdtbl, int c, cl_object *macro);
1572 extern ECL_API void ecl_readtable_set(cl_object rdtbl, int c, enum ecl_chattrib cat, cl_object macro_or_table);
1573 extern ECL_API cl_object ecl_read_object_non_recursive(cl_object in);
1574 extern ECL_API cl_object ecl_read_object(cl_object in);
1575 extern ECL_API cl_object ecl_parse_number(cl_object s, cl_index start, cl_index end, cl_index *ep, unsigned int radix);
1576 extern ECL_API cl_object ecl_parse_integer(cl_object s, cl_index start, cl_index end, cl_index *ep, unsigned int radix);
1577 extern ECL_API bool ecl_invalid_character_p(int c);
1578 extern ECL_API cl_object ecl_copy_readtable(cl_object from, cl_object to);
1579 extern ECL_API cl_object ecl_current_readtable(void);
1580 extern ECL_API int ecl_current_read_base(void);
1581 extern ECL_API char ecl_current_read_default_float_format(void);
1582 #define ecl_read_from_cstring(s) si_string_to_object(1,ecl_make_constant_base_string(s,-1))
1583 #define ecl_read_from_cstring_safe(s,v) si_string_to_object(2,ecl_make_constant_base_string(s,-1),(v))
1584 extern ECL_API cl_object ecl_init_module(cl_object block, void (*entry)(cl_object));
1585
1586 /* reference.c */
1587
1588 extern ECL_API cl_object cl_fboundp(cl_object sym);
1589 extern ECL_API cl_object cl_symbol_function(cl_object sym);
1590 extern ECL_API cl_object cl_fdefinition(cl_object fname);
1591 extern ECL_API cl_object si_coerce_to_function(cl_object form);
1592 extern ECL_API cl_object cl_symbol_value(cl_object sym);
1593 extern ECL_API cl_object cl_boundp(cl_object sym);
1594 extern ECL_API cl_object cl_special_operator_p(cl_object form);
1595 extern ECL_API cl_object ecl_fdefinition(cl_object fname);
1596 extern ECL_API bool ecl_boundp(cl_env_ptr env, cl_object o);
1597
1598 /* sequence.c */
1599
1600 extern ECL_API cl_object si_sequence_start_end(cl_object fun, cl_object sequence, cl_object start, cl_object end);
1601 extern ECL_API cl_object cl_elt(cl_object x, cl_object i);
1602 extern ECL_API cl_object si_elt_set(cl_object seq, cl_object index, cl_object val);
1603 extern ECL_API cl_object cl_copy_seq(cl_object x);
1604 extern ECL_API cl_object cl_length(cl_object x);
1605 extern ECL_API cl_object cl_reverse(cl_object x);
1606 extern ECL_API cl_object cl_nreverse(cl_object x);
1607 extern ECL_API cl_object cl_subseq _ECL_ARGS((cl_narg narg, cl_object sequence, cl_object start, ...));
1608
1609 extern ECL_API cl_object ecl_elt(cl_object seq, cl_fixnum index);
1610 extern ECL_API cl_object ecl_elt_set(cl_object seq, cl_fixnum index, cl_object val);
1611 extern ECL_API cl_fixnum ecl_length(cl_object x);
1612 extern ECL_API cl_object ecl_subseq(cl_object seq, cl_index start, cl_index limit);
1613 extern ECL_API cl_object ecl_copy_seq(cl_object seq);
1614
1615 #ifdef ECL_EXTERNALIZABLE
1616 /* serialize.d */
1617
1618 extern cl_object si_serialize(cl_object root);
1619 extern cl_object si_deserialize(cl_object root);
1620
1621 #endif
1622
1623 #ifdef ECL_SSE2
1624 /* sse2.c */
1625
1626 extern ECL_API cl_object si_sse_pack_p(cl_object x);
1627 extern ECL_API cl_object si_sse_pack_as_elt_type(cl_object x, cl_object type);
1628 extern ECL_API cl_object si_sse_pack_element_type(cl_object x);
1629
1630 extern ECL_API cl_object si_vector_to_sse_pack(cl_object x);
1631 extern ECL_API cl_object si_sse_pack_to_vector(cl_object x, cl_object elt_type);
1632
1633 extern ECL_API cl_object ecl_make_int_sse_pack(__m128i value);
1634 extern ECL_API __m128i ecl_unbox_int_sse_pack(cl_object value);
1635 #define ecl_unbox_int_sse_pack_unsafe(x) ((x)->sse.data.vi)
1636
1637 extern ECL_API cl_object ecl_make_float_sse_pack(__m128 value);
1638 extern ECL_API __m128 ecl_unbox_float_sse_pack(cl_object value);
1639 #define ecl_unbox_float_sse_pack_unsafe(x) ((x)->sse.data.vf)
1640
1641 extern ECL_API cl_object ecl_make_double_sse_pack(__m128d value);
1642 extern ECL_API __m128d ecl_unbox_double_sse_pack(cl_object value);
1643 #define ecl_unbox_double_sse_pack_unsafe(x) ((x)->sse.data.vd)
1644
1645 #endif
1646
1647 /* stacks.c */
1648
1649 extern ECL_API cl_object si_ihs_top(void);
1650 extern ECL_API cl_object si_ihs_fun(cl_object arg);
1651 extern ECL_API cl_object si_ihs_env(cl_object arg);
1652 extern ECL_API cl_object si_ihs_bds(cl_object arg);
1653 extern ECL_API cl_object si_ihs_next(cl_object arg);
1654 extern ECL_API cl_object si_ihs_prev(cl_object arg);
1655 extern ECL_API cl_object si_frs_top(void);
1656 extern ECL_API cl_object si_frs_bds(cl_object arg);
1657 extern ECL_API cl_object si_frs_tag(cl_object arg);
1658 extern ECL_API cl_object si_frs_ihs(cl_object arg);
1659 extern ECL_API cl_object si_bds_top(void);
1660 extern ECL_API cl_object si_bds_var(cl_object arg);
1661 extern ECL_API cl_object si_bds_val(cl_object arg);
1662 extern ECL_API cl_object si_sch_frs_base(cl_object fr, cl_object ihs);
1663 extern ECL_API cl_object si_reset_stack_limits(void);
1664 extern ECL_API cl_object si_set_limit(cl_object type, cl_object size);
1665 extern ECL_API cl_object si_get_limit(cl_object type);
1666
1667 extern ECL_API cl_index ecl_progv(cl_env_ptr env, cl_object vars, cl_object values);
1668 extern ECL_API void ecl_bds_unwind(cl_env_ptr env, cl_index new_bds_ndx);
1669 extern ECL_API void ecl_unwind(cl_env_ptr env, struct ecl_frame *fr) ecl_attr_noreturn;
1670 extern ECL_API struct ecl_frame *frs_sch(cl_object frame_id);
1671
1672 /* string.c */
1673
1674 extern ECL_API cl_object cl_char(cl_object s, cl_object i);
1675 #define cl_schar(x,y) cl_char(x,y)
1676 extern ECL_API cl_object si_char_set(cl_object str, cl_object index, cl_object c);
1677 extern ECL_API cl_object cl_string_trim(cl_object char_bag, cl_object strng);
1678 extern ECL_API cl_object cl_string_left_trim(cl_object char_bag, cl_object strng);
1679 extern ECL_API cl_object cl_string_right_trim(cl_object char_bag, cl_object strng);
1680 extern ECL_API cl_object cl_string(cl_object x);
1681 extern ECL_API cl_object cl_make_string _ECL_ARGS((cl_narg narg, cl_object size, ...));
1682 extern ECL_API cl_object cl_stringE _ECL_ARGS((cl_narg narg, cl_object string1, cl_object string2, ...));
1683 extern ECL_API cl_object cl_string_equal _ECL_ARGS((cl_narg narg, cl_object string1, cl_object string2, ...));
1684 extern ECL_API cl_object cl_stringL _ECL_ARGS((cl_narg narg, ...));
1685 extern ECL_API cl_object cl_stringG _ECL_ARGS((cl_narg narg, ...));
1686 extern ECL_API cl_object cl_stringLE _ECL_ARGS((cl_narg narg, ...));
1687 extern ECL_API cl_object cl_stringGE _ECL_ARGS((cl_narg narg, ...));
1688 extern ECL_API cl_object cl_stringNE _ECL_ARGS((cl_narg narg, ...));
1689 extern ECL_API cl_object cl_string_lessp _ECL_ARGS((cl_narg narg, ...));
1690 extern ECL_API cl_object cl_string_greaterp _ECL_ARGS((cl_narg narg, ...));
1691 extern ECL_API cl_object cl_string_not_greaterp _ECL_ARGS((cl_narg narg, ...));
1692 extern ECL_API cl_object cl_string_not_lessp _ECL_ARGS((cl_narg narg, ...));
1693 extern ECL_API cl_object cl_string_not_equal _ECL_ARGS((cl_narg narg, ...));
1694 extern ECL_API cl_object cl_string_upcase _ECL_ARGS((cl_narg narg, ...));
1695 extern ECL_API cl_object cl_string_downcase _ECL_ARGS((cl_narg narg, ...));
1696 extern ECL_API cl_object cl_string_capitalize _ECL_ARGS((cl_narg narg, ...));
1697 extern ECL_API cl_object cl_nstring_upcase _ECL_ARGS((cl_narg narg, ...));
1698 extern ECL_API cl_object cl_nstring_downcase _ECL_ARGS((cl_narg narg, ...));
1699 extern ECL_API cl_object cl_nstring_capitalize _ECL_ARGS((cl_narg narg, ...));
1700 extern ECL_API cl_object si_base_string_concatenate _ECL_ARGS((cl_narg narg, ...));
1701 extern ECL_API cl_object si_copy_to_simple_base_string(cl_object s);
1702
1703 #define ecl_alloc_simple_base_string(l) ecl_alloc_simple_vector((l),ecl_aet_bc)
1704 extern ECL_API cl_object ecl_alloc_adjustable_base_string(cl_index l);
1705 extern ECL_API cl_object ecl_make_constant_base_string(const char *s, cl_fixnum i);
1706 extern ECL_API cl_object ecl_make_simple_base_string(const char *s, cl_fixnum i);
1707 extern ECL_API cl_object ecl_cstring_to_base_string_or_nil(const char *s);
1708 extern ECL_API bool ecl_string_eq(cl_object x, cl_object y);
1709 extern ECL_API bool ecl_member_char(ecl_character c, cl_object char_bag);
1710 extern ECL_API bool ecl_fits_in_base_string(cl_object s);
1711 extern ECL_API ecl_character ecl_char(cl_object s, cl_index i);
1712 extern ECL_API ecl_character ecl_char_set(cl_object s, cl_index i, ecl_character c);
1713 extern ECL_API cl_object si_octets_to_string _ECL_ARGS((cl_narg narg, cl_object input, ...));
1714 extern ECL_API cl_object si_string_to_octets _ECL_ARGS((cl_narg narg, cl_object input, ...));
1715 extern ECL_API cl_object ecl_decode_from_cstring(const char *s, cl_fixnum len, cl_object encoding);
1716 extern ECL_API cl_fixnum ecl_encode_to_cstring(char *output, cl_fixnum output_len, cl_object input, cl_object encoding);
1717 #ifdef HAVE_WCHAR_H
1718 #include <wchar.h>
1719 extern ECL_API cl_object ecl_decode_from_unicode_wstring(const wchar_t *s, cl_fixnum len);
1720 extern ECL_API cl_fixnum ecl_encode_to_unicode_wstring(wchar_t *output, cl_fixnum output_len, cl_object input);
1721 #endif
1722
1723 /* structure.c */
1724
1725 extern ECL_API cl_object si_structure_subtype_p(cl_object x, cl_object y);
1726 extern ECL_API cl_object cl_copy_structure(cl_object s);
1727 extern ECL_API cl_object si_structure_name(cl_object s);
1728 extern ECL_API cl_object si_structure_ref(cl_object x, cl_object type, cl_object index);
1729 extern ECL_API cl_object si_structure_set(cl_object x, cl_object type, cl_object index, cl_object val);
1730 extern ECL_API cl_object si_structurep(cl_object s);
1731 extern ECL_API cl_object si_make_structure _ECL_ARGS((cl_narg narg, cl_object type, ...));
1732
1733 extern ECL_API cl_object ecl_structure_ref(cl_object x, cl_object name, cl_fixnum n);
1734 extern ECL_API cl_object ecl_structure_set(cl_object x, cl_object name, cl_fixnum n, cl_object v);
1735
1736 #ifdef ECL_THREADS
1737 extern ECL_API cl_object mp_compare_and_swap_structure(cl_object x, cl_object type, cl_object index, cl_object old_val, cl_object new_val);
1738 #endif
1739
1740 /* symbol.c */
1741
1742 extern ECL_API cl_object cl_make_symbol(cl_object str);
1743 extern ECL_API cl_object cl_remprop(cl_object sym, cl_object prop);
1744 extern ECL_API cl_object cl_symbol_plist(cl_object sym);
1745 extern ECL_API cl_object cl_get_properties(cl_object place, cl_object indicator_list);
1746 extern ECL_API cl_object cl_symbol_name(cl_object sym);
1747 extern ECL_API cl_object cl_symbol_package(cl_object sym);
1748 extern ECL_API cl_object cl_keywordp(cl_object sym);
1749 extern ECL_API cl_object si_put_f(cl_object plist, cl_object value, cl_object indicator);
1750 extern ECL_API cl_object si_rem_f(cl_object plist, cl_object indicator);
1751 extern ECL_API cl_object si_set_symbol_plist(cl_object sym, cl_object plist);
1752 extern ECL_API cl_object si_putprop(cl_object sym, cl_object value, cl_object indicator);
1753 extern ECL_API cl_object si_Xmake_special(cl_object sym);
1754 extern ECL_API cl_object si_Xmake_constant(cl_object sym, cl_object val);
1755 extern ECL_API cl_object cl_get _ECL_ARGS((cl_narg narg, cl_object sym, cl_object indicator, ...));
1756 extern ECL_API cl_object cl_getf _ECL_ARGS((cl_narg narg, cl_object place, cl_object indicator, ...));
1757 extern ECL_API cl_object cl_copy_symbol _ECL_ARGS((cl_narg narg, cl_object sym, ...));
1758 extern ECL_API cl_object cl_gensym _ECL_ARGS((cl_narg narg, ...));
1759 extern ECL_API cl_object cl_gentemp _ECL_ARGS((cl_narg narg, ...));
1760 extern ECL_API cl_object si_put_properties _ECL_ARGS((cl_narg narg, cl_object sym, ...));
1761
1762 extern ECL_API void ecl_defvar(cl_object s, cl_object v);
1763 extern ECL_API void ecl_defparameter(cl_object s, cl_object v);
1764 extern ECL_API cl_object ecl_make_symbol(const char *s, const char*p);
1765 extern ECL_API cl_object ecl_make_keyword(const char *s);
1766 extern ECL_API cl_object ecl_symbol_value(cl_object s);
1767 extern ECL_API cl_object ecl_cmp_symbol_value(cl_env_ptr the_env, cl_object s);
1768 extern ECL_API cl_object ecl_setq(cl_env_ptr env, cl_object var, cl_object value);
1769 extern ECL_API cl_object ecl_cmp_setq(cl_env_ptr env, cl_object var, cl_object value);
1770 extern ECL_API cl_object ecl_symbol_name(cl_object s);
1771 extern ECL_API cl_object ecl_symbol_package(cl_object s);
1772 extern ECL_API int ecl_symbol_type(cl_object s);
1773 extern ECL_API void ecl_symbol_type_set(cl_object s, int t);
1774 extern ECL_API cl_object ecl_getf(cl_object place, cl_object indicator, cl_object deflt);
1775 extern ECL_API cl_object ecl_get(cl_object s, cl_object p, cl_object d);
1776 extern ECL_API bool ecl_keywordp(cl_object s);
1777
1778 #ifdef ECL_THREADS
1779 extern ECL_API cl_object mp_compare_and_swap_symbol_plist(cl_object x, cl_object old_val, cl_object new_val);
1780 #endif
1781
1782 /* tcp.c */
1783
1784 #ifdef ECL_TCP
1785 extern ECL_API cl_object si_open_client_stream(cl_object host, cl_object port);
1786 extern ECL_API cl_object si_open_server_stream(cl_object port);
1787 extern ECL_API cl_object si_open_unix_socket_stream(cl_object path);
1788 extern ECL_API cl_object si_lookup_host_entry(cl_object host_or_address);
1789 extern ECL_API void ecl_tcp_close_all(void);
1790 #endif
1791
1792
1793 /* threads.c */
1794
1795 #ifdef ECL_THREADS
1796 extern ECL_API cl_object mp_own_process(void) __attribute__((const));
1797 extern ECL_API cl_object mp_all_processes(void);
1798 extern ECL_API cl_object mp_exit_process(void) ecl_attr_noreturn;
1799 extern ECL_API cl_object mp_interrupt_process(cl_object process, cl_object function);
1800 extern ECL_API cl_object mp_make_process _ECL_ARGS((cl_narg narg, ...));
1801 extern ECL_API cl_object mp_process_active_p(cl_object process);
1802 extern ECL_API cl_object mp_process_enable(cl_object process);
1803 extern ECL_API cl_object mp_process_yield(void);
1804 extern ECL_API cl_object mp_process_join(cl_object process);
1805 extern ECL_API cl_object mp_process_kill(cl_object process);
1806 extern ECL_API cl_object mp_process_suspend(cl_object process);
1807 extern ECL_API cl_object mp_process_resume(cl_object process);
1808 extern ECL_API cl_object mp_process_name(cl_object process);
1809 extern ECL_API cl_object mp_process_preset _ECL_ARGS((cl_narg narg, cl_object process, cl_object function, ...));
1810 extern ECL_API cl_object mp_process_run_function _ECL_ARGS((cl_narg narg, cl_object name, cl_object function, ...));
1811 extern ECL_API cl_object mp_process_run_function_wait _ECL_ARGS((cl_narg narg, ...));
1812 extern ECL_API cl_object mp_process_whostate(cl_object process);
1813 extern ECL_API cl_object mp_make_condition_variable(void);
1814 extern ECL_API cl_object mp_condition_variable_wait(cl_object cv, cl_object lock);
1815 extern ECL_API cl_object mp_condition_variable_timedwait(cl_object cv, cl_object lock, cl_object seconds);
1816 extern ECL_API cl_object mp_condition_variable_signal(cl_object cv);
1817 extern ECL_API cl_object mp_condition_variable_broadcast(cl_object cv);
1818 extern ECL_API cl_object mp_current_process(void);
1819 extern ECL_API cl_object mp_block_signals(void);
1820 extern ECL_API cl_object mp_restore_signals(cl_object sigmask);
1821
1822 extern ECL_API bool ecl_import_current_thread(cl_object process_name, cl_object process_binding);
1823 extern ECL_API void ecl_release_current_thread(void);
1824
1825 /* threads/semaphore.d */
1826
1827 extern ECL_API cl_object mp_make_semaphore _ECL_ARGS((cl_narg, ...));
1828 extern ECL_API cl_object mp_semaphore_count(cl_object);
1829 extern ECL_API cl_object mp_semaphore_name(cl_object);
1830 extern ECL_API cl_object mp_semaphore_wait_count(cl_object);
1831 extern ECL_API cl_object mp_semaphore_wait(cl_object, cl_object, cl_object);
1832 extern ECL_API cl_object mp_wait_on_semaphore _ECL_ARGS((cl_narg, cl_object, ...));
1833 extern ECL_API cl_object mp_try_get_semaphore _ECL_ARGS((cl_narg, cl_object, ...));
1834 extern ECL_API cl_object mp_signal_semaphore _ECL_ARGS((cl_narg, cl_object, ...));
1835 extern ECL_API cl_object ecl_make_semaphore(cl_object name, cl_fixnum count);
1836
1837 /* threads/barrier.d */
1838
1839 extern ECL_API cl_object ecl_make_barrier(cl_object name, cl_index count);
1840 extern ECL_API cl_object mp_make_barrier _ECL_ARGS((cl_narg, cl_object, ...));
1841 extern ECL_API cl_object mp_barrier_count(cl_object);
1842 extern ECL_API cl_object mp_barrier_name(cl_object);
1843 extern ECL_API cl_object mp_barrier_arrivers_count(cl_object);
1844 extern ECL_API cl_object mp_barrier_wait (cl_object);
1845 extern ECL_API cl_object mp_barrier_unblock _ECL_ARGS((cl_narg, cl_object, ...));
1846
1847 /* threads/mailbox.d */
1848
1849 extern ECL_API cl_object mp_make_mailbox _ECL_ARGS((cl_narg, ...));
1850 extern ECL_API cl_object mp_mailbox_name(cl_object mailbox);
1851 extern ECL_API cl_object mp_mailbox_count(cl_object mailbox);
1852 extern ECL_API cl_object mp_mailbox_empty_p(cl_object);
1853 extern ECL_API cl_object mp_mailbox_read(cl_object mailbox);
1854 extern ECL_API cl_object mp_mailbox_try_read(cl_object mailbox);
1855 extern ECL_API cl_object mp_mailbox_send(cl_object mailbox, cl_object msg);
1856 extern ECL_API cl_object mp_mailbox_try_send(cl_object mailbox, cl_object msg);
1857
1858 /* threads/mutex.c */
1859
1860 extern ECL_API cl_object mp_make_lock _ECL_ARGS((cl_narg narg, ...));
1861 extern ECL_API cl_object mp_recursive_lock_p(cl_object lock);
1862 extern ECL_API cl_object mp_holding_lock_p(cl_object lock);
1863 extern ECL_API cl_object mp_lock_name(cl_object lock);
1864 extern ECL_API cl_object mp_lock_owner(cl_object lock);
1865 extern ECL_API cl_object mp_lock_count(cl_object lock);
1866 extern ECL_API cl_object mp_get_lock _ECL_ARGS((cl_narg narg, cl_object lock, ...));
1867 extern ECL_API cl_object mp_get_lock_wait(cl_object lock);
1868 extern ECL_API cl_object mp_get_lock_nowait(cl_object lock);
1869 extern ECL_API cl_object mp_giveup_lock(cl_object lock);
1870
1871 extern ECL_API cl_object ecl_make_lock(cl_object lock, bool recursive);
1872
1873 /* threads/rwlock.d */
1874
1875 extern ECL_API cl_object mp_make_rwlock _ECL_ARGS((cl_narg narg, ...));
1876 extern ECL_API cl_object mp_rwlock_name(cl_object lock);
1877 extern ECL_API cl_object mp_get_rwlock_read _ECL_ARGS((cl_narg narg, cl_object lock, ...));
1878 extern ECL_API cl_object mp_get_rwlock_write _ECL_ARGS((cl_narg narg, cl_object lock, ...));
1879 extern ECL_API cl_object mp_giveup_rwlock_read(cl_object lock);
1880 extern ECL_API cl_object mp_giveup_rwlock_write(cl_object lock);
1881 extern ECL_API cl_object ecl_make_rwlock(cl_object lock);
1882
1883 #endif /* ECL_THREADS */
1884
1885 /* time.c */
1886
1887 extern ECL_API cl_object cl_sleep(cl_object z);
1888 extern ECL_API cl_object cl_get_internal_run_time(void);
1889 extern ECL_API cl_object cl_get_internal_real_time(void);
1890 extern ECL_API cl_object cl_get_universal_time(void);
1891
1892
1893 /* typespec.c */
1894
1895 extern ECL_API void assert_type_integer(cl_object p);
1896 extern ECL_API void assert_type_non_negative_integer(cl_object p);
1897 extern ECL_API void assert_type_proper_list(cl_object p);
1898 extern ECL_API cl_object cl_type_of(cl_object x);
1899
1900 extern ECL_API void FEtype_error_fixnum(cl_object x) ecl_attr_noreturn;
1901 extern ECL_API void FEtype_error_size(cl_object x) ecl_attr_noreturn;
1902 extern ECL_API void FEtype_error_cons(cl_object x) ecl_attr_noreturn;
1903 extern ECL_API void FEtype_error_list(cl_object x) ecl_attr_noreturn;
1904 extern ECL_API void FEtype_error_proper_list(cl_object x) ecl_attr_noreturn;
1905 extern ECL_API void FEtype_error_sequence(cl_object x) ecl_attr_noreturn;
1906 extern ECL_API void FEtype_error_vector(cl_object x) ecl_attr_noreturn;
1907 extern ECL_API void FEcircular_list(cl_object x) ecl_attr_noreturn;
1908 extern ECL_API void FEtype_error_index(cl_object seq, cl_fixnum ndx) ecl_attr_noreturn;
1909 extern ECL_API void FEtype_error_array(cl_object x) ecl_attr_noreturn;
1910 extern ECL_API void FEdivision_by_zero(cl_object x, cl_object y) ecl_attr_noreturn;
1911 extern ECL_API cl_object ecl_type_error(cl_object function, const char *place, cl_object o, cl_object type);
1912 extern ECL_API cl_object ecl_check_cl_type(cl_object fun, cl_object p, cl_type t);
1913 extern ECL_API cl_object ecl_make_integer_type(cl_object min, cl_object max);
1914
1915 /* unixfsys.c */
1916
1917 extern ECL_API cl_object cl_truename(cl_object file);
1918 extern ECL_API cl_object cl_rename_file _ECL_ARGS((cl_narg narg, cl_object old_obj, cl_object new_obj, ...));
1919 extern ECL_API cl_object cl_delete_file(cl_object file);
1920 extern ECL_API cl_object cl_probe_file(cl_object file);
1921 extern ECL_API cl_object cl_file_write_date(cl_object file);
1922 extern ECL_API cl_object cl_file_author(cl_object file);
1923 extern ECL_API cl_object si_file_kind(cl_object pathname, cl_object follow_links);
1924 extern ECL_API cl_object si_getcwd _ECL_ARGS((cl_narg narg, ...));
1925 extern ECL_API cl_object si_getpid(void);
1926 extern ECL_API cl_object si_getuid(void);
1927 extern ECL_API cl_object si_chdir _ECL_ARGS((cl_narg narg, cl_object directory, ...));
1928 extern ECL_API cl_object si_chmod(cl_object filename, cl_object mode);
1929 extern ECL_API cl_object si_mkdir(cl_object directory, cl_object mode);
1930 extern ECL_API cl_object cl_directory _ECL_ARGS((cl_narg narg, cl_object directory, ...));
1931 extern ECL_API cl_object cl_user_homedir_pathname _ECL_ARGS((cl_narg narg, ...));
1932 extern ECL_API cl_object si_mkstemp(cl_object templ);
1933 extern ECL_API cl_object si_rmdir(cl_object directory);
1934
1935 extern ECL_API cl_object ecl_file_len(int f);
1936 extern ECL_API cl_object ecl_homedir_pathname(cl_object user);
1937 extern ECL_API cl_object si_get_library_pathname(void);
1938 extern ECL_API cl_object si_copy_file(cl_object orig, cl_object end);
1939
1940
1941 /* unixint.c */
1942
1943 #ifdef ECL_USE_MPROTECT
1944 #define ecl_disable_interrupts_env(env) ((env)->disable_interrupts=1)
1945 #define ecl_enable_interrupts_env(env) ((env)->disable_interrupts=0)
1946 #else
1947 #define ecl_disable_interrupts_env(env) ((env)->disable_interrupts=1)
1948 #define ecl_enable_interrupts_env(env) (((env)->disable_interrupts^=1) && (ecl_check_pending_interrupts(env),0))
1949 #endif
1950 #define ecl_clear_interrupts_env(env) ((env)->interrupt_struct->pending_interrupt=ECL_NIL)
1951 #define ecl_clear_interrupts() ecl_clear_interrupts(&cl_env)
1952 #define ecl_disable_interrupts() ecl_disable_interrupts_env(&cl_env)
1953 #define ecl_enable_interrupts() ecl_enable_interrupts_env(&cl_env)
1954 #define ECL_PSEUDO_ATOMIC_ENV(env,stmt) (ecl_disable_interrupts_env(env),(stmt),ecl_enable_interrupts_env(env))
1955 #define ECL_PSEUDO_ATOMIC(stmt) (ecl_disable_interrupts(),(stmt),ecl_enable_interrupts())
1956 extern ECL_API cl_object si_handle_signal(cl_object signal);
1957 extern ECL_API cl_object si_get_signal_handler(cl_object signal);
1958 extern ECL_API cl_object si_set_signal_handler(cl_object signal, cl_object handler);
1959 extern ECL_API cl_object si_catch_signal(cl_narg narg, cl_object signal, cl_object state, ...);
1960 extern ECL_API cl_object si_check_pending_interrupts(void);
1961 extern ECL_API cl_object si_disable_interrupts(void);
1962 extern ECL_API cl_object si_enable_interrupts(void);
1963 extern ECL_API cl_object si_trap_fpe(cl_object condition, cl_object flag);
1964 #if defined(ECL_MS_WINDOWS_HOST)
1965 extern ECL_API LONG WINAPI _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS*);
1966 #endif
1967 extern ECL_API void ecl_check_pending_interrupts(cl_env_ptr env);
1968
1969 /* unixsys.c */
1970
1971 extern ECL_API cl_object si_system(cl_object cmd);
1972 extern ECL_API cl_object si_make_pipe();
1973 extern ECL_API cl_object si_run_program _ECL_ARGS((cl_narg narg, cl_object command, cl_object args, ...));
1974 extern ECL_API cl_object si_terminate_process _ECL_ARGS((cl_narg narg, cl_object process, ...));
1975 extern ECL_API cl_object si_waitpid(cl_object pid, cl_object wait);
1976 extern ECL_API cl_object si_killpid(cl_object pid, cl_object signal);
1977
1978 extern ECL_API cl_object si_run_program_inner
1979 (cl_object command, cl_object argv, cl_object environment, cl_object wait);
1980
1981 extern ECL_API cl_object si_spawn_subprocess
1982 (cl_object command, cl_object argv, cl_object environment,
1983 cl_object input, cl_object output, cl_object error);
1984
1985
1986 /* unicode -- no particular file, but we group these changes here */
1987
1988 #ifdef ECL_UNICODE
1989 extern ECL_API cl_object si_base_char_p(cl_object x);
1990 extern ECL_API cl_object si_base_string_p(cl_object x);
1991 extern ECL_API cl_object si_coerce_to_base_string(cl_object x);
1992 extern ECL_API cl_object si_coerce_to_extended_string(cl_object x);
1993 #define ecl_alloc_simple_extended_string(l) ecl_alloc_simple_vector((l),ecl_aet_ch)
1994 extern ECL_API cl_object ecl_alloc_adjustable_extended_string(cl_index l);
1995 extern ECL_API cl_object _ecl_ucd_code_to_name(ecl_character c);
1996 extern ECL_API cl_object _ecl_ucd_name_to_code(cl_object name);
1997 #else
1998 #define si_base_char_p cl_characterp
1999 #define si_base_string_p cl_stringp
2000 #define si_coerce_to_base_string cl_string
2001 #define si_coerce_to_extended_string cl_string
2002 #endif
2003
2004 /* vector_push.d */
2005
2006 extern ECL_API ecl_character ecl_string_push_extend(cl_object s, ecl_character c);
2007 extern ECL_API cl_object cl_vector_push _ECL_ARGS((cl_object V1, cl_object V2));
2008 extern ECL_API cl_object cl_vector_push_extend _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2009
2010
2011 /**********************************************************************
2012 * FUNCTIONS GENERATED BY THE LISP COMPILER
2013 */
2014
2015 /* arraylib.lsp */
2016 extern ECL_API cl_object cl_make_array _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2017 extern ECL_API cl_object si_fill_array_with_seq _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2018 extern ECL_API cl_object cl_vector _ECL_ARGS((cl_narg narg, ...));
2019 extern ECL_API cl_object cl_array_dimensions(cl_object V1);
2020 extern ECL_API cl_object cl_array_in_bounds_p _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2021 extern ECL_API cl_object cl_array_row_major_index _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2022 extern ECL_API cl_object cl_bit _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2023 extern ECL_API cl_object cl_sbit _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2024 extern ECL_API cl_object cl_bit_and _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2025 extern ECL_API cl_object cl_bit_ior _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2026 extern ECL_API cl_object cl_bit_xor _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2027 extern ECL_API cl_object cl_bit_eqv _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2028 extern ECL_API cl_object cl_bit_nand _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2029 extern ECL_API cl_object cl_bit_nor _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2030 extern ECL_API cl_object cl_bit_andc1 _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2031 extern ECL_API cl_object cl_bit_andc2 _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2032 extern ECL_API cl_object cl_bit_orc1 _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2033 extern ECL_API cl_object cl_bit_orc2 _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2034 extern ECL_API cl_object cl_bit_not _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2035 extern ECL_API cl_object cl_vector_pop(cl_object V1);
2036 extern ECL_API cl_object cl_adjust_array _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2037
2038 /* config.lsp */
2039
2040 extern ECL_API cl_object cl_short_site_name();
2041 extern ECL_API cl_object cl_long_site_name();
2042 extern ECL_API cl_object cl_lisp_implementation_type();
2043 extern ECL_API cl_object cl_lisp_implementation_version();
2044 extern ECL_API cl_object si_lisp_implementation_vcs_id();
2045 extern ECL_API cl_object cl_machine_type();
2046 extern ECL_API cl_object cl_machine_instance();
2047 extern ECL_API cl_object cl_machine_version();
2048 extern ECL_API cl_object cl_software_type();
2049 extern ECL_API cl_object cl_software_version();
2050
2051 /* describe.lsp */
2052
2053 extern ECL_API cl_object cl_inspect(cl_object o);
2054 extern ECL_API cl_object cl_describe _ECL_ARGS((cl_narg narg, cl_object o, ...));
2055
2056 /* iolib.lsp */
2057
2058 extern ECL_API cl_object cl_read_from_string _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2059 extern ECL_API cl_object cl_write_to_string _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2060 extern ECL_API cl_object cl_prin1_to_string(cl_object V1);
2061 extern ECL_API cl_object cl_princ_to_string(cl_object V1);
2062 extern ECL_API cl_object cl_y_or_n_p _ECL_ARGS((cl_narg narg, ...));
2063 extern ECL_API cl_object cl_yes_or_no_p _ECL_ARGS((cl_narg narg, ...));
2064 extern ECL_API cl_object si_string_to_object _ECL_ARGS((cl_narg narg, cl_object str, ...));
2065 extern ECL_API cl_object cl_dribble _ECL_ARGS((cl_narg narg, ...));
2066 extern ECL_API cl_object si_load_encoding(cl_object name);
2067 extern ECL_API cl_object si_make_encoding(cl_object mapping);
2068
2069 /* listlib.lsp */
2070
2071 extern ECL_API cl_object cl_union _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2072 extern ECL_API cl_object cl_nunion _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2073 extern ECL_API cl_object cl_intersection _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2074 extern ECL_API cl_object cl_nintersection _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2075 extern ECL_API cl_object cl_set_difference _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2076 extern ECL_API cl_object cl_nset_difference _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2077 extern ECL_API cl_object cl_set_exclusive_or _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2078 extern ECL_API cl_object cl_nset_exclusive_or _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2079 extern ECL_API cl_object cl_subsetp _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2080 extern ECL_API cl_object cl_rassoc_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2081 extern ECL_API cl_object cl_rassoc_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2082 extern ECL_API cl_object cl_assoc_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2083 extern ECL_API cl_object cl_assoc_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2084 extern ECL_API cl_object cl_member_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2085 extern ECL_API cl_object cl_member_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2086 extern ECL_API cl_object cl_subst_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2087 extern ECL_API cl_object cl_subst_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2088 extern ECL_API cl_object cl_nsubst_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2089 extern ECL_API cl_object cl_nsubst_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2090
2091 /* mislib.lsp */
2092
2093 extern ECL_API cl_object cl_logical_pathname_translations(cl_object V1);
2094 extern ECL_API cl_object cl_load_logical_pathname_translations(cl_object V1);
2095 extern ECL_API cl_object cl_decode_universal_time _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2096 extern ECL_API cl_object cl_encode_universal_time _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, cl_object V4, cl_object V5, cl_object V6, ...));
2097 extern ECL_API cl_object cl_get_decoded_time();
2098 extern ECL_API cl_object cl_ensure_directories_exist _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2099 extern ECL_API cl_object si_simple_program_error _ECL_ARGS((cl_narg narg, cl_object format, ...)) ecl_attr_noreturn;
2100 extern ECL_API cl_object si_signal_simple_error _ECL_ARGS((cl_narg narg, cl_object condition, cl_object continuable, cl_object format, cl_object args, ...));
2101 extern ECL_API cl_object si_make_stream_from_fd _ECL_ARGS((cl_narg narg, cl_object fd, cl_object direction, ...));
2102
2103 /* module.lsp */
2104
2105 extern ECL_API cl_object cl_provide(cl_object V1);
2106 extern ECL_API cl_object cl_require _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2107
2108 /* numlib.lsp */
2109
2110 extern ECL_API cl_object cl_isqrt(cl_object V1);
2111 extern ECL_API cl_object cl_phase(cl_object V1);
2112 extern ECL_API cl_object cl_signum(cl_object V1);
2113 extern ECL_API cl_object cl_cis(cl_object V1);
2114 extern ECL_API cl_object cl_asin(cl_object V1);
2115 extern ECL_API cl_object cl_acos(cl_object V1);
2116 extern ECL_API cl_object cl_asinh(cl_object V1);
2117 extern ECL_API cl_object cl_acosh(cl_object V1);
2118 extern ECL_API cl_object cl_atanh(cl_object V1);
2119 extern ECL_API cl_object cl_ffloor _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2120 extern ECL_API cl_object cl_fceiling _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2121 extern ECL_API cl_object cl_ftruncate _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2122 extern ECL_API cl_object cl_fround _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2123 extern ECL_API cl_object cl_logtest(cl_object V1, cl_object V2);
2124 extern ECL_API cl_object cl_byte(cl_object V1, cl_object V2);
2125 extern ECL_API cl_object cl_byte_size(cl_object V1);
2126 extern ECL_API cl_object cl_byte_position(cl_object V1);
2127 extern ECL_API cl_object cl_ldb(cl_object V1, cl_object V2);
2128 extern ECL_API cl_object cl_ldb_test(cl_object V1, cl_object V2);
2129 extern ECL_API cl_object cl_mask_field(cl_object V1, cl_object V2);
2130 extern ECL_API cl_object cl_dpb(cl_object V1, cl_object V2, cl_object V3);
2131 extern ECL_API cl_object cl_deposit_field(cl_object V1, cl_object V2, cl_object V3);
2132
2133 /* packlib.lsp */
2134
2135 extern ECL_API cl_object cl_find_all_symbols(cl_object V1);
2136 extern ECL_API cl_object cl_apropos _ECL_ARGS((cl_narg arg, cl_object V1, ...));
2137 extern ECL_API cl_object cl_apropos_list _ECL_ARGS((cl_narg arg, cl_object V1, ...));
2138
2139 /* predlib.lsp */
2140
2141 extern ECL_API cl_object si_subclassp _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2142 extern ECL_API cl_object si_of_class_p _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2143 extern ECL_API cl_object si_do_deftype _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2144 extern ECL_API cl_object cl_upgraded_array_element_type _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2145 extern ECL_API cl_object cl_upgraded_complex_part_type _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2146 extern ECL_API cl_object cl_typep _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2147 extern ECL_API cl_object cl_coerce(cl_object V1, cl_object V2);
2148 extern ECL_API cl_object cl_subtypep _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2149 extern ECL_API cl_object si_short_float_p(cl_object t);
2150 extern ECL_API cl_object si_single_float_p(cl_object t);
2151 extern ECL_API cl_object si_double_float_p(cl_object t);
2152 extern ECL_API cl_object si_long_float_p(cl_object t);
2153 extern ECL_API cl_object si_ratiop(cl_object t);
2154
2155 /* setf.lsp */
2156
2157 extern ECL_API cl_object si_do_defsetf _ECL_ARGS ((cl_narg narg, cl_object name, cl_object function, ...));
2158 extern ECL_API cl_object si_do_define_setf_method(cl_object name, cl_object function);
2159
2160 /* seq.lsp */
2161
2162 extern ECL_API cl_object cl_make_sequence _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2163 extern ECL_API cl_object cl_concatenate _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2164 extern ECL_API cl_object cl_map _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2165 extern ECL_API cl_object cl_some _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2166 extern ECL_API cl_object cl_every _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2167 extern ECL_API cl_object cl_notany _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2168 extern ECL_API cl_object cl_notevery _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2169 extern ECL_API cl_object cl_map_into _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2170 extern ECL_API cl_object si_sequence_count(cl_object count);
2171
2172 /* seqlib.lsp */
2173
2174 extern ECL_API cl_object cl_reduce _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2175 extern ECL_API cl_object cl_fill _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2176 extern ECL_API cl_object cl_replace _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2177 extern ECL_API cl_object cl_remove _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2178 extern ECL_API cl_object cl_remove_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2179 extern ECL_API cl_object cl_remove_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2180 extern ECL_API cl_object cl_delete _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2181 extern ECL_API cl_object cl_delete_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2182 extern ECL_API cl_object cl_delete_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2183 extern ECL_API cl_object cl_count _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2184 extern ECL_API cl_object cl_count_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2185 extern ECL_API cl_object cl_count_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2186 extern ECL_API cl_object cl_substitute _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2187 extern ECL_API cl_object cl_substitute_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2188 extern ECL_API cl_object cl_substitute_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2189 extern ECL_API cl_object cl_nsubstitute _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2190 extern ECL_API cl_object cl_nsubstitute_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2191 extern ECL_API cl_object cl_nsubstitute_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2192 extern ECL_API cl_object cl_find _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2193 extern ECL_API cl_object cl_find_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2194 extern ECL_API cl_object cl_find_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2195 extern ECL_API cl_object cl_position _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2196 extern ECL_API cl_object cl_position_if _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2197 extern ECL_API cl_object cl_position_if_not _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2198 extern ECL_API cl_object cl_remove_duplicates _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2199 extern ECL_API cl_object cl_delete_duplicates _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2200 extern ECL_API cl_object cl_mismatch _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2201 extern ECL_API cl_object cl_search _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2202 extern ECL_API cl_object cl_sort _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2203 extern ECL_API cl_object cl_stable_sort _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2204 extern ECL_API cl_object cl_merge _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, cl_object V4, ...));
2205 extern ECL_API cl_object cl_constantly(cl_object V1);
2206 extern ECL_API cl_object cl_complement(cl_object V1);
2207
2208 /* trace.lsp */
2209
2210 extern ECL_API cl_object si_traced_old_definition(cl_object V1);
2211
2212 /* pprint.lsp */
2213
2214 extern ECL_API cl_object cl_pprint_newline _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2215 extern ECL_API cl_object cl_pprint_indent _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2216 extern ECL_API cl_object cl_pprint_tab _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, ...));
2217 extern ECL_API cl_object cl_pprint_fill _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2218 extern ECL_API cl_object cl_pprint_linear _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2219 extern ECL_API cl_object cl_pprint_tabular _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2220 extern ECL_API cl_object cl_copy_pprint_dispatch _ECL_ARGS((cl_narg narg, ...));
2221 extern ECL_API cl_object cl_pprint_dispatch _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2222 extern ECL_API cl_object cl_set_pprint_dispatch _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, ...));
2223
2224
2225 /* combin.lsp */
2226 extern ECL_API cl_object cl_method_combination_error _ECL_ARGS((cl_narg narg, cl_object format, ...));
2227 extern ECL_API cl_object cl_invalid_method_error _ECL_ARGS((cl_narg narg, cl_object method, cl_object format, ...));
2228 extern ECL_API cl_object clos_std_compute_applicable_methods(cl_object gf, cl_object arglist);
2229 extern ECL_API cl_object clos_std_compute_effective_method(cl_object gf, cl_object combination, cl_object methods_list);
2230 extern ECL_API cl_object clos_compute_effective_method_function(cl_object gf, cl_object combination, cl_object methods_list);
2231
2232 /* boot.lsp */
2233 extern ECL_API cl_object cl_slot_boundp(cl_object object, cl_object slot);
2234 extern ECL_API cl_object cl_slot_makunbound(cl_object object, cl_object slot);
2235 extern ECL_API cl_object cl_slot_exists_p(cl_object object, cl_object slot);
2236
2237 /* defclass.lsp */
2238 extern ECL_API cl_object clos_load_defclass(cl_object name, cl_object superclasses, cl_object slots, cl_object options);
2239
2240 /* defclass.lsp */
2241 extern ECL_API cl_object clos_ensure_class _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2242
2243 #if 0
2244 /* kernel.lsp */
2245 extern ECL_API cl_object clos_class_id _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2246 extern ECL_API cl_object clos_class_direct_superclasses _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2247 extern ECL_API cl_object clos_class_direct_subclasses _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2248 extern ECL_API cl_object clos_class_slots _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2249 extern ECL_API cl_object clos_class_precedence_list _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2250 extern ECL_API cl_object clos_class_direct_slots _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2251 extern ECL_API cl_object clos_slot_index_table _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2252 extern ECL_API cl_object clos_class_shared_slots _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2253 extern ECL_API cl_object clos_generic_function_method_combination _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2254 extern ECL_API cl_object clos_generic_function_lambda_list _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2255 extern ECL_API cl_object clos_generic_function_argument_precedence_order _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2256 extern ECL_API cl_object clos_generic_function_method_class _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2257 extern ECL_API cl_object clos_generic_function_methods _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2258 extern ECL_API cl_object clos_method_generic_function _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2259 extern ECL_API cl_object clos_method_lambda_list _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2260 extern ECL_API cl_object clos_method_specializers _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2261 extern ECL_API cl_object cl_method_qualifiers _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2262 extern ECL_API cl_object clos_method_function _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2263 extern ECL_API cl_object clos_method_plist _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2264 extern ECL_API cl_object clos_install_method _ECL_ARGS((cl_narg narg, cl_object V1, cl_object V2, cl_object V3, cl_object V4, cl_object V5, ...));
2265
2266 #endif
2267
2268 /* std-slot-value */
2269 extern ECL_API cl_object cl_slot_value(cl_object object, cl_object slot);
2270 extern ECL_API cl_object clos_slot_value_set(cl_object value, cl_object instance, cl_object name);
2271 extern ECL_API cl_object clos_standard_instance_access(cl_object object, cl_object location);
2272 #define clos_funcallable_standard_instance_access clos_standard_instance_access
2273 extern ECL_API cl_object clos_standard_instance_set(cl_object object, cl_object location, cl_object value);
2274 #define clos_funcallable_standard_instance_set clos_standard_instance_access
2275
2276 /* method.lsp */
2277 extern ECL_API cl_object clos_extract_lambda_list(cl_object object);
2278 extern ECL_API cl_object clos_extract_specializer_names(cl_object object);
2279
2280 /* conditions.lsp */
2281 extern ECL_API cl_object cl_abort _ECL_ARGS((cl_narg narg, ...));
2282 extern ECL_API cl_object cl_continue _ECL_ARGS((cl_narg narg, ...));
2283 extern ECL_API cl_object cl_compute_restarts _ECL_ARGS((cl_narg narg, ...));
2284 extern ECL_API cl_object cl_find_restart _ECL_ARGS((cl_narg narg, cl_object name, ...));
2285 extern ECL_API cl_object cl_invoke_restart _ECL_ARGS((cl_narg narg, cl_object restart, ...));
2286 extern ECL_API cl_object cl_invoke_restart_interactively(cl_object restart);
2287 extern ECL_API cl_object cl_make_condition _ECL_ARGS((cl_narg narg, cl_object type, ...));
2288 extern ECL_API cl_object cl_muffle_warning _ECL_ARGS((cl_narg narg, ...));
2289 extern ECL_API cl_object cl_store_value _ECL_ARGS((cl_narg narg, cl_object value, ...));
2290 extern ECL_API cl_object cl_use_value _ECL_ARGS((cl_narg narg, cl_object value, ...));
2291 extern ECL_API cl_object si_bind_simple_restarts(cl_object tag, cl_object names);
2292 extern ECL_API cl_object si_bind_simple_handlers(cl_object tag, cl_object names);
2293 extern ECL_API cl_object si_assert_failure _ECL_ARGS((cl_narg narg, cl_object V1, ...));
2294
2295 /* assert.lsp */
2296 extern ECL_API cl_object si_wrong_type_argument _ECL_ARGS((cl_narg narg, cl_object value, cl_object type, ...));
2297 extern ECL_API cl_object si_ccase_error(cl_object keyform, cl_object key, cl_object values);
2298 extern ECL_API cl_object si_ecase_error(cl_object value, cl_object values) ecl_attr_noreturn;
2299 extern ECL_API cl_object si_etypecase_error(cl_object value, cl_object type) ecl_attr_noreturn;
2300 extern ECL_API cl_object si_ctypecase_error(cl_object keyplace, cl_object value, cl_object type);
2301 extern ECL_API cl_object si_do_check_type(cl_object value, cl_object type, cl_object type_string, cl_object place);
2302
2303 /*
2304 * CDR-5
2305 */
2306 extern ECL_API cl_object si_negative_fixnum_p(cl_object);
2307 extern ECL_API cl_object si_non_negative_fixnum_p(cl_object);
2308 extern ECL_API cl_object si_non_positive_fixnum_p(cl_object);
2309 extern ECL_API cl_object si_positive_fixnum_p(cl_object);
2310 extern ECL_API cl_object si_array_index_p(cl_object);
2311
2312 extern ECL_API cl_object si_negative_integer_p(cl_object);
2313 extern ECL_API cl_object si_non_negative_integer_p(cl_object);
2314 extern ECL_API cl_object si_non_positive_integer_p(cl_object);
2315 extern ECL_API cl_object si_positive_integer_p(cl_object);
2316
2317 extern ECL_API cl_object si_negative_rational_p(cl_object);
2318 extern ECL_API cl_object si_non_negative_rational_p(cl_object);
2319 extern ECL_API cl_object si_non_positive_rational_p(cl_object);
2320 extern ECL_API cl_object si_positive_rational_p(cl_object);
2321
2322 extern ECL_API cl_object si_negative_ratio_p(cl_object);
2323 extern ECL_API cl_object si_non_negative_ratio_p(cl_object);
2324 extern ECL_API cl_object si_non_positive_ratio_p(cl_object);
2325 extern ECL_API cl_object si_positive_ratio_p(cl_object);
2326
2327 extern ECL_API cl_object si_negative_real_p(cl_object);
2328 extern ECL_API cl_object si_non_negative_real_p(cl_object);
2329 extern ECL_API cl_object si_non_positive_real_p(cl_object);
2330 extern ECL_API cl_object si_positive_real_p(cl_object);
2331
2332 extern ECL_API cl_object si_negative_float_p(cl_object);
2333 extern ECL_API cl_object si_non_negative_float_p(cl_object);
2334 extern ECL_API cl_object si_non_positive_float_p(cl_object);
2335 extern ECL_API cl_object si_positive_float_p(cl_object);
2336
2337 extern ECL_API cl_object si_negative_short_float_p(cl_object);
2338 extern ECL_API cl_object si_non_negative_short_float_p(cl_object);
2339 extern ECL_API cl_object si_non_positive_short_float_p(cl_object);
2340 extern ECL_API cl_object si_positive_short_float_p(cl_object);
2341
2342 extern ECL_API cl_object si_negative_single_float_p(cl_object);
2343 extern ECL_API cl_object si_non_negative_single_float_p(cl_object);
2344 extern ECL_API cl_object si_non_positive_single_float_p(cl_object);
2345 extern ECL_API cl_object si_positive_single_float_p(cl_object);
2346
2347 extern ECL_API cl_object si_negative_double_float_p(cl_object);
2348 extern ECL_API cl_object si_non_negative_double_float_p(cl_object);
2349 extern ECL_API cl_object si_non_positive_double_float_p(cl_object);
2350 extern ECL_API cl_object si_positive_double_float_p(cl_object);
2351
2352 extern ECL_API cl_object si_negative_long_float_p(cl_object);
2353 extern ECL_API cl_object si_non_negative_long_float_p(cl_object);
2354 extern ECL_API cl_object si_non_positive_long_float_p(cl_object);
2355 extern ECL_API cl_object si_positive_long_float_p(cl_object);
2356
2357 #ifdef __cplusplus
2358 }
2359 #endif
2360
2361 #endif /* !ECL_EXTERNAL_H */