<\body> In Scheme, bytes are put in bytevectors. Often, when a procedure needs to act on a bytevector, it does not need to act on the whole bytevector, but only on a (contiguous) part of the bytevector. This can be accomplished by passing the procedure position and length arguments, but this is prone to errors such as incorrect bounds calculations. To solve this, are implemented in . A bytevector slice is a structure referring to a bytevector, with a position inside the bytevector and the length (in bytes) of the bytevector. They can be accessed with , and respectively. <\warning> The first two procedures, and , are considered low-level \V it is intended to, at some point in the future, replace them with a single pointer. Using them outside low-level code is recommended against when alternatives are available. Bytevector slices also have a very limited system, to avoid accidental writes when a slice should only be read and to avoid accidental reads when a slice should only be written. However, this is not a true capability model, as it can be circumvented by using and (i.e., slices are forgable) and because the only possible capabilities (read of write or read-write) are very coarse-grained; it is impossible to refine it. <\explain> )> )> )> <|explain> Select a part of the bytevector slice , preserving capabilities. Start at the byte at index in the old slice and let the new slice have as length. If is absent, start at index 0. If is absent, select the whole remaining part of . The new slice must remain within the old slice. If not, an error is raised . <\explain> , , <|explain> These procedures function exactly the same as , except that the capabilities are changed to read-only, write-only and read-write respectively. The old capabilities must be an upper bound on the new capabilities; capabilities cannot be gained with these procedures. If the new capabilities exceed the old capabilities, an exception is raised, with the \<#2018\>what\<#2019\> field set to the symbol . <\explain> , , <|explain> These procedures behave like , and , except that as first argument they accept a bytevector instead of a bytevector slice. They also never raise a . <\warning> In the future, and could be modified to check if the bytevector is read-only or read-write (bytevectors that are part of the program text may not be modified in Guile Scheme). <\explain> )> .> <\explain> )> )> )> <|explain> makes a fresh read-write slice with the same contents as . It requires to be readable \U if not, a exception is raised, with the \<#2018\>what\<#2019\> field set to the symbol . behaves the same as , except for returning a read-only slice instead of a read-write slice. behave the same as , except for returning a bytevector instead of a read-write slice. <\explain> )> <|explain> Return if is a slice, otherwise. <\explain> )> if the slice is readable, otherwise.> <\explain> )> if the slice is writable, otherwise.> <\explain> )> <|explain> Return if the two readable bytevector slices and have the same contents, i.e., they have the same length and the same octet at each index. If one of the slices is not readable, a exception is raised, with the \<#2018\>what\<#2019\> field set to the name of the argument as a symbol. If both slices are not readable, it is unspecified whether \<#2018\>what\<#2019\> is \<#2018\>this\<#2019\> or \<#2018\>that\<#2019\>. To read the value at a (byte) index in the slice, the procedures are used. Likewise, to set the value at a certain byte index, the procedures are used. must be one of the following: <\description> , u16, u32, u64>An unsigned 8-bit, 16-bit, 32-bit and 64-bit integer, respectively. I.e., an (exact) integer in the (closed) range -1|]>>, where is the number of bits. , s16, s32, s64>A signed 8-bit, 16-bit, 32-bit and 64-bit integer, respectively, encoded in the representation. I.e., an (exact) integer in the (closed) range ,2-1|]>>. >A , in binary64/double|https://en.wikipedia.org/wiki/Double-precision_floating-point_format> format. Except for and , can be called as )>, where is the bytevector slice, is the byte index into the slice and is the according to which the bytes of the type are ordered. Endianness is part of ). For communication over the network (including communication between clients and services), big-endian (i.e., ) is almost always used in GNUnet. Except for and , can be called as )>, where , and have the same meaning as for , and is the value to set it to. be a exact for > For and , there is only a single byte and hence there is no endianness. As such, , , and do not have an endianness argument. Aside from that, they behave similarly to the other and procedures. requires the slice to be readable, if not, an appropriate exception is raised. Likewise, requires the slice to be writable. Both require the part of the slice that is being read to be in-bounds. The module defines a few for use with Guile-Quickcheck: <\explain> )> octets.> <\explain> )> octets.> \ <\initial> <\collection>