View | Details | Raw Unified | Return to bug 241583 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 241583