Deleted Added
full compact
xdr.3 (108037) xdr.3 (108087)
1.\" @(#)xdr.3n 2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI
1.\" @(#)xdr.3n 2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI
2.\" $FreeBSD: head/lib/libc/xdr/xdr.3 108037 2002-12-18 12:45:11Z ru $
2.\" $FreeBSD: head/lib/libc/xdr/xdr.3 108087 2002-12-19 09:40:28Z ru $
3.\"
4.Dd February 16, 1988
5.Dt XDR 3
6.Os
7.Sh NAME
8.Nm xdr ,
9.Nm xdr_array ,
10.Nm xdr_bool ,

--- 62 unchanged lines hidden (view full) ---

73.Fa "xdrproc_t elproc"
74.Fc
75.Xc
76.Pp
77A filter primitive that translates between variable-length
78arrays
79and their corresponding external representations.
80The
3.\"
4.Dd February 16, 1988
5.Dt XDR 3
6.Os
7.Sh NAME
8.Nm xdr ,
9.Nm xdr_array ,
10.Nm xdr_bool ,

--- 62 unchanged lines hidden (view full) ---

73.Fa "xdrproc_t elproc"
74.Fc
75.Xc
76.Pp
77A filter primitive that translates between variable-length
78arrays
79and their corresponding external representations.
80The
81parameter
82.Fa arrp
81.Fa arrp
82argument
83is the address of the pointer to the array, while
84.Fa sizep
85is the address of the element count of the array;
86this element count cannot exceed
87.Fa maxsize .
83is the address of the pointer to the array, while
84.Fa sizep
85is the address of the element count of the array;
86this element count cannot exceed
87.Fa maxsize .
88The parameter
88The
89.Fa elsize
89.Fa elsize
90argument
90is the
91.Ic sizeof
92each of the array's elements, and
93.Fa elproc
94is an
95.Tn XDR
96filter that translates between
97the array elements' C form, and their external

--- 18 unchanged lines hidden (view full) ---

116.Ft int
117.Xc
118.It Xo
119.Fn xdr_bytes "XDR *xdrs" "char **sp" "u_int *sizep" "u_int maxsize"
120.Xc
121.Pp
122A filter primitive that translates between counted byte
123strings and their external representations.
91is the
92.Ic sizeof
93each of the array's elements, and
94.Fa elproc
95is an
96.Tn XDR
97filter that translates between
98the array elements' C form, and their external

--- 18 unchanged lines hidden (view full) ---

117.Ft int
118.Xc
119.It Xo
120.Fn xdr_bytes "XDR *xdrs" "char **sp" "u_int *sizep" "u_int maxsize"
121.Xc
122.Pp
123A filter primitive that translates between counted byte
124strings and their external representations.
124The parameter
125The
125.Fa sp
126.Fa sp
127argument
126is the address of the string pointer.
127The length of the
128string is located at address
129.Fa sizep ;
130strings cannot be longer than
131.Fa maxsize .
132This routine returns one if it succeeds, zero otherwise.
133.Pp

--- 200 unchanged lines hidden (view full) ---

334The stream's data is written to, or read from,
335a chunk of memory at location
336.Fa addr
337whose length is no more than
338.Fa size
339bytes long.
340The
341.Fa op
128is the address of the string pointer.
129The length of the
130string is located at address
131.Fa sizep ;
132strings cannot be longer than
133.Fa maxsize .
134This routine returns one if it succeeds, zero otherwise.
135.Pp

--- 200 unchanged lines hidden (view full) ---

336The stream's data is written to, or read from,
337a chunk of memory at location
338.Fa addr
339whose length is no more than
340.Fa size
341bytes long.
342The
343.Fa op
344argument
342determines the direction of the
343.Tn XDR
344stream
345(either
346.Dv XDR_ENCODE ,
347.Dv XDR_DECODE ,
348or
349.Dv XDR_FREE ) .
350.Pp
351.It Xo
352.Ft int
353.Xc
354.It Xo
355.Fn xdr_opaque "XDR *xdrs" "char *cp" "u_int cnt"
356.Xc
357.Pp
358A filter primitive that translates between fixed size opaque
359data
360and its external representation.
345determines the direction of the
346.Tn XDR
347stream
348(either
349.Dv XDR_ENCODE ,
350.Dv XDR_DECODE ,
351or
352.Dv XDR_FREE ) .
353.Pp
354.It Xo
355.Ft int
356.Xc
357.It Xo
358.Fn xdr_opaque "XDR *xdrs" "char *cp" "u_int cnt"
359.Xc
360.Pp
361A filter primitive that translates between fixed size opaque
362data
363and its external representation.
361The parameter
364The
362.Fa cp
365.Fa cp
366argument
363is the address of the opaque object, and
364.Fa cnt
365is its size in bytes.
366This routine returns one if it succeeds, zero otherwise.
367.Pp
368.It Xo
369.Ft int
370.Xc

