Merge branch 'vendor/GCC44'
[dragonfly.git] / contrib / amd / amq / amq_clnt.c
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.
7  *
8  * This code is derived from software contributed to Berkeley by
9  * Jan-Simon Pendry at Imperial College, London.
10  *
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.
26  *
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.
38  *
39  *      %W% (Berkeley) %G%
40  *
41  * $Id: amq_clnt.c,v 1.2 1999/01/10 21:53:59 ezk Exp $
42  *
43  */
44
45 #ifdef HAVE_CONFIG_H
46 # include <config.h>
47 #endif /* HAVE_CONFIG_H */
48 #include <am_defs.h>
49 #include <amq.h>
50
51
52 static struct timeval TIMEOUT = {ALLOWED_MOUNT_TIME, 0};
53
54
55 voidp
56 amqproc_null_1(voidp argp, CLIENT *clnt)
57 {
58   static char res;
59
60   memset((char *) &res, 0, sizeof(res));
61   if (clnt_call(clnt, AMQPROC_NULL,
62                 (XDRPROC_T_TYPE) xdr_void, argp,
63                 (XDRPROC_T_TYPE) xdr_void, &res, TIMEOUT)
64       != RPC_SUCCESS) {
65     return (NULL);
66   }
67   return ((voidp) &res);
68 }
69
70
71 amq_mount_tree_p *
72 amqproc_mnttree_1(amq_string *argp, CLIENT *clnt)
73 {
74   static amq_mount_tree_p res;
75
76   memset((char *) &res, 0, sizeof(res));
77   if (clnt_call(clnt, AMQPROC_MNTTREE,
78                 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
79                 (XDRPROC_T_TYPE) xdr_amq_mount_tree_p, (SVC_IN_ARG_TYPE) & res,
80                 TIMEOUT) != RPC_SUCCESS) {
81     return (NULL);
82   }
83   return (&res);
84 }
85
86
87 voidp
88 amqproc_umnt_1(amq_string *argp, CLIENT *clnt)
89 {
90   static char res;
91
92   memset((char *) &res, 0, sizeof(res));
93   if (clnt_call(clnt, AMQPROC_UMNT,
94                 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
95                 (XDRPROC_T_TYPE) xdr_void, &res,
96                 TIMEOUT) != RPC_SUCCESS) {
97     return (NULL);
98   }
99   return ((voidp) &res);
100 }
101
102
103 amq_mount_stats *
104 amqproc_stats_1(voidp argp, CLIENT *clnt)
105 {
106   static amq_mount_stats res;
107
108   memset((char *) &res, 0, sizeof(res));
109   if (clnt_call(clnt, AMQPROC_STATS,
110                 (XDRPROC_T_TYPE) xdr_void, argp,
111                 (XDRPROC_T_TYPE) xdr_amq_mount_stats,
112                 (SVC_IN_ARG_TYPE) & res,
113                 TIMEOUT) != RPC_SUCCESS) {
114     return (NULL);
115   }
116   return (&res);
117 }
118
119
120 amq_mount_tree_list *
121 amqproc_export_1(voidp argp, CLIENT *clnt)
122 {
123   static amq_mount_tree_list res;
124
125   memset((char *) &res, 0, sizeof(res));
126   if (clnt_call(clnt, AMQPROC_EXPORT,
127                 (XDRPROC_T_TYPE) xdr_void, argp,
128                 (XDRPROC_T_TYPE) xdr_amq_mount_tree_list,
129                 (SVC_IN_ARG_TYPE) & res, TIMEOUT) != RPC_SUCCESS) {
130     return (NULL);
131   }
132   return (&res);
133 }
134
135
136 int *
137 amqproc_setopt_1(amq_setopt *argp, CLIENT *clnt)
138 {
139   static int res;
140
141   memset((char *) &res, 0, sizeof(res));
142   if (clnt_call(clnt, AMQPROC_SETOPT, (XDRPROC_T_TYPE) xdr_amq_setopt,
143                 (SVC_IN_ARG_TYPE) argp, (XDRPROC_T_TYPE) xdr_int,
144                 (SVC_IN_ARG_TYPE) & res, TIMEOUT) != RPC_SUCCESS) {
145     return (NULL);
146   }
147   return (&res);
148 }
149
150
151 amq_mount_info_list *
152 amqproc_getmntfs_1(voidp argp, CLIENT *clnt)
153 {
154   static amq_mount_info_list res;
155
156   memset((char *) &res, 0, sizeof(res));
157   if (clnt_call(clnt, AMQPROC_GETMNTFS, (XDRPROC_T_TYPE) xdr_void, argp,
158                 (XDRPROC_T_TYPE) xdr_amq_mount_info_list,
159                 (SVC_IN_ARG_TYPE) & res, TIMEOUT) != RPC_SUCCESS) {
160     return (NULL);
161   }
162   return (&res);
163 }
164
165
166 int *
167 amqproc_mount_1(voidp argp, CLIENT *clnt)
168 {
169   static int res;
170
171   memset((char *) &res, 0, sizeof(res));
172   if (clnt_call(clnt, AMQPROC_MOUNT, (XDRPROC_T_TYPE) xdr_amq_string, argp,
173                 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) & res,
174                 TIMEOUT) != RPC_SUCCESS) {
175     return (NULL);
176   }
177   return (&res);
178 }
179
180
181 amq_string *
182 amqproc_getvers_1(voidp argp, CLIENT *clnt)
183 {
184   static amq_string res;
185
186   memset((char *) &res, 0, sizeof(res));
187   if (clnt_call(clnt, AMQPROC_GETVERS, (XDRPROC_T_TYPE) xdr_void, argp,
188                 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) & res,
189                 TIMEOUT) != RPC_SUCCESS) {
190     return (NULL);
191   }
192   return (&res);
193 }
194
195
196 int *
197 amqproc_getpid_1(voidp argp, CLIENT *clnt)
198 {
199   static int res;
200
201   memset((char *) &res, 0, sizeof(res));
202   if (clnt_call(clnt, AMQPROC_GETPID, (XDRPROC_T_TYPE) xdr_void, argp,
203                 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) & res,
204                 TIMEOUT) != RPC_SUCCESS) {
205     return (NULL);
206   }
207   return (&res);
208 }