X-Git-Url: http://git.hcoop.net/bpt/guile.git/blobdiff_plain/7fee59bd4a8e7e768dc0ecf26756d5c2aaa8463e..e40ffcb6bda47a508fe90822ef892ba0968f2315:/libguile/gh.h diff --git a/libguile/gh.h b/libguile/gh.h index bc7dc0195..4b9c5f19f 100644 --- a/libguile/gh.h +++ b/libguile/gh.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,6 +43,10 @@ #ifndef __GH_H #define __GH_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -57,18 +61,11 @@ #endif /* __GNUC__ */ void gh_enter(int argc, char *argv[], void (*c_main_prog)()); -void gh_repl(); +void gh_repl(int argc, char *argv[]); SCM gh_catch(SCM tag, scm_catch_body_t body, void *body_data, scm_catch_handler_t handler, void *handler_data); -/* SCM gh_catch_with_saved_stack (SCM tag, scm_catch_body_t body, */ -/* void *body_data, scm_catch_handler_t handler, */ -/* void *handler_data); */ SCM gh_standard_handler(void *data, SCM tag, SCM throw_args); -#if 0 -SCM gh_repl_handler(void *data, SCM tag, SCM throw_args); -void gh_enter_repl(int argc, char *argv[], void (*init_proc)()); -#endif /* 0 */ SCM gh_eval_str(char *scheme_code); SCM gh_eval_str_with_catch(char *scheme_code, scm_catch_handler_t handler); @@ -99,6 +96,7 @@ SCM gh_new_procedure4_0(char *proc_name, SCM (*fn)()); SCM gh_new_procedure5_0(char *proc_name, SCM (*fn)()); /* C to Scheme conversion */ +SCM gh_int2scmb(int x); /* this is being phased out */ SCM gh_bool2scm(int x); SCM gh_int2scm(int x); SCM gh_ulong2scm(unsigned long x); @@ -109,6 +107,13 @@ SCM gh_str2scm(char *s, int len); SCM gh_str02scm(char *s); void gh_set_substr(char *src, SCM dst, int start, int len); SCM gh_symbol2scm(char *symbol_str); +SCM gh_ints2scm(int *d, int n); +SCM gh_longs2ivect(long *d, int n); +SCM gh_ulongs2uvect(unsigned long *d, int n); +SCM gh_doubles2scm(double *d, int n); +#ifdef SCM_FLOATS +SCM gh_doubles2dvect(double *d, int n); +#endif /* Scheme to C conversion */ @@ -121,6 +126,7 @@ double gh_scm2double(SCM obj); char *gh_scm2newstr(SCM str, int *lenp); void gh_get_substr(SCM src, char *dst, int start, int len); char *gh_symbol2newstr(SCM sym, int *lenp); +double *gh_scm2doubles(SCM vector); /* type predicates: tell you if an SCM object has a given type */ int gh_boolean_p(SCM val); @@ -155,11 +161,11 @@ SCM gh_define(char *name, SCM val); ends up being identical to gh_list_to_vector() */ #define gh_vector(ls) scm_vector(ls) SCM gh_make_vector(SCM length, SCM val); -SCM gh_vset(SCM vec, SCM pos, SCM val); -SCM gh_vref(SCM vec, SCM pos); -SCM gh_vector_set(SCM vec, SCM pos, SCM val); +SCM gh_vector_set_x(SCM vec, SCM pos, SCM val); SCM gh_vector_ref(SCM vec, SCM pos); -unsigned long gh_vector_length(SCM v); +unsigned long gh_vector_length (SCM v); +unsigned long gh_uniform_vector_length (SCM v); +SCM gh_uniform_vector_ref (SCM v, SCM ilist); #define gh_list_to_vector(ls) scm_vector(ls) #define gh_vector_to_list(v) scm_vector_to_list(ls) @@ -177,8 +183,8 @@ SCM gh_append4(SCM l1, SCM l2, SCM l3, SCM l4); #define gh_list_tail(ls, k) scm_list_tail(ls, k) #define gh_list_ref(ls, k) scm_list_ref(ls, k) #define gh_memq(x, ls) scm_memq(x, ls) -#define gh_memv(x, ls) scm_memqv(x, ls) -#define gh_member(x, ls) scm_memqber(x, ls) +#define gh_memv(x, ls) scm_memv(x, ls) +#define gh_member(x, ls) scm_member(x, ls) #define gh_assq(x, alist) scm_assq(x, alist) #define gh_assv(x, alist) scm_assv(x, alist) #define gh_assoc(x, alist) scm_assoc(x, alist) @@ -213,6 +219,7 @@ SCM gh_call3 (SCM proc, SCM arg1, SCM arg2, SCM arg3); /* reading and writing Scheme objects. */ void gh_display (SCM x); +void gh_write (SCM x); void gh_newline (void); /* void gh_gc_mark(SCM) : mark an SCM as in use. */ @@ -226,5 +233,8 @@ void gh_newline (void); /* void gh_assert(int cond, char *msg, SCM obj); */ +#ifdef __cplusplus +} +#endif #endif /* __GH_H */