Back to index

plt-scheme  4.2.1
schemef.h
Go to the documentation of this file.
00001 /*
00002   MzScheme
00003   Copyright (c) 2004-2009 PLT Scheme Inc.
00004   Copyright (c) 1995-2001 Matthew Flatt
00005   All rights reserved.
00006 
00007   Please see the full copyright in the documentation.
00008 
00009   Originally based on:
00010   libscheme
00011   Copyright (c) 1994 Brent Benson
00012   All rights reserved.
00013 */
00014 
00015 /* MzScheme function prototypes */
00016 /* Macros generally shouldn't go in this file; it is used both to
00017    prototype functions, and as a parsing source for
00018    declaring scheme_extension_table */
00019 
00020 /* The scheme_extension_table "parser" is picky; don't leave a space
00021    between a function name and it's opening parameter parenthesis. */
00022 
00023 /* After this START tag, all comments should start & end on same line */
00024 
00025 /* START */
00026 
00027 /*========================================================================*/
00028 /*                       setjmpup (continuations)                         */
00029 /*========================================================================*/
00030 
00031 MZ_EXTERN void scheme_init_jmpup_buf(Scheme_Jumpup_Buf *b);
00032 MZ_EXTERN int scheme_setjmpup_relative(Scheme_Jumpup_Buf *b, void *base,
00033                                    void * volatile start, struct Scheme_Cont *cont);
00034 MZ_EXTERN void scheme_longjmpup(Scheme_Jumpup_Buf *b);
00035 MZ_EXTERN void scheme_reset_jmpup_buf(Scheme_Jumpup_Buf *b);
00036 
00037 #ifdef USE_MZ_SETJMP
00038 MZ_EXTERN int scheme_mz_setjmp(mz_pre_jmp_buf b);
00039 MZ_EXTERN void scheme_mz_longjmp(mz_pre_jmp_buf b, int v);
00040 #endif
00041 
00042 MZ_EXTERN void scheme_clear_escape(void);
00043 
00044 MZ_EXTERN Scheme_Jumpup_Buf_Holder *scheme_new_jmpupbuf_holder(void);
00045 
00046 /*========================================================================*/
00047 /*                                parameters                              */
00048 /*========================================================================*/
00049 
00050 MZ_EXTERN Scheme_Config *scheme_current_config(void);
00051 MZ_EXTERN Scheme_Config *scheme_extend_config(Scheme_Config *c, int pos, Scheme_Object *init_val);
00052 MZ_EXTERN void scheme_install_config(Scheme_Config *);
00053 
00054 MZ_EXTERN Scheme_Object *scheme_get_param(Scheme_Config *c, int pos);
00055 MZ_EXTERN void scheme_set_param(Scheme_Config *c, int pos, Scheme_Object *o);
00056 
00057 MZ_EXTERN Scheme_Object *scheme_get_thread_param(Scheme_Config *c, Scheme_Thread_Cell_Table *cells, int pos);
00058 MZ_EXTERN void scheme_set_thread_param(Scheme_Config *c, Scheme_Thread_Cell_Table *cells, int pos, Scheme_Object *o);
00059 
00060 MZ_EXTERN Scheme_Env *scheme_get_env(Scheme_Config *config);
00061 
00062 MZ_EXTERN Scheme_Thread_Cell_Table *scheme_inherit_cells(Scheme_Thread_Cell_Table *cells);
00063 
00064 MZ_EXTERN Scheme_Object *scheme_current_break_cell();
00065 
00066 /*========================================================================*/
00067 /*                                threads                                 */
00068 /*========================================================================*/
00069 
00070 #ifndef LINK_EXTENSIONS_BY_TABLE
00071 # ifndef MZ_USE_PLACES
00072 MZ_EXTERN THREAD_LOCAL Scheme_Thread *scheme_current_thread;
00073 # endif
00074 MZ_EXTERN volatile int scheme_fuel_counter;
00075 #else
00076 MZ_EXTERN Scheme_Thread **scheme_current_thread_ptr;
00077 MZ_EXTERN volatile int *scheme_fuel_counter_ptr;
00078 #endif
00079 
00080 MZ_EXTERN Scheme_Thread *scheme_get_current_thread();
00081 
00082 MZ_EXTERN void scheme_start_atomic(void);
00083 MZ_EXTERN void scheme_end_atomic(void);
00084 MZ_EXTERN void scheme_end_atomic_no_swap(void);
00085 MZ_EXTERN void scheme_start_in_scheduler(void);
00086 MZ_EXTERN void scheme_end_in_scheduler(void);
00087 
00088 MZ_EXTERN void scheme_out_of_fuel(void);
00089 
00090 MZ_EXTERN Scheme_Object *scheme_thread(Scheme_Object *thunk);
00091 MZ_EXTERN Scheme_Object *scheme_thread_w_details(Scheme_Object *thunk, 
00092                                            Scheme_Config *init_config,
00093                                            Scheme_Thread_Cell_Table *copy_from,
00094                                            Scheme_Object *break_cell,
00095                                            Scheme_Custodian *owning_custodian, 
00096                                            int suspend_to_kill);
00097 MZ_EXTERN void scheme_kill_thread(Scheme_Thread *p);
00098 MZ_EXTERN void scheme_break_thread(Scheme_Thread *p);
00099 MZ_EXTERN void scheme_break_main_thread();
00100 MZ_EXTERN void scheme_set_break_main_target(Scheme_Thread *p);
00101 
00102 MZ_EXTERN void scheme_thread_block(float sleep_time);
00103 MZ_EXTERN void scheme_thread_block_enable_break(float sleep_time, int enable);
00104 MZ_EXTERN void scheme_swap_thread(Scheme_Thread *process);
00105 MZ_EXTERN void scheme_making_progress();
00106 
00107 MZ_EXTERN void scheme_weak_suspend_thread(Scheme_Thread *p);
00108 MZ_EXTERN void scheme_weak_resume_thread(Scheme_Thread *p);
00109 
00110 MZ_EXTERN int scheme_block_until(Scheme_Ready_Fun f, Scheme_Needs_Wakeup_Fun, Scheme_Object *, float);
00111 MZ_EXTERN int scheme_block_until_enable_break(Scheme_Ready_Fun f, Scheme_Needs_Wakeup_Fun, Scheme_Object *, 
00112                                          float, int enable);
00113 MZ_EXTERN int scheme_block_until_unless(Scheme_Ready_Fun f, Scheme_Needs_Wakeup_Fun fdf,
00114                                    Scheme_Object *data, float delay, 
00115                                    Scheme_Object *unless,
00116                                    int enable_break);
00117 
00118 MZ_EXTERN void scheme_wait_input_allowed(Scheme_Input_Port *port, int nonblock);
00119 XFORM_NONGCING MZ_EXTERN int scheme_unless_ready(Scheme_Object *unless);
00120 
00121 MZ_EXTERN int scheme_in_main_thread(void);
00122 
00123 MZ_EXTERN void scheme_cancel_sleep(void);
00124 
00125 MZ_EXTERN void scheme_start_sleeper_thread(void (*mzsleep)(float seconds, void *fds), float secs, void *fds, int hit_fd);
00126 MZ_EXTERN void scheme_end_sleeper_thread();
00127 
00128 MZ_EXTERN void scheme_notify_sleep_progress();
00129 
00130 MZ_EXTERN Scheme_Object *scheme_make_thread_cell(Scheme_Object *def_val, int inherited);
00131 MZ_EXTERN Scheme_Object *scheme_thread_cell_get(Scheme_Object *cell, Scheme_Thread_Cell_Table *cells);
00132 MZ_EXTERN void scheme_thread_cell_set(Scheme_Object *cell, Scheme_Thread_Cell_Table *cells, Scheme_Object *v);
00133 
00134 MZ_EXTERN int scheme_tls_allocate();
00135 MZ_EXTERN void scheme_tls_set(int pos, void *v);
00136 MZ_EXTERN void *scheme_tls_get(int pos);
00137 
00138 MZ_EXTERN Scheme_Custodian *scheme_make_custodian(Scheme_Custodian *);
00139 MZ_EXTERN Scheme_Custodian_Reference *scheme_add_managed(Scheme_Custodian *m, Scheme_Object *o,
00140                                                   Scheme_Close_Custodian_Client *f, void *data,
00141                                                   int strong);
00142 MZ_EXTERN void scheme_custodian_check_available(Scheme_Custodian *m, const char *who, const char *what);
00143 MZ_EXTERN int scheme_custodian_is_available(Scheme_Custodian *m);
00144 MZ_EXTERN void scheme_remove_managed(Scheme_Custodian_Reference *m, Scheme_Object *o);
00145 MZ_EXTERN void scheme_close_managed(Scheme_Custodian *m);
00146 MZ_EXTERN void scheme_schedule_custodian_close(Scheme_Custodian *c);
00147 MZ_EXTERN void scheme_add_custodian_extractor(Scheme_Type t, Scheme_Custodian_Extractor e);
00148 
00149 MZ_EXTERN void scheme_add_atexit_closer(Scheme_Exit_Closer_Func f);
00150 
00151 MZ_EXTERN void scheme_add_evt(Scheme_Type type,
00152                                Scheme_Ready_Fun ready,
00153                                Scheme_Needs_Wakeup_Fun wakeup,
00154                                Scheme_Sync_Filter_Fun filter,
00155                                int can_redirect);
00156 MZ_EXTERN void scheme_add_evt_through_sema(Scheme_Type type,
00157                                        Scheme_Sync_Sema_Fun sema,
00158                                        Scheme_Sync_Filter_Fun filter);
00159 MZ_EXTERN int scheme_is_evt(Scheme_Object *o);
00160 MZ_EXTERN Scheme_Object *scheme_sync(int argc, Scheme_Object *argv[]);
00161 MZ_EXTERN Scheme_Object *scheme_sync_enable_break(int argc, Scheme_Object *argv[]);
00162 MZ_EXTERN Scheme_Object *scheme_sync_timeout(int argc, Scheme_Object *argv[]);
00163 
00164 MZ_EXTERN Scheme_Object *scheme_make_evt_set(int argc, Scheme_Object **argv);
00165 
00166 MZ_EXTERN void scheme_add_swap_callback(Scheme_Closure_Func f, Scheme_Object *data);
00167 MZ_EXTERN void scheme_add_swap_out_callback(Scheme_Closure_Func f, Scheme_Object *data);
00168 
00169 MZ_EXTERN Scheme_Object *scheme_call_enable_break(Scheme_Prim *prim, int argc, Scheme_Object *argv[]);
00170 MZ_EXTERN int scheme_close_should_force_port_closed();
00171 
00172 MZ_EXTERN void scheme_push_kill_action(Scheme_Kill_Action_Func f, void *d);
00173 MZ_EXTERN void scheme_pop_kill_action();
00174 
00175 MZ_EXTERN void scheme_set_can_break(int on);
00176 MZ_EXTERN void scheme_push_break_enable(Scheme_Cont_Frame_Data *cframe, int on, int pre_check);
00177 MZ_EXTERN void scheme_pop_break_enable(Scheme_Cont_Frame_Data *cframe, int post_check);
00178 
00179 /*========================================================================*/
00180 /*                              error handling                            */
00181 /*========================================================================*/
00182 
00183 MZ_EXTERN void scheme_signal_error(const char *msg, ...);
00184 MZ_EXTERN void scheme_raise_exn(int exnid, ...);
00185 MZ_EXTERN void scheme_warning(char *msg, ...);
00186 
00187 MZ_EXTERN void scheme_raise(Scheme_Object *exn);
00188 
00189 MZ_EXTERN int scheme_log_level_p(Scheme_Logger *logger, int level);
00190 MZ_EXTERN void scheme_log(Scheme_Logger *logger, int level, int flags,
00191                           char *msg, ...);
00192 MZ_EXTERN void scheme_log_message(Scheme_Logger *logger, int level, char *buffer, long len, Scheme_Object *data);
00193 MZ_EXTERN void scheme_log_abort(char *buffer);
00194 MZ_EXTERN void scheme_out_of_memory_abort();
00195 
00196 MZ_EXTERN void scheme_wrong_count(const char *name, int minc, int maxc,
00197                               int argc, Scheme_Object **argv);
00198 MZ_EXTERN void scheme_wrong_count_m(const char *name, int minc, int maxc,
00199                                 int argc, Scheme_Object **argv,
00200                                 int is_method);
00201 MZ_EXTERN void scheme_case_lambda_wrong_count(const char *name, int argc,
00202                                          Scheme_Object **argv, int is_method, int count, ...);
00203 MZ_EXTERN void scheme_wrong_type(const char *name, const char *expected,
00204                              int which, int argc,
00205                              Scheme_Object **argv);
00206 MZ_EXTERN void scheme_wrong_field_type(Scheme_Object *c_name,
00207                                    const char *expected,
00208                                    Scheme_Object *o);
00209 MZ_EXTERN void scheme_arg_mismatch(const char *name, const char *msg, Scheme_Object *o);
00210 MZ_EXTERN void scheme_wrong_return_arity(const char *where,
00211                                     int expected, int got,
00212                                     Scheme_Object **argv,
00213                                     const char *context_detail, ...);
00214 MZ_EXTERN void scheme_unbound_global(Scheme_Bucket *b);
00215 
00216 MZ_EXTERN Scheme_Object *scheme_dynamic_wind(void (*pre)(void *),
00217                                         Scheme_Object *(* volatile act)(void *),
00218                                         void (* volatile post)(void *),
00219                                         Scheme_Object *(*jmp_handler)(void *),
00220                                         void * volatile data);
00221 
00222 /*========================================================================*/
00223 /*                                 types                                  */
00224 /*========================================================================*/
00225 
00226 MZ_EXTERN Scheme_Type scheme_make_type(const char *name);
00227 
00228 MZ_EXTERN char *scheme_get_type_name(Scheme_Type type);
00229 
00230 /*========================================================================*/
00231 /*                              constants                                 */
00232 /*========================================================================*/
00233 
00234 MZ_EXTERN Scheme_Object scheme_eof[1];
00235 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_make_eof(void);
00236 MZ_EXTERN Scheme_Object scheme_null[1];
00237 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_make_null(void);
00238 MZ_EXTERN Scheme_Object scheme_true[1];
00239 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_make_true(void);
00240 MZ_EXTERN Scheme_Object scheme_false[1];
00241 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_make_false(void);
00242 MZ_EXTERN Scheme_Object scheme_void[1];
00243 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_make_void(void);
00244 MZ_EXTERN Scheme_Object scheme_undefined[1];
00245 MZ_EXTERN Scheme_Object *scheme_tail_call_waiting;
00246 MZ_EXTERN Scheme_Object *scheme_multiple_values;
00247 
00248 MZ_EXTERN unsigned short *scheme_uchar_table[];
00249 MZ_EXTERN unsigned char *scheme_uchar_cases_table[];
00250 MZ_EXTERN unsigned char *scheme_uchar_cats_table[];
00251 MZ_EXTERN int scheme_uchar_ups[];
00252 MZ_EXTERN int scheme_uchar_downs[];
00253 MZ_EXTERN int scheme_uchar_titles[];
00254 MZ_EXTERN int scheme_uchar_folds[];
00255 MZ_EXTERN unsigned char scheme_uchar_combining_classes[];
00256 
00257 /*========================================================================*/
00258 /*                              evaluation                                */
00259 /*========================================================================*/
00260 
00261 MZ_EXTERN Scheme_Object *scheme_eval(Scheme_Object *obj, Scheme_Env *env);
00262 MZ_EXTERN Scheme_Object *scheme_eval_multi(Scheme_Object *obj, Scheme_Env *env);
00263 MZ_EXTERN Scheme_Object *scheme_eval_with_prompt(Scheme_Object *obj, Scheme_Env *env);
00264 MZ_EXTERN Scheme_Object *scheme_eval_multi_with_prompt(Scheme_Object *obj, Scheme_Env *env);
00265 
00266 MZ_EXTERN Scheme_Object *scheme_eval_compiled(Scheme_Object *obj, Scheme_Env *env);
00267 MZ_EXTERN Scheme_Object *scheme_eval_compiled_multi(Scheme_Object *obj, Scheme_Env *env);
00268 MZ_EXTERN Scheme_Object *_scheme_eval_compiled(Scheme_Object *obj, Scheme_Env *env);
00269 MZ_EXTERN Scheme_Object *_scheme_eval_compiled_multi(Scheme_Object *obj, Scheme_Env *env);
00270 
00271 MZ_EXTERN Scheme_Object *scheme_apply(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00272 MZ_EXTERN Scheme_Object *scheme_apply_multi(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00273 MZ_EXTERN Scheme_Object *scheme_apply_no_eb(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00274 MZ_EXTERN Scheme_Object *scheme_apply_multi_no_eb(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00275 MZ_EXTERN Scheme_Object *scheme_apply_to_list(Scheme_Object *rator, Scheme_Object *argss);
00276 MZ_EXTERN Scheme_Object *scheme_apply_with_prompt(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00277 MZ_EXTERN Scheme_Object *scheme_apply_multi_with_prompt(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00278 MZ_EXTERN Scheme_Object *_scheme_apply_with_prompt(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00279 MZ_EXTERN Scheme_Object *_scheme_apply_multi_with_prompt(Scheme_Object *rator, int num_rands, Scheme_Object **rands);
00280 MZ_EXTERN Scheme_Object *scheme_eval_string(const char *str, Scheme_Env *env);
00281 MZ_EXTERN Scheme_Object *scheme_eval_string_multi(const char *str, Scheme_Env *env);
00282 MZ_EXTERN Scheme_Object *scheme_eval_string_all(const char *str, Scheme_Env *env, int all);
00283 MZ_EXTERN Scheme_Object *scheme_eval_string_with_prompt(const char *str, Scheme_Env *env);
00284 MZ_EXTERN Scheme_Object *scheme_eval_string_multi_with_prompt(const char *str, Scheme_Env *env);
00285 MZ_EXTERN Scheme_Object *scheme_eval_string_all_with_prompt(const char *str, Scheme_Env *env, int all);
00286 MZ_EXTERN Scheme_Object *scheme_eval_module_string(const char *str, Scheme_Env *env);
00287 
00288 MZ_EXTERN Scheme_Object *_scheme_apply_known_prim_closure(Scheme_Object *rator, int argc,
00289                                                    Scheme_Object **argv);
00290 MZ_EXTERN Scheme_Object *_scheme_apply_known_prim_closure_multi(Scheme_Object *rator, int argc,
00291                                                         Scheme_Object **argv);
00292 MZ_EXTERN Scheme_Object *_scheme_apply_prim_closure(Scheme_Object *rator, int argc,
00293                                               Scheme_Object **argv);
00294 MZ_EXTERN Scheme_Object *_scheme_apply_prim_closure_multi(Scheme_Object *rator, int argc,
00295                                                    Scheme_Object **argv);
00296 
00297 MZ_EXTERN Scheme_Object *scheme_call_with_prompt(Scheme_Closed_Prim f, void *data);
00298 MZ_EXTERN Scheme_Object *scheme_call_with_prompt_multi(Scheme_Closed_Prim f, void *data);
00299 MZ_EXTERN Scheme_Object *_scheme_call_with_prompt(Scheme_Closed_Prim f, void *data);
00300 MZ_EXTERN Scheme_Object *_scheme_call_with_prompt_multi(Scheme_Closed_Prim f, void *data);
00301 
00302 MZ_EXTERN Scheme_Object *scheme_values(int c, Scheme_Object **v);
00303 
00304 MZ_EXTERN Scheme_Object *scheme_check_one_value(Scheme_Object *v);
00305 
00306 /* Tail calls - only use these when you're writing new functions/syntax */
00307 MZ_EXTERN Scheme_Object *scheme_tail_apply(Scheme_Object *f, int n, Scheme_Object **arg);
00308 MZ_EXTERN Scheme_Object *scheme_tail_apply_no_copy(Scheme_Object *f, int n, Scheme_Object **arg);
00309 MZ_EXTERN Scheme_Object *scheme_tail_apply_to_list(Scheme_Object *f, Scheme_Object *l);
00310 
00311 MZ_EXTERN Scheme_Object *scheme_tail_eval_expr(Scheme_Object *obj);
00312 
00313 MZ_EXTERN void scheme_set_tail_buffer_size(int s);
00314 MZ_EXTERN Scheme_Object *scheme_force_value(Scheme_Object *);
00315 MZ_EXTERN Scheme_Object *scheme_force_one_value(Scheme_Object *);
00316 
00317 MZ_EXTERN MZ_MARK_STACK_TYPE scheme_set_cont_mark(Scheme_Object *key, Scheme_Object *val);
00318 MZ_EXTERN void scheme_push_continuation_frame(Scheme_Cont_Frame_Data *);
00319 MZ_EXTERN void scheme_pop_continuation_frame(Scheme_Cont_Frame_Data *);
00320 MZ_EXTERN void scheme_temp_dec_mark_depth();
00321 MZ_EXTERN void scheme_temp_inc_mark_depth();
00322 
00323 MZ_EXTERN Scheme_Object *scheme_current_continuation_marks(Scheme_Object *prompt_tag);
00324 MZ_EXTERN Scheme_Object *scheme_extract_one_cc_mark(Scheme_Object *mark_set, 
00325                                               Scheme_Object *key);
00326 MZ_EXTERN Scheme_Object *scheme_extract_one_cc_mark_to_tag(Scheme_Object *mark_set, 
00327                                                            Scheme_Object *key,
00328                                                            Scheme_Object *prompt_tag);
00329 
00330 /* Internal */
00331 MZ_EXTERN Scheme_Object *scheme_do_eval(Scheme_Object *obj, int _num_rands, Scheme_Object **rands, int val);
00332 
00333 MZ_EXTERN Scheme_Object *scheme_eval_compiled_stx_string(Scheme_Object *expr, Scheme_Env *env,
00334                                                   long shift, Scheme_Object *modidx);
00335 MZ_EXTERN Scheme_Object *scheme_load_compiled_stx_string(const char *str, long len);
00336 MZ_EXTERN Scheme_Object *scheme_compiled_stx_symbol(Scheme_Object *stx);
00337 
00338 MZ_EXTERN Scheme_Object *scheme_eval_compiled_sized_string(const char *str, int len, Scheme_Env *env);
00339 MZ_EXTERN Scheme_Object *scheme_eval_compiled_sized_string_with_magic(const char *str, int len, Scheme_Env *env, 
00340                                                               Scheme_Object *magic_symbol, Scheme_Object *magic_val,
00341                                                               int multi_ok);
00342 
00343 MZ_EXTERN void scheme_detach_multple_array(Scheme_Object **a);
00344 
00345 /*========================================================================*/
00346 /*                           memory management                            */
00347 /*========================================================================*/
00348 
00349 /* The core allocator functions depend on the GC. Macros in scheme.h */
00350 /*  map to the apporpriate core allocation function. */
00351 
00352 #ifndef SCHEME_NO_GC
00353 # ifndef SCHEME_NO_GC_PROTO
00354 MZ_EXTERN void *GC_malloc(size_t size_in_bytes);
00355 MZ_EXTERN void *GC_malloc_atomic(size_t size_in_bytes);
00356 #  ifdef MZ_PRECISE_GC
00357 MZ_EXTERN void *GC_malloc_one_tagged(size_t size_in_bytes);
00358 MZ_EXTERN void *GC_malloc_atomic_uncollectable(size_t size_in_bytes);
00359 MZ_EXTERN void *scheme_malloc_uncollectable(size_t size_in_bytes);
00360 MZ_EXTERN void *GC_malloc_array_tagged(size_t size_in_bytes);
00361 MZ_EXTERN void *GC_malloc_allow_interior(size_t size_in_bytes);
00362 MZ_EXTERN void *GC_malloc_atomic_allow_interior(size_t size_in_bytes);
00363 MZ_EXTERN void *GC_malloc_tagged_allow_interior(size_t size_in_bytes);
00364 #  else
00365 MZ_EXTERN void *GC_malloc_stubborn(size_t size_in_bytes);
00366 MZ_EXTERN void *GC_malloc_uncollectable(size_t size_in_bytes);
00367 #  endif
00368 # endif
00369 #endif
00370 
00371 MZ_EXTERN void *scheme_malloc_code(long size);
00372 MZ_EXTERN void scheme_free_code(void *p);
00373 #ifndef MZ_PRECISE_GC
00374 MZ_EXTERN void *scheme_malloc_gcable_code(long size);
00375 #endif
00376 
00377 
00378 MZ_EXTERN void *scheme_malloc_eternal(size_t n);
00379 MZ_EXTERN void scheme_end_stubborn_change(void *p);
00380 
00381 MZ_EXTERN void *scheme_calloc(size_t num, size_t size);
00382 
00383 MZ_EXTERN char *scheme_strdup(const char *str);
00384 MZ_EXTERN char *scheme_strdup_eternal(const char *str);
00385 
00386 MZ_EXTERN void *scheme_malloc_fail_ok(void *(*f)(size_t), size_t);
00387 
00388 #ifndef MZ_PRECISE_GC
00389 MZ_EXTERN void scheme_weak_reference(void **p);
00390 MZ_EXTERN void scheme_weak_reference_indirect(void **p, void *v);
00391 MZ_EXTERN void scheme_unweak_reference(void **p);
00392 #endif
00393 MZ_EXTERN void scheme_add_finalizer(void *p, void (*f)(void *p, void *data), void *data);
00394 MZ_EXTERN void scheme_add_finalizer_once(void *p, void (*f)(void *p, void *data), void *data);
00395 MZ_EXTERN void scheme_subtract_finalizer(void *p, void (*f)(void *p, void *data), void *data);
00396 MZ_EXTERN void scheme_add_scheme_finalizer(void *p, void (*f)(void *p, void *data), void *data);
00397 MZ_EXTERN void scheme_add_scheme_finalizer_once(void *p, void (*f)(void *p, void *data), void *data);
00398 MZ_EXTERN void scheme_register_finalizer(void *p,
00399                                     void (*f)(void *p, void *data), void *data,
00400                                     void (**oldf)(void *p, void *data),
00401                                     void **olddata);
00402 MZ_EXTERN void scheme_remove_all_finalization(void *p);
00403 
00404 MZ_EXTERN void scheme_dont_gc_ptr(void *p);
00405 MZ_EXTERN void scheme_gc_ptr_ok(void *p);
00406 
00407 MZ_EXTERN void scheme_collect_garbage(void);
00408 
00409 #ifdef MZ_PRECISE_GC
00410 MZ_EXTERN THREAD_LOCAL void **GC_variable_stack;
00411 MZ_EXTERN void GC_register_traversers(short tag, Size_Proc size, Mark_Proc mark, Fixup_Proc fixup,
00412                                   int is_constant_size, int is_atomic);
00413 MZ_EXTERN void *GC_resolve(void *p);
00414 MZ_EXTERN void GC_mark(const void *p);
00415 MZ_EXTERN void GC_fixup(void *p);
00416 MZ_EXTERN void *GC_fixup_self(void *p);
00417 #endif
00418 
00419 MZ_EXTERN void **scheme_malloc_immobile_box(void *p);
00420 MZ_EXTERN void scheme_free_immobile_box(void **b);
00421 
00422 /*========================================================================*/
00423 /*                             hash tables                                */
00424 /*========================================================================*/
00425 
00426 MZ_EXTERN Scheme_Bucket_Table *scheme_make_bucket_table(int size_hint, int type);
00427 MZ_EXTERN void scheme_add_to_table(Scheme_Bucket_Table *table, const char *key, void *val, int);
00428 MZ_EXTERN void scheme_change_in_table(Scheme_Bucket_Table *table, const char *key, void *new_val);
00429 MZ_EXTERN void *scheme_lookup_in_table(Scheme_Bucket_Table *table, const char *key);
00430 MZ_EXTERN Scheme_Bucket *scheme_bucket_from_table(Scheme_Bucket_Table *table, const char *key);
00431 MZ_EXTERN int scheme_bucket_table_equal(Scheme_Bucket_Table *t1, Scheme_Bucket_Table *t2);
00432 MZ_EXTERN Scheme_Bucket_Table *scheme_clone_bucket_table(Scheme_Bucket_Table *bt);
00433 
00434 MZ_EXTERN Scheme_Hash_Table *scheme_make_hash_table(int type);
00435 MZ_EXTERN Scheme_Hash_Table *scheme_make_hash_table_equal();
00436 MZ_EXTERN Scheme_Hash_Table *scheme_make_hash_table_eqv();
00437 MZ_EXTERN void scheme_hash_set(Scheme_Hash_Table *table, Scheme_Object *key, Scheme_Object *val);
00438 MZ_EXTERN Scheme_Object *scheme_hash_get(Scheme_Hash_Table *table, Scheme_Object *key);
00439 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_eq_hash_get(Scheme_Hash_Table *table, Scheme_Object *key);
00440 MZ_EXTERN void scheme_hash_set_atomic(Scheme_Hash_Table *table, Scheme_Object *key, Scheme_Object *val);
00441 MZ_EXTERN Scheme_Object *scheme_hash_get_atomic(Scheme_Hash_Table *table, Scheme_Object *key);
00442 MZ_EXTERN int scheme_hash_table_equal(Scheme_Hash_Table *t1, Scheme_Hash_Table *t2);
00443 MZ_EXTERN int scheme_is_hash_table_equal(Scheme_Object *o);
00444 MZ_EXTERN int scheme_is_hash_table_eqv(Scheme_Object *o);
00445 MZ_EXTERN Scheme_Hash_Table *scheme_clone_hash_table(Scheme_Hash_Table *bt);
00446 
00447 MZ_EXTERN Scheme_Hash_Tree *scheme_make_hash_tree(int kind);
00448 MZ_EXTERN Scheme_Hash_Tree *scheme_hash_tree_set(Scheme_Hash_Tree *tree, Scheme_Object *key, Scheme_Object *val);
00449 MZ_EXTERN Scheme_Object *scheme_hash_tree_get(Scheme_Hash_Tree *tree, Scheme_Object *key);
00450 MZ_EXTERN long scheme_hash_tree_next(Scheme_Hash_Tree *tree, long pos);
00451 MZ_EXTERN int scheme_hash_tree_index(Scheme_Hash_Tree *tree, long pos, Scheme_Object **_key, Scheme_Object **_val);
00452 MZ_EXTERN int scheme_hash_tree_equal(Scheme_Hash_Tree *t1, Scheme_Hash_Tree *t2);
00453 MZ_EXTERN int scheme_is_hash_tree_equal(Scheme_Object *o);
00454 MZ_EXTERN int scheme_is_hash_tree_eqv(Scheme_Object *o);
00455 
00456 /*========================================================================*/
00457 /*                   basic Scheme value constructors                      */
00458 /*========================================================================*/
00459 
00460 MZ_EXTERN Scheme_Object *scheme_make_prim(Scheme_Prim *prim);
00461 MZ_EXTERN Scheme_Object *scheme_make_noneternal_prim(Scheme_Prim *prim);
00462 MZ_EXTERN Scheme_Object *scheme_make_prim_w_arity(Scheme_Prim *prim, const char *name,
00463                                    mzshort mina, mzshort maxa);
00464 MZ_EXTERN Scheme_Object *scheme_make_folding_prim(Scheme_Prim *prim,
00465                                    const char *name,
00466                                    mzshort mina, mzshort maxa,
00467                                    short functional);
00468 MZ_EXTERN Scheme_Object *scheme_make_immed_prim(Scheme_Prim *prim,
00469                                            const char *name,
00470                                            mzshort mina, mzshort maxa);
00471 MZ_EXTERN Scheme_Object *scheme_make_noncm_prim(Scheme_Prim *prim,
00472                                           const char *name,
00473                                           mzshort mina, mzshort maxa);
00474 MZ_EXTERN Scheme_Object *scheme_make_noneternal_prim_w_arity(Scheme_Prim *prim,
00475                                              const char *name,
00476                                              mzshort mina, mzshort maxa);
00477 MZ_EXTERN Scheme_Object *scheme_make_prim_w_everything(Scheme_Prim *fun, int eternal,
00478                                                  const char *name,
00479                                                  mzshort mina, mzshort maxa,
00480                                                  int folding,
00481                                                  mzshort minr, mzshort maxr);
00482 
00483 MZ_EXTERN Scheme_Object *scheme_make_prim_closure_w_arity(Scheme_Primitive_Closure_Proc *prim,
00484                                                    int size, Scheme_Object **vals,
00485                                                    const char *name,
00486                                                    mzshort mina, mzshort maxa);
00487 MZ_EXTERN Scheme_Object *scheme_make_folding_prim_closure(Scheme_Primitive_Closure_Proc *prim,
00488                                                    int size, Scheme_Object **vals,
00489                                                    const char *name,
00490                                                    mzshort mina, mzshort maxa,
00491                                                    short functional);
00492 
00493 MZ_EXTERN Scheme_Object *scheme_make_closed_prim(Scheme_Closed_Prim *prim, void *data);
00494 MZ_EXTERN Scheme_Object *scheme_make_closed_prim_w_arity(Scheme_Closed_Prim *prim,
00495                                                   void *data, const char *name,
00496                                                   mzshort mina, mzshort maxa);
00497 MZ_EXTERN Scheme_Object *scheme_make_folding_closed_prim(Scheme_Closed_Prim *prim,
00498                                                   void *data, const char *name,
00499                                                   mzshort mina, mzshort maxa,
00500                                                   short functional);
00501 MZ_EXTERN Scheme_Object *scheme_make_closed_prim_w_everything(Scheme_Closed_Prim *fun,
00502                                                        void *data,
00503                                                        const char *name,
00504                                                        mzshort mina, mzshort maxa,
00505                                                        short folding,
00506                                                        mzshort minr, mzshort maxr);
00507 
00508 MZ_EXTERN void scheme_prim_is_method(Scheme_Object *o);
00509 
00510 MZ_EXTERN Scheme_Object *scheme_make_pair(Scheme_Object *car, Scheme_Object *cdr);
00511 MZ_EXTERN Scheme_Object *scheme_make_mutable_pair(Scheme_Object *car, Scheme_Object *cdr);
00512 
00513 MZ_EXTERN Scheme_Object *scheme_make_raw_pair(Scheme_Object *, Scheme_Object *);
00514 
00515 MZ_EXTERN Scheme_Object *scheme_make_byte_string(const char *chars);
00516 MZ_EXTERN Scheme_Object *scheme_make_sized_byte_string(char *chars, long len, int copy);
00517 MZ_EXTERN Scheme_Object *scheme_make_sized_offset_byte_string(char *chars, long d, long len, int copy);
00518 MZ_EXTERN Scheme_Object *scheme_make_immutable_sized_byte_string(char *chars, long len, int copy);
00519 MZ_EXTERN Scheme_Object *scheme_make_byte_string_without_copying(char *chars);
00520 MZ_EXTERN Scheme_Object *scheme_alloc_byte_string(long size, char fill);
00521 MZ_EXTERN Scheme_Object *scheme_append_byte_string(Scheme_Object *, Scheme_Object *);
00522 
00523 MZ_EXTERN Scheme_Object *scheme_make_utf8_string(const char *chars);
00524 MZ_EXTERN Scheme_Object *scheme_make_sized_utf8_string(char *chars, long len);
00525 MZ_EXTERN Scheme_Object *scheme_make_sized_offset_utf8_string(char *chars, long d, long len);
00526 MZ_EXTERN Scheme_Object *scheme_make_immutable_sized_utf8_string(char *chars, long len);
00527 
00528 MZ_EXTERN Scheme_Object *scheme_make_locale_string(const char *chars);
00529 
00530 MZ_EXTERN Scheme_Object *scheme_char_string_to_byte_string(Scheme_Object *s);
00531 MZ_EXTERN Scheme_Object *scheme_byte_string_to_char_string(Scheme_Object *s);
00532 MZ_EXTERN Scheme_Object *scheme_char_string_to_byte_string_locale(Scheme_Object *s);
00533 MZ_EXTERN Scheme_Object *scheme_byte_string_to_char_string_locale(Scheme_Object *s);
00534 MZ_EXTERN Scheme_Object *scheme_char_string_to_path(Scheme_Object *p);
00535 MZ_EXTERN Scheme_Object *scheme_path_to_char_string(Scheme_Object *p);
00536 
00537 MZ_EXTERN Scheme_Object *scheme_make_char_string(const mzchar *chars);
00538 MZ_EXTERN Scheme_Object *scheme_make_sized_char_string(mzchar *chars, long len, int copy);
00539 MZ_EXTERN Scheme_Object *scheme_make_sized_offset_char_string(mzchar *chars, long d, long len, int copy);
00540 MZ_EXTERN Scheme_Object *scheme_make_immutable_sized_char_string(mzchar *chars, long len, int copy);
00541 MZ_EXTERN Scheme_Object *scheme_make_char_string_without_copying(mzchar *chars);
00542 MZ_EXTERN Scheme_Object *scheme_alloc_char_string(long size, mzchar fill);
00543 MZ_EXTERN Scheme_Object *scheme_append_char_string(Scheme_Object *, Scheme_Object *);
00544 
00545 MZ_EXTERN mzchar *scheme_string_recase(mzchar *s, int d, int len, int mode, int inplace, int *_len);
00546 
00547 MZ_EXTERN Scheme_Object *scheme_make_vector(long size, Scheme_Object *fill);
00548 MZ_EXTERN Scheme_Object *scheme_make_integer_value(long i);
00549 MZ_EXTERN Scheme_Object *scheme_make_integer_value_from_unsigned(unsigned long i);
00550 MZ_EXTERN Scheme_Object *scheme_make_integer_value_from_long_long(mzlonglong i);
00551 MZ_EXTERN Scheme_Object *scheme_make_integer_value_from_unsigned_long_long(umzlonglong i);
00552 MZ_EXTERN Scheme_Object *scheme_make_integer_value_from_long_halves(unsigned long lowhalf, unsigned long hihalf);
00553 MZ_EXTERN Scheme_Object *scheme_make_integer_value_from_unsigned_long_halves(unsigned long lowhalf, unsigned long hihalf);
00554 MZ_EXTERN Scheme_Object *scheme_make_double(double d);
00555 #ifdef MZ_USE_SINGLE_FLOATS
00556 MZ_EXTERN Scheme_Object *scheme_make_float(float f) ;
00557 #endif
00558 MZ_EXTERN Scheme_Object *scheme_make_char(mzchar ch);
00559 MZ_EXTERN Scheme_Object *scheme_make_char_or_nul(mzchar ch);
00560 MZ_EXTERN Scheme_Object *scheme_make_sema(long v);
00561 MZ_EXTERN void scheme_post_sema(Scheme_Object *o);
00562 MZ_EXTERN void scheme_post_sema_all(Scheme_Object *o);
00563 MZ_EXTERN int scheme_wait_sema(Scheme_Object *o, int just_try);
00564 XFORM_NONGCING MZ_EXTERN int scheme_try_plain_sema(Scheme_Object *o);
00565 MZ_EXTERN Scheme_Object **scheme_char_constants;
00566 
00567 MZ_EXTERN Scheme_Object *scheme_make_channel();
00568 MZ_EXTERN Scheme_Object *scheme_make_channel_put_evt(Scheme_Object *ch, Scheme_Object *v);
00569 
00570 XFORM_NONGCING MZ_EXTERN int scheme_get_int_val(Scheme_Object *o, long *v);
00571 XFORM_NONGCING MZ_EXTERN int scheme_get_unsigned_int_val(Scheme_Object *o, unsigned long *v);
00572 XFORM_NONGCING MZ_EXTERN int scheme_get_long_long_val(Scheme_Object *o, mzlonglong *v);
00573 XFORM_NONGCING MZ_EXTERN int scheme_get_unsigned_long_long_val(Scheme_Object *o, umzlonglong *v);
00574 
00575 XFORM_NONGCING MZ_EXTERN double scheme_real_to_double(Scheme_Object *r);
00576 
00577 MZ_EXTERN Scheme_Object *scheme_make_cptr(void *cptr, Scheme_Object *typetag);
00578 MZ_EXTERN Scheme_Object *scheme_make_offset_cptr(void *cptr, long offset, Scheme_Object *typetag);
00579 
00580 MZ_EXTERN const char *scheme_get_proc_name(Scheme_Object *p, int *len, int for_error);
00581 
00582 /*========================================================================*/
00583 /*                               strings                                  */
00584 /*========================================================================*/
00585 
00586 MZ_EXTERN int scheme_utf8_decode(const unsigned char *s, int start, int end, 
00587                              unsigned int *us, int dstart, int dend,
00588                              long *ipos, char utf16, int permissive);
00589 MZ_EXTERN int scheme_utf8_decode_as_prefix(const unsigned char *s, int start, int end, 
00590                                       unsigned int *us, int dstart, int dend,
00591                                       long *ipos, char utf16, int permissive);
00592 MZ_EXTERN int scheme_utf8_decode_all(const unsigned char *s, int len, unsigned int *us, 
00593                                  int permissive);
00594 MZ_EXTERN int scheme_utf8_decode_prefix(const unsigned char *s, int len, unsigned int *us, 
00595                                    int permissive);
00596 MZ_EXTERN mzchar *scheme_utf8_decode_to_buffer(const unsigned char *s, int len, 
00597                                           mzchar *buf, int blen);
00598 MZ_EXTERN mzchar *scheme_utf8_decode_to_buffer_len(const unsigned char *s, int len, 
00599                                              mzchar *buf, int blen, long *rlen);
00600 XFORM_NONGCING MZ_EXTERN int scheme_utf8_decode_count(const unsigned char *s, int start, int end, 
00601                                                 int *_state, int might_continue, int permissive);
00602 
00603 MZ_EXTERN int scheme_utf8_encode(const unsigned int *us, int start, int end, 
00604                              unsigned char *s, int dstart,
00605                              char utf16);
00606 MZ_EXTERN int scheme_utf8_encode_all(const unsigned int *us, int len, unsigned char *s);
00607 
00608 MZ_EXTERN char *scheme_utf8_encode_to_buffer(const mzchar *s, int len, 
00609                                         char *buf, int blen);
00610 MZ_EXTERN char *scheme_utf8_encode_to_buffer_len(const mzchar *s, int len, 
00611                                            char *buf, int blen, long *rlen);
00612 
00613 MZ_EXTERN unsigned short *scheme_ucs4_to_utf16(const mzchar *text, int start, int end, 
00614                                           unsigned short *buf, int bufsize,
00615                                           long *ulen, int term_size);
00616 MZ_EXTERN mzchar *scheme_utf16_to_ucs4(const unsigned short *text, int start, int end, 
00617                                    mzchar *buf, int bufsize,
00618                                    long *ulen, int term_size);
00619 
00620 MZ_EXTERN Scheme_Object *scheme_open_converter(const char *from_e, const char *to_e);
00621 MZ_EXTERN void scheme_close_converter(Scheme_Object *conv);
00622 
00623 /*========================================================================*/
00624 /*                               bignums                                  */
00625 /*========================================================================*/
00626 
00627 MZ_EXTERN Scheme_Object *scheme_make_bignum(long v);
00628 MZ_EXTERN Scheme_Object *scheme_make_bignum_from_unsigned(unsigned long v);
00629 MZ_EXTERN Scheme_Object *scheme_make_bignum_from_long_long(mzlonglong v);
00630 MZ_EXTERN Scheme_Object *scheme_make_bignum_from_unsigned_long_long(umzlonglong v);
00631 MZ_EXTERN double scheme_bignum_to_double(const Scheme_Object *n);
00632 MZ_EXTERN Scheme_Object *scheme_bignum_from_double(double d);
00633 #ifdef MZ_USE_SINGLE_FLOATS
00634 MZ_EXTERN float scheme_bignum_to_float(const Scheme_Object *n);
00635 MZ_EXTERN Scheme_Object *scheme_bignum_from_float(float d);
00636 #else
00637 # define scheme_bignum_to_float scheme_bignum_to_double
00638 # define scheme_bignum_from_float scheme_bignum_from_double
00639 #endif
00640 MZ_EXTERN char *scheme_bignum_to_string(const Scheme_Object *n, int radix);
00641 MZ_EXTERN char *scheme_bignum_to_allocated_string(const Scheme_Object *n, int radix, int alloc);
00642 MZ_EXTERN Scheme_Object *scheme_read_bignum(const mzchar *str, int offset, int radix);
00643 MZ_EXTERN Scheme_Object *scheme_read_bignum_bytes(const char *str, int offset, int radix);
00644 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_bignum_normalize(const Scheme_Object *n);
00645 
00646 /*========================================================================*/
00647 /*                              rationals                                 */
00648 /*========================================================================*/
00649 
00650 MZ_EXTERN Scheme_Object *scheme_make_rational(const Scheme_Object *r, const Scheme_Object *d);
00651 MZ_EXTERN double scheme_rational_to_double(const Scheme_Object *n);
00652 MZ_EXTERN Scheme_Object *scheme_rational_from_double(double d);
00653 #ifdef MZ_USE_SINGLE_FLOATS
00654 MZ_EXTERN float scheme_rational_to_float(const Scheme_Object *n);
00655 MZ_EXTERN Scheme_Object *scheme_rational_from_float(float d);
00656 #else
00657 # define scheme_rational_to_float scheme_rational_to_double
00658 # define scheme_rational_from_float scheme_rational_from_double
00659 #endif
00660 MZ_EXTERN Scheme_Object *scheme_rational_normalize(const Scheme_Object *n);
00661 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_rational_numerator(const Scheme_Object *n);
00662 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_rational_denominator(const Scheme_Object *n);
00663 
00664 /*========================================================================*/
00665 /*                              complexes                                 */
00666 /*========================================================================*/
00667 
00668 MZ_EXTERN Scheme_Object *scheme_make_complex(const Scheme_Object *r, const Scheme_Object *i);
00669 MZ_EXTERN Scheme_Object *scheme_complex_normalize(const Scheme_Object *n);
00670 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_complex_real_part(const Scheme_Object *n);
00671 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_complex_imaginary_part(const Scheme_Object *n);
00672 
00673 /* Exact/inexact: */
00674 XFORM_NONGCING MZ_EXTERN int scheme_is_exact(const Scheme_Object *n);
00675 XFORM_NONGCING MZ_EXTERN int scheme_is_inexact(const Scheme_Object *n);
00676 
00677 /*========================================================================*/
00678 /*                 macros, syntax, and compilation                        */
00679 /*========================================================================*/
00680 
00681 MZ_EXTERN Scheme_Object *scheme_expand(Scheme_Object *form, Scheme_Env *env);
00682 
00683 MZ_EXTERN Scheme_Object *scheme_compile(Scheme_Object *form, Scheme_Env *env, int writeable);
00684 
00685 /*========================================================================*/
00686 /*                               ports                                    */
00687 /*========================================================================*/
00688 
00689 MZ_EXTERN Scheme_Object *scheme_read(Scheme_Object *port);
00690 MZ_EXTERN Scheme_Object *scheme_read_syntax(Scheme_Object *port, Scheme_Object *stxsrc);
00691 MZ_EXTERN void scheme_write(Scheme_Object *obj, Scheme_Object *port);
00692 MZ_EXTERN void scheme_display(Scheme_Object *obj, Scheme_Object *port);
00693 MZ_EXTERN void scheme_print(Scheme_Object *obj, Scheme_Object *port);
00694 MZ_EXTERN void scheme_write_w_max(Scheme_Object *obj, Scheme_Object *port, long maxl);
00695 MZ_EXTERN void scheme_display_w_max(Scheme_Object *obj, Scheme_Object *port, long maxl);
00696 MZ_EXTERN void scheme_print_w_max(Scheme_Object *obj, Scheme_Object *port, long maxl);
00697 MZ_EXTERN void scheme_write_byte_string(const char *str, long len, Scheme_Object *port);
00698 MZ_EXTERN void scheme_write_char_string(const mzchar *str, long len, Scheme_Object *port);
00699 MZ_EXTERN long scheme_put_byte_string(const char *who, Scheme_Object *port,
00700                                   const char *str, long d, long len,
00701                                   int rarely_block);
00702 MZ_EXTERN long scheme_put_char_string(const char *who, Scheme_Object *port,
00703                                   const mzchar *str, long d, long len);
00704 MZ_EXTERN char *scheme_write_to_string(Scheme_Object *obj, long *len);
00705 MZ_EXTERN char *scheme_display_to_string(Scheme_Object *obj, long *len);
00706 MZ_EXTERN char *scheme_print_to_string(Scheme_Object *obj, long *len);
00707 MZ_EXTERN char *scheme_write_to_string_w_max(Scheme_Object *obj, long *len, long maxl);
00708 MZ_EXTERN char *scheme_display_to_string_w_max(Scheme_Object *obj, long *len, long maxl);
00709 MZ_EXTERN char *scheme_print_to_string_w_max(Scheme_Object *obj, long *len, long maxl);
00710 MZ_EXTERN void scheme_debug_print(Scheme_Object *obj);
00711 MZ_EXTERN void scheme_flush_output(Scheme_Object *port);
00712 
00713 MZ_EXTERN char *scheme_format(mzchar *format, int flen, int argc, Scheme_Object **argv, long *rlen);
00714 MZ_EXTERN void scheme_printf(mzchar *format, int flen, int argc, Scheme_Object **argv);
00715 MZ_EXTERN char *scheme_format_utf8(char *format, int flen, int argc, Scheme_Object **argv, long *rlen);
00716 MZ_EXTERN void scheme_printf_utf8(char *format, int flen, int argc, Scheme_Object **argv);
00717 
00718 MZ_EXTERN int scheme_getc(Scheme_Object *port);
00719 MZ_EXTERN int scheme_get_byte(Scheme_Object *port);
00720 MZ_EXTERN int scheme_peekc(Scheme_Object *port);
00721 MZ_EXTERN int scheme_peek_byte(Scheme_Object *port);
00722 MZ_EXTERN int scheme_peekc_skip(Scheme_Object *port, Scheme_Object *skip);
00723 MZ_EXTERN int scheme_peek_byte_skip(Scheme_Object *port, Scheme_Object *skip, Scheme_Object *unless_evt);
00724 MZ_EXTERN int scheme_getc_special_ok(Scheme_Object *port);
00725 MZ_EXTERN int scheme_get_byte_special_ok(Scheme_Object *port);
00726 MZ_EXTERN int scheme_peekc_special_ok(Scheme_Object *port);
00727 MZ_EXTERN int scheme_peek_byte_special_ok_skip(Scheme_Object *port, Scheme_Object *skip, Scheme_Object *unless_evt);
00728 MZ_EXTERN int scheme_peekc_special_ok_skip(Scheme_Object *port, Scheme_Object *skip);
00729 MZ_EXTERN void scheme_ungetc(int ch, Scheme_Object *port);
00730 MZ_EXTERN int scheme_byte_ready(Scheme_Object *port);
00731 MZ_EXTERN int scheme_char_ready(Scheme_Object *port);
00732 MZ_EXTERN int scheme_peekc_is_ungetc(Scheme_Object *port);
00733 MZ_EXTERN void scheme_need_wakeup(Scheme_Object *port, void *fds);
00734 MZ_EXTERN long scheme_get_byte_string(const char *who,
00735                                   Scheme_Object *port,
00736                                   char *buffer, long offset, long size,
00737                                   int only_avail,
00738                                   int peek, Scheme_Object *peek_skip);
00739 MZ_EXTERN long scheme_get_byte_string_unless(const char *who,
00740                                         Scheme_Object *port,
00741                                         char *buffer, long offset, long size,
00742                                         int only_avail,
00743                                         int peek, Scheme_Object *peek_skip,
00744                                         Scheme_Object *unless_evt);
00745 MZ_EXTERN long scheme_get_byte_string_special_ok_unless(const char *who,
00746                                                  Scheme_Object *port,
00747                                                  char *buffer, long offset, long size,
00748                                                  int only_avail,
00749                                                  int peek, Scheme_Object *peek_skip,
00750                                                  Scheme_Object *unless_evt);
00751 MZ_EXTERN Scheme_Object *scheme_progress_evt(Scheme_Object *port);
00752 MZ_EXTERN int scheme_peeked_read(Scheme_Object *port,
00753                              long size,
00754                              Scheme_Object *unless_evt,
00755                              Scheme_Object *target_evt);
00756 MZ_EXTERN long scheme_get_char_string(const char *who,
00757                                   Scheme_Object *port,
00758                                   mzchar *buffer, long offset, long size,
00759                                   int peek, Scheme_Object *peek_skip);
00760 MZ_EXTERN long scheme_get_bytes(Scheme_Object *port, long size, char *buffer, int offset);
00761 MZ_EXTERN Scheme_Object *scheme_get_ready_special(Scheme_Object *port, Scheme_Object *stxsrc, int peek);
00762 MZ_EXTERN long scheme_tell(Scheme_Object *port);
00763 MZ_EXTERN long scheme_output_tell(Scheme_Object *port);
00764 MZ_EXTERN long scheme_tell_line(Scheme_Object *port);
00765 MZ_EXTERN long scheme_tell_column(Scheme_Object *port);
00766 MZ_EXTERN void scheme_tell_all(Scheme_Object *port, long *line, long *col, long *pos);
00767 MZ_EXTERN void scheme_count_lines(Scheme_Object *port);
00768 MZ_EXTERN void scheme_close_input_port(Scheme_Object *port);
00769 MZ_EXTERN void scheme_close_output_port(Scheme_Object *port);
00770 
00771 MZ_EXTERN Scheme_Object *scheme_write_special(int argc, Scheme_Object *argv[]);
00772 MZ_EXTERN Scheme_Object *scheme_write_special_nonblock(int argc, Scheme_Object *argv[]);
00773 
00774 MZ_EXTERN Scheme_Object *scheme_make_write_evt(const char *who, Scheme_Object *port,
00775                                           Scheme_Object *special, char *str, long start, long size);
00776 
00777 MZ_EXTERN Scheme_Port *scheme_port_record(Scheme_Object *port);
00778 MZ_EXTERN Scheme_Input_Port *scheme_input_port_record(Scheme_Object *port);
00779 MZ_EXTERN Scheme_Output_Port *scheme_output_port_record(Scheme_Object *port);
00780 XFORM_NONGCING MZ_EXTERN int scheme_is_input_port(Scheme_Object *port);
00781 XFORM_NONGCING MZ_EXTERN int scheme_is_output_port(Scheme_Object *port);
00782 
00783 MZ_EXTERN Scheme_Object *scheme_make_port_type(const char *name);
00784 MZ_EXTERN Scheme_Input_Port *scheme_make_input_port(Scheme_Object *subtype, void *data,
00785                                               Scheme_Object *name,
00786                                               Scheme_Get_String_Fun get_byte_string_fun,
00787                                               Scheme_Peek_String_Fun peek_string_fun,
00788                                               Scheme_Progress_Evt_Fun progress_evt_fun,
00789                                               Scheme_Peeked_Read_Fun peeked_read_fun,
00790                                               Scheme_In_Ready_Fun byte_ready_fun,
00791                                               Scheme_Close_Input_Fun close_fun,
00792                                               Scheme_Need_Wakeup_Input_Fun need_wakeup_fun,
00793                                               int must_close);
00794 MZ_EXTERN Scheme_Output_Port *scheme_make_output_port(Scheme_Object *subtype, void *data,
00795                                                 Scheme_Object *name,
00796                                                 Scheme_Write_String_Evt_Fun write_byte_string_evt_fun,
00797                                                 Scheme_Write_String_Fun write_byte_string_fun,
00798                                                 Scheme_Out_Ready_Fun ready_fun,
00799                                                 Scheme_Close_Output_Fun close_fun,
00800                                                 Scheme_Need_Wakeup_Output_Fun need_wakeup_fun,
00801                                                 Scheme_Write_Special_Evt_Fun write_special_evt_fun,
00802                                                 Scheme_Write_Special_Fun write_special_fun,
00803                                                 int must_close);
00804 MZ_EXTERN void scheme_set_next_port_custodian(Scheme_Custodian *c);
00805 
00806 MZ_EXTERN void scheme_set_port_location_fun(Scheme_Port *port,
00807                                        Scheme_Location_Fun location_fun);
00808 MZ_EXTERN void scheme_set_port_count_lines_fun(Scheme_Port *port,
00809                                           Scheme_Count_Lines_Fun count_lines_fun);
00810 
00811 MZ_EXTERN Scheme_Object *scheme_progress_evt_via_get(Scheme_Input_Port *port);
00812 MZ_EXTERN int scheme_peeked_read_via_get(Scheme_Input_Port *port,
00813                                     long size,
00814                                     Scheme_Object *unless_evt,
00815                                     Scheme_Object *target_ch);
00816 MZ_EXTERN Scheme_Object *scheme_write_evt_via_write(Scheme_Output_Port *port,
00817                                               const char *str, long offset, long size);
00818 MZ_EXTERN Scheme_Object *scheme_write_special_evt_via_write_special(Scheme_Output_Port *port, 
00819                                                             Scheme_Object *special);
00820 
00821 MZ_EXTERN Scheme_Object *scheme_open_input_file(const char *name, const char *who);
00822 MZ_EXTERN Scheme_Object *scheme_open_output_file(const char *name, const char *who);
00823 MZ_EXTERN Scheme_Object *scheme_open_input_output_file(const char *name, const char *who, Scheme_Object **oport);
00824 MZ_EXTERN Scheme_Object *scheme_open_output_file_with_mode(const char *name, const char *who, int text);
00825 
00826 MZ_EXTERN Scheme_Object *scheme_make_file_input_port(FILE *fp);
00827 MZ_EXTERN Scheme_Object *scheme_make_named_file_input_port(FILE *fp, Scheme_Object *name);
00828 MZ_EXTERN Scheme_Object *scheme_make_file_output_port(FILE *fp);
00829 
00830 MZ_EXTERN Scheme_Object *scheme_make_fd_input_port(int fd, Scheme_Object *name, int regfile, int win_textmode);
00831 MZ_EXTERN Scheme_Object *scheme_make_fd_output_port(int fd, Scheme_Object *name, int regfile, int win_textmode, int read_too);
00832 
00833 MZ_EXTERN Scheme_Object *scheme_make_byte_string_input_port(const char *str);
00834 MZ_EXTERN Scheme_Object *scheme_make_sized_byte_string_input_port(const char *str, long len);
00835 MZ_EXTERN Scheme_Object *scheme_make_byte_string_output_port();
00836 MZ_EXTERN char *scheme_get_sized_byte_string_output(Scheme_Object *port, long *len);
00837 MZ_EXTERN char *scheme_get_reset_sized_byte_string_output(Scheme_Object *port, long *len, int reset, long startpos, long endpos);
00838 
00839 MZ_EXTERN void scheme_pipe(Scheme_Object **read, Scheme_Object **write);
00840 MZ_EXTERN void scheme_pipe_with_limit(Scheme_Object **write, Scheme_Object **read, int maxsize);
00841 
00842 MZ_EXTERN Scheme_Object *scheme_make_null_output_port(int can_write_special);
00843 MZ_EXTERN Scheme_Object *scheme_make_redirect_output_port(Scheme_Object *port);
00844 
00845 MZ_EXTERN long scheme_set_file_position(Scheme_Object *port, long pos);
00846 
00847 MZ_EXTERN int scheme_file_exists(char *filename);
00848 MZ_EXTERN int scheme_directory_exists(char *dirname);
00849 MZ_EXTERN char *scheme_expand_filename(char* filename, int ilen, const char *errorin, int *ex, int guards);
00850 MZ_EXTERN char *scheme_expand_user_filename(char* filename, int ilen, const char *errorin, int *ex, int guards);
00851 MZ_EXTERN char *scheme_expand_string_filename(Scheme_Object *f, const char *errorin, int *ex, int guards);
00852 
00853 MZ_EXTERN char *scheme_os_getcwd(char *buf, int buflen, int *actlen, int noexn);
00854 MZ_EXTERN int scheme_os_setcwd(char *buf, int noexn);
00855 MZ_EXTERN char *scheme_getdrive(void);
00856 
00857 MZ_EXTERN Scheme_Object *scheme_split_path(const char *path, int len, Scheme_Object **base, int *isdir, int kind);
00858 MZ_EXTERN Scheme_Object *scheme_build_path(int argc, Scheme_Object **argv);
00859 MZ_EXTERN Scheme_Object *scheme_path_to_directory_path(Scheme_Object *p);
00860 MZ_EXTERN Scheme_Object *scheme_path_to_complete_path(Scheme_Object *path, Scheme_Object *relto_path);
00861 
00862 MZ_EXTERN Scheme_Object *scheme_make_path(const char *chars);
00863 MZ_EXTERN Scheme_Object *scheme_make_sized_path(char *chars, long len, int copy);
00864 MZ_EXTERN Scheme_Object *scheme_make_sized_offset_path(char *chars, long d, long len, int copy);
00865 MZ_EXTERN Scheme_Object *scheme_make_sized_offset_kind_path(char *chars, long d, long len, int copy, int kind);
00866 MZ_EXTERN Scheme_Object *scheme_make_path_without_copying(char *chars);
00867 
00868 #ifdef MACINTOSH_EVENTS
00869 MZ_EXTERN char *scheme_mac_spec_to_path(mzFSSpec *spec);
00870 MZ_EXTERN int scheme_mac_path_to_spec(const char *filename, mzFSSpec *spec);
00871 #endif
00872 
00873 MZ_EXTERN void *scheme_alloc_fdset_array(int count, int permanent);
00874 MZ_EXTERN void *scheme_init_fdset_array(void *fdarray, int count);
00875 MZ_EXTERN void *scheme_get_fdset(void *fdarray, int pos);
00876 MZ_EXTERN void scheme_fdzero(void *fd);
00877 MZ_EXTERN void scheme_fdset(void *fd, int pos);
00878 MZ_EXTERN void scheme_fdclr(void *fd, int pos);
00879 MZ_EXTERN int scheme_fdisset(void *fd, int pos);
00880 MZ_EXTERN void scheme_add_fd_handle(void *h, void *fds, int repost);
00881 MZ_EXTERN void scheme_add_fd_eventmask(void *fds, int mask);
00882 MZ_EXTERN void scheme_collapse_win_fd(void *fds);
00883 
00884 MZ_EXTERN void scheme_security_check_file(const char *who, const char *filename, int guards);
00885 MZ_EXTERN void scheme_security_check_file_link(const char *who, const char *filename, const char *content);
00886 MZ_EXTERN void scheme_security_check_network(const char *who, const char *host, int port, int client);
00887 
00888 MZ_EXTERN struct mz_addrinfo *scheme_get_host_address(const char *address, int id, int *err, 
00889                                                 int family, int passive, int tcp);
00890 MZ_EXTERN void scheme_free_host_address(struct mz_addrinfo *a);
00891 MZ_EXTERN const char *scheme_host_address_strerror(int errnum);
00892 MZ_EXTERN void scheme_getnameinfo(void *sa, int salen, 
00893                               char *host, int hostlen,
00894                               char *serv, int servlen);
00895 
00896 MZ_EXTERN int scheme_get_port_file_descriptor(Scheme_Object *p, long *_fd);
00897 MZ_EXTERN long scheme_get_port_fd(Scheme_Object *p);
00898 MZ_EXTERN int scheme_get_port_socket(Scheme_Object *p, long *_s);
00899 MZ_EXTERN void scheme_socket_to_ports(long s, const char *name, int takeover,
00900                                       Scheme_Object **_inp, Scheme_Object **_outp);
00901 
00902 MZ_EXTERN void scheme_set_type_printer(Scheme_Type stype, Scheme_Type_Printer printer);
00903 MZ_EXTERN void scheme_print_bytes(Scheme_Print_Params *pp, const char *str, int offset, int len);
00904 MZ_EXTERN void scheme_print_utf8(Scheme_Print_Params *pp, const char *str, int offset, int len);
00905 MZ_EXTERN void scheme_print_string(Scheme_Print_Params *pp, const mzchar *str, int offset, int len);
00906 
00907 MZ_EXTERN Scheme_Object *scheme_read_byte_string(Scheme_Object *port);
00908 
00909 /*========================================================================*/
00910 /*                        namespace/environment                           */
00911 /*========================================================================*/
00912 
00913 MZ_EXTERN Scheme_Object *scheme_make_namespace(int argc, Scheme_Object *argv[]);
00914 MZ_EXTERN void scheme_add_namespace_option(Scheme_Object *key, void (*f)(Scheme_Env *));
00915 
00916 MZ_EXTERN void scheme_add_global(const char *name, Scheme_Object *val, Scheme_Env *env);
00917 MZ_EXTERN void scheme_add_global_symbol(Scheme_Object *name, Scheme_Object *val,
00918                            Scheme_Env *env);
00919 
00920 MZ_EXTERN Scheme_Object *scheme_make_envunbox(Scheme_Object *value);
00921 
00922 MZ_EXTERN Scheme_Object *scheme_lookup_global(Scheme_Object *symbol, Scheme_Env *env);
00923 
00924 MZ_EXTERN Scheme_Bucket *scheme_global_bucket(Scheme_Object *symbol, Scheme_Env *env);
00925 MZ_EXTERN Scheme_Bucket *scheme_global_keyword_bucket(Scheme_Object *symbol, Scheme_Env *env);
00926 MZ_EXTERN Scheme_Bucket *scheme_module_bucket(Scheme_Object *mod, Scheme_Object *var, int pos, Scheme_Env *env);
00927 
00928 MZ_EXTERN Scheme_Object *scheme_builtin_value(const char *name); /* convenience */
00929 
00930 MZ_EXTERN void scheme_set_global_bucket(char *proc, Scheme_Bucket *var, Scheme_Object *val,
00931                                         int set_undef);
00932 MZ_EXTERN void scheme_install_macro(Scheme_Bucket *b, Scheme_Object *v);
00933 
00934 
00935 MZ_EXTERN void scheme_save_initial_module_set(Scheme_Env *env);
00936 MZ_EXTERN Scheme_Env *scheme_primitive_module(Scheme_Object *name, Scheme_Env *for_env);
00937 MZ_EXTERN void scheme_finish_primitive_module(Scheme_Env *env);
00938 MZ_EXTERN void scheme_protect_primitive_provide(Scheme_Env *env, Scheme_Object *name);
00939 
00940 MZ_EXTERN Scheme_Object *scheme_make_modidx(Scheme_Object *path,
00941                               Scheme_Object *base,
00942                               Scheme_Object *resolved);
00943 
00944 MZ_EXTERN Scheme_Object *scheme_apply_for_syntax_in_env(Scheme_Object *proc, Scheme_Env *env);
00945 
00946 MZ_EXTERN Scheme_Object *scheme_dynamic_require(int argc, Scheme_Object *argv[]);
00947 MZ_EXTERN Scheme_Object *scheme_namespace_require(Scheme_Object *);
00948 
00949 MZ_EXTERN int scheme_is_module_path(Scheme_Object *);
00950 
00951 MZ_EXTERN Scheme_Object *scheme_datum_to_kernel_stx(Scheme_Object *e);
00952 
00953 /*========================================================================*/
00954 /*                                symbols                                 */
00955 /*========================================================================*/
00956 
00957 MZ_EXTERN Scheme_Object *scheme_intern_symbol(const char *name);
00958 MZ_EXTERN Scheme_Object *scheme_intern_exact_symbol(const char *name, unsigned int len);
00959 MZ_EXTERN Scheme_Object *scheme_intern_exact_char_symbol(const mzchar *name, unsigned int len);
00960 MZ_EXTERN Scheme_Object *scheme_make_symbol(const char *name); /* Make uninterned */
00961 MZ_EXTERN Scheme_Object *scheme_make_exact_symbol(const char *name, unsigned int len); /* Exact case */
00962 MZ_EXTERN Scheme_Object *scheme_make_exact_char_symbol(const mzchar *name, unsigned int len); /* Exact case */
00963 MZ_EXTERN const char *scheme_symbol_name(Scheme_Object *sym);
00964 MZ_EXTERN const char *scheme_symbol_name_and_size(Scheme_Object *sym, unsigned int *l, int flags);
00965 MZ_EXTERN char *scheme_symbol_val(Scheme_Object *sym);
00966 
00967 MZ_EXTERN Scheme_Object *scheme_intern_exact_keyword(const char *name, unsigned int len);
00968 MZ_EXTERN Scheme_Object *scheme_intern_exact_char_keyword(const mzchar *name, unsigned int len);
00969 
00970 /*========================================================================*/
00971 /*                                structs                                 */
00972 /*========================================================================*/
00973 
00974 MZ_EXTERN Scheme_Object **scheme_make_struct_values(Scheme_Object *struct_type,
00975                                      Scheme_Object **names,
00976                                      int count, int flags);
00977 MZ_EXTERN Scheme_Object **scheme_make_struct_names(Scheme_Object *base,
00978                                     Scheme_Object *field_names,
00979                                     int flags, int *count_out);
00980 MZ_EXTERN Scheme_Object *scheme_make_struct_type(Scheme_Object *base,
00981                                            Scheme_Object *parent,
00982                                            Scheme_Object *inspector,
00983                                            int num_fields, int num_uninit_fields,
00984                                            Scheme_Object *uninit_val,
00985                                            Scheme_Object *properties,
00986                                            Scheme_Object *guard);
00987 MZ_EXTERN Scheme_Object *scheme_make_struct_instance(Scheme_Object *stype,
00988                                                int argc,
00989                                                Scheme_Object **argv);
00990 
00991 MZ_EXTERN Scheme_Object *scheme_make_struct_exptime(Scheme_Object **names, int count,
00992                                               Scheme_Object *super_sym,
00993                                               Scheme_Object *super_exptime,
00994                                               int flags);
00995 
00996 XFORM_NONGCING MZ_EXTERN int scheme_is_struct_instance(Scheme_Object *type, Scheme_Object *v);
00997 MZ_EXTERN Scheme_Object *scheme_struct_ref(Scheme_Object *s, int pos);
00998 MZ_EXTERN void scheme_struct_set(Scheme_Object *s, int pos, Scheme_Object *v);
00999 
01000 MZ_EXTERN Scheme_Object *scheme_make_struct_type_property(Scheme_Object *name);
01001 MZ_EXTERN Scheme_Object *scheme_make_struct_type_property_w_guard(Scheme_Object *name, Scheme_Object *guard);
01002 XFORM_NONGCING MZ_EXTERN Scheme_Object *scheme_struct_type_property_ref(Scheme_Object *prop, Scheme_Object *s);
01003 
01004 MZ_EXTERN Scheme_Object *scheme_make_location(Scheme_Object *src,
01005                                          Scheme_Object *line,
01006                                          Scheme_Object *col,
01007                                          Scheme_Object *pos,
01008                                          Scheme_Object *span);
01009 MZ_EXTERN int scheme_is_location(Scheme_Object *o);
01010 
01011 MZ_EXTERN Scheme_Object *scheme_make_inspector(Scheme_Object *superior);
01012 XFORM_NONGCING MZ_EXTERN int scheme_is_subinspector(Scheme_Object *i, Scheme_Object *sup);
01013 
01014 /*========================================================================*/
01015 /*                              utilities                                 */
01016 /*========================================================================*/
01017 
01018 XFORM_NONGCING MZ_EXTERN int scheme_eq(Scheme_Object *obj1, Scheme_Object *obj2);
01019 XFORM_NONGCING MZ_EXTERN int scheme_eqv(Scheme_Object *obj1, Scheme_Object *obj2);
01020 MZ_EXTERN int scheme_equal(Scheme_Object *obj1, Scheme_Object *obj2);
01021 
01022 #ifdef MZ_PRECISE_GC
01023 XFORM_NONGCING MZ_EXTERN long scheme_hash_key(Scheme_Object *o);
01024 #endif
01025 MZ_EXTERN long scheme_equal_hash_key(Scheme_Object *o);
01026 MZ_EXTERN long scheme_equal_hash_key2(Scheme_Object *o);
01027 MZ_EXTERN long scheme_recur_equal_hash_key(Scheme_Object *o, void *cycle_data);
01028 MZ_EXTERN long scheme_recur_equal_hash_key2(Scheme_Object *o, void *cycle_data);
01029 MZ_EXTERN long scheme_eqv_hash_key(Scheme_Object *o);
01030 MZ_EXTERN long scheme_eqv_hash_key2(Scheme_Object *o);
01031 
01032 MZ_EXTERN void scheme_set_type_equality(Scheme_Type type, 
01033                                         Scheme_Equal_Proc f,
01034                                         Scheme_Primary_Hash_Proc hash1,
01035                                         Scheme_Secondary_Hash_Proc hash2);
01036 MZ_EXTERN int scheme_recur_equal(Scheme_Object *obj1, Scheme_Object *obj2, void *cycle_info);
01037 
01038 MZ_EXTERN Scheme_Object *scheme_build_list(int argc, Scheme_Object **argv);
01039 MZ_EXTERN Scheme_Object *scheme_build_list_offset(int argc, Scheme_Object **argv, int delta);
01040 
01041 MZ_EXTERN int scheme_is_list(Scheme_Object *obj1);
01042 MZ_EXTERN int scheme_list_length(Scheme_Object *list);
01043 MZ_EXTERN int scheme_proper_list_length(Scheme_Object *list);
01044 
01045 MZ_EXTERN Scheme_Object *scheme_alloc_list(int size);
01046 MZ_EXTERN Scheme_Object *scheme_map_1(Scheme_Object *(*f)(Scheme_Object*),
01047                          Scheme_Object *l);
01048 
01049 MZ_EXTERN Scheme_Object *scheme_car(Scheme_Object *pair);
01050 MZ_EXTERN Scheme_Object *scheme_cdr(Scheme_Object *pair);
01051 MZ_EXTERN Scheme_Object *scheme_cadr(Scheme_Object *pair);
01052 MZ_EXTERN Scheme_Object *scheme_caddr(Scheme_Object *pair);
01053 
01054 MZ_EXTERN Scheme_Object *scheme_vector_to_list(Scheme_Object *vec);
01055 MZ_EXTERN Scheme_Object *scheme_list_to_vector(Scheme_Object *list);
01056 
01057 MZ_EXTERN Scheme_Object *scheme_append(Scheme_Object *lstx, Scheme_Object *lsty);
01058 MZ_EXTERN Scheme_Object *scheme_reverse(Scheme_Object *l);
01059 
01060 MZ_EXTERN Scheme_Object *scheme_box(Scheme_Object *v);
01061 MZ_EXTERN Scheme_Object *scheme_unbox(Scheme_Object *obj);
01062 MZ_EXTERN void scheme_set_box(Scheme_Object *b, Scheme_Object *v);
01063 
01064 MZ_EXTERN Scheme_Object *scheme_make_weak_box(Scheme_Object *v);
01065 
01066 MZ_EXTERN Scheme_Object *scheme_make_ephemeron(Scheme_Object *key, Scheme_Object *val);
01067 MZ_EXTERN Scheme_Object *scheme_ephemeron_value(Scheme_Object *o);
01068 MZ_EXTERN Scheme_Object *scheme_ephemeron_key(Scheme_Object *o);
01069 
01070 MZ_EXTERN Scheme_Object *scheme_load(const char *file);
01071 MZ_EXTERN Scheme_Object *scheme_load_extension(const char *filename, Scheme_Env *env);
01072 MZ_EXTERN void scheme_register_extension_global(void *ptr, long size);
01073 
01074 MZ_EXTERN long scheme_get_seconds(void);
01075 MZ_EXTERN long scheme_get_milliseconds(void);
01076 MZ_EXTERN double scheme_get_inexact_milliseconds(void);
01077 MZ_EXTERN long scheme_get_process_milliseconds(void);
01078 MZ_EXTERN long scheme_get_thread_milliseconds(Scheme_Object *thrd);
01079 
01080 MZ_EXTERN char *scheme_banner(void);
01081 MZ_EXTERN char *scheme_version(void);
01082 
01083 MZ_EXTERN int scheme_check_proc_arity(const char *where, int a,
01084                                   int which, int argc, Scheme_Object **argv);
01085 MZ_EXTERN int scheme_check_proc_arity2(const char *where, int a,
01086                                    int which, int argc, Scheme_Object **argv,
01087                                    int false_ok);
01088 
01089 MZ_EXTERN char *scheme_make_provided_string(Scheme_Object *o, int count, int *len);
01090 MZ_EXTERN char *scheme_make_args_string(char *s, int which, int argc, Scheme_Object **argv, long *len);
01091 
01092 MZ_EXTERN const char *scheme_system_library_subpath();
01093 
01094 MZ_EXTERN void scheme_signal_received(void);
01095 
01096 MZ_EXTERN int scheme_char_strlen(const mzchar *s);