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 
serialize_Id(struct oarchive * out,const char * tag,struct Id * v)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 }
deserialize_Id(struct iarchive * in,const char * tag,struct Id * v)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 }
deallocate_Id(struct Id * v)38 void deallocate_Id(struct Id*v){
39     deallocate_String(&v->scheme);
40     deallocate_String(&v->id);
41 }
serialize_ACL(struct oarchive * out,const char * tag,struct ACL * v)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 }
deserialize_ACL(struct iarchive * in,const char * tag,struct ACL * v)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 }
deallocate_ACL(struct ACL * v)58 void deallocate_ACL(struct ACL*v){
59     deallocate_Id(&v->id);
60 }
serialize_Stat(struct oarchive * out,const char * tag,struct Stat * v)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 }
deserialize_Stat(struct iarchive * in,const char * tag,struct Stat * v)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 }
deallocate_Stat(struct Stat * v)95 void deallocate_Stat(struct Stat*v){
96 }
serialize_StatPersisted(struct oarchive * out,const char * tag,struct StatPersisted * v)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 }
deserialize_StatPersisted(struct iarchive * in,const char * tag,struct StatPersisted * v)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 }
deallocate_StatPersisted(struct StatPersisted * v)127 void deallocate_StatPersisted(struct StatPersisted*v){
128 }
serialize_ClientInfo(struct oarchive * out,const char * tag,struct ClientInfo * v)129 int serialize_ClientInfo(struct oarchive *out, const char *tag, struct ClientInfo *v){
130     int rc;
131     rc = out->start_record(out, tag);
132     rc = rc ? rc : out->serialize_String(out, "authScheme", &v->authScheme);
133     rc = rc ? rc : out->serialize_String(out, "user", &v->user);
134     rc = rc ? rc : out->end_record(out, tag);
135     return rc;
136 }
deserialize_ClientInfo(struct iarchive * in,const char * tag,struct ClientInfo * v)137 int deserialize_ClientInfo(struct iarchive *in, const char *tag, struct ClientInfo*v){
138     int rc;
139     rc = in->start_record(in, tag);
140     rc = rc ? rc : in->deserialize_String(in, "authScheme", &v->authScheme);
141     rc = rc ? rc : in->deserialize_String(in, "user", &v->user);
142     rc = rc ? rc : in->end_record(in, tag);
143     return rc;
144 }
deallocate_ClientInfo(struct ClientInfo * v)145 void deallocate_ClientInfo(struct ClientInfo*v){
146     deallocate_String(&v->authScheme);
147     deallocate_String(&v->user);
148 }
serialize_ConnectRequest(struct oarchive * out,const char * tag,struct ConnectRequest * v)149 int serialize_ConnectRequest(struct oarchive *out, const char *tag, struct ConnectRequest *v){
150     int rc;
151     rc = out->start_record(out, tag);
152     rc = rc ? rc : out->serialize_Int(out, "protocolVersion", &v->protocolVersion);
153     rc = rc ? rc : out->serialize_Long(out, "lastZxidSeen", &v->lastZxidSeen);
154     rc = rc ? rc : out->serialize_Int(out, "timeOut", &v->timeOut);
155     rc = rc ? rc : out->serialize_Long(out, "sessionId", &v->sessionId);
156     rc = rc ? rc : out->serialize_Buffer(out, "passwd", &v->passwd);
157     rc = rc ? rc : out->end_record(out, tag);
158     return rc;
159 }
deserialize_ConnectRequest(struct iarchive * in,const char * tag,struct ConnectRequest * v)160 int deserialize_ConnectRequest(struct iarchive *in, const char *tag, struct ConnectRequest*v){
161     int rc;
162     rc = in->start_record(in, tag);
163     rc = rc ? rc : in->deserialize_Int(in, "protocolVersion", &v->protocolVersion);
164     rc = rc ? rc : in->deserialize_Long(in, "lastZxidSeen", &v->lastZxidSeen);
165     rc = rc ? rc : in->deserialize_Int(in, "timeOut", &v->timeOut);
166     rc = rc ? rc : in->deserialize_Long(in, "sessionId", &v->sessionId);
167     rc = rc ? rc : in->deserialize_Buffer(in, "passwd", &v->passwd);
168     rc = rc ? rc : in->end_record(in, tag);
169     return rc;
170 }
deallocate_ConnectRequest(struct ConnectRequest * v)171 void deallocate_ConnectRequest(struct ConnectRequest*v){
172     deallocate_Buffer(&v->passwd);
173 }
serialize_ConnectResponse(struct oarchive * out,const char * tag,struct ConnectResponse * v)174 int serialize_ConnectResponse(struct oarchive *out, const char *tag, struct ConnectResponse *v){
175     int rc;
176     rc = out->start_record(out, tag);
177     rc = rc ? rc : out->serialize_Int(out, "protocolVersion", &v->protocolVersion);
178     rc = rc ? rc : out->serialize_Int(out, "timeOut", &v->timeOut);
179     rc = rc ? rc : out->serialize_Long(out, "sessionId", &v->sessionId);
180     rc = rc ? rc : out->serialize_Buffer(out, "passwd", &v->passwd);
181     rc = rc ? rc : out->end_record(out, tag);
182     return rc;
183 }
deserialize_ConnectResponse(struct iarchive * in,const char * tag,struct ConnectResponse * v)184 int deserialize_ConnectResponse(struct iarchive *in, const char *tag, struct ConnectResponse*v){
185     int rc;
186     rc = in->start_record(in, tag);
187     rc = rc ? rc : in->deserialize_Int(in, "protocolVersion", &v->protocolVersion);
188     rc = rc ? rc : in->deserialize_Int(in, "timeOut", &v->timeOut);
189     rc = rc ? rc : in->deserialize_Long(in, "sessionId", &v->sessionId);
190     rc = rc ? rc : in->deserialize_Buffer(in, "passwd", &v->passwd);
191     rc = rc ? rc : in->end_record(in, tag);
192     return rc;
193 }
deallocate_ConnectResponse(struct ConnectResponse * v)194 void deallocate_ConnectResponse(struct ConnectResponse*v){
195     deallocate_Buffer(&v->passwd);
196 }
allocate_String_vector(struct String_vector * v,int32_t len)197 int allocate_String_vector(struct String_vector *v, int32_t len) {
198     if (!len) {
199         v->count = 0;
200         v->data = 0;
201     } else {
202         v->count = len;
203         v->data = calloc(sizeof(*v->data), len);
204     }
205     return 0;
206 }
deallocate_String_vector(struct String_vector * v)207 int deallocate_String_vector(struct String_vector *v) {
208     if (v->data) {
209         int32_t i;
210         for(i=0;i<v->count; i++) {
211             deallocate_String(&v->data[i]);
212         }
213         free(v->data);
214         v->data = 0;
215     }
216     return 0;
217 }
serialize_String_vector(struct oarchive * out,const char * tag,struct String_vector * v)218 int serialize_String_vector(struct oarchive *out, const char *tag, struct String_vector *v)
219 {
220     int32_t count = v->count;
221     int rc = 0;
222     int32_t i;
223     rc = out->start_vector(out, tag, &count);
224     for(i=0;i<v->count;i++) {
225     rc = rc ? rc : out->serialize_String(out, "data", &v->data[i]);
226     }
227     rc = rc ? rc : out->end_vector(out, tag);
228     return rc;
229 }
deserialize_String_vector(struct iarchive * in,const char * tag,struct String_vector * v)230 int deserialize_String_vector(struct iarchive *in, const char *tag, struct String_vector *v)
231 {
232     int rc = 0;
233     int32_t i;
234     rc = in->start_vector(in, tag, &v->count);
235     v->data = calloc(v->count, sizeof(*v->data));
236     for(i=0;i<v->count;i++) {
237     rc = rc ? rc : in->deserialize_String(in, "value", &v->data[i]);
238     }
239     rc = in->end_vector(in, tag);
240     return rc;
241 }
serialize_SetWatches(struct oarchive * out,const char * tag,struct SetWatches * v)242 int serialize_SetWatches(struct oarchive *out, const char *tag, struct SetWatches *v){
243     int rc;
244     rc = out->start_record(out, tag);
245     rc = rc ? rc : out->serialize_Long(out, "relativeZxid", &v->relativeZxid);
246     rc = rc ? rc : serialize_String_vector(out, "dataWatches", &v->dataWatches);
247     rc = rc ? rc : serialize_String_vector(out, "existWatches", &v->existWatches);
248     rc = rc ? rc : serialize_String_vector(out, "childWatches", &v->childWatches);
249     rc = rc ? rc : out->end_record(out, tag);
250     return rc;
251 }
deserialize_SetWatches(struct iarchive * in,const char * tag,struct SetWatches * v)252 int deserialize_SetWatches(struct iarchive *in, const char *tag, struct SetWatches*v){
253     int rc;
254     rc = in->start_record(in, tag);
255     rc = rc ? rc : in->deserialize_Long(in, "relativeZxid", &v->relativeZxid);
256     rc = rc ? rc : deserialize_String_vector(in, "dataWatches", &v->dataWatches);
257     rc = rc ? rc : deserialize_String_vector(in, "existWatches", &v->existWatches);
258     rc = rc ? rc : deserialize_String_vector(in, "childWatches", &v->childWatches);
259     rc = rc ? rc : in->end_record(in, tag);
260     return rc;
261 }
deallocate_SetWatches(struct SetWatches * v)262 void deallocate_SetWatches(struct SetWatches*v){
263     deallocate_String_vector(&v->dataWatches);
264     deallocate_String_vector(&v->existWatches);
265     deallocate_String_vector(&v->childWatches);
266 }
serialize_SetWatches2(struct oarchive * out,const char * tag,struct SetWatches2 * v)267 int serialize_SetWatches2(struct oarchive *out, const char *tag, struct SetWatches2 *v){
268     int rc;
269     rc = out->start_record(out, tag);
270     rc = rc ? rc : out->serialize_Long(out, "relativeZxid", &v->relativeZxid);
271     rc = rc ? rc : serialize_String_vector(out, "dataWatches", &v->dataWatches);
272     rc = rc ? rc : serialize_String_vector(out, "existWatches", &v->existWatches);
273     rc = rc ? rc : serialize_String_vector(out, "childWatches", &v->childWatches);
274     rc = rc ? rc : serialize_String_vector(out, "persistentWatches", &v->persistentWatches);
275     rc = rc ? rc : serialize_String_vector(out, "persistentRecursiveWatches", &v->persistentRecursiveWatches);
276     rc = rc ? rc : out->end_record(out, tag);
277     return rc;
278 }
deserialize_SetWatches2(struct iarchive * in,const char * tag,struct SetWatches2 * v)279 int deserialize_SetWatches2(struct iarchive *in, const char *tag, struct SetWatches2*v){
280     int rc;
281     rc = in->start_record(in, tag);
282     rc = rc ? rc : in->deserialize_Long(in, "relativeZxid", &v->relativeZxid);
283     rc = rc ? rc : deserialize_String_vector(in, "dataWatches", &v->dataWatches);
284     rc = rc ? rc : deserialize_String_vector(in, "existWatches", &v->existWatches);
285     rc = rc ? rc : deserialize_String_vector(in, "childWatches", &v->childWatches);
286     rc = rc ? rc : deserialize_String_vector(in, "persistentWatches", &v->persistentWatches);
287     rc = rc ? rc : deserialize_String_vector(in, "persistentRecursiveWatches", &v->persistentRecursiveWatches);
288     rc = rc ? rc : in->end_record(in, tag);
289     return rc;
290 }
deallocate_SetWatches2(struct SetWatches2 * v)291 void deallocate_SetWatches2(struct SetWatches2*v){
292     deallocate_String_vector(&v->dataWatches);
293     deallocate_String_vector(&v->existWatches);
294     deallocate_String_vector(&v->childWatches);
295     deallocate_String_vector(&v->persistentWatches);
296     deallocate_String_vector(&v->persistentRecursiveWatches);
297 }
serialize_RequestHeader(struct oarchive * out,const char * tag,struct RequestHeader * v)298 int serialize_RequestHeader(struct oarchive *out, const char *tag, struct RequestHeader *v){
299     int rc;
300     rc = out->start_record(out, tag);
301     rc = rc ? rc : out->serialize_Int(out, "xid", &v->xid);
302     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
303     rc = rc ? rc : out->end_record(out, tag);
304     return rc;
305 }
deserialize_RequestHeader(struct iarchive * in,const char * tag,struct RequestHeader * v)306 int deserialize_RequestHeader(struct iarchive *in, const char *tag, struct RequestHeader*v){
307     int rc;
308     rc = in->start_record(in, tag);
309     rc = rc ? rc : in->deserialize_Int(in, "xid", &v->xid);
310     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
311     rc = rc ? rc : in->end_record(in, tag);
312     return rc;
313 }
deallocate_RequestHeader(struct RequestHeader * v)314 void deallocate_RequestHeader(struct RequestHeader*v){
315 }
serialize_MultiHeader(struct oarchive * out,const char * tag,struct MultiHeader * v)316 int serialize_MultiHeader(struct oarchive *out, const char *tag, struct MultiHeader *v){
317     int rc;
318     rc = out->start_record(out, tag);
319     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
320     rc = rc ? rc : out->serialize_Bool(out, "done", &v->done);
321     rc = rc ? rc : out->serialize_Int(out, "err", &v->err);
322     rc = rc ? rc : out->end_record(out, tag);
323     return rc;
324 }
deserialize_MultiHeader(struct iarchive * in,const char * tag,struct MultiHeader * v)325 int deserialize_MultiHeader(struct iarchive *in, const char *tag, struct MultiHeader*v){
326     int rc;
327     rc = in->start_record(in, tag);
328     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
329     rc = rc ? rc : in->deserialize_Bool(in, "done", &v->done);
330     rc = rc ? rc : in->deserialize_Int(in, "err", &v->err);
331     rc = rc ? rc : in->end_record(in, tag);
332     return rc;
333 }
deallocate_MultiHeader(struct MultiHeader * v)334 void deallocate_MultiHeader(struct MultiHeader*v){
335 }
serialize_AuthPacket(struct oarchive * out,const char * tag,struct AuthPacket * v)336 int serialize_AuthPacket(struct oarchive *out, const char *tag, struct AuthPacket *v){
337     int rc;
338     rc = out->start_record(out, tag);
339     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
340     rc = rc ? rc : out->serialize_String(out, "scheme", &v->scheme);
341     rc = rc ? rc : out->serialize_Buffer(out, "auth", &v->auth);
342     rc = rc ? rc : out->end_record(out, tag);
343     return rc;
344 }
deserialize_AuthPacket(struct iarchive * in,const char * tag,struct AuthPacket * v)345 int deserialize_AuthPacket(struct iarchive *in, const char *tag, struct AuthPacket*v){
346     int rc;
347     rc = in->start_record(in, tag);
348     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
349     rc = rc ? rc : in->deserialize_String(in, "scheme", &v->scheme);
350     rc = rc ? rc : in->deserialize_Buffer(in, "auth", &v->auth);
351     rc = rc ? rc : in->end_record(in, tag);
352     return rc;
353 }
deallocate_AuthPacket(struct AuthPacket * v)354 void deallocate_AuthPacket(struct AuthPacket*v){
355     deallocate_String(&v->scheme);
356     deallocate_Buffer(&v->auth);
357 }
serialize_ReplyHeader(struct oarchive * out,const char * tag,struct ReplyHeader * v)358 int serialize_ReplyHeader(struct oarchive *out, const char *tag, struct ReplyHeader *v){
359     int rc;
360     rc = out->start_record(out, tag);
361     rc = rc ? rc : out->serialize_Int(out, "xid", &v->xid);
362     rc = rc ? rc : out->serialize_Long(out, "zxid", &v->zxid);
363     rc = rc ? rc : out->serialize_Int(out, "err", &v->err);
364     rc = rc ? rc : out->end_record(out, tag);
365     return rc;
366 }
deserialize_ReplyHeader(struct iarchive * in,const char * tag,struct ReplyHeader * v)367 int deserialize_ReplyHeader(struct iarchive *in, const char *tag, struct ReplyHeader*v){
368     int rc;
369     rc = in->start_record(in, tag);
370     rc = rc ? rc : in->deserialize_Int(in, "xid", &v->xid);
371     rc = rc ? rc : in->deserialize_Long(in, "zxid", &v->zxid);
372     rc = rc ? rc : in->deserialize_Int(in, "err", &v->err);
373     rc = rc ? rc : in->end_record(in, tag);
374     return rc;
375 }
deallocate_ReplyHeader(struct ReplyHeader * v)376 void deallocate_ReplyHeader(struct ReplyHeader*v){
377 }
serialize_GetDataRequest(struct oarchive * out,const char * tag,struct GetDataRequest * v)378 int serialize_GetDataRequest(struct oarchive *out, const char *tag, struct GetDataRequest *v){
379     int rc;
380     rc = out->start_record(out, tag);
381     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
382     rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch);
383     rc = rc ? rc : out->end_record(out, tag);
384     return rc;
385 }
deserialize_GetDataRequest(struct iarchive * in,const char * tag,struct GetDataRequest * v)386 int deserialize_GetDataRequest(struct iarchive *in, const char *tag, struct GetDataRequest*v){
387     int rc;
388     rc = in->start_record(in, tag);
389     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
390     rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch);
391     rc = rc ? rc : in->end_record(in, tag);
392     return rc;
393 }
deallocate_GetDataRequest(struct GetDataRequest * v)394 void deallocate_GetDataRequest(struct GetDataRequest*v){
395     deallocate_String(&v->path);
396 }
serialize_SetDataRequest(struct oarchive * out,const char * tag,struct SetDataRequest * v)397 int serialize_SetDataRequest(struct oarchive *out, const char *tag, struct SetDataRequest *v){
398     int rc;
399     rc = out->start_record(out, tag);
400     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
401     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
402     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
403     rc = rc ? rc : out->end_record(out, tag);
404     return rc;
405 }
deserialize_SetDataRequest(struct iarchive * in,const char * tag,struct SetDataRequest * v)406 int deserialize_SetDataRequest(struct iarchive *in, const char *tag, struct SetDataRequest*v){
407     int rc;
408     rc = in->start_record(in, tag);
409     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
410     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
411     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
412     rc = rc ? rc : in->end_record(in, tag);
413     return rc;
414 }
deallocate_SetDataRequest(struct SetDataRequest * v)415 void deallocate_SetDataRequest(struct SetDataRequest*v){
416     deallocate_String(&v->path);
417     deallocate_Buffer(&v->data);
418 }
serialize_ReconfigRequest(struct oarchive * out,const char * tag,struct ReconfigRequest * v)419 int serialize_ReconfigRequest(struct oarchive *out, const char *tag, struct ReconfigRequest *v){
420     int rc;
421     rc = out->start_record(out, tag);
422     rc = rc ? rc : out->serialize_String(out, "joiningServers", &v->joiningServers);
423     rc = rc ? rc : out->serialize_String(out, "leavingServers", &v->leavingServers);
424     rc = rc ? rc : out->serialize_String(out, "newMembers", &v->newMembers);
425     rc = rc ? rc : out->serialize_Long(out, "curConfigId", &v->curConfigId);
426     rc = rc ? rc : out->end_record(out, tag);
427     return rc;
428 }
deserialize_ReconfigRequest(struct iarchive * in,const char * tag,struct ReconfigRequest * v)429 int deserialize_ReconfigRequest(struct iarchive *in, const char *tag, struct ReconfigRequest*v){
430     int rc;
431     rc = in->start_record(in, tag);
432     rc = rc ? rc : in->deserialize_String(in, "joiningServers", &v->joiningServers);
433     rc = rc ? rc : in->deserialize_String(in, "leavingServers", &v->leavingServers);
434     rc = rc ? rc : in->deserialize_String(in, "newMembers", &v->newMembers);
435     rc = rc ? rc : in->deserialize_Long(in, "curConfigId", &v->curConfigId);
436     rc = rc ? rc : in->end_record(in, tag);
437     return rc;
438 }
deallocate_ReconfigRequest(struct ReconfigRequest * v)439 void deallocate_ReconfigRequest(struct ReconfigRequest*v){
440     deallocate_String(&v->joiningServers);
441     deallocate_String(&v->leavingServers);
442     deallocate_String(&v->newMembers);
443 }
serialize_SetDataResponse(struct oarchive * out,const char * tag,struct SetDataResponse * v)444 int serialize_SetDataResponse(struct oarchive *out, const char *tag, struct SetDataResponse *v){
445     int rc;
446     rc = out->start_record(out, tag);
447     rc = rc ? rc : serialize_Stat(out, "stat", &v->stat);
448     rc = rc ? rc : out->end_record(out, tag);
449     return rc;
450 }
deserialize_SetDataResponse(struct iarchive * in,const char * tag,struct SetDataResponse * v)451 int deserialize_SetDataResponse(struct iarchive *in, const char *tag, struct SetDataResponse*v){
452     int rc;
453     rc = in->start_record(in, tag);
454     rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat);
455     rc = rc ? rc : in->end_record(in, tag);
456     return rc;
457 }
deallocate_SetDataResponse(struct SetDataResponse * v)458 void deallocate_SetDataResponse(struct SetDataResponse*v){
459     deallocate_Stat(&v->stat);
460 }
serialize_GetSASLRequest(struct oarchive * out,const char * tag,struct GetSASLRequest * v)461 int serialize_GetSASLRequest(struct oarchive *out, const char *tag, struct GetSASLRequest *v){
462     int rc;
463     rc = out->start_record(out, tag);
464     rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token);
465     rc = rc ? rc : out->end_record(out, tag);
466     return rc;
467 }
deserialize_GetSASLRequest(struct iarchive * in,const char * tag,struct GetSASLRequest * v)468 int deserialize_GetSASLRequest(struct iarchive *in, const char *tag, struct GetSASLRequest*v){
469     int rc;
470     rc = in->start_record(in, tag);
471     rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token);
472     rc = rc ? rc : in->end_record(in, tag);
473     return rc;
474 }
deallocate_GetSASLRequest(struct GetSASLRequest * v)475 void deallocate_GetSASLRequest(struct GetSASLRequest*v){
476     deallocate_Buffer(&v->token);
477 }
serialize_SetSASLRequest(struct oarchive * out,const char * tag,struct SetSASLRequest * v)478 int serialize_SetSASLRequest(struct oarchive *out, const char *tag, struct SetSASLRequest *v){
479     int rc;
480     rc = out->start_record(out, tag);
481     rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token);
482     rc = rc ? rc : out->end_record(out, tag);
483     return rc;
484 }
deserialize_SetSASLRequest(struct iarchive * in,const char * tag,struct SetSASLRequest * v)485 int deserialize_SetSASLRequest(struct iarchive *in, const char *tag, struct SetSASLRequest*v){
486     int rc;
487     rc = in->start_record(in, tag);
488     rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token);
489     rc = rc ? rc : in->end_record(in, tag);
490     return rc;
491 }
deallocate_SetSASLRequest(struct SetSASLRequest * v)492 void deallocate_SetSASLRequest(struct SetSASLRequest*v){
493     deallocate_Buffer(&v->token);
494 }
serialize_SetSASLResponse(struct oarchive * out,const char * tag,struct SetSASLResponse * v)495 int serialize_SetSASLResponse(struct oarchive *out, const char *tag, struct SetSASLResponse *v){
496     int rc;
497     rc = out->start_record(out, tag);
498     rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token);
499     rc = rc ? rc : out->end_record(out, tag);
500     return rc;
501 }
deserialize_SetSASLResponse(struct iarchive * in,const char * tag,struct SetSASLResponse * v)502 int deserialize_SetSASLResponse(struct iarchive *in, const char *tag, struct SetSASLResponse*v){
503     int rc;
504     rc = in->start_record(in, tag);
505     rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token);
506     rc = rc ? rc : in->end_record(in, tag);
507     return rc;
508 }
deallocate_SetSASLResponse(struct SetSASLResponse * v)509 void deallocate_SetSASLResponse(struct SetSASLResponse*v){
510     deallocate_Buffer(&v->token);
511 }
allocate_ACL_vector(struct ACL_vector * v,int32_t len)512 int allocate_ACL_vector(struct ACL_vector *v, int32_t len) {
513     if (!len) {
514         v->count = 0;
515         v->data = 0;
516     } else {
517         v->count = len;
518         v->data = calloc(sizeof(*v->data), len);
519     }
520     return 0;
521 }
deallocate_ACL_vector(struct ACL_vector * v)522 int deallocate_ACL_vector(struct ACL_vector *v) {
523     if (v->data) {
524         int32_t i;
525         for(i=0;i<v->count; i++) {
526             deallocate_ACL(&v->data[i]);
527         }
528         free(v->data);
529         v->data = 0;
530     }
531     return 0;
532 }
serialize_ACL_vector(struct oarchive * out,const char * tag,struct ACL_vector * v)533 int serialize_ACL_vector(struct oarchive *out, const char *tag, struct ACL_vector *v)
534 {
535     int32_t count = v->count;
536     int rc = 0;
537     int32_t i;
538     rc = out->start_vector(out, tag, &count);
539     for(i=0;i<v->count;i++) {
540     rc = rc ? rc : serialize_ACL(out, "data", &v->data[i]);
541     }
542     rc = rc ? rc : out->end_vector(out, tag);
543     return rc;
544 }
deserialize_ACL_vector(struct iarchive * in,const char * tag,struct ACL_vector * v)545 int deserialize_ACL_vector(struct iarchive *in, const char *tag, struct ACL_vector *v)
546 {
547     int rc = 0;
548     int32_t i;
549     rc = in->start_vector(in, tag, &v->count);
550     v->data = calloc(v->count, sizeof(*v->data));
551     for(i=0;i<v->count;i++) {
552     rc = rc ? rc : deserialize_ACL(in, "value", &v->data[i]);
553     }
554     rc = in->end_vector(in, tag);
555     return rc;
556 }
serialize_CreateRequest(struct oarchive * out,const char * tag,struct CreateRequest * v)557 int serialize_CreateRequest(struct oarchive *out, const char *tag, struct CreateRequest *v){
558     int rc;
559     rc = out->start_record(out, tag);
560     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
561     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
562     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
563     rc = rc ? rc : out->serialize_Int(out, "flags", &v->flags);
564     rc = rc ? rc : out->end_record(out, tag);
565     return rc;
566 }
deserialize_CreateRequest(struct iarchive * in,const char * tag,struct CreateRequest * v)567 int deserialize_CreateRequest(struct iarchive *in, const char *tag, struct CreateRequest*v){
568     int rc;
569     rc = in->start_record(in, tag);
570     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
571     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
572     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
573     rc = rc ? rc : in->deserialize_Int(in, "flags", &v->flags);
574     rc = rc ? rc : in->end_record(in, tag);
575     return rc;
576 }
deallocate_CreateRequest(struct CreateRequest * v)577 void deallocate_CreateRequest(struct CreateRequest*v){
578     deallocate_String(&v->path);
579     deallocate_Buffer(&v->data);
580     deallocate_ACL_vector(&v->acl);
581 }
serialize_CreateTTLRequest(struct oarchive * out,const char * tag,struct CreateTTLRequest * v)582 int serialize_CreateTTLRequest(struct oarchive *out, const char *tag, struct CreateTTLRequest *v){
583     int rc;
584     rc = out->start_record(out, tag);
585     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
586     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
587     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
588     rc = rc ? rc : out->serialize_Int(out, "flags", &v->flags);
589     rc = rc ? rc : out->serialize_Long(out, "ttl", &v->ttl);
590     rc = rc ? rc : out->end_record(out, tag);
591     return rc;
592 }
deserialize_CreateTTLRequest(struct iarchive * in,const char * tag,struct CreateTTLRequest * v)593 int deserialize_CreateTTLRequest(struct iarchive *in, const char *tag, struct CreateTTLRequest*v){
594     int rc;
595     rc = in->start_record(in, tag);
596     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
597     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
598     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
599     rc = rc ? rc : in->deserialize_Int(in, "flags", &v->flags);
600     rc = rc ? rc : in->deserialize_Long(in, "ttl", &v->ttl);
601     rc = rc ? rc : in->end_record(in, tag);
602     return rc;
603 }
deallocate_CreateTTLRequest(struct CreateTTLRequest * v)604 void deallocate_CreateTTLRequest(struct CreateTTLRequest*v){
605     deallocate_String(&v->path);
606     deallocate_Buffer(&v->data);
607     deallocate_ACL_vector(&v->acl);
608 }
serialize_DeleteRequest(struct oarchive * out,const char * tag,struct DeleteRequest * v)609 int serialize_DeleteRequest(struct oarchive *out, const char *tag, struct DeleteRequest *v){
610     int rc;
611     rc = out->start_record(out, tag);
612     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
613     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
614     rc = rc ? rc : out->end_record(out, tag);
615     return rc;
616 }
deserialize_DeleteRequest(struct iarchive * in,const char * tag,struct DeleteRequest * v)617 int deserialize_DeleteRequest(struct iarchive *in, const char *tag, struct DeleteRequest*v){
618     int rc;
619     rc = in->start_record(in, tag);
620     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
621     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
622     rc = rc ? rc : in->end_record(in, tag);
623     return rc;
624 }
deallocate_DeleteRequest(struct DeleteRequest * v)625 void deallocate_DeleteRequest(struct DeleteRequest*v){
626     deallocate_String(&v->path);
627 }
serialize_GetChildrenRequest(struct oarchive * out,const char * tag,struct GetChildrenRequest * v)628 int serialize_GetChildrenRequest(struct oarchive *out, const char *tag, struct GetChildrenRequest *v){
629     int rc;
630     rc = out->start_record(out, tag);
631     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
632     rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch);
633     rc = rc ? rc : out->end_record(out, tag);
634     return rc;
635 }
deserialize_GetChildrenRequest(struct iarchive * in,const char * tag,struct GetChildrenRequest * v)636 int deserialize_GetChildrenRequest(struct iarchive *in, const char *tag, struct GetChildrenRequest*v){
637     int rc;
638     rc = in->start_record(in, tag);
639     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
640     rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch);
641     rc = rc ? rc : in->end_record(in, tag);
642     return rc;
643 }
deallocate_GetChildrenRequest(struct GetChildrenRequest * v)644 void deallocate_GetChildrenRequest(struct GetChildrenRequest*v){
645     deallocate_String(&v->path);
646 }
serialize_GetAllChildrenNumberRequest(struct oarchive * out,const char * tag,struct GetAllChildrenNumberRequest * v)647 int serialize_GetAllChildrenNumberRequest(struct oarchive *out, const char *tag, struct GetAllChildrenNumberRequest *v){
648     int rc;
649     rc = out->start_record(out, tag);
650     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
651     rc = rc ? rc : out->end_record(out, tag);
652     return rc;
653 }
deserialize_GetAllChildrenNumberRequest(struct iarchive * in,const char * tag,struct GetAllChildrenNumberRequest * v)654 int deserialize_GetAllChildrenNumberRequest(struct iarchive *in, const char *tag, struct GetAllChildrenNumberRequest*v){
655     int rc;
656     rc = in->start_record(in, tag);
657     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
658     rc = rc ? rc : in->end_record(in, tag);
659     return rc;
660 }
deallocate_GetAllChildrenNumberRequest(struct GetAllChildrenNumberRequest * v)661 void deallocate_GetAllChildrenNumberRequest(struct GetAllChildrenNumberRequest*v){
662     deallocate_String(&v->path);
663 }
serialize_GetChildren2Request(struct oarchive * out,const char * tag,struct GetChildren2Request * v)664 int serialize_GetChildren2Request(struct oarchive *out, const char *tag, struct GetChildren2Request *v){
665     int rc;
666     rc = out->start_record(out, tag);
667     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
668     rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch);
669     rc = rc ? rc : out->end_record(out, tag);
670     return rc;
671 }
deserialize_GetChildren2Request(struct iarchive * in,const char * tag,struct GetChildren2Request * v)672 int deserialize_GetChildren2Request(struct iarchive *in, const char *tag, struct GetChildren2Request*v){
673     int rc;
674     rc = in->start_record(in, tag);
675     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
676     rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch);
677     rc = rc ? rc : in->end_record(in, tag);
678     return rc;
679 }
deallocate_GetChildren2Request(struct GetChildren2Request * v)680 void deallocate_GetChildren2Request(struct GetChildren2Request*v){
681     deallocate_String(&v->path);
682 }
serialize_CheckVersionRequest(struct oarchive * out,const char * tag,struct CheckVersionRequest * v)683 int serialize_CheckVersionRequest(struct oarchive *out, const char *tag, struct CheckVersionRequest *v){
684     int rc;
685     rc = out->start_record(out, tag);
686     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
687     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
688     rc = rc ? rc : out->end_record(out, tag);
689     return rc;
690 }
deserialize_CheckVersionRequest(struct iarchive * in,const char * tag,struct CheckVersionRequest * v)691 int deserialize_CheckVersionRequest(struct iarchive *in, const char *tag, struct CheckVersionRequest*v){
692     int rc;
693     rc = in->start_record(in, tag);
694     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
695     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
696     rc = rc ? rc : in->end_record(in, tag);
697     return rc;
698 }
deallocate_CheckVersionRequest(struct CheckVersionRequest * v)699 void deallocate_CheckVersionRequest(struct CheckVersionRequest*v){
700     deallocate_String(&v->path);
701 }
serialize_GetMaxChildrenRequest(struct oarchive * out,const char * tag,struct GetMaxChildrenRequest * v)702 int serialize_GetMaxChildrenRequest(struct oarchive *out, const char *tag, struct GetMaxChildrenRequest *v){
703     int rc;
704     rc = out->start_record(out, tag);
705     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
706     rc = rc ? rc : out->end_record(out, tag);
707     return rc;
708 }
deserialize_GetMaxChildrenRequest(struct iarchive * in,const char * tag,struct GetMaxChildrenRequest * v)709 int deserialize_GetMaxChildrenRequest(struct iarchive *in, const char *tag, struct GetMaxChildrenRequest*v){
710     int rc;
711     rc = in->start_record(in, tag);
712     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
713     rc = rc ? rc : in->end_record(in, tag);
714     return rc;
715 }
deallocate_GetMaxChildrenRequest(struct GetMaxChildrenRequest * v)716 void deallocate_GetMaxChildrenRequest(struct GetMaxChildrenRequest*v){
717     deallocate_String(&v->path);
718 }
serialize_GetMaxChildrenResponse(struct oarchive * out,const char * tag,struct GetMaxChildrenResponse * v)719 int serialize_GetMaxChildrenResponse(struct oarchive *out, const char *tag, struct GetMaxChildrenResponse *v){
720     int rc;
721     rc = out->start_record(out, tag);
722     rc = rc ? rc : out->serialize_Int(out, "max", &v->max);
723     rc = rc ? rc : out->end_record(out, tag);
724     return rc;
725 }
deserialize_GetMaxChildrenResponse(struct iarchive * in,const char * tag,struct GetMaxChildrenResponse * v)726 int deserialize_GetMaxChildrenResponse(struct iarchive *in, const char *tag, struct GetMaxChildrenResponse*v){
727     int rc;
728     rc = in->start_record(in, tag);
729     rc = rc ? rc : in->deserialize_Int(in, "max", &v->max);
730     rc = rc ? rc : in->end_record(in, tag);
731     return rc;
732 }
deallocate_GetMaxChildrenResponse(struct GetMaxChildrenResponse * v)733 void deallocate_GetMaxChildrenResponse(struct GetMaxChildrenResponse*v){
734 }
serialize_SetMaxChildrenRequest(struct oarchive * out,const char * tag,struct SetMaxChildrenRequest * v)735 int serialize_SetMaxChildrenRequest(struct oarchive *out, const char *tag, struct SetMaxChildrenRequest *v){
736     int rc;
737     rc = out->start_record(out, tag);
738     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
739     rc = rc ? rc : out->serialize_Int(out, "max", &v->max);
740     rc = rc ? rc : out->end_record(out, tag);
741     return rc;
742 }
deserialize_SetMaxChildrenRequest(struct iarchive * in,const char * tag,struct SetMaxChildrenRequest * v)743 int deserialize_SetMaxChildrenRequest(struct iarchive *in, const char *tag, struct SetMaxChildrenRequest*v){
744     int rc;
745     rc = in->start_record(in, tag);
746     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
747     rc = rc ? rc : in->deserialize_Int(in, "max", &v->max);
748     rc = rc ? rc : in->end_record(in, tag);
749     return rc;
750 }
deallocate_SetMaxChildrenRequest(struct SetMaxChildrenRequest * v)751 void deallocate_SetMaxChildrenRequest(struct SetMaxChildrenRequest*v){
752     deallocate_String(&v->path);
753 }
serialize_SyncRequest(struct oarchive * out,const char * tag,struct SyncRequest * v)754 int serialize_SyncRequest(struct oarchive *out, const char *tag, struct SyncRequest *v){
755     int rc;
756     rc = out->start_record(out, tag);
757     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
758     rc = rc ? rc : out->end_record(out, tag);
759     return rc;
760 }
deserialize_SyncRequest(struct iarchive * in,const char * tag,struct SyncRequest * v)761 int deserialize_SyncRequest(struct iarchive *in, const char *tag, struct SyncRequest*v){
762     int rc;
763     rc = in->start_record(in, tag);
764     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
765     rc = rc ? rc : in->end_record(in, tag);
766     return rc;
767 }
deallocate_SyncRequest(struct SyncRequest * v)768 void deallocate_SyncRequest(struct SyncRequest*v){
769     deallocate_String(&v->path);
770 }
serialize_SyncResponse(struct oarchive * out,const char * tag,struct SyncResponse * v)771 int serialize_SyncResponse(struct oarchive *out, const char *tag, struct SyncResponse *v){
772     int rc;
773     rc = out->start_record(out, tag);
774     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
775     rc = rc ? rc : out->end_record(out, tag);
776     return rc;
777 }
deserialize_SyncResponse(struct iarchive * in,const char * tag,struct SyncResponse * v)778 int deserialize_SyncResponse(struct iarchive *in, const char *tag, struct SyncResponse*v){
779     int rc;
780     rc = in->start_record(in, tag);
781     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
782     rc = rc ? rc : in->end_record(in, tag);
783     return rc;
784 }
deallocate_SyncResponse(struct SyncResponse * v)785 void deallocate_SyncResponse(struct SyncResponse*v){
786     deallocate_String(&v->path);
787 }
serialize_GetACLRequest(struct oarchive * out,const char * tag,struct GetACLRequest * v)788 int serialize_GetACLRequest(struct oarchive *out, const char *tag, struct GetACLRequest *v){
789     int rc;
790     rc = out->start_record(out, tag);
791     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
792     rc = rc ? rc : out->end_record(out, tag);
793     return rc;
794 }
deserialize_GetACLRequest(struct iarchive * in,const char * tag,struct GetACLRequest * v)795 int deserialize_GetACLRequest(struct iarchive *in, const char *tag, struct GetACLRequest*v){
796     int rc;
797     rc = in->start_record(in, tag);
798     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
799     rc = rc ? rc : in->end_record(in, tag);
800     return rc;
801 }
deallocate_GetACLRequest(struct GetACLRequest * v)802 void deallocate_GetACLRequest(struct GetACLRequest*v){
803     deallocate_String(&v->path);
804 }
serialize_SetACLRequest(struct oarchive * out,const char * tag,struct SetACLRequest * v)805 int serialize_SetACLRequest(struct oarchive *out, const char *tag, struct SetACLRequest *v){
806     int rc;
807     rc = out->start_record(out, tag);
808     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
809     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
810     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
811     rc = rc ? rc : out->end_record(out, tag);
812     return rc;
813 }
deserialize_SetACLRequest(struct iarchive * in,const char * tag,struct SetACLRequest * v)814 int deserialize_SetACLRequest(struct iarchive *in, const char *tag, struct SetACLRequest*v){
815     int rc;
816     rc = in->start_record(in, tag);
817     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
818     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
819     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
820     rc = rc ? rc : in->end_record(in, tag);
821     return rc;
822 }
deallocate_SetACLRequest(struct SetACLRequest * v)823 void deallocate_SetACLRequest(struct SetACLRequest*v){
824     deallocate_String(&v->path);
825     deallocate_ACL_vector(&v->acl);
826 }
serialize_SetACLResponse(struct oarchive * out,const char * tag,struct SetACLResponse * v)827 int serialize_SetACLResponse(struct oarchive *out, const char *tag, struct SetACLResponse *v){
828     int rc;
829     rc = out->start_record(out, tag);
830     rc = rc ? rc : serialize_Stat(out, "stat", &v->stat);
831     rc = rc ? rc : out->end_record(out, tag);
832     return rc;
833 }
deserialize_SetACLResponse(struct iarchive * in,const char * tag,struct SetACLResponse * v)834 int deserialize_SetACLResponse(struct iarchive *in, const char *tag, struct SetACLResponse*v){
835     int rc;
836     rc = in->start_record(in, tag);
837     rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat);
838     rc = rc ? rc : in->end_record(in, tag);
839     return rc;
840 }
deallocate_SetACLResponse(struct SetACLResponse * v)841 void deallocate_SetACLResponse(struct SetACLResponse*v){
842     deallocate_Stat(&v->stat);
843 }
serialize_AddWatchRequest(struct oarchive * out,const char * tag,struct AddWatchRequest * v)844 int serialize_AddWatchRequest(struct oarchive *out, const char *tag, struct AddWatchRequest *v){
845     int rc;
846     rc = out->start_record(out, tag);
847     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
848     rc = rc ? rc : out->serialize_Int(out, "mode", &v->mode);
849     rc = rc ? rc : out->end_record(out, tag);
850     return rc;
851 }
deserialize_AddWatchRequest(struct iarchive * in,const char * tag,struct AddWatchRequest * v)852 int deserialize_AddWatchRequest(struct iarchive *in, const char *tag, struct AddWatchRequest*v){
853     int rc;
854     rc = in->start_record(in, tag);
855     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
856     rc = rc ? rc : in->deserialize_Int(in, "mode", &v->mode);
857     rc = rc ? rc : in->end_record(in, tag);
858     return rc;
859 }
deallocate_AddWatchRequest(struct AddWatchRequest * v)860 void deallocate_AddWatchRequest(struct AddWatchRequest*v){
861     deallocate_String(&v->path);
862 }
serialize_WatcherEvent(struct oarchive * out,const char * tag,struct WatcherEvent * v)863 int serialize_WatcherEvent(struct oarchive *out, const char *tag, struct WatcherEvent *v){
864     int rc;
865     rc = out->start_record(out, tag);
866     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
867     rc = rc ? rc : out->serialize_Int(out, "state", &v->state);
868     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
869     rc = rc ? rc : out->end_record(out, tag);
870     return rc;
871 }
deserialize_WatcherEvent(struct iarchive * in,const char * tag,struct WatcherEvent * v)872 int deserialize_WatcherEvent(struct iarchive *in, const char *tag, struct WatcherEvent*v){
873     int rc;
874     rc = in->start_record(in, tag);
875     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
876     rc = rc ? rc : in->deserialize_Int(in, "state", &v->state);
877     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
878     rc = rc ? rc : in->end_record(in, tag);
879     return rc;
880 }
deallocate_WatcherEvent(struct WatcherEvent * v)881 void deallocate_WatcherEvent(struct WatcherEvent*v){
882     deallocate_String(&v->path);
883 }
serialize_ErrorResponse(struct oarchive * out,const char * tag,struct ErrorResponse * v)884 int serialize_ErrorResponse(struct oarchive *out, const char *tag, struct ErrorResponse *v){
885     int rc;
886     rc = out->start_record(out, tag);
887     rc = rc ? rc : out->serialize_Int(out, "err", &v->err);
888     rc = rc ? rc : out->end_record(out, tag);
889     return rc;
890 }
deserialize_ErrorResponse(struct iarchive * in,const char * tag,struct ErrorResponse * v)891 int deserialize_ErrorResponse(struct iarchive *in, const char *tag, struct ErrorResponse*v){
892     int rc;
893     rc = in->start_record(in, tag);
894     rc = rc ? rc : in->deserialize_Int(in, "err", &v->err);
895     rc = rc ? rc : in->end_record(in, tag);
896     return rc;
897 }
deallocate_ErrorResponse(struct ErrorResponse * v)898 void deallocate_ErrorResponse(struct ErrorResponse*v){
899 }
serialize_CreateResponse(struct oarchive * out,const char * tag,struct CreateResponse * v)900 int serialize_CreateResponse(struct oarchive *out, const char *tag, struct CreateResponse *v){
901     int rc;
902     rc = out->start_record(out, tag);
903     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
904     rc = rc ? rc : out->end_record(out, tag);
905     return rc;
906 }
deserialize_CreateResponse(struct iarchive * in,const char * tag,struct CreateResponse * v)907 int deserialize_CreateResponse(struct iarchive *in, const char *tag, struct CreateResponse*v){
908     int rc;
909     rc = in->start_record(in, tag);
910     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
911     rc = rc ? rc : in->end_record(in, tag);
912     return rc;
913 }
deallocate_CreateResponse(struct CreateResponse * v)914 void deallocate_CreateResponse(struct CreateResponse*v){
915     deallocate_String(&v->path);
916 }
serialize_Create2Response(struct oarchive * out,const char * tag,struct Create2Response * v)917 int serialize_Create2Response(struct oarchive *out, const char *tag, struct Create2Response *v){
918     int rc;
919     rc = out->start_record(out, tag);
920     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
921     rc = rc ? rc : serialize_Stat(out, "stat", &v->stat);
922     rc = rc ? rc : out->end_record(out, tag);
923     return rc;
924 }
deserialize_Create2Response(struct iarchive * in,const char * tag,struct Create2Response * v)925 int deserialize_Create2Response(struct iarchive *in, const char *tag, struct Create2Response*v){
926     int rc;
927     rc = in->start_record(in, tag);
928     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
929     rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat);
930     rc = rc ? rc : in->end_record(in, tag);
931     return rc;
932 }
deallocate_Create2Response(struct Create2Response * v)933 void deallocate_Create2Response(struct Create2Response*v){
934     deallocate_String(&v->path);
935     deallocate_Stat(&v->stat);
936 }
serialize_ExistsRequest(struct oarchive * out,const char * tag,struct ExistsRequest * v)937 int serialize_ExistsRequest(struct oarchive *out, const char *tag, struct ExistsRequest *v){
938     int rc;
939     rc = out->start_record(out, tag);
940     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
941     rc = rc ? rc : out->serialize_Bool(out, "watch", &v->watch);
942     rc = rc ? rc : out->end_record(out, tag);
943     return rc;
944 }
deserialize_ExistsRequest(struct iarchive * in,const char * tag,struct ExistsRequest * v)945 int deserialize_ExistsRequest(struct iarchive *in, const char *tag, struct ExistsRequest*v){
946     int rc;
947     rc = in->start_record(in, tag);
948     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
949     rc = rc ? rc : in->deserialize_Bool(in, "watch", &v->watch);
950     rc = rc ? rc : in->end_record(in, tag);
951     return rc;
952 }
deallocate_ExistsRequest(struct ExistsRequest * v)953 void deallocate_ExistsRequest(struct ExistsRequest*v){
954     deallocate_String(&v->path);
955 }
serialize_ExistsResponse(struct oarchive * out,const char * tag,struct ExistsResponse * v)956 int serialize_ExistsResponse(struct oarchive *out, const char *tag, struct ExistsResponse *v){
957     int rc;
958     rc = out->start_record(out, tag);
959     rc = rc ? rc : serialize_Stat(out, "stat", &v->stat);
960     rc = rc ? rc : out->end_record(out, tag);
961     return rc;
962 }
deserialize_ExistsResponse(struct iarchive * in,const char * tag,struct ExistsResponse * v)963 int deserialize_ExistsResponse(struct iarchive *in, const char *tag, struct ExistsResponse*v){
964     int rc;
965     rc = in->start_record(in, tag);
966     rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat);
967     rc = rc ? rc : in->end_record(in, tag);
968     return rc;
969 }
deallocate_ExistsResponse(struct ExistsResponse * v)970 void deallocate_ExistsResponse(struct ExistsResponse*v){
971     deallocate_Stat(&v->stat);
972 }
serialize_GetDataResponse(struct oarchive * out,const char * tag,struct GetDataResponse * v)973 int serialize_GetDataResponse(struct oarchive *out, const char *tag, struct GetDataResponse *v){
974     int rc;
975     rc = out->start_record(out, tag);
976     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
977     rc = rc ? rc : serialize_Stat(out, "stat", &v->stat);
978     rc = rc ? rc : out->end_record(out, tag);
979     return rc;
980 }
deserialize_GetDataResponse(struct iarchive * in,const char * tag,struct GetDataResponse * v)981 int deserialize_GetDataResponse(struct iarchive *in, const char *tag, struct GetDataResponse*v){
982     int rc;
983     rc = in->start_record(in, tag);
984     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
985     rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat);
986     rc = rc ? rc : in->end_record(in, tag);
987     return rc;
988 }
deallocate_GetDataResponse(struct GetDataResponse * v)989 void deallocate_GetDataResponse(struct GetDataResponse*v){
990     deallocate_Buffer(&v->data);
991     deallocate_Stat(&v->stat);
992 }
serialize_GetChildrenResponse(struct oarchive * out,const char * tag,struct GetChildrenResponse * v)993 int serialize_GetChildrenResponse(struct oarchive *out, const char *tag, struct GetChildrenResponse *v){
994     int rc;
995     rc = out->start_record(out, tag);
996     rc = rc ? rc : serialize_String_vector(out, "children", &v->children);
997     rc = rc ? rc : out->end_record(out, tag);
998     return rc;
999 }
deserialize_GetChildrenResponse(struct iarchive * in,const char * tag,struct GetChildrenResponse * v)1000 int deserialize_GetChildrenResponse(struct iarchive *in, const char *tag, struct GetChildrenResponse*v){
1001     int rc;
1002     rc = in->start_record(in, tag);
1003     rc = rc ? rc : deserialize_String_vector(in, "children", &v->children);
1004     rc = rc ? rc : in->end_record(in, tag);
1005     return rc;
1006 }
deallocate_GetChildrenResponse(struct GetChildrenResponse * v)1007 void deallocate_GetChildrenResponse(struct GetChildrenResponse*v){
1008     deallocate_String_vector(&v->children);
1009 }
serialize_GetAllChildrenNumberResponse(struct oarchive * out,const char * tag,struct GetAllChildrenNumberResponse * v)1010 int serialize_GetAllChildrenNumberResponse(struct oarchive *out, const char *tag, struct GetAllChildrenNumberResponse *v){
1011     int rc;
1012     rc = out->start_record(out, tag);
1013     rc = rc ? rc : out->serialize_Int(out, "totalNumber", &v->totalNumber);
1014     rc = rc ? rc : out->end_record(out, tag);
1015     return rc;
1016 }
deserialize_GetAllChildrenNumberResponse(struct iarchive * in,const char * tag,struct GetAllChildrenNumberResponse * v)1017 int deserialize_GetAllChildrenNumberResponse(struct iarchive *in, const char *tag, struct GetAllChildrenNumberResponse*v){
1018     int rc;
1019     rc = in->start_record(in, tag);
1020     rc = rc ? rc : in->deserialize_Int(in, "totalNumber", &v->totalNumber);
1021     rc = rc ? rc : in->end_record(in, tag);
1022     return rc;
1023 }
deallocate_GetAllChildrenNumberResponse(struct GetAllChildrenNumberResponse * v)1024 void deallocate_GetAllChildrenNumberResponse(struct GetAllChildrenNumberResponse*v){
1025 }
serialize_GetChildren2Response(struct oarchive * out,const char * tag,struct GetChildren2Response * v)1026 int serialize_GetChildren2Response(struct oarchive *out, const char *tag, struct GetChildren2Response *v){
1027     int rc;
1028     rc = out->start_record(out, tag);
1029     rc = rc ? rc : serialize_String_vector(out, "children", &v->children);
1030     rc = rc ? rc : serialize_Stat(out, "stat", &v->stat);
1031     rc = rc ? rc : out->end_record(out, tag);
1032     return rc;
1033 }
deserialize_GetChildren2Response(struct iarchive * in,const char * tag,struct GetChildren2Response * v)1034 int deserialize_GetChildren2Response(struct iarchive *in, const char *tag, struct GetChildren2Response*v){
1035     int rc;
1036     rc = in->start_record(in, tag);
1037     rc = rc ? rc : deserialize_String_vector(in, "children", &v->children);
1038     rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat);
1039     rc = rc ? rc : in->end_record(in, tag);
1040     return rc;
1041 }
deallocate_GetChildren2Response(struct GetChildren2Response * v)1042 void deallocate_GetChildren2Response(struct GetChildren2Response*v){
1043     deallocate_String_vector(&v->children);
1044     deallocate_Stat(&v->stat);
1045 }
serialize_GetACLResponse(struct oarchive * out,const char * tag,struct GetACLResponse * v)1046 int serialize_GetACLResponse(struct oarchive *out, const char *tag, struct GetACLResponse *v){
1047     int rc;
1048     rc = out->start_record(out, tag);
1049     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
1050     rc = rc ? rc : serialize_Stat(out, "stat", &v->stat);
1051     rc = rc ? rc : out->end_record(out, tag);
1052     return rc;
1053 }
deserialize_GetACLResponse(struct iarchive * in,const char * tag,struct GetACLResponse * v)1054 int deserialize_GetACLResponse(struct iarchive *in, const char *tag, struct GetACLResponse*v){
1055     int rc;
1056     rc = in->start_record(in, tag);
1057     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
1058     rc = rc ? rc : deserialize_Stat(in, "stat", &v->stat);
1059     rc = rc ? rc : in->end_record(in, tag);
1060     return rc;
1061 }
deallocate_GetACLResponse(struct GetACLResponse * v)1062 void deallocate_GetACLResponse(struct GetACLResponse*v){
1063     deallocate_ACL_vector(&v->acl);
1064     deallocate_Stat(&v->stat);
1065 }
serialize_CheckWatchesRequest(struct oarchive * out,const char * tag,struct CheckWatchesRequest * v)1066 int serialize_CheckWatchesRequest(struct oarchive *out, const char *tag, struct CheckWatchesRequest *v){
1067     int rc;
1068     rc = out->start_record(out, tag);
1069     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1070     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
1071     rc = rc ? rc : out->end_record(out, tag);
1072     return rc;
1073 }
deserialize_CheckWatchesRequest(struct iarchive * in,const char * tag,struct CheckWatchesRequest * v)1074 int deserialize_CheckWatchesRequest(struct iarchive *in, const char *tag, struct CheckWatchesRequest*v){
1075     int rc;
1076     rc = in->start_record(in, tag);
1077     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1078     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
1079     rc = rc ? rc : in->end_record(in, tag);
1080     return rc;
1081 }
deallocate_CheckWatchesRequest(struct CheckWatchesRequest * v)1082 void deallocate_CheckWatchesRequest(struct CheckWatchesRequest*v){
1083     deallocate_String(&v->path);
1084 }
serialize_RemoveWatchesRequest(struct oarchive * out,const char * tag,struct RemoveWatchesRequest * v)1085 int serialize_RemoveWatchesRequest(struct oarchive *out, const char *tag, struct RemoveWatchesRequest *v){
1086     int rc;
1087     rc = out->start_record(out, tag);
1088     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1089     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
1090     rc = rc ? rc : out->end_record(out, tag);
1091     return rc;
1092 }
deserialize_RemoveWatchesRequest(struct iarchive * in,const char * tag,struct RemoveWatchesRequest * v)1093 int deserialize_RemoveWatchesRequest(struct iarchive *in, const char *tag, struct RemoveWatchesRequest*v){
1094     int rc;
1095     rc = in->start_record(in, tag);
1096     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1097     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
1098     rc = rc ? rc : in->end_record(in, tag);
1099     return rc;
1100 }
deallocate_RemoveWatchesRequest(struct RemoveWatchesRequest * v)1101 void deallocate_RemoveWatchesRequest(struct RemoveWatchesRequest*v){
1102     deallocate_String(&v->path);
1103 }
serialize_GetEphemeralsRequest(struct oarchive * out,const char * tag,struct GetEphemeralsRequest * v)1104 int serialize_GetEphemeralsRequest(struct oarchive *out, const char *tag, struct GetEphemeralsRequest *v){
1105     int rc;
1106     rc = out->start_record(out, tag);
1107     rc = rc ? rc : out->serialize_String(out, "prefixPath", &v->prefixPath);
1108     rc = rc ? rc : out->end_record(out, tag);
1109     return rc;
1110 }
deserialize_GetEphemeralsRequest(struct iarchive * in,const char * tag,struct GetEphemeralsRequest * v)1111 int deserialize_GetEphemeralsRequest(struct iarchive *in, const char *tag, struct GetEphemeralsRequest*v){
1112     int rc;
1113     rc = in->start_record(in, tag);
1114     rc = rc ? rc : in->deserialize_String(in, "prefixPath", &v->prefixPath);
1115     rc = rc ? rc : in->end_record(in, tag);
1116     return rc;
1117 }
deallocate_GetEphemeralsRequest(struct GetEphemeralsRequest * v)1118 void deallocate_GetEphemeralsRequest(struct GetEphemeralsRequest*v){
1119     deallocate_String(&v->prefixPath);
1120 }
serialize_GetEphemeralsResponse(struct oarchive * out,const char * tag,struct GetEphemeralsResponse * v)1121 int serialize_GetEphemeralsResponse(struct oarchive *out, const char *tag, struct GetEphemeralsResponse *v){
1122     int rc;
1123     rc = out->start_record(out, tag);
1124     rc = rc ? rc : serialize_String_vector(out, "ephemerals", &v->ephemerals);
1125     rc = rc ? rc : out->end_record(out, tag);
1126     return rc;
1127 }
deserialize_GetEphemeralsResponse(struct iarchive * in,const char * tag,struct GetEphemeralsResponse * v)1128 int deserialize_GetEphemeralsResponse(struct iarchive *in, const char *tag, struct GetEphemeralsResponse*v){
1129     int rc;
1130     rc = in->start_record(in, tag);
1131     rc = rc ? rc : deserialize_String_vector(in, "ephemerals", &v->ephemerals);
1132     rc = rc ? rc : in->end_record(in, tag);
1133     return rc;
1134 }
deallocate_GetEphemeralsResponse(struct GetEphemeralsResponse * v)1135 void deallocate_GetEphemeralsResponse(struct GetEphemeralsResponse*v){
1136     deallocate_String_vector(&v->ephemerals);
1137 }
allocate_ClientInfo_vector(struct ClientInfo_vector * v,int32_t len)1138 int allocate_ClientInfo_vector(struct ClientInfo_vector *v, int32_t len) {
1139     if (!len) {
1140         v->count = 0;
1141         v->data = 0;
1142     } else {
1143         v->count = len;
1144         v->data = calloc(sizeof(*v->data), len);
1145     }
1146     return 0;
1147 }
deallocate_ClientInfo_vector(struct ClientInfo_vector * v)1148 int deallocate_ClientInfo_vector(struct ClientInfo_vector *v) {
1149     if (v->data) {
1150         int32_t i;
1151         for(i=0;i<v->count; i++) {
1152             deallocate_ClientInfo(&v->data[i]);
1153         }
1154         free(v->data);
1155         v->data = 0;
1156     }
1157     return 0;
1158 }
serialize_ClientInfo_vector(struct oarchive * out,const char * tag,struct ClientInfo_vector * v)1159 int serialize_ClientInfo_vector(struct oarchive *out, const char *tag, struct ClientInfo_vector *v)
1160 {
1161     int32_t count = v->count;
1162     int rc = 0;
1163     int32_t i;
1164     rc = out->start_vector(out, tag, &count);
1165     for(i=0;i<v->count;i++) {
1166     rc = rc ? rc : serialize_ClientInfo(out, "data", &v->data[i]);
1167     }
1168     rc = rc ? rc : out->end_vector(out, tag);
1169     return rc;
1170 }
deserialize_ClientInfo_vector(struct iarchive * in,const char * tag,struct ClientInfo_vector * v)1171 int deserialize_ClientInfo_vector(struct iarchive *in, const char *tag, struct ClientInfo_vector *v)
1172 {
1173     int rc = 0;
1174     int32_t i;
1175     rc = in->start_vector(in, tag, &v->count);
1176     v->data = calloc(v->count, sizeof(*v->data));
1177     for(i=0;i<v->count;i++) {
1178     rc = rc ? rc : deserialize_ClientInfo(in, "value", &v->data[i]);
1179     }
1180     rc = in->end_vector(in, tag);
1181     return rc;
1182 }
serialize_WhoAmIResponse(struct oarchive * out,const char * tag,struct WhoAmIResponse * v)1183 int serialize_WhoAmIResponse(struct oarchive *out, const char *tag, struct WhoAmIResponse *v){
1184     int rc;
1185     rc = out->start_record(out, tag);
1186     rc = rc ? rc : serialize_ClientInfo_vector(out, "clientInfo", &v->clientInfo);
1187     rc = rc ? rc : out->end_record(out, tag);
1188     return rc;
1189 }
deserialize_WhoAmIResponse(struct iarchive * in,const char * tag,struct WhoAmIResponse * v)1190 int deserialize_WhoAmIResponse(struct iarchive *in, const char *tag, struct WhoAmIResponse*v){
1191     int rc;
1192     rc = in->start_record(in, tag);
1193     rc = rc ? rc : deserialize_ClientInfo_vector(in, "clientInfo", &v->clientInfo);
1194     rc = rc ? rc : in->end_record(in, tag);
1195     return rc;
1196 }
deallocate_WhoAmIResponse(struct WhoAmIResponse * v)1197 void deallocate_WhoAmIResponse(struct WhoAmIResponse*v){
1198     deallocate_ClientInfo_vector(&v->clientInfo);
1199 }
serialize_LearnerInfo(struct oarchive * out,const char * tag,struct LearnerInfo * v)1200 int serialize_LearnerInfo(struct oarchive *out, const char *tag, struct LearnerInfo *v){
1201     int rc;
1202     rc = out->start_record(out, tag);
1203     rc = rc ? rc : out->serialize_Long(out, "serverid", &v->serverid);
1204     rc = rc ? rc : out->serialize_Int(out, "protocolVersion", &v->protocolVersion);
1205     rc = rc ? rc : out->serialize_Long(out, "configVersion", &v->configVersion);
1206     rc = rc ? rc : out->end_record(out, tag);
1207     return rc;
1208 }
deserialize_LearnerInfo(struct iarchive * in,const char * tag,struct LearnerInfo * v)1209 int deserialize_LearnerInfo(struct iarchive *in, const char *tag, struct LearnerInfo*v){
1210     int rc;
1211     rc = in->start_record(in, tag);
1212     rc = rc ? rc : in->deserialize_Long(in, "serverid", &v->serverid);
1213     rc = rc ? rc : in->deserialize_Int(in, "protocolVersion", &v->protocolVersion);
1214     rc = rc ? rc : in->deserialize_Long(in, "configVersion", &v->configVersion);
1215     rc = rc ? rc : in->end_record(in, tag);
1216     return rc;
1217 }
deallocate_LearnerInfo(struct LearnerInfo * v)1218 void deallocate_LearnerInfo(struct LearnerInfo*v){
1219 }
allocate_Id_vector(struct Id_vector * v,int32_t len)1220 int allocate_Id_vector(struct Id_vector *v, int32_t len) {
1221     if (!len) {
1222         v->count = 0;
1223         v->data = 0;
1224     } else {
1225         v->count = len;
1226         v->data = calloc(sizeof(*v->data), len);
1227     }
1228     return 0;
1229 }
deallocate_Id_vector(struct Id_vector * v)1230 int deallocate_Id_vector(struct Id_vector *v) {
1231     if (v->data) {
1232         int32_t i;
1233         for(i=0;i<v->count; i++) {
1234             deallocate_Id(&v->data[i]);
1235         }
1236         free(v->data);
1237         v->data = 0;
1238     }
1239     return 0;
1240 }
serialize_Id_vector(struct oarchive * out,const char * tag,struct Id_vector * v)1241 int serialize_Id_vector(struct oarchive *out, const char *tag, struct Id_vector *v)
1242 {
1243     int32_t count = v->count;
1244     int rc = 0;
1245     int32_t i;
1246     rc = out->start_vector(out, tag, &count);
1247     for(i=0;i<v->count;i++) {
1248     rc = rc ? rc : serialize_Id(out, "data", &v->data[i]);
1249     }
1250     rc = rc ? rc : out->end_vector(out, tag);
1251     return rc;
1252 }
deserialize_Id_vector(struct iarchive * in,const char * tag,struct Id_vector * v)1253 int deserialize_Id_vector(struct iarchive *in, const char *tag, struct Id_vector *v)
1254 {
1255     int rc = 0;
1256     int32_t i;
1257     rc = in->start_vector(in, tag, &v->count);
1258     v->data = calloc(v->count, sizeof(*v->data));
1259     for(i=0;i<v->count;i++) {
1260     rc = rc ? rc : deserialize_Id(in, "value", &v->data[i]);
1261     }
1262     rc = in->end_vector(in, tag);
1263     return rc;
1264 }
serialize_QuorumPacket(struct oarchive * out,const char * tag,struct QuorumPacket * v)1265 int serialize_QuorumPacket(struct oarchive *out, const char *tag, struct QuorumPacket *v){
1266     int rc;
1267     rc = out->start_record(out, tag);
1268     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
1269     rc = rc ? rc : out->serialize_Long(out, "zxid", &v->zxid);
1270     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
1271     rc = rc ? rc : serialize_Id_vector(out, "authinfo", &v->authinfo);
1272     rc = rc ? rc : out->end_record(out, tag);
1273     return rc;
1274 }
deserialize_QuorumPacket(struct iarchive * in,const char * tag,struct QuorumPacket * v)1275 int deserialize_QuorumPacket(struct iarchive *in, const char *tag, struct QuorumPacket*v){
1276     int rc;
1277     rc = in->start_record(in, tag);
1278     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
1279     rc = rc ? rc : in->deserialize_Long(in, "zxid", &v->zxid);
1280     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
1281     rc = rc ? rc : deserialize_Id_vector(in, "authinfo", &v->authinfo);
1282     rc = rc ? rc : in->end_record(in, tag);
1283     return rc;
1284 }
deallocate_QuorumPacket(struct QuorumPacket * v)1285 void deallocate_QuorumPacket(struct QuorumPacket*v){
1286     deallocate_Buffer(&v->data);
1287     deallocate_Id_vector(&v->authinfo);
1288 }
serialize_QuorumAuthPacket(struct oarchive * out,const char * tag,struct QuorumAuthPacket * v)1289 int serialize_QuorumAuthPacket(struct oarchive *out, const char *tag, struct QuorumAuthPacket *v){
1290     int rc;
1291     rc = out->start_record(out, tag);
1292     rc = rc ? rc : out->serialize_Long(out, "magic", &v->magic);
1293     rc = rc ? rc : out->serialize_Int(out, "status", &v->status);
1294     rc = rc ? rc : out->serialize_Buffer(out, "token", &v->token);
1295     rc = rc ? rc : out->end_record(out, tag);
1296     return rc;
1297 }
deserialize_QuorumAuthPacket(struct iarchive * in,const char * tag,struct QuorumAuthPacket * v)1298 int deserialize_QuorumAuthPacket(struct iarchive *in, const char *tag, struct QuorumAuthPacket*v){
1299     int rc;
1300     rc = in->start_record(in, tag);
1301     rc = rc ? rc : in->deserialize_Long(in, "magic", &v->magic);
1302     rc = rc ? rc : in->deserialize_Int(in, "status", &v->status);
1303     rc = rc ? rc : in->deserialize_Buffer(in, "token", &v->token);
1304     rc = rc ? rc : in->end_record(in, tag);
1305     return rc;
1306 }
deallocate_QuorumAuthPacket(struct QuorumAuthPacket * v)1307 void deallocate_QuorumAuthPacket(struct QuorumAuthPacket*v){
1308     deallocate_Buffer(&v->token);
1309 }
serialize_FileHeader(struct oarchive * out,const char * tag,struct FileHeader * v)1310 int serialize_FileHeader(struct oarchive *out, const char *tag, struct FileHeader *v){
1311     int rc;
1312     rc = out->start_record(out, tag);
1313     rc = rc ? rc : out->serialize_Int(out, "magic", &v->magic);
1314     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
1315     rc = rc ? rc : out->serialize_Long(out, "dbid", &v->dbid);
1316     rc = rc ? rc : out->end_record(out, tag);
1317     return rc;
1318 }
deserialize_FileHeader(struct iarchive * in,const char * tag,struct FileHeader * v)1319 int deserialize_FileHeader(struct iarchive *in, const char *tag, struct FileHeader*v){
1320     int rc;
1321     rc = in->start_record(in, tag);
1322     rc = rc ? rc : in->deserialize_Int(in, "magic", &v->magic);
1323     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
1324     rc = rc ? rc : in->deserialize_Long(in, "dbid", &v->dbid);
1325     rc = rc ? rc : in->end_record(in, tag);
1326     return rc;
1327 }
deallocate_FileHeader(struct FileHeader * v)1328 void deallocate_FileHeader(struct FileHeader*v){
1329 }
serialize_TxnDigest(struct oarchive * out,const char * tag,struct TxnDigest * v)1330 int serialize_TxnDigest(struct oarchive *out, const char *tag, struct TxnDigest *v){
1331     int rc;
1332     rc = out->start_record(out, tag);
1333     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
1334     rc = rc ? rc : out->serialize_Long(out, "treeDigest", &v->treeDigest);
1335     rc = rc ? rc : out->end_record(out, tag);
1336     return rc;
1337 }
deserialize_TxnDigest(struct iarchive * in,const char * tag,struct TxnDigest * v)1338 int deserialize_TxnDigest(struct iarchive *in, const char *tag, struct TxnDigest*v){
1339     int rc;
1340     rc = in->start_record(in, tag);
1341     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
1342     rc = rc ? rc : in->deserialize_Long(in, "treeDigest", &v->treeDigest);
1343     rc = rc ? rc : in->end_record(in, tag);
1344     return rc;
1345 }
deallocate_TxnDigest(struct TxnDigest * v)1346 void deallocate_TxnDigest(struct TxnDigest*v){
1347 }
serialize_TxnHeader(struct oarchive * out,const char * tag,struct TxnHeader * v)1348 int serialize_TxnHeader(struct oarchive *out, const char *tag, struct TxnHeader *v){
1349     int rc;
1350     rc = out->start_record(out, tag);
1351     rc = rc ? rc : out->serialize_Long(out, "clientId", &v->clientId);
1352     rc = rc ? rc : out->serialize_Int(out, "cxid", &v->cxid);
1353     rc = rc ? rc : out->serialize_Long(out, "zxid", &v->zxid);
1354     rc = rc ? rc : out->serialize_Long(out, "time", &v->time);
1355     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
1356     rc = rc ? rc : out->end_record(out, tag);
1357     return rc;
1358 }
deserialize_TxnHeader(struct iarchive * in,const char * tag,struct TxnHeader * v)1359 int deserialize_TxnHeader(struct iarchive *in, const char *tag, struct TxnHeader*v){
1360     int rc;
1361     rc = in->start_record(in, tag);
1362     rc = rc ? rc : in->deserialize_Long(in, "clientId", &v->clientId);
1363     rc = rc ? rc : in->deserialize_Int(in, "cxid", &v->cxid);
1364     rc = rc ? rc : in->deserialize_Long(in, "zxid", &v->zxid);
1365     rc = rc ? rc : in->deserialize_Long(in, "time", &v->time);
1366     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
1367     rc = rc ? rc : in->end_record(in, tag);
1368     return rc;
1369 }
deallocate_TxnHeader(struct TxnHeader * v)1370 void deallocate_TxnHeader(struct TxnHeader*v){
1371 }
serialize_CreateTxnV0(struct oarchive * out,const char * tag,struct CreateTxnV0 * v)1372 int serialize_CreateTxnV0(struct oarchive *out, const char *tag, struct CreateTxnV0 *v){
1373     int rc;
1374     rc = out->start_record(out, tag);
1375     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1376     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
1377     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
1378     rc = rc ? rc : out->serialize_Bool(out, "ephemeral", &v->ephemeral);
1379     rc = rc ? rc : out->end_record(out, tag);
1380     return rc;
1381 }
deserialize_CreateTxnV0(struct iarchive * in,const char * tag,struct CreateTxnV0 * v)1382 int deserialize_CreateTxnV0(struct iarchive *in, const char *tag, struct CreateTxnV0*v){
1383     int rc;
1384     rc = in->start_record(in, tag);
1385     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1386     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
1387     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
1388     rc = rc ? rc : in->deserialize_Bool(in, "ephemeral", &v->ephemeral);
1389     rc = rc ? rc : in->end_record(in, tag);
1390     return rc;
1391 }
deallocate_CreateTxnV0(struct CreateTxnV0 * v)1392 void deallocate_CreateTxnV0(struct CreateTxnV0*v){
1393     deallocate_String(&v->path);
1394     deallocate_Buffer(&v->data);
1395     deallocate_ACL_vector(&v->acl);
1396 }
serialize_CreateTxn(struct oarchive * out,const char * tag,struct CreateTxn * v)1397 int serialize_CreateTxn(struct oarchive *out, const char *tag, struct CreateTxn *v){
1398     int rc;
1399     rc = out->start_record(out, tag);
1400     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1401     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
1402     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
1403     rc = rc ? rc : out->serialize_Bool(out, "ephemeral", &v->ephemeral);
1404     rc = rc ? rc : out->serialize_Int(out, "parentCVersion", &v->parentCVersion);
1405     rc = rc ? rc : out->end_record(out, tag);
1406     return rc;
1407 }
deserialize_CreateTxn(struct iarchive * in,const char * tag,struct CreateTxn * v)1408 int deserialize_CreateTxn(struct iarchive *in, const char *tag, struct CreateTxn*v){
1409     int rc;
1410     rc = in->start_record(in, tag);
1411     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1412     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
1413     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
1414     rc = rc ? rc : in->deserialize_Bool(in, "ephemeral", &v->ephemeral);
1415     rc = rc ? rc : in->deserialize_Int(in, "parentCVersion", &v->parentCVersion);
1416     rc = rc ? rc : in->end_record(in, tag);
1417     return rc;
1418 }
deallocate_CreateTxn(struct CreateTxn * v)1419 void deallocate_CreateTxn(struct CreateTxn*v){
1420     deallocate_String(&v->path);
1421     deallocate_Buffer(&v->data);
1422     deallocate_ACL_vector(&v->acl);
1423 }
serialize_CreateTTLTxn(struct oarchive * out,const char * tag,struct CreateTTLTxn * v)1424 int serialize_CreateTTLTxn(struct oarchive *out, const char *tag, struct CreateTTLTxn *v){
1425     int rc;
1426     rc = out->start_record(out, tag);
1427     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1428     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
1429     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
1430     rc = rc ? rc : out->serialize_Int(out, "parentCVersion", &v->parentCVersion);
1431     rc = rc ? rc : out->serialize_Long(out, "ttl", &v->ttl);
1432     rc = rc ? rc : out->end_record(out, tag);
1433     return rc;
1434 }
deserialize_CreateTTLTxn(struct iarchive * in,const char * tag,struct CreateTTLTxn * v)1435 int deserialize_CreateTTLTxn(struct iarchive *in, const char *tag, struct CreateTTLTxn*v){
1436     int rc;
1437     rc = in->start_record(in, tag);
1438     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1439     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
1440     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
1441     rc = rc ? rc : in->deserialize_Int(in, "parentCVersion", &v->parentCVersion);
1442     rc = rc ? rc : in->deserialize_Long(in, "ttl", &v->ttl);
1443     rc = rc ? rc : in->end_record(in, tag);
1444     return rc;
1445 }
deallocate_CreateTTLTxn(struct CreateTTLTxn * v)1446 void deallocate_CreateTTLTxn(struct CreateTTLTxn*v){
1447     deallocate_String(&v->path);
1448     deallocate_Buffer(&v->data);
1449     deallocate_ACL_vector(&v->acl);
1450 }
serialize_CreateContainerTxn(struct oarchive * out,const char * tag,struct CreateContainerTxn * v)1451 int serialize_CreateContainerTxn(struct oarchive *out, const char *tag, struct CreateContainerTxn *v){
1452     int rc;
1453     rc = out->start_record(out, tag);
1454     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1455     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
1456     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
1457     rc = rc ? rc : out->serialize_Int(out, "parentCVersion", &v->parentCVersion);
1458     rc = rc ? rc : out->end_record(out, tag);
1459     return rc;
1460 }
deserialize_CreateContainerTxn(struct iarchive * in,const char * tag,struct CreateContainerTxn * v)1461 int deserialize_CreateContainerTxn(struct iarchive *in, const char *tag, struct CreateContainerTxn*v){
1462     int rc;
1463     rc = in->start_record(in, tag);
1464     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1465     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
1466     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
1467     rc = rc ? rc : in->deserialize_Int(in, "parentCVersion", &v->parentCVersion);
1468     rc = rc ? rc : in->end_record(in, tag);
1469     return rc;
1470 }
deallocate_CreateContainerTxn(struct CreateContainerTxn * v)1471 void deallocate_CreateContainerTxn(struct CreateContainerTxn*v){
1472     deallocate_String(&v->path);
1473     deallocate_Buffer(&v->data);
1474     deallocate_ACL_vector(&v->acl);
1475 }
serialize_DeleteTxn(struct oarchive * out,const char * tag,struct DeleteTxn * v)1476 int serialize_DeleteTxn(struct oarchive *out, const char *tag, struct DeleteTxn *v){
1477     int rc;
1478     rc = out->start_record(out, tag);
1479     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1480     rc = rc ? rc : out->end_record(out, tag);
1481     return rc;
1482 }
deserialize_DeleteTxn(struct iarchive * in,const char * tag,struct DeleteTxn * v)1483 int deserialize_DeleteTxn(struct iarchive *in, const char *tag, struct DeleteTxn*v){
1484     int rc;
1485     rc = in->start_record(in, tag);
1486     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1487     rc = rc ? rc : in->end_record(in, tag);
1488     return rc;
1489 }
deallocate_DeleteTxn(struct DeleteTxn * v)1490 void deallocate_DeleteTxn(struct DeleteTxn*v){
1491     deallocate_String(&v->path);
1492 }
serialize_SetDataTxn(struct oarchive * out,const char * tag,struct SetDataTxn * v)1493 int serialize_SetDataTxn(struct oarchive *out, const char *tag, struct SetDataTxn *v){
1494     int rc;
1495     rc = out->start_record(out, tag);
1496     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1497     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
1498     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
1499     rc = rc ? rc : out->end_record(out, tag);
1500     return rc;
1501 }
deserialize_SetDataTxn(struct iarchive * in,const char * tag,struct SetDataTxn * v)1502 int deserialize_SetDataTxn(struct iarchive *in, const char *tag, struct SetDataTxn*v){
1503     int rc;
1504     rc = in->start_record(in, tag);
1505     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1506     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
1507     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
1508     rc = rc ? rc : in->end_record(in, tag);
1509     return rc;
1510 }
deallocate_SetDataTxn(struct SetDataTxn * v)1511 void deallocate_SetDataTxn(struct SetDataTxn*v){
1512     deallocate_String(&v->path);
1513     deallocate_Buffer(&v->data);
1514 }
serialize_CheckVersionTxn(struct oarchive * out,const char * tag,struct CheckVersionTxn * v)1515 int serialize_CheckVersionTxn(struct oarchive *out, const char *tag, struct CheckVersionTxn *v){
1516     int rc;
1517     rc = out->start_record(out, tag);
1518     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1519     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
1520     rc = rc ? rc : out->end_record(out, tag);
1521     return rc;
1522 }
deserialize_CheckVersionTxn(struct iarchive * in,const char * tag,struct CheckVersionTxn * v)1523 int deserialize_CheckVersionTxn(struct iarchive *in, const char *tag, struct CheckVersionTxn*v){
1524     int rc;
1525     rc = in->start_record(in, tag);
1526     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1527     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
1528     rc = rc ? rc : in->end_record(in, tag);
1529     return rc;
1530 }
deallocate_CheckVersionTxn(struct CheckVersionTxn * v)1531 void deallocate_CheckVersionTxn(struct CheckVersionTxn*v){
1532     deallocate_String(&v->path);
1533 }
serialize_SetACLTxn(struct oarchive * out,const char * tag,struct SetACLTxn * v)1534 int serialize_SetACLTxn(struct oarchive *out, const char *tag, struct SetACLTxn *v){
1535     int rc;
1536     rc = out->start_record(out, tag);
1537     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1538     rc = rc ? rc : serialize_ACL_vector(out, "acl", &v->acl);
1539     rc = rc ? rc : out->serialize_Int(out, "version", &v->version);
1540     rc = rc ? rc : out->end_record(out, tag);
1541     return rc;
1542 }
deserialize_SetACLTxn(struct iarchive * in,const char * tag,struct SetACLTxn * v)1543 int deserialize_SetACLTxn(struct iarchive *in, const char *tag, struct SetACLTxn*v){
1544     int rc;
1545     rc = in->start_record(in, tag);
1546     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1547     rc = rc ? rc : deserialize_ACL_vector(in, "acl", &v->acl);
1548     rc = rc ? rc : in->deserialize_Int(in, "version", &v->version);
1549     rc = rc ? rc : in->end_record(in, tag);
1550     return rc;
1551 }
deallocate_SetACLTxn(struct SetACLTxn * v)1552 void deallocate_SetACLTxn(struct SetACLTxn*v){
1553     deallocate_String(&v->path);
1554     deallocate_ACL_vector(&v->acl);
1555 }
serialize_SetMaxChildrenTxn(struct oarchive * out,const char * tag,struct SetMaxChildrenTxn * v)1556 int serialize_SetMaxChildrenTxn(struct oarchive *out, const char *tag, struct SetMaxChildrenTxn *v){
1557     int rc;
1558     rc = out->start_record(out, tag);
1559     rc = rc ? rc : out->serialize_String(out, "path", &v->path);
1560     rc = rc ? rc : out->serialize_Int(out, "max", &v->max);
1561     rc = rc ? rc : out->end_record(out, tag);
1562     return rc;
1563 }
deserialize_SetMaxChildrenTxn(struct iarchive * in,const char * tag,struct SetMaxChildrenTxn * v)1564 int deserialize_SetMaxChildrenTxn(struct iarchive *in, const char *tag, struct SetMaxChildrenTxn*v){
1565     int rc;
1566     rc = in->start_record(in, tag);
1567     rc = rc ? rc : in->deserialize_String(in, "path", &v->path);
1568     rc = rc ? rc : in->deserialize_Int(in, "max", &v->max);
1569     rc = rc ? rc : in->end_record(in, tag);
1570     return rc;
1571 }
deallocate_SetMaxChildrenTxn(struct SetMaxChildrenTxn * v)1572 void deallocate_SetMaxChildrenTxn(struct SetMaxChildrenTxn*v){
1573     deallocate_String(&v->path);
1574 }
serialize_CreateSessionTxn(struct oarchive * out,const char * tag,struct CreateSessionTxn * v)1575 int serialize_CreateSessionTxn(struct oarchive *out, const char *tag, struct CreateSessionTxn *v){
1576     int rc;
1577     rc = out->start_record(out, tag);
1578     rc = rc ? rc : out->serialize_Int(out, "timeOut", &v->timeOut);
1579     rc = rc ? rc : out->end_record(out, tag);
1580     return rc;
1581 }
deserialize_CreateSessionTxn(struct iarchive * in,const char * tag,struct CreateSessionTxn * v)1582 int deserialize_CreateSessionTxn(struct iarchive *in, const char *tag, struct CreateSessionTxn*v){
1583     int rc;
1584     rc = in->start_record(in, tag);
1585     rc = rc ? rc : in->deserialize_Int(in, "timeOut", &v->timeOut);
1586     rc = rc ? rc : in->end_record(in, tag);
1587     return rc;
1588 }
deallocate_CreateSessionTxn(struct CreateSessionTxn * v)1589 void deallocate_CreateSessionTxn(struct CreateSessionTxn*v){
1590 }
serialize_CloseSessionTxn(struct oarchive * out,const char * tag,struct CloseSessionTxn * v)1591 int serialize_CloseSessionTxn(struct oarchive *out, const char *tag, struct CloseSessionTxn *v){
1592     int rc;
1593     rc = out->start_record(out, tag);
1594     rc = rc ? rc : serialize_String_vector(out, "paths2Delete", &v->paths2Delete);
1595     rc = rc ? rc : out->end_record(out, tag);
1596     return rc;
1597 }
deserialize_CloseSessionTxn(struct iarchive * in,const char * tag,struct CloseSessionTxn * v)1598 int deserialize_CloseSessionTxn(struct iarchive *in, const char *tag, struct CloseSessionTxn*v){
1599     int rc;
1600     rc = in->start_record(in, tag);
1601     rc = rc ? rc : deserialize_String_vector(in, "paths2Delete", &v->paths2Delete);
1602     rc = rc ? rc : in->end_record(in, tag);
1603     return rc;
1604 }
deallocate_CloseSessionTxn(struct CloseSessionTxn * v)1605 void deallocate_CloseSessionTxn(struct CloseSessionTxn*v){
1606     deallocate_String_vector(&v->paths2Delete);
1607 }
serialize_ErrorTxn(struct oarchive * out,const char * tag,struct ErrorTxn * v)1608 int serialize_ErrorTxn(struct oarchive *out, const char *tag, struct ErrorTxn *v){
1609     int rc;
1610     rc = out->start_record(out, tag);
1611     rc = rc ? rc : out->serialize_Int(out, "err", &v->err);
1612     rc = rc ? rc : out->end_record(out, tag);
1613     return rc;
1614 }
deserialize_ErrorTxn(struct iarchive * in,const char * tag,struct ErrorTxn * v)1615 int deserialize_ErrorTxn(struct iarchive *in, const char *tag, struct ErrorTxn*v){
1616     int rc;
1617     rc = in->start_record(in, tag);
1618     rc = rc ? rc : in->deserialize_Int(in, "err", &v->err);
1619     rc = rc ? rc : in->end_record(in, tag);
1620     return rc;
1621 }
deallocate_ErrorTxn(struct ErrorTxn * v)1622 void deallocate_ErrorTxn(struct ErrorTxn*v){
1623 }
serialize_Txn(struct oarchive * out,const char * tag,struct Txn * v)1624 int serialize_Txn(struct oarchive *out, const char *tag, struct Txn *v){
1625     int rc;
1626     rc = out->start_record(out, tag);
1627     rc = rc ? rc : out->serialize_Int(out, "type", &v->type);
1628     rc = rc ? rc : out->serialize_Buffer(out, "data", &v->data);
1629     rc = rc ? rc : out->end_record(out, tag);
1630     return rc;
1631 }
deserialize_Txn(struct iarchive * in,const char * tag,struct Txn * v)1632 int deserialize_Txn(struct iarchive *in, const char *tag, struct Txn*v){
1633     int rc;
1634     rc = in->start_record(in, tag);
1635     rc = rc ? rc : in->deserialize_Int(in, "type", &v->type);
1636     rc = rc ? rc : in->deserialize_Buffer(in, "data", &v->data);
1637     rc = rc ? rc : in->end_record(in, tag);
1638     return rc;
1639 }
deallocate_Txn(struct Txn * v)1640 void deallocate_Txn(struct Txn*v){
1641     deallocate_Buffer(&v->data);
1642 }
allocate_Txn_vector(struct Txn_vector * v,int32_t len)1643 int allocate_Txn_vector(struct Txn_vector *v, int32_t len) {
1644     if (!len) {
1645         v->count = 0;
1646         v->data = 0;
1647     } else {
1648         v->count = len;
1649         v->data = calloc(sizeof(*v->data), len);
1650     }
1651     return 0;
1652 }
deallocate_Txn_vector(struct Txn_vector * v)1653 int deallocate_Txn_vector(struct Txn_vector *v) {
1654     if (v->data) {
1655         int32_t i;
1656         for(i=0;i<v->count; i++) {
1657             deallocate_Txn(&v->data[i]);
1658         }
1659         free(v->data);
1660         v->data = 0;
1661     }
1662     return 0;
1663 }
serialize_Txn_vector(struct oarchive * out,const char * tag,struct Txn_vector * v)1664 int serialize_Txn_vector(struct oarchive *out, const char *tag, struct Txn_vector *v)
1665 {
1666     int32_t count = v->count;
1667     int rc = 0;
1668     int32_t i;
1669     rc = out->start_vector(out, tag, &count);
1670     for(i=0;i<v->count;i++) {
1671     rc = rc ? rc : serialize_Txn(out, "data", &v->data[i]);
1672     }
1673     rc = rc ? rc : out->end_vector(out, tag);
1674     return rc;
1675 }
deserialize_Txn_vector(struct iarchive * in,const char * tag,struct Txn_vector * v)1676 int deserialize_Txn_vector(struct iarchive *in, const char *tag, struct Txn_vector *v)
1677 {
1678     int rc = 0;
1679     int32_t i;
1680     rc = in->start_vector(in, tag, &v->count);
1681     v->data = calloc(v->count, sizeof(*v->data));
1682     for(i=0;i<v->count;i++) {
1683     rc = rc ? rc : deserialize_Txn(in, "value", &v->data[i]);
1684     }
1685     rc = in->end_vector(in, tag);
1686     return rc;
1687 }
serialize_MultiTxn(struct oarchive * out,const char * tag,struct MultiTxn * v)1688 int serialize_MultiTxn(struct oarchive *out, const char *tag, struct MultiTxn *v){
1689     int rc;
1690     rc = out->start_record(out, tag);
1691     rc = rc ? rc : serialize_Txn_vector(out, "txns", &v->txns);
1692     rc = rc ? rc : out->end_record(out, tag);
1693     return rc;
1694 }
deserialize_MultiTxn(struct iarchive * in,const char * tag,struct MultiTxn * v)1695 int deserialize_MultiTxn(struct iarchive *in, const char *tag, struct MultiTxn*v){
1696     int rc;
1697     rc = in->start_record(in, tag);
1698     rc = rc ? rc : deserialize_Txn_vector(in, "txns", &v->txns);
1699     rc = rc ? rc : in->end_record(in, tag);
1700     return rc;
1701 }
deallocate_MultiTxn(struct MultiTxn * v)1702 void deallocate_MultiTxn(struct MultiTxn*v){
1703     deallocate_Txn_vector(&v->txns);
1704 }
1705