--- 49 unchanged lines hidden (view full) ---

420The behavior of these two routines is similar to
421the
422system calls
423.Xr read 2
424and
425.Xr write 2 ,
426except that
427.Fa handle
367is the address of the opaque object, and
368.Fa cnt
369is its size in bytes.
370This routine returns one if it succeeds, zero otherwise.
371.Pp
372.It Xo
373.Ft int
374.Xc

--- 49 unchanged lines hidden (view full) ---

424The behavior of these two routines is similar to
425the
426system calls
427.Xr read 2
428and
429.Xr write 2 ,
430except that
431.Fa handle
428is passed to the former routines as the first parameter.
432is passed to the former routines as the first argument.
429Note: the
430.Tn XDR
431stream's
432.Fa op
433field must be set by the caller.
434.Pp
435Warning: this
436.Tn XDR

--- 52 unchanged lines hidden (view full) ---

489.It Xo
490.Ft int
491.Xc
492.It Xo
493.Fn xdr_reference "XDR *xdrs" "char **pp" "u_int size" "xdrproc_t proc"
494.Xc
495.Pp
496A primitive that provides pointer chasing within structures.
433Note: the
434.Tn XDR
435stream's
436.Fa op
437field must be set by the caller.
438.Pp
439Warning: this
440.Tn XDR

--- 52 unchanged lines hidden (view full) ---

493.It Xo
494.Ft int
495.Xc
496.It Xo
497.Fn xdr_reference "XDR *xdrs" "char **pp" "u_int size" "xdrproc_t proc"
498.Xc
499.Pp
500A primitive that provides pointer chasing within structures.
497The parameter
501The
498.Fa pp
502.Fa pp
503argument
499is the address of the pointer;
500.Fa size
501is the
502.Ic sizeof
503the structure that
504.Fa *pp
505points to; and
506.Fa proc

--- 17 unchanged lines hidden (view full) ---

524.Fn xdr_setpos "XDR *xdrs" "u_int pos"
525.Xc
526.Pp
527A macro that invokes the set position routine associated with
528the
529.Tn XDR
530stream
531.Fa xdrs .
504is the address of the pointer;
505.Fa size
506is the
507.Ic sizeof
508the structure that
509.Fa *pp
510points to; and
511.Fa proc

--- 17 unchanged lines hidden (view full) ---

529.Fn xdr_setpos "XDR *xdrs" "u_int pos"
530.Xc
531.Pp
532A macro that invokes the set position routine associated with
533the
534.Tn XDR
535stream
536.Fa xdrs .
532The parameter
537The
533.Fa pos
538.Fa pos
539argument
534is a position value obtained from
535.Fn xdr_getpos .
536This routine returns one if the
537.Tn XDR
538stream could be repositioned,
539and zero otherwise.
540.Pp
541Warning: it is difficult to reposition some types of

--- 28 unchanged lines hidden (view full) ---

570stream object pointed to by
571.Fa xdrs .
572The
573.Tn XDR
574stream data is written to, or read from, the Standard
575.Tn I/O
576stream
577.Fa file .
540is a position value obtained from
541.Fn xdr_getpos .
542This routine returns one if the
543.Tn XDR
544stream could be repositioned,
545and zero otherwise.
546.Pp
547Warning: it is difficult to reposition some types of

--- 28 unchanged lines hidden (view full) ---

576stream object pointed to by
577.Fa xdrs .
578The
579.Tn XDR
580stream data is written to, or read from, the Standard
581.Tn I/O
582stream
583.Fa file .
578The parameter
584The
579.Fa op
585.Fa op
586argument
580determines the direction of the
581.Tn XDR
582stream (either
583.Dv XDR_ENCODE ,
584.Dv XDR_DECODE ,
585or
586.Dv XDR_FREE ) .
587.Pp

--- 116 unchanged lines hidden (view full) ---

704It first
705translates the discriminant of the union located at
706.Fa dscmp .
707This discriminant is always an
708.Vt enum_t .
709Next the union located at
710.Fa unp
711is translated.
587determines the direction of the
588.Tn XDR
589stream (either
590.Dv XDR_ENCODE ,
591.Dv XDR_DECODE ,
592or
593.Dv XDR_FREE ) .
594.Pp

