1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-06 04:00:26 +02:00

Pull generalized-vectors from under bitvector/string/vector

* libguile/generalized-vectors.c: Collect the register array type functions here.
* libguile/strings.c: Remove array registry code. Fix includes.
* libguile/vectors.c: Remove array registry code. Fix includes.
* libguile/bitvectors.c: Remove array registry code. Fix includes.
This commit is contained in:
Daniel Llorens 2020-02-06 15:18:14 +01:00
parent 9e785509e4
commit f188424557
5 changed files with 17 additions and 19 deletions

View file

@ -25,21 +25,21 @@
#endif
#include <string.h>
#include <stdbool.h>
#include "array-handle.h"
#include "arrays.h"
#include "boolean.h"
#include "generalized-vectors.h"
#include "gsubr.h"
#include "list.h"
#include "numbers.h"
#include "pairs.h"
#include "ports.h"
#include "srfi-4.h"
#include <stdbool.h>
#include "bitvectors.h"
/* FIXME move functions using these (operating on rank-1 bit arrays, not
bitvectors) to a separate source file
*/
#include "arrays.h"
#include "srfi-4.h"
/* Bit vectors. Would be nice if they were implemented on top of bytevectors,
* but alack, all we have is this crufty C.
@ -756,8 +756,6 @@ scm_istr2bve (SCM str)
return res;
}
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_BIT, scm_make_bitvector)
void
scm_init_bitvectors ()
{

View file

@ -28,7 +28,10 @@
#include "gsubr.h"
#include "generalized-vectors.h"
#include "array-handle.h"
#include "vectors.h"
#include "bitvectors.h"
#include "strings.h"
struct scm_t_vector_ctor
{
@ -67,6 +70,11 @@ SCM_DEFINE (scm_make_generalized_vector, "make-generalized-vector", 2, 1, 0,
}
#undef FUNC_NAME
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_SCM, scm_make_vector)
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_BIT, scm_make_bitvector)
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_CHAR, scm_make_string)
void
scm_init_generalized_vectors ()
{

View file

@ -22,6 +22,8 @@
<https://www.gnu.org/licenses/>. */
/* FIXME move array-handle functions to array-handle.[hc] */
#include "libguile/array-handle.h"
SCM_API SCM scm_make_srfi_4_vector (SCM type, SCM len, SCM fill);

View file

@ -37,7 +37,6 @@
#include "chars.h"
#include "deprecation.h"
#include "error.h"
#include "generalized-vectors.h"
#include "gsubr.h"
#include "numbers.h"
#include "pairs.h"
@ -2493,8 +2492,6 @@ scm_i_get_substring_spec (size_t len,
*cend = scm_to_unsigned_integer (end, *cstart, len);
}
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_CHAR, scm_make_string)
void
scm_init_strings ()
{

View file

@ -34,10 +34,6 @@
#include "vectors.h"
#include <string.h>
// You're next
#include "array-handle.h"
#include "generalized-vectors.h"
#define VECTOR_MAX_LENGTH (SCM_T_BITS_MAX >> 8)
@ -429,9 +425,6 @@ SCM_DEFINE (scm_vector_move_right_x, "vector-move-right!", 5, 0, 0,
}
#undef FUNC_NAME
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_SCM, scm_make_vector)
void
scm_init_vectors ()
{