Next: XDR Encoding and Decoding, Previous: XDR Type Representations, Up: Implementation of XDR [Contents][Index]
All the basic data types defined by XDR are defined in the (rpc
xdr types)
module.
XDR’s 32-bit and 64-bit signed and unsigned integer types. This type decodes to/encodes from Scheme exact numbers.
32-bit and 64-bit IEEE-754 floating point numbers. This type decodes to/encodes from Scheme inexact numbers. Note that XDR also defines a “quadruple-precision floating point type” (i.e., 128-bit long) that is currently not available (FIXME).
The “void” type that yields zero bits. Any Scheme value is suitable
as an input when encoding with this type. When decoding this type,
the %void
value (which may be compared via eq?
) is
returned.
XDR provides support for “enumerations”, similar to that found in C. An enumeration type maps symbols to integers and are actually encoded as 32-bit integers.
Return an enumeration type that obeys the symbol-integer mapping
provided in enum-alist which should be a list of symbol-integer
pairs. The returned type decodes to/encodes from Scheme symbols, as
provided in enum-alist. Upon decoding/encoding of an
enumeration, an &xdr-enumeration-error
is raised if an
incorrect value (i.e., one not listed in enum-alist) is found.
XDR’s boolean type which is an enumeration. It encodes to/decodes
from Scheme symbols TRUE
and FALSE
.
Several fixed-size and variable-size are predefined in the standard.
Return a fixed-length “opaque” array of size octets. An opaque array is simply a sequence of octets.
The returned XDR type object is actually an <xdr-struct-type>
object. Thus, it encodes from/decodes to Scheme lists of exact
integers. Conversion to a Scheme string, if needed, is left to the
user.
Return a variable-length opaque array. As for
make-xdr-vector-type
(see XDR Type Representations),
limit can be either a number specifying the maximum number of
elements that can be held by the created type, or #f
in which
case the variable-length array can hold up to 2^32 - 1 octets.
The returned XDR type object is actually an <xdr-vector-type>
object. Thus, it encodes from/decodes to Scheme vectors of exact
integers.
This is a synonym of make-xdr-variable-length-opaque-array
since XDR’s string type actually represents ASCII strings, i.e.,
sequences of octets.
These convenience variables contain the unlimited variable-length opaque array.
Next: XDR Encoding and Decoding, Previous: XDR Type Representations, Up: Implementation of XDR [Contents][Index]