Next: Bytevectors as Integers, Previous: Bytevector Endianness, Up: Bytevectors [Contents][Index]
Bytevectors can be created, copied, and analyzed with the following procedures and C functions.
Return a new bytevector of len bytes. Optionally, if fill is given, fill it with fill; fill must be in the range [-128,255].
Return true if obj is a bytevector.
Equivalent to scm_is_true (scm_bytevector_p (obj))
.
Return the length in bytes of bytevector bv.
Likewise, return the length in bytes of bytevector bv.
Return is bv1 equals to bv2—i.e., if they have the same length and contents.
Fill positions [start ... end) of bytevector bv with byte fill. start defaults to 0 and end defaults to the length of bv.11
Copy len bytes from source into target, starting reading from source-start (a positive index within source) and writing at target-start.
It is permitted for the source and target regions to overlap. In that case, copying takes place as if the source is first copied into a temporary bytevector and then into the destination.
Return a newly allocated copy of bv.
Return the byte at index in bytevector bv.
Set the byte at index in bv to value.
Low-level C macros are available. They do not perform any type-checking; as such they should be used with care.
Return the length in bytes of bytevector bv.
Return a pointer to the contents of bytevector bv.
R6RS defines (bytevector-fill! bv
fill)
. Arguments start and end are a Guile extension
(cf. vector-fill!
,
string-fill!
).
Next: Bytevectors as Integers, Previous: Bytevector Endianness, Up: Bytevectors [Contents][Index]