RPC: get rid of bool_t
[deb_libnfs.git] / rquota / libnfs-raw-rquota.c
CommitLineData
a0c4ea7d
RS
1/*
2Copyright (c) 2014, Ronnie Sahlberg
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7
81. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
102. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25The views and conclusions contained in the software and documentation are those
26of the authors and should not be interpreted as representing official policies,
27either expressed or implied, of the FreeBSD Project.
28*/
29
763cd6e3
RS
30/*
31 * Please do not edit this file.
32 * It was generated using rpcgen.
33 */
34
35#include "libnfs-zdr.h"
36#include "libnfs-raw-rquota.h"
37
af8d37c8 38uint32_t
763cd6e3
RS
39zdr_rquotastat (ZDR *zdrs, rquotastat *objp)
40{
41 register int32_t *buf;
9c29b498 42 buf = NULL;
763cd6e3
RS
43
44 if (!zdr_enum (zdrs, (enum_t *) objp))
45 return FALSE;
46 return TRUE;
47}
48
af8d37c8 49uint32_t
763cd6e3
RS
50zdr_exportpath (ZDR *zdrs, exportpath *objp)
51{
52 register int32_t *buf;
9c29b498 53 buf = NULL;
763cd6e3
RS
54
55 if (!zdr_string (zdrs, objp, RQUOTAPATHLEN))
56 return FALSE;
57 return TRUE;
58}
59
af8d37c8 60uint32_t
763cd6e3
RS
61zdr_GETQUOTA1args (ZDR *zdrs, GETQUOTA1args *objp)
62{
63 register int32_t *buf;
9c29b498 64 buf = NULL;
763cd6e3
RS
65
66 if (!zdr_exportpath (zdrs, &objp->export))
67 return FALSE;
68 if (!zdr_int (zdrs, &objp->uid))
69 return FALSE;
70 return TRUE;
71}
72
af8d37c8 73uint32_t
763cd6e3
RS
74zdr_quotatype (ZDR *zdrs, quotatype *objp)
75{
76 register int32_t *buf;
9c29b498 77 buf = NULL;
763cd6e3
RS
78
79 if (!zdr_enum (zdrs, (enum_t *) objp))
80 return FALSE;
81 return TRUE;
82}
83
af8d37c8 84uint32_t
763cd6e3
RS
85zdr_GETQUOTA2args (ZDR *zdrs, GETQUOTA2args *objp)
86{
87 register int32_t *buf;
9c29b498 88 buf = NULL;
763cd6e3
RS
89
90 if (!zdr_exportpath (zdrs, &objp->export))
91 return FALSE;
92 if (!zdr_quotatype (zdrs, &objp->type))
93 return FALSE;
94 if (!zdr_int (zdrs, &objp->uid))
95 return FALSE;
96 return TRUE;
97}
98
af8d37c8 99uint32_t
763cd6e3
RS
100zdr_GETQUOTA1res_ok (ZDR *zdrs, GETQUOTA1res_ok *objp)
101{
102 register int32_t *buf;
9c29b498 103 buf = NULL;
763cd6e3
RS
104
105
106 if (zdrs->x_op == ZDR_ENCODE) {
107 buf = ZDR_INLINE (zdrs, 10 * BYTES_PER_ZDR_UNIT);
108 if (buf == NULL) {
109 if (!zdr_int (zdrs, &objp->bsize))
110 return FALSE;
111 if (!zdr_int (zdrs, &objp->active))
112 return FALSE;
113 if (!zdr_int (zdrs, &objp->bhardlimit))
114 return FALSE;
115 if (!zdr_int (zdrs, &objp->bsoftlimit))
116 return FALSE;
117 if (!zdr_int (zdrs, &objp->curblocks))
118 return FALSE;
119 if (!zdr_int (zdrs, &objp->fhardlimit))
120 return FALSE;
121 if (!zdr_int (zdrs, &objp->fsoftlimit))
122 return FALSE;
123 if (!zdr_int (zdrs, &objp->curfiles))
124 return FALSE;
125 if (!zdr_int (zdrs, &objp->btimeleft))
126 return FALSE;
127 if (!zdr_int (zdrs, &objp->ftimeleft))
128 return FALSE;
129 } else {
130 IZDR_PUT_LONG(buf, objp->bsize);
131 IZDR_PUT_LONG(buf, objp->active);
132 IZDR_PUT_LONG(buf, objp->bhardlimit);
133 IZDR_PUT_LONG(buf, objp->bsoftlimit);
134 IZDR_PUT_LONG(buf, objp->curblocks);
135 IZDR_PUT_LONG(buf, objp->fhardlimit);
136 IZDR_PUT_LONG(buf, objp->fsoftlimit);
137 IZDR_PUT_LONG(buf, objp->curfiles);
138 IZDR_PUT_LONG(buf, objp->btimeleft);
139 IZDR_PUT_LONG(buf, objp->ftimeleft);
140 }
141 return TRUE;
142 } else if (zdrs->x_op == ZDR_DECODE) {
143 buf = ZDR_INLINE (zdrs, 10 * BYTES_PER_ZDR_UNIT);
144 if (buf == NULL) {
145 if (!zdr_int (zdrs, &objp->bsize))
146 return FALSE;
147 if (!zdr_int (zdrs, &objp->active))
148 return FALSE;
149 if (!zdr_int (zdrs, &objp->bhardlimit))
150 return FALSE;
151 if (!zdr_int (zdrs, &objp->bsoftlimit))
152 return FALSE;
153 if (!zdr_int (zdrs, &objp->curblocks))
154 return FALSE;
155 if (!zdr_int (zdrs, &objp->fhardlimit))
156 return FALSE;
157 if (!zdr_int (zdrs, &objp->fsoftlimit))
158 return FALSE;
159 if (!zdr_int (zdrs, &objp->curfiles))
160 return FALSE;
161 if (!zdr_int (zdrs, &objp->btimeleft))
162 return FALSE;
163 if (!zdr_int (zdrs, &objp->ftimeleft))
164 return FALSE;
165 } else {
166 objp->bsize = IZDR_GET_LONG(buf);
167 objp->active = IZDR_GET_LONG(buf);
168 objp->bhardlimit = IZDR_GET_LONG(buf);
169 objp->bsoftlimit = IZDR_GET_LONG(buf);
170 objp->curblocks = IZDR_GET_LONG(buf);
171 objp->fhardlimit = IZDR_GET_LONG(buf);
172 objp->fsoftlimit = IZDR_GET_LONG(buf);
173 objp->curfiles = IZDR_GET_LONG(buf);
174 objp->btimeleft = IZDR_GET_LONG(buf);
175 objp->ftimeleft = IZDR_GET_LONG(buf);
176 }
177 return TRUE;
178 }
179
180 if (!zdr_int (zdrs, &objp->bsize))
181 return FALSE;
182 if (!zdr_int (zdrs, &objp->active))
183 return FALSE;
184 if (!zdr_int (zdrs, &objp->bhardlimit))
185 return FALSE;
186 if (!zdr_int (zdrs, &objp->bsoftlimit))
187 return FALSE;
188 if (!zdr_int (zdrs, &objp->curblocks))
189 return FALSE;
190 if (!zdr_int (zdrs, &objp->fhardlimit))
191 return FALSE;
192 if (!zdr_int (zdrs, &objp->fsoftlimit))
193 return FALSE;
194 if (!zdr_int (zdrs, &objp->curfiles))
195 return FALSE;
196 if (!zdr_int (zdrs, &objp->btimeleft))
197 return FALSE;
198 if (!zdr_int (zdrs, &objp->ftimeleft))
199 return FALSE;
200 return TRUE;
201}
202
af8d37c8 203uint32_t
763cd6e3
RS
204zdr_GETQUOTA1res (ZDR *zdrs, GETQUOTA1res *objp)
205{
206 register int32_t *buf;
9c29b498 207 buf = NULL;
763cd6e3
RS
208
209 if (!zdr_rquotastat (zdrs, &objp->status))
210 return FALSE;
211 switch (objp->status) {
212 case RQUOTA_OK:
213 if (!zdr_GETQUOTA1res_ok (zdrs, &objp->GETQUOTA1res_u.quota))
214 return FALSE;
215 break;
216 default:
217 break;
218 }
219 return TRUE;
220}