add more spacing
[personal-kdebase.git] / runtime / kioslave / nfs / mount_xdr.c
blob433a8596884bdb4fe05795c74de21767ed88d6eb
1 /*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 * --- Well, it was hand-edited now, to fix compilation on other systems.... ---
5 */
7 #include <rpc/types.h>
8 #include <rpc/xdr.h>
9 #include <arpa/inet.h>
11 #include <stdint.h>
13 /* David: added the #defines below to fix compilation on Mac OS 10.3.9, whose rpc/xdr.h has no int32 macros, only long, short etc. */
15 #ifndef IXDR_GET_INT32
16 #define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++))
17 #endif
18 #ifndef IXDR_GET_U_INT32
19 #define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf))
20 #endif
21 #ifndef IXDR_PUT_INT32
22 #define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)(v)))
23 #endif
24 #ifndef IXDR_PUT_U_INT32
25 #define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32(buf, (int32_t)(v))
26 #endif
28 #include "mount.h"
30 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
31 * unrestricted use provided that this legend is included on all tape
32 * media and as a part of the software program in whole or part. Users
33 * may copy or modify Sun RPC without charge, but are not authorized
34 * to license or distribute it to anyone else except as part of a product or
35 * program developed by the user or with the express written consent of
36 * Sun Microsystems, Inc.
38 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
39 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
40 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
42 * Sun RPC is provided with no support and without any obligation on the
43 * part of Sun Microsystems, Inc. to assist in its use, correction,
44 * modification or enhancement.
46 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
47 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
48 * OR ANY PART THEREOF.
50 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
51 * or profits or other special, indirect and consequential damages, even if
52 * Sun has been advised of the possibility of such damages.
54 * Sun Microsystems, Inc.
55 * 2550 Garcia Avenue
56 * Mountain View, California 94043
59 * Copyright (c) 1985, 1990 by Sun Microsystems, Inc.
62 /* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */
64 bool_t
65 xdr_fhandle(XDR *xdrs, fhandle objp)
68 register int32_t *buf=buf;
70 if (!xdr_opaque(xdrs, objp, FHSIZE)) {
71 return (FALSE);
73 return (TRUE);
76 bool_t
77 xdr_fhstatus(XDR *xdrs, fhstatus *objp)
80 register int32_t *buf=buf;
82 if (!xdr_u_int(xdrs, &objp->fhs_status)) {
83 return (FALSE);
85 switch (objp->fhs_status) {
86 case 0:
87 if (!xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle)) {
88 return (FALSE);
90 break;
91 default:
92 break;
94 return (TRUE);
97 bool_t
98 xdr_dirpath(XDR *xdrs, dirpath *objp)
101 register int32_t *buf=buf;
103 if (!xdr_string(xdrs, objp, MNTPATHLEN)) {
104 return (FALSE);
106 return (TRUE);
109 bool_t
110 xdr_name(XDR *xdrs, name *objp)
113 register int32_t *buf=buf;
115 if (!xdr_string(xdrs, objp, MNTNAMLEN)) {
116 return (FALSE);
118 return (TRUE);
121 bool_t
122 xdr_mountlist(XDR *xdrs, mountlist *objp)
125 register int32_t *buf=buf;
127 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct mountbody), (xdrproc_t)xdr_mountbody)) {
128 return (FALSE);
130 return (TRUE);
133 bool_t
134 xdr_mountbody(XDR *xdrs, mountbody *objp)
137 register int32_t *buf=buf;
139 if (!xdr_name(xdrs, &objp->ml_hostname)) {
140 return (FALSE);
142 if (!xdr_dirpath(xdrs, &objp->ml_directory)) {
143 return (FALSE);
145 if (!xdr_mountlist(xdrs, &objp->ml_next)) {
146 return (FALSE);
148 return (TRUE);
151 bool_t
152 xdr_groups(XDR *xdrs, groups *objp)
155 register int32_t *buf=buf;
157 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct groupnode), (xdrproc_t)xdr_groupnode)) {
158 return (FALSE);
160 return (TRUE);
163 bool_t
164 xdr_groupnode(XDR *xdrs, groupnode *objp)
167 register int32_t *buf=buf;
169 if (!xdr_name(xdrs, &objp->gr_name)) {
170 return (FALSE);
172 if (!xdr_groups(xdrs, &objp->gr_next)) {
173 return (FALSE);
175 return (TRUE);
178 bool_t
179 xdr_exports(XDR *xdrs, exports *objp)
182 register int32_t *buf=buf;
184 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct exportnode), (xdrproc_t)xdr_exportnode)) {
185 return (FALSE);
187 return (TRUE);
190 bool_t
191 xdr_exportnode(XDR *xdrs, exportnode *objp)
194 register int32_t *buf=buf;
196 if (!xdr_dirpath(xdrs, &objp->ex_dir)) {
197 return (FALSE);
199 if (!xdr_groups(xdrs, &objp->ex_groups)) {
200 return (FALSE);
202 if (!xdr_exports(xdrs, &objp->ex_next)) {
203 return (FALSE);
205 return (TRUE);
208 bool_t
209 xdr_ppathcnf(XDR *xdrs, ppathcnf *objp)
212 register int32_t *buf=buf;
214 int i=i;
216 if (xdrs->x_op == XDR_ENCODE) {
217 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
218 if (buf == NULL) {
219 if (!xdr_int(xdrs, &objp->pc_link_max)) {
220 return (FALSE);
222 if (!xdr_short(xdrs, &objp->pc_max_canon)) {
223 return (FALSE);
225 if (!xdr_short(xdrs, &objp->pc_max_input)) {
226 return (FALSE);
228 if (!xdr_short(xdrs, &objp->pc_name_max)) {
229 return (FALSE);
231 if (!xdr_short(xdrs, &objp->pc_path_max)) {
232 return (FALSE);
234 if (!xdr_short(xdrs, &objp->pc_pipe_buf)) {
235 return (FALSE);
239 else {
240 IXDR_PUT_U_INT32(buf,objp->pc_link_max);
241 IXDR_PUT_SHORT(buf,objp->pc_max_canon);
242 IXDR_PUT_SHORT(buf,objp->pc_max_input);
243 IXDR_PUT_SHORT(buf,objp->pc_name_max);
244 IXDR_PUT_SHORT(buf,objp->pc_path_max);
245 IXDR_PUT_SHORT(buf,objp->pc_pipe_buf);
247 if (!xdr_u_char(xdrs, &objp->pc_vdisable)) {
248 return (FALSE);
250 if (!xdr_char(xdrs, &objp->pc_xxx)) {
251 return (FALSE);
253 buf = XDR_INLINE(xdrs, 2 * BYTES_PER_XDR_UNIT);
254 if (buf == NULL) {
255 if (!xdr_vector(xdrs, (char *)objp->pc_mask, 2, sizeof(short), (xdrproc_t)xdr_short)) {
256 return (FALSE);
260 else {
261 { register short *genp;
262 for ( i = 0,genp=objp->pc_mask;
263 i < 2; i++){
264 IXDR_PUT_SHORT(buf,*genp++);
269 return (TRUE);
270 } else if (xdrs->x_op == XDR_DECODE) {
271 buf = XDR_INLINE(xdrs,6 * BYTES_PER_XDR_UNIT);
272 if (buf == NULL) {
273 if (!xdr_int(xdrs, &objp->pc_link_max)) {
274 return (FALSE);
276 if (!xdr_short(xdrs, &objp->pc_max_canon)) {
277 return (FALSE);
279 if (!xdr_short(xdrs, &objp->pc_max_input)) {
280 return (FALSE);
282 if (!xdr_short(xdrs, &objp->pc_name_max)) {
283 return (FALSE);
285 if (!xdr_short(xdrs, &objp->pc_path_max)) {
286 return (FALSE);
288 if (!xdr_short(xdrs, &objp->pc_pipe_buf)) {
289 return (FALSE);
293 else {
294 objp->pc_link_max = IXDR_GET_U_INT32(buf);
295 objp->pc_max_canon = IXDR_GET_SHORT(buf);
296 objp->pc_max_input = IXDR_GET_SHORT(buf);
297 objp->pc_name_max = IXDR_GET_SHORT(buf);
298 objp->pc_path_max = IXDR_GET_SHORT(buf);
299 objp->pc_pipe_buf = IXDR_GET_SHORT(buf);
301 if (!xdr_u_char(xdrs, &objp->pc_vdisable)) {
302 return (FALSE);
304 if (!xdr_char(xdrs, &objp->pc_xxx)) {
305 return (FALSE);
307 buf = XDR_INLINE(xdrs, 2 * BYTES_PER_XDR_UNIT);
308 if (buf == NULL) {
309 if (!xdr_vector(xdrs, (char *)objp->pc_mask, 2, sizeof(short), (xdrproc_t)xdr_short)) {
310 return (FALSE);
314 else {
315 { register short *genp;
316 for ( i = 0,genp=objp->pc_mask;
317 i < 2; i++){
318 *genp++ = IXDR_GET_SHORT(buf);
322 return(TRUE);
325 if (!xdr_int(xdrs, &objp->pc_link_max)) {
326 return (FALSE);
328 if (!xdr_short(xdrs, &objp->pc_max_canon)) {
329 return (FALSE);
331 if (!xdr_short(xdrs, &objp->pc_max_input)) {
332 return (FALSE);
334 if (!xdr_short(xdrs, &objp->pc_name_max)) {
335 return (FALSE);
337 if (!xdr_short(xdrs, &objp->pc_path_max)) {
338 return (FALSE);
340 if (!xdr_short(xdrs, &objp->pc_pipe_buf)) {
341 return (FALSE);
343 if (!xdr_u_char(xdrs, &objp->pc_vdisable)) {
344 return (FALSE);
346 if (!xdr_char(xdrs, &objp->pc_xxx)) {
347 return (FALSE);
349 if (!xdr_vector(xdrs, (char *)objp->pc_mask, 2, sizeof(short), (xdrproc_t)xdr_short)) {
350 return (FALSE);
352 return (TRUE);