mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-06 20:20:20 +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:
parent
9e785509e4
commit
f188424557
5 changed files with 17 additions and 19 deletions
|
@ -25,21 +25,21 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "array-handle.h"
|
|
||||||
#include "arrays.h"
|
|
||||||
#include "boolean.h"
|
#include "boolean.h"
|
||||||
#include "generalized-vectors.h"
|
|
||||||
#include "gsubr.h"
|
#include "gsubr.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "numbers.h"
|
#include "numbers.h"
|
||||||
#include "pairs.h"
|
#include "pairs.h"
|
||||||
#include "ports.h"
|
#include "ports.h"
|
||||||
#include "srfi-4.h"
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#include "bitvectors.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,
|
/* Bit vectors. Would be nice if they were implemented on top of bytevectors,
|
||||||
* but alack, all we have is this crufty C.
|
* but alack, all we have is this crufty C.
|
||||||
|
@ -756,8 +756,6 @@ scm_istr2bve (SCM str)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_BIT, scm_make_bitvector)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
scm_init_bitvectors ()
|
scm_init_bitvectors ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,10 @@
|
||||||
#include "gsubr.h"
|
#include "gsubr.h"
|
||||||
|
|
||||||
#include "generalized-vectors.h"
|
#include "generalized-vectors.h"
|
||||||
|
#include "array-handle.h"
|
||||||
|
#include "vectors.h"
|
||||||
|
#include "bitvectors.h"
|
||||||
|
#include "strings.h"
|
||||||
|
|
||||||
struct scm_t_vector_ctor
|
struct scm_t_vector_ctor
|
||||||
{
|
{
|
||||||
|
@ -67,6 +70,11 @@ SCM_DEFINE (scm_make_generalized_vector, "make-generalized-vector", 2, 1, 0,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#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
|
void
|
||||||
scm_init_generalized_vectors ()
|
scm_init_generalized_vectors ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
/* FIXME move array-handle functions to array-handle.[hc] */
|
||||||
|
|
||||||
#include "libguile/array-handle.h"
|
#include "libguile/array-handle.h"
|
||||||
|
|
||||||
SCM_API SCM scm_make_srfi_4_vector (SCM type, SCM len, SCM fill);
|
SCM_API SCM scm_make_srfi_4_vector (SCM type, SCM len, SCM fill);
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include "chars.h"
|
#include "chars.h"
|
||||||
#include "deprecation.h"
|
#include "deprecation.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "generalized-vectors.h"
|
|
||||||
#include "gsubr.h"
|
#include "gsubr.h"
|
||||||
#include "numbers.h"
|
#include "numbers.h"
|
||||||
#include "pairs.h"
|
#include "pairs.h"
|
||||||
|
@ -2493,8 +2492,6 @@ scm_i_get_substring_spec (size_t len,
|
||||||
*cend = scm_to_unsigned_integer (end, *cstart, len);
|
*cend = scm_to_unsigned_integer (end, *cstart, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_CHAR, scm_make_string)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
scm_init_strings ()
|
scm_init_strings ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,10 +34,6 @@
|
||||||
#include "vectors.h"
|
#include "vectors.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// You're next
|
|
||||||
#include "array-handle.h"
|
|
||||||
#include "generalized-vectors.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define VECTOR_MAX_LENGTH (SCM_T_BITS_MAX >> 8)
|
#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
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
|
||||||
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_SCM, scm_make_vector)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
scm_init_vectors ()
|
scm_init_vectors ()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue