diff options
author | Andy Wingo <wingo@pobox.com> | 2009-07-18 12:43:54 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-07-19 15:15:44 +0200 |
commit | f45eccffa73c043466a4cc0f5037132ee5795eee (patch) | |
tree | 16e441eddc02d5274cd61592814ea29bbe55b73d /libguile/extensions.c | |
parent | 476b894c71b436f3befb8af46b899aaf244763e2 (diff) | |
download | guile-f45eccffa73c043466a4cc0f5037132ee5795eee.tar.gz |
add registry of vector constructors, make-generalized-vector
* libguile/generalized-vectors.h:
* libguile/generalized-vectors.c: Add a registry of vector constructors.
(scm_make_generalized_vector): New public function, constructs a
vector of a given type.
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/srfi-4.c:
* libguile/strings.c:
* libguile/vectors.c: Register vector constructors.
* libguile/extensions.c (scm_init_extensions): No need to NULL the list
of registered extensions here, the static init does it for us. Allows
scm_c_register_extension to be called before scm_init_extensions.
* libguile/init.c (scm_i_init_guile): Move array initialization earlier,
so e.g. scm_init_strings has access to a valid list of array element
types when registering its vector constructor.
Diffstat (limited to 'libguile/extensions.c')
-rw-r--r-- | libguile/extensions.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libguile/extensions.c b/libguile/extensions.c index 54351dd9c..d01e9c656 100644 --- a/libguile/extensions.c +++ b/libguile/extensions.c @@ -1,6 +1,6 @@ /* extensions.c - registering and loading extensions. * - * Copyright (C) 2001, 2006 Free Software Foundation, Inc. + * Copyright (C) 2001, 2006, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -41,7 +41,7 @@ typedef struct extension_t void *data; } extension_t; -static extension_t *registered_extensions; +static extension_t *registered_extensions = NULL; /* Register a LIB/INIT pair for use by `scm_load_extension'. LIB is allowed to be NULL and then only INIT is used to identify the @@ -157,7 +157,6 @@ SCM_DEFINE (scm_load_extension, "load-extension", 2, 0, 0, void scm_init_extensions () { - registered_extensions = NULL; #include "libguile/extensions.x" } |