mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 13:30:26 +02:00
Move private bytevectors API to a separate header
Also give bytevectors a private type (a struct). * libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): Remove. (SCM_BYTEVECTOR_LENGTH): (SCM_BYTEVECTOR_CONTENTS): Proxy to the C accessors. (SCM_BYTEVECTOR_PARENT): Remove from public API. (SCM_BYTEVECTOR_P, SCM_VALIDATE_BYTEVECTOR): Make public. (scm_c_bytevector_contents): New function. * libguile/bytevectors-internal.h: New file. * libguile/Makefile.am (noinst_HEADERS): Add new file. * libguile/bytevectors.c: * libguile/array-handle.c: * libguile/arrays.c: * libguile/foreign.c: * libguile/goops.c: * libguile/init.c: * libguile/loader.c: * libguile/print.c: * libguile/r6rs-ports.c: * libguile/srfi-4.c: * libguile/strings.c: Adapt to use bytevectors-internal.h as needed, and sometimes to use the internal bytevector type.
This commit is contained in:
parent
51bc69dd1c
commit
0134abce74
14 changed files with 310 additions and 276 deletions
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include "async.h"
|
||||
#include "boolean.h"
|
||||
#include "bytevectors-internal.h"
|
||||
#include "chars.h"
|
||||
#include "dynwind.h"
|
||||
#include "ephemerons.h"
|
||||
|
@ -252,7 +253,8 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0,
|
|||
case scm_tc7_vm_cont:
|
||||
return class_vm_cont;
|
||||
case scm_tc7_bytevector:
|
||||
if (SCM_BYTEVECTOR_ELEMENT_TYPE (x) == SCM_ARRAY_ELEMENT_TYPE_VU8)
|
||||
if (scm_bytevector_element_type (scm_to_bytevector (x))
|
||||
== SCM_ARRAY_ELEMENT_TYPE_VU8)
|
||||
return class_bytevector;
|
||||
else
|
||||
return class_uvec;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue