@@ -2,6 +2,7 @@ \section{Standard Module \sectcode{xdrlib}}
22\label {module-xdrlib }
33\stmodindex {xdrlib}
44\index {XDR}
5+ \index {External Data Representation}
56\index {RFC!1014}
67
78\renewcommand {\indexsubitem }{(in module xdrlib)}
@@ -31,11 +32,11 @@ \subsection{Packer Objects}
3132\end {funcdesc }
3233
3334In general, you can pack any of the most common XDR data types by
34- calling the appropriate \code {pack_\var {type}} method. Each method
35+ calling the appropriate \code {pack_\var {type}() } method. Each method
3536takes a single argument, the value to pack. The following simple data
36- type packing methods are supported: \code {pack_uint}, \code {pack_int},
37- \code {pack_enum}, \code {pack_bool}, \code {pack_uhyper},
38- and \code {pack_hyper}.
37+ type packing methods are supported: \code {pack_uint() }, \code {pack_int() },
38+ \code {pack_enum() }, \code {pack_bool() }, \code {pack_uhyper() },
39+ and \code {pack_hyper() }.
3940
4041\begin {funcdesc }{pack_float}{value}
4142Packs the single-precision floating point number \var {value}.
@@ -47,30 +48,30 @@ \subsection{Packer Objects}
4748
4849The following methods support packing strings, bytes, and opaque data:
4950
50- \begin {funcdesc }{pack_fstring}{n\ , s}
51+ \begin {funcdesc }{pack_fstring}{n, s}
5152Packs a fixed length string, \var {s}. \var {n} is the length of the
5253string but it is \emph {not } packed into the data buffer. The string
5354is padded with null bytes if necessary to guaranteed 4 byte alignment.
5455\end {funcdesc }
5556
56- \begin {funcdesc }{pack_fopaque}{n\ , data}
57+ \begin {funcdesc }{pack_fopaque}{n, data}
5758Packs a fixed length opaque data stream, similarly to
58- \code {pack_fstring}.
59+ \code {pack_fstring() }.
5960\end {funcdesc }
6061
6162\begin {funcdesc }{pack_string}{s}
6263Packs a variable length string, \var {s}. The length of the string is
6364first packed as an unsigned integer, then the string data is packed
64- with \code {pack_fstring}.
65+ with \code {pack_fstring() }.
6566\end {funcdesc }
6667
6768\begin {funcdesc }{pack_opaque}{data}
6869Packs a variable length opaque data string, similarly to
69- \code {pack_string}.
70+ \code {pack_string() }.
7071\end {funcdesc }
7172
7273\begin {funcdesc }{pack_bytes}{bytes}
73- Packs a variable length byte stream, similarly to \code {pack_string}.
74+ Packs a variable length byte stream, similarly to \code {pack_string() }.
7475\end {funcdesc }
7576
7677The following methods support packing arrays and lists:
@@ -88,15 +89,15 @@ \subsection{Packer Objects}
8889\begin {funcdesc }{pack_farray}{n\, array\, pack_item}
8990Packs a fixed length list (\var {array}) of homogeneous items. \var {n}
9091is the length of the list; it is \emph {not } packed into the buffer,
91- but a \code {ValueError} exception is raised if \code {len(array)} is not
92+ but a \code {ValueError} exception is raised if \code {len(\var { array} )} is not
9293equal to \var {n}. As above, \var {pack_item} is the function used to
9394pack each element.
9495\end {funcdesc }
9596
9697\begin {funcdesc }{pack_array}{list\, pack_item}
9798Packs a variable length \var {list} of homogeneous items. First, the
9899length of the list is packed as an unsigned integer, then each element
99- is packed as in \code {pack_farray} above.
100+ is packed as in \code {pack_farray() } above.
100101\end {funcdesc }
101102
102103\subsection {Unpacker Objects }
@@ -133,7 +134,7 @@ \subsection{Unpacker Objects}
133134
134135In addition, every data type that can be packed with a \code {Packer},
135136can be unpacked with an \code {Unpacker}. Unpacking methods are of the
136- form \code {unpack_\var {type}}, and take no arguments. They return the
137+ form \code {unpack_\var {type}() }, and take no arguments. They return the
137138unpacked object.
138139
139140\begin {funcdesc }{unpack_float}{}
@@ -142,7 +143,7 @@ \subsection{Unpacker Objects}
142143
143144\begin {funcdesc }{unpack_double}{}
144145Unpacks a double-precision floating point number, similarly to
145- \code {unpack_float}.
146+ \code {unpack_float() }.
146147\end {funcdesc }
147148
148149In addition, the following methods unpack strings, bytes, and opaque
@@ -156,23 +157,23 @@ \subsection{Unpacker Objects}
156157
157158\begin {funcdesc }{unpack_fopaque}{n}
158159Unpacks and returns a fixed length opaque data stream, similarly to
159- \code {unpack_fstring}.
160+ \code {unpack_fstring() }.
160161\end {funcdesc }
161162
162163\begin {funcdesc }{unpack_string}{}
163164Unpacks and returns a variable length string. The length of the
164165string is first unpacked as an unsigned integer, then the string data
165- is unpacked with \code {unpack_fstring}.
166+ is unpacked with \code {unpack_fstring() }.
166167\end {funcdesc }
167168
168169\begin {funcdesc }{unpack_opaque}{}
169170Unpacks and returns a variable length opaque data string, similarly to
170- \code {unpack_string}.
171+ \code {unpack_string() }.
171172\end {funcdesc }
172173
173174\begin {funcdesc }{unpack_bytes}{}
174175Unpacks and returns a variable length byte stream, similarly to
175- \code {unpack_string}.
176+ \code {unpack_string() }.
176177\end {funcdesc }
177178
178179The following methods support unpacking arrays and lists:
@@ -195,7 +196,7 @@ \subsection{Unpacker Objects}
195196\begin {funcdesc }{unpack_array}{unpack_item}
196197Unpacks and returns a variable length \var {list} of homogeneous items.
197198First, the length of the list is unpacked as an unsigned integer, then
198- each element is unpacked as in \code {unpack_farray} above.
199+ each element is unpacked as in \code {unpack_farray() } above.
199200\end {funcdesc }
200201
201202\subsection {Exceptions }
0 commit comments