xref: /freebsd/lib/libc/xdr/xdr.3 (revision d98b6d6eddc726199f06ba3e0005a916aca13498)
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 ,
34*d98b6d6eSKevin Lo.Nm xdr_sizeof,
358360efbdSAlfred Perlstein.Nm xdrstdio_create ,
368360efbdSAlfred Perlstein.Nm xdr_string ,
378360efbdSAlfred Perlstein.Nm xdr_u_char ,
388360efbdSAlfred Perlstein.Nm xdr_u_hyper ,
398360efbdSAlfred Perlstein.Nm xdr_u_int ,
408360efbdSAlfred Perlstein.Nm xdr_u_long ,
418360efbdSAlfred Perlstein.Nm xdr_u_longlong_t ,
428360efbdSAlfred Perlstein.Nm xdr_u_short ,
438360efbdSAlfred Perlstein.Nm xdr_union ,
448360efbdSAlfred Perlstein.Nm xdr_vector ,
458360efbdSAlfred Perlstein.Nm xdr_void ,
468360efbdSAlfred Perlstein.Nm xdr_wrapstring
471abae7eeSRuslan Ermilov.Nd "library routines for external data representation"
481abae7eeSRuslan Ermilov.Sh LIBRARY
491abae7eeSRuslan Ermilov.Lb libc
501abae7eeSRuslan Ermilov.Sh SYNOPSIS
5132eef9aeSRuslan Ermilov.In rpc/types.h
5232eef9aeSRuslan Ermilov.In rpc/xdr.h
531abae7eeSRuslan Ermilov.Pp
541abae7eeSRuslan ErmilovSee
551abae7eeSRuslan Ermilov.Sx DESCRIPTION
561abae7eeSRuslan Ermilovfor function declarations.
571abae7eeSRuslan Ermilov.Sh DESCRIPTION
58eae561b3SGarrett WollmanThese routines allow C programmers to describe
59eae561b3SGarrett Wollmanarbitrary data structures in a machine-independent fashion.
60eae561b3SGarrett WollmanData for remote procedure calls are transmitted using these
61eae561b3SGarrett Wollmanroutines.
621abae7eeSRuslan Ermilov.Pp
631abae7eeSRuslan Ermilov.Bl -tag -width indent -compact
641abae7eeSRuslan Ermilov.It Xo
651abae7eeSRuslan Ermilov.Ft int
661abae7eeSRuslan Ermilov.Xc
671abae7eeSRuslan Ermilov.It Xo
681abae7eeSRuslan Ermilov.Fo xdr_array
691abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
701abae7eeSRuslan Ermilov.Fa "char **arrp"
711abae7eeSRuslan Ermilov.Fa "u_int *sizep"
721abae7eeSRuslan Ermilov.Fa "u_int maxsize"
731abae7eeSRuslan Ermilov.Fa "u_int elsize"
741abae7eeSRuslan Ermilov.Fa "xdrproc_t elproc"
751abae7eeSRuslan Ermilov.Fc
761abae7eeSRuslan Ermilov.Xc
771abae7eeSRuslan Ermilov.Pp
78eae561b3SGarrett WollmanA filter primitive that translates between variable-length
79eae561b3SGarrett Wollmanarrays
80c6ff3a1bSSheldon Hearnand their corresponding external representations.
81c6ff3a1bSSheldon HearnThe
821abae7eeSRuslan Ermilov.Fa arrp
832efeeba5SRuslan Ermilovargument
84eae561b3SGarrett Wollmanis the address of the pointer to the array, while
851abae7eeSRuslan Ermilov.Fa sizep
86eae561b3SGarrett Wollmanis the address of the element count of the array;
87eae561b3SGarrett Wollmanthis element count cannot exceed
881abae7eeSRuslan Ermilov.Fa maxsize .
892efeeba5SRuslan ErmilovThe
901abae7eeSRuslan Ermilov.Fa elsize
912efeeba5SRuslan Ermilovargument
92eae561b3SGarrett Wollmanis the
931abae7eeSRuslan Ermilov.Ic sizeof
94eae561b3SGarrett Wollmaneach of the array's elements, and
951abae7eeSRuslan Ermilov.Fa elproc
96eae561b3SGarrett Wollmanis an
971abae7eeSRuslan Ermilov.Tn XDR
98eae561b3SGarrett Wollmanfilter that translates between
99eae561b3SGarrett Wollmanthe array elements' C form, and their external
100eae561b3SGarrett Wollmanrepresentation.
101eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1021abae7eeSRuslan Ermilov.Pp
1031abae7eeSRuslan Ermilov.It Xo
1041abae7eeSRuslan Ermilov.Ft int
1051abae7eeSRuslan Ermilov.Xc
1061abae7eeSRuslan Ermilov.It Xo
1071abae7eeSRuslan Ermilov.Fn xdr_bool "XDR *xdrs" "bool_t *bp"
1081abae7eeSRuslan Ermilov.Xc
1091abae7eeSRuslan Ermilov.Pp
110eae561b3SGarrett WollmanA filter primitive that translates between booleans (C
111eae561b3SGarrett Wollmanintegers)
112c6ff3a1bSSheldon Hearnand their external representations.
113c6ff3a1bSSheldon HearnWhen encoding data, this
114eae561b3SGarrett Wollmanfilter produces values of either one or zero.
115eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1161abae7eeSRuslan Ermilov.Pp
1171abae7eeSRuslan Ermilov.It Xo
1181abae7eeSRuslan Ermilov.Ft int
1191abae7eeSRuslan Ermilov.Xc
1201abae7eeSRuslan Ermilov.It Xo
1211abae7eeSRuslan Ermilov.Fn xdr_bytes "XDR *xdrs" "char **sp" "u_int *sizep" "u_int maxsize"
1221abae7eeSRuslan Ermilov.Xc
1231abae7eeSRuslan Ermilov.Pp
124eae561b3SGarrett WollmanA filter primitive that translates between counted byte
125eae561b3SGarrett Wollmanstrings and their external representations.
1262efeeba5SRuslan ErmilovThe
1271abae7eeSRuslan Ermilov.Fa sp
1282efeeba5SRuslan Ermilovargument
129c6ff3a1bSSheldon Hearnis the address of the string pointer.
130c6ff3a1bSSheldon HearnThe length of the
131eae561b3SGarrett Wollmanstring is located at address
1321abae7eeSRuslan Ermilov.Fa sizep ;
133eae561b3SGarrett Wollmanstrings cannot be longer than
1341abae7eeSRuslan Ermilov.Fa maxsize .
135eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1361abae7eeSRuslan Ermilov.Pp
1371abae7eeSRuslan Ermilov.It Xo
1381abae7eeSRuslan Ermilov.Ft int
1391abae7eeSRuslan Ermilov.Xc
1401abae7eeSRuslan Ermilov.It Xo
1411abae7eeSRuslan Ermilov.Fn xdr_char "XDR *xdrs" "char *cp"
1421abae7eeSRuslan Ermilov.Xc
1431abae7eeSRuslan Ermilov.Pp
144eae561b3SGarrett WollmanA filter primitive that translates between C characters
145eae561b3SGarrett Wollmanand their external representations.
146eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
147eae561b3SGarrett WollmanNote: encoded characters are not packed, and occupy 4 bytes
148c6ff3a1bSSheldon Hearneach.
149c6ff3a1bSSheldon HearnFor arrays of characters, it is worthwhile to
150eae561b3SGarrett Wollmanconsider
1511abae7eeSRuslan Ermilov.Fn xdr_bytes ,
1521abae7eeSRuslan Ermilov.Fn xdr_opaque
153eae561b3SGarrett Wollmanor
1541abae7eeSRuslan Ermilov.Fn xdr_string .
1551abae7eeSRuslan Ermilov.Pp
1561abae7eeSRuslan Ermilov.It Xo
1571abae7eeSRuslan Ermilov.Ft void
1581abae7eeSRuslan Ermilov.Xc
1591abae7eeSRuslan Ermilov.It Xo
1601abae7eeSRuslan Ermilov.Fn xdr_destroy "XDR *xdrs"
1611abae7eeSRuslan Ermilov.Xc
1621abae7eeSRuslan Ermilov.Pp
163eae561b3SGarrett WollmanA macro that invokes the destroy routine associated with the
1641abae7eeSRuslan Ermilov.Tn XDR
165eae561b3SGarrett Wollmanstream,
1661abae7eeSRuslan Ermilov.Fa xdrs .
167eae561b3SGarrett WollmanDestruction usually involves freeing private data structures
1681abae7eeSRuslan Ermilovassociated with the stream.
1691abae7eeSRuslan ErmilovUsing
1701abae7eeSRuslan Ermilov.Fa xdrs
171eae561b3SGarrett Wollmanafter invoking
1721abae7eeSRuslan Ermilov.Fn xdr_destroy
173eae561b3SGarrett Wollmanis undefined.
1741abae7eeSRuslan Ermilov.Pp
1751abae7eeSRuslan Ermilov.It Xo
1761abae7eeSRuslan Ermilov.Ft int
1771abae7eeSRuslan Ermilov.Xc
1781abae7eeSRuslan Ermilov.It Xo
1791abae7eeSRuslan Ermilov.Fn xdr_double "XDR *xdrs" "double *dp"
1801abae7eeSRuslan Ermilov.Xc
1811abae7eeSRuslan Ermilov.Pp
182eae561b3SGarrett WollmanA filter primitive that translates between C
1831abae7eeSRuslan Ermilov.Vt double
184eae561b3SGarrett Wollmanprecision numbers and their external representations.
185eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1861abae7eeSRuslan Ermilov.Pp
1871abae7eeSRuslan Ermilov.It Xo
1881abae7eeSRuslan Ermilov.Ft int
1891abae7eeSRuslan Ermilov.Xc
1901abae7eeSRuslan Ermilov.It Xo
1911abae7eeSRuslan Ermilov.Fn xdr_enum "XDR *xdrs" "enum_t *ep"
1921abae7eeSRuslan Ermilov.Xc
1931abae7eeSRuslan Ermilov.Pp
194eae561b3SGarrett WollmanA filter primitive that translates between C
1951abae7eeSRuslan Ermilov.Vt enum Ns s
196eae561b3SGarrett Wollman(actually integers) and their external representations.
197eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1981abae7eeSRuslan Ermilov.Pp
1991abae7eeSRuslan Ermilov.It Xo
2001abae7eeSRuslan Ermilov.Ft int
2011abae7eeSRuslan Ermilov.Xc
2021abae7eeSRuslan Ermilov.It Xo
2031abae7eeSRuslan Ermilov.Fn xdr_float "XDR *xdrs" "float *fp"
2041abae7eeSRuslan Ermilov.Xc
2051abae7eeSRuslan Ermilov.Pp
206eae561b3SGarrett WollmanA filter primitive that translates between C
2071abae7eeSRuslan Ermilov.Vt float Ns s
208eae561b3SGarrett Wollmanand their external representations.
209eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
2101abae7eeSRuslan Ermilov.Pp
2111abae7eeSRuslan Ermilov.It Xo
2121abae7eeSRuslan Ermilov.Ft void
2131abae7eeSRuslan Ermilov.Xc
2141abae7eeSRuslan Ermilov.It Xo
2157062693eSRuslan Ermilov.Fn xdr_free "xdrproc_t proc" "void *objp"
2161abae7eeSRuslan Ermilov.Xc
2171abae7eeSRuslan Ermilov.Pp
218c6ff3a1bSSheldon HearnGeneric freeing routine.
219c6ff3a1bSSheldon HearnThe first argument is the
2201abae7eeSRuslan Ermilov.Tn XDR
221c6ff3a1bSSheldon Hearnroutine for the object being freed.
222c6ff3a1bSSheldon HearnThe second argument
223c6ff3a1bSSheldon Hearnis a pointer to the object itself.
224c6ff3a1bSSheldon HearnNote: the pointer passed
225eae561b3SGarrett Wollmanto this routine is
2261abae7eeSRuslan Ermilov.Em not
227eae561b3SGarrett Wollmanfreed, but what it points to
2281abae7eeSRuslan Ermilov.Em is
229eae561b3SGarrett Wollmanfreed (recursively).
2301abae7eeSRuslan Ermilov.Pp
2311abae7eeSRuslan Ermilov.It Xo
2321abae7eeSRuslan Ermilov.Ft u_int
2331abae7eeSRuslan Ermilov.Xc
2341abae7eeSRuslan Ermilov.It Xo
2351abae7eeSRuslan Ermilov.Fn xdr_getpos "XDR *xdrs"
2361abae7eeSRuslan Ermilov.Xc
2371abae7eeSRuslan Ermilov.Pp
2381abae7eeSRuslan ErmilovA macro that invokes the get\-position routine
239eae561b3SGarrett Wollmanassociated with the
2401abae7eeSRuslan Ermilov.Tn XDR
241eae561b3SGarrett Wollmanstream,
2421abae7eeSRuslan Ermilov.Fa xdrs .
243eae561b3SGarrett WollmanThe routine returns an unsigned integer,
244eae561b3SGarrett Wollmanwhich indicates the position of the
2451abae7eeSRuslan Ermilov.Tn XDR
246eae561b3SGarrett Wollmanbyte stream.
247eae561b3SGarrett WollmanA desirable feature of
2481abae7eeSRuslan Ermilov.Tn XDR
249eae561b3SGarrett Wollmanstreams is that simple arithmetic works with this number,
250eae561b3SGarrett Wollmanalthough the
2511abae7eeSRuslan Ermilov.Tn XDR
252eae561b3SGarrett Wollmanstream instances need not guarantee this.
2531abae7eeSRuslan Ermilov.Pp
2541abae7eeSRuslan Ermilov.It Xo
2558360efbdSAlfred Perlstein.Ft int
2568360efbdSAlfred Perlstein.Xc
2578360efbdSAlfred Perlstein.It Xo
2585843ec1dSBruce Evans.Fn xdr_hyper "XDR *xdrs" "quad_t *llp"
2598360efbdSAlfred Perlstein.Xc
2608360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C
2618360efbdSAlfred Perlstein.Vt "long long"
2628360efbdSAlfred Perlsteinintegers and their external representations.
2638360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
2648360efbdSAlfred Perlstein.Pp
2658360efbdSAlfred Perlstein.It Xo
2661abae7eeSRuslan Ermilov.Ft "long *"
2671abae7eeSRuslan Ermilov.Xc
2681abae7eeSRuslan Ermilov.It Xo
2691abae7eeSRuslan Ermilov.Fn xdr_inline "XDR *xdrs" "int len"
2701abae7eeSRuslan Ermilov.Xc
2711abae7eeSRuslan Ermilov.Pp
272eae561b3SGarrett WollmanA macro that invokes the in-line routine associated with the
2731abae7eeSRuslan Ermilov.Tn XDR
274eae561b3SGarrett Wollmanstream,
2751abae7eeSRuslan Ermilov.Fa xdrs .
276eae561b3SGarrett WollmanThe routine returns a pointer
277eae561b3SGarrett Wollmanto a contiguous piece of the stream's buffer;
2781abae7eeSRuslan Ermilov.Fa len
279eae561b3SGarrett Wollmanis the byte length of the desired buffer.
280eae561b3SGarrett WollmanNote: pointer is cast to
2811abae7eeSRuslan Ermilov.Vt "long *" .
2821abae7eeSRuslan Ermilov.Pp
283eae561b3SGarrett WollmanWarning:
2841abae7eeSRuslan Ermilov.Fn xdr_inline
285eae561b3SGarrett Wollmanmay return
2861abae7eeSRuslan Ermilov.Dv NULL
287eae561b3SGarrett Wollman(0)
288eae561b3SGarrett Wollmanif it cannot allocate a contiguous piece of a buffer.
289eae561b3SGarrett WollmanTherefore the behavior may vary among stream instances;
290eae561b3SGarrett Wollmanit exists for the sake of efficiency.
2911abae7eeSRuslan Ermilov.Pp
2921abae7eeSRuslan Ermilov.It Xo
2931abae7eeSRuslan Ermilov.Ft int
2941abae7eeSRuslan Ermilov.Xc
2951abae7eeSRuslan Ermilov.It Xo
2961abae7eeSRuslan Ermilov.Fn xdr_int "XDR *xdrs" "int *ip"
2971abae7eeSRuslan Ermilov.Xc
2981abae7eeSRuslan Ermilov.Pp
299eae561b3SGarrett WollmanA filter primitive that translates between C integers
300eae561b3SGarrett Wollmanand their external representations.
301eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3021abae7eeSRuslan Ermilov.Pp
3031abae7eeSRuslan Ermilov.It Xo
3041abae7eeSRuslan Ermilov.Ft int
3051abae7eeSRuslan Ermilov.Xc
3061abae7eeSRuslan Ermilov.It Xo
3071abae7eeSRuslan Ermilov.Fn xdr_long "XDR *xdrs" "long *lp"
3081abae7eeSRuslan Ermilov.Xc
3091abae7eeSRuslan Ermilov.Pp
310eae561b3SGarrett WollmanA filter primitive that translates between C
3111abae7eeSRuslan Ermilov.Vt long
312eae561b3SGarrett Wollmanintegers and their external representations.
313eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3141abae7eeSRuslan Ermilov.Pp
3151abae7eeSRuslan Ermilov.It Xo
3168360efbdSAlfred Perlstein.Ft int
3178360efbdSAlfred Perlstein.Xc
3188360efbdSAlfred Perlstein.It Xo
3195843ec1dSBruce Evans.Fn xdr_longlong_t "XDR *xdrs" "quad_t *llp"
3208360efbdSAlfred Perlstein.Xc
3218360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C
3228360efbdSAlfred Perlstein.Vt "long long"
3238360efbdSAlfred Perlsteinintegers and their external representations.
3248360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
3258360efbdSAlfred Perlstein.Pp
3268360efbdSAlfred Perlstein.It Xo
3271abae7eeSRuslan Ermilov.Ft void
3281abae7eeSRuslan Ermilov.Xc
3291abae7eeSRuslan Ermilov.It Xo
3301abae7eeSRuslan Ermilov.Fn xdrmem_create "XDR *xdrs" "char *addr" "u_int size" "enum xdr_op op"
3311abae7eeSRuslan Ermilov.Xc
3321abae7eeSRuslan Ermilov.Pp
333eae561b3SGarrett WollmanThis routine initializes the
3341abae7eeSRuslan Ermilov.Tn XDR
335eae561b3SGarrett Wollmanstream object pointed to by
3361abae7eeSRuslan Ermilov.Fa xdrs .
337eae561b3SGarrett WollmanThe stream's data is written to, or read from,
338eae561b3SGarrett Wollmana chunk of memory at location
3391abae7eeSRuslan Ermilov.Fa addr
340eae561b3SGarrett Wollmanwhose length is no more than
3411abae7eeSRuslan Ermilov.Fa size
3421abae7eeSRuslan Ermilovbytes long.
3431abae7eeSRuslan ErmilovThe
3441abae7eeSRuslan Ermilov.Fa op
3452efeeba5SRuslan Ermilovargument
346eae561b3SGarrett Wollmandetermines the direction of the
3471abae7eeSRuslan Ermilov.Tn XDR
348eae561b3SGarrett Wollmanstream
349eae561b3SGarrett Wollman(either
3501abae7eeSRuslan Ermilov.Dv XDR_ENCODE ,
3511abae7eeSRuslan Ermilov.Dv XDR_DECODE ,
352eae561b3SGarrett Wollmanor
3531abae7eeSRuslan Ermilov.Dv XDR_FREE ) .
3541abae7eeSRuslan Ermilov.Pp
3551abae7eeSRuslan Ermilov.It Xo
3561abae7eeSRuslan Ermilov.Ft int
3571abae7eeSRuslan Ermilov.Xc
3581abae7eeSRuslan Ermilov.It Xo
3591abae7eeSRuslan Ermilov.Fn xdr_opaque "XDR *xdrs" "char *cp" "u_int cnt"
3601abae7eeSRuslan Ermilov.Xc
3611abae7eeSRuslan Ermilov.Pp
362eae561b3SGarrett WollmanA filter primitive that translates between fixed size opaque
363eae561b3SGarrett Wollmandata
364eae561b3SGarrett Wollmanand its external representation.
3652efeeba5SRuslan ErmilovThe
3661abae7eeSRuslan Ermilov.Fa cp
3672efeeba5SRuslan Ermilovargument
368eae561b3SGarrett Wollmanis the address of the opaque object, and
3691abae7eeSRuslan Ermilov.Fa cnt
370eae561b3SGarrett Wollmanis its size in bytes.
371eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3721abae7eeSRuslan Ermilov.Pp
3731abae7eeSRuslan Ermilov.It Xo
3741abae7eeSRuslan Ermilov.Ft int
3751abae7eeSRuslan Ermilov.Xc
3761abae7eeSRuslan Ermilov.It Xo
3771abae7eeSRuslan Ermilov.Fn xdr_pointer "XDR *xdrs" "char **objpp" "u_int objsize" "xdrproc_t xdrobj"
3781abae7eeSRuslan Ermilov.Xc
3791abae7eeSRuslan Ermilov.Pp
380eae561b3SGarrett WollmanLike
3811abae7eeSRuslan Ermilov.Fn xdr_reference
3821abae7eeSRuslan Ermilovexcept that it serializes
3831abae7eeSRuslan Ermilov.Dv NULL
384eae561b3SGarrett Wollmanpointers, whereas
3851abae7eeSRuslan Ermilov.Fn xdr_reference
3861abae7eeSRuslan Ermilovdoes not.
3871abae7eeSRuslan ErmilovThus,
3881abae7eeSRuslan Ermilov.Fn xdr_pointer
389eae561b3SGarrett Wollmancan represent
390eae561b3SGarrett Wollmanrecursive data structures, such as binary trees or
391eae561b3SGarrett Wollmanlinked lists.
3921abae7eeSRuslan Ermilov.Pp
3931abae7eeSRuslan Ermilov.It Xo
3941abae7eeSRuslan Ermilov.Ft void
3951abae7eeSRuslan Ermilov.Xc
3961abae7eeSRuslan Ermilov.It Xo
3971abae7eeSRuslan Ermilov.Fo xdrrec_create
3981abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
3991abae7eeSRuslan Ermilov.Fa "u_int sendsize"
4001abae7eeSRuslan Ermilov.Fa "u_int recvsize"
4017062693eSRuslan Ermilov.Fa "void *handle"
4021abae7eeSRuslan Ermilov.Fa "int \*(lp*readit\*(rp\*(lp\*(rp"
4031abae7eeSRuslan Ermilov.Fa "int \*(lp*writeit\*(rp\*(lp\*(rp"
4041abae7eeSRuslan Ermilov.Fc
4051abae7eeSRuslan Ermilov.Xc
4061abae7eeSRuslan Ermilov.Pp
407eae561b3SGarrett WollmanThis routine initializes the
4081abae7eeSRuslan Ermilov.Tn XDR
409eae561b3SGarrett Wollmanstream object pointed to by
4101abae7eeSRuslan Ermilov.Fa xdrs .
411eae561b3SGarrett WollmanThe stream's data is written to a buffer of size
4121abae7eeSRuslan Ermilov.Fa sendsize ;
413eae561b3SGarrett Wollmana value of zero indicates the system should use a suitable
414c6ff3a1bSSheldon Hearndefault.
415c6ff3a1bSSheldon HearnThe stream's data is read from a buffer of size
4161abae7eeSRuslan Ermilov.Fa recvsize ;
417eae561b3SGarrett Wollmanit too can be set to a suitable default by passing a zero
418eae561b3SGarrett Wollmanvalue.
419eae561b3SGarrett WollmanWhen a stream's output buffer is full,
4201abae7eeSRuslan Ermilov.Fn writeit
4211abae7eeSRuslan Ermilovis called.
4221abae7eeSRuslan ErmilovSimilarly, when a stream's input buffer is empty,
4231abae7eeSRuslan Ermilov.Fn readit
4241abae7eeSRuslan Ermilovis called.
4251abae7eeSRuslan ErmilovThe behavior of these two routines is similar to
426eae561b3SGarrett Wollmanthe
427eae561b3SGarrett Wollmansystem calls
4281abae7eeSRuslan Ermilov.Xr read 2
429eae561b3SGarrett Wollmanand
4301abae7eeSRuslan Ermilov.Xr write 2 ,
431eae561b3SGarrett Wollmanexcept that
4321abae7eeSRuslan Ermilov.Fa handle
4332efeeba5SRuslan Ermilovis passed to the former routines as the first argument.
434eae561b3SGarrett WollmanNote: the
4351abae7eeSRuslan Ermilov.Tn XDR
436eae561b3SGarrett Wollmanstream's
4371abae7eeSRuslan Ermilov.Fa op
438eae561b3SGarrett Wollmanfield must be set by the caller.
4391abae7eeSRuslan Ermilov.Pp
440eae561b3SGarrett WollmanWarning: this
4411abae7eeSRuslan Ermilov.Tn XDR
442eae561b3SGarrett Wollmanstream implements an intermediate record stream.
443eae561b3SGarrett WollmanTherefore there are additional bytes in the stream
444eae561b3SGarrett Wollmanto provide record boundary information.
4451abae7eeSRuslan Ermilov.Pp
4461abae7eeSRuslan Ermilov.It Xo
4471abae7eeSRuslan Ermilov.Ft int
4481abae7eeSRuslan Ermilov.Xc
4491abae7eeSRuslan Ermilov.It Xo
4501abae7eeSRuslan Ermilov.Fn xdrrec_endofrecord "XDR *xdrs" "int sendnow"
4511abae7eeSRuslan Ermilov.Xc
4521abae7eeSRuslan Ermilov.Pp
453eae561b3SGarrett WollmanThis routine can be invoked only on
454eae561b3SGarrett Wollmanstreams created by
4551abae7eeSRuslan Ermilov.Fn xdrrec_create .
456eae561b3SGarrett WollmanThe data in the output buffer is marked as a completed
457eae561b3SGarrett Wollmanrecord,
458eae561b3SGarrett Wollmanand the output buffer is optionally written out if
4591abae7eeSRuslan Ermilov.Fa sendnow
460c6ff3a1bSSheldon Hearnis non-zero.
461c6ff3a1bSSheldon HearnThis routine returns one if it succeeds, zero
462eae561b3SGarrett Wollmanotherwise.
4631abae7eeSRuslan Ermilov.Pp
4641abae7eeSRuslan Ermilov.It Xo
4651abae7eeSRuslan Ermilov.Ft int
4661abae7eeSRuslan Ermilov.Xc
4671abae7eeSRuslan Ermilov.It Xo
4681abae7eeSRuslan Ermilov.Fn xdrrec_eof "XDR *xdrs"
4691abae7eeSRuslan Ermilov.Xc
4701abae7eeSRuslan Ermilov.Pp
471eae561b3SGarrett WollmanThis routine can be invoked only on
472eae561b3SGarrett Wollmanstreams created by
4731abae7eeSRuslan Ermilov.Fn xdrrec_create .
474eae561b3SGarrett WollmanAfter consuming the rest of the current record in the stream,
475eae561b3SGarrett Wollmanthis routine returns one if the stream has no more input,
476eae561b3SGarrett Wollmanzero otherwise.
4771abae7eeSRuslan Ermilov.Pp
4781abae7eeSRuslan Ermilov.It Xo
4791abae7eeSRuslan Ermilov.Ft int
4801abae7eeSRuslan Ermilov.Xc
4811abae7eeSRuslan Ermilov.It Xo
4821abae7eeSRuslan Ermilov.Fn xdrrec_skiprecord "XDR *xdrs"
4831abae7eeSRuslan Ermilov.Xc
4841abae7eeSRuslan Ermilov.Pp
485eae561b3SGarrett WollmanThis routine can be invoked only on
486eae561b3SGarrett Wollmanstreams created by
4871abae7eeSRuslan Ermilov.Fn xdrrec_create .
488eae561b3SGarrett WollmanIt tells the
4891abae7eeSRuslan Ermilov.Tn XDR
490eae561b3SGarrett Wollmanimplementation that the rest of the current record
491eae561b3SGarrett Wollmanin the stream's input buffer should be discarded.
492eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
4931abae7eeSRuslan Ermilov.Pp
4941abae7eeSRuslan Ermilov.It Xo
4951abae7eeSRuslan Ermilov.Ft int
4961abae7eeSRuslan Ermilov.Xc
4971abae7eeSRuslan Ermilov.It Xo
4981abae7eeSRuslan Ermilov.Fn xdr_reference "XDR *xdrs" "char **pp" "u_int size" "xdrproc_t proc"
4991abae7eeSRuslan Ermilov.Xc
5001abae7eeSRuslan Ermilov.Pp
501eae561b3SGarrett WollmanA primitive that provides pointer chasing within structures.
5022efeeba5SRuslan ErmilovThe
5031abae7eeSRuslan Ermilov.Fa pp
5042efeeba5SRuslan Ermilovargument
505eae561b3SGarrett Wollmanis the address of the pointer;
5061abae7eeSRuslan Ermilov.Fa size
507eae561b3SGarrett Wollmanis the
5081abae7eeSRuslan Ermilov.Ic sizeof
509eae561b3SGarrett Wollmanthe structure that
5101abae7eeSRuslan Ermilov.Fa *pp
511eae561b3SGarrett Wollmanpoints to; and
5121abae7eeSRuslan Ermilov.Fa proc
513eae561b3SGarrett Wollmanis an
5141abae7eeSRuslan Ermilov.Tn XDR
515eae561b3SGarrett Wollmanprocedure that filters the structure
516eae561b3SGarrett Wollmanbetween its C form and its external representation.
517eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
5181abae7eeSRuslan Ermilov.Pp
519eae561b3SGarrett WollmanWarning: this routine does not understand
5201abae7eeSRuslan Ermilov.Dv NULL
521c6ff3a1bSSheldon Hearnpointers.
522c6ff3a1bSSheldon HearnUse
5231abae7eeSRuslan Ermilov.Fn xdr_pointer
524eae561b3SGarrett Wollmaninstead.
5251abae7eeSRuslan Ermilov.Pp
5261abae7eeSRuslan Ermilov.It Xo
5271abae7eeSRuslan Ermilov.Ft int
5281abae7eeSRuslan Ermilov.Xc
5291abae7eeSRuslan Ermilov.It Xo
5301abae7eeSRuslan Ermilov.Fn xdr_setpos "XDR *xdrs" "u_int pos"
5311abae7eeSRuslan Ermilov.Xc
5321abae7eeSRuslan Ermilov.Pp
533eae561b3SGarrett WollmanA macro that invokes the set position routine associated with
534eae561b3SGarrett Wollmanthe
5351abae7eeSRuslan Ermilov.Tn XDR
536eae561b3SGarrett Wollmanstream
5371abae7eeSRuslan Ermilov.Fa xdrs .
5382efeeba5SRuslan ErmilovThe
5391abae7eeSRuslan Ermilov.Fa pos
5402efeeba5SRuslan Ermilovargument
541eae561b3SGarrett Wollmanis a position value obtained from
5421abae7eeSRuslan Ermilov.Fn xdr_getpos .
543eae561b3SGarrett WollmanThis routine returns one if the
5441abae7eeSRuslan Ermilov.Tn XDR
545eae561b3SGarrett Wollmanstream could be repositioned,
546eae561b3SGarrett Wollmanand zero otherwise.
5471abae7eeSRuslan Ermilov.Pp
548eae561b3SGarrett WollmanWarning: it is difficult to reposition some types of
5491abae7eeSRuslan Ermilov.Tn XDR
550eae561b3SGarrett Wollmanstreams, so this routine may fail with one
551eae561b3SGarrett Wollmantype of stream and succeed with another.
5521abae7eeSRuslan Ermilov.Pp
5531abae7eeSRuslan Ermilov.It Xo
5541abae7eeSRuslan Ermilov.Ft int
5551abae7eeSRuslan Ermilov.Xc
5561abae7eeSRuslan Ermilov.It Xo
5571abae7eeSRuslan Ermilov.Fn xdr_short "XDR *xdrs" "short *sp"
5581abae7eeSRuslan Ermilov.Xc
5591abae7eeSRuslan Ermilov.Pp
560eae561b3SGarrett WollmanA filter primitive that translates between C
5611abae7eeSRuslan Ermilov.Vt short
562eae561b3SGarrett Wollmanintegers and their external representations.
563eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
5641abae7eeSRuslan Ermilov.Pp
565*d98b6d6eSKevin Lo.It Xo
566*d98b6d6eSKevin Lo.Ft unsigned long
567*d98b6d6eSKevin Lo.Xc
568*d98b6d6eSKevin Lo.It Xo
569*d98b6d6eSKevin Lo.Fn xdr_sizeof "xdrproc_t func" "void *data"
570*d98b6d6eSKevin Lo.Xc
571*d98b6d6eSKevin Lo.Pp
572*d98b6d6eSKevin LoThis routine returns the amount of memory required to encode
573*d98b6d6eSKevin Lo.Fa data
574*d98b6d6eSKevin Lousing filter
575*d98b6d6eSKevin Lo.Fa func .
576*d98b6d6eSKevin Lo.Pp
577c6e2c333SRuslan Ermilov.It Li "#ifdef _STDIO_H_"
578c6e2c333SRuslan Ermilov.It Li "/* XDR using stdio library */"
5791abae7eeSRuslan Ermilov.It Xo
5801abae7eeSRuslan Ermilov.Ft void
5811abae7eeSRuslan Ermilov.Xc
5821abae7eeSRuslan Ermilov.It Xo
5831abae7eeSRuslan Ermilov.Fn xdrstdio_create "XDR *xdrs" "FILE *file" "enum xdr_op op"
5841abae7eeSRuslan Ermilov.Xc
585c6e2c333SRuslan Ermilov.It Li "#endif"
5861abae7eeSRuslan Ermilov.Pp
587eae561b3SGarrett WollmanThis routine initializes the
5881abae7eeSRuslan Ermilov.Tn XDR
589eae561b3SGarrett Wollmanstream object pointed to by
5901abae7eeSRuslan Ermilov.Fa xdrs .
591eae561b3SGarrett WollmanThe
5921abae7eeSRuslan Ermilov.Tn XDR
593eae561b3SGarrett Wollmanstream data is written to, or read from, the Standard
5941abae7eeSRuslan Ermilov.Tn I/O
595eae561b3SGarrett Wollmanstream
5961abae7eeSRuslan Ermilov.Fa file .
5972efeeba5SRuslan ErmilovThe
5981abae7eeSRuslan Ermilov.Fa op
5992efeeba5SRuslan Ermilovargument
600eae561b3SGarrett Wollmandetermines the direction of the
6011abae7eeSRuslan Ermilov.Tn XDR
602eae561b3SGarrett Wollmanstream (either
6031abae7eeSRuslan Ermilov.Dv XDR_ENCODE ,
6041abae7eeSRuslan Ermilov.Dv XDR_DECODE ,
605eae561b3SGarrett Wollmanor
6061abae7eeSRuslan Ermilov.Dv XDR_FREE ) .
6071abae7eeSRuslan Ermilov.Pp
608eae561b3SGarrett WollmanWarning: the destroy routine associated with such
6091abae7eeSRuslan Ermilov.Tn XDR
610eae561b3SGarrett Wollmanstreams calls
6111abae7eeSRuslan Ermilov.Xr fflush 3
612eae561b3SGarrett Wollmanon the
6131abae7eeSRuslan Ermilov.Fa file
614eae561b3SGarrett Wollmanstream, but never
6151abae7eeSRuslan Ermilov.Xr fclose 3 .
6161abae7eeSRuslan Ermilov.Pp
6171abae7eeSRuslan Ermilov.It Xo
6181abae7eeSRuslan Ermilov.Ft int
6191abae7eeSRuslan Ermilov.Xc
6201abae7eeSRuslan Ermilov.It Xo
6211abae7eeSRuslan Ermilov.Fn xdr_string "XDR *xdrs" "char **sp" "u_int maxsize"
6221abae7eeSRuslan Ermilov.Xc
6231abae7eeSRuslan Ermilov.Pp
624eae561b3SGarrett WollmanA filter primitive that translates between C strings and
625eae561b3SGarrett Wollmantheir
626eae561b3SGarrett Wollmancorresponding external representations.
627eae561b3SGarrett WollmanStrings cannot be longer than
6281abae7eeSRuslan Ermilov.Fa maxsize .
629eae561b3SGarrett WollmanNote:
6301abae7eeSRuslan Ermilov.Fa sp
631eae561b3SGarrett Wollmanis the address of the string's pointer.
632eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6331abae7eeSRuslan Ermilov.Pp
6341abae7eeSRuslan Ermilov.It Xo
6351abae7eeSRuslan Ermilov.Ft int
6361abae7eeSRuslan Ermilov.Xc
6371abae7eeSRuslan Ermilov.It Xo
6381abae7eeSRuslan Ermilov.Fn xdr_u_char "XDR *xdrs" "unsigned char *ucp"
6391abae7eeSRuslan Ermilov.Xc
6401abae7eeSRuslan Ermilov.Pp
641eae561b3SGarrett WollmanA filter primitive that translates between
6421abae7eeSRuslan Ermilov.Vt unsigned
643eae561b3SGarrett WollmanC characters and their external representations.
644eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6451abae7eeSRuslan Ermilov.Pp
6461abae7eeSRuslan Ermilov.It Xo
6471abae7eeSRuslan Ermilov.Ft int
6481abae7eeSRuslan Ermilov.Xc
6491abae7eeSRuslan Ermilov.It Xo
6505843ec1dSBruce Evans.Fn xdr_u_hyper "XDR *xdrs" "u_quad_t *ullp"
6518360efbdSAlfred Perlstein.Xc
6528360efbdSAlfred PerlsteinA filter primitive that translates between
6538360efbdSAlfred Perlstein.Vt unsigned
6548360efbdSAlfred PerlsteinANSI C
6558360efbdSAlfred Perlstein.Vt long long
6568360efbdSAlfred Perlsteinintegers and their external representations.
6578360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
6588360efbdSAlfred Perlstein.Pp
6598360efbdSAlfred Perlstein.It Xo
6608360efbdSAlfred Perlstein.Ft int
6618360efbdSAlfred Perlstein.Xc
6628360efbdSAlfred Perlstein.It Xo
6631abae7eeSRuslan Ermilov.Fn xdr_u_int "XDR *xdrs" "unsigned *up"
6641abae7eeSRuslan Ermilov.Xc
6651abae7eeSRuslan Ermilov.Pp
666eae561b3SGarrett WollmanA filter primitive that translates between C
6671abae7eeSRuslan Ermilov.Vt unsigned
668eae561b3SGarrett Wollmanintegers and their external representations.
669eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6701abae7eeSRuslan Ermilov.Pp
6711abae7eeSRuslan Ermilov.It Xo
6721abae7eeSRuslan Ermilov.Ft int
6731abae7eeSRuslan Ermilov.Xc
6741abae7eeSRuslan Ermilov.It Xo
6751abae7eeSRuslan Ermilov.Fn xdr_u_long "XDR *xdrs" "unsigned long *ulp"
6761abae7eeSRuslan Ermilov.Xc
6771abae7eeSRuslan Ermilov.Pp
678eae561b3SGarrett WollmanA filter primitive that translates between C
6791abae7eeSRuslan Ermilov.Vt "unsigned long"
680eae561b3SGarrett Wollmanintegers and their external representations.
681eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6821abae7eeSRuslan Ermilov.Pp
6831abae7eeSRuslan Ermilov.It Xo
6841abae7eeSRuslan Ermilov.Ft int
6851abae7eeSRuslan Ermilov.Xc
6861abae7eeSRuslan Ermilov.It Xo
6875843ec1dSBruce Evans.Fn xdr_u_longlong_t "XDR *xdrs" "u_quad_t *ullp"
6888360efbdSAlfred Perlstein.Xc
6898360efbdSAlfred PerlsteinA filter primitive that translates between
6908360efbdSAlfred Perlstein.Vt unsigned
6918360efbdSAlfred PerlsteinANSI C
6928360efbdSAlfred Perlstein.Vt "long long"
6938360efbdSAlfred Perlsteinintegers and their external representations.
6948360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
6958360efbdSAlfred Perlstein.Pp
6968360efbdSAlfred Perlstein.It Xo
6978360efbdSAlfred Perlstein.Ft int
6988360efbdSAlfred Perlstein.Xc
6998360efbdSAlfred Perlstein.It Xo
7001abae7eeSRuslan Ermilov.Fn xdr_u_short "XDR *xdrs" "unsigned short *usp"
7011abae7eeSRuslan Ermilov.Xc
7021abae7eeSRuslan Ermilov.Pp
703eae561b3SGarrett WollmanA filter primitive that translates between C
7041abae7eeSRuslan Ermilov.Vt "unsigned short"
705eae561b3SGarrett Wollmanintegers and their external representations.
706eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
7071abae7eeSRuslan Ermilov.Pp
7081abae7eeSRuslan Ermilov.It Xo
7091abae7eeSRuslan Ermilov.Ft int
7101abae7eeSRuslan Ermilov.Xc
7111abae7eeSRuslan Ermilov.It Xo
7121abae7eeSRuslan Ermilov.Fo xdr_union
7131abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
7145843ec1dSBruce Evans.Fa "enum_t *dscmp"
7151abae7eeSRuslan Ermilov.Fa "char *unp"
7165843ec1dSBruce Evans.Fa "const struct xdr_discrim *choices"
7175843ec1dSBruce Evans.Fa "xdrproc_t defaultarm"
7181abae7eeSRuslan Ermilov.Fc
7191abae7eeSRuslan Ermilov.Xc
7201abae7eeSRuslan Ermilov.Pp
721eae561b3SGarrett WollmanA filter primitive that translates between a discriminated C
7221abae7eeSRuslan Ermilov.Vt union
723c6ff3a1bSSheldon Hearnand its corresponding external representation.
724c6ff3a1bSSheldon HearnIt first
725eae561b3SGarrett Wollmantranslates the discriminant of the union located at
7261abae7eeSRuslan Ermilov.Fa dscmp .
727eae561b3SGarrett WollmanThis discriminant is always an
7281abae7eeSRuslan Ermilov.Vt enum_t .
729eae561b3SGarrett WollmanNext the union located at
7301abae7eeSRuslan Ermilov.Fa unp
7311abae7eeSRuslan Ermilovis translated.
7322efeeba5SRuslan ErmilovThe
7331abae7eeSRuslan Ermilov.Fa choices
7342efeeba5SRuslan Ermilovargument
735eae561b3SGarrett Wollmanis a pointer to an array of
7361abae7eeSRuslan Ermilov.Vt xdr_discrim
737c6ff3a1bSSheldon Hearnstructures.
738c6ff3a1bSSheldon HearnEach structure contains an ordered pair of
7391abae7eeSRuslan Ermilov.Bq Va value , proc .
740eae561b3SGarrett WollmanIf the union's discriminant is equal to the associated
7411abae7eeSRuslan Ermilov.Va value ,
742eae561b3SGarrett Wollmanthen the
7431abae7eeSRuslan Ermilov.Fn proc
7441abae7eeSRuslan Ermilovis called to translate the union.
7451abae7eeSRuslan ErmilovThe end of the
7461abae7eeSRuslan Ermilov.Vt xdr_discrim
747eae561b3SGarrett Wollmanstructure array is denoted by a routine of value
7481abae7eeSRuslan Ermilov.Dv NULL .
749eae561b3SGarrett WollmanIf the discriminant is not found in the
7501abae7eeSRuslan Ermilov.Fa choices
751eae561b3SGarrett Wollmanarray, then the
7521abae7eeSRuslan Ermilov.Fn defaultarm
753eae561b3SGarrett Wollmanprocedure is called (if it is not
7541abae7eeSRuslan Ermilov.Dv NULL ) .
755eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise.
7561abae7eeSRuslan Ermilov.Pp
7571abae7eeSRuslan Ermilov.It Xo
7581abae7eeSRuslan Ermilov.Ft int
7591abae7eeSRuslan Ermilov.Xc
7601abae7eeSRuslan Ermilov.It Xo
7611abae7eeSRuslan Ermilov.Fo xdr_vector
7621abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
7631abae7eeSRuslan Ermilov.Fa "char *arrp"
7641abae7eeSRuslan Ermilov.Fa "u_int size"
7651abae7eeSRuslan Ermilov.Fa "u_int elsize"
7661abae7eeSRuslan Ermilov.Fa "xdrproc_t elproc"
7671abae7eeSRuslan Ermilov.Fc
7681abae7eeSRuslan Ermilov.Xc
7691abae7eeSRuslan Ermilov.Pp
770eae561b3SGarrett WollmanA filter primitive that translates between fixed-length
771eae561b3SGarrett Wollmanarrays
7721abae7eeSRuslan Ermilovand their corresponding external representations.
7731abae7eeSRuslan ErmilovThe
7741abae7eeSRuslan Ermilov.Fa arrp
7752efeeba5SRuslan Ermilovargument
776eae561b3SGarrett Wollmanis the address of the pointer to the array, while
7771abae7eeSRuslan Ermilov.Fa size
7781abae7eeSRuslan Ermilovis the element count of the array.
7792efeeba5SRuslan ErmilovThe
7801abae7eeSRuslan Ermilov.Fa elsize
7812efeeba5SRuslan Ermilovargument
782eae561b3SGarrett Wollmanis the
7831abae7eeSRuslan Ermilov.Ic sizeof
784eae561b3SGarrett Wollmaneach of the array's elements, and
7851abae7eeSRuslan Ermilov.Fa elproc
786eae561b3SGarrett Wollmanis an
7871abae7eeSRuslan Ermilov.Tn XDR
788eae561b3SGarrett Wollmanfilter that translates between
789eae561b3SGarrett Wollmanthe array elements' C form, and their external
790eae561b3SGarrett Wollmanrepresentation.
791eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
7921abae7eeSRuslan Ermilov.Pp
7931abae7eeSRuslan Ermilov.It Xo
7941abae7eeSRuslan Ermilov.Ft int
7951abae7eeSRuslan Ermilov.Xc
7961abae7eeSRuslan Ermilov.It Xo
7971abae7eeSRuslan Ermilov.Fn xdr_void void
7981abae7eeSRuslan Ermilov.Xc
7991abae7eeSRuslan Ermilov.Pp
800eae561b3SGarrett WollmanThis routine always returns one.
801eae561b3SGarrett WollmanIt may be passed to
8021abae7eeSRuslan Ermilov.Tn RPC
8032efeeba5SRuslan Ermilovroutines that require a function argument,
804eae561b3SGarrett Wollmanwhere nothing is to be done.
8051abae7eeSRuslan Ermilov.Pp
8061abae7eeSRuslan Ermilov.It Xo
8071abae7eeSRuslan Ermilov.Ft int
8081abae7eeSRuslan Ermilov.Xc
8091abae7eeSRuslan Ermilov.It Xo
8101abae7eeSRuslan Ermilov.Fn xdr_wrapstring "XDR *xdrs" "char **sp"
8111abae7eeSRuslan Ermilov.Xc
8121abae7eeSRuslan Ermilov.Pp
813eae561b3SGarrett WollmanA primitive that calls
8141abae7eeSRuslan Ermilov.Fn xdr_string xdrs sp MAXUN.UNSIGNED ;
815eae561b3SGarrett Wollmanwhere
8161abae7eeSRuslan Ermilov.Dv MAXUN.UNSIGNED
817eae561b3SGarrett Wollmanis the maximum value of an unsigned integer.
8181fae73b1SRuslan ErmilovThe
8191abae7eeSRuslan Ermilov.Fn xdr_wrapstring
8201fae73b1SRuslan Ermilovfunction
821eae561b3SGarrett Wollmanis handy because the
8221abae7eeSRuslan Ermilov.Tn RPC
823eae561b3SGarrett Wollmanpackage passes a maximum of two
8241abae7eeSRuslan Ermilov.Tn XDR
8252efeeba5SRuslan Ermilovroutines as arguments, and
8261abae7eeSRuslan Ermilov.Fn xdr_string ,
827eae561b3SGarrett Wollmanone of the most frequently used primitives, requires three.
828eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise.
8291abae7eeSRuslan Ermilov.El
8301abae7eeSRuslan Ermilov.Sh SEE ALSO
8311abae7eeSRuslan Ermilov.Xr rpc 3
8321abae7eeSRuslan Ermilov.Rs
8331abae7eeSRuslan Ermilov.%T "eXternal Data Representation Standard: Protocol Specification"
8341abae7eeSRuslan Ermilov.Re
8351abae7eeSRuslan Ermilov.Rs
8361abae7eeSRuslan Ermilov.%T "eXternal Data Representation: Sun Technical Notes"
8371abae7eeSRuslan Ermilov.Re
8381abae7eeSRuslan Ermilov.Rs
8391abae7eeSRuslan Ermilov.%T "XDR: External Data Representation Standard"
8401abae7eeSRuslan Ermilov.%O RFC1014
8411abae7eeSRuslan Ermilov.%Q "Sun Microsystems, Inc., USC\-ISI"
8421abae7eeSRuslan Ermilov.Re
843