xref: /freebsd/lib/libc/xdr/xdr.3 (revision dc36d6f9bb1753f3808552f3afd30eda9a7b206a)
1e83201b4SWolfram Schneider.\"
21abae7eeSRuslan Ermilov.Dd February 16, 1988
31abae7eeSRuslan Ermilov.Dt XDR 3
41abae7eeSRuslan Ermilov.Os
51abae7eeSRuslan Ermilov.Sh NAME
68360efbdSAlfred Perlstein.Nm xdr ,
78360efbdSAlfred Perlstein.Nm xdr_array ,
88360efbdSAlfred Perlstein.Nm xdr_bool ,
98360efbdSAlfred Perlstein.Nm xdr_bytes ,
108360efbdSAlfred Perlstein.Nm xdr_char ,
118360efbdSAlfred Perlstein.Nm xdr_destroy ,
128360efbdSAlfred Perlstein.Nm xdr_double ,
138360efbdSAlfred Perlstein.Nm xdr_enum ,
148360efbdSAlfred Perlstein.Nm xdr_float ,
158360efbdSAlfred Perlstein.Nm xdr_free ,
168360efbdSAlfred Perlstein.Nm xdr_getpos ,
178360efbdSAlfred Perlstein.Nm xdr_hyper ,
188360efbdSAlfred Perlstein.Nm xdr_inline ,
198360efbdSAlfred Perlstein.Nm xdr_int ,
208360efbdSAlfred Perlstein.Nm xdr_long ,
218360efbdSAlfred Perlstein.Nm xdr_longlong_t ,
228360efbdSAlfred Perlstein.Nm xdrmem_create ,
238360efbdSAlfred Perlstein.Nm xdr_opaque ,
248360efbdSAlfred Perlstein.Nm xdr_pointer ,
258360efbdSAlfred Perlstein.Nm xdrrec_create ,
268360efbdSAlfred Perlstein.Nm xdrrec_endofrecord ,
278360efbdSAlfred Perlstein.Nm xdrrec_eof ,
288360efbdSAlfred Perlstein.Nm xdrrec_skiprecord ,
298360efbdSAlfred Perlstein.Nm xdr_reference ,
308360efbdSAlfred Perlstein.Nm xdr_setpos ,
318360efbdSAlfred Perlstein.Nm xdr_short ,
32d98b6d6eSKevin Lo.Nm xdr_sizeof ,
338360efbdSAlfred Perlstein.Nm xdrstdio_create ,
348360efbdSAlfred Perlstein.Nm xdr_string ,
358360efbdSAlfred Perlstein.Nm xdr_u_char ,
368360efbdSAlfred Perlstein.Nm xdr_u_hyper ,
378360efbdSAlfred Perlstein.Nm xdr_u_int ,
388360efbdSAlfred Perlstein.Nm xdr_u_long ,
398360efbdSAlfred Perlstein.Nm xdr_u_longlong_t ,
408360efbdSAlfred Perlstein.Nm xdr_u_short ,
418360efbdSAlfred Perlstein.Nm xdr_union ,
428360efbdSAlfred Perlstein.Nm xdr_vector ,
438360efbdSAlfred Perlstein.Nm xdr_void ,
448360efbdSAlfred Perlstein.Nm xdr_wrapstring
451abae7eeSRuslan Ermilov.Nd "library routines for external data representation"
461abae7eeSRuslan Ermilov.Sh LIBRARY
471abae7eeSRuslan Ermilov.Lb libc
481abae7eeSRuslan Ermilov.Sh SYNOPSIS
4932eef9aeSRuslan Ermilov.In rpc/types.h
5032eef9aeSRuslan Ermilov.In rpc/xdr.h
511abae7eeSRuslan Ermilov.Pp
521abae7eeSRuslan ErmilovSee
531abae7eeSRuslan Ermilov.Sx DESCRIPTION
541abae7eeSRuslan Ermilovfor function declarations.
551abae7eeSRuslan Ermilov.Sh DESCRIPTION
56eae561b3SGarrett WollmanThese routines allow C programmers to describe
57eae561b3SGarrett Wollmanarbitrary data structures in a machine-independent fashion.
58eae561b3SGarrett WollmanData for remote procedure calls are transmitted using these
59eae561b3SGarrett Wollmanroutines.
601abae7eeSRuslan Ermilov.Pp
611abae7eeSRuslan Ermilov.Bl -tag -width indent -compact
621abae7eeSRuslan Ermilov.It Xo
631abae7eeSRuslan Ermilov.Ft int
641abae7eeSRuslan Ermilov.Xc
651abae7eeSRuslan Ermilov.It Xo
661abae7eeSRuslan Ermilov.Fo xdr_array
671abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
681abae7eeSRuslan Ermilov.Fa "char **arrp"
691abae7eeSRuslan Ermilov.Fa "u_int *sizep"
701abae7eeSRuslan Ermilov.Fa "u_int maxsize"
711abae7eeSRuslan Ermilov.Fa "u_int elsize"
721abae7eeSRuslan Ermilov.Fa "xdrproc_t elproc"
731abae7eeSRuslan Ermilov.Fc
741abae7eeSRuslan Ermilov.Xc
751abae7eeSRuslan Ermilov.Pp
76eae561b3SGarrett WollmanA filter primitive that translates between variable-length
77eae561b3SGarrett Wollmanarrays
78c6ff3a1bSSheldon Hearnand their corresponding external representations.
79c6ff3a1bSSheldon HearnThe
801abae7eeSRuslan Ermilov.Fa arrp
812efeeba5SRuslan Ermilovargument
82eae561b3SGarrett Wollmanis the address of the pointer to the array, while
831abae7eeSRuslan Ermilov.Fa sizep
84eae561b3SGarrett Wollmanis the address of the element count of the array;
85eae561b3SGarrett Wollmanthis element count cannot exceed
861abae7eeSRuslan Ermilov.Fa maxsize .
872efeeba5SRuslan ErmilovThe
881abae7eeSRuslan Ermilov.Fa elsize
892efeeba5SRuslan Ermilovargument
90eae561b3SGarrett Wollmanis the
911abae7eeSRuslan Ermilov.Ic sizeof
92eae561b3SGarrett Wollmaneach of the array's elements, and
931abae7eeSRuslan Ermilov.Fa elproc
94eae561b3SGarrett Wollmanis an
951abae7eeSRuslan Ermilov.Tn XDR
96eae561b3SGarrett Wollmanfilter that translates between
97eae561b3SGarrett Wollmanthe array elements' C form, and their external
98eae561b3SGarrett Wollmanrepresentation.
99eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1001abae7eeSRuslan Ermilov.Pp
1011abae7eeSRuslan Ermilov.It Xo
1021abae7eeSRuslan Ermilov.Ft int
1031abae7eeSRuslan Ermilov.Xc
1041abae7eeSRuslan Ermilov.It Xo
1051abae7eeSRuslan Ermilov.Fn xdr_bool "XDR *xdrs" "bool_t *bp"
1061abae7eeSRuslan Ermilov.Xc
1071abae7eeSRuslan Ermilov.Pp
108eae561b3SGarrett WollmanA filter primitive that translates between booleans (C
109eae561b3SGarrett Wollmanintegers)
110c6ff3a1bSSheldon Hearnand their external representations.
111c6ff3a1bSSheldon HearnWhen encoding data, this
112eae561b3SGarrett Wollmanfilter produces values of either one or zero.
113eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1141abae7eeSRuslan Ermilov.Pp
1151abae7eeSRuslan Ermilov.It Xo
1161abae7eeSRuslan Ermilov.Ft int
1171abae7eeSRuslan Ermilov.Xc
1181abae7eeSRuslan Ermilov.It Xo
1191abae7eeSRuslan Ermilov.Fn xdr_bytes "XDR *xdrs" "char **sp" "u_int *sizep" "u_int maxsize"
1201abae7eeSRuslan Ermilov.Xc
1211abae7eeSRuslan Ermilov.Pp
122eae561b3SGarrett WollmanA filter primitive that translates between counted byte
123eae561b3SGarrett Wollmanstrings and their external representations.
1242efeeba5SRuslan ErmilovThe
1251abae7eeSRuslan Ermilov.Fa sp
1262efeeba5SRuslan Ermilovargument
127c6ff3a1bSSheldon Hearnis the address of the string pointer.
128c6ff3a1bSSheldon HearnThe length of the
129eae561b3SGarrett Wollmanstring is located at address
1301abae7eeSRuslan Ermilov.Fa sizep ;
131eae561b3SGarrett Wollmanstrings cannot be longer than
1321abae7eeSRuslan Ermilov.Fa maxsize .
133eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1341abae7eeSRuslan Ermilov.Pp
1351abae7eeSRuslan Ermilov.It Xo
1361abae7eeSRuslan Ermilov.Ft int
1371abae7eeSRuslan Ermilov.Xc
1381abae7eeSRuslan Ermilov.It Xo
1391abae7eeSRuslan Ermilov.Fn xdr_char "XDR *xdrs" "char *cp"
1401abae7eeSRuslan Ermilov.Xc
1411abae7eeSRuslan Ermilov.Pp
142eae561b3SGarrett WollmanA filter primitive that translates between C characters
143eae561b3SGarrett Wollmanand their external representations.
144eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
145eae561b3SGarrett WollmanNote: encoded characters are not packed, and occupy 4 bytes
146c6ff3a1bSSheldon Hearneach.
147c6ff3a1bSSheldon HearnFor arrays of characters, it is worthwhile to
148eae561b3SGarrett Wollmanconsider
1491abae7eeSRuslan Ermilov.Fn xdr_bytes ,
1501abae7eeSRuslan Ermilov.Fn xdr_opaque
151eae561b3SGarrett Wollmanor
1521abae7eeSRuslan Ermilov.Fn xdr_string .
1531abae7eeSRuslan Ermilov.Pp
1541abae7eeSRuslan Ermilov.It Xo
1551abae7eeSRuslan Ermilov.Ft void
1561abae7eeSRuslan Ermilov.Xc
1571abae7eeSRuslan Ermilov.It Xo
1581abae7eeSRuslan Ermilov.Fn xdr_destroy "XDR *xdrs"
1591abae7eeSRuslan Ermilov.Xc
1601abae7eeSRuslan Ermilov.Pp
161eae561b3SGarrett WollmanA macro that invokes the destroy routine associated with the
1621abae7eeSRuslan Ermilov.Tn XDR
163eae561b3SGarrett Wollmanstream,
1641abae7eeSRuslan Ermilov.Fa xdrs .
165eae561b3SGarrett WollmanDestruction usually involves freeing private data structures
1661abae7eeSRuslan Ermilovassociated with the stream.
1671abae7eeSRuslan ErmilovUsing
1681abae7eeSRuslan Ermilov.Fa xdrs
169eae561b3SGarrett Wollmanafter invoking
1701abae7eeSRuslan Ermilov.Fn xdr_destroy
171eae561b3SGarrett Wollmanis undefined.
1721abae7eeSRuslan Ermilov.Pp
1731abae7eeSRuslan Ermilov.It Xo
1741abae7eeSRuslan Ermilov.Ft int
1751abae7eeSRuslan Ermilov.Xc
1761abae7eeSRuslan Ermilov.It Xo
1771abae7eeSRuslan Ermilov.Fn xdr_double "XDR *xdrs" "double *dp"
1781abae7eeSRuslan Ermilov.Xc
1791abae7eeSRuslan Ermilov.Pp
180eae561b3SGarrett WollmanA filter primitive that translates between C
1811abae7eeSRuslan Ermilov.Vt double
182eae561b3SGarrett Wollmanprecision numbers and their external representations.
183eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1841abae7eeSRuslan Ermilov.Pp
1851abae7eeSRuslan Ermilov.It Xo
1861abae7eeSRuslan Ermilov.Ft int
1871abae7eeSRuslan Ermilov.Xc
1881abae7eeSRuslan Ermilov.It Xo
1891abae7eeSRuslan Ermilov.Fn xdr_enum "XDR *xdrs" "enum_t *ep"
1901abae7eeSRuslan Ermilov.Xc
1911abae7eeSRuslan Ermilov.Pp
192eae561b3SGarrett WollmanA filter primitive that translates between C
1931abae7eeSRuslan Ermilov.Vt enum Ns s
194eae561b3SGarrett Wollman(actually integers) and their external representations.
195eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
1961abae7eeSRuslan Ermilov.Pp
1971abae7eeSRuslan Ermilov.It Xo
1981abae7eeSRuslan Ermilov.Ft int
1991abae7eeSRuslan Ermilov.Xc
2001abae7eeSRuslan Ermilov.It Xo
2011abae7eeSRuslan Ermilov.Fn xdr_float "XDR *xdrs" "float *fp"
2021abae7eeSRuslan Ermilov.Xc
2031abae7eeSRuslan Ermilov.Pp
204eae561b3SGarrett WollmanA filter primitive that translates between C
2051abae7eeSRuslan Ermilov.Vt float Ns s
206eae561b3SGarrett Wollmanand their external representations.
207eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
2081abae7eeSRuslan Ermilov.Pp
2091abae7eeSRuslan Ermilov.It Xo
2101abae7eeSRuslan Ermilov.Ft void
2111abae7eeSRuslan Ermilov.Xc
2121abae7eeSRuslan Ermilov.It Xo
2137062693eSRuslan Ermilov.Fn xdr_free "xdrproc_t proc" "void *objp"
2141abae7eeSRuslan Ermilov.Xc
2151abae7eeSRuslan Ermilov.Pp
216c6ff3a1bSSheldon HearnGeneric freeing routine.
217c6ff3a1bSSheldon HearnThe first argument is the
2181abae7eeSRuslan Ermilov.Tn XDR
219c6ff3a1bSSheldon Hearnroutine for the object being freed.
220c6ff3a1bSSheldon HearnThe second argument
221c6ff3a1bSSheldon Hearnis a pointer to the object itself.
222c6ff3a1bSSheldon HearnNote: the pointer passed
223eae561b3SGarrett Wollmanto this routine is
2241abae7eeSRuslan Ermilov.Em not
225eae561b3SGarrett Wollmanfreed, but what it points to
2261abae7eeSRuslan Ermilov.Em is
227eae561b3SGarrett Wollmanfreed (recursively).
2281abae7eeSRuslan Ermilov.Pp
2291abae7eeSRuslan Ermilov.It Xo
2301abae7eeSRuslan Ermilov.Ft u_int
2311abae7eeSRuslan Ermilov.Xc
2321abae7eeSRuslan Ermilov.It Xo
2331abae7eeSRuslan Ermilov.Fn xdr_getpos "XDR *xdrs"
2341abae7eeSRuslan Ermilov.Xc
2351abae7eeSRuslan Ermilov.Pp
2361abae7eeSRuslan ErmilovA macro that invokes the get\-position routine
237eae561b3SGarrett Wollmanassociated with the
2381abae7eeSRuslan Ermilov.Tn XDR
239eae561b3SGarrett Wollmanstream,
2401abae7eeSRuslan Ermilov.Fa xdrs .
241eae561b3SGarrett WollmanThe routine returns an unsigned integer,
242eae561b3SGarrett Wollmanwhich indicates the position of the
2431abae7eeSRuslan Ermilov.Tn XDR
244eae561b3SGarrett Wollmanbyte stream.
245eae561b3SGarrett WollmanA desirable feature of
2461abae7eeSRuslan Ermilov.Tn XDR
247eae561b3SGarrett Wollmanstreams is that simple arithmetic works with this number,
248eae561b3SGarrett Wollmanalthough the
2491abae7eeSRuslan Ermilov.Tn XDR
250eae561b3SGarrett Wollmanstream instances need not guarantee this.
2511abae7eeSRuslan Ermilov.Pp
2521abae7eeSRuslan Ermilov.It Xo
2538360efbdSAlfred Perlstein.Ft int
2548360efbdSAlfred Perlstein.Xc
2558360efbdSAlfred Perlstein.It Xo
2565843ec1dSBruce Evans.Fn xdr_hyper "XDR *xdrs" "quad_t *llp"
2578360efbdSAlfred Perlstein.Xc
2588360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C
2598360efbdSAlfred Perlstein.Vt "long long"
2608360efbdSAlfred Perlsteinintegers and their external representations.
2618360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
2628360efbdSAlfred Perlstein.Pp
2638360efbdSAlfred Perlstein.It Xo
2641abae7eeSRuslan Ermilov.Ft "long *"
2651abae7eeSRuslan Ermilov.Xc
2661abae7eeSRuslan Ermilov.It Xo
2671abae7eeSRuslan Ermilov.Fn xdr_inline "XDR *xdrs" "int len"
2681abae7eeSRuslan Ermilov.Xc
2691abae7eeSRuslan Ermilov.Pp
270eae561b3SGarrett WollmanA macro that invokes the in-line routine associated with the
2711abae7eeSRuslan Ermilov.Tn XDR
272eae561b3SGarrett Wollmanstream,
2731abae7eeSRuslan Ermilov.Fa xdrs .
274eae561b3SGarrett WollmanThe routine returns a pointer
275eae561b3SGarrett Wollmanto a contiguous piece of the stream's buffer;
2761abae7eeSRuslan Ermilov.Fa len
277eae561b3SGarrett Wollmanis the byte length of the desired buffer.
278eae561b3SGarrett WollmanNote: pointer is cast to
2791abae7eeSRuslan Ermilov.Vt "long *" .
2801abae7eeSRuslan Ermilov.Pp
281eae561b3SGarrett WollmanWarning:
2821abae7eeSRuslan Ermilov.Fn xdr_inline
283eae561b3SGarrett Wollmanmay return
2841abae7eeSRuslan Ermilov.Dv NULL
285eae561b3SGarrett Wollman(0)
286eae561b3SGarrett Wollmanif it cannot allocate a contiguous piece of a buffer.
287eae561b3SGarrett WollmanTherefore the behavior may vary among stream instances;
288eae561b3SGarrett Wollmanit exists for the sake of efficiency.
2891abae7eeSRuslan Ermilov.Pp
2901abae7eeSRuslan Ermilov.It Xo
2911abae7eeSRuslan Ermilov.Ft int
2921abae7eeSRuslan Ermilov.Xc
2931abae7eeSRuslan Ermilov.It Xo
2941abae7eeSRuslan Ermilov.Fn xdr_int "XDR *xdrs" "int *ip"
2951abae7eeSRuslan Ermilov.Xc
2961abae7eeSRuslan Ermilov.Pp
297eae561b3SGarrett WollmanA filter primitive that translates between C integers
298eae561b3SGarrett Wollmanand their external representations.
299eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3001abae7eeSRuslan Ermilov.Pp
3011abae7eeSRuslan Ermilov.It Xo
3021abae7eeSRuslan Ermilov.Ft int
3031abae7eeSRuslan Ermilov.Xc
3041abae7eeSRuslan Ermilov.It Xo
3051abae7eeSRuslan Ermilov.Fn xdr_long "XDR *xdrs" "long *lp"
3061abae7eeSRuslan Ermilov.Xc
3071abae7eeSRuslan Ermilov.Pp
308eae561b3SGarrett WollmanA filter primitive that translates between C
3091abae7eeSRuslan Ermilov.Vt long
310eae561b3SGarrett Wollmanintegers and their external representations.
311eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3121abae7eeSRuslan Ermilov.Pp
3131abae7eeSRuslan Ermilov.It Xo
3148360efbdSAlfred Perlstein.Ft int
3158360efbdSAlfred Perlstein.Xc
3168360efbdSAlfred Perlstein.It Xo
3175843ec1dSBruce Evans.Fn xdr_longlong_t "XDR *xdrs" "quad_t *llp"
3188360efbdSAlfred Perlstein.Xc
3198360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C
3208360efbdSAlfred Perlstein.Vt "long long"
3218360efbdSAlfred Perlsteinintegers and their external representations.
3228360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
3238360efbdSAlfred Perlstein.Pp
3248360efbdSAlfred Perlstein.It Xo
3251abae7eeSRuslan Ermilov.Ft void
3261abae7eeSRuslan Ermilov.Xc
3271abae7eeSRuslan Ermilov.It Xo
3281abae7eeSRuslan Ermilov.Fn xdrmem_create "XDR *xdrs" "char *addr" "u_int size" "enum xdr_op op"
3291abae7eeSRuslan Ermilov.Xc
3301abae7eeSRuslan Ermilov.Pp
331eae561b3SGarrett WollmanThis routine initializes the
3321abae7eeSRuslan Ermilov.Tn XDR
333eae561b3SGarrett Wollmanstream object pointed to by
3341abae7eeSRuslan Ermilov.Fa xdrs .
335eae561b3SGarrett WollmanThe stream's data is written to, or read from,
336eae561b3SGarrett Wollmana chunk of memory at location
3371abae7eeSRuslan Ermilov.Fa addr
338eae561b3SGarrett Wollmanwhose length is no more than
3391abae7eeSRuslan Ermilov.Fa size
3401abae7eeSRuslan Ermilovbytes long.
3411abae7eeSRuslan ErmilovThe
3421abae7eeSRuslan Ermilov.Fa op
3432efeeba5SRuslan Ermilovargument
344eae561b3SGarrett Wollmandetermines the direction of the
3451abae7eeSRuslan Ermilov.Tn XDR
346eae561b3SGarrett Wollmanstream
347eae561b3SGarrett Wollman(either
3481abae7eeSRuslan Ermilov.Dv XDR_ENCODE ,
3491abae7eeSRuslan Ermilov.Dv XDR_DECODE ,
350eae561b3SGarrett Wollmanor
3511abae7eeSRuslan Ermilov.Dv XDR_FREE ) .
3521abae7eeSRuslan Ermilov.Pp
3531abae7eeSRuslan Ermilov.It Xo
3541abae7eeSRuslan Ermilov.Ft int
3551abae7eeSRuslan Ermilov.Xc
3561abae7eeSRuslan Ermilov.It Xo
3571abae7eeSRuslan Ermilov.Fn xdr_opaque "XDR *xdrs" "char *cp" "u_int cnt"
3581abae7eeSRuslan Ermilov.Xc
3591abae7eeSRuslan Ermilov.Pp
360eae561b3SGarrett WollmanA filter primitive that translates between fixed size opaque
361eae561b3SGarrett Wollmandata
362eae561b3SGarrett Wollmanand its external representation.
3632efeeba5SRuslan ErmilovThe
3641abae7eeSRuslan Ermilov.Fa cp
3652efeeba5SRuslan Ermilovargument
366eae561b3SGarrett Wollmanis the address of the opaque object, and
3671abae7eeSRuslan Ermilov.Fa cnt
368eae561b3SGarrett Wollmanis its size in bytes.
369eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
3701abae7eeSRuslan Ermilov.Pp
3711abae7eeSRuslan Ermilov.It Xo
3721abae7eeSRuslan Ermilov.Ft int
3731abae7eeSRuslan Ermilov.Xc
3741abae7eeSRuslan Ermilov.It Xo
3751abae7eeSRuslan Ermilov.Fn xdr_pointer "XDR *xdrs" "char **objpp" "u_int objsize" "xdrproc_t xdrobj"
3761abae7eeSRuslan Ermilov.Xc
3771abae7eeSRuslan Ermilov.Pp
378eae561b3SGarrett WollmanLike
3791abae7eeSRuslan Ermilov.Fn xdr_reference
3801abae7eeSRuslan Ermilovexcept that it serializes
3811abae7eeSRuslan Ermilov.Dv NULL
382eae561b3SGarrett Wollmanpointers, whereas
3831abae7eeSRuslan Ermilov.Fn xdr_reference
3841abae7eeSRuslan Ermilovdoes not.
3851abae7eeSRuslan ErmilovThus,
3861abae7eeSRuslan Ermilov.Fn xdr_pointer
387eae561b3SGarrett Wollmancan represent
388eae561b3SGarrett Wollmanrecursive data structures, such as binary trees or
389eae561b3SGarrett Wollmanlinked lists.
3901abae7eeSRuslan Ermilov.Pp
3911abae7eeSRuslan Ermilov.It Xo
3921abae7eeSRuslan Ermilov.Ft void
3931abae7eeSRuslan Ermilov.Xc
3941abae7eeSRuslan Ermilov.It Xo
3951abae7eeSRuslan Ermilov.Fo xdrrec_create
3961abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
3971abae7eeSRuslan Ermilov.Fa "u_int sendsize"
3981abae7eeSRuslan Ermilov.Fa "u_int recvsize"
3997062693eSRuslan Ermilov.Fa "void *handle"
4001abae7eeSRuslan Ermilov.Fa "int \*(lp*readit\*(rp\*(lp\*(rp"
4011abae7eeSRuslan Ermilov.Fa "int \*(lp*writeit\*(rp\*(lp\*(rp"
4021abae7eeSRuslan Ermilov.Fc
4031abae7eeSRuslan Ermilov.Xc
4041abae7eeSRuslan Ermilov.Pp
405eae561b3SGarrett WollmanThis routine initializes the
4061abae7eeSRuslan Ermilov.Tn XDR
407eae561b3SGarrett Wollmanstream object pointed to by
4081abae7eeSRuslan Ermilov.Fa xdrs .
409eae561b3SGarrett WollmanThe stream's data is written to a buffer of size
4101abae7eeSRuslan Ermilov.Fa sendsize ;
411eae561b3SGarrett Wollmana value of zero indicates the system should use a suitable
412c6ff3a1bSSheldon Hearndefault.
413c6ff3a1bSSheldon HearnThe stream's data is read from a buffer of size
4141abae7eeSRuslan Ermilov.Fa recvsize ;
415eae561b3SGarrett Wollmanit too can be set to a suitable default by passing a zero
416eae561b3SGarrett Wollmanvalue.
417eae561b3SGarrett WollmanWhen a stream's output buffer is full,
4181abae7eeSRuslan Ermilov.Fn writeit
4191abae7eeSRuslan Ermilovis called.
4201abae7eeSRuslan ErmilovSimilarly, when a stream's input buffer is empty,
4211abae7eeSRuslan Ermilov.Fn readit
4221abae7eeSRuslan Ermilovis called.
4231abae7eeSRuslan ErmilovThe behavior of these two routines is similar to
424eae561b3SGarrett Wollmanthe
425eae561b3SGarrett Wollmansystem calls
4261abae7eeSRuslan Ermilov.Xr read 2
427eae561b3SGarrett Wollmanand
4281abae7eeSRuslan Ermilov.Xr write 2 ,
429eae561b3SGarrett Wollmanexcept that
4301abae7eeSRuslan Ermilov.Fa handle
4312efeeba5SRuslan Ermilovis passed to the former routines as the first argument.
432eae561b3SGarrett WollmanNote: the
4331abae7eeSRuslan Ermilov.Tn XDR
434eae561b3SGarrett Wollmanstream's
4351abae7eeSRuslan Ermilov.Fa op
436eae561b3SGarrett Wollmanfield must be set by the caller.
4371abae7eeSRuslan Ermilov.Pp
438eae561b3SGarrett WollmanWarning: this
4391abae7eeSRuslan Ermilov.Tn XDR
440eae561b3SGarrett Wollmanstream implements an intermediate record stream.
441eae561b3SGarrett WollmanTherefore there are additional bytes in the stream
442eae561b3SGarrett Wollmanto provide record boundary information.
4431abae7eeSRuslan Ermilov.Pp
4441abae7eeSRuslan Ermilov.It Xo
4451abae7eeSRuslan Ermilov.Ft int
4461abae7eeSRuslan Ermilov.Xc
4471abae7eeSRuslan Ermilov.It Xo
4481abae7eeSRuslan Ermilov.Fn xdrrec_endofrecord "XDR *xdrs" "int sendnow"
4491abae7eeSRuslan Ermilov.Xc
4501abae7eeSRuslan Ermilov.Pp
451eae561b3SGarrett WollmanThis routine can be invoked only on
452eae561b3SGarrett Wollmanstreams created by
4531abae7eeSRuslan Ermilov.Fn xdrrec_create .
454eae561b3SGarrett WollmanThe data in the output buffer is marked as a completed
455eae561b3SGarrett Wollmanrecord,
456eae561b3SGarrett Wollmanand the output buffer is optionally written out if
4571abae7eeSRuslan Ermilov.Fa sendnow
458c6ff3a1bSSheldon Hearnis non-zero.
459c6ff3a1bSSheldon HearnThis routine returns one if it succeeds, zero
460eae561b3SGarrett Wollmanotherwise.
4611abae7eeSRuslan Ermilov.Pp
4621abae7eeSRuslan Ermilov.It Xo
4631abae7eeSRuslan Ermilov.Ft int
4641abae7eeSRuslan Ermilov.Xc
4651abae7eeSRuslan Ermilov.It Xo
4661abae7eeSRuslan Ermilov.Fn xdrrec_eof "XDR *xdrs"
4671abae7eeSRuslan Ermilov.Xc
4681abae7eeSRuslan Ermilov.Pp
469eae561b3SGarrett WollmanThis routine can be invoked only on
470eae561b3SGarrett Wollmanstreams created by
4711abae7eeSRuslan Ermilov.Fn xdrrec_create .
472eae561b3SGarrett WollmanAfter consuming the rest of the current record in the stream,
473eae561b3SGarrett Wollmanthis routine returns one if the stream has no more input,
474eae561b3SGarrett Wollmanzero otherwise.
4751abae7eeSRuslan Ermilov.Pp
4761abae7eeSRuslan Ermilov.It Xo
4771abae7eeSRuslan Ermilov.Ft int
4781abae7eeSRuslan Ermilov.Xc
4791abae7eeSRuslan Ermilov.It Xo
4801abae7eeSRuslan Ermilov.Fn xdrrec_skiprecord "XDR *xdrs"
4811abae7eeSRuslan Ermilov.Xc
4821abae7eeSRuslan Ermilov.Pp
483eae561b3SGarrett WollmanThis routine can be invoked only on
484eae561b3SGarrett Wollmanstreams created by
4851abae7eeSRuslan Ermilov.Fn xdrrec_create .
486eae561b3SGarrett WollmanIt tells the
4871abae7eeSRuslan Ermilov.Tn XDR
488eae561b3SGarrett Wollmanimplementation that the rest of the current record
489eae561b3SGarrett Wollmanin the stream's input buffer should be discarded.
490eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
4911abae7eeSRuslan Ermilov.Pp
4921abae7eeSRuslan Ermilov.It Xo
4931abae7eeSRuslan Ermilov.Ft int
4941abae7eeSRuslan Ermilov.Xc
4951abae7eeSRuslan Ermilov.It Xo
4961abae7eeSRuslan Ermilov.Fn xdr_reference "XDR *xdrs" "char **pp" "u_int size" "xdrproc_t proc"
4971abae7eeSRuslan Ermilov.Xc
4981abae7eeSRuslan Ermilov.Pp
499eae561b3SGarrett WollmanA primitive that provides pointer chasing within structures.
5002efeeba5SRuslan ErmilovThe
5011abae7eeSRuslan Ermilov.Fa pp
5022efeeba5SRuslan Ermilovargument
503eae561b3SGarrett Wollmanis the address of the pointer;
5041abae7eeSRuslan Ermilov.Fa size
505eae561b3SGarrett Wollmanis the
5061abae7eeSRuslan Ermilov.Ic sizeof
507eae561b3SGarrett Wollmanthe structure that
5081abae7eeSRuslan Ermilov.Fa *pp
509eae561b3SGarrett Wollmanpoints to; and
5101abae7eeSRuslan Ermilov.Fa proc
511eae561b3SGarrett Wollmanis an
5121abae7eeSRuslan Ermilov.Tn XDR
513eae561b3SGarrett Wollmanprocedure that filters the structure
514eae561b3SGarrett Wollmanbetween its C form and its external representation.
515eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
5161abae7eeSRuslan Ermilov.Pp
517eae561b3SGarrett WollmanWarning: this routine does not understand
5181abae7eeSRuslan Ermilov.Dv NULL
519c6ff3a1bSSheldon Hearnpointers.
520c6ff3a1bSSheldon HearnUse
5211abae7eeSRuslan Ermilov.Fn xdr_pointer
522eae561b3SGarrett Wollmaninstead.
5231abae7eeSRuslan Ermilov.Pp
5241abae7eeSRuslan Ermilov.It Xo
5251abae7eeSRuslan Ermilov.Ft int
5261abae7eeSRuslan Ermilov.Xc
5271abae7eeSRuslan Ermilov.It Xo
5281abae7eeSRuslan Ermilov.Fn xdr_setpos "XDR *xdrs" "u_int pos"
5291abae7eeSRuslan Ermilov.Xc
5301abae7eeSRuslan Ermilov.Pp
531eae561b3SGarrett WollmanA macro that invokes the set position routine associated with
532eae561b3SGarrett Wollmanthe
5331abae7eeSRuslan Ermilov.Tn XDR
534eae561b3SGarrett Wollmanstream
5351abae7eeSRuslan Ermilov.Fa xdrs .
5362efeeba5SRuslan ErmilovThe
5371abae7eeSRuslan Ermilov.Fa pos
5382efeeba5SRuslan Ermilovargument
539eae561b3SGarrett Wollmanis a position value obtained from
5401abae7eeSRuslan Ermilov.Fn xdr_getpos .
541eae561b3SGarrett WollmanThis routine returns one if the
5421abae7eeSRuslan Ermilov.Tn XDR
543eae561b3SGarrett Wollmanstream could be repositioned,
544eae561b3SGarrett Wollmanand zero otherwise.
5451abae7eeSRuslan Ermilov.Pp
546eae561b3SGarrett WollmanWarning: it is difficult to reposition some types of
5471abae7eeSRuslan Ermilov.Tn XDR
548eae561b3SGarrett Wollmanstreams, so this routine may fail with one
549eae561b3SGarrett Wollmantype of stream and succeed with another.
5501abae7eeSRuslan Ermilov.Pp
5511abae7eeSRuslan Ermilov.It Xo
5521abae7eeSRuslan Ermilov.Ft int
5531abae7eeSRuslan Ermilov.Xc
5541abae7eeSRuslan Ermilov.It Xo
5551abae7eeSRuslan Ermilov.Fn xdr_short "XDR *xdrs" "short *sp"
5561abae7eeSRuslan Ermilov.Xc
5571abae7eeSRuslan Ermilov.Pp
558eae561b3SGarrett WollmanA filter primitive that translates between C
5591abae7eeSRuslan Ermilov.Vt short
560eae561b3SGarrett Wollmanintegers and their external representations.
561eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
5621abae7eeSRuslan Ermilov.Pp
563d98b6d6eSKevin Lo.It Xo
564d98b6d6eSKevin Lo.Ft unsigned long
565d98b6d6eSKevin Lo.Xc
566d98b6d6eSKevin Lo.It Xo
567d98b6d6eSKevin Lo.Fn xdr_sizeof "xdrproc_t func" "void *data"
568d98b6d6eSKevin Lo.Xc
569d98b6d6eSKevin Lo.Pp
570d98b6d6eSKevin LoThis routine returns the amount of memory required to encode
571d98b6d6eSKevin Lo.Fa data
572d98b6d6eSKevin Lousing filter
573d98b6d6eSKevin Lo.Fa func .
574d98b6d6eSKevin Lo.Pp
575c6e2c333SRuslan Ermilov.It Li "#ifdef _STDIO_H_"
576c6e2c333SRuslan Ermilov.It Li "/* XDR using stdio library */"
5771abae7eeSRuslan Ermilov.It Xo
5781abae7eeSRuslan Ermilov.Ft void
5791abae7eeSRuslan Ermilov.Xc
5801abae7eeSRuslan Ermilov.It Xo
5811abae7eeSRuslan Ermilov.Fn xdrstdio_create "XDR *xdrs" "FILE *file" "enum xdr_op op"
5821abae7eeSRuslan Ermilov.Xc
583c6e2c333SRuslan Ermilov.It Li "#endif"
5841abae7eeSRuslan Ermilov.Pp
585eae561b3SGarrett WollmanThis routine initializes the
5861abae7eeSRuslan Ermilov.Tn XDR
587eae561b3SGarrett Wollmanstream object pointed to by
5881abae7eeSRuslan Ermilov.Fa xdrs .
589eae561b3SGarrett WollmanThe
5901abae7eeSRuslan Ermilov.Tn XDR
591eae561b3SGarrett Wollmanstream data is written to, or read from, the Standard
5921abae7eeSRuslan Ermilov.Tn I/O
593eae561b3SGarrett Wollmanstream
5941abae7eeSRuslan Ermilov.Fa file .
5952efeeba5SRuslan ErmilovThe
5961abae7eeSRuslan Ermilov.Fa op
5972efeeba5SRuslan Ermilovargument
598eae561b3SGarrett Wollmandetermines the direction of the
5991abae7eeSRuslan Ermilov.Tn XDR
600eae561b3SGarrett Wollmanstream (either
6011abae7eeSRuslan Ermilov.Dv XDR_ENCODE ,
6021abae7eeSRuslan Ermilov.Dv XDR_DECODE ,
603eae561b3SGarrett Wollmanor
6041abae7eeSRuslan Ermilov.Dv XDR_FREE ) .
6051abae7eeSRuslan Ermilov.Pp
606eae561b3SGarrett WollmanWarning: the destroy routine associated with such
6071abae7eeSRuslan Ermilov.Tn XDR
608eae561b3SGarrett Wollmanstreams calls
6091abae7eeSRuslan Ermilov.Xr fflush 3
610eae561b3SGarrett Wollmanon the
6111abae7eeSRuslan Ermilov.Fa file
612eae561b3SGarrett Wollmanstream, but never
6131abae7eeSRuslan Ermilov.Xr fclose 3 .
6141abae7eeSRuslan Ermilov.Pp
6151abae7eeSRuslan Ermilov.It Xo
6161abae7eeSRuslan Ermilov.Ft int
6171abae7eeSRuslan Ermilov.Xc
6181abae7eeSRuslan Ermilov.It Xo
6191abae7eeSRuslan Ermilov.Fn xdr_string "XDR *xdrs" "char **sp" "u_int maxsize"
6201abae7eeSRuslan Ermilov.Xc
6211abae7eeSRuslan Ermilov.Pp
622eae561b3SGarrett WollmanA filter primitive that translates between C strings and
623eae561b3SGarrett Wollmantheir
624eae561b3SGarrett Wollmancorresponding external representations.
625eae561b3SGarrett WollmanStrings cannot be longer than
6261abae7eeSRuslan Ermilov.Fa maxsize .
627eae561b3SGarrett WollmanNote:
6281abae7eeSRuslan Ermilov.Fa sp
629eae561b3SGarrett Wollmanis the address of the string's pointer.
630eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6311abae7eeSRuslan Ermilov.Pp
6321abae7eeSRuslan Ermilov.It Xo
6331abae7eeSRuslan Ermilov.Ft int
6341abae7eeSRuslan Ermilov.Xc
6351abae7eeSRuslan Ermilov.It Xo
6361abae7eeSRuslan Ermilov.Fn xdr_u_char "XDR *xdrs" "unsigned char *ucp"
6371abae7eeSRuslan Ermilov.Xc
6381abae7eeSRuslan Ermilov.Pp
639eae561b3SGarrett WollmanA filter primitive that translates between
6401abae7eeSRuslan Ermilov.Vt unsigned
641eae561b3SGarrett WollmanC characters and their external representations.
642eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6431abae7eeSRuslan Ermilov.Pp
6441abae7eeSRuslan Ermilov.It Xo
6451abae7eeSRuslan Ermilov.Ft int
6461abae7eeSRuslan Ermilov.Xc
6471abae7eeSRuslan Ermilov.It Xo
6485843ec1dSBruce Evans.Fn xdr_u_hyper "XDR *xdrs" "u_quad_t *ullp"
6498360efbdSAlfred Perlstein.Xc
6508360efbdSAlfred PerlsteinA filter primitive that translates between
6518360efbdSAlfred Perlstein.Vt unsigned
6528360efbdSAlfred PerlsteinANSI C
6538360efbdSAlfred Perlstein.Vt long long
6548360efbdSAlfred Perlsteinintegers and their external representations.
6558360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
6568360efbdSAlfred Perlstein.Pp
6578360efbdSAlfred Perlstein.It Xo
6588360efbdSAlfred Perlstein.Ft int
6598360efbdSAlfred Perlstein.Xc
6608360efbdSAlfred Perlstein.It Xo
6611abae7eeSRuslan Ermilov.Fn xdr_u_int "XDR *xdrs" "unsigned *up"
6621abae7eeSRuslan Ermilov.Xc
6631abae7eeSRuslan Ermilov.Pp
664eae561b3SGarrett WollmanA filter primitive that translates between C
6651abae7eeSRuslan Ermilov.Vt unsigned
666eae561b3SGarrett Wollmanintegers and their external representations.
667eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6681abae7eeSRuslan Ermilov.Pp
6691abae7eeSRuslan Ermilov.It Xo
6701abae7eeSRuslan Ermilov.Ft int
6711abae7eeSRuslan Ermilov.Xc
6721abae7eeSRuslan Ermilov.It Xo
6731abae7eeSRuslan Ermilov.Fn xdr_u_long "XDR *xdrs" "unsigned long *ulp"
6741abae7eeSRuslan Ermilov.Xc
6751abae7eeSRuslan Ermilov.Pp
676eae561b3SGarrett WollmanA filter primitive that translates between C
6771abae7eeSRuslan Ermilov.Vt "unsigned long"
678eae561b3SGarrett Wollmanintegers and their external representations.
679eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
6801abae7eeSRuslan Ermilov.Pp
6811abae7eeSRuslan Ermilov.It Xo
6821abae7eeSRuslan Ermilov.Ft int
6831abae7eeSRuslan Ermilov.Xc
6841abae7eeSRuslan Ermilov.It Xo
6855843ec1dSBruce Evans.Fn xdr_u_longlong_t "XDR *xdrs" "u_quad_t *ullp"
6868360efbdSAlfred Perlstein.Xc
6878360efbdSAlfred PerlsteinA filter primitive that translates between
6888360efbdSAlfred Perlstein.Vt unsigned
6898360efbdSAlfred PerlsteinANSI C
6908360efbdSAlfred Perlstein.Vt "long long"
6918360efbdSAlfred Perlsteinintegers and their external representations.
6928360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise.
6938360efbdSAlfred Perlstein.Pp
6948360efbdSAlfred Perlstein.It Xo
6958360efbdSAlfred Perlstein.Ft int
6968360efbdSAlfred Perlstein.Xc
6978360efbdSAlfred Perlstein.It Xo
6981abae7eeSRuslan Ermilov.Fn xdr_u_short "XDR *xdrs" "unsigned short *usp"
6991abae7eeSRuslan Ermilov.Xc
7001abae7eeSRuslan Ermilov.Pp
701eae561b3SGarrett WollmanA filter primitive that translates between C
7021abae7eeSRuslan Ermilov.Vt "unsigned short"
703eae561b3SGarrett Wollmanintegers and their external representations.
704eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
7051abae7eeSRuslan Ermilov.Pp
7061abae7eeSRuslan Ermilov.It Xo
7071abae7eeSRuslan Ermilov.Ft int
7081abae7eeSRuslan Ermilov.Xc
7091abae7eeSRuslan Ermilov.It Xo
7101abae7eeSRuslan Ermilov.Fo xdr_union
7111abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
7125843ec1dSBruce Evans.Fa "enum_t *dscmp"
7131abae7eeSRuslan Ermilov.Fa "char *unp"
7145843ec1dSBruce Evans.Fa "const struct xdr_discrim *choices"
7155843ec1dSBruce Evans.Fa "xdrproc_t defaultarm"
7161abae7eeSRuslan Ermilov.Fc
7171abae7eeSRuslan Ermilov.Xc
7181abae7eeSRuslan Ermilov.Pp
719eae561b3SGarrett WollmanA filter primitive that translates between a discriminated C
7201abae7eeSRuslan Ermilov.Vt union
721c6ff3a1bSSheldon Hearnand its corresponding external representation.
722c6ff3a1bSSheldon HearnIt first
723eae561b3SGarrett Wollmantranslates the discriminant of the union located at
7241abae7eeSRuslan Ermilov.Fa dscmp .
725eae561b3SGarrett WollmanThis discriminant is always an
7261abae7eeSRuslan Ermilov.Vt enum_t .
727eae561b3SGarrett WollmanNext the union located at
7281abae7eeSRuslan Ermilov.Fa unp
7291abae7eeSRuslan Ermilovis translated.
7302efeeba5SRuslan ErmilovThe
7311abae7eeSRuslan Ermilov.Fa choices
7322efeeba5SRuslan Ermilovargument
733eae561b3SGarrett Wollmanis a pointer to an array of
7341abae7eeSRuslan Ermilov.Vt xdr_discrim
735c6ff3a1bSSheldon Hearnstructures.
736c6ff3a1bSSheldon HearnEach structure contains an ordered pair of
7371abae7eeSRuslan Ermilov.Bq Va value , proc .
738eae561b3SGarrett WollmanIf the union's discriminant is equal to the associated
7391abae7eeSRuslan Ermilov.Va value ,
740eae561b3SGarrett Wollmanthen the
7411abae7eeSRuslan Ermilov.Fn proc
7421abae7eeSRuslan Ermilovis called to translate the union.
7431abae7eeSRuslan ErmilovThe end of the
7441abae7eeSRuslan Ermilov.Vt xdr_discrim
745eae561b3SGarrett Wollmanstructure array is denoted by a routine of value
7461abae7eeSRuslan Ermilov.Dv NULL .
747eae561b3SGarrett WollmanIf the discriminant is not found in the
7481abae7eeSRuslan Ermilov.Fa choices
749eae561b3SGarrett Wollmanarray, then the
7501abae7eeSRuslan Ermilov.Fn defaultarm
751eae561b3SGarrett Wollmanprocedure is called (if it is not
7521abae7eeSRuslan Ermilov.Dv NULL ) .
753eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise.
7541abae7eeSRuslan Ermilov.Pp
7551abae7eeSRuslan Ermilov.It Xo
7561abae7eeSRuslan Ermilov.Ft int
7571abae7eeSRuslan Ermilov.Xc
7581abae7eeSRuslan Ermilov.It Xo
7591abae7eeSRuslan Ermilov.Fo xdr_vector
7601abae7eeSRuslan Ermilov.Fa "XDR *xdrs"
7611abae7eeSRuslan Ermilov.Fa "char *arrp"
7621abae7eeSRuslan Ermilov.Fa "u_int size"
7631abae7eeSRuslan Ermilov.Fa "u_int elsize"
7641abae7eeSRuslan Ermilov.Fa "xdrproc_t elproc"
7651abae7eeSRuslan Ermilov.Fc
7661abae7eeSRuslan Ermilov.Xc
7671abae7eeSRuslan Ermilov.Pp
768eae561b3SGarrett WollmanA filter primitive that translates between fixed-length
769eae561b3SGarrett Wollmanarrays
7701abae7eeSRuslan Ermilovand their corresponding external representations.
7711abae7eeSRuslan ErmilovThe
7721abae7eeSRuslan Ermilov.Fa arrp
7732efeeba5SRuslan Ermilovargument
774eae561b3SGarrett Wollmanis the address of the pointer to the array, while
7751abae7eeSRuslan Ermilov.Fa size
7761abae7eeSRuslan Ermilovis the element count of the array.
7772efeeba5SRuslan ErmilovThe
7781abae7eeSRuslan Ermilov.Fa elsize
7792efeeba5SRuslan Ermilovargument
780eae561b3SGarrett Wollmanis the
7811abae7eeSRuslan Ermilov.Ic sizeof
782eae561b3SGarrett Wollmaneach of the array's elements, and
7831abae7eeSRuslan Ermilov.Fa elproc
784eae561b3SGarrett Wollmanis an
7851abae7eeSRuslan Ermilov.Tn XDR
786eae561b3SGarrett Wollmanfilter that translates between
787eae561b3SGarrett Wollmanthe array elements' C form, and their external
788eae561b3SGarrett Wollmanrepresentation.
789eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise.
7901abae7eeSRuslan Ermilov.Pp
7911abae7eeSRuslan Ermilov.It Xo
7921abae7eeSRuslan Ermilov.Ft int
7931abae7eeSRuslan Ermilov.Xc
7941abae7eeSRuslan Ermilov.It Xo
7951abae7eeSRuslan Ermilov.Fn xdr_void void
7961abae7eeSRuslan Ermilov.Xc
7971abae7eeSRuslan Ermilov.Pp
798eae561b3SGarrett WollmanThis routine always returns one.
799eae561b3SGarrett WollmanIt may be passed to
8001abae7eeSRuslan Ermilov.Tn RPC
8012efeeba5SRuslan Ermilovroutines that require a function argument,
802eae561b3SGarrett Wollmanwhere nothing is to be done.
8031abae7eeSRuslan Ermilov.Pp
8041abae7eeSRuslan Ermilov.It Xo
8051abae7eeSRuslan Ermilov.Ft int
8061abae7eeSRuslan Ermilov.Xc
8071abae7eeSRuslan Ermilov.It Xo
8081abae7eeSRuslan Ermilov.Fn xdr_wrapstring "XDR *xdrs" "char **sp"
8091abae7eeSRuslan Ermilov.Xc
8101abae7eeSRuslan Ermilov.Pp
811eae561b3SGarrett WollmanA primitive that calls
8121abae7eeSRuslan Ermilov.Fn xdr_string xdrs sp MAXUN.UNSIGNED ;
813eae561b3SGarrett Wollmanwhere
8141abae7eeSRuslan Ermilov.Dv MAXUN.UNSIGNED
815eae561b3SGarrett Wollmanis the maximum value of an unsigned integer.
8161fae73b1SRuslan ErmilovThe
8171abae7eeSRuslan Ermilov.Fn xdr_wrapstring
8181fae73b1SRuslan Ermilovfunction
819eae561b3SGarrett Wollmanis handy because the
8201abae7eeSRuslan Ermilov.Tn RPC
821eae561b3SGarrett Wollmanpackage passes a maximum of two
8221abae7eeSRuslan Ermilov.Tn XDR
8232efeeba5SRuslan Ermilovroutines as arguments, and
8241abae7eeSRuslan Ermilov.Fn xdr_string ,
825eae561b3SGarrett Wollmanone of the most frequently used primitives, requires three.
826eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise.
8271abae7eeSRuslan Ermilov.El
8281abae7eeSRuslan Ermilov.Sh SEE ALSO
8291abae7eeSRuslan Ermilov.Xr rpc 3
8301abae7eeSRuslan Ermilov.Rs
8311abae7eeSRuslan Ermilov.%T "eXternal Data Representation Standard: Protocol Specification"
8321abae7eeSRuslan Ermilov.Re
8331abae7eeSRuslan Ermilov.Rs
8341abae7eeSRuslan Ermilov.%T "eXternal Data Representation: Sun Technical Notes"
8351abae7eeSRuslan Ermilov.Re
8361abae7eeSRuslan Ermilov.Rs
8371abae7eeSRuslan Ermilov.%T "XDR: External Data Representation Standard"
8381abae7eeSRuslan Ermilov.%O RFC1014
8391abae7eeSRuslan Ermilov.%Q "Sun Microsystems, Inc., USC\-ISI"
8401abae7eeSRuslan Ermilov.Re
841*5c6d2a01SKevin Lo.Sh HISTORY
842*5c6d2a01SKevin LoThe
843*5c6d2a01SKevin Lo.Nm xdr_sizeof
844*5c6d2a01SKevin Lofunction first appeared in
845*5c6d2a01SKevin Lo.Fx 9.0 .
846