diff options
author | Andy Wingo <wingo@pobox.com> | 2009-12-07 11:14:01 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-12-07 11:21:59 +0100 |
commit | 66e78727d602b0c59bf4633951eac17d3697bfc0 (patch) | |
tree | 8121466595e4d5dc1d5d0b7c929e548e3d905de0 /libguile/struct.h | |
parent | ea68d342f18c3d2082ce6a4fb39bd38b6af932cc (diff) | |
download | guile-66e78727d602b0c59bf4633951eac17d3697bfc0.tar.gz |
add scm_c_make_struct[v]
* libguile/struct.h (scm_c_make_struct, scm_c_make_structv): New
functions with which you can make a struct without consing a rest
list.
* libguile/struct.c (scm_struct_init): Refactor to take an array of init
values, not a list.
(scm_make_struct, scm_make_vtable_vtable): Pull the rest arg out into
a list and pass it down to the new array-taking functions.
* libguile/memoize.c: Remove a neeless #include <alloca>.
Diffstat (limited to 'libguile/struct.h')
-rw-r--r-- | libguile/struct.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/struct.h b/libguile/struct.h index 5955e5928..daa1e1ffc 100644 --- a/libguile/struct.h +++ b/libguile/struct.h @@ -147,6 +147,10 @@ SCM_API SCM scm_make_struct_layout (SCM fields); SCM_API SCM scm_struct_p (SCM x); SCM_API SCM scm_struct_vtable_p (SCM x); SCM_API SCM scm_make_struct (SCM vtable, SCM tail_array_size, SCM init); +SCM_API SCM scm_c_make_struct (SCM vtable, size_t n_tail, size_t n_inits, + scm_t_bits init, ...); +SCM_API SCM scm_c_make_structv (SCM vtable, size_t n_tail, size_t n_inits, + scm_t_bits init[]); SCM_API SCM scm_make_vtable (SCM fields, SCM printer); SCM_API SCM scm_make_vtable_vtable (SCM extra_fields, SCM tail_array_size, SCM init); SCM_API SCM scm_struct_ref (SCM handle, SCM pos); |