Deleted Added
full compact
xdr.3 (50476) xdr.3 (57686)
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 50476 1999-08-28 00:22:10Z peter $
2.\" $FreeBSD: head/lib/libc/xdr/xdr.3 57686 2000-03-02 09:14:21Z sheldonh $
3.\"
4.TH XDR 3 "16 February 1988"
5.SH NAME
6xdr \- library routines for external data representation
7.SH SYNOPSIS AND DESCRIPTION
8.LP
9These routines allow C programmers to describe
10arbitrary data structures in a machine-independent fashion.

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

19char **arrp;
20u_int *sizep, maxsize, elsize;
21xdrproc_t elproc;
22.fi
23.ft R
24.IP
25A filter primitive that translates between variable-length
26arrays
3.\"
4.TH XDR 3 "16 February 1988"
5.SH NAME
6xdr \- library routines for external data representation
7.SH SYNOPSIS AND DESCRIPTION
8.LP
9These routines allow C programmers to describe
10arbitrary data structures in a machine-independent fashion.

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

19char **arrp;
20u_int *sizep, maxsize, elsize;
21xdrproc_t elproc;
22.fi
23.ft R
24.IP
25A filter primitive that translates between variable-length
26arrays
27and their corresponding external representations. The
27and their corresponding external representations.
28The
28parameter
29.I arrp
30is the address of the pointer to the array, while
31.I sizep
32is the address of the element count of the array;
33this element count cannot exceed
34.IR maxsize .
35The parameter

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

53xdr_bool(xdrs, bp)
54\s-1XDR\s0 *xdrs;
55bool_t *bp;
56.fi
57.ft R
58.IP
59A filter primitive that translates between booleans (C
60integers)
29parameter
30.I arrp
31is the address of the pointer to the array, while
32.I sizep
33is the address of the element count of the array;
34this element count cannot exceed
35.IR maxsize .
36The parameter

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

54xdr_bool(xdrs, bp)
55\s-1XDR\s0 *xdrs;
56bool_t *bp;
57.fi
58.ft R
59.IP
60A filter primitive that translates between booleans (C
61integers)
61and their external representations. When encoding data, this
62and their external representations.
63When encoding data, this
62filter produces values of either one or zero.
63This routine returns one if it succeeds, zero otherwise.
64.br
65.if t .ne 10
66.LP
67.ft B
68.nf
69.sp .5
70xdr_bytes(xdrs, sp, sizep, maxsize)
71\s-1XDR\s0 *xdrs;
72char **sp;
73u_int *sizep, maxsize;
74.fi
75.ft R
76.IP
77A filter primitive that translates between counted byte
78strings and their external representations.
79The parameter
80.I sp
64filter produces values of either one or zero.
65This routine returns one if it succeeds, zero otherwise.
66.br
67.if t .ne 10
68.LP
69.ft B
70.nf
71.sp .5
72xdr_bytes(xdrs, sp, sizep, maxsize)
73\s-1XDR\s0 *xdrs;
74char **sp;
75u_int *sizep, maxsize;
76.fi
77.ft R
78.IP
79A filter primitive that translates between counted byte
80strings and their external representations.
81The parameter
82.I sp
81is the address of the string pointer. The length of the
83is the address of the string pointer.
84The length of the
82string is located at address
83.IR sizep ;
84strings cannot be longer than
85.IR maxsize .
86This routine returns one if it succeeds, zero otherwise.
87.br
88.if t .ne 7
89.LP

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

95char *cp;
96.fi
97.ft R
98.IP
99A filter primitive that translates between C characters
100and their external representations.
101This routine returns one if it succeeds, zero otherwise.
102Note: encoded characters are not packed, and occupy 4 bytes
85string is located at address
86.IR sizep ;
87strings cannot be longer than
88.IR maxsize .
89This routine returns one if it succeeds, zero otherwise.
90.br
91.if t .ne 7
92.LP

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

98char *cp;
99.fi
100.ft R
101.IP
102A filter primitive that translates between C characters
103and their external representations.
104This routine returns one if it succeeds, zero otherwise.
105Note: encoded characters are not packed, and occupy 4 bytes
103each. For arrays of characters, it is worthwhile to
106each.
107For arrays of characters, it is worthwhile to
104consider
105.BR xdr_bytes(\|) ,
106.B xdr_opaque(\|)
107or
108.BR xdr_string(\|) .
109.br
110.if t .ne 8
111.LP

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

184.sp .5
185void
186xdr_free(proc, objp)
187xdrproc_t proc;
188char *objp;
189.fi
190.ft R
191.IP
108consider
109.BR xdr_bytes(\|) ,
110.B xdr_opaque(\|)
111or
112.BR xdr_string(\|) .
113.br
114.if t .ne 8
115.LP

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

