Previous: XDR Standard Data Types, Up: Implementation of XDR [Contents][Index]
The following primitives are exported by the (rpc xdr)
module.
They implement the encoding of Scheme values to XDR data types, and
the decoding of binary XDR data to Scheme values. The exact mapping
between XDR data types and Scheme data types has been discussed
earlier.
Encode value (a suitable Scheme value), using XDR type type, into bytevector bv at index. Return the index where encoding ended.
bv should be an R6RS bytevector large enough to hold the XDR
representation of value according to type. To that end, users
may rely on xdr-type-size
(see XDR Type Representations).
Error conditions sub-classing &xdr-error
may be raised during
encoding. The exact exceptions that may be raised are type-dependent
and have been discussed in the previous sections.
Decode from port (a binary input port) a value of XDR type type. Return the decoded value.
Error conditions sub-classing &xdr-error
may be raised during
encoding. The exact exceptions that may be raised are type-dependent
and have been discussed in the previous sections.