Print this page
4398 Extra spaces in man pages
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3nsl/xdr_admin.3nsl
+++ new/usr/src/man/man3nsl/xdr_admin.3nsl
1 1 '\" te
2 2 .\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
3 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 6 .TH XDR_ADMIN 3NSL "Dec 30, 1996"
7 7 .SH NAME
8 8 xdr_admin, xdr_control, xdr_getpos, xdr_inline, xdrrec_endofrecord, xdrrec_eof,
9 9 xdrrec_readbytes, xdrrec_skiprecord, xdr_setpos, xdr_sizeof \- library routines
10 10 for external data representation
11 11 .SH DESCRIPTION
12 12 .sp
13 13 .LP
14 14 \fBXDR\fR library routines allow C programmers to describe arbitrary data
15 15 structures in a machine-independent fashion. Protocols such as remote procedure
16 16 calls (RPC) use these routines to describe the format of the data.
17 17 .sp
18 18 .LP
19 19 These routines deal specifically with the management of the \fBXDR\fR stream.
20 20 .SS "Routines"
21 21 .sp
22 22 .LP
23 23 See \fBrpc\fR(3NSL) for the definition of the \fBXDR\fR data structure. Note
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
24 24 that any buffers passed to the \fBXDR\fR routines must be properly aligned. It
25 25 is suggested either that \fBmalloc\fR(3C) be used to allocate these buffers, or
26 26 that the programmer insure that the buffer address is divisible evenly by
27 27 four.
28 28 .sp
29 29 .LP
30 30 \fB#include <rpc/xdr.h>\fR
31 31 .sp
32 32 .ne 2
33 33 .na
34 -\fB\fBbool_t xdr_control( XDR *\fR\fIxdrs\fR\fB, int\fR\fI req\fR\fB, void
34 +\fB\fBbool_t xdr_control(XDR *\fR\fIxdrs\fR\fB, int\fR\fI req\fR\fB, void
35 35 *\fR\fIinfo\fR\fB);\fR\fR
36 36 .ad
37 37 .sp .6
38 38 .RS 4n
39 39 A function macro to change or retrieve various information about an \fBXDR\fR
40 40 stream. \fIreq\fR indicates the type of operation and \fIinfo\fR is a pointer
41 41 to the information. The supported values of \fIreq\fR is
42 42 \fBXDR_GET_BYTES_AVAIL\fR and its argument type is \fBxdr_bytesrec *\fR. They
43 43 return the number of bytes left unconsumed in the stream and a flag indicating
44 44 whether or not this is the last fragment.
45 45 .RE
46 46
47 47 .sp
48 48 .ne 2
49 49 .na
50 50 \fB\fBuint_t xdr_getpos(const XDR *\fR\fIxdrs\fR\fB);\fR\fR
51 51 .ad
52 52 .sp .6
53 53 .RS 4n
54 54 A macro that invokes the get-position routine associated with the \fBXDR\fR
55 55 stream, \fIxdrs\fR. The routine returns an unsigned integer, which indicates
56 56 the position of the \fBXDR\fR byte stream. A desirable feature of \fBXDR\fR
57 57 streams is that simple arithmetic works with this number, although the
58 58 \fBXDR\fR stream instances need not guarantee this. Therefore, applications
59 59 written for portability should not depend on this feature.
60 60 .RE
61 61
62 62 .sp
63 63 .ne 2
64 64 .na
65 65 \fB\fBlong *xdr_inline(XDR *\fR\fIxdrs\fR\fB, const int \fR\fIlen\fR\fB);\fR\fR
66 66 .ad
67 67 .sp .6
68 68 .RS 4n
69 69 A macro that invokes the in-line routine associated with the \fBXDR\fR stream,
70 70 \fIxdrs\fR. The routine returns a pointer to a contiguous piece of the stream's
71 71 buffer; \fIlen\fR is the byte length of the desired buffer. Note: pointer is
72 72 cast to \fBlong *\fR.
73 73 .sp
74 74 Warning: \fBxdr_inline()\fR may return \fINULL\fR (\fB0\fR) if it cannot
75 75 allocate a contiguous piece of a buffer. Therefore the behavior may vary among
76 76 stream instances; it exists for the sake of efficiency, and applications
77 77 written for portability should not depend on this feature.
78 78 .RE
79 79
80 80 .sp
81 81 .ne 2
82 82 .na
83 83 \fB\fBbool_t xdrrec_endofrecord(XDR *xdrs, int \fR\fIsendnow\fR\fB);\fR\fR
84 84 .ad
85 85 .sp .6
86 86 .RS 4n
87 87 This routine can be invoked only on streams created by \fBxdrrec_create()\fR.
88 88 See \fBxdr_create\fR(3NSL). The data in the output buffer is marked as a
89 89 completed record, and the output buffer is optionally written out if
90 90 \fIsendnow\fR is non-zero. This routine returns \fBTRUE\fR if it succeeds,
91 91 \fBFALSE\fR otherwise.
92 92 .RE
93 93
94 94 .sp
95 95 .ne 2
96 96 .na
97 97 \fB\fBbool_t xdrrec_eof(XDR *\fR\fIxdrs\fR\fB);\fR\fR
98 98 .ad
99 99 .sp .6
100 100 .RS 4n
101 101 This routine can be invoked only on streams created by \fBxdrrec_create()\fR.
102 102 After consuming the rest of the current record in the stream, this routine
103 103 returns \fBTRUE\fR if there is no more data in the stream's input buffer. It
104 104 returns \fBFALSE\fR if there is additional data in the stream's input buffer.
105 105 .RE
106 106
107 107 .sp
108 108 .ne 2
109 109 .na
110 110 \fB\fBint xdrrec_readbytes(XDR *\fR\fIxdrs\fR\fB, caddr_t\fR\fI addr\fR\fB,
111 111 uint_t\fR\fI nbytes\fR\fB);\fR\fR
112 112 .ad
113 113 .sp .6
114 114 .RS 4n
115 115 This routine can be invoked only on streams created by \fBxdrrec_create()\fR.
116 116 It attempts to read \fInbytes\fR bytes from the \fBXDR\fR stream into the
117 117 buffer pointed to by \fIaddr\fR. Upon success this routine returns the number
118 118 of bytes read. Upon failure, it returns \fB\(mi1\fR\&. A return value of
119 119 \fB0\fR indicates an end of record.
120 120 .RE
121 121
122 122 .sp
123 123 .ne 2
124 124 .na
125 125 \fB\fBbool_t xdrrec_skiprecord(XDR *\fR\fIxdrs\fR\fB);\fR\fR
126 126 .ad
127 127 .sp .6
128 128 .RS 4n
129 129 This routine can be invoked only on streams created by \fBxdrrec_create()\fR.
130 130 See \fBxdr_create\fR(3NSL). It tells the \fBXDR\fR implementation that the
131 131 rest of the current record in the stream's input buffer should be discarded.
132 132 This routine returns \fBTRUE\fR if it succeeds, \fBFALSE\fR otherwise.
133 133 .RE
134 134
135 135 .sp
136 136 .ne 2
137 137 .na
138 138 \fB\fBbool_t xdr_setpos(XDR *\fR\fIxdrs\fR\fB, const uint_t
139 139 \fR\fIpos\fR\fB);\fR\fR
140 140 .ad
141 141 .sp .6
142 142 .RS 4n
143 143 A macro that invokes the set position routine associated with the \fBXDR\fR
144 144 stream \fIxdrs\fR. The parameter \fIpos\fR is a position value obtained from
145 145 \fBxdr_getpos()\fR. This routine returns \fBTRUE\fR if the \fBXDR\fR stream was
146 146 repositioned, and \fBFALSE\fR otherwise.
147 147 .sp
148 148 Warning: it is difficult to reposition some types of \fBXDR\fR streams, so this
149 149 routine may fail with one type of stream and succeed with another. Therefore,
150 150 applications written for portability should not depend on this feature.
151 151 .RE
152 152
153 153 .sp
154 154 .ne 2
155 155 .na
156 156 \fB\fBunsigned long xdr_sizeof(xdrproc_t \fR\fIfunc\fR\fB, void
157 157 *\fR\fIdata\fR\fB);\fR\fR
158 158 .ad
159 159 .sp .6
160 160 .RS 4n
161 161 This routine returns the number of bytes required to encode \fIdata\fR using
162 162 the \fBXDR\fR filter function \fIfunc\fR, excluding potential overhead such as
163 163 \fBRPC\fR headers or record markers. \fB0\fR is returned on error. This
164 164 information might be used to select between transport protocols, or to
165 165 determine the buffer size for various lower levels of \fBRPC\fR client and
166 166 server creation routines, or to allocate storage when \fBXDR\fR is used
167 167 outside of the \fBRPC\fR subsystem.
168 168 .RE
169 169
170 170 .SH ATTRIBUTES
171 171 .sp
172 172 .LP
173 173 See \fBattributes\fR(5) for descriptions of the following attributes:
174 174 .sp
175 175
176 176 .sp
177 177 .TS
178 178 box;
179 179 c | c
180 180 l | l .
181 181 ATTRIBUTE TYPE ATTRIBUTE VALUE
182 182 _
183 183 MT-Level Safe
184 184 .TE
185 185
186 186 .SH SEE ALSO
187 187 .sp
188 188 .LP
189 189 \fBmalloc\fR(3C), \fBrpc\fR(3NSL), \fBxdr_complex\fR(3NSL),
190 190 \fBxdr_create\fR(3NSL), \fBxdr_simple\fR(3NSL), \fBattributes\fR(5)
↓ open down ↓ |
146 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX