]>
Commit | Line | Data |
---|---|---|
cc3832e9 MK |
1 | .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) |
2 | .\" | |
fea681da | 3 | .\" @(#)xdr.3n 2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI |
e7c7da90 MK |
4 | .\" |
5 | .\" 2007-12-30, mtk, Convert function prototypes to modern C syntax | |
6 | .\" | |
5b20a7a2 | 7 | .TH XDR 3 2007-12-30 "" "Linux Programmer's Manual" |
fea681da MK |
8 | .SH NAME |
9 | xdr \- library routines for external data representation | |
10 | .SH "SYNOPSIS AND DESCRIPTION" | |
11 | .LP | |
12 | These routines allow C programmers to describe | |
13 | arbitrary data structures in a machine-independent fashion. | |
14 | Data for remote procedure calls are transmitted using these | |
15 | routines. | |
5b20a7a2 MK |
16 | |
17 | The prototypes below are declared in | |
18 | .I <rpc/xdr.h> | |
19 | and make use of the following types: | |
20 | .in +4n | |
78729a5d | 21 | .nf |
5b20a7a2 MK |
22 | |
23 | typedef int \fIbool_t\fP; | |
24 | ||
25 | typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...); | |
26 | .fi | |
78729a5d | 27 | .in |
5b20a7a2 MK |
28 | .LP |
29 | For the declaration of the | |
30 | .I XDR | |
31 | type, see | |
32 | .IR <rpc/xdr.h> . | |
fea681da | 33 | .LP |
fea681da | 34 | .nf |
5b20a7a2 MK |
35 | .BI "bool_t xdr_array(XDR *" xdrs ", char **" arrp ", unsigned int *" sizep , |
36 | .BI " unsigned int " maxsize ", unsigned int " elsize , | |
37 | .BI " xdrproc_t " elproc ); | |
fea681da | 38 | .fi |
fea681da | 39 | .IP |
5b20a7a2 | 40 | A filter primitive that translates between variable-length arrays |
c13182ef MK |
41 | and their corresponding external representations. |
42 | The parameter | |
fea681da MK |
43 | .I arrp |
44 | is the address of the pointer to the array, while | |
45 | .I sizep | |
46 | is the address of the element count of the array; | |
47 | this element count cannot exceed | |
48 | .IR maxsize . | |
49 | The parameter | |
50 | .I elsize | |
51 | is the | |
52 | .I sizeof | |
53 | each of the array's elements, and | |
54 | .I elproc | |
5b20a7a2 | 55 | is an XDR filter that translates between |
fea681da MK |
56 | the array elements' C form, and their external |
57 | representation. | |
58 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 59 | .LP |
fea681da | 60 | .nf |
5b20a7a2 | 61 | .BI "bool_t xdr_bool(XDR *" xdrs ", bool_t *" bp ); |
fea681da | 62 | .fi |
fea681da MK |
63 | .IP |
64 | A filter primitive that translates between booleans (C | |
65 | integers) | |
c13182ef MK |
66 | and their external representations. |
67 | When encoding data, this | |
fea681da MK |
68 | filter produces values of either one or zero. |
69 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 70 | .LP |
fea681da | 71 | .nf |
5b20a7a2 MK |
72 | .BI "bool_t xdr_bytes(XDR *" xdrs ", char **" sp ", unsigned int *" sizep , |
73 | .BI " unsigned int " maxsize ); | |
fea681da | 74 | .fi |
fea681da MK |
75 | .IP |
76 | A filter primitive that translates between counted byte | |
77 | strings and their external representations. | |
78 | The parameter | |
79 | .I sp | |
c13182ef MK |
80 | is the address of the string pointer. |
81 | The length of the | |
fea681da MK |
82 | string is located at address |
83 | .IR sizep ; | |
84 | strings cannot be longer than | |
85 | .IR maxsize . | |
86 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 87 | .LP |
fea681da | 88 | .nf |
5b20a7a2 | 89 | .BI "bool_t xdr_char(XDR *" xdrs ", char *" cp ); |
fea681da | 90 | .fi |
fea681da MK |
91 | .IP |
92 | A filter primitive that translates between C characters | |
93 | and their external representations. | |
94 | This routine returns one if it succeeds, zero otherwise. | |
c13182ef MK |
95 | Note: encoded characters are not packed, and occupy 4 bytes each. |
96 | For arrays of characters, it is worthwhile to | |
fea681da | 97 | consider |
63aa9df0 MK |
98 | .BR xdr_bytes (), |
99 | .BR xdr_opaque () | |
fea681da | 100 | or |
63aa9df0 | 101 | .BR xdr_string (). |
fea681da | 102 | .LP |
fea681da | 103 | .nf |
5b20a7a2 | 104 | .BI "void xdr_destroy(XDR *" xdrs ); |
fea681da | 105 | .fi |
fea681da | 106 | .IP |
5b20a7a2 | 107 | A macro that invokes the destroy routine associated with the XDR stream, |
fea681da MK |
108 | .IR xdrs . |
109 | Destruction usually involves freeing private data structures | |
c13182ef MK |
110 | associated with the stream. |
111 | Using | |
fea681da MK |
112 | .I xdrs |
113 | after invoking | |
63aa9df0 | 114 | .BR xdr_destroy () |
fea681da | 115 | is undefined. |
fea681da | 116 | .LP |
fea681da | 117 | .nf |
5b20a7a2 | 118 | .BI "bool_t xdr_double(XDR *" xdrs ", double *" dp ); |
fea681da | 119 | .fi |
fea681da MK |
120 | .IP |
121 | A filter primitive that translates between C | |
9ff08aad | 122 | .I double |
fea681da MK |
123 | precision numbers and their external representations. |
124 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 125 | .LP |
fea681da | 126 | .nf |
5b20a7a2 | 127 | .BI "bool_t xdr_enum(XDR *" xdrs ", enum_t *" ep ); |
fea681da | 128 | .fi |
fea681da MK |
129 | .IP |
130 | A filter primitive that translates between C | |
f19a0f03 | 131 | .IR enum s |
fea681da MK |
132 | (actually integers) and their external representations. |
133 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 134 | .LP |
fea681da | 135 | .nf |
5b20a7a2 | 136 | .BI "bool_t xdr_float(XDR *" xdrs ", float *" fp ); |
fea681da | 137 | .fi |
fea681da MK |
138 | .IP |
139 | A filter primitive that translates between C | |
f19a0f03 | 140 | .IR float s |
fea681da MK |
141 | and their external representations. |
142 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 143 | .LP |
fea681da | 144 | .nf |
5b20a7a2 | 145 | .BI "void xdr_free(xdrproc_t " proc ", char *" objp ); |
fea681da | 146 | .fi |
fea681da | 147 | .IP |
c13182ef | 148 | Generic freeing routine. |
5b20a7a2 MK |
149 | The first argument is the XDR routine for the object being freed. |
150 | The second argument is a pointer to the object itself. | |
151 | Note: the pointer passed to this routine is | |
fea681da MK |
152 | .I not |
153 | freed, but what it points to | |
154 | .I is | |
155 | freed (recursively). | |
fea681da | 156 | .LP |
fea681da | 157 | .nf |
5b20a7a2 | 158 | .BI "unsigned int xdr_getpos(XDR *" xdrs ); |
fea681da | 159 | .fi |
fea681da MK |
160 | .IP |
161 | A macro that invokes the get-position routine | |
5b20a7a2 | 162 | associated with the XDR stream, |
fea681da MK |
163 | .IR xdrs . |
164 | The routine returns an unsigned integer, | |
5b20a7a2 MK |
165 | which indicates the position of the XDR byte stream. |
166 | A desirable feature of XDR | |
fea681da | 167 | streams is that simple arithmetic works with this number, |
5b20a7a2 | 168 | although the XDR stream instances need not guarantee this. |
fea681da | 169 | .LP |
fea681da | 170 | .nf |
5b20a7a2 | 171 | .BI "long *xdr_inline(XDR *" xdrs ", int " len ); |
fea681da | 172 | .fi |
fea681da | 173 | .IP |
5b20a7a2 | 174 | A macro that invokes the in-line routine associated with the XDR stream, |
fea681da MK |
175 | .IR xdrs . |
176 | The routine returns a pointer | |
177 | to a contiguous piece of the stream's buffer; | |
178 | .I len | |
179 | is the byte length of the desired buffer. | |
180 | Note: pointer is cast to | |
9ff08aad | 181 | .IR "long *" . |
fea681da MK |
182 | .IP |
183 | Warning: | |
63aa9df0 | 184 | .BR xdr_inline () |
5b20a7a2 | 185 | may return NULL (0) |
fea681da MK |
186 | if it cannot allocate a contiguous piece of a buffer. |
187 | Therefore the behavior may vary among stream instances; | |
188 | it exists for the sake of efficiency. | |
fea681da | 189 | .LP |
fea681da | 190 | .nf |
5b20a7a2 | 191 | .BI "bool_t xdr_int(XDR *" xdrs ", int *" ip ); |
fea681da | 192 | .fi |
fea681da MK |
193 | .IP |
194 | A filter primitive that translates between C integers | |
195 | and their external representations. | |
196 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 197 | .LP |
fea681da | 198 | .nf |
5b20a7a2 | 199 | .BI "bool_t xdr_long(XDR *" xdrs ", long *" lp ); |
fea681da | 200 | .fi |
fea681da MK |
201 | .IP |
202 | A filter primitive that translates between C | |
9ff08aad | 203 | .I long |
fea681da MK |
204 | integers and their external representations. |
205 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 206 | .LP |
fea681da | 207 | .nf |
5b20a7a2 MK |
208 | .BI "void xdrmem_create(XDR *" xdrs ", char *" addr ", unsigned int " size , |
209 | .BI " enum xdr_op " op ); | |
fea681da | 210 | .fi |
fea681da | 211 | .IP |
5b20a7a2 | 212 | This routine initializes the XDR stream object pointed to by |
fea681da MK |
213 | .IR xdrs . |
214 | The stream's data is written to, or read from, | |
215 | a chunk of memory at location | |
216 | .I addr | |
217 | whose length is no more than | |
218 | .I size | |
c13182ef MK |
219 | bytes long. |
220 | The | |
fea681da | 221 | .I op |
5b20a7a2 | 222 | determines the direction of the XDR stream (either |
066cb3d6 MK |
223 | .BR XDR_ENCODE , |
224 | .BR XDR_DECODE , | |
fea681da | 225 | or |
066cb3d6 | 226 | .BR XDR_FREE ). |
fea681da | 227 | .LP |
fea681da | 228 | .nf |
5b20a7a2 | 229 | .BI "bool_t xdr_opaque(XDR *" xdrs ", char *" cp ", unsigned int " cnt ); |
fea681da | 230 | .fi |
fea681da MK |
231 | .IP |
232 | A filter primitive that translates between fixed size opaque data | |
233 | and its external representation. | |
234 | The parameter | |
235 | .I cp | |
236 | is the address of the opaque object, and | |
237 | .I cnt | |
238 | is its size in bytes. | |
239 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 240 | .LP |
fea681da | 241 | .nf |
5b20a7a2 MK |
242 | .BI "bool_t xdr_pointer(XDR *" xdrs ", char **" objpp , |
243 | .BI " unsigned int " objsize ", xdrproc_t " xdrobj ); | |
fea681da | 244 | .fi |
fea681da MK |
245 | .IP |
246 | Like | |
63aa9df0 | 247 | .BR xdr_reference () |
5b20a7a2 | 248 | except that it serializes NULL pointers, whereas |
63aa9df0 | 249 | .BR xdr_reference () |
c13182ef MK |
250 | does not. |
251 | Thus, | |
63aa9df0 | 252 | .BR xdr_pointer () |
fea681da MK |
253 | can represent |
254 | recursive data structures, such as binary trees or | |
255 | linked lists. | |
fea681da | 256 | .LP |
fea681da | 257 | .nf |
5b20a7a2 MK |
258 | .BI "void xdrrec_create(XDR *" xdrs ", unsigned int " sendsize , |
259 | .BI " unsigned int " recvsize ", char *" handle , | |
260 | .BI " int (*" readit ") (char *, char *, int)," | |
261 | .BI " int (*" writeit ") (char *, char *, int));" | |
fea681da | 262 | .fi |
fea681da | 263 | .IP |
5b20a7a2 | 264 | This routine initializes the XDR stream object pointed to by |
fea681da MK |
265 | .IR xdrs . |
266 | The stream's data is written to a buffer of size | |
267 | .IR sendsize ; | |
5b20a7a2 | 268 | a value of zero indicates the system should use a suitable default. |
c13182ef | 269 | The stream's data is read from a buffer of size |
fea681da | 270 | .IR recvsize ; |
5b20a7a2 | 271 | it too can be set to a suitable default by passing a zero value. |
fea681da MK |
272 | When a stream's output buffer is full, |
273 | .I writeit | |
c13182ef MK |
274 | is called. |
275 | Similarly, when a stream's input buffer is empty, | |
fea681da | 276 | .I readit |
c13182ef MK |
277 | is called. |
278 | The behavior of these two routines is similar to | |
fb186734 MK |
279 | the system calls |
280 | .BR read (2) | |
fea681da | 281 | and |
fb186734 | 282 | .BR write (2), |
fea681da MK |
283 | except that |
284 | .I handle | |
285 | is passed to the former routines as the first parameter. | |
5b20a7a2 | 286 | Note: the XDR stream's |
fea681da MK |
287 | .I op |
288 | field must be set by the caller. | |
289 | .IP | |
5b20a7a2 | 290 | Warning: this XDR stream implements an intermediate record stream. |
fea681da MK |
291 | Therefore there are additional bytes in the stream |
292 | to provide record boundary information. | |
fea681da | 293 | .LP |
fea681da | 294 | .nf |
5b20a7a2 | 295 | .BI "bool_t xdrrec_endofrecord(XDR *" xdrs ", int " sendnow ); |
fea681da | 296 | .fi |
fea681da | 297 | .IP |
5b20a7a2 | 298 | This routine can be invoked only on streams created by |
63aa9df0 | 299 | .BR xdrrec_create (). |
5b20a7a2 | 300 | The data in the output buffer is marked as a completed record, |
fea681da MK |
301 | and the output buffer is optionally written out if |
302 | .I sendnow | |
eba72288 | 303 | is non-zero. |
c13182ef | 304 | This routine returns one if it succeeds, zero otherwise. |
fea681da | 305 | .LP |
fea681da | 306 | .nf |
5b20a7a2 | 307 | .BI "bool_t xdrrec_eof(XDR *" xdrs ); |
fea681da | 308 | .fi |
fea681da | 309 | .IP |
5b20a7a2 | 310 | This routine can be invoked only on streams created by |
63aa9df0 | 311 | .BR xdrrec_create (). |
fea681da MK |
312 | After consuming the rest of the current record in the stream, |
313 | this routine returns one if the stream has no more input, | |
314 | zero otherwise. | |
fea681da | 315 | .LP |
fea681da | 316 | .nf |
5b20a7a2 | 317 | .BI "bool_t xdrrec_skiprecord(XDR *" xdrs ); |
fea681da | 318 | .fi |
fea681da MK |
319 | .IP |
320 | This routine can be invoked only on | |
321 | streams created by | |
63aa9df0 | 322 | .BR xdrrec_create (). |
5b20a7a2 | 323 | It tells the XDR implementation that the rest of the current record |
fea681da MK |
324 | in the stream's input buffer should be discarded. |
325 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 326 | .LP |
fea681da | 327 | .nf |
5b20a7a2 MK |
328 | .BI "bool_t xdr_reference(XDR *" xdrs ", char **" pp ", unsigned int " size , |
329 | .BI " xdrproc_t " proc ); | |
fea681da | 330 | .fi |
fea681da MK |
331 | .IP |
332 | A primitive that provides pointer chasing within structures. | |
333 | The parameter | |
334 | .I pp | |
335 | is the address of the pointer; | |
336 | .I size | |
337 | is the | |
338 | .I sizeof | |
339 | the structure that | |
340 | .I *pp | |
341 | points to; and | |
342 | .I proc | |
5b20a7a2 | 343 | is an XDR procedure that filters the structure |
fea681da MK |
344 | between its C form and its external representation. |
345 | This routine returns one if it succeeds, zero otherwise. | |
346 | .IP | |
5b20a7a2 | 347 | Warning: this routine does not understand NULL pointers. |
c13182ef | 348 | Use |
63aa9df0 | 349 | .BR xdr_pointer () |
fea681da | 350 | instead. |
fea681da | 351 | .LP |
fea681da | 352 | .nf |
5b20a7a2 | 353 | .BI "xdr_setpos(XDR *" xdrs ", unsigned int " pos ); |
fea681da | 354 | .fi |
fea681da MK |
355 | .IP |
356 | A macro that invokes the set position routine associated with | |
5b20a7a2 | 357 | the XDR stream |
fea681da MK |
358 | .IR xdrs . |
359 | The parameter | |
360 | .I pos | |
361 | is a position value obtained from | |
63aa9df0 | 362 | .BR xdr_getpos (). |
5b20a7a2 | 363 | This routine returns one if the XDR stream could be repositioned, |
fea681da MK |
364 | and zero otherwise. |
365 | .IP | |
5b20a7a2 | 366 | Warning: it is difficult to reposition some types of XDR |
fea681da MK |
367 | streams, so this routine may fail with one |
368 | type of stream and succeed with another. | |
fea681da | 369 | .LP |
fea681da | 370 | .nf |
5b20a7a2 | 371 | .BI "bool_t xdr_short(XDR *" xdrs ", short *" sp ); |
fea681da | 372 | .fi |
fea681da MK |
373 | .IP |
374 | A filter primitive that translates between C | |
f19a0f03 | 375 | .I short |
fea681da MK |
376 | integers and their external representations. |
377 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 378 | .LP |
fea681da | 379 | .nf |
5b20a7a2 | 380 | .BI "void xdrstdio_create(XDR *" xdrs ", FILE *" file ", enum xdr_op " op ); |
fea681da | 381 | .fi |
fea681da | 382 | .IP |
5b20a7a2 | 383 | This routine initializes the XDR stream object pointed to by |
fea681da | 384 | .IR xdrs . |
5b20a7a2 | 385 | The XDR stream data is written to, or read from, the |
eee0a2ec | 386 | .I stdio |
fea681da MK |
387 | stream |
388 | .IR file . | |
389 | The parameter | |
390 | .I op | |
5b20a7a2 | 391 | determines the direction of the XDR stream (either |
066cb3d6 MK |
392 | .BR XDR_ENCODE , |
393 | .BR XDR_DECODE , | |
fea681da | 394 | or |
066cb3d6 | 395 | .BR XDR_FREE ). |
fea681da | 396 | .IP |
5b20a7a2 | 397 | Warning: the destroy routine associated with such XDR streams calls |
fb186734 | 398 | .BR fflush (3) |
fea681da MK |
399 | on the |
400 | .I file | |
401 | stream, but never | |
fb186734 | 402 | .BR fclose (3). |
fea681da | 403 | .LP |
fea681da | 404 | .nf |
5b20a7a2 | 405 | .BI "bool_t xdr_string(XDR *" xdrs ", char **" sp ", unsigned int " maxsize ); |
fea681da | 406 | .fi |
fea681da MK |
407 | .IP |
408 | A filter primitive that translates between C strings and | |
5b20a7a2 | 409 | their corresponding external representations. |
fea681da MK |
410 | Strings cannot be longer than |
411 | .IR maxsize . | |
c13182ef | 412 | Note: |
fea681da MK |
413 | .I sp |
414 | is the address of the string's pointer. | |
415 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 416 | .LP |
fea681da | 417 | .nf |
5b20a7a2 | 418 | .BI "bool_t xdr_u_char(XDR *" xdrs ", unsigned char *" ucp ); |
fea681da | 419 | .fi |
fea681da MK |
420 | .IP |
421 | A filter primitive that translates between | |
9ff08aad | 422 | .I unsigned |
fea681da MK |
423 | C characters and their external representations. |
424 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 425 | .LP |
fea681da | 426 | .nf |
5b20a7a2 | 427 | .BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up ); |
fea681da | 428 | .fi |
fea681da MK |
429 | .IP |
430 | A filter primitive that translates between C | |
9ff08aad | 431 | .I unsigned |
fea681da MK |
432 | integers and their external representations. |
433 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 434 | .LP |
fea681da | 435 | .nf |
5b20a7a2 | 436 | .BI "bool_t xdr_u_long(XDR *" xdrs ", unsigned long *" ulp ); |
fea681da | 437 | .fi |
fea681da MK |
438 | .IP |
439 | A filter primitive that translates between C | |
9ff08aad | 440 | .I "unsigned long" |
fea681da MK |
441 | integers and their external representations. |
442 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 443 | .LP |
fea681da | 444 | .nf |
5b20a7a2 | 445 | .BI "bool_t xdr_u_short(XDR *" xdrs ", unsigned short *" usp ); |
fea681da | 446 | .fi |
fea681da MK |
447 | .IP |
448 | A filter primitive that translates between C | |
9ff08aad | 449 | .I "unsigned short" |
fea681da MK |
450 | integers and their external representations. |
451 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 452 | .LP |
fea681da | 453 | .nf |
5b20a7a2 MK |
454 | .BI "bool_t xdr_union(XDR *" xdrs ", int *" dscmp ", char *" unp , |
455 | .BI " struct xdr_discrim *" choices , | |
456 | .BI " xdrproc_t " defaultarm "); /* may equal NULL */" | |
fea681da | 457 | .fi |
fea681da MK |
458 | .IP |
459 | A filter primitive that translates between a discriminated C | |
f19a0f03 | 460 | .I union |
c13182ef MK |
461 | and its corresponding external representation. |
462 | It first | |
fea681da MK |
463 | translates the discriminant of the union located at |
464 | .IR dscmp . | |
465 | This discriminant is always an | |
f19a0f03 | 466 | .IR enum_t . |
fea681da MK |
467 | Next the union located at |
468 | .I unp | |
c13182ef MK |
469 | is translated. |
470 | The parameter | |
fea681da MK |
471 | .I choices |
472 | is a pointer to an array of | |
63aa9df0 | 473 | .BR xdr_discrim () |
c13182ef MK |
474 | structures. |
475 | Each structure contains an ordered pair of | |
fea681da MK |
476 | .RI [ value , proc ]. |
477 | If the union's discriminant is equal to the associated | |
478 | .IR value , | |
479 | then the | |
480 | .I proc | |
c13182ef MK |
481 | is called to translate the union. |
482 | The end of the | |
63aa9df0 | 483 | .BR xdr_discrim () |
5b20a7a2 | 484 | structure array is denoted by a routine of value NULL. |
fea681da MK |
485 | If the discriminant is not found in the |
486 | .I choices | |
487 | array, then the | |
488 | .I defaultarm | |
5b20a7a2 | 489 | procedure is called (if it is not NULL). |
fea681da | 490 | Returns one if it succeeds, zero otherwise. |
fea681da | 491 | .LP |
fea681da | 492 | .nf |
5b20a7a2 MK |
493 | .BI "bool_t xdr_vector(XDR *" xdrs ", char *" arrp ", unsigned int " size , |
494 | .BI " unsigned int " elsize ", xdrproc_t " elproc ); | |
fea681da | 495 | .fi |
fea681da | 496 | .IP |
5b20a7a2 | 497 | A filter primitive that translates between fixed-length arrays |
c13182ef MK |
498 | and their corresponding external representations. |
499 | The parameter | |
fea681da MK |
500 | .I arrp |
501 | is the address of the pointer to the array, while | |
502 | .I size | |
c3c1773e | 503 | is the element count of the array. |
c13182ef | 504 | The parameter |
fea681da MK |
505 | .I elsize |
506 | is the | |
507 | .I sizeof | |
508 | each of the array's elements, and | |
509 | .I elproc | |
5b20a7a2 | 510 | is an XDR filter that translates between |
fea681da MK |
511 | the array elements' C form, and their external |
512 | representation. | |
513 | This routine returns one if it succeeds, zero otherwise. | |
fea681da | 514 | .LP |
fea681da | 515 | .nf |
5b20a7a2 | 516 | .BI "bool_t xdr_void(void);" |
fea681da | 517 | .fi |
fea681da MK |
518 | .IP |
519 | This routine always returns one. | |
5b20a7a2 | 520 | It may be passed to RPC routines that require a function parameter, |
fea681da | 521 | where nothing is to be done. |
fea681da | 522 | .LP |
fea681da | 523 | .nf |
5b20a7a2 | 524 | .BI "bool_t xdr_wrapstring(XDR *" xdrs ", char **" sp ); |
fea681da | 525 | .fi |
fea681da MK |
526 | .IP |
527 | A primitive that calls | |
066cb3d6 | 528 | .B "xdr_string(xdrs, sp,MAXUN.UNSIGNED );" |
fea681da | 529 | where |
d2d293ba | 530 | .B MAXUN.UNSIGNED |
fea681da | 531 | is the maximum value of an unsigned integer. |
63aa9df0 | 532 | .BR xdr_wrapstring () |
5b20a7a2 | 533 | is handy because the RPC package passes a maximum of two XDR |
fea681da | 534 | routines as parameters, and |
63aa9df0 | 535 | .BR xdr_string (), |
fea681da MK |
536 | one of the most frequently used primitives, requires three. |
537 | Returns one if it succeeds, zero otherwise. | |
538 | .SH "SEE ALSO" | |
539 | .BR rpc (3) | |
540 | .LP | |
541 | The following manuals: | |
542 | .RS | |
fea681da MK |
543 | eXternal Data Representation Standard: Protocol Specification |
544 | .br | |
545 | eXternal Data Representation: Sun Technical Notes | |
fea681da | 546 | .br |
066cb3d6 | 547 | .IR "XDR: External Data Representation Standard" , |
d2d293ba MK |
548 | RFC\ 1014, Sun Microsystems, Inc., |
549 | USC-ISI. | |
5d78bcdd | 550 | .RE |