Line 0
Link Here
|
|
|
1 |
/** |
2 |
* Licensed to the Apache Software Foundation (ASF) under one |
3 |
* or more contributor license agreements. See the NOTICE file |
4 |
* distributed with this work for additional information |
5 |
* regarding copyright ownership. The ASF licenses this file |
6 |
* to you under the Apache License, Version 2.0 (the |
7 |
* "License"); you may not use this file except in compliance |
8 |
* with the License. You may obtain a copy of the License at |
9 |
* |
10 |
* http://www.apache.org/licenses/LICENSE-2.0 |
11 |
* |
12 |
* Unless required by applicable law or agreed to in writing, software |
13 |
* distributed under the License is distributed on an "AS IS" BASIS, |
14 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 |
* See the License for the specific language governing permissions and |
16 |
* limitations under the License. |
17 |
*/ |
18 |
|
19 |
#include <stdlib.h> |
20 |
#include "zookeeper.jute.h" |
21 |
|
22 |
int serialize_Id(struct oarchive *out, const char *tag, struct Id *v){ |
23 |
int rc; |
24 |
rc = out->start_record(out, tag); |
25 |
rc = rc ? rc : out->serialize_String(out, "scheme", &v->scheme); |
26 |
rc = rc ? rc : out->serialize_String(out, "id", &v->id); |
27 |
rc = rc ? rc : out->end_record(out, tag); |
28 |
return rc; |
29 |
} |
30 |
int deserialize_Id(struct iarchive *in, const char *tag, struct Id*v){ |
31 |
int rc; |
32 |
rc = in->start_record(in, tag); |
33 |
rc = rc ? rc : in->deserialize_String(in, "scheme", &v->scheme); |
34 |
rc = rc ? rc : in->deserialize_String(in, "id", &v->id); |
35 |
rc = rc ? rc : in->end_record(in, tag); |
36 |
return rc; |
37 |
} |
38 |
void deallocate_Id(struct Id*v){ |
39 |
deallocate_String(&v->scheme); |
40 |
deallocate_String(&v->id); |
41 |
} |
42 |
int serialize_ACL(struct oarchive *out, const char *tag, struct ACL *v){ |
43 |
int rc; |
44 |
rc = out->start_record(out, tag); |
45 |
rc = rc ? rc : out->serialize_Int(out, "perms", &v->perms); |
46 |
rc = rc ? rc : serialize_Id(out, "id", &v->id); |
47 |
rc = rc ? rc : out->end_record(out, tag); |
48 |
return rc; |
49 |
} |
50 |
int deserialize_ACL(struct iarchive *in, const char *tag, struct ACL*v){ |
51 |
int rc; |
52 |
rc = in->start_record(in, tag); |
53 |
rc = rc ? rc : in->deserialize_Int(in, "perms", &v->perms); |
54 |
rc = rc ? rc : deserialize_Id(in, "id", &v->id); |
55 |
rc = rc ? rc : in->end_record(in, tag); |
56 |
return rc; |
57 |
} |
58 |
void deallocate_ACL(struct ACL*v){ |
59 |
deallocate_Id(&v->id); |
60 |
} |
61 |
int serialize_Stat(struct oarchive *out, const char *tag, struct Stat *v){ |
62 |
int rc; |
63 |
rc = out->start_record(out, tag); |
64 |
rc = rc ? rc : out->serialize_Long(out, "czxid", &v->czxid); |
65 |
rc = rc ? rc : out->serialize_Long(out, "mzxid", &v->mzxid); |
66 |
rc = rc ? rc : out->serialize_Long(out, "ctime", &v->ctime); |
67 |
rc = rc ? rc : out->serialize_Long(out, "mtime", &v->mtime); |
68 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
69 |
rc = rc ? rc : out->serialize_Int(out, "cversion", &v->cversion); |
70 |
rc = rc ? rc : out->serialize_Int(out, "aversion", &v->aversion); |
71 |
rc = rc ? rc : out->serialize_Long(out, "ephemeralOwner", &v->ephemeralOwner); |
72 |
rc = rc ? rc : out->serialize_Int(out, "dataLength", &v->dataLength); |
73 |
rc = rc ? rc : out->serialize_Int(out, "numChildren", &v->numChildren); |
74 |
rc = rc ? rc : out->serialize_Long(out, "pzxid", &v->pzxid); |
75 |
rc = rc ? rc : out->end_record(out, tag); |
76 |
return rc; |
77 |
} |
78 |
int deserialize_Stat(struct iarchive *in, const char *tag, struct Stat*v){ |
79 |
int rc; |
80 |
rc = in->start_record(in, tag); |
81 |
rc = rc ? rc : in->deserialize_Long(in, "czxid", &v->czxid); |
82 |
rc = rc ? rc : in->deserialize_Long(in, "mzxid", &v->mzxid); |
83 |
rc = rc ? rc : in->deserialize_Long(in, "ctime", &v->ctime); |
84 |
rc = rc ? rc : in->deserialize_Long(in, "mtime", &v->mtime); |
85 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
86 |
rc = rc ? rc : in->deserialize_Int(in, "cversion", &v->cversion); |
87 |
rc = rc ? rc : in->deserialize_Int(in, "aversion", &v->aversion); |
88 |
rc = rc ? rc : in->deserialize_Long(in, "ephemeralOwner", &v->ephemeralOwner); |
89 |
rc = rc ? rc : in->deserialize_Int(in, "dataLength", &v->dataLength); |
90 |
rc = rc ? rc : in->deserialize_Int(in, "numChildren", &v->numChildren); |
91 |
rc = rc ? rc : in->deserialize_Long(in, "pzxid", &v->pzxid); |
92 |
rc = rc ? rc : in->end_record(in, tag); |
93 |
return rc; |
94 |
} |
95 |
void deallocate_Stat(struct Stat*v){ |
96 |
} |
97 |
int serialize_StatPersisted(struct oarchive *out, const char *tag, struct StatPersisted *v){ |
98 |
int rc; |
99 |
rc = out->start_record(out, tag); |
100 |
rc = rc ? rc : out->serialize_Long(out, "czxid", &v->czxid); |
101 |
rc = rc ? rc : out->serialize_Long(out, "mzxid", &v->mzxid); |
102 |
rc = rc ? rc : out->serialize_Long(out, "ctime", &v->ctime); |
103 |
rc = rc ? rc : out->serialize_Long(out, "mtime", &v->mtime); |
104 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
105 |
rc = rc ? rc : out->serialize_Int(out, "cversion", &v->cversion); |
106 |
rc = rc ? rc : out->serialize_Int(out, "aversion", &v->aversion); |
107 |
rc = rc ? rc : out->serialize_Long(out, "ephemeralOwner", &v->ephemeralOwner); |
108 |
rc = rc ? rc : out->serialize_Long(out, "pzxid", &v->pzxid); |
109 |
rc = rc ? rc : out->end_record(out, tag); |
110 |
return rc; |
111 |
} |
112 |
int deserialize_StatPersisted(struct iarchive *in, const char *tag, struct StatPersisted*v){ |
113 |
int rc; |
114 |
rc = in->start_record(in, tag); |
115 |
rc = rc ? rc : in->deserialize_Long(in, "czxid", &v->czxid); |
116 |
rc = rc ? rc : in->deserialize_Long(in, "mzxid", &v->mzxid); |
117 |
rc = rc ? rc : in->deserialize_Long(in, "ctime", &v->ctime); |
118 |
rc = rc ? rc : in->deserialize_Long(in, "mtime", &v->mtime); |
119 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
120 |
rc = rc ? rc : in->deserialize_Int(in, "cversion", &v->cversion); |
121 |
rc = rc ? rc : in->deserialize_Int(in, "aversion", &v->aversion); |
122 |
rc = rc ? rc : in->deserialize_Long(in, "ephemeralOwner", &v->ephemeralOwner); |
123 |
rc = rc ? rc : in->deserialize_Long(in, "pzxid", &v->pzxid); |
124 |
rc = rc ? rc : in->end_record(in, tag); |
125 |
return rc; |
126 |
} |
127 |
void deallocate_StatPersisted(struct StatPersisted*v){ |
128 |
} |
129 |
int serialize_ConnectRequest(struct oarchive *out, const char *tag, struct ConnectRequest *v){ |
130 |
int rc; |
131 |
rc = out->start_record(out, tag); |
132 |
rc = rc ? rc : out->serialize_Int(out, "protocolVersion", &v->protocolVersion); |
133 |
rc = rc ? rc : out->serialize_Long(out, "lastZxidSeen", &v->lastZxidSeen); |
134 |
rc = rc ? rc : out->serialize_Int(out, "timeOut", &v->timeOut); |
135 |
rc = rc ? rc : out->serialize_Long(out, "sessionId", &v->sessionId); |
136 |
rc = rc ? rc : out->serialize_Buffer(out, "passwd", &v->passwd); |
137 |
rc = rc ? rc : out->end_record(out, tag); |
138 |
return rc; |
139 |
} |
140 |
int deserialize_ConnectRequest(struct iarchive *in, const char *tag, struct ConnectRequest*v){ |
141 |
int rc; |
142 |
rc = in->start_record(in, tag); |
143 |
rc = rc ? rc : in->deserialize_Int(in, "protocolVersion", &v->protocolVersion); |
144 |
rc = rc ? rc : in->deserialize_Long(in, "lastZxidSeen", &v->lastZxidSeen); |
145 |
rc = rc ? rc : in->deserialize_Int(in, "timeOut", &v->timeOut); |
146 |
rc = rc ? rc : in->deserialize_Long(in, "sessionId", &v->sessionId); |
147 |
rc = rc ? rc : in->deserialize_Buffer(in, "passwd", &v->passwd); |
148 |
rc = rc ? rc : in->end_record(in, tag); |
149 |
return rc; |
150 |
} |
151 |
void deallocate_ConnectRequest(struct ConnectRequest*v){ |
152 |
deallocate_Buffer(&v->passwd); |
153 |
} |
154 |
int serialize_ConnectResponse(struct oarchive *out, const char *tag, struct ConnectResponse *v){ |
155 |
int rc; |
156 |
rc = out->start_record(out, tag); |
157 |
rc = rc ? rc : out->serialize_Int(out, "protocolVersion", &v->protocolVersion); |
158 |
rc = rc ? rc : out->serialize_Int(out, "timeOut", &v->timeOut); |
159 |
rc = rc ? rc : out->serialize_Long(out, "sessionId", &v->sessionId); |
160 |
rc = rc ? rc : out->serialize_Buffer(out, "passwd", &v->passwd); |
161 |
rc = rc ? rc : out->end_record(out, tag); |
162 |
return rc; |
163 |
} |
164 |
int deserialize_ConnectResponse(struct iarchive *in, const char *tag, struct ConnectResponse*v){ |
165 |
int rc; |
166 |
rc = in->start_record(in, tag); |
167 |
rc = rc ? rc : in->deserialize_Int(in, "protocolVersion", &v->protocolVersion); |
168 |
rc = rc ? rc : in->deserialize_Int(in, "timeOut", &v->timeOut); |
169 |
rc = rc ? rc : in->deserialize_Long(in, "sessionId", &v->sessionId); |
170 |
rc = rc ? rc : in->deserialize_Buffer(in, "passwd", &v->passwd); |
171 |
rc = rc ? rc : in->end_record(in, tag); |
172 |
return rc; |
173 |
} |
174 |
void deallocate_ConnectResponse(struct ConnectResponse*v){ |
175 |
deallocate_Buffer(&v->passwd); |
176 |
} |
177 |
int allocate_String_vector(struct String_vector *v, int32_t len) { |
178 |
if (!len) { |
179 |
v->count = 0; |
180 |
v->data = 0; |
181 |
} else { |
182 |
v->count = len; |
183 |
v->data = calloc(sizeof(*v->data), len); |
184 |
} |
185 |
return 0; |
186 |
} |
187 |
int deallocate_String_vector(struct String_vector *v) { |
188 |
if (v->data) { |
189 |
int32_t i; |
190 |
for(i=0;i<v->count; i++) { |
191 |
deallocate_String(&v->data[i]); |
192 |
} |
193 |
free(v->data); |
194 |
v->data = 0; |
195 |
} |
196 |
return 0; |
197 |
} |
198 |
int serialize_String_vector(struct oarchive *out, const char *tag, struct String_vector *v) |
199 |
{ |
200 |
int32_t count = v->count; |
201 |
int rc = 0; |
202 |
int32_t i; |
203 |
rc = out->start_vector(out, tag, &count); |
204 |
for(i=0;i<v->count;i++) { |
205 |
rc = rc ? rc : out->serialize_String(out, "data", &v->data[i]); |
206 |
} |
207 |
rc = rc ? rc : out->end_vector(out, tag); |
208 |
return rc; |
209 |
} |
210 |
int deserialize_String_vector(struct iarchive *in, const char *tag, struct String_vector *v) |
211 |
{ |
212 |
int rc = 0; |
213 |
int32_t i; |
214 |
rc = in->start_vector(in, tag, &v->count); |
215 |
v->data = calloc(v->count, sizeof(*v->data)); |
216 |
for(i=0;i<v->count;i++) { |
217 |
rc = rc ? rc : in->deserialize_String(in, "value", &v->data[i]); |
218 |
} |
219 |
rc = in->end_vector(in, tag); |
220 |
return rc; |
221 |
} |
222 |
int serialize_SetWatches(struct oarchive *out, const char *tag, struct SetWatches *v){ |
223 |
int rc; |
224 |
rc = out->start_record(out, tag); |
225 |
rc = rc ? rc : out->serialize_Long(out, "relativeZxid", &v->relativeZxid); |
226 |
rc = rc ? rc : serialize_String_vector(out, "dataWatches", &v->dataWatches); |
227 |
rc = rc ? rc : serialize_String_vector(out, "existWatches", &v->existWatches); |
228 |
rc = rc ? rc : serialize_String_vector(out, "childWatches", &v->childWatches); |
229 |
rc = rc ? rc : out->end_record(out, tag); |
230 |
return rc; |
231 |
} |
232 |
int deserialize_SetWatches(struct iarchive *in, const char *tag, struct SetWatches*v){ |
233 |
int rc; |
234 |
rc = in->start_record(in, tag); |
235 |
rc = rc ? rc : in->deserialize_Long(in, "relativeZxid", &v->relativeZxid); |
236 |
rc = rc ? rc : deserialize_String_vector(in, "dataWatches", &v->dataWatches); |
237 |
rc = rc ? rc : deserialize_String_vector(in, "existWatches", &v->existWatches); |
238 |
rc = rc ? rc : deserialize_String_vector(in, "childWatches", &v->childWatches); |
239 |
rc = rc ? rc : in->end_record(in, tag); |
240 |
return rc; |
241 |
} |
242 |
void deallocate_SetWatches(struct SetWatches*v){ |
243 |
deallocate_String_vector(&v->dataWatches); |
244 |
deallocate_String_vector(&v->existWatches); |
245 |
deallocate_String_vector(&v->childWatches); |
246 |
} |
247 |
int serialize_RequestHeader(struct oarchive *out, const char *tag, struct RequestHeader *v){ |
248 |
int rc; |
249 |
rc = out->start_record(out, tag); |
250 |
rc = rc ? rc : out->serialize_Int(out, "xid", &v->xid); |
251 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
252 |
rc = rc ? rc : out->end_record(out, tag); |
253 |
return rc; |
254 |
} |
255 |
int deserialize_RequestHeader(struct iarchive *in, const char *tag, struct RequestHeader*v){ |
256 |
int rc; |
257 |
rc = in->start_record(in, tag); |
258 |
rc = rc ? rc : in->deserialize_Int(in, "xid", &v->xid); |
259 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
260 |
rc = rc ? rc : in->end_record(in, tag); |
261 |
return rc; |
262 |
} |
263 |
void deallocate_RequestHeader(struct RequestHeader*v){ |
264 |
} |
265 |
int serialize_MultiHeader(struct oarchive *out, const char *tag, struct MultiHeader *v){ |
266 |
int rc; |
267 |
rc = out->start_record(out, tag); |
268 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
269 |
rc = rc ? rc : out->serialize_Bool(out, "done", &v->done); |
270 |
rc = rc ? rc : out->serialize_Int(out, "err", &v->err); |
271 |
rc = rc ? rc : out->end_record(out, tag); |
272 |
return rc; |
273 |
} |
274 |
int deserialize_MultiHeader(struct iarchive *in, const char *tag, struct MultiHeader*v){ |
275 |
int rc; |
276 |
rc = in->start_record(in, tag); |
277 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
278 |
rc = rc ? rc : in->deserialize_Bool(in, "done", &v->done); |
279 |
rc = rc ? rc : in->deserialize_Int(in, "err", &v->err); |
280 |
rc = rc ? rc : in->end_record(in, tag); |
281 |
return rc; |
282 |
} |
283 |
void deallocate_MultiHeader(struct MultiHeader*v){ |
284 |
} |
285 |
int serialize_AuthPacket(struct oarchive *out, const char *tag, struct AuthPacket *v){ |
286 |
int rc; |
287 |
rc = out->start_record(out, tag); |
288 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
289 |
rc = rc ? rc : out->serialize_String(out, "scheme", &v->scheme); |
290 |
rc = rc ? rc : out->serialize_Buffer(out, "auth", &v->auth); |
291 |
rc = rc ? rc : out->end_record(out, tag); |
292 |
return rc; |
293 |
} |
294 |
int deserialize_AuthPacket(struct iarchive *in, const char *tag, struct AuthPacket*v){ |
295 |
int rc; |
296 |
rc = in->start_record(in, tag); |
297 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
298 |
rc = rc ? rc : in->deserialize_String(in, "scheme", &v->scheme); |
299 |
rc = rc ? rc : in->deserialize_Buffer(in, "auth", &v->auth); |
300 |
rc = rc ? rc : in->end_record(in, tag); |
301 |
return rc; |
302 |
} |
303 |
void deallocate_AuthPacket(struct AuthPacket*v){ |
304 |
deallocate_String(&v->scheme); |
305 |
deallocate_Buffer(&v->auth); |
306 |
} |
307 |
int serialize_ReplyHeader(struct oarchive *out, const char *tag, struct ReplyHeader *v){ |
308 |
int rc; |
309 |
rc = out->start_record(out, tag); |
310 |
rc = rc ? rc : out->serialize_Int(out, "xid", &v->xid); |
311 |
rc = rc ? rc : out->serialize_Long(out, "zxid", &v->zxid); |
312 |
rc = rc ? rc : out->serialize_Int(out, "err", &v->err); |
313 |
rc = rc ? rc : out->end_record(out, tag); |
314 |
return rc; |
315 |
} |
316 |
int deserialize_ReplyHeader(struct iarchive *in, const char *tag, struct ReplyHeader*v){ |
317 |
int rc; |
318 |
rc = in->start_record(in, tag); |
319 |
rc = rc ? rc : in->deserialize_Int(in, "xid", &v->xid); |
320 |
rc = rc ? rc : in->deserialize_Long(in, "zxid", &v->zxid); |
321 |
rc = rc ? rc : in->deserialize_Int(in, "err", &v->err); |
322 |
rc = rc ? rc : in->end_record(in, tag); |
323 |
return rc; |
324 |
} |
325 |
void deallocate_ReplyHeader(struct ReplyHeader*v){ |
326 |
} |
327 |
int serialize_GetDataRequest(struct oarchive *out, const char *tag, struct GetDataRequest *v){ |
328 |
int rc; |
329 |
rc = out->start_record(out, tag); |
330 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
331 |
rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch); |
332 |
rc = rc ? rc : out->end_record(out, tag); |
333 |
return rc; |
334 |
} |
335 |
int deserialize_GetDataRequest(struct iarchive *in, const char *tag, struct GetDataRequest*v){ |
336 |
int rc; |
337 |
rc = in->start_record(in, tag); |
338 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
339 |
rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch); |
340 |
rc = rc ? rc : in->end_record(in, tag); |
341 |
return rc; |
342 |
} |
343 |
void deallocate_GetDataRequest(struct GetDataRequest*v){ |
344 |
deallocate_String(&v->path); |
345 |
} |
346 |
int serialize_SetDataRequest(struct oarchive *out, const char *tag, struct SetDataRequest *v){ |
347 |
int rc; |
348 |
rc = out->start_record(out, tag); |
349 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
350 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
351 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
352 |
rc = rc ? rc : out->end_record(out, tag); |
353 |
return rc; |
354 |
} |
355 |
int deserialize_SetDataRequest(struct iarchive *in, const char *tag, struct SetDataRequest*v){ |
356 |
int rc; |
357 |
rc = in->start_record(in, tag); |
358 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
359 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
360 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
361 |
rc = rc ? rc : in->end_record(in, tag); |
362 |
return rc; |
363 |
} |
364 |
void deallocate_SetDataRequest(struct SetDataRequest*v){ |
365 |
deallocate_String(&v->path); |
366 |
deallocate_Buffer(&v->data); |
367 |
} |
368 |
int serialize_ReconfigRequest(struct oarchive *out, const char *tag, struct ReconfigRequest *v){ |
369 |
int rc; |
370 |
rc = out->start_record(out, tag); |
371 |
rc = rc ? rc : out->serialize_String(out, "joiningServers", &v->joiningServers); |
372 |
rc = rc ? rc : out->serialize_String(out, "leavingServers", &v->leavingServers); |
373 |
rc = rc ? rc : out->serialize_String(out, "newMembers", &v->newMembers); |
374 |
rc = rc ? rc : out->serialize_Long(out, "curConfigId", &v->curConfigId); |
375 |
rc = rc ? rc : out->end_record(out, tag); |
376 |
return rc; |
377 |
} |
378 |
int deserialize_ReconfigRequest(struct iarchive *in, const char *tag, struct ReconfigRequest*v){ |
379 |
int rc; |
380 |
rc = in->start_record(in, tag); |
381 |
rc = rc ? rc : in->deserialize_String(in, "joiningServers", &v->joiningServers); |
382 |
rc = rc ? rc : in->deserialize_String(in, "leavingServers", &v->leavingServers); |
383 |
rc = rc ? rc : in->deserialize_String(in, "newMembers", &v->newMembers); |
384 |
rc = rc ? rc : in->deserialize_Long(in, "curConfigId", &v->curConfigId); |
385 |
rc = rc ? rc : in->end_record(in, tag); |
386 |
return rc; |
387 |
} |
388 |
void deallocate_ReconfigRequest(struct ReconfigRequest*v){ |
389 |
deallocate_String(&v->joiningServers); |
390 |
deallocate_String(&v->leavingServers); |
391 |
deallocate_String(&v->newMembers); |
392 |
} |
393 |
int serialize_SetDataResponse(struct oarchive *out, const char *tag, struct SetDataResponse *v){ |
394 |
int rc; |
395 |
rc = out->start_record(out, tag); |
396 |
rc = rc ? rc : serialize_Stat(out, "stat", &v->stat); |
397 |
rc = rc ? rc : out->end_record(out, tag); |
398 |
return rc; |
399 |
} |
400 |
int deserialize_SetDataResponse(struct iarchive *in, const char *tag, struct SetDataResponse*v){ |
401 |
int rc; |
402 |
rc = in->start_record(in, tag); |
403 |
rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat); |
404 |
rc = rc ? rc : in->end_record(in, tag); |
405 |
return rc; |
406 |
} |
407 |
void deallocate_SetDataResponse(struct SetDataResponse*v){ |
408 |
deallocate_Stat(&v->stat); |
409 |
} |
410 |
int serialize_GetSASLRequest(struct oarchive *out, const char *tag, struct GetSASLRequest *v){ |
411 |
int rc; |
412 |
rc = out->start_record(out, tag); |
413 |
rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token); |
414 |
rc = rc ? rc : out->end_record(out, tag); |
415 |
return rc; |
416 |
} |
417 |
int deserialize_GetSASLRequest(struct iarchive *in, const char *tag, struct GetSASLRequest*v){ |
418 |
int rc; |
419 |
rc = in->start_record(in, tag); |
420 |
rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token); |
421 |
rc = rc ? rc : in->end_record(in, tag); |
422 |
return rc; |
423 |
} |
424 |
void deallocate_GetSASLRequest(struct GetSASLRequest*v){ |
425 |
deallocate_Buffer(&v->token); |
426 |
} |
427 |
int serialize_SetSASLRequest(struct oarchive *out, const char *tag, struct SetSASLRequest *v){ |
428 |
int rc; |
429 |
rc = out->start_record(out, tag); |
430 |
rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token); |
431 |
rc = rc ? rc : out->end_record(out, tag); |
432 |
return rc; |
433 |
} |
434 |
int deserialize_SetSASLRequest(struct iarchive *in, const char *tag, struct SetSASLRequest*v){ |
435 |
int rc; |
436 |
rc = in->start_record(in, tag); |
437 |
rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token); |
438 |
rc = rc ? rc : in->end_record(in, tag); |
439 |
return rc; |
440 |
} |
441 |
void deallocate_SetSASLRequest(struct SetSASLRequest*v){ |
442 |
deallocate_Buffer(&v->token); |
443 |
} |
444 |
int serialize_SetSASLResponse(struct oarchive *out, const char *tag, struct SetSASLResponse *v){ |
445 |
int rc; |
446 |
rc = out->start_record(out, tag); |
447 |
rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token); |
448 |
rc = rc ? rc : out->end_record(out, tag); |
449 |
return rc; |
450 |
} |
451 |
int deserialize_SetSASLResponse(struct iarchive *in, const char *tag, struct SetSASLResponse*v){ |
452 |
int rc; |
453 |
rc = in->start_record(in, tag); |
454 |
rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token); |
455 |
rc = rc ? rc : in->end_record(in, tag); |
456 |
return rc; |
457 |
} |
458 |
void deallocate_SetSASLResponse(struct SetSASLResponse*v){ |
459 |
deallocate_Buffer(&v->token); |
460 |
} |
461 |
int allocate_ACL_vector(struct ACL_vector *v, int32_t len) { |
462 |
if (!len) { |
463 |
v->count = 0; |
464 |
v->data = 0; |
465 |
} else { |
466 |
v->count = len; |
467 |
v->data = calloc(sizeof(*v->data), len); |
468 |
} |
469 |
return 0; |
470 |
} |
471 |
int deallocate_ACL_vector(struct ACL_vector *v) { |
472 |
if (v->data) { |
473 |
int32_t i; |
474 |
for(i=0;i<v->count; i++) { |
475 |
deallocate_ACL(&v->data[i]); |
476 |
} |
477 |
free(v->data); |
478 |
v->data = 0; |
479 |
} |
480 |
return 0; |
481 |
} |
482 |
int serialize_ACL_vector(struct oarchive *out, const char *tag, struct ACL_vector *v) |
483 |
{ |
484 |
int32_t count = v->count; |
485 |
int rc = 0; |
486 |
int32_t i; |
487 |
rc = out->start_vector(out, tag, &count); |
488 |
for(i=0;i<v->count;i++) { |
489 |
rc = rc ? rc : serialize_ACL(out, "data", &v->data[i]); |
490 |
} |
491 |
rc = rc ? rc : out->end_vector(out, tag); |
492 |
return rc; |
493 |
} |
494 |
int deserialize_ACL_vector(struct iarchive *in, const char *tag, struct ACL_vector *v) |
495 |
{ |
496 |
int rc = 0; |
497 |
int32_t i; |
498 |
rc = in->start_vector(in, tag, &v->count); |
499 |
v->data = calloc(v->count, sizeof(*v->data)); |
500 |
for(i=0;i<v->count;i++) { |
501 |
rc = rc ? rc : deserialize_ACL(in, "value", &v->data[i]); |
502 |
} |
503 |
rc = in->end_vector(in, tag); |
504 |
return rc; |
505 |
} |
506 |
int serialize_CreateRequest(struct oarchive *out, const char *tag, struct CreateRequest *v){ |
507 |
int rc; |
508 |
rc = out->start_record(out, tag); |
509 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
510 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
511 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
512 |
rc = rc ? rc : out->serialize_Int(out, "flags", &v->flags); |
513 |
rc = rc ? rc : out->end_record(out, tag); |
514 |
return rc; |
515 |
} |
516 |
int deserialize_CreateRequest(struct iarchive *in, const char *tag, struct CreateRequest*v){ |
517 |
int rc; |
518 |
rc = in->start_record(in, tag); |
519 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
520 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
521 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
522 |
rc = rc ? rc : in->deserialize_Int(in, "flags", &v->flags); |
523 |
rc = rc ? rc : in->end_record(in, tag); |
524 |
return rc; |
525 |
} |
526 |
void deallocate_CreateRequest(struct CreateRequest*v){ |
527 |
deallocate_String(&v->path); |
528 |
deallocate_Buffer(&v->data); |
529 |
deallocate_ACL_vector(&v->acl); |
530 |
} |
531 |
int serialize_CreateTTLRequest(struct oarchive *out, const char *tag, struct CreateTTLRequest *v){ |
532 |
int rc; |
533 |
rc = out->start_record(out, tag); |
534 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
535 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
536 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
537 |
rc = rc ? rc : out->serialize_Int(out, "flags", &v->flags); |
538 |
rc = rc ? rc : out->serialize_Long(out, "ttl", &v->ttl); |
539 |
rc = rc ? rc : out->end_record(out, tag); |
540 |
return rc; |
541 |
} |
542 |
int deserialize_CreateTTLRequest(struct iarchive *in, const char *tag, struct CreateTTLRequest*v){ |
543 |
int rc; |
544 |
rc = in->start_record(in, tag); |
545 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
546 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
547 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
548 |
rc = rc ? rc : in->deserialize_Int(in, "flags", &v->flags); |
549 |
rc = rc ? rc : in->deserialize_Long(in, "ttl", &v->ttl); |
550 |
rc = rc ? rc : in->end_record(in, tag); |
551 |
return rc; |
552 |
} |
553 |
void deallocate_CreateTTLRequest(struct CreateTTLRequest*v){ |
554 |
deallocate_String(&v->path); |
555 |
deallocate_Buffer(&v->data); |
556 |
deallocate_ACL_vector(&v->acl); |
557 |
} |
558 |
int serialize_DeleteRequest(struct oarchive *out, const char *tag, struct DeleteRequest *v){ |
559 |
int rc; |
560 |
rc = out->start_record(out, tag); |
561 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
562 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
563 |
rc = rc ? rc : out->end_record(out, tag); |
564 |
return rc; |
565 |
} |
566 |
int deserialize_DeleteRequest(struct iarchive *in, const char *tag, struct DeleteRequest*v){ |
567 |
int rc; |
568 |
rc = in->start_record(in, tag); |
569 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
570 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
571 |
rc = rc ? rc : in->end_record(in, tag); |
572 |
return rc; |
573 |
} |
574 |
void deallocate_DeleteRequest(struct DeleteRequest*v){ |
575 |
deallocate_String(&v->path); |
576 |
} |
577 |
int serialize_GetChildrenRequest(struct oarchive *out, const char *tag, struct GetChildrenRequest *v){ |
578 |
int rc; |
579 |
rc = out->start_record(out, tag); |
580 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
581 |
rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch); |
582 |
rc = rc ? rc : out->end_record(out, tag); |
583 |
return rc; |
584 |
} |
585 |
int deserialize_GetChildrenRequest(struct iarchive *in, const char *tag, struct GetChildrenRequest*v){ |
586 |
int rc; |
587 |
rc = in->start_record(in, tag); |
588 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
589 |
rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch); |
590 |
rc = rc ? rc : in->end_record(in, tag); |
591 |
return rc; |
592 |
} |
593 |
void deallocate_GetChildrenRequest(struct GetChildrenRequest*v){ |
594 |
deallocate_String(&v->path); |
595 |
} |
596 |
int serialize_GetChildren2Request(struct oarchive *out, const char *tag, struct GetChildren2Request *v){ |
597 |
int rc; |
598 |
rc = out->start_record(out, tag); |
599 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
600 |
rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch); |
601 |
rc = rc ? rc : out->end_record(out, tag); |
602 |
return rc; |
603 |
} |
604 |
int deserialize_GetChildren2Request(struct iarchive *in, const char *tag, struct GetChildren2Request*v){ |
605 |
int rc; |
606 |
rc = in->start_record(in, tag); |
607 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
608 |
rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch); |
609 |
rc = rc ? rc : in->end_record(in, tag); |
610 |
return rc; |
611 |
} |
612 |
void deallocate_GetChildren2Request(struct GetChildren2Request*v){ |
613 |
deallocate_String(&v->path); |
614 |
} |
615 |
int serialize_CheckVersionRequest(struct oarchive *out, const char *tag, struct CheckVersionRequest *v){ |
616 |
int rc; |
617 |
rc = out->start_record(out, tag); |
618 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
619 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
620 |
rc = rc ? rc : out->end_record(out, tag); |
621 |
return rc; |
622 |
} |
623 |
int deserialize_CheckVersionRequest(struct iarchive *in, const char *tag, struct CheckVersionRequest*v){ |
624 |
int rc; |
625 |
rc = in->start_record(in, tag); |
626 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
627 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
628 |
rc = rc ? rc : in->end_record(in, tag); |
629 |
return rc; |
630 |
} |
631 |
void deallocate_CheckVersionRequest(struct CheckVersionRequest*v){ |
632 |
deallocate_String(&v->path); |
633 |
} |
634 |
int serialize_GetMaxChildrenRequest(struct oarchive *out, const char *tag, struct GetMaxChildrenRequest *v){ |
635 |
int rc; |
636 |
rc = out->start_record(out, tag); |
637 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
638 |
rc = rc ? rc : out->end_record(out, tag); |
639 |
return rc; |
640 |
} |
641 |
int deserialize_GetMaxChildrenRequest(struct iarchive *in, const char *tag, struct GetMaxChildrenRequest*v){ |
642 |
int rc; |
643 |
rc = in->start_record(in, tag); |
644 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
645 |
rc = rc ? rc : in->end_record(in, tag); |
646 |
return rc; |
647 |
} |
648 |
void deallocate_GetMaxChildrenRequest(struct GetMaxChildrenRequest*v){ |
649 |
deallocate_String(&v->path); |
650 |
} |
651 |
int serialize_GetMaxChildrenResponse(struct oarchive *out, const char *tag, struct GetMaxChildrenResponse *v){ |
652 |
int rc; |
653 |
rc = out->start_record(out, tag); |
654 |
rc = rc ? rc : out->serialize_Int(out, "max", &v->max); |
655 |
rc = rc ? rc : out->end_record(out, tag); |
656 |
return rc; |
657 |
} |
658 |
int deserialize_GetMaxChildrenResponse(struct iarchive *in, const char *tag, struct GetMaxChildrenResponse*v){ |
659 |
int rc; |
660 |
rc = in->start_record(in, tag); |
661 |
rc = rc ? rc : in->deserialize_Int(in, "max", &v->max); |
662 |
rc = rc ? rc : in->end_record(in, tag); |
663 |
return rc; |
664 |
} |
665 |
void deallocate_GetMaxChildrenResponse(struct GetMaxChildrenResponse*v){ |
666 |
} |
667 |
int serialize_SetMaxChildrenRequest(struct oarchive *out, const char *tag, struct SetMaxChildrenRequest *v){ |
668 |
int rc; |
669 |
rc = out->start_record(out, tag); |
670 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
671 |
rc = rc ? rc : out->serialize_Int(out, "max", &v->max); |
672 |
rc = rc ? rc : out->end_record(out, tag); |
673 |
return rc; |
674 |
} |
675 |
int deserialize_SetMaxChildrenRequest(struct iarchive *in, const char *tag, struct SetMaxChildrenRequest*v){ |
676 |
int rc; |
677 |
rc = in->start_record(in, tag); |
678 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
679 |
rc = rc ? rc : in->deserialize_Int(in, "max", &v->max); |
680 |
rc = rc ? rc : in->end_record(in, tag); |
681 |
return rc; |
682 |
} |
683 |
void deallocate_SetMaxChildrenRequest(struct SetMaxChildrenRequest*v){ |
684 |
deallocate_String(&v->path); |
685 |
} |
686 |
int serialize_SyncRequest(struct oarchive *out, const char *tag, struct SyncRequest *v){ |
687 |
int rc; |
688 |
rc = out->start_record(out, tag); |
689 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
690 |
rc = rc ? rc : out->end_record(out, tag); |
691 |
return rc; |
692 |
} |
693 |
int deserialize_SyncRequest(struct iarchive *in, const char *tag, struct SyncRequest*v){ |
694 |
int rc; |
695 |
rc = in->start_record(in, tag); |
696 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
697 |
rc = rc ? rc : in->end_record(in, tag); |
698 |
return rc; |
699 |
} |
700 |
void deallocate_SyncRequest(struct SyncRequest*v){ |
701 |
deallocate_String(&v->path); |
702 |
} |
703 |
int serialize_SyncResponse(struct oarchive *out, const char *tag, struct SyncResponse *v){ |
704 |
int rc; |
705 |
rc = out->start_record(out, tag); |
706 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
707 |
rc = rc ? rc : out->end_record(out, tag); |
708 |
return rc; |
709 |
} |
710 |
int deserialize_SyncResponse(struct iarchive *in, const char *tag, struct SyncResponse*v){ |
711 |
int rc; |
712 |
rc = in->start_record(in, tag); |
713 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
714 |
rc = rc ? rc : in->end_record(in, tag); |
715 |
return rc; |
716 |
} |
717 |
void deallocate_SyncResponse(struct SyncResponse*v){ |
718 |
deallocate_String(&v->path); |
719 |
} |
720 |
int serialize_GetACLRequest(struct oarchive *out, const char *tag, struct GetACLRequest *v){ |
721 |
int rc; |
722 |
rc = out->start_record(out, tag); |
723 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
724 |
rc = rc ? rc : out->end_record(out, tag); |
725 |
return rc; |
726 |
} |
727 |
int deserialize_GetACLRequest(struct iarchive *in, const char *tag, struct GetACLRequest*v){ |
728 |
int rc; |
729 |
rc = in->start_record(in, tag); |
730 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
731 |
rc = rc ? rc : in->end_record(in, tag); |
732 |
return rc; |
733 |
} |
734 |
void deallocate_GetACLRequest(struct GetACLRequest*v){ |
735 |
deallocate_String(&v->path); |
736 |
} |
737 |
int serialize_SetACLRequest(struct oarchive *out, const char *tag, struct SetACLRequest *v){ |
738 |
int rc; |
739 |
rc = out->start_record(out, tag); |
740 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
741 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
742 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
743 |
rc = rc ? rc : out->end_record(out, tag); |
744 |
return rc; |
745 |
} |
746 |
int deserialize_SetACLRequest(struct iarchive *in, const char *tag, struct SetACLRequest*v){ |
747 |
int rc; |
748 |
rc = in->start_record(in, tag); |
749 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
750 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
751 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
752 |
rc = rc ? rc : in->end_record(in, tag); |
753 |
return rc; |
754 |
} |
755 |
void deallocate_SetACLRequest(struct SetACLRequest*v){ |
756 |
deallocate_String(&v->path); |
757 |
deallocate_ACL_vector(&v->acl); |
758 |
} |
759 |
int serialize_SetACLResponse(struct oarchive *out, const char *tag, struct SetACLResponse *v){ |
760 |
int rc; |
761 |
rc = out->start_record(out, tag); |
762 |
rc = rc ? rc : serialize_Stat(out, "stat", &v->stat); |
763 |
rc = rc ? rc : out->end_record(out, tag); |
764 |
return rc; |
765 |
} |
766 |
int deserialize_SetACLResponse(struct iarchive *in, const char *tag, struct SetACLResponse*v){ |
767 |
int rc; |
768 |
rc = in->start_record(in, tag); |
769 |
rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat); |
770 |
rc = rc ? rc : in->end_record(in, tag); |
771 |
return rc; |
772 |
} |
773 |
void deallocate_SetACLResponse(struct SetACLResponse*v){ |
774 |
deallocate_Stat(&v->stat); |
775 |
} |
776 |
int serialize_WatcherEvent(struct oarchive *out, const char *tag, struct WatcherEvent *v){ |
777 |
int rc; |
778 |
rc = out->start_record(out, tag); |
779 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
780 |
rc = rc ? rc : out->serialize_Int(out, "state", &v->state); |
781 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
782 |
rc = rc ? rc : out->end_record(out, tag); |
783 |
return rc; |
784 |
} |
785 |
int deserialize_WatcherEvent(struct iarchive *in, const char *tag, struct WatcherEvent*v){ |
786 |
int rc; |
787 |
rc = in->start_record(in, tag); |
788 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
789 |
rc = rc ? rc : in->deserialize_Int(in, "state", &v->state); |
790 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
791 |
rc = rc ? rc : in->end_record(in, tag); |
792 |
return rc; |
793 |
} |
794 |
void deallocate_WatcherEvent(struct WatcherEvent*v){ |
795 |
deallocate_String(&v->path); |
796 |
} |
797 |
int serialize_ErrorResponse(struct oarchive *out, const char *tag, struct ErrorResponse *v){ |
798 |
int rc; |
799 |
rc = out->start_record(out, tag); |
800 |
rc = rc ? rc : out->serialize_Int(out, "err", &v->err); |
801 |
rc = rc ? rc : out->end_record(out, tag); |
802 |
return rc; |
803 |
} |
804 |
int deserialize_ErrorResponse(struct iarchive *in, const char *tag, struct ErrorResponse*v){ |
805 |
int rc; |
806 |
rc = in->start_record(in, tag); |
807 |
rc = rc ? rc : in->deserialize_Int(in, "err", &v->err); |
808 |
rc = rc ? rc : in->end_record(in, tag); |
809 |
return rc; |
810 |
} |
811 |
void deallocate_ErrorResponse(struct ErrorResponse*v){ |
812 |
} |
813 |
int serialize_CreateResponse(struct oarchive *out, const char *tag, struct CreateResponse *v){ |
814 |
int rc; |
815 |
rc = out->start_record(out, tag); |
816 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
817 |
rc = rc ? rc : out->end_record(out, tag); |
818 |
return rc; |
819 |
} |
820 |
int deserialize_CreateResponse(struct iarchive *in, const char *tag, struct CreateResponse*v){ |
821 |
int rc; |
822 |
rc = in->start_record(in, tag); |
823 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
824 |
rc = rc ? rc : in->end_record(in, tag); |
825 |
return rc; |
826 |
} |
827 |
void deallocate_CreateResponse(struct CreateResponse*v){ |
828 |
deallocate_String(&v->path); |
829 |
} |
830 |
int serialize_Create2Response(struct oarchive *out, const char *tag, struct Create2Response *v){ |
831 |
int rc; |
832 |
rc = out->start_record(out, tag); |
833 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
834 |
rc = rc ? rc : serialize_Stat(out, "stat", &v->stat); |
835 |
rc = rc ? rc : out->end_record(out, tag); |
836 |
return rc; |
837 |
} |
838 |
int deserialize_Create2Response(struct iarchive *in, const char *tag, struct Create2Response*v){ |
839 |
int rc; |
840 |
rc = in->start_record(in, tag); |
841 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
842 |
rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat); |
843 |
rc = rc ? rc : in->end_record(in, tag); |
844 |
return rc; |
845 |
} |
846 |
void deallocate_Create2Response(struct Create2Response*v){ |
847 |
deallocate_String(&v->path); |
848 |
deallocate_Stat(&v->stat); |
849 |
} |
850 |
int serialize_ExistsRequest(struct oarchive *out, const char *tag, struct ExistsRequest *v){ |
851 |
int rc; |
852 |
rc = out->start_record(out, tag); |
853 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
854 |
rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch); |
855 |
rc = rc ? rc : out->end_record(out, tag); |
856 |
return rc; |
857 |
} |
858 |
int deserialize_ExistsRequest(struct iarchive *in, const char *tag, struct ExistsRequest*v){ |
859 |
int rc; |
860 |
rc = in->start_record(in, tag); |
861 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
862 |
rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch); |
863 |
rc = rc ? rc : in->end_record(in, tag); |
864 |
return rc; |
865 |
} |
866 |
void deallocate_ExistsRequest(struct ExistsRequest*v){ |
867 |
deallocate_String(&v->path); |
868 |
} |
869 |
int serialize_ExistsResponse(struct oarchive *out, const char *tag, struct ExistsResponse *v){ |
870 |
int rc; |
871 |
rc = out->start_record(out, tag); |
872 |
rc = rc ? rc : serialize_Stat(out, "stat", &v->stat); |
873 |
rc = rc ? rc : out->end_record(out, tag); |
874 |
return rc; |
875 |
} |
876 |
int deserialize_ExistsResponse(struct iarchive *in, const char *tag, struct ExistsResponse*v){ |
877 |
int rc; |
878 |
rc = in->start_record(in, tag); |
879 |
rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat); |
880 |
rc = rc ? rc : in->end_record(in, tag); |
881 |
return rc; |
882 |
} |
883 |
void deallocate_ExistsResponse(struct ExistsResponse*v){ |
884 |
deallocate_Stat(&v->stat); |
885 |
} |
886 |
int serialize_GetDataResponse(struct oarchive *out, const char *tag, struct GetDataResponse *v){ |
887 |
int rc; |
888 |
rc = out->start_record(out, tag); |
889 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
890 |
rc = rc ? rc : serialize_Stat(out, "stat", &v->stat); |
891 |
rc = rc ? rc : out->end_record(out, tag); |
892 |
return rc; |
893 |
} |
894 |
int deserialize_GetDataResponse(struct iarchive *in, const char *tag, struct GetDataResponse*v){ |
895 |
int rc; |
896 |
rc = in->start_record(in, tag); |
897 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
898 |
rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat); |
899 |
rc = rc ? rc : in->end_record(in, tag); |
900 |
return rc; |
901 |
} |
902 |
void deallocate_GetDataResponse(struct GetDataResponse*v){ |
903 |
deallocate_Buffer(&v->data); |
904 |
deallocate_Stat(&v->stat); |
905 |
} |
906 |
int serialize_GetChildrenResponse(struct oarchive *out, const char *tag, struct GetChildrenResponse *v){ |
907 |
int rc; |
908 |
rc = out->start_record(out, tag); |
909 |
rc = rc ? rc : serialize_String_vector(out, "children", &v->children); |
910 |
rc = rc ? rc : out->end_record(out, tag); |
911 |
return rc; |
912 |
} |
913 |
int deserialize_GetChildrenResponse(struct iarchive *in, const char *tag, struct GetChildrenResponse*v){ |
914 |
int rc; |
915 |
rc = in->start_record(in, tag); |
916 |
rc = rc ? rc : deserialize_String_vector(in, "children", &v->children); |
917 |
rc = rc ? rc : in->end_record(in, tag); |
918 |
return rc; |
919 |
} |
920 |
void deallocate_GetChildrenResponse(struct GetChildrenResponse*v){ |
921 |
deallocate_String_vector(&v->children); |
922 |
} |
923 |
int serialize_GetChildren2Response(struct oarchive *out, const char *tag, struct GetChildren2Response *v){ |
924 |
int rc; |
925 |
rc = out->start_record(out, tag); |
926 |
rc = rc ? rc : serialize_String_vector(out, "children", &v->children); |
927 |
rc = rc ? rc : serialize_Stat(out, "stat", &v->stat); |
928 |
rc = rc ? rc : out->end_record(out, tag); |
929 |
return rc; |
930 |
} |
931 |
int deserialize_GetChildren2Response(struct iarchive *in, const char *tag, struct GetChildren2Response*v){ |
932 |
int rc; |
933 |
rc = in->start_record(in, tag); |
934 |
rc = rc ? rc : deserialize_String_vector(in, "children", &v->children); |
935 |
rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat); |
936 |
rc = rc ? rc : in->end_record(in, tag); |
937 |
return rc; |
938 |
} |
939 |
void deallocate_GetChildren2Response(struct GetChildren2Response*v){ |
940 |
deallocate_String_vector(&v->children); |
941 |
deallocate_Stat(&v->stat); |
942 |
} |
943 |
int serialize_GetACLResponse(struct oarchive *out, const char *tag, struct GetACLResponse *v){ |
944 |
int rc; |
945 |
rc = out->start_record(out, tag); |
946 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
947 |
rc = rc ? rc : serialize_Stat(out, "stat", &v->stat); |
948 |
rc = rc ? rc : out->end_record(out, tag); |
949 |
return rc; |
950 |
} |
951 |
int deserialize_GetACLResponse(struct iarchive *in, const char *tag, struct GetACLResponse*v){ |
952 |
int rc; |
953 |
rc = in->start_record(in, tag); |
954 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
955 |
rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat); |
956 |
rc = rc ? rc : in->end_record(in, tag); |
957 |
return rc; |
958 |
} |
959 |
void deallocate_GetACLResponse(struct GetACLResponse*v){ |
960 |
deallocate_ACL_vector(&v->acl); |
961 |
deallocate_Stat(&v->stat); |
962 |
} |
963 |
int serialize_CheckWatchesRequest(struct oarchive *out, const char *tag, struct CheckWatchesRequest *v){ |
964 |
int rc; |
965 |
rc = out->start_record(out, tag); |
966 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
967 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
968 |
rc = rc ? rc : out->end_record(out, tag); |
969 |
return rc; |
970 |
} |
971 |
int deserialize_CheckWatchesRequest(struct iarchive *in, const char *tag, struct CheckWatchesRequest*v){ |
972 |
int rc; |
973 |
rc = in->start_record(in, tag); |
974 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
975 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
976 |
rc = rc ? rc : in->end_record(in, tag); |
977 |
return rc; |
978 |
} |
979 |
void deallocate_CheckWatchesRequest(struct CheckWatchesRequest*v){ |
980 |
deallocate_String(&v->path); |
981 |
} |
982 |
int serialize_RemoveWatchesRequest(struct oarchive *out, const char *tag, struct RemoveWatchesRequest *v){ |
983 |
int rc; |
984 |
rc = out->start_record(out, tag); |
985 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
986 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
987 |
rc = rc ? rc : out->end_record(out, tag); |
988 |
return rc; |
989 |
} |
990 |
int deserialize_RemoveWatchesRequest(struct iarchive *in, const char *tag, struct RemoveWatchesRequest*v){ |
991 |
int rc; |
992 |
rc = in->start_record(in, tag); |
993 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
994 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
995 |
rc = rc ? rc : in->end_record(in, tag); |
996 |
return rc; |
997 |
} |
998 |
void deallocate_RemoveWatchesRequest(struct RemoveWatchesRequest*v){ |
999 |
deallocate_String(&v->path); |
1000 |
} |
1001 |
int serialize_LearnerInfo(struct oarchive *out, const char *tag, struct LearnerInfo *v){ |
1002 |
int rc; |
1003 |
rc = out->start_record(out, tag); |
1004 |
rc = rc ? rc : out->serialize_Long(out, "serverid", &v->serverid); |
1005 |
rc = rc ? rc : out->serialize_Int(out, "protocolVersion", &v->protocolVersion); |
1006 |
rc = rc ? rc : out->serialize_Long(out, "configVersion", &v->configVersion); |
1007 |
rc = rc ? rc : out->end_record(out, tag); |
1008 |
return rc; |
1009 |
} |
1010 |
int deserialize_LearnerInfo(struct iarchive *in, const char *tag, struct LearnerInfo*v){ |
1011 |
int rc; |
1012 |
rc = in->start_record(in, tag); |
1013 |
rc = rc ? rc : in->deserialize_Long(in, "serverid", &v->serverid); |
1014 |
rc = rc ? rc : in->deserialize_Int(in, "protocolVersion", &v->protocolVersion); |
1015 |
rc = rc ? rc : in->deserialize_Long(in, "configVersion", &v->configVersion); |
1016 |
rc = rc ? rc : in->end_record(in, tag); |
1017 |
return rc; |
1018 |
} |
1019 |
void deallocate_LearnerInfo(struct LearnerInfo*v){ |
1020 |
} |
1021 |
int allocate_Id_vector(struct Id_vector *v, int32_t len) { |
1022 |
if (!len) { |
1023 |
v->count = 0; |
1024 |
v->data = 0; |
1025 |
} else { |
1026 |
v->count = len; |
1027 |
v->data = calloc(sizeof(*v->data), len); |
1028 |
} |
1029 |
return 0; |
1030 |
} |
1031 |
int deallocate_Id_vector(struct Id_vector *v) { |
1032 |
if (v->data) { |
1033 |
int32_t i; |
1034 |
for(i=0;i<v->count; i++) { |
1035 |
deallocate_Id(&v->data[i]); |
1036 |
} |
1037 |
free(v->data); |
1038 |
v->data = 0; |
1039 |
} |
1040 |
return 0; |
1041 |
} |
1042 |
int serialize_Id_vector(struct oarchive *out, const char *tag, struct Id_vector *v) |
1043 |
{ |
1044 |
int32_t count = v->count; |
1045 |
int rc = 0; |
1046 |
int32_t i; |
1047 |
rc = out->start_vector(out, tag, &count); |
1048 |
for(i=0;i<v->count;i++) { |
1049 |
rc = rc ? rc : serialize_Id(out, "data", &v->data[i]); |
1050 |
} |
1051 |
rc = rc ? rc : out->end_vector(out, tag); |
1052 |
return rc; |
1053 |
} |
1054 |
int deserialize_Id_vector(struct iarchive *in, const char *tag, struct Id_vector *v) |
1055 |
{ |
1056 |
int rc = 0; |
1057 |
int32_t i; |
1058 |
rc = in->start_vector(in, tag, &v->count); |
1059 |
v->data = calloc(v->count, sizeof(*v->data)); |
1060 |
for(i=0;i<v->count;i++) { |
1061 |
rc = rc ? rc : deserialize_Id(in, "value", &v->data[i]); |
1062 |
} |
1063 |
rc = in->end_vector(in, tag); |
1064 |
return rc; |
1065 |
} |
1066 |
int serialize_QuorumPacket(struct oarchive *out, const char *tag, struct QuorumPacket *v){ |
1067 |
int rc; |
1068 |
rc = out->start_record(out, tag); |
1069 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
1070 |
rc = rc ? rc : out->serialize_Long(out, "zxid", &v->zxid); |
1071 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
1072 |
rc = rc ? rc : serialize_Id_vector(out, "authinfo", &v->authinfo); |
1073 |
rc = rc ? rc : out->end_record(out, tag); |
1074 |
return rc; |
1075 |
} |
1076 |
int deserialize_QuorumPacket(struct iarchive *in, const char *tag, struct QuorumPacket*v){ |
1077 |
int rc; |
1078 |
rc = in->start_record(in, tag); |
1079 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
1080 |
rc = rc ? rc : in->deserialize_Long(in, "zxid", &v->zxid); |
1081 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
1082 |
rc = rc ? rc : deserialize_Id_vector(in, "authinfo", &v->authinfo); |
1083 |
rc = rc ? rc : in->end_record(in, tag); |
1084 |
return rc; |
1085 |
} |
1086 |
void deallocate_QuorumPacket(struct QuorumPacket*v){ |
1087 |
deallocate_Buffer(&v->data); |
1088 |
deallocate_Id_vector(&v->authinfo); |
1089 |
} |
1090 |
int serialize_QuorumAuthPacket(struct oarchive *out, const char *tag, struct QuorumAuthPacket *v){ |
1091 |
int rc; |
1092 |
rc = out->start_record(out, tag); |
1093 |
rc = rc ? rc : out->serialize_Long(out, "magic", &v->magic); |
1094 |
rc = rc ? rc : out->serialize_Int(out, "status", &v->status); |
1095 |
rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token); |
1096 |
rc = rc ? rc : out->end_record(out, tag); |
1097 |
return rc; |
1098 |
} |
1099 |
int deserialize_QuorumAuthPacket(struct iarchive *in, const char *tag, struct QuorumAuthPacket*v){ |
1100 |
int rc; |
1101 |
rc = in->start_record(in, tag); |
1102 |
rc = rc ? rc : in->deserialize_Long(in, "magic", &v->magic); |
1103 |
rc = rc ? rc : in->deserialize_Int(in, "status", &v->status); |
1104 |
rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token); |
1105 |
rc = rc ? rc : in->end_record(in, tag); |
1106 |
return rc; |
1107 |
} |
1108 |
void deallocate_QuorumAuthPacket(struct QuorumAuthPacket*v){ |
1109 |
deallocate_Buffer(&v->token); |
1110 |
} |
1111 |
int serialize_FileHeader(struct oarchive *out, const char *tag, struct FileHeader *v){ |
1112 |
int rc; |
1113 |
rc = out->start_record(out, tag); |
1114 |
rc = rc ? rc : out->serialize_Int(out, "magic", &v->magic); |
1115 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
1116 |
rc = rc ? rc : out->serialize_Long(out, "dbid", &v->dbid); |
1117 |
rc = rc ? rc : out->end_record(out, tag); |
1118 |
return rc; |
1119 |
} |
1120 |
int deserialize_FileHeader(struct iarchive *in, const char *tag, struct FileHeader*v){ |
1121 |
int rc; |
1122 |
rc = in->start_record(in, tag); |
1123 |
rc = rc ? rc : in->deserialize_Int(in, "magic", &v->magic); |
1124 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
1125 |
rc = rc ? rc : in->deserialize_Long(in, "dbid", &v->dbid); |
1126 |
rc = rc ? rc : in->end_record(in, tag); |
1127 |
return rc; |
1128 |
} |
1129 |
void deallocate_FileHeader(struct FileHeader*v){ |
1130 |
} |
1131 |
int serialize_TxnHeader(struct oarchive *out, const char *tag, struct TxnHeader *v){ |
1132 |
int rc; |
1133 |
rc = out->start_record(out, tag); |
1134 |
rc = rc ? rc : out->serialize_Long(out, "clientId", &v->clientId); |
1135 |
rc = rc ? rc : out->serialize_Int(out, "cxid", &v->cxid); |
1136 |
rc = rc ? rc : out->serialize_Long(out, "zxid", &v->zxid); |
1137 |
rc = rc ? rc : out->serialize_Long(out, "time", &v->time); |
1138 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
1139 |
rc = rc ? rc : out->end_record(out, tag); |
1140 |
return rc; |
1141 |
} |
1142 |
int deserialize_TxnHeader(struct iarchive *in, const char *tag, struct TxnHeader*v){ |
1143 |
int rc; |
1144 |
rc = in->start_record(in, tag); |
1145 |
rc = rc ? rc : in->deserialize_Long(in, "clientId", &v->clientId); |
1146 |
rc = rc ? rc : in->deserialize_Int(in, "cxid", &v->cxid); |
1147 |
rc = rc ? rc : in->deserialize_Long(in, "zxid", &v->zxid); |
1148 |
rc = rc ? rc : in->deserialize_Long(in, "time", &v->time); |
1149 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
1150 |
rc = rc ? rc : in->end_record(in, tag); |
1151 |
return rc; |
1152 |
} |
1153 |
void deallocate_TxnHeader(struct TxnHeader*v){ |
1154 |
} |
1155 |
int serialize_CreateTxnV0(struct oarchive *out, const char *tag, struct CreateTxnV0 *v){ |
1156 |
int rc; |
1157 |
rc = out->start_record(out, tag); |
1158 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1159 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
1160 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
1161 |
rc = rc ? rc : out->serialize_Bool(out, "ephemeral", &v->ephemeral); |
1162 |
rc = rc ? rc : out->end_record(out, tag); |
1163 |
return rc; |
1164 |
} |
1165 |
int deserialize_CreateTxnV0(struct iarchive *in, const char *tag, struct CreateTxnV0*v){ |
1166 |
int rc; |
1167 |
rc = in->start_record(in, tag); |
1168 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1169 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
1170 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
1171 |
rc = rc ? rc : in->deserialize_Bool(in, "ephemeral", &v->ephemeral); |
1172 |
rc = rc ? rc : in->end_record(in, tag); |
1173 |
return rc; |
1174 |
} |
1175 |
void deallocate_CreateTxnV0(struct CreateTxnV0*v){ |
1176 |
deallocate_String(&v->path); |
1177 |
deallocate_Buffer(&v->data); |
1178 |
deallocate_ACL_vector(&v->acl); |
1179 |
} |
1180 |
int serialize_CreateTxn(struct oarchive *out, const char *tag, struct CreateTxn *v){ |
1181 |
int rc; |
1182 |
rc = out->start_record(out, tag); |
1183 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1184 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
1185 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
1186 |
rc = rc ? rc : out->serialize_Bool(out, "ephemeral", &v->ephemeral); |
1187 |
rc = rc ? rc : out->serialize_Int(out, "parentCVersion", &v->parentCVersion); |
1188 |
rc = rc ? rc : out->end_record(out, tag); |
1189 |
return rc; |
1190 |
} |
1191 |
int deserialize_CreateTxn(struct iarchive *in, const char *tag, struct CreateTxn*v){ |
1192 |
int rc; |
1193 |
rc = in->start_record(in, tag); |
1194 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1195 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
1196 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
1197 |
rc = rc ? rc : in->deserialize_Bool(in, "ephemeral", &v->ephemeral); |
1198 |
rc = rc ? rc : in->deserialize_Int(in, "parentCVersion", &v->parentCVersion); |
1199 |
rc = rc ? rc : in->end_record(in, tag); |
1200 |
return rc; |
1201 |
} |
1202 |
void deallocate_CreateTxn(struct CreateTxn*v){ |
1203 |
deallocate_String(&v->path); |
1204 |
deallocate_Buffer(&v->data); |
1205 |
deallocate_ACL_vector(&v->acl); |
1206 |
} |
1207 |
int serialize_CreateTTLTxn(struct oarchive *out, const char *tag, struct CreateTTLTxn *v){ |
1208 |
int rc; |
1209 |
rc = out->start_record(out, tag); |
1210 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1211 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
1212 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
1213 |
rc = rc ? rc : out->serialize_Int(out, "parentCVersion", &v->parentCVersion); |
1214 |
rc = rc ? rc : out->serialize_Long(out, "ttl", &v->ttl); |
1215 |
rc = rc ? rc : out->end_record(out, tag); |
1216 |
return rc; |
1217 |
} |
1218 |
int deserialize_CreateTTLTxn(struct iarchive *in, const char *tag, struct CreateTTLTxn*v){ |
1219 |
int rc; |
1220 |
rc = in->start_record(in, tag); |
1221 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1222 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
1223 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
1224 |
rc = rc ? rc : in->deserialize_Int(in, "parentCVersion", &v->parentCVersion); |
1225 |
rc = rc ? rc : in->deserialize_Long(in, "ttl", &v->ttl); |
1226 |
rc = rc ? rc : in->end_record(in, tag); |
1227 |
return rc; |
1228 |
} |
1229 |
void deallocate_CreateTTLTxn(struct CreateTTLTxn*v){ |
1230 |
deallocate_String(&v->path); |
1231 |
deallocate_Buffer(&v->data); |
1232 |
deallocate_ACL_vector(&v->acl); |
1233 |
} |
1234 |
int serialize_CreateContainerTxn(struct oarchive *out, const char *tag, struct CreateContainerTxn *v){ |
1235 |
int rc; |
1236 |
rc = out->start_record(out, tag); |
1237 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1238 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
1239 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
1240 |
rc = rc ? rc : out->serialize_Int(out, "parentCVersion", &v->parentCVersion); |
1241 |
rc = rc ? rc : out->end_record(out, tag); |
1242 |
return rc; |
1243 |
} |
1244 |
int deserialize_CreateContainerTxn(struct iarchive *in, const char *tag, struct CreateContainerTxn*v){ |
1245 |
int rc; |
1246 |
rc = in->start_record(in, tag); |
1247 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1248 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
1249 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
1250 |
rc = rc ? rc : in->deserialize_Int(in, "parentCVersion", &v->parentCVersion); |
1251 |
rc = rc ? rc : in->end_record(in, tag); |
1252 |
return rc; |
1253 |
} |
1254 |
void deallocate_CreateContainerTxn(struct CreateContainerTxn*v){ |
1255 |
deallocate_String(&v->path); |
1256 |
deallocate_Buffer(&v->data); |
1257 |
deallocate_ACL_vector(&v->acl); |
1258 |
} |
1259 |
int serialize_DeleteTxn(struct oarchive *out, const char *tag, struct DeleteTxn *v){ |
1260 |
int rc; |
1261 |
rc = out->start_record(out, tag); |
1262 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1263 |
rc = rc ? rc : out->end_record(out, tag); |
1264 |
return rc; |
1265 |
} |
1266 |
int deserialize_DeleteTxn(struct iarchive *in, const char *tag, struct DeleteTxn*v){ |
1267 |
int rc; |
1268 |
rc = in->start_record(in, tag); |
1269 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1270 |
rc = rc ? rc : in->end_record(in, tag); |
1271 |
return rc; |
1272 |
} |
1273 |
void deallocate_DeleteTxn(struct DeleteTxn*v){ |
1274 |
deallocate_String(&v->path); |
1275 |
} |
1276 |
int serialize_SetDataTxn(struct oarchive *out, const char *tag, struct SetDataTxn *v){ |
1277 |
int rc; |
1278 |
rc = out->start_record(out, tag); |
1279 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1280 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
1281 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
1282 |
rc = rc ? rc : out->end_record(out, tag); |
1283 |
return rc; |
1284 |
} |
1285 |
int deserialize_SetDataTxn(struct iarchive *in, const char *tag, struct SetDataTxn*v){ |
1286 |
int rc; |
1287 |
rc = in->start_record(in, tag); |
1288 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1289 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
1290 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
1291 |
rc = rc ? rc : in->end_record(in, tag); |
1292 |
return rc; |
1293 |
} |
1294 |
void deallocate_SetDataTxn(struct SetDataTxn*v){ |
1295 |
deallocate_String(&v->path); |
1296 |
deallocate_Buffer(&v->data); |
1297 |
} |
1298 |
int serialize_CheckVersionTxn(struct oarchive *out, const char *tag, struct CheckVersionTxn *v){ |
1299 |
int rc; |
1300 |
rc = out->start_record(out, tag); |
1301 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1302 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
1303 |
rc = rc ? rc : out->end_record(out, tag); |
1304 |
return rc; |
1305 |
} |
1306 |
int deserialize_CheckVersionTxn(struct iarchive *in, const char *tag, struct CheckVersionTxn*v){ |
1307 |
int rc; |
1308 |
rc = in->start_record(in, tag); |
1309 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1310 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
1311 |
rc = rc ? rc : in->end_record(in, tag); |
1312 |
return rc; |
1313 |
} |
1314 |
void deallocate_CheckVersionTxn(struct CheckVersionTxn*v){ |
1315 |
deallocate_String(&v->path); |
1316 |
} |
1317 |
int serialize_SetACLTxn(struct oarchive *out, const char *tag, struct SetACLTxn *v){ |
1318 |
int rc; |
1319 |
rc = out->start_record(out, tag); |
1320 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1321 |
rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl); |
1322 |
rc = rc ? rc : out->serialize_Int(out, "version", &v->version); |
1323 |
rc = rc ? rc : out->end_record(out, tag); |
1324 |
return rc; |
1325 |
} |
1326 |
int deserialize_SetACLTxn(struct iarchive *in, const char *tag, struct SetACLTxn*v){ |
1327 |
int rc; |
1328 |
rc = in->start_record(in, tag); |
1329 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1330 |
rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl); |
1331 |
rc = rc ? rc : in->deserialize_Int(in, "version", &v->version); |
1332 |
rc = rc ? rc : in->end_record(in, tag); |
1333 |
return rc; |
1334 |
} |
1335 |
void deallocate_SetACLTxn(struct SetACLTxn*v){ |
1336 |
deallocate_String(&v->path); |
1337 |
deallocate_ACL_vector(&v->acl); |
1338 |
} |
1339 |
int serialize_SetMaxChildrenTxn(struct oarchive *out, const char *tag, struct SetMaxChildrenTxn *v){ |
1340 |
int rc; |
1341 |
rc = out->start_record(out, tag); |
1342 |
rc = rc ? rc : out->serialize_String(out, "path", &v->path); |
1343 |
rc = rc ? rc : out->serialize_Int(out, "max", &v->max); |
1344 |
rc = rc ? rc : out->end_record(out, tag); |
1345 |
return rc; |
1346 |
} |
1347 |
int deserialize_SetMaxChildrenTxn(struct iarchive *in, const char *tag, struct SetMaxChildrenTxn*v){ |
1348 |
int rc; |
1349 |
rc = in->start_record(in, tag); |
1350 |
rc = rc ? rc : in->deserialize_String(in, "path", &v->path); |
1351 |
rc = rc ? rc : in->deserialize_Int(in, "max", &v->max); |
1352 |
rc = rc ? rc : in->end_record(in, tag); |
1353 |
return rc; |
1354 |
} |
1355 |
void deallocate_SetMaxChildrenTxn(struct SetMaxChildrenTxn*v){ |
1356 |
deallocate_String(&v->path); |
1357 |
} |
1358 |
int serialize_CreateSessionTxn(struct oarchive *out, const char *tag, struct CreateSessionTxn *v){ |
1359 |
int rc; |
1360 |
rc = out->start_record(out, tag); |
1361 |
rc = rc ? rc : out->serialize_Int(out, "timeOut", &v->timeOut); |
1362 |
rc = rc ? rc : out->end_record(out, tag); |
1363 |
return rc; |
1364 |
} |
1365 |
int deserialize_CreateSessionTxn(struct iarchive *in, const char *tag, struct CreateSessionTxn*v){ |
1366 |
int rc; |
1367 |
rc = in->start_record(in, tag); |
1368 |
rc = rc ? rc : in->deserialize_Int(in, "timeOut", &v->timeOut); |
1369 |
rc = rc ? rc : in->end_record(in, tag); |
1370 |
return rc; |
1371 |
} |
1372 |
void deallocate_CreateSessionTxn(struct CreateSessionTxn*v){ |
1373 |
} |
1374 |
int serialize_ErrorTxn(struct oarchive *out, const char *tag, struct ErrorTxn *v){ |
1375 |
int rc; |
1376 |
rc = out->start_record(out, tag); |
1377 |
rc = rc ? rc : out->serialize_Int(out, "err", &v->err); |
1378 |
rc = rc ? rc : out->end_record(out, tag); |
1379 |
return rc; |
1380 |
} |
1381 |
int deserialize_ErrorTxn(struct iarchive *in, const char *tag, struct ErrorTxn*v){ |
1382 |
int rc; |
1383 |
rc = in->start_record(in, tag); |
1384 |
rc = rc ? rc : in->deserialize_Int(in, "err", &v->err); |
1385 |
rc = rc ? rc : in->end_record(in, tag); |
1386 |
return rc; |
1387 |
} |
1388 |
void deallocate_ErrorTxn(struct ErrorTxn*v){ |
1389 |
} |
1390 |
int serialize_Txn(struct oarchive *out, const char *tag, struct Txn *v){ |
1391 |
int rc; |
1392 |
rc = out->start_record(out, tag); |
1393 |
rc = rc ? rc : out->serialize_Int(out, "type", &v->type); |
1394 |
rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data); |
1395 |
rc = rc ? rc : out->end_record(out, tag); |
1396 |
return rc; |
1397 |
} |
1398 |
int deserialize_Txn(struct iarchive *in, const char *tag, struct Txn*v){ |
1399 |
int rc; |
1400 |
rc = in->start_record(in, tag); |
1401 |
rc = rc ? rc : in->deserialize_Int(in, "type", &v->type); |
1402 |
rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data); |
1403 |
rc = rc ? rc : in->end_record(in, tag); |
1404 |
return rc; |
1405 |
} |
1406 |
void deallocate_Txn(struct Txn*v){ |
1407 |
deallocate_Buffer(&v->data); |
1408 |
} |
1409 |
int allocate_Txn_vector(struct Txn_vector *v, int32_t len) { |
1410 |
if (!len) { |
1411 |
v->count = 0; |
1412 |
v->data = 0; |
1413 |
} else { |
1414 |
v->count = len; |
1415 |
v->data = calloc(sizeof(*v->data), len); |
1416 |
} |
1417 |
return 0; |
1418 |
} |
1419 |
int deallocate_Txn_vector(struct Txn_vector *v) { |
1420 |
if (v->data) { |
1421 |
int32_t i; |
1422 |
for(i=0;i<v->count; i++) { |
1423 |
deallocate_Txn(&v->data[i]); |
1424 |
} |
1425 |
free(v->data); |
1426 |
v->data = 0; |
1427 |
} |
1428 |
return 0; |
1429 |
} |
1430 |
int serialize_Txn_vector(struct oarchive *out, const char *tag, struct Txn_vector *v) |
1431 |
{ |
1432 |
int32_t count = v->count; |
1433 |
int rc = 0; |
1434 |
int32_t i; |
1435 |
rc = out->start_vector(out, tag, &count); |
1436 |
for(i=0;i<v->count;i++) { |
1437 |
rc = rc ? rc : serialize_Txn(out, "data", &v->data[i]); |
1438 |
} |
1439 |
rc = rc ? rc : out->end_vector(out, tag); |
1440 |
return rc; |
1441 |
} |
1442 |
int deserialize_Txn_vector(struct iarchive *in, const char *tag, struct Txn_vector *v) |
1443 |
{ |
1444 |
int rc = 0; |
1445 |
int32_t i; |
1446 |
rc = in->start_vector(in, tag, &v->count); |
1447 |
v->data = calloc(v->count, sizeof(*v->data)); |
1448 |
for(i=0;i<v->count;i++) { |
1449 |
rc = rc ? rc : deserialize_Txn(in, "value", &v->data[i]); |
1450 |
} |
1451 |
rc = in->end_vector(in, tag); |
1452 |
return rc; |
1453 |
} |
1454 |
int serialize_MultiTxn(struct oarchive *out, const char *tag, struct MultiTxn *v){ |
1455 |
int rc; |
1456 |
rc = out->start_record(out, tag); |
1457 |
rc = rc ? rc : serialize_Txn_vector(out, "txns", &v->txns); |
1458 |
rc = rc ? rc : out->end_record(out, tag); |
1459 |
return rc; |
1460 |
} |
1461 |
int deserialize_MultiTxn(struct iarchive *in, const char *tag, struct MultiTxn*v){ |
1462 |
int rc; |
1463 |
rc = in->start_record(in, tag); |
1464 |
rc = rc ? rc : deserialize_Txn_vector(in, "txns", &v->txns); |
1465 |
rc = rc ? rc : in->end_record(in, tag); |
1466 |
return rc; |
1467 |
} |
1468 |
void deallocate_MultiTxn(struct MultiTxn*v){ |
1469 |
deallocate_Txn_vector(&v->txns); |
1470 |
} |