AMD64 - Fix many compile-time warnings. int/ptr type mismatches, %llx, etc.
[dragonfly.git] / contrib / amd / amq / amq_xdr.c
blob26b93b3748affe11d06a47bf7e392e93e1506cf0
1 /*
2 * Copyright (c) 1997-1999 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgment:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
39 * %W% (Berkeley) %G%
41 * $Id: amq_xdr.c,v 1.2 1999/01/10 21:53:59 ezk Exp $
45 #ifdef HAVE_CONFIG_H
46 # include <config.h>
47 #endif /* HAVE_CONFIG_H */
48 #include <am_defs.h>
49 #include <amq.h>
52 bool_t
53 xdr_time_type(XDR *xdrs, time_type *objp)
55 if (!xdr_long(xdrs, (long *) objp)) {
56 return (FALSE);
58 return (TRUE);
62 bool_t
63 xdr_amq_mount_tree(XDR *xdrs, amq_mount_tree *objp)
66 if (!xdr_amq_string(xdrs, &objp->mt_mountinfo)) {
67 return (FALSE);
70 if (!xdr_amq_string(xdrs, &objp->mt_directory)) {
71 return (FALSE);
74 if (!xdr_amq_string(xdrs, &objp->mt_mountpoint)) {
75 return (FALSE);
78 if (!xdr_amq_string(xdrs, &objp->mt_type)) {
79 return (FALSE);
82 if (!xdr_time_type(xdrs, &objp->mt_mounttime)) {
83 return (FALSE);
86 if (!xdr_u_short(xdrs, &objp->mt_mountuid)) {
87 return (FALSE);
90 if (!xdr_int(xdrs, &objp->mt_getattr)) {
91 return (FALSE);
94 if (!xdr_int(xdrs, &objp->mt_lookup)) {
95 return (FALSE);
98 if (!xdr_int(xdrs, &objp->mt_readdir)) {
99 return (FALSE);
102 if (!xdr_int(xdrs, &objp->mt_readlink)) {
103 return (FALSE);
106 if (!xdr_int(xdrs, &objp->mt_statfs)) {
107 return (FALSE);
110 if (!xdr_pointer(xdrs, (char **) &objp->mt_next, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_tree)) {
111 return (FALSE);
114 if (!xdr_pointer(xdrs, (char **) &objp->mt_child, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_tree)) {
115 return (FALSE);
118 return (TRUE);
122 bool_t
123 xdr_amq_mount_tree_p(XDR *xdrs, amq_mount_tree_p *objp)
125 if (!xdr_pointer(xdrs, (char **) objp, sizeof(amq_mount_tree), (XDRPROC_T_TYPE) xdr_amq_mount_tree)) {
126 return (FALSE);
128 return (TRUE);
132 bool_t
133 xdr_amq_mount_info(XDR *xdrs, amq_mount_info *objp)
136 if (!xdr_amq_string(xdrs, &objp->mi_type)) {
137 return (FALSE);
140 if (!xdr_amq_string(xdrs, &objp->mi_mountpt)) {
141 return (FALSE);
144 if (!xdr_amq_string(xdrs, &objp->mi_mountinfo)) {
145 return (FALSE);
148 if (!xdr_amq_string(xdrs, &objp->mi_fserver)) {
149 return (FALSE);
152 if (!xdr_int(xdrs, &objp->mi_error)) {
153 return (FALSE);
156 if (!xdr_int(xdrs, &objp->mi_refc)) {
157 return (FALSE);
160 if (!xdr_int(xdrs, &objp->mi_up)) {
161 return (FALSE);
164 return (TRUE);
168 bool_t
169 xdr_amq_mount_info_list(XDR *xdrs, amq_mount_info_list *objp)
171 if (!xdr_array(xdrs,
172 (char **) &objp->amq_mount_info_list_val,
173 (u_int *) &objp->amq_mount_info_list_len,
175 sizeof(amq_mount_info),
176 (XDRPROC_T_TYPE) xdr_amq_mount_info)) {
177 return (FALSE);
179 return (TRUE);
183 bool_t
184 xdr_amq_mount_tree_list(XDR *xdrs, amq_mount_tree_list *objp)
186 if (!xdr_array(xdrs,
187 (char **) &objp->amq_mount_tree_list_val,
188 (u_int *) &objp->amq_mount_tree_list_len,
190 sizeof(amq_mount_tree_p),
191 (XDRPROC_T_TYPE) xdr_amq_mount_tree_p)) {
192 return (FALSE);
194 return (TRUE);
198 bool_t
199 xdr_amq_mount_stats(XDR *xdrs, amq_mount_stats *objp)
202 if (!xdr_int(xdrs, &objp->as_drops)) {
203 return (FALSE);
206 if (!xdr_int(xdrs, &objp->as_stale)) {
207 return (FALSE);
210 if (!xdr_int(xdrs, &objp->as_mok)) {
211 return (FALSE);
214 if (!xdr_int(xdrs, &objp->as_merr)) {
215 return (FALSE);
218 if (!xdr_int(xdrs, &objp->as_uerr)) {
219 return (FALSE);
222 return (TRUE);
226 bool_t
227 xdr_amq_opt(XDR *xdrs, amq_opt *objp)
229 if (!xdr_enum(xdrs, (enum_t *) objp)) {
230 return (FALSE);
232 return (TRUE);
236 bool_t
237 xdr_amq_setopt(XDR *xdrs, amq_setopt *objp)
240 if (!xdr_amq_opt(xdrs, &objp->as_opt)) {
241 return (FALSE);
244 if (!xdr_amq_string(xdrs, &objp->as_str)) {
245 return (FALSE);
248 return (TRUE);
252 bool_t
253 xdr_pri_free(XDRPROC_T_TYPE xdr_args, caddr_t args_ptr)
255 XDR xdr;
257 xdr.x_op = XDR_FREE;
258 return ((*xdr_args) (&xdr, (caddr_t *) args_ptr));