xref: /freebsd/lib/libc/xdr/xdr.3 (revision 7062693e56a4ce8feb73cfe6c35787cc138aa39f)
1eae561b3SGarrett Wollman.\" @(#)xdr.3n	2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI
27f3dea24SPeter Wemm.\" $FreeBSD$
3e83201b4SWolfram Schneider.\"
41abae7eeSRuslan Ermilov.Dd February 16, 1988
51abae7eeSRuslan Ermilov.Dt XDR 3
61abae7eeSRuslan Ermilov.Os
71abae7eeSRuslan Ermilov.Sh NAME
88360efbdSAlfred Perlstein.Nm xdr ,
98360efbdSAlfred Perlstein.Nm xdr_array ,
108360efbdSAlfred Perlstein.Nm xdr_bool ,
118360efbdSAlfred Perlstein.Nm xdr_bytes ,
128360efbdSAlfred Perlstein.Nm xdr_char ,
138360efbdSAlfred Perlstein.Nm xdr_destroy ,
148360efbdSAlfred Perlstein.Nm xdr_double ,
158360efbdSAlfred Perlstein.Nm xdr_enum ,
168360efbdSAlfred Perlstein.Nm xdr_float ,
178360efbdSAlfred Perlstein.Nm xdr_free ,
188360efbdSAlfred Perlstein.Nm xdr_getpos ,
198360efbdSAlfred Perlstein.Nm xdr_hyper ,
208360efbdSAlfred Perlstein.Nm xdr_inline ,
218360efbdSAlfred Perlstein.Nm xdr_int ,
228360efbdSAlfred Perlstein.Nm xdr_long ,
238360efbdSAlfred Perlstein.Nm xdr_longlong_t ,
248360efbdSAlfred Perlstein.Nm xdrmem_create ,
258360efbdSAlfred Perlstein.Nm xdr_opaque ,
268360efbdSAlfred Perlstein.Nm xdr_pointer ,
278360efbdSAlfred Perlstein.Nm xdrrec_create ,
288360efbdSAlfred Perlstein.Nm xdrrec_endofrecord ,
298360efbdSAlfred Perlstein.Nm xdrrec_eof ,
308360efbdSAlfred Perlstein.Nm xdrrec_skiprecord ,
318360efbdSAlfred Perlstein.Nm xdr_reference ,
328360efbdSAlfred Perlstein.Nm xdr_setpos ,
338360efbdSAlfred Perlstein.Nm xdr_short ,
348360efbdSAlfred Perlstein.Nm xdrstdio_create ,
358360efbdSAlfred Perlstein.Nm xdr_string ,
368360efbdSAlfred Perlstein.Nm xdr_u_char ,
378360efbdSAlfred Perlstein.Nm xdr_u_hyper ,
388360efbdSAlfred Perlstein.Nm xdr_u_int ,
398360efbdSAlfred Perlstein.Nm xdr_u_long ,
408360efbdSAlfred Perlstein.Nm xdr_u_longlong_t ,
418360efbdSAlfred Perlstein.Nm xdr_u_short ,
428360efbdSAlfred Perlstein.Nm xdr_union ,
438360efbdSAlfred Perlstein.Nm xdr_vector ,
448360efbdSAlfred Perlstein.Nm xdr_void ,
458360efbdSAlfred Perlstein.Nm xdr_wrapstring
461abae7eeSRuslan Ermilov.Nd "library routines for external data representation"
471abae7eeSRuslan Ermilov.Sh LIBRARY
481abae7eeSRuslan Ermilov.Lb libc
491abae7eeSRuslan Ermilov.Sh SYNOPSIS
5032eef9aeSRuslan Ermilov.In rpc/types.h
5132eef9aeSRuslan Ermilov.In rpc/xdr.h
521abae7eeSRuslan Ermilov.Pp
531abae7eeSRuslan ErmilovSee
541abae7eeSRuslan Ermilov.Sx DESCRIPTION
551abae7eeSRuslan Ermilovfor function declarations.
561abae7eeSRuslan Ermilov.Sh DESCRIPTION
57eae561b3SGarrett WollmanThese routines allow C programmers to describe
58eae561b3SGarrett Wollmanarbitrary data structures in a machine-independent fashion.
59eae561b3SGarrett WollmanData for remote procedure calls are transmitted using these
60eae561b3SGarrett Wollmanroutines.
611abae7eeSRuslan Ermilov.Pp
621abae7eeSRuslan Ermilov.Bl -tag -width indent -compact
631abae7eeSRuslan Ermilov.It Xo
641abae7eeSRuslan Ermilov.Ft int
651abae7eeSRuslan Ermilov.Xc
661abae7eeSRuslan Ermilov.It Xo
671abae7eeSRuslan Ermilov.Fo xdr_array
681abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
691abae7eeSRuslan Ermilov.Fa "char **arrp"
701abae7eeSRuslan Ermilov.Fa "u_int *sizep"
711abae7eeSRuslan Ermilov.Fa "u_int maxsize"
721abae7eeSRuslan Ermilov.Fa "u_int elsize"
731abae7eeSRuslan Ermilov.Fa "xdrproc_t elproc"
741abae7eeSRuslan Ermilov.Fc
751abae7eeSRuslan Ermilov.Xc
761abae7eeSRuslan Ermilov.Pp
77eae561b3SGarrett WollmanA filter primitive that translates between variable-length
78eae561b3SGarrett Wollmanarrays
79c6ff3a1bSSheldon Hearnand their corresponding external representations.
80c6ff3a1bSSheldon HearnThe
811abae7eeSRuslan Ermilov.Fa arrp
822efeeba5SRuslan Ermilovargument
83eae561b3SGarrett Wollmanis the address of the pointer to the array, while
841abae7eeSRuslan Ermilov.Fa sizep
85eae561b3SGarrett Wollmanis the address of the element count of the array;
86eae561b3SGarrett Wollmanthis element count cannot exceed
871abae7eeSRuslan Ermilov.Fa maxsize .
882efeeba5SRuslan ErmilovThe
891abae7eeSRuslan Ermilov.Fa elsize
902efeeba5SRuslan Ermilovargument
91eae561b3SGarrett Wollmanis the
921abae7eeSRuslan Ermilov.Ic sizeof
93eae561b3SGarrett Wollmaneach of the array's elements, and
941abae7eeSRuslan Ermilov.Fa elproc
95eae561b3SGarrett Wollmanis an
961abae7eeSRuslan Ermilov.Tn XDR
97eae561b3SGarrett Wollmanfilter that translates between
98eae561b3SGarrett Wollmanthe array elements' C form, and their external
99eae561b3SGarrett Wollmanrepresentation.
100eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1011abae7eeSRuslan Ermilov.Pp
1021abae7eeSRuslan Ermilov.It Xo
1031abae7eeSRuslan Ermilov.Ft int
1041abae7eeSRuslan Ermilov.Xc
1051abae7eeSRuslan Ermilov.It Xo
1061abae7eeSRuslan Ermilov.Fn xdr_bool "XDR *xdrs" "bool_t *bp"
1071abae7eeSRuslan Ermilov.Xc
1081abae7eeSRuslan Ermilov.Pp
109eae561b3SGarrett WollmanA filter primitive that translates between booleans (C
110eae561b3SGarrett Wollmanintegers)
111c6ff3a1bSSheldon Hearnand their external representations.
112c6ff3a1bSSheldon HearnWhen encoding data, this
113eae561b3SGarrett Wollmanfilter produces values of either one or zero.
114eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1151abae7eeSRuslan Ermilov.Pp
1161abae7eeSRuslan Ermilov.It Xo
1171abae7eeSRuslan Ermilov.Ft int
1181abae7eeSRuslan Ermilov.Xc
1191abae7eeSRuslan Ermilov.It Xo
1201abae7eeSRuslan Ermilov.Fn xdr_bytes "XDR *xdrs" "char **sp" "u_int *sizep" "u_int maxsize"
1211abae7eeSRuslan Ermilov.Xc
1221abae7eeSRuslan Ermilov.Pp
123eae561b3SGarrett WollmanA filter primitive that translates between counted byte
124eae561b3SGarrett Wollmanstrings and their external representations.
1252efeeba5SRuslan ErmilovThe
1261abae7eeSRuslan Ermilov.Fa sp
1272efeeba5SRuslan Ermilovargument
128c6ff3a1bSSheldon Hearnis the address of the string pointer.
129c6ff3a1bSSheldon HearnThe length of the
130eae561b3SGarrett Wollmanstring is located at address
1311abae7eeSRuslan Ermilov.Fa sizep ;
132eae561b3SGarrett Wollmanstrings cannot be longer than
1331abae7eeSRuslan Ermilov.Fa maxsize .
134eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1351abae7eeSRuslan Ermilov.Pp
1361abae7eeSRuslan Ermilov.It Xo
1371abae7eeSRuslan Ermilov.Ft int
1381abae7eeSRuslan Ermilov.Xc
1391abae7eeSRuslan Ermilov.It Xo
1401abae7eeSRuslan Ermilov.Fn xdr_char "XDR *xdrs" "char *cp"
1411abae7eeSRuslan Ermilov.Xc
1421abae7eeSRuslan Ermilov.Pp
143eae561b3SGarrett WollmanA filter primitive that translates between C characters
144eae561b3SGarrett Wollmanand their external representations.
145eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
146eae561b3SGarrett WollmanNote: encoded characters are not packed, and occupy 4 bytes
147c6ff3a1bSSheldon Hearneach.
148c6ff3a1bSSheldon HearnFor arrays of characters, it is worthwhile to
149eae561b3SGarrett Wollmanconsider
1501abae7eeSRuslan Ermilov.Fn xdr_bytes ,
1511abae7eeSRuslan Ermilov.Fn xdr_opaque
152eae561b3SGarrett Wollmanor
1531abae7eeSRuslan Ermilov.Fn xdr_string .
1541abae7eeSRuslan Ermilov.Pp
1551abae7eeSRuslan Ermilov.It Xo
1561abae7eeSRuslan Ermilov.Ft void
1571abae7eeSRuslan Ermilov.Xc
1581abae7eeSRuslan Ermilov.It Xo
1591abae7eeSRuslan Ermilov.Fn xdr_destroy "XDR *xdrs"
1601abae7eeSRuslan Ermilov.Xc
1611abae7eeSRuslan Ermilov.Pp
162eae561b3SGarrett WollmanA macro that invokes the destroy routine associated with the
1631abae7eeSRuslan Ermilov.Tn XDR
164eae561b3SGarrett Wollmanstream,
1651abae7eeSRuslan Ermilov.Fa xdrs .
166eae561b3SGarrett WollmanDestruction usually involves freeing private data structures
1671abae7eeSRuslan Ermilovassociated with the stream.
1681abae7eeSRuslan ErmilovUsing
1691abae7eeSRuslan Ermilov.Fa xdrs
170eae561b3SGarrett Wollmanafter invoking
1711abae7eeSRuslan Ermilov.Fn xdr_destroy
172eae561b3SGarrett Wollmanis undefined.
1731abae7eeSRuslan Ermilov.Pp
1741abae7eeSRuslan Ermilov.It Xo
1751abae7eeSRuslan Ermilov.Ft int
1761abae7eeSRuslan Ermilov.Xc
1771abae7eeSRuslan Ermilov.It Xo
1781abae7eeSRuslan Ermilov.Fn xdr_double "XDR *xdrs" "double *dp"
1791abae7eeSRuslan Ermilov.Xc
1801abae7eeSRuslan Ermilov.Pp
181eae561b3SGarrett WollmanA filter primitive that translates between C
1821abae7eeSRuslan Ermilov.Vt double
183eae561b3SGarrett Wollmanprecision numbers and their external representations.
184eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1851abae7eeSRuslan Ermilov.Pp
1861abae7eeSRuslan Ermilov.It Xo
1871abae7eeSRuslan Ermilov.Ft int
1881abae7eeSRuslan Ermilov.Xc
1891abae7eeSRuslan Ermilov.It Xo
1901abae7eeSRuslan Ermilov.Fn xdr_enum "XDR *xdrs" "enum_t *ep"
1911abae7eeSRuslan Ermilov.Xc
1921abae7eeSRuslan Ermilov.Pp
193eae561b3SGarrett WollmanA filter primitive that translates between C
1941abae7eeSRuslan Ermilov.Vt enum Ns s
195eae561b3SGarrett Wollman(actually integers) and their external representations.
196eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1971abae7eeSRuslan Ermilov.Pp
1981abae7eeSRuslan Ermilov.It Xo
1991abae7eeSRuslan Ermilov.Ft int
2001abae7eeSRuslan Ermilov.Xc
2011abae7eeSRuslan Ermilov.It Xo
2021abae7eeSRuslan Ermilov.Fn xdr_float "XDR *xdrs" "float *fp"
2031abae7eeSRuslan Ermilov.Xc
2041abae7eeSRuslan Ermilov.Pp
205eae561b3SGarrett WollmanA filter primitive that translates between C
2061abae7eeSRuslan Ermilov.Vt float Ns s
207eae561b3SGarrett Wollmanand their external representations.
208eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
2091abae7eeSRuslan Ermilov.Pp
2101abae7eeSRuslan Ermilov.It Xo
2111abae7eeSRuslan Ermilov.Ft void
2121abae7eeSRuslan Ermilov.Xc
2131abae7eeSRuslan Ermilov.It Xo
2147062693eSRuslan Ermilov.Fn xdr_free "xdrproc_t proc" "void *objp"
2151abae7eeSRuslan Ermilov.Xc
2161abae7eeSRuslan Ermilov.Pp
217c6ff3a1bSSheldon HearnGeneric freeing routine.
218c6ff3a1bSSheldon HearnThe first argument is the
2191abae7eeSRuslan Ermilov.Tn XDR
220c6ff3a1bSSheldon Hearnroutine for the object being freed.
221c6ff3a1bSSheldon HearnThe second argument
222c6ff3a1bSSheldon Hearnis a pointer to the object itself.
223c6ff3a1bSSheldon HearnNote: the pointer passed
224eae561b3SGarrett Wollmanto this routine is
2251abae7eeSRuslan Ermilov.Em not
226eae561b3SGarrett Wollmanfreed, but what it points to
2271abae7eeSRuslan Ermilov.Em is
228eae561b3SGarrett Wollmanfreed (recursively).
2291abae7eeSRuslan Ermilov.Pp
2301abae7eeSRuslan Ermilov.It Xo
2311abae7eeSRuslan Ermilov.Ft u_int
2321abae7eeSRuslan Ermilov.Xc
2331abae7eeSRuslan Ermilov.It Xo
2341abae7eeSRuslan Ermilov.Fn xdr_getpos "XDR *xdrs"
2351abae7eeSRuslan Ermilov.Xc
2361abae7eeSRuslan Ermilov.Pp
2371abae7eeSRuslan ErmilovA macro that invokes the get\-position routine
238eae561b3SGarrett Wollmanassociated with the
2391abae7eeSRuslan Ermilov.Tn XDR
240eae561b3SGarrett Wollmanstream,
2411abae7eeSRuslan Ermilov.Fa xdrs .
242eae561b3SGarrett WollmanThe routine returns an unsigned integer,
243eae561b3SGarrett Wollmanwhich indicates the position of the
2441abae7eeSRuslan Ermilov.Tn XDR
245eae561b3SGarrett Wollmanbyte stream.
246eae561b3SGarrett WollmanA desirable feature of
2471abae7eeSRuslan Ermilov.Tn XDR
248eae561b3SGarrett Wollmanstreams is that simple arithmetic works with this number,
249eae561b3SGarrett Wollmanalthough the
2501abae7eeSRuslan Ermilov.Tn XDR
251eae561b3SGarrett Wollmanstream instances need not guarantee this.
2521abae7eeSRuslan Ermilov.Pp
2531abae7eeSRuslan Ermilov.It Xo
2548360efbdSAlfred Perlstein.Ft int
2558360efbdSAlfred Perlstein.Xc
2568360efbdSAlfred Perlstein.It Xo
2575843ec1dSBruce Evans.Fn xdr_hyper "XDR *xdrs" "quad_t *llp"
2588360efbdSAlfred Perlstein.Xc
2598360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C
2608360efbdSAlfred Perlstein.Vt "long long"
2618360efbdSAlfred Perlsteinintegers and their external representations.
2628360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
2638360efbdSAlfred Perlstein.Pp
2648360efbdSAlfred Perlstein.It Xo
2651abae7eeSRuslan Ermilov.Ft "long *"
2661abae7eeSRuslan Ermilov.Xc
2671abae7eeSRuslan Ermilov.It Xo
2681abae7eeSRuslan Ermilov.Fn xdr_inline "XDR *xdrs" "int len"
2691abae7eeSRuslan Ermilov.Xc
2701abae7eeSRuslan Ermilov.Pp
271eae561b3SGarrett WollmanA macro that invokes the in-line routine associated with the
2721abae7eeSRuslan Ermilov.Tn XDR
273eae561b3SGarrett Wollmanstream,
2741abae7eeSRuslan Ermilov.Fa xdrs .
275eae561b3SGarrett WollmanThe routine returns a pointer
276eae561b3SGarrett Wollmanto a contiguous piece of the stream's buffer;
2771abae7eeSRuslan Ermilov.Fa len
278eae561b3SGarrett Wollmanis the byte length of the desired buffer.
279eae561b3SGarrett WollmanNote: pointer is cast to
2801abae7eeSRuslan Ermilov.Vt "long *" .
2811abae7eeSRuslan Ermilov.Pp
282eae561b3SGarrett WollmanWarning:
2831abae7eeSRuslan Ermilov.Fn xdr_inline
284eae561b3SGarrett Wollmanmay return
2851abae7eeSRuslan Ermilov.Dv NULL
286eae561b3SGarrett Wollman(0)
287eae561b3SGarrett Wollmanif it cannot allocate a contiguous piece of a buffer.
288eae561b3SGarrett WollmanTherefore the behavior may vary among stream instances;
289eae561b3SGarrett Wollmanit exists for the sake of efficiency.
2901abae7eeSRuslan Ermilov.Pp
2911abae7eeSRuslan Ermilov.It Xo
2921abae7eeSRuslan Ermilov.Ft int
2931abae7eeSRuslan Ermilov.Xc
2941abae7eeSRuslan Ermilov.It Xo
2951abae7eeSRuslan Ermilov.Fn xdr_int "XDR *xdrs" "int *ip"
2961abae7eeSRuslan Ermilov.Xc
2971abae7eeSRuslan Ermilov.Pp
298eae561b3SGarrett WollmanA filter primitive that translates between C integers
299eae561b3SGarrett Wollmanand their external representations.
300eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3011abae7eeSRuslan Ermilov.Pp
3021abae7eeSRuslan Ermilov.It Xo
3031abae7eeSRuslan Ermilov.Ft int
3041abae7eeSRuslan Ermilov.Xc
3051abae7eeSRuslan Ermilov.It Xo
3061abae7eeSRuslan Ermilov.Fn xdr_long "XDR *xdrs" "long *lp"
3071abae7eeSRuslan Ermilov.Xc
3081abae7eeSRuslan Ermilov.Pp
309eae561b3SGarrett WollmanA filter primitive that translates between C
3101abae7eeSRuslan Ermilov.Vt long
311eae561b3SGarrett Wollmanintegers and their external representations.
312eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3131abae7eeSRuslan Ermilov.Pp
3141abae7eeSRuslan Ermilov.It Xo
3158360efbdSAlfred Perlstein.Ft int
3168360efbdSAlfred Perlstein.Xc
3178360efbdSAlfred Perlstein.It Xo
3185843ec1dSBruce Evans.Fn xdr_longlong_t "XDR *xdrs" "quad_t *llp"
3198360efbdSAlfred Perlstein.Xc
3208360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C
3218360efbdSAlfred Perlstein.Vt "long long"
3228360efbdSAlfred Perlsteinintegers and their external representations.
3238360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
3248360efbdSAlfred Perlstein.Pp
3258360efbdSAlfred Perlstein.It Xo
3261abae7eeSRuslan Ermilov.Ft void
3271abae7eeSRuslan Ermilov.Xc
3281abae7eeSRuslan Ermilov.It Xo
3291abae7eeSRuslan Ermilov.Fn xdrmem_create "XDR *xdrs" "char *addr" "u_int size" "enum xdr_op op"
3301abae7eeSRuslan Ermilov.Xc
3311abae7eeSRuslan Ermilov.Pp
332eae561b3SGarrett WollmanThis routine initializes the
3331abae7eeSRuslan Ermilov.Tn XDR
334eae561b3SGarrett Wollmanstream object pointed to by
3351abae7eeSRuslan Ermilov.Fa xdrs .
336eae561b3SGarrett WollmanThe stream's data is written to, or read from,
337eae561b3SGarrett Wollmana chunk of memory at location
3381abae7eeSRuslan Ermilov.Fa addr
339eae561b3SGarrett Wollmanwhose length is no more than
3401abae7eeSRuslan Ermilov.Fa size
3411abae7eeSRuslan Ermilovbytes long.
3421abae7eeSRuslan ErmilovThe
3431abae7eeSRuslan Ermilov.Fa op
3442efeeba5SRuslan Ermilovargument
345eae561b3SGarrett Wollmandetermines the direction of the
3461abae7eeSRuslan Ermilov.Tn XDR
347eae561b3SGarrett Wollmanstream
348eae561b3SGarrett Wollman(either
3491abae7eeSRuslan Ermilov.Dv XDR_ENCODE ,
3501abae7eeSRuslan Ermilov.Dv XDR_DECODE ,
351eae561b3SGarrett Wollmanor
3521abae7eeSRuslan Ermilov.Dv XDR_FREE ) .
3531abae7eeSRuslan Ermilov.Pp
3541abae7eeSRuslan Ermilov.It Xo
3551abae7eeSRuslan Ermilov.Ft int
3561abae7eeSRuslan Ermilov.Xc
3571abae7eeSRuslan Ermilov.It Xo
3581abae7eeSRuslan Ermilov.Fn xdr_opaque "XDR *xdrs" "char *cp" "u_int cnt"
3591abae7eeSRuslan Ermilov.Xc
3601abae7eeSRuslan Ermilov.Pp
361eae561b3SGarrett WollmanA filter primitive that translates between fixed size opaque
362eae561b3SGarrett Wollmandata
363eae561b3SGarrett Wollmanand its external representation.
3642efeeba5SRuslan ErmilovThe
3651abae7eeSRuslan Ermilov.Fa cp
3662efeeba5SRuslan Ermilovargument
367eae561b3SGarrett Wollmanis the address of the opaque object, and
3681abae7eeSRuslan Ermilov.Fa cnt
369eae561b3SGarrett Wollmanis its size in bytes.
370eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3711abae7eeSRuslan Ermilov.Pp
3721abae7eeSRuslan Ermilov.It Xo
3731abae7eeSRuslan Ermilov.Ft int
3741abae7eeSRuslan Ermilov.Xc
3751abae7eeSRuslan Ermilov.It Xo
3761abae7eeSRuslan Ermilov.Fn xdr_pointer "XDR *xdrs" "char **objpp" "u_int objsize" "xdrproc_t xdrobj"
3771abae7eeSRuslan Ermilov.Xc
3781abae7eeSRuslan Ermilov.Pp
379eae561b3SGarrett WollmanLike
3801abae7eeSRuslan Ermilov.Fn xdr_reference
3811abae7eeSRuslan Ermilovexcept that it serializes
3821abae7eeSRuslan Ermilov.Dv NULL
383eae561b3SGarrett Wollmanpointers, whereas
3841abae7eeSRuslan Ermilov.Fn xdr_reference
3851abae7eeSRuslan Ermilovdoes not.
3861abae7eeSRuslan ErmilovThus,
3871abae7eeSRuslan Ermilov.Fn xdr_pointer
388eae561b3SGarrett Wollmancan represent
389eae561b3SGarrett Wollmanrecursive data structures, such as binary trees or
390eae561b3SGarrett Wollmanlinked lists.
3911abae7eeSRuslan Ermilov.Pp
3921abae7eeSRuslan Ermilov.It Xo
3931abae7eeSRuslan Ermilov.Ft void
3941abae7eeSRuslan Ermilov.Xc
3951abae7eeSRuslan Ermilov.It Xo
3961abae7eeSRuslan Ermilov.Fo xdrrec_create
3971abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
3981abae7eeSRuslan Ermilov.Fa "u_int sendsize"
3991abae7eeSRuslan Ermilov.Fa "u_int recvsize"
4007062693eSRuslan Ermilov.Fa "void *handle"
4011abae7eeSRuslan Ermilov.Fa "int \*(lp*readit\*(rp\*(lp\*(rp"
4021abae7eeSRuslan Ermilov.Fa "int \*(lp*writeit\*(rp\*(lp\*(rp"
4031abae7eeSRuslan Ermilov.Fc
4041abae7eeSRuslan Ermilov.Xc
4051abae7eeSRuslan Ermilov.Pp
406eae561b3SGarrett WollmanThis routine initializes the
4071abae7eeSRuslan Ermilov.Tn XDR
408eae561b3SGarrett Wollmanstream object pointed to by
4091abae7eeSRuslan Ermilov.Fa xdrs .
410eae561b3SGarrett WollmanThe stream's data is written to a buffer of size
4111abae7eeSRuslan Ermilov.Fa sendsize ;
412eae561b3SGarrett Wollmana value of zero indicates the system should use a suitable
413c6ff3a1bSSheldon Hearndefault.
414c6ff3a1bSSheldon HearnThe stream's data is read from a buffer of size
4151abae7eeSRuslan Ermilov.Fa recvsize ;
416eae561b3SGarrett Wollmanit too can be set to a suitable default by passing a zero
417eae561b3SGarrett Wollmanvalue.
418eae561b3SGarrett WollmanWhen a stream's output buffer is full,
4191abae7eeSRuslan Ermilov.Fn writeit
4201abae7eeSRuslan Ermilovis called.
4211abae7eeSRuslan ErmilovSimilarly, when a stream's input buffer is empty,
4221abae7eeSRuslan Ermilov.Fn readit
4231abae7eeSRuslan Ermilovis called.
4241abae7eeSRuslan ErmilovThe behavior of these two routines is similar to
425eae561b3SGarrett Wollmanthe
426eae561b3SGarrett Wollmansystem calls
4271abae7eeSRuslan Ermilov.Xr read 2
428eae561b3SGarrett Wollmanand
4291abae7eeSRuslan Ermilov.Xr write 2 ,
430eae561b3SGarrett Wollmanexcept that
4311abae7eeSRuslan Ermilov.Fa handle
4322efeeba5SRuslan Ermilovis passed to the former routines as the first argument.
433eae561b3SGarrett WollmanNote: the
4341abae7eeSRuslan Ermilov.Tn XDR
435eae561b3SGarrett Wollmanstream's
4361abae7eeSRuslan Ermilov.Fa op
437eae561b3SGarrett Wollmanfield must be set by the caller.
4381abae7eeSRuslan Ermilov.Pp
439eae561b3SGarrett WollmanWarning: this
4401abae7eeSRuslan Ermilov.Tn XDR
441eae561b3SGarrett Wollmanstream implements an intermediate record stream.
442eae561b3SGarrett WollmanTherefore there are additional bytes in the stream
443eae561b3SGarrett Wollmanto provide record boundary information.
4441abae7eeSRuslan Ermilov.Pp
4451abae7eeSRuslan Ermilov.It Xo
4461abae7eeSRuslan Ermilov.Ft int
4471abae7eeSRuslan Ermilov.Xc
4481abae7eeSRuslan Ermilov.It Xo
4491abae7eeSRuslan Ermilov.Fn xdrrec_endofrecord "XDR *xdrs" "int sendnow"
4501abae7eeSRuslan Ermilov.Xc
4511abae7eeSRuslan Ermilov.Pp
452eae561b3SGarrett WollmanThis routine can be invoked only on
453eae561b3SGarrett Wollmanstreams created by
4541abae7eeSRuslan Ermilov.Fn xdrrec_create .
455eae561b3SGarrett WollmanThe data in the output buffer is marked as a completed
456eae561b3SGarrett Wollmanrecord,
457eae561b3SGarrett Wollmanand the output buffer is optionally written out if
4581abae7eeSRuslan Ermilov.Fa sendnow
459c6ff3a1bSSheldon Hearnis non-zero.
460c6ff3a1bSSheldon HearnThis routine returns one if it succeeds, zero
461eae561b3SGarrett Wollmanotherwise.
4621abae7eeSRuslan Ermilov.Pp
4631abae7eeSRuslan Ermilov.It Xo
4641abae7eeSRuslan Ermilov.Ft int
4651abae7eeSRuslan Ermilov.Xc
4661abae7eeSRuslan Ermilov.It Xo
4671abae7eeSRuslan Ermilov.Fn xdrrec_eof "XDR *xdrs"
4681abae7eeSRuslan Ermilov.Xc
4691abae7eeSRuslan Ermilov.Pp
470eae561b3SGarrett WollmanThis routine can be invoked only on
471eae561b3SGarrett Wollmanstreams created by
4721abae7eeSRuslan Ermilov.Fn xdrrec_create .
473eae561b3SGarrett WollmanAfter consuming the rest of the current record in the stream,
474eae561b3SGarrett Wollmanthis routine returns one if the stream has no more input,
475eae561b3SGarrett Wollmanzero otherwise.
4761abae7eeSRuslan Ermilov.Pp
4771abae7eeSRuslan Ermilov.It Xo
4781abae7eeSRuslan Ermilov.Ft int
4791abae7eeSRuslan Ermilov.Xc
4801abae7eeSRuslan Ermilov.It Xo
4811abae7eeSRuslan Ermilov.Fn xdrrec_skiprecord "XDR *xdrs"
4821abae7eeSRuslan Ermilov.Xc
4831abae7eeSRuslan Ermilov.Pp
484eae561b3SGarrett WollmanThis routine can be invoked only on
485eae561b3SGarrett Wollmanstreams created by
4861abae7eeSRuslan Ermilov.Fn xdrrec_create .
487eae561b3SGarrett WollmanIt tells the
4881abae7eeSRuslan Ermilov.Tn XDR
489eae561b3SGarrett Wollmanimplementation that the rest of the current record
490eae561b3SGarrett Wollmanin the stream's input buffer should be discarded.
491eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
4921abae7eeSRuslan Ermilov.Pp
4931abae7eeSRuslan Ermilov.It Xo
4941abae7eeSRuslan Ermilov.Ft int
4951abae7eeSRuslan Ermilov.Xc
4961abae7eeSRuslan Ermilov.It Xo
4971abae7eeSRuslan Ermilov.Fn xdr_reference "XDR *xdrs" "char **pp" "u_int size" "xdrproc_t proc"
4981abae7eeSRuslan Ermilov.Xc
4991abae7eeSRuslan Ermilov.Pp
500eae561b3SGarrett WollmanA primitive that provides pointer chasing within structures.
5012efeeba5SRuslan ErmilovThe
5021abae7eeSRuslan Ermilov.Fa pp
5032efeeba5SRuslan Ermilovargument
504eae561b3SGarrett Wollmanis the address of the pointer;
5051abae7eeSRuslan Ermilov.Fa size
506eae561b3SGarrett Wollmanis the
5071abae7eeSRuslan Ermilov.Ic sizeof
508eae561b3SGarrett Wollmanthe structure that
5091abae7eeSRuslan Ermilov.Fa *pp
510eae561b3SGarrett Wollmanpoints to; and
5111abae7eeSRuslan Ermilov.Fa proc
512eae561b3SGarrett Wollmanis an
5131abae7eeSRuslan Ermilov.Tn XDR
514eae561b3SGarrett Wollmanprocedure that filters the structure
515eae561b3SGarrett Wollmanbetween its C form and its external representation.
516eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
5171abae7eeSRuslan Ermilov.Pp
518eae561b3SGarrett WollmanWarning: this routine does not understand
5191abae7eeSRuslan Ermilov.Dv NULL
520c6ff3a1bSSheldon Hearnpointers.
521c6ff3a1bSSheldon HearnUse
5221abae7eeSRuslan Ermilov.Fn xdr_pointer
523eae561b3SGarrett Wollmaninstead.
5241abae7eeSRuslan Ermilov.Pp
5251abae7eeSRuslan Ermilov.It Xo
5261abae7eeSRuslan Ermilov.Ft int
5271abae7eeSRuslan Ermilov.Xc
5281abae7eeSRuslan Ermilov.It Xo
5291abae7eeSRuslan Ermilov.Fn xdr_setpos "XDR *xdrs" "u_int pos"
5301abae7eeSRuslan Ermilov.Xc
5311abae7eeSRuslan Ermilov.Pp
532eae561b3SGarrett WollmanA macro that invokes the set position routine associated with
533eae561b3SGarrett Wollmanthe
5341abae7eeSRuslan Ermilov.Tn XDR
535eae561b3SGarrett Wollmanstream
5361abae7eeSRuslan Ermilov.Fa xdrs .
5372efeeba5SRuslan ErmilovThe
5381abae7eeSRuslan Ermilov.Fa pos
5392efeeba5SRuslan Ermilovargument
540eae561b3SGarrett Wollmanis a position value obtained from
5411abae7eeSRuslan Ermilov.Fn xdr_getpos .
542eae561b3SGarrett WollmanThis routine returns one if the
5431abae7eeSRuslan Ermilov.Tn XDR
544eae561b3SGarrett Wollmanstream could be repositioned,
545eae561b3SGarrett Wollmanand zero otherwise.
5461abae7eeSRuslan Ermilov.Pp
547eae561b3SGarrett WollmanWarning: it is difficult to reposition some types of
5481abae7eeSRuslan Ermilov.Tn XDR
549eae561b3SGarrett Wollmanstreams, so this routine may fail with one
550eae561b3SGarrett Wollmantype of stream and succeed with another.
5511abae7eeSRuslan Ermilov.Pp
5521abae7eeSRuslan Ermilov.It Xo
5531abae7eeSRuslan Ermilov.Ft int
5541abae7eeSRuslan Ermilov.Xc
5551abae7eeSRuslan Ermilov.It Xo
5561abae7eeSRuslan Ermilov.Fn xdr_short "XDR *xdrs" "short *sp"
5571abae7eeSRuslan Ermilov.Xc
5581abae7eeSRuslan Ermilov.Pp
559eae561b3SGarrett WollmanA filter primitive that translates between C
5601abae7eeSRuslan Ermilov.Vt short
561eae561b3SGarrett Wollmanintegers and their external representations.
562eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
5631abae7eeSRuslan Ermilov.Pp
564c6e2c333SRuslan Ermilov.It Li "#ifdef _STDIO_H_"
565c6e2c333SRuslan Ermilov.It Li "/* XDR using stdio library */"
5661abae7eeSRuslan Ermilov.It Xo
5671abae7eeSRuslan Ermilov.Ft void
5681abae7eeSRuslan Ermilov.Xc
5691abae7eeSRuslan Ermilov.It Xo
5701abae7eeSRuslan Ermilov.Fn xdrstdio_create "XDR *xdrs" "FILE *file" "enum xdr_op op"
5711abae7eeSRuslan Ermilov.Xc
572c6e2c333SRuslan Ermilov.It Li "#endif"
5731abae7eeSRuslan Ermilov.Pp
574eae561b3SGarrett WollmanThis routine initializes the
5751abae7eeSRuslan Ermilov.Tn XDR
576eae561b3SGarrett Wollmanstream object pointed to by
5771abae7eeSRuslan Ermilov.Fa xdrs .
578eae561b3SGarrett WollmanThe
5791abae7eeSRuslan Ermilov.Tn XDR
580eae561b3SGarrett Wollmanstream data is written to, or read from, the Standard
5811abae7eeSRuslan Ermilov.Tn I/O
582eae561b3SGarrett Wollmanstream
5831abae7eeSRuslan Ermilov.Fa file .
5842efeeba5SRuslan ErmilovThe
5851abae7eeSRuslan Ermilov.Fa op
5862efeeba5SRuslan Ermilovargument
587eae561b3SGarrett Wollmandetermines the direction of the
5881abae7eeSRuslan Ermilov.Tn XDR
589eae561b3SGarrett Wollmanstream (either
5901abae7eeSRuslan Ermilov.Dv XDR_ENCODE ,
5911abae7eeSRuslan Ermilov.Dv XDR_DECODE ,
592eae561b3SGarrett Wollmanor
5931abae7eeSRuslan Ermilov.Dv XDR_FREE ) .
5941abae7eeSRuslan Ermilov.Pp
595eae561b3SGarrett WollmanWarning: the destroy routine associated with such
5961abae7eeSRuslan Ermilov.Tn XDR
597eae561b3SGarrett Wollmanstreams calls
5981abae7eeSRuslan Ermilov.Xr fflush 3
599eae561b3SGarrett Wollmanon the
6001abae7eeSRuslan Ermilov.Fa file
601eae561b3SGarrett Wollmanstream, but never
6021abae7eeSRuslan Ermilov.Xr fclose 3 .
6031abae7eeSRuslan Ermilov.Pp
6041abae7eeSRuslan Ermilov.It Xo
6051abae7eeSRuslan Ermilov.Ft int
6061abae7eeSRuslan Ermilov.Xc
6071abae7eeSRuslan Ermilov.It Xo
6081abae7eeSRuslan Ermilov.Fn xdr_string "XDR *xdrs" "char **sp" "u_int maxsize"
6091abae7eeSRuslan Ermilov.Xc
6101abae7eeSRuslan Ermilov.Pp
611eae561b3SGarrett WollmanA filter primitive that translates between C strings and
612eae561b3SGarrett Wollmantheir
613eae561b3SGarrett Wollmancorresponding external representations.
614eae561b3SGarrett WollmanStrings cannot be longer than
6151abae7eeSRuslan Ermilov.Fa maxsize .
616eae561b3SGarrett WollmanNote:
6171abae7eeSRuslan Ermilov.Fa sp
618eae561b3SGarrett Wollmanis the address of the string's pointer.
619eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6201abae7eeSRuslan Ermilov.Pp
6211abae7eeSRuslan Ermilov.It Xo
6221abae7eeSRuslan Ermilov.Ft int
6231abae7eeSRuslan Ermilov.Xc
6241abae7eeSRuslan Ermilov.It Xo
6251abae7eeSRuslan Ermilov.Fn xdr_u_char "XDR *xdrs" "unsigned char *ucp"
6261abae7eeSRuslan Ermilov.Xc
6271abae7eeSRuslan Ermilov.Pp
628eae561b3SGarrett WollmanA filter primitive that translates between
6291abae7eeSRuslan Ermilov.Vt unsigned
630eae561b3SGarrett WollmanC characters and their external representations.
631eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6321abae7eeSRuslan Ermilov.Pp
6331abae7eeSRuslan Ermilov.It Xo
6341abae7eeSRuslan Ermilov.Ft int
6351abae7eeSRuslan Ermilov.Xc
6361abae7eeSRuslan Ermilov.It Xo
6375843ec1dSBruce Evans.Fn xdr_u_hyper "XDR *xdrs" "u_quad_t *ullp"
6388360efbdSAlfred Perlstein.Xc
6398360efbdSAlfred PerlsteinA filter primitive that translates between
6408360efbdSAlfred Perlstein.Vt unsigned
6418360efbdSAlfred PerlsteinANSI C
6428360efbdSAlfred Perlstein.Vt long long
6438360efbdSAlfred Perlsteinintegers and their external representations.
6448360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
6458360efbdSAlfred Perlstein.Pp
6468360efbdSAlfred Perlstein.It Xo
6478360efbdSAlfred Perlstein.Ft int
6488360efbdSAlfred Perlstein.Xc
6498360efbdSAlfred Perlstein.It Xo
6501abae7eeSRuslan Ermilov.Fn xdr_u_int "XDR *xdrs" "unsigned *up"
6511abae7eeSRuslan Ermilov.Xc
6521abae7eeSRuslan Ermilov.Pp
653eae561b3SGarrett WollmanA filter primitive that translates between C
6541abae7eeSRuslan Ermilov.Vt unsigned
655eae561b3SGarrett Wollmanintegers and their external representations.
656eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6571abae7eeSRuslan Ermilov.Pp
6581abae7eeSRuslan Ermilov.It Xo
6591abae7eeSRuslan Ermilov.Ft int
6601abae7eeSRuslan Ermilov.Xc
6611abae7eeSRuslan Ermilov.It Xo
6621abae7eeSRuslan Ermilov.Fn xdr_u_long "XDR *xdrs" "unsigned long *ulp"
6631abae7eeSRuslan Ermilov.Xc
6641abae7eeSRuslan Ermilov.Pp
665eae561b3SGarrett WollmanA filter primitive that translates between C
6661abae7eeSRuslan Ermilov.Vt "unsigned long"
667eae561b3SGarrett Wollmanintegers and their external representations.
668eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6691abae7eeSRuslan Ermilov.Pp
6701abae7eeSRuslan Ermilov.It Xo
6711abae7eeSRuslan Ermilov.Ft int
6721abae7eeSRuslan Ermilov.Xc
6731abae7eeSRuslan Ermilov.It Xo
6745843ec1dSBruce Evans.Fn xdr_u_longlong_t "XDR *xdrs" "u_quad_t *ullp"
6758360efbdSAlfred Perlstein.Xc
6768360efbdSAlfred PerlsteinA filter primitive that translates between
6778360efbdSAlfred Perlstein.Vt unsigned
6788360efbdSAlfred PerlsteinANSI C
6798360efbdSAlfred Perlstein.Vt "long long"
6808360efbdSAlfred Perlsteinintegers and their external representations.
6818360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
6828360efbdSAlfred Perlstein.Pp
6838360efbdSAlfred Perlstein.It Xo
6848360efbdSAlfred Perlstein.Ft int
6858360efbdSAlfred Perlstein.Xc
6868360efbdSAlfred Perlstein.It Xo
6871abae7eeSRuslan Ermilov.Fn xdr_u_short "XDR *xdrs" "unsigned short *usp"
6881abae7eeSRuslan Ermilov.Xc
6891abae7eeSRuslan Ermilov.Pp
690eae561b3SGarrett WollmanA filter primitive that translates between C
6911abae7eeSRuslan Ermilov.Vt "unsigned short"
692eae561b3SGarrett Wollmanintegers and their external representations.
693eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6941abae7eeSRuslan Ermilov.Pp
6951abae7eeSRuslan Ermilov.It Xo
6961abae7eeSRuslan Ermilov.Ft int
6971abae7eeSRuslan Ermilov.Xc
6981abae7eeSRuslan Ermilov.It Xo
6991abae7eeSRuslan Ermilov.Fo xdr_union
7001abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
7015843ec1dSBruce Evans.Fa "enum_t *dscmp"
7021abae7eeSRuslan Ermilov.Fa "char *unp"
7035843ec1dSBruce Evans.Fa "const struct xdr_discrim *choices"
7045843ec1dSBruce Evans.Fa "xdrproc_t defaultarm"
7051abae7eeSRuslan Ermilov.Fc
7061abae7eeSRuslan Ermilov.Xc
7071abae7eeSRuslan Ermilov.Pp
708eae561b3SGarrett WollmanA filter primitive that translates between a discriminated C
7091abae7eeSRuslan Ermilov.Vt union
710c6ff3a1bSSheldon Hearnand its corresponding external representation.
711c6ff3a1bSSheldon HearnIt first
712eae561b3SGarrett Wollmantranslates the discriminant of the union located at
7131abae7eeSRuslan Ermilov.Fa dscmp .
714eae561b3SGarrett WollmanThis discriminant is always an
7151abae7eeSRuslan Ermilov.Vt enum_t .
716eae561b3SGarrett WollmanNext the union located at
7171abae7eeSRuslan Ermilov.Fa unp
7181abae7eeSRuslan Ermilovis translated.
7192efeeba5SRuslan ErmilovThe
7201abae7eeSRuslan Ermilov.Fa choices
7212efeeba5SRuslan Ermilovargument
722eae561b3SGarrett Wollmanis a pointer to an array of
7231abae7eeSRuslan Ermilov.Vt xdr_discrim
724c6ff3a1bSSheldon Hearnstructures.
725c6ff3a1bSSheldon HearnEach structure contains an ordered pair of
7261abae7eeSRuslan Ermilov.Bq Va value , proc .
727eae561b3SGarrett WollmanIf the union's discriminant is equal to the associated
7281abae7eeSRuslan Ermilov.Va value ,
729eae561b3SGarrett Wollmanthen the
7301abae7eeSRuslan Ermilov.Fn proc
7311abae7eeSRuslan Ermilovis called to translate the union.
7321abae7eeSRuslan ErmilovThe end of the
7331abae7eeSRuslan Ermilov.Vt xdr_discrim
734eae561b3SGarrett Wollmanstructure array is denoted by a routine of value
7351abae7eeSRuslan Ermilov.Dv NULL .
736eae561b3SGarrett WollmanIf the discriminant is not found in the
7371abae7eeSRuslan Ermilov.Fa choices
738eae561b3SGarrett Wollmanarray, then the
7391abae7eeSRuslan Ermilov.Fn defaultarm
740eae561b3SGarrett Wollmanprocedure is called (if it is not
7411abae7eeSRuslan Ermilov.Dv NULL ) .
742eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise.
7431abae7eeSRuslan Ermilov.Pp
7441abae7eeSRuslan Ermilov.It Xo
7451abae7eeSRuslan Ermilov.Ft int
7461abae7eeSRuslan Ermilov.Xc
7471abae7eeSRuslan Ermilov.It Xo
7481abae7eeSRuslan Ermilov.Fo xdr_vector
7491abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
7501abae7eeSRuslan Ermilov.Fa "char *arrp"
7511abae7eeSRuslan Ermilov.Fa "u_int size"
7521abae7eeSRuslan Ermilov.Fa "u_int elsize"
7531abae7eeSRuslan Ermilov.Fa "xdrproc_t elproc"
7541abae7eeSRuslan Ermilov.Fc
7551abae7eeSRuslan Ermilov.Xc
7561abae7eeSRuslan Ermilov.Pp
757eae561b3SGarrett WollmanA filter primitive that translates between fixed-length
758eae561b3SGarrett Wollmanarrays
7591abae7eeSRuslan Ermilovand their corresponding external representations.
7601abae7eeSRuslan ErmilovThe
7611abae7eeSRuslan Ermilov.Fa arrp
7622efeeba5SRuslan Ermilovargument
763eae561b3SGarrett Wollmanis the address of the pointer to the array, while
7641abae7eeSRuslan Ermilov.Fa size
7651abae7eeSRuslan Ermilovis the element count of the array.
7662efeeba5SRuslan ErmilovThe
7671abae7eeSRuslan Ermilov.Fa elsize
7682efeeba5SRuslan Ermilovargument
769eae561b3SGarrett Wollmanis the
7701abae7eeSRuslan Ermilov.Ic sizeof
771eae561b3SGarrett Wollmaneach of the array's elements, and
7721abae7eeSRuslan Ermilov.Fa elproc
773eae561b3SGarrett Wollmanis an
7741abae7eeSRuslan Ermilov.Tn XDR
775eae561b3SGarrett Wollmanfilter that translates between
776eae561b3SGarrett Wollmanthe array elements' C form, and their external
777eae561b3SGarrett Wollmanrepresentation.
778eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
7791abae7eeSRuslan Ermilov.Pp
7801abae7eeSRuslan Ermilov.It Xo
7811abae7eeSRuslan Ermilov.Ft int
7821abae7eeSRuslan Ermilov.Xc
7831abae7eeSRuslan Ermilov.It Xo
7841abae7eeSRuslan Ermilov.Fn xdr_void void
7851abae7eeSRuslan Ermilov.Xc
7861abae7eeSRuslan Ermilov.Pp
787eae561b3SGarrett WollmanThis routine always returns one.
788eae561b3SGarrett WollmanIt may be passed to
7891abae7eeSRuslan Ermilov.Tn RPC
7902efeeba5SRuslan Ermilovroutines that require a function argument,
791eae561b3SGarrett Wollmanwhere nothing is to be done.
7921abae7eeSRuslan Ermilov.Pp
7931abae7eeSRuslan Ermilov.It Xo
7941abae7eeSRuslan Ermilov.Ft int
7951abae7eeSRuslan Ermilov.Xc
7961abae7eeSRuslan Ermilov.It Xo
7971abae7eeSRuslan Ermilov.Fn xdr_wrapstring "XDR *xdrs" "char **sp"
7981abae7eeSRuslan Ermilov.Xc
7991abae7eeSRuslan Ermilov.Pp
800eae561b3SGarrett WollmanA primitive that calls
8011abae7eeSRuslan Ermilov.Fn xdr_string xdrs sp MAXUN.UNSIGNED ;
802eae561b3SGarrett Wollmanwhere
8031abae7eeSRuslan Ermilov.Dv MAXUN.UNSIGNED
804eae561b3SGarrett Wollmanis the maximum value of an unsigned integer.
8051fae73b1SRuslan ErmilovThe
8061abae7eeSRuslan Ermilov.Fn xdr_wrapstring
8071fae73b1SRuslan Ermilovfunction
808eae561b3SGarrett Wollmanis handy because the
8091abae7eeSRuslan Ermilov.Tn RPC
810eae561b3SGarrett Wollmanpackage passes a maximum of two
8111abae7eeSRuslan Ermilov.Tn XDR
8122efeeba5SRuslan Ermilovroutines as arguments, and
8131abae7eeSRuslan Ermilov.Fn xdr_string ,
814eae561b3SGarrett Wollmanone of the most frequently used primitives, requires three.
815eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise.
8161abae7eeSRuslan Ermilov.El
8171abae7eeSRuslan Ermilov.Sh SEE ALSO
8181abae7eeSRuslan Ermilov.Xr rpc 3
8191abae7eeSRuslan Ermilov.Rs
8201abae7eeSRuslan Ermilov.%T "eXternal Data Representation Standard: Protocol Specification"
8211abae7eeSRuslan Ermilov.Re
8221abae7eeSRuslan Ermilov.Rs
8231abae7eeSRuslan Ermilov.%T "eXternal Data Representation: Sun Technical Notes"
8241abae7eeSRuslan Ermilov.Re
8251abae7eeSRuslan Ermilov.Rs
8261abae7eeSRuslan Ermilov.%T "XDR: External Data Representation Standard"
8271abae7eeSRuslan Ermilov.%O RFC1014
8281abae7eeSRuslan Ermilov.%Q "Sun Microsystems, Inc., USC\-ISI"
8291abae7eeSRuslan Ermilov.Re
830