--- 116 unchanged lines hidden (view full) ---

711It first
712translates the discriminant of the union located at
713.Fa dscmp .
714This discriminant is always an
715.Vt enum_t .
716Next the union located at
717.Fa unp
718is translated.
712The parameter
719The
713.Fa choices
720.Fa choices
721argument
714is a pointer to an array of
715.Vt xdr_discrim
716structures.
717Each structure contains an ordered pair of
718.Bq Va value , proc .
719If the union's discriminant is equal to the associated
720.Va value ,
721then the

--- 23 unchanged lines hidden (view full) ---

745.Fa "xdrproc_t elproc"
746.Fc
747.Xc
748.Pp
749A filter primitive that translates between fixed-length
750arrays
751and their corresponding external representations.
752The
722is a pointer to an array of
723.Vt xdr_discrim
724structures.
725Each structure contains an ordered pair of
726.Bq Va value , proc .
727If the union's discriminant is equal to the associated
728.Va value ,
729then the

--- 23 unchanged lines hidden (view full) ---

753.Fa "xdrproc_t elproc"
754.Fc
755.Xc
756.Pp
757A filter primitive that translates between fixed-length
758arrays
759and their corresponding external representations.
760The
753parameter
754.Fa arrp
761.Fa arrp
762argument
755is the address of the pointer to the array, while
756.Fa size
757is the element count of the array.
763is the address of the pointer to the array, while
764.Fa size
765is the element count of the array.
758The parameter
766The
759.Fa elsize
767.Fa elsize
768argument
760is the
761.Ic sizeof
762each of the array's elements, and
763.Fa elproc
764is an
765.Tn XDR
766filter that translates between
767the array elements' C form, and their external

--- 5 unchanged lines hidden (view full) ---

773.Xc
774.It Xo
775.Fn xdr_void void
776.Xc
777.Pp
778This routine always returns one.
779It may be passed to
780.Tn RPC
769is the
770.Ic sizeof
771each of the array's elements, and
772.Fa elproc
773is an
774.Tn XDR
775filter that translates between
776the array elements' C form, and their external

--- 5 unchanged lines hidden (view full) ---

782.Xc
783.It Xo
784.Fn xdr_void void
785.Xc
786.Pp
787This routine always returns one.
788It may be passed to
789.Tn RPC
781routines that require a function parameter,
790routines that require a function argument,
782where nothing is to be done.
783.Pp
784.It Xo
785.Ft int
786.Xc
787.It Xo
788.Fn xdr_wrapstring "XDR *xdrs" "char **sp"
789.Xc

--- 5 unchanged lines hidden (view full) ---

795is the maximum value of an unsigned integer.
796The
797.Fn xdr_wrapstring
798function
799is handy because the
800.Tn RPC
801package passes a maximum of two
802.Tn XDR
791where nothing is to be done.
792.Pp
793.It Xo
794.Ft int
795.Xc
796.It Xo
797.Fn xdr_wrapstring "XDR *xdrs" "char **sp"
798.Xc

--- 5 unchanged lines hidden (view full) ---

804is the maximum value of an unsigned integer.
805The
806.Fn xdr_wrapstring
807function
808is handy because the
809.Tn RPC
810package passes a maximum of two
811.Tn XDR
803routines as parameters, and
812routines as arguments, and
804.Fn xdr_string ,
805one of the most frequently used primitives, requires three.
806Returns one if it succeeds, zero otherwise.
807.El
808.Sh SEE ALSO
809.Xr rpc 3
810.Rs
811.%T "eXternal Data Representation Standard: Protocol Specification"
812.Re
813.Rs
814.%T "eXternal Data Representation: Sun Technical Notes"
815.Re
816.Rs
817.%T "XDR: External Data Representation Standard"
818.%O RFC1014
819.%Q "Sun Microsystems, Inc., USC\-ISI"
820.Re
813.Fn xdr_string ,
814one of the most frequently used primitives, requires three.
815Returns one if it succeeds, zero otherwise.
816.El
817.Sh SEE ALSO
818.Xr rpc 3
819.Rs
820.%T "eXternal Data Representation Standard: Protocol Specification"
821.Re
822.Rs
823.%T "eXternal Data Representation: Sun Technical Notes"
824.Re
825.Rs
826.%T "XDR: External Data Representation Standard"
827.%O RFC1014
828.%Q "Sun Microsystems, Inc., USC\-ISI"
829.Re