OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / xdr.3
1 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
2 .\"
3 .\" @(#)xdr.3n  2.2 88/08/03 4.0 RPCSRC; from 1.16 88/03/14 SMI
4 .\"
5 .\" 2007-12-30, mtk, Convert function prototypes to modern C syntax
6 .\"
7 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
8 .\"         all rights reserved.
9 .\" Translated Tue Jan  4 20:48:51 JST 2000
10 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
11 .\"
12 .TH XDR 3 2007-12-30 "" "Linux Programmer's Manual"
13 .\"O .SH NAME
14 .SH Ì¾Á°
15 .\"O xdr \- library routines for external data representation
16 xdr \- ³°Éô¥Ç¡¼¥¿É½¸½(XDR)¤Î¤¿¤á¤Î¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Æ¥£¥ó
17 .\"O .SH SYNOPSIS AND DESCRIPTION
18 .SH ½ñ¼°¤ÈÀâÌÀ
19 .LP
20 .\"O These routines allow C programmers to describe
21 .\"O arbitrary data structures in a machine-independent fashion.
22 .\"O Data for remote procedure calls are transmitted using these
23 .\"O routines.
24 ¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤Ï C ¥×¥í¥°¥é¥Þ¡¼¤¬¥Þ¥·¥óÈó°Í¸¤Ê·Á¼°¤Ç
25 Ǥ°Õ¤Î¥Ç¡¼¥¿¹½Â¤ÂΤòµ­½Ò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£
26 ¥ê¥â¡¼¥È¡¦¥×¥í¥·¥¸¥ã¡¦¥³¡¼¥ë¤Î¤¿¤á¤Î¥Ç¡¼¥¿¤Ï¤³¤ì¤é¤Î¥ë¡¼¥Æ¥£¥ó¤ò
27 »ÈÍѤ·¤ÆÁ÷¿®¤µ¤ì¤ë¡£
28
29 .\"O The prototypes below are declared in
30 .\"O .I <rpc/xdr.h>
31 .\"O and make use of the following types:
32 °Ê²¼¤Ë¼¨¤¹¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï
33 .I <rpc/xdr.h>
34 ¤Ç¹Ô¤ï¤ì¤Æ¤ª¤ê¡¢¤½¤ÎÃæ¤Ç¤Ï¼¡¤Î·¿¤¬»ÈÍѤµ¤ì¤ë¡£
35 .in +4n
36 .nf
37
38 typedef int \fIbool_t\fP;
39
40 typedef bool_t (*\fIxdrproc_t\fP) (XDR *, void *,...);
41 .fi
42 .in
43 .LP
44 .\"O For the declaration of the
45 .\"O .I XDR
46 .\"O type, see
47 .\"O .IR <rpc/xdr.h> .
48 .I XDR
49 ·¿¤ÎÀë¸À¤Ë¤Ä¤¤¤Æ¤Ï¡¢
50 .I <rpc/xdr.h>
51 ¤ò»²¾È¡£
52 .LP
53 .nf
54 .BI "bool_t xdr_array(XDR *" xdrs ", char **" arrp ", unsigned int *" sizep ,
55 .BI "                 unsigned int " maxsize ", unsigned int " elsize ,
56 .BI "                 xdrproc_t " elproc );
57 .fi
58 .IP
59 .\"O A filter primitive that translates between variable-length arrays
60 .\"O and their corresponding external representations.
61 .\"O The argument
62 .\"O .I arrp
63 .\"O is the address of the pointer to the array, while
64 .\"O .I sizep
65 .\"O is the address of the element count of the array;
66 .\"O this element count cannot exceed
67 .\"O .IR maxsize .
68 ²ÄÊÑŤÎÇÛÎó¤È¤½¤ì¤ËÂбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
69 °ú¤­¿ô
70 .I arrp
71 ¤ÏÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê¡¢
72 .I sizep
73 ¤ÏÇÛÎó¤ÎÍ×ÁÇ¿ô¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£
74 ¤³¤ì¤é¤ÎÍ×ÁÇ¿ô¤Ï
75 .I maxsize
76 ¤òĶ¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
77 .\"O The argument
78 .\"O .I elsize
79 .\"O is the
80 .\"O .I sizeof
81 .\"O each of the array's elements, and
82 .\"O .I elproc
83 .\"O is an XDR filter that translates between
84 .\"O the array elements' C form, and their external
85 .\"O representation.
86 .\"O This routine returns one if it succeeds, zero otherwise.
87 °ú¤­¿ô
88 .I elsize
89 ¤Ï³ÆÇÛÎó¤ÎÍ×ÁǤÎ
90 .I sizeof
91 ¤Ç¤¢¤ê¡¢
92 .I elproc
93 ¤ÏÇÛÎóÍ×ÁǤò C ·Á¼°¤«¤é¤½¤Î³°Éôɽ¸½¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Î XDR ¥Õ¥£¥ë¥¿¡¼¤Ç¤¢¤ë¡£
94 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£
95 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£
96 .LP
97 .nf
98 .BI "bool_t xdr_bool(XDR *" xdrs ", bool_t *" bp );
99 .fi
100 .IP
101 .\"O A filter primitive that translates between booleans (C
102 .\"O integers)
103 .\"O and their external representations.
104 .\"O When encoding data, this
105 .\"O filter produces values of either one or zero.
106 .\"O This routine returns one if it succeeds, zero otherwise.
107 ¿¿µ¶ÃÍ(C ¤Î int)¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
108 ¥Ç¡¼¥¿¤ò¥¨¥ó¥³¡¼¥É¤¹¤ë»þ¡¢¤³¤Î¥Õ¥£¥ë¥¿¡¼¤Ï 1 ¤Þ¤¿ 0 ¤ÎÃͤòÀ¸À®¤¹¤ë¡£
109 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£
110 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£
111 .LP
112 .nf
113 .BI "bool_t xdr_bytes(XDR *" xdrs ", char **" sp ", unsigned int *" sizep ,
114 .BI "                 unsigned int " maxsize );
115 .fi
116 .IP
117 .\"O A filter primitive that translates between counted byte
118 .\"O strings and their external representations.
119 .\"O The argument
120 .\"O .I sp
121 .\"O is the address of the string pointer.
122 .\"O The length of the
123 .\"O string is located at address
124 .\"O .IR sizep ;
125 .\"O strings cannot be longer than
126 .\"O .IR maxsize .
127 .\"O This routine returns one if it succeeds, zero otherwise.
128 ¤¢¤ëŤµ¤Î¥Ð¥¤¥Èʸ»úÎó¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
129 °ú¤­¿ô
130 .I sp
131 ¤Ïʸ»úÎó¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£Ê¸»úÎó¤ÎŤµ¤Ï
132 .I sizep
133 ¤Î¥¢¥É¥ì¥¹¤ËÃÖ¤¯¡£Ê¸»úÎó¤Ï
134 .I maxsize
135 ¤è¤êŤ¯¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
136 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£
137 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£
138 .LP
139 .nf
140 .BI "bool_t xdr_char(XDR *" xdrs ", char *" cp );
141 .fi
142 .IP
143 .\"O A filter primitive that translates between C characters
144 .\"O and their external representations.
145 .\"O This routine returns one if it succeeds, zero otherwise.
146 .\"O Note: encoded characters are not packed, and occupy 4 bytes each.
147 .\"O For arrays of characters, it is worthwhile to
148 .\"O consider
149 .\"O .BR xdr_bytes (),
150 .\"O .BR xdr_opaque ()
151 .\"O or
152 .\"O .BR xdr_string ().
153 C ¤Îʸ»ú(char)¤È¤½¤Î³°Éôɽ¸½¤È¤Î´Ö¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
154 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£
155 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¤Ï 0 ¤òÊÖ¤¹¡£
156 Ãí°Õ: ¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ç¡¼¥¿¤ÏµÍ¤á¹þ¤Þ¤ì¤Æ¤ª¤é¤º¡¢¤½¤ì¤¾¤ì 4 ¥Ð¥¤¥È¤ò
157 Àê¤á¤ë¡£Ê¸»ú¤ÎÇÛÎó¤Î¾ì¹ç¤Ë¤Ï
158 .BR xdr_bytes (),
159 .BR xdr_opaque (),
160 .BR xdr_string ()
161 ¤Ê¤É¤ò¹Íθ¤·¤¿Êý¤¬Îɤ¤¡£
162 .LP
163 .nf
164 .BI "void xdr_destroy(XDR *" xdrs );
165 .fi
166 .IP
167 .\"O A macro that invokes the destroy routine associated with the XDR stream,
168 .\"O .IR xdrs .
169 .\"O Destruction usually involves freeing private data structures
170 .\"O associated with the stream.
171 .\"O Using
172 .\"O .I xdrs
173 .\"O after invoking
174 .\"O .BR xdr_destroy ()
175 .\"O is undefined.
176 ¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à
177 .I xdrs
178 ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç˲õ¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£
179 Ç˲õ¤Ë¤ÏÄ̾¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿»äŪ¥Ç¡¼¥¿¹½Â¤ÂΤβòÊü¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£
180 .BR xdr_destroy ()
181 ¤Î¸Æ¤Ó½Ð¤·¤Î¸å¤Ë
182 .I xdrs
183 ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£
184 .LP
185 .nf
186 .BI "bool_t xdr_double(XDR *" xdrs ", double *" dp );
187 .fi
188 .IP
189 .\"O A filter primitive that translates between C
190 .\"O .I double
191 .\"O precision numbers and their external representations.
192 .\"O This routine returns one if it succeeds, zero otherwise.
193 C ¤Î
194 .I ÇÜÀºÅÙ¿ô (double)
195 ¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
196 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
197 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
198 .LP
199 .nf
200 .BI "bool_t xdr_enum(XDR *" xdrs ", enum_t *" ep );
201 .fi
202 .IP
203 .\"O A filter primitive that translates between C
204 .\"O .IR enum s
205 .\"O (actually integers) and their external representations.
206 .\"O This routine returns one if it succeeds, zero otherwise.
207 C ¤Î
208 .I enum
209 (¼ÂºÝ¤Ë¤Ï int)¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
210 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
211 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
212 .LP
213 .nf
214 .BI "bool_t xdr_float(XDR *" xdrs ", float *" fp );
215 .fi
216 .IP
217 .\"O A filter primitive that translates between C
218 .\"O .IR float s
219 .\"O and their external representations.
220 .\"O This routine returns one if it succeeds, zero otherwise.
221 C ¤Î
222 .IR "ÉâÆ°¾®¿ôÅÀ¿ô (float)"
223 ¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
224 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
225 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
226 .LP
227 .nf
228 .BI "void xdr_free(xdrproc_t " proc ", char *" objp );
229 .fi
230 .IP
231 .\"O Generic freeing routine.
232 .\"O The first argument is the XDR routine for the object being freed.
233 .\"O The second argument is a pointer to the object itself.
234 .\"O Note: the pointer passed to this routine is
235 .\"O .I not
236 .\"O freed, but what it points to
237 .\"O .I is
238 .\"O freed (recursively).
239 ÈÆÍѲòÊü(free)¥ë¡¼¥Æ¥£¥ó¡£ºÇ½é¤Î°ú¤­¿ô¤Ï¥ª¥Ö¥¸¥§¥¯¥È¤ò²òÊü¤¹¤ë¤¿¤á¤Î
240 XDR ¥ë¡¼¥Æ¥£¥ó¤Ç¤¢¤ë¡£ÆóÈÖÌܤΰú¤­¿ô¤Ï¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¼«¿È¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼
241 ¤Ç¤¢¤ë¡£Ãí°Õ: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ËÅϤµ¤ì¤ë¥Ý¥¤¥ó¥¿¡¼¤Ï
242 .I ²òÊü¤µ¤ì¤Ê¤¤
243 ¤¬¡¢¤³¤Î¥Ý¥¤¥ó¥¿¡¼¤Î»Ø¤¹¥Ç¡¼¥¿¤Ï(ºÆµ¢Åª¤Ë)
244 .IR ²òÊü¤µ¤ì¤ë ¡£
245 .LP
246 .nf
247 .BI "unsigned int xdr_getpos(XDR *" xdrs );
248 .fi
249 .IP
250 .\"O A macro that invokes the get-position routine
251 .\"O associated with the XDR stream,
252 .\"O .IR xdrs .
253 .\"O The routine returns an unsigned integer,
254 .\"O which indicates the position of the XDR byte stream.
255 .\"O A desirable feature of .SM XDR
256 .\"O streams is that simple arithmetic works with this number,
257 .\"O although the XDR stream instances need not guarantee this.
258 ¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à
259 .I xdrs
260 ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿°ÌÃÖ¼èÆÀ¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£
261 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï XDR ¥Ð¥¤¥È¡¦¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ò»Ø¼¨¤¹¤ëÉä¹æ̵¤·À°¿ô¤òÊÖ¤¹¡£
262 XDR ¥¹¥È¥ê¡¼¥à¤Îµ¡Ç½¤È¤·¤Æ¤³¤Î¿ôÃͤÇñ½ã¤Ê»»½Ñºî¶È¤¬¤Ç¤­¤ë¤³¤È¤¬
263 ´üÂÔ¤µ¤ì¤Æ¤ë¤¤¤ë¡£¤·¤«¤·¤Ê¤¬¤é
264 XDR ¥¹¥È¥ê¡¼¥à¤Î¼ÂÂΤϤ³¤ì¤òÊݾڤ¹¤ëɬÍפϤʤ¤¡£
265 .LP
266 .nf
267 .BI "long *xdr_inline(XDR *" xdrs ", int " len );
268 .fi
269 .IP
270 .\"O A macro that invokes the inline routine associated with the XDR stream,
271 .\"O .IR xdrs .
272 .\"O The routine returns a pointer
273 .\"O to a contiguous piece of the stream's buffer;
274 .\"O .I len
275 .\"O is the byte length of the desired buffer.
276 .\"O Note: pointer is cast to
277 .\"O .IR "long *" .
278 ¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à
279 .I xdrs
280 ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿ÆâÉô(inline)¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£
281 ¥ë¡¼¥Æ¥£¥ó¤Ï¥¹¥È¥ê¡¼¥à¤Î¥Ð¥Ã¥Õ¥¡¡¼¤ÎϢ³¤¹¤ëÃÇÊҤؤΥݥ¤¥ó¥¿¡¼¤òÊÖ¤¹¡£
282 .I len
283 ¤ÏÍ׵᤹¤ë¥Ð¥Ã¥Õ¥¡¡¼¤Î¥Ð¥¤¥ÈŤǤ¢¤ë¡£
284 Ãí°Õ: ¥Ý¥¤¥ó¥¿¡¼¤Ï
285 .I "long *"
286 ¤Ë¥­¥ã¥¹¥È¤µ¤ì¤ë¡£
287 .IP
288 .\"O Warning:
289 .\"O .BR xdr_inline ()
290 .\"O may return NULL (0)
291 .\"O if it cannot allocate a contiguous piece of a buffer.
292 .\"O Therefore the behavior may vary among stream instances;
293 .\"O it exists for the sake of efficiency.
294 ·Ù¹ð:
295 .BR xdr_inline ()
296 ¤Ï¥Ð¥Ã¥Õ¥¡¡¼¤ÎϢ³¤¹¤ëÃÇÊÒ¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï
297 NULL (0)¤òÊÖ¤¹¤«¤â¤·¤ì¤Ê¤¤¡£
298 ¤É¤Î¾ì¹ç¤â¤½¤ÎÆ°ºî¤Ï¥¹¥È¥ê¡¼¥à¤Î¼ÂÂΤˤè¤Ã¤ÆÊѲ½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
299 ¤³¤ì¤Ï¸úΨ²½¤Î¤¿¤á¤Ë¸ºß¤·¤Æ¤¤¤ë¡£
300 .LP
301 .nf
302 .BI "bool_t xdr_int(XDR *" xdrs ", int *" ip );
303 .fi
304 .IP
305 .\"O A filter primitive that translates between C integers
306 .\"O and their external representations.
307 .\"O This routine returns one if it succeeds, zero otherwise.
308 C ¤ÎÀ°¿ô(int)¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
309 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
310 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
311 .LP
312 .nf
313 .BI "bool_t xdr_long(XDR *" xdrs ", long *" lp );
314 .fi
315 .IP
316 .\"O A filter primitive that translates between C
317 .\"O .I long
318 .\"O integers and their external representations.
319 .\"O This routine returns one if it succeeds, zero otherwise.
320 C ¤Î
321 .I long
322 À°¿ô¤È¤½¤Î¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
323 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
324 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
325 .LP
326 .nf
327 .BI "void xdrmem_create(XDR *" xdrs ", char *" addr ", unsigned int " size ,
328 .BI "                   enum xdr_op " op );
329 .fi
330 .IP
331 .\"O This routine initializes the XDR stream object pointed to by
332 .\"O .IR xdrs .
333 .\"O The stream's data is written to, or read from,
334 .\"O a chunk of memory at location
335 .\"O .I addr
336 .\"O whose length is no more than
337 .\"O .I size
338 .\"O bytes long.
339 .\"O The
340 .\"O .I op
341 .\"O determines the direction of the XDR stream (either
342 .\"O .BR XDR_ENCODE ,
343 .\"O .BR XDR_DECODE ,
344 .\"O or
345 .\"O .BR XDR_FREE ).
346 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï
347 .I xdrs
348 ¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤Æ¤¤¤ë XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£
349 ¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤Ï
350 .I addr
351 °ÌÃ֤ˤ¢¤ë¥á¥â¥ê¡¼¤Î²ô¤«¤éÆɤ߽ñ¤­¤µ¤ì¤ë¡£
352 ¤½¤ÎŤµ¤Ï¥Ð¥¤¥Èñ°Ì¤Ç
353 .I size
354 Ķ¤¨¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
355 .I op
356 ¤Ï XDR ¥¹¥È¥ê¡¼¥à¤ÎÊÑ´¹Êý¸þ¤ò·èÄꤹ¤ë
357 .RB ( XDR_ENCODE ,
358 .BR XDR_DECODE ,
359 .B XDR_FREE
360 ¤Î¤É¤ì¤«)¡£
361 .LP
362 .nf
363 .BI "bool_t xdr_opaque(XDR *" xdrs ", char *" cp ", unsigned int " cnt );
364 .fi
365 .IP
366 .\"O A filter primitive that translates between fixed size opaque data
367 .\"O and its external representation.
368 .\"O The argument
369 .\"O .I cp
370 .\"O is the address of the opaque object, and
371 .\"O .I cnt
372 .\"O is its size in bytes.
373 .\"O This routine returns one if it succeeds, zero otherwise.
374 ¸ÇÄêŤÎÉÔÌÀ¥Ç¡¼¥¿¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
375 °ú¤­¿ô
376 .I cp
377 ¤ÏÉÔÌÀ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ê
378 .I cnt
379 ¤Ï¤½¤Î¥Ð¥¤¥Èñ°Ì¤ÎÂ礭¤µ¤Ç¤¢¤ë¡£
380 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
381 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
382 .LP
383 .nf
384 .BI "bool_t xdr_pointer(XDR *" xdrs ", char **" objpp ,
385 .BI "                   unsigned int " objsize ", xdrproc_t " xdrobj );
386 .fi
387 .IP
388 .\"O Like
389 .\"O .BR xdr_reference ()
390 .\"O except that it serializes NULL pointers, whereas
391 .\"O .BR xdr_reference ()
392 .\"O does not.
393 .\"O Thus,
394 .\"O .BR xdr_pointer ()
395 .\"O can represent
396 .\"O recursive data structures, such as binary trees or
397 .\"O linked lists.
398 .BR xdr_reference ()
399 ¤ÈƱÍͤǤ¢¤ë¤¬¡¢¤³¤ì¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤òÈֹ沽¤¹¤ë¤Î¤ËÂФ·¤Æ
400 .BR xdr_reference ()
401 ¤Ï¤½¤¦¤·¤Ê¤¤ÅÀ¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢
402 .BR xdr_pointer ()
403 ¤ÏÆóʬÌÚ¤äÏ¢·ë¥ê¥¹¥È¤Î¤è¤¦¤ÊºÆµ¢Åª¤Ê¥Ç¡¼¥¿¹½Â¤ÂΤò
404 ɽ¸½¤Ç¤­¤ë¡£
405 .LP
406 .nf
407 .BI "void xdrrec_create(XDR *" xdrs ", unsigned int " sendsize ,
408 .BI "                   unsigned int " recvsize ", char *" handle ,
409 .BI "                   int (*" readit ") (char *, char *, int),"
410 .BI "                   int (*" writeit ") (char *, char *, int));"
411 .fi
412 .IP
413 .\"O This routine initializes the XDR stream object pointed to by
414 .\"O .IR xdrs .
415 .\"O The stream's data is written to a buffer of size
416 .\"O .IR sendsize ;
417 .\"O a value of zero indicates the system should use a suitable default.
418 .\"O The stream's data is read from a buffer of size
419 .\"O .IR recvsize ;
420 .\"O it too can be set to a suitable default by passing a zero value.
421 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï
422 .I xdrs
423 ¤Ç»Ø¤µ¤ì¤¿ XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£
424 ¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤ÏÂ礭¤µ
425 .I sendsize
426 ¤Î¥Ð¥Ã¥Õ¥¡¤Ø½ñ¤­¹þ¤Þ¤ì¤ë¡£
427 .I sendsize
428 ¤ò¥¼¥í¤Ë¤¹¤ë¤È¡¢¥·¥¹¥Æ¥à¤ËŬÀڤʥǥե©¥ë¥È¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤¹¤ë¡£
429 ¥¹¥È¥ê¡¼¥à¤Î¥Ç¡¼¥¿¤ÏÂ礭¤µ
430 .I recvsize
431 ¤Î¥Ð¥Ã¥Õ¥¡¤«¤éÆɤ߹þ¤Þ¤ì¤ë¡£¤³¤ì¤â¥¼¥í¤òÅϤ¹¤³¤È¤ÇŬÀڤʥǥե©¥ë¥È¤Ë
432 ÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
433 .\"O When a stream's output buffer is full,
434 .\"O .I writeit
435 .\"O is called.
436 .\"O Similarly, when a stream's input buffer is empty,
437 .\"O .I readit
438 .\"O is called.
439 .\"O The behavior of these two routines is similar to
440 .\"O the system calls
441 .\"O .BR read (2)
442 .\"O and
443 .\"O .BR write (2),
444 .\"O except that
445 .\"O .I handle
446 .\"O is passed to the former routines as the first argument.
447 ¥¹¥È¥ê¡¼¥à¤Î½ÐÎϥХåե¡¤¬°ìÇդξì¹ç¤Ï
448 .I writeit
449 ¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£Æ±Íͤ˥¹¥È¥ê¡¼¥àÆþÎϥХåե¡¤¬¶õ¤Î¾ì¹ç¤Ë¤Ï
450 .I readit
451 ¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£¤³¤ì¤é¤ÎÆó¤Ä¤Î¥ë¡¼¥Æ¥£¥ó¤ÎÆ°ºî¤Ï¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î
452 .BR read (2)
453 ¤ä
454 .BR write (2)
455 ¤È»÷¤Æ¤¤¤ë¤¬¡¢Á°¼Ô¤Î¥ë¡¼¥Æ¥£¥ó¤ÏºÇ½é¤Î°ú¤­¿ô¤È¤·¤Æ
456 .I handle
457 ¤¬ÅϤµ¤ì¤ëÅÀ¤Ç°Û¤Ê¤Ã¤Æ¤¤¤ë¡£
458 .\"O Note: the XDR stream's
459 .\"O .I op
460 .\"O field must be set by the caller.
461 Ãí°Õ: XDR ¥¹¥È¥ê¡¼¥à¤Î
462 .I op
463 ¤Ï¸Æ¤Ó½Ð¤·Â¦¤ÇÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
464 .IP
465 .\"O Warning: this XDR stream implements an intermediate record stream.
466 .\"O Therefore there are additional bytes in the stream
467 .\"O to provide record boundary information.
468 ·Ù¹ð: ¤³¤Î XDR ¥¹¥È¥ê¡¼¥à¤ÏÃæ´Ö¥ì¥³¡¼¥É¡¦¥¹¥È¥ê¡¼¥à¤ò¼ÂÁõ¤·¤Æ¤¤¤ë¡£
469 ¥ì¥³¡¼¥É¶­³¦¤Î¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë¥¹¥È¥ê¡¼¥à¤Ë¤Ï;ʬ¤Ê¥Ð¥¤¥È¤¬Â¸ºß¤¹¤ë¡£
470 .LP
471 .nf
472 .BI "bool_t xdrrec_endofrecord(XDR *" xdrs ", int " sendnow );
473 .fi
474 .IP
475 .\"O This routine can be invoked only on streams created by
476 .\"O .BR xdrrec_create ().
477 .\"O The data in the output buffer is marked as a completed record,
478 .\"O and the output buffer is optionally written out if
479 .\"O .I sendnow
480 .\"O is nonzero.
481 .\"O This routine returns one if it succeeds, zero otherwise.
482 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï
483 .BR xdrrec_create ()
484 ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
485 ½ÐÎϥХåե¡¤Î¥Ç¡¼¥¿¤Ï´°Á´¤Ê¥ì¥³¡¼¥É¤È¤·¤Æ°õ¤µ¤ì¡¢
486 .I sendnow
487 ¤¬¥¼¥í¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï½ÐÎϥХåե¡¤Ï½ñ¤­½Ð¤µ¤ì¤ë¡£
488 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
489 .LP
490 .nf
491 .BI "bool_t xdrrec_eof(XDR *" xdrs );
492 .fi
493 .IP
494 .\"O This routine can be invoked only on streams created by
495 .\"O .BR xdrrec_create ().
496 .\"O After consuming the rest of the current record in the stream,
497 .\"O this routine returns one if the stream has no more input,
498 .\"O zero otherwise.
499 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï
500 .BR xdrrec_create ()
501 ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
502 ¥¹¥È¥ê¡¼¥à¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Î»Ä¤ê¤ò¾ÃÈñ¤·¤¿¸å¤Ë¡¢
503 ¥¹¥È¥ê¡¼¥à¤ËÆþÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£
504 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
505 .LP
506 .nf
507 .BI "bool_t xdrrec_skiprecord(XDR *" xdrs );
508 .fi
509 .IP
510 .\"O This routine can be invoked only on
511 .\"O streams created by
512 .\"O .BR xdrrec_create ().
513 .\"O It tells the XDR implementation that the rest of the current record
514 .\"O in the stream's input buffer should be discarded.
515 .\"O This routine returns one if it succeeds, zero otherwise.
516 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï
517 .BR xdrrec_create ()
518 ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ¤Î¤ß¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
519 XDR ¤Î¼ÂÁõ¤Ë¤½¤Î¥¹¥È¥ê¡¼¥à¤ÎÆþÎϥХåե¡¡¼¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Î»Ä¤ê¤ò
520 ¼Î¤Æ¤ë¤è¤¦¤ËÅÁ¤¨¤ë¡£¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
521 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
522 .LP
523 .nf
524 .BI "bool_t xdr_reference(XDR *" xdrs ", char **" pp ", unsigned int " size ,
525 .BI "                     xdrproc_t " proc );
526 .fi
527 .IP
528 .\"O A primitive that provides pointer chasing within structures.
529 .\"O The argument
530 .\"O .I pp
531 .\"O is the address of the pointer;
532 .\"O .I size
533 .\"O is the
534 .\"O .I sizeof
535 .\"O the structure that
536 .\"O .I *pp
537 .\"O points to; and
538 .\"O .I proc
539 .\"O is an XDR procedure that filters the structure
540 .\"O between its C form and its external representation.
541 .\"O This routine returns one if it succeeds, zero otherwise.
542 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¡¼ÄÉÀפòÄ󶡤¹¤ë´ðËܥ롼¥Æ¥£¥ó¡£
543 °ú¤­¿ô
544 .I pp
545 ¤Ï¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£
546 .I size
547 ¤Ï
548 .I *pp
549 ¤¬»Ø¤·¤Æ¤¤¤ë¹½Â¤ÂΤÎ
550 .I sizeof
551 ¤Ç¤¢¤ë¡£
552 .I proc
553 ¤Ï¤½¤Î¹½Â¤ÂΤΠC ·Á¼°¤È³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦ XDR ¥×¥í¥·¥¸¥ã¤Ç¤¢¤ë¡£
554 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤òÊÖ¤¹¡£
555 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
556 .IP
557 .\"O Warning: this routine does not understand NULL pointers.
558 .\"O Use
559 .\"O .BR xdr_pointer ()
560 .\"O instead.
561 ·Ù¹ð: ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï NULL ¥Ý¥¤¥ó¥¿¡¼¤òÍý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£¤«¤ï¤ê¤Ë
562 .BR xdr_pointer ()
563 ¤ò»ÈÍѤ¹¤ë¤³¤È¡£
564 .LP
565 .nf
566 .BI "xdr_setpos(XDR *" xdrs ", unsigned int " pos );
567 .fi
568 .IP
569 .\"O A macro that invokes the set position routine associated with
570 .\"O the XDR stream
571 .\"O .IR xdrs .
572 .\"O The argument
573 .\"O .I pos
574 .\"O is a position value obtained from
575 .\"O .BR xdr_getpos ().
576 .\"O This routine returns one if the XDR stream could be repositioned,
577 .\"O and zero otherwise.
578 ¤³¤Î¥Þ¥¯¥í¤Ï XDR ¥¹¥È¥ê¡¼¥à
579 .I xdrs
580 ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿°ÌÃÖÀßÄê¥ë¡¼¥Æ¥£¥ó¤ò¸Æ¤Ó½Ð¤¹¡£°ú¤­¿ô
581 .I pos
582 ¤Ï
583 .BR xdr_getpos ()
584 ¤Ë¤è¤Ã¤Æ¼èÆÀ¤µ¤ì¤ë°ÌÃÖ¿ôÃͤǤ¢¤ë¡£
585 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï XDR ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤ÎÊѹ¹¤¬¤Ç¤­¤¿¾ì¹ç¤Ë¤Ï 1 ¤òÊÖ¤¹¡£
586 ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 ¤òÊÖ¤¹¡£
587 .IP
588 .\"O Warning: it is difficult to reposition some types of XDR
589 .\"O streams, so this routine may fail with one
590 .\"O type of stream and succeed with another.
591 ·Ù¹ð: ¤¢¤ë¼ï¤Î XDR ¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¤Ï°ÌÃÖ¤ÎÊѹ¹¤ò¹Ô¤Ê¤¦¤³¤È¤¬º¤Æñ¤Ç¤¢¤ë¡£
592 ¤½¤ì¤Ç¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¤¢¤ë¼ï¤Î¥¹¥È¥ê¡¼¥à¤Î¾ì¹ç¤Ë¤ÏÀ®¸ù¤·¡¢Ê̤μïÎà¤Î
593 ¾ì¹ç¤Ë¤Ï¼ºÇÔ¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
594 .LP
595 .nf
596 .BI "bool_t xdr_short(XDR *" xdrs ", short *" sp );
597 .fi
598 .IP
599 .\"O A filter primitive that translates between C
600 .\"O .I short
601 .\"O integers and their external representations.
602 .\"O This routine returns one if it succeeds, zero otherwise.
603 C ¤Î
604 .I short
605 À°¿ô¤È¤½¤Î³°Éôɽ¸½¤È¤ÎÊÑ´¹¤ò¹Ô¤Ê¤¦´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
606 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤¹¤ë¤È 1 ¤òÊÖ¤¹¡£
607 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
608 .LP
609 .nf
610 .BI "void xdrstdio_create(XDR *" xdrs ", FILE *" file ", enum xdr_op " op );
611 .fi
612 .IP
613 .\"O This routine initializes the XDR stream object pointed to by
614 .\"O .IR xdrs .
615 .\"O The XDR stream data is written to, or read from, the
616 .\"O .I stdio
617 .\"O stream
618 .\"O .IR file .
619 .\"O The argument
620 .\"O .I op
621 .\"O determines the direction of the XDR stream (either
622 .\"O .BR XDR_ENCODE ,
623 .\"O .BR XDR_DECODE ,
624 .\"O or
625 .\"O .BR XDR_FREE ).
626 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï
627 .I xdrs
628 ¤Ç»Ø¤µ¤ì¤¿ XDR ¥¹¥È¥ê¡¼¥à¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤¹¤ë¡£
629 XDR ¥¹¥È¥ê¡¼¥à¤ËÆɤ߽ñ¤­¤ì¤¿¥Ç¡¼¥¿¤Ï
630 .I stdio
631 ¥¹¥È¥ê¡¼¥à
632 .I file
633 ¤¬»ÈÍѤµ¤ì¤ë¡£
634 .I op
635 °ú¤­¿ô¤Ï XDR ¥¹¥È¥ê¡¼¥à¤ÎÊÑ´¹Êý¸þ¤ò·èÄꤹ¤ë
636 .RB ( XDR_ENCODE ,
637 .BR XDR_DECODE ,
638 .B XDR_FREE
639 ¤Î¤É¤ì¤«)¡£
640 .IP
641 .\"O Warning: the destroy routine associated with such XDR streams calls
642 .\"O .BR fflush (3)
643 .\"O on the
644 .\"O .I file
645 .\"O stream, but never
646 .\"O .BR fclose (3).
647 ·Ù¹ð: ¤³¤Î¤è¤¦¤Ê XDR ¥¹¥È¥ê¡¼¥à¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿Ç˲õ¥ë¡¼¥Æ¥£¥ó¤Ï
648 .I file
649 ¥¹¥È¥ê¡¼¥à¤ËÂФ·¤Æ
650 .BR fflush (3)
651 ¤ò¸Æ¤Ó½Ð¤¹¤¬
652 .BR fclose (3)
653 ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ï¤Ê¤¤¡£
654 .LP
655 .nf
656 .BI "bool_t xdr_string(XDR *" xdrs ", char **" sp ", unsigned int " maxsize );
657 .fi
658 .IP
659 .\"O A filter primitive that translates between C strings and
660 .\"O their corresponding external representations.
661 .\"O Strings cannot be longer than
662 .\"O .IR maxsize .
663 .\"O Note:
664 .\"O .I sp
665 .\"O is the address of the string's pointer.
666 .\"O This routine returns one if it succeeds, zero otherwise.
667 C ¤Îʸ»úÎó¤È¤½¤ì¤ËÂбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
668 ʸ»úÎó¤Ï
669 .I maxsize
670 ¤è¤êŤ¯¤Ï¤Ç¤­¤Ê¤¤¡£
671 Ãí°Õ:
672 .I sp
673 ¤Ïʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£
674 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
675 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
676 .LP
677 .nf
678 .BI "bool_t xdr_u_char(XDR *" xdrs ", unsigned char *" ucp );
679 .fi
680 .IP
681 .\"O A filter primitive that translates between
682 .\"O .I unsigned
683 .\"O C characters and their external representations.
684 .\"O This routine returns one if it succeeds, zero otherwise.
685 C ¤Î
686 .I Éä¹æ̵¤·Ê¸»ú (unsigned char)
687 ¤È¤½¤Î³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
688 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
689 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
690 .LP
691 .nf
692 .BI "bool_t xdr_u_int(XDR *" xdrs ", unsigned *" up );
693 .fi
694 .IP
695 .\"O A filter primitive that translates between C
696 .\"O .I unsigned
697 .\"O integers and their external representations.
698 .\"O This routine returns one if it succeeds, zero otherwise.
699 C ¤Î
700 .I Éä¹æ̵¤·À°¿ô (unsigned)
701 ¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
702 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
703 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
704 .LP
705 .nf
706 .BI "bool_t xdr_u_long(XDR *" xdrs ", unsigned long *" ulp );
707 .fi
708 .IP
709 .\"O A filter primitive that translates between C
710 .\"O .I "unsigned long"
711 .\"O integers and their external representations.
712 .\"O This routine returns one if it succeeds, zero otherwise.
713 C ¤Î
714 .I "unsigned long"
715 À°¿ô¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
716 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
717 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
718 .LP
719 .nf
720 .BI "bool_t xdr_u_short(XDR *" xdrs ", unsigned short *" usp );
721 .fi
722 .IP
723 .\"O A filter primitive that translates between C
724 .\"O .I "unsigned short"
725 .\"O integers and their external representations.
726 .\"O This routine returns one if it succeeds, zero otherwise.
727 C ¤Î
728 .I "unsigned short"
729 À°¿ô¤È¤½¤Î³°Éôɽ¸½¤òÊÑ´¹¤¹¤ë¤¿¤á¤Î´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
730 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£
731 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
732 .LP
733 .nf
734 .BI "bool_t xdr_union(XDR *" xdrs ", int *" dscmp ", char *" unp ,
735 .BI "                 struct xdr_discrim *" choices ,
736 .BI "                 xdrproc_t " defaultarm ");     /* may equal NULL */"
737 .fi
738 .IP
739 .\"O A filter primitive that translates between a discriminated C
740 .\"O .I union
741 .\"O and its corresponding external representation.
742 .\"O It first
743 .\"O translates the discriminant of the union located at
744 .\"O .IR dscmp .
745 ʬÊ̲Äǽ¤Ê C ¤Î
746 .I "¶¦ÍÑÂΠ(union)"
747 ¤È¤½¤Î³°Éô·Á¼°¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
748 ºÇ½é¤Ë
749 .I dscmp
750 ¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿¶¦ÍÑÂΤÎʬÊÌÍ×ÁǤ¬ÊÑ´¹¤µ¤ì¤ë¡£
751 .\"O This discriminant is always an
752 .\"O .IR enum_t .
753 ¤³¤ÎʬÊÌÍ×ÁǤϾï¤Ë
754 .I enum_t
755 ¤Ç¤¢¤ë¡£
756 .\"O Next the union located at
757 .\"O .I unp
758 .\"O is translated.
759 .\"O The argument
760 .\"O .I choices
761 .\"O is a pointer to an array of
762 .\"O .BR xdr_discrim ()
763 .\"O structures.
764 .\"O Each structure contains an ordered pair of
765 .\"O .RI [ value , proc ].
766 ¼¡¤Ë
767 .I unp
768 ¤Î°ÌÃ֤ζ¦ÍÑÂΤ¬ÊÑ´¹¤µ¤ì¤ë¡£°ú¤­¿ô
769 .I choices
770 ¤Ï
771 .BR xdr_discrim ()
772 ¹½Â¤ÂΤÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ë¡£³Æ¹½Â¤ÂΤÏ
773 .RI [ value , proc ]
774 ¤Î½ç½øÉÕ¤­¥Ú¥¢¤ò³ÊǼ¤·¤Æ¤¤¤ë¡£
775 .\"O If the union's discriminant is equal to the associated
776 .\"O .IR value ,
777 .\"O then the
778 .\"O .I proc
779 .\"O is called to translate the union.
780 .\"O The end of the
781 .\"O .BR xdr_discrim ()
782 .\"O structure array is denoted by a routine of value NULL.
783 ¤â¤·¶¦ÍÑÂΤÎʬÊÌÍ×ÁǤ¬´ØÏ¢ÉÕ¤±¤é¤ì¤¿
784 .I value
785 ¤ÈÅù¤·¤¤¾ì¹ç¤Ë¤Ï¡¢¶¦ÍÑÂΤòÊÑ´¹¤¹¤ë¤¿¤á¤Ë
786 .I proc
787 ¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¡£
788 .BR xdr_discrim ()
789 ¹½Â¤ÂΤÎÇÛÎó¤ÎºÇ¸å¤Ï¡¢¥ë¡¼¥Æ¥£¥ó¤È¤·¤Æ
790 .SM NULL
791 ¤ò»ØÄꤹ¤ë¤³¤È¤Ç¼¨¤µ¤ì¤ë¡£
792 .\"O If the discriminant is not found in the
793 .\"O .I choices
794 .\"O array, then the
795 .\"O .I defaultarm
796 .\"O procedure is called (if it is not NULL).
797 .\"O Returns one if it succeeds, zero otherwise.
798 ʬÊÌÍ×ÁǤ¬
799 .I choices
800 ÇÛÎó¤ÎÃæ¤Ë¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
801 .I defaultarm
802 ¤¬ (NULL ¤Ç¤Ê¤±¤ì¤Ð) ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£
803 À®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
804 .LP
805 .nf
806 .BI "bool_t xdr_vector(XDR *" xdrs ", char *" arrp ", unsigned int " size ,
807 .BI "                  unsigned int " elsize ", xdrproc_t " elproc );
808 .fi
809 .IP
810 .\"O A filter primitive that translates between fixed-length arrays
811 .\"O and their corresponding external representations.
812 .\"O The argument
813 .\"O .I arrp
814 .\"O is the address of the pointer to the array, while
815 .\"O .I size
816 .\"O is the element count of the array.
817 .\"O The argument
818 .\"O .I elsize
819 .\"O is the
820 .\"O .I sizeof
821 .\"O each of the array's elements, and
822 .\"O .I elproc
823 .\"O is an XDR filter that translates between
824 .\"O the array elements' C form, and their external
825 .\"O representation.
826 .\"O This routine returns one if it succeeds, zero otherwise.
827 ¸ÇÄêŤÎÇÛÎó¤È¤½¤ì¤é¤¬Âбþ¤¹¤ë³°Éôɽ¸½¤È¤òÊÑ´¹¤¹¤ë´ðËÜ¥Õ¥£¥ë¥¿¡¼¡£
828 °ú¤­¿ô
829 .I arrp
830 ¤ÏÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Î¥¢¥É¥ì¥¹¤Ç¤¢¤ë¡£°ìÊý¤Ç
831 .I size
832 ¤ÏÇÛÎó¤ÎÍ×ÁÇ¿ô¤½¤Î¤â¤Î¤Ç¤¢¤ë¡£°ú¤­¿ô
833 .I elsize
834 ¤ÏÇÛÎó¤Î³ÆÍ×ÁǤÎ
835 .I sizeof
836 ¤Ç¡¢
837 .I elproc
838 ¤ÏÇÛÎó¤ÎÍ×ÁǤò C ·Á¼°¤«¤é¤½¤Î³°Éôɽ¸½¤Ø¤ÈÊÑ´¹¤¹¤ë XDR ¥Õ¥£¥ë¥¿¡¼¤Ç¤¢¤ë¡£
839 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤ÏÀ®¸ù¤·¤¿¾ì¹ç 1 ¤òÊÖ¤¹¡£
840 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
841 .LP
842 .nf
843 .BI "bool_t xdr_void(void);"
844 .fi
845 .IP
846 .\"O This routine always returns one.
847 .\"O It may be passed to RPC routines that require a function argument,
848 .\"O where nothing is to be done.
849 ¤³¤Î¥ë¡¼¥Æ¥£¥ó¤Ï¾ï¤Ë 1 ¤òÊÖ¤¹¡£
850 ¤³¤ì¤Ï²¿¤â¹Ô¤Ê¤ï¤Ê¤¤¤¬¡¢´Ø¿ô°ú¤­¿ô¤¬É¬ÍפÊ
851 RPC ¥ë¡¼¥Æ¥£¥ó¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤ë¡£
852 .LP
853 .nf
854 .BI "bool_t xdr_wrapstring(XDR *" xdrs ", char **" sp );
855 .fi
856 .IP
857 .\"O A primitive that calls
858 .\"O .B "xdr_string(xdrs, sp,MAXUN.UNSIGNED );"
859 .\"O where
860 .\"O .B MAXUN.UNSIGNED
861 .\"O is the maximum value of an unsigned integer.
862 .\"O .BR xdr_wrapstring ()
863 .\"O is handy because the RPC package passes a maximum of two XDR
864 .\"O routines as arguments, and
865 .\"O .BR xdr_string (),
866 .\"O one of the most frequently used primitives, requires three.
867 .\"O Returns one if it succeeds, zero otherwise.
868 .B "xdr_string(xdrs, sp, \s-1MAXUN.UNSIGNED\s0 );"
869 ¤ò¸Æ¤Ó½Ð¤¹´ðËܥ롼¥Æ¥£¥ó¡£
870 ¤³¤³¤Ç
871 .B
872 .SM MAXUN.UNSIGNED
873 ¤ÏÉä¹æ̵¤·À°¿ô(unsigned int)¤ÎºÇÂçÃͤǤ¢¤ë¡£
874 .BR xdr_wrapstring ()
875 ¤Ï¡¢
876 .SM RPC
877 ¥Ñ¥Ã¥±¡¼¥¸¤ÏÆó¤Ä¤Î
878 .SM XDR
879 ¥ë¡¼¥Æ¥£¥ó¤ÎºÇÂçÃͤò°ú¤­¿ô¤È¤·¤ÆÅϤ¹¤¿¤áÊØÍø¤Ç¤¢¤ë¡£
880 .BR xdr_string ()
881 ¤ÏºÇ¤âÉÑÈˤËÍøÍѤµ¤ì¤ë´ðËܥ롼¥Æ¥£¥ó¤Ç¤¢¤ë¤¬»°¤Ä¤òÍ׵᤹¤ë¡£
882 À®¸ù¤·¤¿¾ì¹ç¤Ï 1 ¤òÊÖ¤¹¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤¹¡£
883 .\"O .SH SEE ALSO
884 .SH ´ØÏ¢¹àÌÜ
885 .BR rpc (3)
886 .LP
887 .\"O The following manuals:
888 °Ê²¼¤Î¥Þ¥Ë¥å¥¢¥ë:
889 .RS
890 eXternal Data Representation Standard: Protocol Specification
891 .br
892 eXternal Data Representation: Sun Technical Notes
893 .br
894 .IR "XDR: External Data Representation Standard" ,
895 RFC\ 1014, Sun Microsystems, Inc.,
896 USC-ISI.
897 .RE