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 5014e6355fSBruce Evans.Fd "#include <rpc/types.h>" 511abae7eeSRuslan Ermilov.Fd "#include <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 81eae561b3SGarrett Wollmanparameter 821abae7eeSRuslan Ermilov.Fa arrp 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 . 88eae561b3SGarrett WollmanThe parameter 891abae7eeSRuslan Ermilov.Fa elsize 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. 124eae561b3SGarrett WollmanThe parameter 1251abae7eeSRuslan Ermilov.Fa sp 126c6ff3a1bSSheldon Hearnis the address of the string pointer. 127c6ff3a1bSSheldon HearnThe length of the 128eae561b3SGarrett Wollmanstring is located at address 1291abae7eeSRuslan Ermilov.Fa sizep ; 130eae561b3SGarrett Wollmanstrings cannot be longer than 1311abae7eeSRuslan Ermilov.Fa maxsize . 132eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 1331abae7eeSRuslan Ermilov.Pp 1341abae7eeSRuslan Ermilov.It Xo 1351abae7eeSRuslan Ermilov.Ft int 1361abae7eeSRuslan Ermilov.Xc 1371abae7eeSRuslan Ermilov.It Xo 1381abae7eeSRuslan Ermilov.Fn xdr_char "XDR *xdrs" "char *cp" 1391abae7eeSRuslan Ermilov.Xc 1401abae7eeSRuslan Ermilov.Pp 141eae561b3SGarrett WollmanA filter primitive that translates between C characters 142eae561b3SGarrett Wollmanand their external representations. 143eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 144eae561b3SGarrett WollmanNote: encoded characters are not packed, and occupy 4 bytes 145c6ff3a1bSSheldon Hearneach. 146c6ff3a1bSSheldon HearnFor arrays of characters, it is worthwhile to 147eae561b3SGarrett Wollmanconsider 1481abae7eeSRuslan Ermilov.Fn xdr_bytes , 1491abae7eeSRuslan Ermilov.Fn xdr_opaque 150eae561b3SGarrett Wollmanor 1511abae7eeSRuslan Ermilov.Fn xdr_string . 1521abae7eeSRuslan Ermilov.Pp 1531abae7eeSRuslan Ermilov.It Xo 1541abae7eeSRuslan Ermilov.Ft void 1551abae7eeSRuslan Ermilov.Xc 1561abae7eeSRuslan Ermilov.It Xo 1571abae7eeSRuslan Ermilov.Fn xdr_destroy "XDR *xdrs" 1581abae7eeSRuslan Ermilov.Xc 1591abae7eeSRuslan Ermilov.Pp 160eae561b3SGarrett WollmanA macro that invokes the destroy routine associated with the 1611abae7eeSRuslan Ermilov.Tn XDR 162eae561b3SGarrett Wollmanstream, 1631abae7eeSRuslan Ermilov.Fa xdrs . 164eae561b3SGarrett WollmanDestruction usually involves freeing private data structures 1651abae7eeSRuslan Ermilovassociated with the stream. 1661abae7eeSRuslan ErmilovUsing 1671abae7eeSRuslan Ermilov.Fa xdrs 168eae561b3SGarrett Wollmanafter invoking 1691abae7eeSRuslan Ermilov.Fn xdr_destroy 170eae561b3SGarrett Wollmanis undefined. 1711abae7eeSRuslan Ermilov.Pp 1721abae7eeSRuslan Ermilov.It Xo 1731abae7eeSRuslan Ermilov.Ft int 1741abae7eeSRuslan Ermilov.Xc 1751abae7eeSRuslan Ermilov.It Xo 1761abae7eeSRuslan Ermilov.Fn xdr_double "XDR *xdrs" "double *dp" 1771abae7eeSRuslan Ermilov.Xc 1781abae7eeSRuslan Ermilov.Pp 179eae561b3SGarrett WollmanA filter primitive that translates between C 1801abae7eeSRuslan Ermilov.Vt double 181eae561b3SGarrett Wollmanprecision numbers and their external representations. 182eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 1831abae7eeSRuslan Ermilov.Pp 1841abae7eeSRuslan Ermilov.It Xo 1851abae7eeSRuslan Ermilov.Ft int 1861abae7eeSRuslan Ermilov.Xc 1871abae7eeSRuslan Ermilov.It Xo 1881abae7eeSRuslan Ermilov.Fn xdr_enum "XDR *xdrs" "enum_t *ep" 1891abae7eeSRuslan Ermilov.Xc 1901abae7eeSRuslan Ermilov.Pp 191eae561b3SGarrett WollmanA filter primitive that translates between C 1921abae7eeSRuslan Ermilov.Vt enum Ns s 193eae561b3SGarrett Wollman(actually integers) and their external representations. 194eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 1951abae7eeSRuslan Ermilov.Pp 1961abae7eeSRuslan Ermilov.It Xo 1971abae7eeSRuslan Ermilov.Ft int 1981abae7eeSRuslan Ermilov.Xc 1991abae7eeSRuslan Ermilov.It Xo 2001abae7eeSRuslan Ermilov.Fn xdr_float "XDR *xdrs" "float *fp" 2011abae7eeSRuslan Ermilov.Xc 2021abae7eeSRuslan Ermilov.Pp 203eae561b3SGarrett WollmanA filter primitive that translates between C 2041abae7eeSRuslan Ermilov.Vt float Ns s 205eae561b3SGarrett Wollmanand their external representations. 206eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 2071abae7eeSRuslan Ermilov.Pp 2081abae7eeSRuslan Ermilov.It Xo 2091abae7eeSRuslan Ermilov.Ft void 2101abae7eeSRuslan Ermilov.Xc 2111abae7eeSRuslan Ermilov.It Xo 2121abae7eeSRuslan Ermilov.Fn xdr_free "xdrproc_t proc" "char *objp" 2131abae7eeSRuslan Ermilov.Xc 2141abae7eeSRuslan Ermilov.Pp 215c6ff3a1bSSheldon HearnGeneric freeing routine. 216c6ff3a1bSSheldon HearnThe first argument is the 2171abae7eeSRuslan Ermilov.Tn XDR 218c6ff3a1bSSheldon Hearnroutine for the object being freed. 219c6ff3a1bSSheldon HearnThe second argument 220c6ff3a1bSSheldon Hearnis a pointer to the object itself. 221c6ff3a1bSSheldon HearnNote: the pointer passed 222eae561b3SGarrett Wollmanto this routine is 2231abae7eeSRuslan Ermilov.Em not 224eae561b3SGarrett Wollmanfreed, but what it points to 2251abae7eeSRuslan Ermilov.Em is 226eae561b3SGarrett Wollmanfreed (recursively). 2271abae7eeSRuslan Ermilov.Pp 2281abae7eeSRuslan Ermilov.It Xo 2291abae7eeSRuslan Ermilov.Ft u_int 2301abae7eeSRuslan Ermilov.Xc 2311abae7eeSRuslan Ermilov.It Xo 2321abae7eeSRuslan Ermilov.Fn xdr_getpos "XDR *xdrs" 2331abae7eeSRuslan Ermilov.Xc 2341abae7eeSRuslan Ermilov.Pp 2351abae7eeSRuslan ErmilovA macro that invokes the get\-position routine 236eae561b3SGarrett Wollmanassociated with the 2371abae7eeSRuslan Ermilov.Tn XDR 238eae561b3SGarrett Wollmanstream, 2391abae7eeSRuslan Ermilov.Fa xdrs . 240eae561b3SGarrett WollmanThe routine returns an unsigned integer, 241eae561b3SGarrett Wollmanwhich indicates the position of the 2421abae7eeSRuslan Ermilov.Tn XDR 243eae561b3SGarrett Wollmanbyte stream. 244eae561b3SGarrett WollmanA desirable feature of 2451abae7eeSRuslan Ermilov.Tn XDR 246eae561b3SGarrett Wollmanstreams is that simple arithmetic works with this number, 247eae561b3SGarrett Wollmanalthough the 2481abae7eeSRuslan Ermilov.Tn XDR 249eae561b3SGarrett Wollmanstream instances need not guarantee this. 2501abae7eeSRuslan Ermilov.Pp 2511abae7eeSRuslan Ermilov.It Xo 2528360efbdSAlfred Perlstein.Ft int 2538360efbdSAlfred Perlstein.Xc 2548360efbdSAlfred Perlstein.It Xo 2558360efbdSAlfred Perlstein.Fn xdr_hyper "XDR *xdrs" "longlong_t *llp" 2568360efbdSAlfred Perlstein.Xc 2578360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C 2588360efbdSAlfred Perlstein.Vt "long long" 2598360efbdSAlfred Perlsteinintegers and their external representations. 2608360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise. 2618360efbdSAlfred Perlstein.Pp 2628360efbdSAlfred Perlstein.It Xo 2631abae7eeSRuslan Ermilov.Ft "long *" 2641abae7eeSRuslan Ermilov.Xc 2651abae7eeSRuslan Ermilov.It Xo 2661abae7eeSRuslan Ermilov.Fn xdr_inline "XDR *xdrs" "int len" 2671abae7eeSRuslan Ermilov.Xc 2681abae7eeSRuslan Ermilov.Pp 269eae561b3SGarrett WollmanA macro that invokes the in-line routine associated with the 2701abae7eeSRuslan Ermilov.Tn XDR 271eae561b3SGarrett Wollmanstream, 2721abae7eeSRuslan Ermilov.Fa xdrs . 273eae561b3SGarrett WollmanThe routine returns a pointer 274eae561b3SGarrett Wollmanto a contiguous piece of the stream's buffer; 2751abae7eeSRuslan Ermilov.Fa len 276eae561b3SGarrett Wollmanis the byte length of the desired buffer. 277eae561b3SGarrett WollmanNote: pointer is cast to 2781abae7eeSRuslan Ermilov.Vt "long *" . 2791abae7eeSRuslan Ermilov.Pp 280eae561b3SGarrett WollmanWarning: 2811abae7eeSRuslan Ermilov.Fn xdr_inline 282eae561b3SGarrett Wollmanmay return 2831abae7eeSRuslan Ermilov.Dv NULL 284eae561b3SGarrett Wollman(0) 285eae561b3SGarrett Wollmanif it cannot allocate a contiguous piece of a buffer. 286eae561b3SGarrett WollmanTherefore the behavior may vary among stream instances; 287eae561b3SGarrett Wollmanit exists for the sake of efficiency. 2881abae7eeSRuslan Ermilov.Pp 2891abae7eeSRuslan Ermilov.It Xo 2901abae7eeSRuslan Ermilov.Ft int 2911abae7eeSRuslan Ermilov.Xc 2921abae7eeSRuslan Ermilov.It Xo 2931abae7eeSRuslan Ermilov.Fn xdr_int "XDR *xdrs" "int *ip" 2941abae7eeSRuslan Ermilov.Xc 2951abae7eeSRuslan Ermilov.Pp 296eae561b3SGarrett WollmanA filter primitive that translates between C integers 297eae561b3SGarrett Wollmanand their external representations. 298eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 2991abae7eeSRuslan Ermilov.Pp 3001abae7eeSRuslan Ermilov.It Xo 3011abae7eeSRuslan Ermilov.Ft int 3021abae7eeSRuslan Ermilov.Xc 3031abae7eeSRuslan Ermilov.It Xo 3041abae7eeSRuslan Ermilov.Fn xdr_long "XDR *xdrs" "long *lp" 3051abae7eeSRuslan Ermilov.Xc 3061abae7eeSRuslan Ermilov.Pp 307eae561b3SGarrett WollmanA filter primitive that translates between C 3081abae7eeSRuslan Ermilov.Vt long 309eae561b3SGarrett Wollmanintegers and their external representations. 310eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 3111abae7eeSRuslan Ermilov.Pp 3121abae7eeSRuslan Ermilov.It Xo 3138360efbdSAlfred Perlstein.Ft int 3148360efbdSAlfred Perlstein.Xc 3158360efbdSAlfred Perlstein.It Xo 3168360efbdSAlfred Perlstein.Fn xdr_longlong_t "XDR *xdrs" "longlong_t *llp" 3178360efbdSAlfred Perlstein.Xc 3188360efbdSAlfred PerlsteinA filter primitive that translates between ANSI C 3198360efbdSAlfred Perlstein.Vt "long long" 3208360efbdSAlfred Perlsteinintegers and their external representations. 3218360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise. 3228360efbdSAlfred Perlstein.Pp 3238360efbdSAlfred Perlstein.It Xo 3241abae7eeSRuslan Ermilov.Ft void 3251abae7eeSRuslan Ermilov.Xc 3261abae7eeSRuslan Ermilov.It Xo 3271abae7eeSRuslan Ermilov.Fn xdrmem_create "XDR *xdrs" "char *addr" "u_int size" "enum xdr_op op" 3281abae7eeSRuslan Ermilov.Xc 3291abae7eeSRuslan Ermilov.Pp 330eae561b3SGarrett WollmanThis routine initializes the 3311abae7eeSRuslan Ermilov.Tn XDR 332eae561b3SGarrett Wollmanstream object pointed to by 3331abae7eeSRuslan Ermilov.Fa xdrs . 334eae561b3SGarrett WollmanThe stream's data is written to, or read from, 335eae561b3SGarrett Wollmana chunk of memory at location 3361abae7eeSRuslan Ermilov.Fa addr 337eae561b3SGarrett Wollmanwhose length is no more than 3381abae7eeSRuslan Ermilov.Fa size 3391abae7eeSRuslan Ermilovbytes long. 3401abae7eeSRuslan ErmilovThe 3411abae7eeSRuslan Ermilov.Fa op 342eae561b3SGarrett Wollmandetermines the direction of the 3431abae7eeSRuslan Ermilov.Tn XDR 344eae561b3SGarrett Wollmanstream 345eae561b3SGarrett Wollman(either 3461abae7eeSRuslan Ermilov.Dv XDR_ENCODE , 3471abae7eeSRuslan Ermilov.Dv XDR_DECODE , 348eae561b3SGarrett Wollmanor 3491abae7eeSRuslan Ermilov.Dv XDR_FREE ) . 3501abae7eeSRuslan Ermilov.Pp 3511abae7eeSRuslan Ermilov.It Xo 3521abae7eeSRuslan Ermilov.Ft int 3531abae7eeSRuslan Ermilov.Xc 3541abae7eeSRuslan Ermilov.It Xo 3551abae7eeSRuslan Ermilov.Fn xdr_opaque "XDR *xdrs" "char *cp" "u_int cnt" 3561abae7eeSRuslan Ermilov.Xc 3571abae7eeSRuslan Ermilov.Pp 358eae561b3SGarrett WollmanA filter primitive that translates between fixed size opaque 359eae561b3SGarrett Wollmandata 360eae561b3SGarrett Wollmanand its external representation. 361eae561b3SGarrett WollmanThe parameter 3621abae7eeSRuslan Ermilov.Fa cp 363eae561b3SGarrett Wollmanis the address of the opaque object, and 3641abae7eeSRuslan Ermilov.Fa cnt 365eae561b3SGarrett Wollmanis its size in bytes. 366eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 3671abae7eeSRuslan Ermilov.Pp 3681abae7eeSRuslan Ermilov.It Xo 3691abae7eeSRuslan Ermilov.Ft int 3701abae7eeSRuslan Ermilov.Xc 3711abae7eeSRuslan Ermilov.It Xo 3721abae7eeSRuslan Ermilov.Fn xdr_pointer "XDR *xdrs" "char **objpp" "u_int objsize" "xdrproc_t xdrobj" 3731abae7eeSRuslan Ermilov.Xc 3741abae7eeSRuslan Ermilov.Pp 375eae561b3SGarrett WollmanLike 3761abae7eeSRuslan Ermilov.Fn xdr_reference 3771abae7eeSRuslan Ermilovexcept that it serializes 3781abae7eeSRuslan Ermilov.Dv NULL 379eae561b3SGarrett Wollmanpointers, whereas 3801abae7eeSRuslan Ermilov.Fn xdr_reference 3811abae7eeSRuslan Ermilovdoes not. 3821abae7eeSRuslan ErmilovThus, 3831abae7eeSRuslan Ermilov.Fn xdr_pointer 384eae561b3SGarrett Wollmancan represent 385eae561b3SGarrett Wollmanrecursive data structures, such as binary trees or 386eae561b3SGarrett Wollmanlinked lists. 3871abae7eeSRuslan Ermilov.Pp 3881abae7eeSRuslan Ermilov.It Xo 3891abae7eeSRuslan Ermilov.Ft void 3901abae7eeSRuslan Ermilov.Xc 3911abae7eeSRuslan Ermilov.It Xo 3921abae7eeSRuslan Ermilov.Fo xdrrec_create 3931abae7eeSRuslan Ermilov.Fa "XDR *xdrs" 3941abae7eeSRuslan Ermilov.Fa "u_int sendsize" 3951abae7eeSRuslan Ermilov.Fa "u_int recvsize" 3961abae7eeSRuslan Ermilov.Fa "char *handle" 3971abae7eeSRuslan Ermilov.Fa "int \*(lp*readit\*(rp\*(lp\*(rp" 3981abae7eeSRuslan Ermilov.Fa "int \*(lp*writeit\*(rp\*(lp\*(rp" 3991abae7eeSRuslan Ermilov.Fc 4001abae7eeSRuslan Ermilov.Xc 4011abae7eeSRuslan Ermilov.Pp 402eae561b3SGarrett WollmanThis routine initializes the 4031abae7eeSRuslan Ermilov.Tn XDR 404eae561b3SGarrett Wollmanstream object pointed to by 4051abae7eeSRuslan Ermilov.Fa xdrs . 406eae561b3SGarrett WollmanThe stream's data is written to a buffer of size 4071abae7eeSRuslan Ermilov.Fa sendsize ; 408eae561b3SGarrett Wollmana value of zero indicates the system should use a suitable 409c6ff3a1bSSheldon Hearndefault. 410c6ff3a1bSSheldon HearnThe stream's data is read from a buffer of size 4111abae7eeSRuslan Ermilov.Fa recvsize ; 412eae561b3SGarrett Wollmanit too can be set to a suitable default by passing a zero 413eae561b3SGarrett Wollmanvalue. 414eae561b3SGarrett WollmanWhen a stream's output buffer is full, 4151abae7eeSRuslan Ermilov.Fn writeit 4161abae7eeSRuslan Ermilovis called. 4171abae7eeSRuslan ErmilovSimilarly, when a stream's input buffer is empty, 4181abae7eeSRuslan Ermilov.Fn readit 4191abae7eeSRuslan Ermilovis called. 4201abae7eeSRuslan ErmilovThe behavior of these two routines is similar to 421eae561b3SGarrett Wollmanthe 422eae561b3SGarrett Wollmansystem calls 4231abae7eeSRuslan Ermilov.Xr read 2 424eae561b3SGarrett Wollmanand 4251abae7eeSRuslan Ermilov.Xr write 2 , 426eae561b3SGarrett Wollmanexcept that 4271abae7eeSRuslan Ermilov.Fa handle 428eae561b3SGarrett Wollmanis passed to the former routines as the first parameter. 429eae561b3SGarrett WollmanNote: the 4301abae7eeSRuslan Ermilov.Tn XDR 431eae561b3SGarrett Wollmanstream's 4321abae7eeSRuslan Ermilov.Fa op 433eae561b3SGarrett Wollmanfield must be set by the caller. 4341abae7eeSRuslan Ermilov.Pp 435eae561b3SGarrett WollmanWarning: this 4361abae7eeSRuslan Ermilov.Tn XDR 437eae561b3SGarrett Wollmanstream implements an intermediate record stream. 438eae561b3SGarrett WollmanTherefore there are additional bytes in the stream 439eae561b3SGarrett Wollmanto provide record boundary information. 4401abae7eeSRuslan Ermilov.Pp 4411abae7eeSRuslan Ermilov.It Xo 4421abae7eeSRuslan Ermilov.Ft int 4431abae7eeSRuslan Ermilov.Xc 4441abae7eeSRuslan Ermilov.It Xo 4451abae7eeSRuslan Ermilov.Fn xdrrec_endofrecord "XDR *xdrs" "int sendnow" 4461abae7eeSRuslan Ermilov.Xc 4471abae7eeSRuslan Ermilov.Pp 448eae561b3SGarrett WollmanThis routine can be invoked only on 449eae561b3SGarrett Wollmanstreams created by 4501abae7eeSRuslan Ermilov.Fn xdrrec_create . 451eae561b3SGarrett WollmanThe data in the output buffer is marked as a completed 452eae561b3SGarrett Wollmanrecord, 453eae561b3SGarrett Wollmanand the output buffer is optionally written out if 4541abae7eeSRuslan Ermilov.Fa sendnow 455c6ff3a1bSSheldon Hearnis non-zero. 456c6ff3a1bSSheldon HearnThis routine returns one if it succeeds, zero 457eae561b3SGarrett Wollmanotherwise. 4581abae7eeSRuslan Ermilov.Pp 4591abae7eeSRuslan Ermilov.It Xo 4601abae7eeSRuslan Ermilov.Ft int 4611abae7eeSRuslan Ermilov.Xc 4621abae7eeSRuslan Ermilov.It Xo 4631abae7eeSRuslan Ermilov.Fn xdrrec_eof "XDR *xdrs" 4641abae7eeSRuslan Ermilov.Xc 4651abae7eeSRuslan Ermilov.Pp 466eae561b3SGarrett WollmanThis routine can be invoked only on 467eae561b3SGarrett Wollmanstreams created by 4681abae7eeSRuslan Ermilov.Fn xdrrec_create . 469eae561b3SGarrett WollmanAfter consuming the rest of the current record in the stream, 470eae561b3SGarrett Wollmanthis routine returns one if the stream has no more input, 471eae561b3SGarrett Wollmanzero otherwise. 4721abae7eeSRuslan Ermilov.Pp 4731abae7eeSRuslan Ermilov.It Xo 4741abae7eeSRuslan Ermilov.Ft int 4751abae7eeSRuslan Ermilov.Xc 4761abae7eeSRuslan Ermilov.It Xo 4771abae7eeSRuslan Ermilov.Fn xdrrec_skiprecord "XDR *xdrs" 4781abae7eeSRuslan Ermilov.Xc 4791abae7eeSRuslan Ermilov.Pp 480eae561b3SGarrett WollmanThis routine can be invoked only on 481eae561b3SGarrett Wollmanstreams created by 4821abae7eeSRuslan Ermilov.Fn xdrrec_create . 483eae561b3SGarrett WollmanIt tells the 4841abae7eeSRuslan Ermilov.Tn XDR 485eae561b3SGarrett Wollmanimplementation that the rest of the current record 486eae561b3SGarrett Wollmanin the stream's input buffer should be discarded. 487eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 4881abae7eeSRuslan Ermilov.Pp 4891abae7eeSRuslan Ermilov.It Xo 4901abae7eeSRuslan Ermilov.Ft int 4911abae7eeSRuslan Ermilov.Xc 4921abae7eeSRuslan Ermilov.It Xo 4931abae7eeSRuslan Ermilov.Fn xdr_reference "XDR *xdrs" "char **pp" "u_int size" "xdrproc_t proc" 4941abae7eeSRuslan Ermilov.Xc 4951abae7eeSRuslan Ermilov.Pp 496eae561b3SGarrett WollmanA primitive that provides pointer chasing within structures. 497eae561b3SGarrett WollmanThe parameter 4981abae7eeSRuslan Ermilov.Fa pp 499eae561b3SGarrett Wollmanis the address of the pointer; 5001abae7eeSRuslan Ermilov.Fa size 501eae561b3SGarrett Wollmanis the 5021abae7eeSRuslan Ermilov.Ic sizeof 503eae561b3SGarrett Wollmanthe structure that 5041abae7eeSRuslan Ermilov.Fa *pp 505eae561b3SGarrett Wollmanpoints to; and 5061abae7eeSRuslan Ermilov.Fa proc 507eae561b3SGarrett Wollmanis an 5081abae7eeSRuslan Ermilov.Tn XDR 509eae561b3SGarrett Wollmanprocedure that filters the structure 510eae561b3SGarrett Wollmanbetween its C form and its external representation. 511eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 5121abae7eeSRuslan Ermilov.Pp 513eae561b3SGarrett WollmanWarning: this routine does not understand 5141abae7eeSRuslan Ermilov.Dv NULL 515c6ff3a1bSSheldon Hearnpointers. 516c6ff3a1bSSheldon HearnUse 5171abae7eeSRuslan Ermilov.Fn xdr_pointer 518eae561b3SGarrett Wollmaninstead. 5191abae7eeSRuslan Ermilov.Pp 5201abae7eeSRuslan Ermilov.It Xo 5211abae7eeSRuslan Ermilov.Ft int 5221abae7eeSRuslan Ermilov.Xc 5231abae7eeSRuslan Ermilov.It Xo 5241abae7eeSRuslan Ermilov.Fn xdr_setpos "XDR *xdrs" "u_int pos" 5251abae7eeSRuslan Ermilov.Xc 5261abae7eeSRuslan Ermilov.Pp 527eae561b3SGarrett WollmanA macro that invokes the set position routine associated with 528eae561b3SGarrett Wollmanthe 5291abae7eeSRuslan Ermilov.Tn XDR 530eae561b3SGarrett Wollmanstream 5311abae7eeSRuslan Ermilov.Fa xdrs . 532eae561b3SGarrett WollmanThe parameter 5331abae7eeSRuslan Ermilov.Fa pos 534eae561b3SGarrett Wollmanis a position value obtained from 5351abae7eeSRuslan Ermilov.Fn xdr_getpos . 536eae561b3SGarrett WollmanThis routine returns one if the 5371abae7eeSRuslan Ermilov.Tn XDR 538eae561b3SGarrett Wollmanstream could be repositioned, 539eae561b3SGarrett Wollmanand zero otherwise. 5401abae7eeSRuslan Ermilov.Pp 541eae561b3SGarrett WollmanWarning: it is difficult to reposition some types of 5421abae7eeSRuslan Ermilov.Tn XDR 543eae561b3SGarrett Wollmanstreams, so this routine may fail with one 544eae561b3SGarrett Wollmantype of stream and succeed with another. 5451abae7eeSRuslan Ermilov.Pp 5461abae7eeSRuslan Ermilov.It Xo 5471abae7eeSRuslan Ermilov.Ft int 5481abae7eeSRuslan Ermilov.Xc 5491abae7eeSRuslan Ermilov.It Xo 5501abae7eeSRuslan Ermilov.Fn xdr_short "XDR *xdrs" "short *sp" 5511abae7eeSRuslan Ermilov.Xc 5521abae7eeSRuslan Ermilov.Pp 553eae561b3SGarrett WollmanA filter primitive that translates between C 5541abae7eeSRuslan Ermilov.Vt short 555eae561b3SGarrett Wollmanintegers and their external representations. 556eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 5571abae7eeSRuslan Ermilov.Pp 558c6e2c333SRuslan Ermilov.It Li "#ifdef _STDIO_H_" 559c6e2c333SRuslan Ermilov.It Li "/* XDR using stdio library */" 5601abae7eeSRuslan Ermilov.It Xo 5611abae7eeSRuslan Ermilov.Ft void 5621abae7eeSRuslan Ermilov.Xc 5631abae7eeSRuslan Ermilov.It Xo 5641abae7eeSRuslan Ermilov.Fn xdrstdio_create "XDR *xdrs" "FILE *file" "enum xdr_op op" 5651abae7eeSRuslan Ermilov.Xc 566c6e2c333SRuslan Ermilov.It Li "#endif" 5671abae7eeSRuslan Ermilov.Pp 568eae561b3SGarrett WollmanThis routine initializes the 5691abae7eeSRuslan Ermilov.Tn XDR 570eae561b3SGarrett Wollmanstream object pointed to by 5711abae7eeSRuslan Ermilov.Fa xdrs . 572eae561b3SGarrett WollmanThe 5731abae7eeSRuslan Ermilov.Tn XDR 574eae561b3SGarrett Wollmanstream data is written to, or read from, the Standard 5751abae7eeSRuslan Ermilov.Tn I/O 576eae561b3SGarrett Wollmanstream 5771abae7eeSRuslan Ermilov.Fa file . 578eae561b3SGarrett WollmanThe parameter 5791abae7eeSRuslan Ermilov.Fa op 580eae561b3SGarrett Wollmandetermines the direction of the 5811abae7eeSRuslan Ermilov.Tn XDR 582eae561b3SGarrett Wollmanstream (either 5831abae7eeSRuslan Ermilov.Dv XDR_ENCODE , 5841abae7eeSRuslan Ermilov.Dv XDR_DECODE , 585eae561b3SGarrett Wollmanor 5861abae7eeSRuslan Ermilov.Dv XDR_FREE ) . 5871abae7eeSRuslan Ermilov.Pp 588eae561b3SGarrett WollmanWarning: the destroy routine associated with such 5891abae7eeSRuslan Ermilov.Tn XDR 590eae561b3SGarrett Wollmanstreams calls 5911abae7eeSRuslan Ermilov.Xr fflush 3 592eae561b3SGarrett Wollmanon the 5931abae7eeSRuslan Ermilov.Fa file 594eae561b3SGarrett Wollmanstream, but never 5951abae7eeSRuslan Ermilov.Xr fclose 3 . 5961abae7eeSRuslan Ermilov.Pp 5971abae7eeSRuslan Ermilov.It Xo 5981abae7eeSRuslan Ermilov.Ft int 5991abae7eeSRuslan Ermilov.Xc 6001abae7eeSRuslan Ermilov.It Xo 6011abae7eeSRuslan Ermilov.Fn xdr_string "XDR *xdrs" "char **sp" "u_int maxsize" 6021abae7eeSRuslan Ermilov.Xc 6031abae7eeSRuslan Ermilov.Pp 604eae561b3SGarrett WollmanA filter primitive that translates between C strings and 605eae561b3SGarrett Wollmantheir 606eae561b3SGarrett Wollmancorresponding external representations. 607eae561b3SGarrett WollmanStrings cannot be longer than 6081abae7eeSRuslan Ermilov.Fa maxsize . 609eae561b3SGarrett WollmanNote: 6101abae7eeSRuslan Ermilov.Fa sp 611eae561b3SGarrett Wollmanis the address of the string's pointer. 612eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 6131abae7eeSRuslan Ermilov.Pp 6141abae7eeSRuslan Ermilov.It Xo 6151abae7eeSRuslan Ermilov.Ft int 6161abae7eeSRuslan Ermilov.Xc 6171abae7eeSRuslan Ermilov.It Xo 6181abae7eeSRuslan Ermilov.Fn xdr_u_char "XDR *xdrs" "unsigned char *ucp" 6191abae7eeSRuslan Ermilov.Xc 6201abae7eeSRuslan Ermilov.Pp 621eae561b3SGarrett WollmanA filter primitive that translates between 6221abae7eeSRuslan Ermilov.Vt unsigned 623eae561b3SGarrett WollmanC characters and their external representations. 624eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 6251abae7eeSRuslan Ermilov.Pp 6261abae7eeSRuslan Ermilov.It Xo 6271abae7eeSRuslan Ermilov.Ft int 6281abae7eeSRuslan Ermilov.Xc 6291abae7eeSRuslan Ermilov.It Xo 6308360efbdSAlfred Perlstein.Fn xdr_u_hyper "XDR *xdrs" "u_longlong_t *ullp" 6318360efbdSAlfred Perlstein.Xc 6328360efbdSAlfred PerlsteinA filter primitive that translates between 6338360efbdSAlfred Perlstein.Vt unsigned 6348360efbdSAlfred PerlsteinANSI C 6358360efbdSAlfred Perlstein.Vt long long 6368360efbdSAlfred Perlsteinintegers and their external representations. 6378360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise. 6388360efbdSAlfred Perlstein.Pp 6398360efbdSAlfred Perlstein.It Xo 6408360efbdSAlfred Perlstein.Ft int 6418360efbdSAlfred Perlstein.Xc 6428360efbdSAlfred Perlstein.It Xo 6431abae7eeSRuslan Ermilov.Fn xdr_u_int "XDR *xdrs" "unsigned *up" 6441abae7eeSRuslan Ermilov.Xc 6451abae7eeSRuslan Ermilov.Pp 646eae561b3SGarrett WollmanA filter primitive that translates between C 6471abae7eeSRuslan Ermilov.Vt unsigned 648eae561b3SGarrett Wollmanintegers and their external representations. 649eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 6501abae7eeSRuslan Ermilov.Pp 6511abae7eeSRuslan Ermilov.It Xo 6521abae7eeSRuslan Ermilov.Ft int 6531abae7eeSRuslan Ermilov.Xc 6541abae7eeSRuslan Ermilov.It Xo 6551abae7eeSRuslan Ermilov.Fn xdr_u_long "XDR *xdrs" "unsigned long *ulp" 6561abae7eeSRuslan Ermilov.Xc 6571abae7eeSRuslan Ermilov.Pp 658eae561b3SGarrett WollmanA filter primitive that translates between C 6591abae7eeSRuslan Ermilov.Vt "unsigned long" 660eae561b3SGarrett Wollmanintegers and their external representations. 661eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 6621abae7eeSRuslan Ermilov.Pp 6631abae7eeSRuslan Ermilov.It Xo 6641abae7eeSRuslan Ermilov.Ft int 6651abae7eeSRuslan Ermilov.Xc 6661abae7eeSRuslan Ermilov.It Xo 6678360efbdSAlfred Perlstein.Fn xdr_u_longlong_t "XDR *xdrs" "u_longlong_t *ullp" 6688360efbdSAlfred Perlstein.Xc 6698360efbdSAlfred PerlsteinA filter primitive that translates between 6708360efbdSAlfred Perlstein.Vt unsigned 6718360efbdSAlfred PerlsteinANSI C 6728360efbdSAlfred Perlstein.Vt "long long" 6738360efbdSAlfred Perlsteinintegers and their external representations. 6748360efbdSAlfred PerlsteinThis routine returns one if it succeeds, zero otherwise. 6758360efbdSAlfred Perlstein.Pp 6768360efbdSAlfred Perlstein.It Xo 6778360efbdSAlfred Perlstein.Ft int 6788360efbdSAlfred Perlstein.Xc 6798360efbdSAlfred Perlstein.It Xo 6801abae7eeSRuslan Ermilov.Fn xdr_u_short "XDR *xdrs" "unsigned short *usp" 6811abae7eeSRuslan Ermilov.Xc 6821abae7eeSRuslan Ermilov.Pp 683eae561b3SGarrett WollmanA filter primitive that translates between C 6841abae7eeSRuslan Ermilov.Vt "unsigned short" 685eae561b3SGarrett Wollmanintegers and their external representations. 686eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 6871abae7eeSRuslan Ermilov.Pp 6881abae7eeSRuslan Ermilov.It Xo 6891abae7eeSRuslan Ermilov.Ft int 6901abae7eeSRuslan Ermilov.Xc 6911abae7eeSRuslan Ermilov.It Xo 6921abae7eeSRuslan Ermilov.Fo xdr_union 6931abae7eeSRuslan Ermilov.Fa "XDR *xdrs" 6941abae7eeSRuslan Ermilov.Fa "int *dscmp" 6951abae7eeSRuslan Ermilov.Fa "char *unp" 6961abae7eeSRuslan Ermilov.Fa "struct xdr_discrim *choices" 6971abae7eeSRuslan Ermilov.Fa "bool_t \*(lp*defaultarm\*(rp\*(lp\*(rp" 6981abae7eeSRuslan Ermilov.Fc 6991abae7eeSRuslan Ermilov.Xc 7001abae7eeSRuslan Ermilov.Pp 701eae561b3SGarrett WollmanA filter primitive that translates between a discriminated C 7021abae7eeSRuslan Ermilov.Vt union 703c6ff3a1bSSheldon Hearnand its corresponding external representation. 704c6ff3a1bSSheldon HearnIt first 705eae561b3SGarrett Wollmantranslates the discriminant of the union located at 7061abae7eeSRuslan Ermilov.Fa dscmp . 707eae561b3SGarrett WollmanThis discriminant is always an 7081abae7eeSRuslan Ermilov.Vt enum_t . 709eae561b3SGarrett WollmanNext the union located at 7101abae7eeSRuslan Ermilov.Fa unp 7111abae7eeSRuslan Ermilovis translated. 7121abae7eeSRuslan ErmilovThe parameter 7131abae7eeSRuslan Ermilov.Fa choices 714eae561b3SGarrett Wollmanis a pointer to an array of 7151abae7eeSRuslan Ermilov.Vt xdr_discrim 716c6ff3a1bSSheldon Hearnstructures. 717c6ff3a1bSSheldon HearnEach structure contains an ordered pair of 7181abae7eeSRuslan Ermilov.Bq Va value , proc . 719eae561b3SGarrett WollmanIf the union's discriminant is equal to the associated 7201abae7eeSRuslan Ermilov.Va value , 721eae561b3SGarrett Wollmanthen the 7221abae7eeSRuslan Ermilov.Fn proc 7231abae7eeSRuslan Ermilovis called to translate the union. 7241abae7eeSRuslan ErmilovThe end of the 7251abae7eeSRuslan Ermilov.Vt xdr_discrim 726eae561b3SGarrett Wollmanstructure array is denoted by a routine of value 7271abae7eeSRuslan Ermilov.Dv NULL . 728eae561b3SGarrett WollmanIf the discriminant is not found in the 7291abae7eeSRuslan Ermilov.Fa choices 730eae561b3SGarrett Wollmanarray, then the 7311abae7eeSRuslan Ermilov.Fn defaultarm 732eae561b3SGarrett Wollmanprocedure is called (if it is not 7331abae7eeSRuslan Ermilov.Dv NULL ) . 734eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise. 7351abae7eeSRuslan Ermilov.Pp 7361abae7eeSRuslan Ermilov.It Xo 7371abae7eeSRuslan Ermilov.Ft int 7381abae7eeSRuslan Ermilov.Xc 7391abae7eeSRuslan Ermilov.It Xo 7401abae7eeSRuslan Ermilov.Fo xdr_vector 7411abae7eeSRuslan Ermilov.Fa "XDR *xdrs" 7421abae7eeSRuslan Ermilov.Fa "char *arrp" 7431abae7eeSRuslan Ermilov.Fa "u_int size" 7441abae7eeSRuslan Ermilov.Fa "u_int elsize" 7451abae7eeSRuslan Ermilov.Fa "xdrproc_t elproc" 7461abae7eeSRuslan Ermilov.Fc 7471abae7eeSRuslan Ermilov.Xc 7481abae7eeSRuslan Ermilov.Pp 749eae561b3SGarrett WollmanA filter primitive that translates between fixed-length 750eae561b3SGarrett Wollmanarrays 7511abae7eeSRuslan Ermilovand their corresponding external representations. 7521abae7eeSRuslan ErmilovThe 753eae561b3SGarrett Wollmanparameter 7541abae7eeSRuslan Ermilov.Fa arrp 755eae561b3SGarrett Wollmanis the address of the pointer to the array, while 7561abae7eeSRuslan Ermilov.Fa size 7571abae7eeSRuslan Ermilovis the element count of the array. 7581abae7eeSRuslan ErmilovThe parameter 7591abae7eeSRuslan Ermilov.Fa elsize 760eae561b3SGarrett Wollmanis the 7611abae7eeSRuslan Ermilov.Ic sizeof 762eae561b3SGarrett Wollmaneach of the array's elements, and 7631abae7eeSRuslan Ermilov.Fa elproc 764eae561b3SGarrett Wollmanis an 7651abae7eeSRuslan Ermilov.Tn XDR 766eae561b3SGarrett Wollmanfilter that translates between 767eae561b3SGarrett Wollmanthe array elements' C form, and their external 768eae561b3SGarrett Wollmanrepresentation. 769eae561b3SGarrett WollmanThis routine returns one if it succeeds, zero otherwise. 7701abae7eeSRuslan Ermilov.Pp 7711abae7eeSRuslan Ermilov.It Xo 7721abae7eeSRuslan Ermilov.Ft int 7731abae7eeSRuslan Ermilov.Xc 7741abae7eeSRuslan Ermilov.It Xo 7751abae7eeSRuslan Ermilov.Fn xdr_void void 7761abae7eeSRuslan Ermilov.Xc 7771abae7eeSRuslan Ermilov.Pp 778eae561b3SGarrett WollmanThis routine always returns one. 779eae561b3SGarrett WollmanIt may be passed to 7801abae7eeSRuslan Ermilov.Tn RPC 781eae561b3SGarrett Wollmanroutines that require a function parameter, 782eae561b3SGarrett Wollmanwhere nothing is to be done. 7831abae7eeSRuslan Ermilov.Pp 7841abae7eeSRuslan Ermilov.It Xo 7851abae7eeSRuslan Ermilov.Ft int 7861abae7eeSRuslan Ermilov.Xc 7871abae7eeSRuslan Ermilov.It Xo 7881abae7eeSRuslan Ermilov.Fn xdr_wrapstring "XDR *xdrs" "char **sp" 7891abae7eeSRuslan Ermilov.Xc 7901abae7eeSRuslan Ermilov.Pp 791eae561b3SGarrett WollmanA primitive that calls 7921abae7eeSRuslan Ermilov.Fn xdr_string xdrs sp MAXUN.UNSIGNED ; 793eae561b3SGarrett Wollmanwhere 7941abae7eeSRuslan Ermilov.Dv MAXUN.UNSIGNED 795eae561b3SGarrett Wollmanis the maximum value of an unsigned integer. 7961abae7eeSRuslan Ermilov.Fn xdr_wrapstring 797eae561b3SGarrett Wollmanis handy because the 7981abae7eeSRuslan Ermilov.Tn RPC 799eae561b3SGarrett Wollmanpackage passes a maximum of two 8001abae7eeSRuslan Ermilov.Tn XDR 801eae561b3SGarrett Wollmanroutines as parameters, and 8021abae7eeSRuslan Ermilov.Fn xdr_string , 803eae561b3SGarrett Wollmanone of the most frequently used primitives, requires three. 804eae561b3SGarrett WollmanReturns one if it succeeds, zero otherwise. 8051abae7eeSRuslan Ermilov.El 8061abae7eeSRuslan Ermilov.Sh SEE ALSO 8071abae7eeSRuslan Ermilov.Xr rpc 3 8081abae7eeSRuslan Ermilov.Rs 8091abae7eeSRuslan Ermilov.%T "eXternal Data Representation Standard: Protocol Specification" 8101abae7eeSRuslan Ermilov.Re 8111abae7eeSRuslan Ermilov.Rs 8121abae7eeSRuslan Ermilov.%T "eXternal Data Representation: Sun Technical Notes" 8131abae7eeSRuslan Ermilov.Re 8141abae7eeSRuslan Ermilov.Rs 8151abae7eeSRuslan Ermilov.%T "XDR: External Data Representation Standard" 8161abae7eeSRuslan Ermilov.%O RFC1014 8171abae7eeSRuslan Ermilov.%Q "Sun Microsystems, Inc., USC\-ISI" 8181abae7eeSRuslan Ermilov.Re 819