-/* 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
#ifndef __GH_H
#define __GH_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdio.h>
#include <libguile.h>
#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);
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);
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 */
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);
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)
#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)
/* 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. */
/* void gh_assert(int cond, char *msg, SCM obj); */
+#ifdef __cplusplus
+}
+#endif
#endif /* __GH_H */