188.sp .5
189void
190xdr_free(proc, objp)
191xdrproc_t proc;
192char *objp;
193.fi
194.ft R
195.IP
192Generic freeing routine. The first argument is the
196Generic freeing routine.
197The first argument is the
193.SM XDR
198.SM XDR
194routine for the object being freed. The second argument
195is a pointer to the object itself. Note: the pointer passed
199routine for the object being freed.
200The second argument
201is a pointer to the object itself.
202Note: the pointer passed
196to this routine is
197.I not
198freed, but what it points to
199.I is
200freed (recursively).
201.br
202.if t .ne 8
203.LP

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

387.IP
388This routine initializes the
389.SM XDR
390stream object pointed to by
391.IR xdrs .
392The stream's data is written to a buffer of size
393.IR sendsize ;
394a value of zero indicates the system should use a suitable
203to this routine is
204.I not
205freed, but what it points to
206.I is
207freed (recursively).
208.br
209.if t .ne 8
210.LP

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

394.IP
395This routine initializes the
396.SM XDR
397stream object pointed to by
398.IR xdrs .
399The stream's data is written to a buffer of size
400.IR sendsize ;
401a value of zero indicates the system should use a suitable
395default. The stream's data is read from a buffer of size
402default.
403The stream's data is read from a buffer of size
396.IR recvsize ;
397it too can be set to a suitable default by passing a zero
398value.
399When a stream's output buffer is full,
400.I writeit
401is called. Similarly, when a stream's input buffer is empty,
402.I readit
403is called. The behavior of these two routines is similar to

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

434.IP
435This routine can be invoked only on
436streams created by
437.BR xdrrec_create(\|) .
438The data in the output buffer is marked as a completed
439record,
440and the output buffer is optionally written out if
441.I sendnow
404.IR recvsize ;
405it too can be set to a suitable default by passing a zero
406value.
407When a stream's output buffer is full,
408.I writeit
409is called. Similarly, when a stream's input buffer is empty,
410.I readit
411is called. The behavior of these two routines is similar to

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

442.IP
443This routine can be invoked only on
444streams created by
445.BR xdrrec_create(\|) .
446The data in the output buffer is marked as a completed
447record,
448and the output buffer is optionally written out if
449.I sendnow
442is non-zero. This routine returns one if it succeeds, zero
450is non-zero.
451This routine returns one if it succeeds, zero
443otherwise.
444.br
445.if t .ne 8
446.LP
447.ft B
448.nf
449.sp .5
450xdrrec_eof(xdrs)

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

506is an
507.SM XDR
508procedure that filters the structure
509between its C form and its external representation.
510This routine returns one if it succeeds, zero otherwise.
511.IP
512Warning: this routine does not understand
513.SM NULL
452otherwise.
453.br
454.if t .ne 8
455.LP
456.ft B
457.nf
458.sp .5
459xdrrec_eof(xdrs)

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

515is an
516.SM XDR
517procedure that filters the structure
518between its C form and its external representation.
519This routine returns one if it succeeds, zero otherwise.
520.IP
521Warning: this routine does not understand
522.SM NULL
514pointers. Use
523pointers.
524Use
515.B xdr_pointer(\|)
516instead.
517.br
518.if t .ne 10
519.LP
520.ft B
521.nf
522.sp .5

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

701char *unp;
702struct xdr_discrim *choices;
703bool_t (*defaultarm) (\|); /* may equal \s-1NULL\s0 */
704.fi
705.ft R
706.IP
707A filter primitive that translates between a discriminated C
708.B union
525.B xdr_pointer(\|)
526instead.
527.br
528.if t .ne 10
529.LP
530.ft B
531.nf
532.sp .5

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

711char *unp;
712struct xdr_discrim *choices;
713bool_t (*defaultarm) (\|); /* may equal \s-1NULL\s0 */
714.fi
715.ft R
716.IP
717A filter primitive that translates between a discriminated C
718.B union
709and its corresponding external representation. It first
719and its corresponding external representation.
720It first
710translates the discriminant of the union located at
711.IR dscmp .
712This discriminant is always an
713.BR enum_t .
714Next the union located at
715.I unp
716is translated. The parameter
717.I choices
718is a pointer to an array of
719.B xdr_discrim(\|)
721translates the discriminant of the union located at
722.IR dscmp .
723This discriminant is always an
724.BR enum_t .
725Next the union located at
726.I unp
727is translated. The parameter
728.I choices
729is a pointer to an array of
730.B xdr_discrim(\|)
720structures. Each structure contains an ordered pair of
731structures.
732Each structure contains an ordered pair of
721.RI [ value , proc ].
722If the union's discriminant is equal to the associated
723.IR value ,
724then the
725.I proc
726is called to translate the union. The end of the
727.B xdr_discrim(\|)
728structure array is denoted by a routine of value

--- 97 unchanged lines hidden ---
733.RI [ value , proc ].
734If the union's discriminant is equal to the associated
735.IR value ,
736then the
737.I proc
738is called to translate the union. The end of the
739.B xdr_discrim(\|)
740structure array is denoted by a routine of value

--- 97 unchanged lines hidden ---