compiler: introduce workaround for annotation ids in nestednode list (see comments), and regenerate schema .{c|h} files based on capnproto v0.5.2
This commit is contained in:
parent
98c2d02744
commit
560366c7d4
3 changed files with 402 additions and 88 deletions
|
|
@ -28,6 +28,10 @@ struct node {
|
||||||
struct field *fields;
|
struct field *fields;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// annotation ids introduced via c++.capnp, see comments in find_node()
|
||||||
|
static const uint64_t NAMESPACE_ANNOTATION_ID = 0xb9c6f99ebf805f2cull;
|
||||||
|
static const uint64_t NAME_ANNOTATION_ID = 0xf264a779fef191ceull;
|
||||||
|
|
||||||
static struct str SRC = STR_INIT, HDR = STR_INIT;
|
static struct str SRC = STR_INIT, HDR = STR_INIT;
|
||||||
static struct capn g_valcapn;
|
static struct capn g_valcapn;
|
||||||
static struct capn_segment g_valseg;
|
static struct capn_segment g_valseg;
|
||||||
|
|
@ -37,6 +41,24 @@ static int g_val0used, g_nullused;
|
||||||
static struct capn_tree *g_node_tree;
|
static struct capn_tree *g_node_tree;
|
||||||
|
|
||||||
struct node *find_node(uint64_t id) {
|
struct node *find_node(uint64_t id) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: an Annotation is technically a node (since it can show up in
|
||||||
|
* a Node's NestedNode list), but a `struct node` is currently configured
|
||||||
|
* to represent only Nodes. So when processing all nested nodes,
|
||||||
|
* we need a way to handle entities (like Annotation) which can't be
|
||||||
|
* represented by a `struct node`.
|
||||||
|
*
|
||||||
|
* Current workaround is a hard coded test for the annotations
|
||||||
|
* introduced via c++.capnp (NAME_ANNOTATION_ID and NAMESPACE_ANNOTATION_ID),
|
||||||
|
* and to report that we don't have a node associated with them
|
||||||
|
* (but at least don't fail and stop further processing).
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (id == NAME_ANNOTATION_ID || id == NAMESPACE_ANNOTATION_ID) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
struct node *s = (struct node*) g_node_tree;
|
struct node *s = (struct node*) g_node_tree;
|
||||||
while (s && s->n.id != id) {
|
while (s && s->n.id != id) {
|
||||||
s = (struct node*) s->hdr.link[s->n.id < id];
|
s = (struct node*) s->hdr.link[s->n.id < id];
|
||||||
|
|
@ -71,7 +93,10 @@ static void resolve_names(struct str *b, struct node *n, capn_text name, struct
|
||||||
for (i = capn_len(n->n.nestedNodes)-1; i >= 0; i--) {
|
for (i = capn_len(n->n.nestedNodes)-1; i >= 0; i--) {
|
||||||
struct Node_NestedNode nest;
|
struct Node_NestedNode nest;
|
||||||
get_Node_NestedNode(&nest, n->n.nestedNodes, i);
|
get_Node_NestedNode(&nest, n->n.nestedNodes, i);
|
||||||
resolve_names(b, find_node(nest.id), nest.name, file);
|
struct node *nn = find_node(nest.id);
|
||||||
|
if (nn != NULL) {
|
||||||
|
resolve_names(b, nn, nest.name, file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n->n.which == Node__struct) {
|
if (n->n.which == Node__struct) {
|
||||||
|
|
@ -161,7 +186,7 @@ static void decode_value(struct value* v, Type_ptr type, Value_ptr value, const
|
||||||
case Type__interface:
|
case Type__interface:
|
||||||
v->tname = strf(&v->tname_buf, "%s_ptr", find_node(v->t._struct.typeId)->name.str);
|
v->tname = strf(&v->tname_buf, "%s_ptr", find_node(v->t._struct.typeId)->name.str);
|
||||||
break;
|
break;
|
||||||
case Type_object:
|
case Type_anyPointer:
|
||||||
v->tname = "capn_ptr";
|
v->tname = "capn_ptr";
|
||||||
break;
|
break;
|
||||||
case Type__list:
|
case Type__list:
|
||||||
|
|
@ -195,7 +220,7 @@ static void decode_value(struct value* v, Type_ptr type, Value_ptr value, const
|
||||||
break;
|
break;
|
||||||
case Type_text:
|
case Type_text:
|
||||||
case Type_data:
|
case Type_data:
|
||||||
case Type_object:
|
case Type_anyPointer:
|
||||||
case Type__list:
|
case Type__list:
|
||||||
v->tname = "capn_ptr";
|
v->tname = "capn_ptr";
|
||||||
break;
|
break;
|
||||||
|
|
@ -258,11 +283,11 @@ static void decode_value(struct value* v, Type_ptr type, Value_ptr value, const
|
||||||
|
|
||||||
case Value_data:
|
case Value_data:
|
||||||
case Value__struct:
|
case Value__struct:
|
||||||
case Value_object:
|
case Value_anyPointer:
|
||||||
case Value__list:
|
case Value__list:
|
||||||
if (v->v.object.type) {
|
if (v->v.anyPointer.type) {
|
||||||
capn_ptr p = capn_root(&g_valcapn);
|
capn_ptr p = capn_root(&g_valcapn);
|
||||||
if (capn_setp(p, 0, v->v.object)) {
|
if (capn_setp(p, 0, v->v.anyPointer)) {
|
||||||
fprintf(stderr, "failed to copy object\n");
|
fprintf(stderr, "failed to copy object\n");
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
@ -359,7 +384,7 @@ static void define_const(struct node *n) {
|
||||||
case Value_text:
|
case Value_text:
|
||||||
case Value_data:
|
case Value_data:
|
||||||
case Value__struct:
|
case Value__struct:
|
||||||
case Value_object:
|
case Value_anyPointer:
|
||||||
case Value__list:
|
case Value__list:
|
||||||
str_addf(&HDR, "extern %s %s;\n", v.tname, n->name.str);
|
str_addf(&HDR, "extern %s %s;\n", v.tname, n->name.str);
|
||||||
if (!v.ptrval.type) {
|
if (!v.ptrval.type) {
|
||||||
|
|
@ -498,7 +523,7 @@ static void set_member(struct str *func, struct field *f, const char *ptr, const
|
||||||
case Type__struct:
|
case Type__struct:
|
||||||
case Type__interface:
|
case Type__interface:
|
||||||
case Type__list:
|
case Type__list:
|
||||||
case Type_object:
|
case Type_anyPointer:
|
||||||
if (!f->v.intval) {
|
if (!f->v.intval) {
|
||||||
str_addf(func, "capn_setp(%s, %d, %s);\n",
|
str_addf(func, "capn_setp(%s, %d, %s);\n",
|
||||||
ptr, f->f.slot.offset, pvar);
|
ptr, f->f.slot.offset, pvar);
|
||||||
|
|
@ -575,7 +600,7 @@ static void get_member(struct str *func, struct field *f, const char *ptr, const
|
||||||
break;
|
break;
|
||||||
case Type__struct:
|
case Type__struct:
|
||||||
case Type__interface:
|
case Type__interface:
|
||||||
case Type_object:
|
case Type_anyPointer:
|
||||||
case Type__list:
|
case Type__list:
|
||||||
str_addf(func, "%s = capn_getp(%s, %d, 0);\n", pvar, ptr, f->f.slot.offset);
|
str_addf(func, "%s = capn_getp(%s, %d, 0);\n", pvar, ptr, f->f.slot.offset);
|
||||||
break;
|
break;
|
||||||
|
|
@ -728,7 +753,7 @@ static void do_union(struct strings *s, struct node *n, struct field *first_fiel
|
||||||
union_cases(s, n, first_field, (1 << Type_int64) | (1 << Type_uint64) | (1 << Type_float64));
|
union_cases(s, n, first_field, (1 << Type_int64) | (1 << Type_uint64) | (1 << Type_float64));
|
||||||
union_cases(s, n, first_field, (1 << Type_text));
|
union_cases(s, n, first_field, (1 << Type_text));
|
||||||
union_cases(s, n, first_field, (1 << Type_data));
|
union_cases(s, n, first_field, (1 << Type_data));
|
||||||
union_cases(s, n, first_field, (1 << Type__struct) | (1 << Type__interface) | (1 << Type_object) | (1 << Type__list));
|
union_cases(s, n, first_field, (1 << Type__struct) | (1 << Type__interface) | (1 << Type_anyPointer) | (1 << Type__list));
|
||||||
|
|
||||||
str_addf(&s->decl, "%sunion {\n", s->dtab.str);
|
str_addf(&s->decl, "%sunion {\n", s->dtab.str);
|
||||||
str_add(&s->dtab, "\t", -1);
|
str_add(&s->dtab, "\t", -1);
|
||||||
|
|
@ -980,7 +1005,7 @@ static void define_method(struct node *iface, int ord) {
|
||||||
case Type__list:
|
case Type__list:
|
||||||
case Type__struct:
|
case Type__struct:
|
||||||
case Type__interface:
|
case Type__interface:
|
||||||
case Type_object:
|
case Type_anyPointer:
|
||||||
m->f.offset = ptrs++;
|
m->f.offset = ptrs++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1117,7 +1142,10 @@ int main() {
|
||||||
for (i = capn_len(n->n.nestedNodes)-1; i >= 0; i--) {
|
for (i = capn_len(n->n.nestedNodes)-1; i >= 0; i--) {
|
||||||
struct Node_NestedNode nest;
|
struct Node_NestedNode nest;
|
||||||
get_Node_NestedNode(&nest, n->n.nestedNodes, i);
|
get_Node_NestedNode(&nest, n->n.nestedNodes, i);
|
||||||
resolve_names(&b, find_node(nest.id), nest.name, n);
|
struct node *nn = find_node(nest.id);
|
||||||
|
if (nn) {
|
||||||
|
resolve_names(&b, nn, nest.name, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
str_release(&b);
|
str_release(&b);
|
||||||
|
|
@ -1138,6 +1166,10 @@ int main() {
|
||||||
|
|
||||||
get_CodeGeneratorRequest_RequestedFile(&file_req, req.requestedFiles, i);
|
get_CodeGeneratorRequest_RequestedFile(&file_req, req.requestedFiles, i);
|
||||||
file_node = find_node(file_req.id);
|
file_node = find_node(file_req.id);
|
||||||
|
if (file_node == NULL) {
|
||||||
|
fprintf(stderr, "invalid file_node specified\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
str_reset(&HDR);
|
str_reset(&HDR);
|
||||||
str_reset(&SRC);
|
str_reset(&SRC);
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
#include "schema.capnp.h"
|
#include "schema.capnp.h"
|
||||||
/* AUTO GENERATED - DO NOT EDIT */
|
/* AUTO GENERATED - DO NOT EDIT */
|
||||||
static const capn_text capn_val0 = {0,""};
|
static const capn_text capn_val0 = {0,""};
|
||||||
|
uint16_t Field_noDiscriminant = 65535;
|
||||||
|
|
||||||
Node_ptr new_Node(struct capn_segment *s) {
|
Node_ptr new_Node(struct capn_segment *s) {
|
||||||
Node_ptr p;
|
Node_ptr p;
|
||||||
p.p = capn_new_struct(s, 40, 5);
|
p.p = capn_new_struct(s, 40, 6);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
Node_list new_Node_list(struct capn_segment *s, int len) {
|
Node_list new_Node_list(struct capn_segment *s, int len) {
|
||||||
Node_list p;
|
Node_list p;
|
||||||
p.p = capn_new_list(s, len, 40, 5);
|
p.p = capn_new_list(s, len, 40, 6);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
void read_Node(struct Node *s, Node_ptr p) {
|
void read_Node(struct Node *s, Node_ptr p) {
|
||||||
|
|
@ -18,6 +19,8 @@ void read_Node(struct Node *s, Node_ptr p) {
|
||||||
s->displayName = capn_get_text(p.p, 0, capn_val0);
|
s->displayName = capn_get_text(p.p, 0, capn_val0);
|
||||||
s->displayNamePrefixLength = capn_read32(p.p, 8);
|
s->displayNamePrefixLength = capn_read32(p.p, 8);
|
||||||
s->scopeId = capn_read64(p.p, 16);
|
s->scopeId = capn_read64(p.p, 16);
|
||||||
|
s->parameters.p = capn_getp(p.p, 5, 0);
|
||||||
|
s->isGeneric = (capn_read8(p.p, 36) & 1) != 0;
|
||||||
s->nestedNodes.p = capn_getp(p.p, 1, 0);
|
s->nestedNodes.p = capn_getp(p.p, 1, 0);
|
||||||
s->annotations.p = capn_getp(p.p, 2, 0);
|
s->annotations.p = capn_getp(p.p, 2, 0);
|
||||||
s->which = (enum Node_which) capn_read16(p.p, 12);
|
s->which = (enum Node_which) capn_read16(p.p, 12);
|
||||||
|
|
@ -36,6 +39,7 @@ void read_Node(struct Node *s, Node_ptr p) {
|
||||||
break;
|
break;
|
||||||
case Node__interface:
|
case Node__interface:
|
||||||
s->_interface.methods.p = capn_getp(p.p, 3, 0);
|
s->_interface.methods.p = capn_getp(p.p, 3, 0);
|
||||||
|
s->_interface.superclasses.p = capn_getp(p.p, 4, 0);
|
||||||
break;
|
break;
|
||||||
case Node__const:
|
case Node__const:
|
||||||
s->_const.type.p = capn_getp(p.p, 3, 0);
|
s->_const.type.p = capn_getp(p.p, 3, 0);
|
||||||
|
|
@ -66,6 +70,8 @@ void write_Node(const struct Node *s, Node_ptr p) {
|
||||||
capn_set_text(p.p, 0, s->displayName);
|
capn_set_text(p.p, 0, s->displayName);
|
||||||
capn_write32(p.p, 8, s->displayNamePrefixLength);
|
capn_write32(p.p, 8, s->displayNamePrefixLength);
|
||||||
capn_write64(p.p, 16, s->scopeId);
|
capn_write64(p.p, 16, s->scopeId);
|
||||||
|
capn_setp(p.p, 5, s->parameters.p);
|
||||||
|
capn_write1(p.p, 288, s->isGeneric != 0);
|
||||||
capn_setp(p.p, 1, s->nestedNodes.p);
|
capn_setp(p.p, 1, s->nestedNodes.p);
|
||||||
capn_setp(p.p, 2, s->annotations.p);
|
capn_setp(p.p, 2, s->annotations.p);
|
||||||
capn_write16(p.p, 12, s->which);
|
capn_write16(p.p, 12, s->which);
|
||||||
|
|
@ -84,6 +90,7 @@ void write_Node(const struct Node *s, Node_ptr p) {
|
||||||
break;
|
break;
|
||||||
case Node__interface:
|
case Node__interface:
|
||||||
capn_setp(p.p, 3, s->_interface.methods.p);
|
capn_setp(p.p, 3, s->_interface.methods.p);
|
||||||
|
capn_setp(p.p, 4, s->_interface.superclasses.p);
|
||||||
break;
|
break;
|
||||||
case Node__const:
|
case Node__const:
|
||||||
capn_setp(p.p, 3, s->_const.type.p);
|
capn_setp(p.p, 3, s->_const.type.p);
|
||||||
|
|
@ -119,6 +126,35 @@ void set_Node(const struct Node *s, Node_list l, int i) {
|
||||||
write_Node(s, p);
|
write_Node(s, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Node_Parameter_ptr new_Node_Parameter(struct capn_segment *s) {
|
||||||
|
Node_Parameter_ptr p;
|
||||||
|
p.p = capn_new_struct(s, 0, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
Node_Parameter_list new_Node_Parameter_list(struct capn_segment *s, int len) {
|
||||||
|
Node_Parameter_list p;
|
||||||
|
p.p = capn_new_list(s, len, 0, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
void read_Node_Parameter(struct Node_Parameter *s, Node_Parameter_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
s->name = capn_get_text(p.p, 0, capn_val0);
|
||||||
|
}
|
||||||
|
void write_Node_Parameter(const struct Node_Parameter *s, Node_Parameter_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
capn_set_text(p.p, 0, s->name);
|
||||||
|
}
|
||||||
|
void get_Node_Parameter(struct Node_Parameter *s, Node_Parameter_list l, int i) {
|
||||||
|
Node_Parameter_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
read_Node_Parameter(s, p);
|
||||||
|
}
|
||||||
|
void set_Node_Parameter(const struct Node_Parameter *s, Node_Parameter_list l, int i) {
|
||||||
|
Node_Parameter_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
write_Node_Parameter(s, p);
|
||||||
|
}
|
||||||
|
|
||||||
Node_NestedNode_ptr new_Node_NestedNode(struct capn_segment *s) {
|
Node_NestedNode_ptr new_Node_NestedNode(struct capn_segment *s) {
|
||||||
Node_NestedNode_ptr p;
|
Node_NestedNode_ptr p;
|
||||||
p.p = capn_new_struct(s, 8, 1);
|
p.p = capn_new_struct(s, 8, 1);
|
||||||
|
|
@ -172,6 +208,7 @@ void read_Field(struct Field *s, Field_ptr p) {
|
||||||
s->slot.offset = capn_read32(p.p, 4);
|
s->slot.offset = capn_read32(p.p, 4);
|
||||||
s->slot.type.p = capn_getp(p.p, 2, 0);
|
s->slot.type.p = capn_getp(p.p, 2, 0);
|
||||||
s->slot.defaultValue.p = capn_getp(p.p, 3, 0);
|
s->slot.defaultValue.p = capn_getp(p.p, 3, 0);
|
||||||
|
s->slot.hadExplicitDefault = (capn_read8(p.p, 16) & 1) != 0;
|
||||||
break;
|
break;
|
||||||
case Field_group:
|
case Field_group:
|
||||||
s->group.typeId = capn_read64(p.p, 16);
|
s->group.typeId = capn_read64(p.p, 16);
|
||||||
|
|
@ -200,6 +237,7 @@ void write_Field(const struct Field *s, Field_ptr p) {
|
||||||
capn_write32(p.p, 4, s->slot.offset);
|
capn_write32(p.p, 4, s->slot.offset);
|
||||||
capn_setp(p.p, 2, s->slot.type.p);
|
capn_setp(p.p, 2, s->slot.type.p);
|
||||||
capn_setp(p.p, 3, s->slot.defaultValue.p);
|
capn_setp(p.p, 3, s->slot.defaultValue.p);
|
||||||
|
capn_write1(p.p, 128, s->slot.hadExplicitDefault != 0);
|
||||||
break;
|
break;
|
||||||
case Field_group:
|
case Field_group:
|
||||||
capn_write64(p.p, 16, s->group.typeId);
|
capn_write64(p.p, 16, s->group.typeId);
|
||||||
|
|
@ -260,33 +298,68 @@ void set_Enumerant(const struct Enumerant *s, Enumerant_list l, int i) {
|
||||||
write_Enumerant(s, p);
|
write_Enumerant(s, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Superclass_ptr new_Superclass(struct capn_segment *s) {
|
||||||
|
Superclass_ptr p;
|
||||||
|
p.p = capn_new_struct(s, 8, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
Superclass_list new_Superclass_list(struct capn_segment *s, int len) {
|
||||||
|
Superclass_list p;
|
||||||
|
p.p = capn_new_list(s, len, 8, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
void read_Superclass(struct Superclass *s, Superclass_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
s->id = capn_read64(p.p, 0);
|
||||||
|
s->brand.p = capn_getp(p.p, 0, 0);
|
||||||
|
}
|
||||||
|
void write_Superclass(const struct Superclass *s, Superclass_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
capn_write64(p.p, 0, s->id);
|
||||||
|
capn_setp(p.p, 0, s->brand.p);
|
||||||
|
}
|
||||||
|
void get_Superclass(struct Superclass *s, Superclass_list l, int i) {
|
||||||
|
Superclass_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
read_Superclass(s, p);
|
||||||
|
}
|
||||||
|
void set_Superclass(const struct Superclass *s, Superclass_list l, int i) {
|
||||||
|
Superclass_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
write_Superclass(s, p);
|
||||||
|
}
|
||||||
|
|
||||||
Method_ptr new_Method(struct capn_segment *s) {
|
Method_ptr new_Method(struct capn_segment *s) {
|
||||||
Method_ptr p;
|
Method_ptr p;
|
||||||
p.p = capn_new_struct(s, 8, 4);
|
p.p = capn_new_struct(s, 24, 5);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
Method_list new_Method_list(struct capn_segment *s, int len) {
|
Method_list new_Method_list(struct capn_segment *s, int len) {
|
||||||
Method_list p;
|
Method_list p;
|
||||||
p.p = capn_new_list(s, len, 8, 4);
|
p.p = capn_new_list(s, len, 24, 5);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
void read_Method(struct Method *s, Method_ptr p) {
|
void read_Method(struct Method *s, Method_ptr p) {
|
||||||
capn_resolve(&p.p);
|
capn_resolve(&p.p);
|
||||||
s->name = capn_get_text(p.p, 0, capn_val0);
|
s->name = capn_get_text(p.p, 0, capn_val0);
|
||||||
s->codeOrder = capn_read16(p.p, 0);
|
s->codeOrder = capn_read16(p.p, 0);
|
||||||
s->params.p = capn_getp(p.p, 1, 0);
|
s->implicitParameters.p = capn_getp(p.p, 4, 0);
|
||||||
s->requiredParamCount = capn_read16(p.p, 2);
|
s->paramStructType = capn_read64(p.p, 8);
|
||||||
s->returnType.p = capn_getp(p.p, 2, 0);
|
s->paramBrand.p = capn_getp(p.p, 2, 0);
|
||||||
s->annotations.p = capn_getp(p.p, 3, 0);
|
s->resultStructType = capn_read64(p.p, 16);
|
||||||
|
s->resultBrand.p = capn_getp(p.p, 3, 0);
|
||||||
|
s->annotations.p = capn_getp(p.p, 1, 0);
|
||||||
}
|
}
|
||||||
void write_Method(const struct Method *s, Method_ptr p) {
|
void write_Method(const struct Method *s, Method_ptr p) {
|
||||||
capn_resolve(&p.p);
|
capn_resolve(&p.p);
|
||||||
capn_set_text(p.p, 0, s->name);
|
capn_set_text(p.p, 0, s->name);
|
||||||
capn_write16(p.p, 0, s->codeOrder);
|
capn_write16(p.p, 0, s->codeOrder);
|
||||||
capn_setp(p.p, 1, s->params.p);
|
capn_setp(p.p, 4, s->implicitParameters.p);
|
||||||
capn_write16(p.p, 2, s->requiredParamCount);
|
capn_write64(p.p, 8, s->paramStructType);
|
||||||
capn_setp(p.p, 2, s->returnType.p);
|
capn_setp(p.p, 2, s->paramBrand.p);
|
||||||
capn_setp(p.p, 3, s->annotations.p);
|
capn_write64(p.p, 16, s->resultStructType);
|
||||||
|
capn_setp(p.p, 3, s->resultBrand.p);
|
||||||
|
capn_setp(p.p, 1, s->annotations.p);
|
||||||
}
|
}
|
||||||
void get_Method(struct Method *s, Method_list l, int i) {
|
void get_Method(struct Method *s, Method_list l, int i) {
|
||||||
Method_ptr p;
|
Method_ptr p;
|
||||||
|
|
@ -299,49 +372,14 @@ void set_Method(const struct Method *s, Method_list l, int i) {
|
||||||
write_Method(s, p);
|
write_Method(s, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
Method_Param_ptr new_Method_Param(struct capn_segment *s) {
|
|
||||||
Method_Param_ptr p;
|
|
||||||
p.p = capn_new_struct(s, 0, 4);
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
Method_Param_list new_Method_Param_list(struct capn_segment *s, int len) {
|
|
||||||
Method_Param_list p;
|
|
||||||
p.p = capn_new_list(s, len, 0, 4);
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
void read_Method_Param(struct Method_Param *s, Method_Param_ptr p) {
|
|
||||||
capn_resolve(&p.p);
|
|
||||||
s->name = capn_get_text(p.p, 0, capn_val0);
|
|
||||||
s->type.p = capn_getp(p.p, 1, 0);
|
|
||||||
s->defaultValue.p = capn_getp(p.p, 2, 0);
|
|
||||||
s->annotations.p = capn_getp(p.p, 3, 0);
|
|
||||||
}
|
|
||||||
void write_Method_Param(const struct Method_Param *s, Method_Param_ptr p) {
|
|
||||||
capn_resolve(&p.p);
|
|
||||||
capn_set_text(p.p, 0, s->name);
|
|
||||||
capn_setp(p.p, 1, s->type.p);
|
|
||||||
capn_setp(p.p, 2, s->defaultValue.p);
|
|
||||||
capn_setp(p.p, 3, s->annotations.p);
|
|
||||||
}
|
|
||||||
void get_Method_Param(struct Method_Param *s, Method_Param_list l, int i) {
|
|
||||||
Method_Param_ptr p;
|
|
||||||
p.p = capn_getp(l.p, i, 0);
|
|
||||||
read_Method_Param(s, p);
|
|
||||||
}
|
|
||||||
void set_Method_Param(const struct Method_Param *s, Method_Param_list l, int i) {
|
|
||||||
Method_Param_ptr p;
|
|
||||||
p.p = capn_getp(l.p, i, 0);
|
|
||||||
write_Method_Param(s, p);
|
|
||||||
}
|
|
||||||
|
|
||||||
Type_ptr new_Type(struct capn_segment *s) {
|
Type_ptr new_Type(struct capn_segment *s) {
|
||||||
Type_ptr p;
|
Type_ptr p;
|
||||||
p.p = capn_new_struct(s, 16, 1);
|
p.p = capn_new_struct(s, 24, 1);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
Type_list new_Type_list(struct capn_segment *s, int len) {
|
Type_list new_Type_list(struct capn_segment *s, int len) {
|
||||||
Type_list p;
|
Type_list p;
|
||||||
p.p = capn_new_list(s, len, 16, 1);
|
p.p = capn_new_list(s, len, 24, 1);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
void read_Type(struct Type *s, Type_ptr p) {
|
void read_Type(struct Type *s, Type_ptr p) {
|
||||||
|
|
@ -353,12 +391,29 @@ void read_Type(struct Type *s, Type_ptr p) {
|
||||||
break;
|
break;
|
||||||
case Type__enum:
|
case Type__enum:
|
||||||
s->_enum.typeId = capn_read64(p.p, 8);
|
s->_enum.typeId = capn_read64(p.p, 8);
|
||||||
|
s->_enum.brand.p = capn_getp(p.p, 0, 0);
|
||||||
break;
|
break;
|
||||||
case Type__struct:
|
case Type__struct:
|
||||||
s->_struct.typeId = capn_read64(p.p, 8);
|
s->_struct.typeId = capn_read64(p.p, 8);
|
||||||
|
s->_struct.brand.p = capn_getp(p.p, 0, 0);
|
||||||
break;
|
break;
|
||||||
case Type__interface:
|
case Type__interface:
|
||||||
s->_interface.typeId = capn_read64(p.p, 8);
|
s->_interface.typeId = capn_read64(p.p, 8);
|
||||||
|
s->_interface.brand.p = capn_getp(p.p, 0, 0);
|
||||||
|
break;
|
||||||
|
case Type_anyPointer:
|
||||||
|
s->anyPointer_which = (enum Type_anyPointer_which) capn_read16(p.p, 8);
|
||||||
|
switch (s->anyPointer_which) {
|
||||||
|
case Type_anyPointer_parameter:
|
||||||
|
s->anyPointer.parameter.scopeId = capn_read64(p.p, 16);
|
||||||
|
s->anyPointer.parameter.parameterIndex = capn_read16(p.p, 10);
|
||||||
|
break;
|
||||||
|
case Type_anyPointer_implicitMethodParameter:
|
||||||
|
s->anyPointer.implicitMethodParameter.parameterIndex = capn_read16(p.p, 10);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -373,12 +428,29 @@ void write_Type(const struct Type *s, Type_ptr p) {
|
||||||
break;
|
break;
|
||||||
case Type__enum:
|
case Type__enum:
|
||||||
capn_write64(p.p, 8, s->_enum.typeId);
|
capn_write64(p.p, 8, s->_enum.typeId);
|
||||||
|
capn_setp(p.p, 0, s->_enum.brand.p);
|
||||||
break;
|
break;
|
||||||
case Type__struct:
|
case Type__struct:
|
||||||
capn_write64(p.p, 8, s->_struct.typeId);
|
capn_write64(p.p, 8, s->_struct.typeId);
|
||||||
|
capn_setp(p.p, 0, s->_struct.brand.p);
|
||||||
break;
|
break;
|
||||||
case Type__interface:
|
case Type__interface:
|
||||||
capn_write64(p.p, 8, s->_interface.typeId);
|
capn_write64(p.p, 8, s->_interface.typeId);
|
||||||
|
capn_setp(p.p, 0, s->_interface.brand.p);
|
||||||
|
break;
|
||||||
|
case Type_anyPointer:
|
||||||
|
capn_write16(p.p, 8, s->anyPointer_which);
|
||||||
|
switch (s->anyPointer_which) {
|
||||||
|
case Type_anyPointer_parameter:
|
||||||
|
capn_write64(p.p, 16, s->anyPointer.parameter.scopeId);
|
||||||
|
capn_write16(p.p, 10, s->anyPointer.parameter.parameterIndex);
|
||||||
|
break;
|
||||||
|
case Type_anyPointer_implicitMethodParameter:
|
||||||
|
capn_write16(p.p, 10, s->anyPointer.implicitMethodParameter.parameterIndex);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -395,6 +467,123 @@ void set_Type(const struct Type *s, Type_list l, int i) {
|
||||||
write_Type(s, p);
|
write_Type(s, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Brand_ptr new_Brand(struct capn_segment *s) {
|
||||||
|
Brand_ptr p;
|
||||||
|
p.p = capn_new_struct(s, 0, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
Brand_list new_Brand_list(struct capn_segment *s, int len) {
|
||||||
|
Brand_list p;
|
||||||
|
p.p = capn_new_list(s, len, 0, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
void read_Brand(struct Brand *s, Brand_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
s->scopes.p = capn_getp(p.p, 0, 0);
|
||||||
|
}
|
||||||
|
void write_Brand(const struct Brand *s, Brand_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
capn_setp(p.p, 0, s->scopes.p);
|
||||||
|
}
|
||||||
|
void get_Brand(struct Brand *s, Brand_list l, int i) {
|
||||||
|
Brand_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
read_Brand(s, p);
|
||||||
|
}
|
||||||
|
void set_Brand(const struct Brand *s, Brand_list l, int i) {
|
||||||
|
Brand_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
write_Brand(s, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
Brand_Scope_ptr new_Brand_Scope(struct capn_segment *s) {
|
||||||
|
Brand_Scope_ptr p;
|
||||||
|
p.p = capn_new_struct(s, 16, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
Brand_Scope_list new_Brand_Scope_list(struct capn_segment *s, int len) {
|
||||||
|
Brand_Scope_list p;
|
||||||
|
p.p = capn_new_list(s, len, 16, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
void read_Brand_Scope(struct Brand_Scope *s, Brand_Scope_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
s->scopeId = capn_read64(p.p, 0);
|
||||||
|
s->which = (enum Brand_Scope_which) capn_read16(p.p, 8);
|
||||||
|
switch (s->which) {
|
||||||
|
case Brand_Scope_bind:
|
||||||
|
s->bind.p = capn_getp(p.p, 0, 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void write_Brand_Scope(const struct Brand_Scope *s, Brand_Scope_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
capn_write64(p.p, 0, s->scopeId);
|
||||||
|
capn_write16(p.p, 8, s->which);
|
||||||
|
switch (s->which) {
|
||||||
|
case Brand_Scope_bind:
|
||||||
|
capn_setp(p.p, 0, s->bind.p);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void get_Brand_Scope(struct Brand_Scope *s, Brand_Scope_list l, int i) {
|
||||||
|
Brand_Scope_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
read_Brand_Scope(s, p);
|
||||||
|
}
|
||||||
|
void set_Brand_Scope(const struct Brand_Scope *s, Brand_Scope_list l, int i) {
|
||||||
|
Brand_Scope_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
write_Brand_Scope(s, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
Brand_Binding_ptr new_Brand_Binding(struct capn_segment *s) {
|
||||||
|
Brand_Binding_ptr p;
|
||||||
|
p.p = capn_new_struct(s, 8, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
Brand_Binding_list new_Brand_Binding_list(struct capn_segment *s, int len) {
|
||||||
|
Brand_Binding_list p;
|
||||||
|
p.p = capn_new_list(s, len, 8, 1);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
void read_Brand_Binding(struct Brand_Binding *s, Brand_Binding_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
s->which = (enum Brand_Binding_which) capn_read16(p.p, 0);
|
||||||
|
switch (s->which) {
|
||||||
|
case Brand_Binding_type:
|
||||||
|
s->type.p = capn_getp(p.p, 0, 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void write_Brand_Binding(const struct Brand_Binding *s, Brand_Binding_ptr p) {
|
||||||
|
capn_resolve(&p.p);
|
||||||
|
capn_write16(p.p, 0, s->which);
|
||||||
|
switch (s->which) {
|
||||||
|
case Brand_Binding_type:
|
||||||
|
capn_setp(p.p, 0, s->type.p);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void get_Brand_Binding(struct Brand_Binding *s, Brand_Binding_list l, int i) {
|
||||||
|
Brand_Binding_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
read_Brand_Binding(s, p);
|
||||||
|
}
|
||||||
|
void set_Brand_Binding(const struct Brand_Binding *s, Brand_Binding_list l, int i) {
|
||||||
|
Brand_Binding_ptr p;
|
||||||
|
p.p = capn_getp(l.p, i, 0);
|
||||||
|
write_Brand_Binding(s, p);
|
||||||
|
}
|
||||||
|
|
||||||
Value_ptr new_Value(struct capn_segment *s) {
|
Value_ptr new_Value(struct capn_segment *s) {
|
||||||
Value_ptr p;
|
Value_ptr p;
|
||||||
p.p = capn_new_struct(s, 16, 1);
|
p.p = capn_new_struct(s, 16, 1);
|
||||||
|
|
@ -439,8 +628,8 @@ void read_Value(struct Value *s, Value_ptr p) {
|
||||||
break;
|
break;
|
||||||
case Value__list:
|
case Value__list:
|
||||||
case Value__struct:
|
case Value__struct:
|
||||||
case Value_object:
|
case Value_anyPointer:
|
||||||
s->object = capn_getp(p.p, 0, 0);
|
s->anyPointer = capn_getp(p.p, 0, 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -480,8 +669,8 @@ void write_Value(const struct Value *s, Value_ptr p) {
|
||||||
break;
|
break;
|
||||||
case Value__list:
|
case Value__list:
|
||||||
case Value__struct:
|
case Value__struct:
|
||||||
case Value_object:
|
case Value_anyPointer:
|
||||||
capn_setp(p.p, 0, s->object);
|
capn_setp(p.p, 0, s->anyPointer);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -500,22 +689,24 @@ void set_Value(const struct Value *s, Value_list l, int i) {
|
||||||
|
|
||||||
Annotation_ptr new_Annotation(struct capn_segment *s) {
|
Annotation_ptr new_Annotation(struct capn_segment *s) {
|
||||||
Annotation_ptr p;
|
Annotation_ptr p;
|
||||||
p.p = capn_new_struct(s, 8, 1);
|
p.p = capn_new_struct(s, 8, 2);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
Annotation_list new_Annotation_list(struct capn_segment *s, int len) {
|
Annotation_list new_Annotation_list(struct capn_segment *s, int len) {
|
||||||
Annotation_list p;
|
Annotation_list p;
|
||||||
p.p = capn_new_list(s, len, 8, 1);
|
p.p = capn_new_list(s, len, 8, 2);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
void read_Annotation(struct Annotation *s, Annotation_ptr p) {
|
void read_Annotation(struct Annotation *s, Annotation_ptr p) {
|
||||||
capn_resolve(&p.p);
|
capn_resolve(&p.p);
|
||||||
s->id = capn_read64(p.p, 0);
|
s->id = capn_read64(p.p, 0);
|
||||||
|
s->brand.p = capn_getp(p.p, 1, 0);
|
||||||
s->value.p = capn_getp(p.p, 0, 0);
|
s->value.p = capn_getp(p.p, 0, 0);
|
||||||
}
|
}
|
||||||
void write_Annotation(const struct Annotation *s, Annotation_ptr p) {
|
void write_Annotation(const struct Annotation *s, Annotation_ptr p) {
|
||||||
capn_resolve(&p.p);
|
capn_resolve(&p.p);
|
||||||
capn_write64(p.p, 0, s->id);
|
capn_write64(p.p, 0, s->id);
|
||||||
|
capn_setp(p.p, 1, s->brand.p);
|
||||||
capn_setp(p.p, 0, s->value.p);
|
capn_setp(p.p, 0, s->value.p);
|
||||||
}
|
}
|
||||||
void get_Annotation(struct Annotation *s, Annotation_list l, int i) {
|
void get_Annotation(struct Annotation *s, Annotation_list l, int i) {
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,16 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct Node;
|
struct Node;
|
||||||
|
struct Node_Parameter;
|
||||||
struct Node_NestedNode;
|
struct Node_NestedNode;
|
||||||
struct Field;
|
struct Field;
|
||||||
struct Enumerant;
|
struct Enumerant;
|
||||||
|
struct Superclass;
|
||||||
struct Method;
|
struct Method;
|
||||||
struct Method_Param;
|
|
||||||
struct Type;
|
struct Type;
|
||||||
|
struct Brand;
|
||||||
|
struct Brand_Scope;
|
||||||
|
struct Brand_Binding;
|
||||||
struct Value;
|
struct Value;
|
||||||
struct Annotation;
|
struct Annotation;
|
||||||
struct CodeGeneratorRequest;
|
struct CodeGeneratorRequest;
|
||||||
|
|
@ -27,12 +31,16 @@ struct CodeGeneratorRequest_RequestedFile;
|
||||||
struct CodeGeneratorRequest_RequestedFile_Import;
|
struct CodeGeneratorRequest_RequestedFile_Import;
|
||||||
|
|
||||||
typedef struct {capn_ptr p;} Node_ptr;
|
typedef struct {capn_ptr p;} Node_ptr;
|
||||||
|
typedef struct {capn_ptr p;} Node_Parameter_ptr;
|
||||||
typedef struct {capn_ptr p;} Node_NestedNode_ptr;
|
typedef struct {capn_ptr p;} Node_NestedNode_ptr;
|
||||||
typedef struct {capn_ptr p;} Field_ptr;
|
typedef struct {capn_ptr p;} Field_ptr;
|
||||||
typedef struct {capn_ptr p;} Enumerant_ptr;
|
typedef struct {capn_ptr p;} Enumerant_ptr;
|
||||||
|
typedef struct {capn_ptr p;} Superclass_ptr;
|
||||||
typedef struct {capn_ptr p;} Method_ptr;
|
typedef struct {capn_ptr p;} Method_ptr;
|
||||||
typedef struct {capn_ptr p;} Method_Param_ptr;
|
|
||||||
typedef struct {capn_ptr p;} Type_ptr;
|
typedef struct {capn_ptr p;} Type_ptr;
|
||||||
|
typedef struct {capn_ptr p;} Brand_ptr;
|
||||||
|
typedef struct {capn_ptr p;} Brand_Scope_ptr;
|
||||||
|
typedef struct {capn_ptr p;} Brand_Binding_ptr;
|
||||||
typedef struct {capn_ptr p;} Value_ptr;
|
typedef struct {capn_ptr p;} Value_ptr;
|
||||||
typedef struct {capn_ptr p;} Annotation_ptr;
|
typedef struct {capn_ptr p;} Annotation_ptr;
|
||||||
typedef struct {capn_ptr p;} CodeGeneratorRequest_ptr;
|
typedef struct {capn_ptr p;} CodeGeneratorRequest_ptr;
|
||||||
|
|
@ -40,12 +48,16 @@ typedef struct {capn_ptr p;} CodeGeneratorRequest_RequestedFile_ptr;
|
||||||
typedef struct {capn_ptr p;} CodeGeneratorRequest_RequestedFile_Import_ptr;
|
typedef struct {capn_ptr p;} CodeGeneratorRequest_RequestedFile_Import_ptr;
|
||||||
|
|
||||||
typedef struct {capn_ptr p;} Node_list;
|
typedef struct {capn_ptr p;} Node_list;
|
||||||
|
typedef struct {capn_ptr p;} Node_Parameter_list;
|
||||||
typedef struct {capn_ptr p;} Node_NestedNode_list;
|
typedef struct {capn_ptr p;} Node_NestedNode_list;
|
||||||
typedef struct {capn_ptr p;} Field_list;
|
typedef struct {capn_ptr p;} Field_list;
|
||||||
typedef struct {capn_ptr p;} Enumerant_list;
|
typedef struct {capn_ptr p;} Enumerant_list;
|
||||||
|
typedef struct {capn_ptr p;} Superclass_list;
|
||||||
typedef struct {capn_ptr p;} Method_list;
|
typedef struct {capn_ptr p;} Method_list;
|
||||||
typedef struct {capn_ptr p;} Method_Param_list;
|
|
||||||
typedef struct {capn_ptr p;} Type_list;
|
typedef struct {capn_ptr p;} Type_list;
|
||||||
|
typedef struct {capn_ptr p;} Brand_list;
|
||||||
|
typedef struct {capn_ptr p;} Brand_Scope_list;
|
||||||
|
typedef struct {capn_ptr p;} Brand_Binding_list;
|
||||||
typedef struct {capn_ptr p;} Value_list;
|
typedef struct {capn_ptr p;} Value_list;
|
||||||
typedef struct {capn_ptr p;} Annotation_list;
|
typedef struct {capn_ptr p;} Annotation_list;
|
||||||
typedef struct {capn_ptr p;} CodeGeneratorRequest_list;
|
typedef struct {capn_ptr p;} CodeGeneratorRequest_list;
|
||||||
|
|
@ -62,6 +74,7 @@ enum ElementSize {
|
||||||
ElementSize_pointer = 6,
|
ElementSize_pointer = 6,
|
||||||
ElementSize_inlineComposite = 7
|
ElementSize_inlineComposite = 7
|
||||||
};
|
};
|
||||||
|
extern uint16_t Field_noDiscriminant;
|
||||||
enum Node_which {
|
enum Node_which {
|
||||||
Node_file = 0,
|
Node_file = 0,
|
||||||
Node__struct = 1,
|
Node__struct = 1,
|
||||||
|
|
@ -76,6 +89,8 @@ struct Node {
|
||||||
capn_text displayName;
|
capn_text displayName;
|
||||||
uint32_t displayNamePrefixLength;
|
uint32_t displayNamePrefixLength;
|
||||||
uint64_t scopeId;
|
uint64_t scopeId;
|
||||||
|
Node_Parameter_list parameters;
|
||||||
|
unsigned isGeneric : 1;
|
||||||
Node_NestedNode_list nestedNodes;
|
Node_NestedNode_list nestedNodes;
|
||||||
Annotation_list annotations;
|
Annotation_list annotations;
|
||||||
enum Node_which which;
|
enum Node_which which;
|
||||||
|
|
@ -94,6 +109,7 @@ struct Node {
|
||||||
} _enum;
|
} _enum;
|
||||||
struct {
|
struct {
|
||||||
Method_list methods;
|
Method_list methods;
|
||||||
|
Superclass_list superclasses;
|
||||||
} _interface;
|
} _interface;
|
||||||
struct {
|
struct {
|
||||||
Type_ptr type;
|
Type_ptr type;
|
||||||
|
|
@ -117,6 +133,10 @@ struct Node {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Node_Parameter {
|
||||||
|
capn_text name;
|
||||||
|
};
|
||||||
|
|
||||||
struct Node_NestedNode {
|
struct Node_NestedNode {
|
||||||
capn_text name;
|
capn_text name;
|
||||||
uint64_t id;
|
uint64_t id;
|
||||||
|
|
@ -141,6 +161,7 @@ struct Field {
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
Type_ptr type;
|
Type_ptr type;
|
||||||
Value_ptr defaultValue;
|
Value_ptr defaultValue;
|
||||||
|
unsigned hadExplicitDefault : 1;
|
||||||
} slot;
|
} slot;
|
||||||
struct {
|
struct {
|
||||||
uint64_t typeId;
|
uint64_t typeId;
|
||||||
|
|
@ -158,20 +179,25 @@ struct Enumerant {
|
||||||
Annotation_list annotations;
|
Annotation_list annotations;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Superclass {
|
||||||
|
uint64_t id;
|
||||||
|
Brand_ptr brand;
|
||||||
|
};
|
||||||
|
|
||||||
struct Method {
|
struct Method {
|
||||||
capn_text name;
|
capn_text name;
|
||||||
uint16_t codeOrder;
|
uint16_t codeOrder;
|
||||||
Method_Param_list params;
|
Node_Parameter_list implicitParameters;
|
||||||
uint16_t requiredParamCount;
|
uint64_t paramStructType;
|
||||||
Type_ptr returnType;
|
Brand_ptr paramBrand;
|
||||||
|
uint64_t resultStructType;
|
||||||
|
Brand_ptr resultBrand;
|
||||||
Annotation_list annotations;
|
Annotation_list annotations;
|
||||||
};
|
};
|
||||||
|
enum Type_anyPointer_which {
|
||||||
struct Method_Param {
|
Type_anyPointer_unconstrained = 0,
|
||||||
capn_text name;
|
Type_anyPointer_parameter = 1,
|
||||||
Type_ptr type;
|
Type_anyPointer_implicitMethodParameter = 2
|
||||||
Value_ptr defaultValue;
|
|
||||||
Annotation_list annotations;
|
|
||||||
};
|
};
|
||||||
enum Type_which {
|
enum Type_which {
|
||||||
Type__void = 0,
|
Type__void = 0,
|
||||||
|
|
@ -192,7 +218,7 @@ enum Type_which {
|
||||||
Type__enum = 15,
|
Type__enum = 15,
|
||||||
Type__struct = 16,
|
Type__struct = 16,
|
||||||
Type__interface = 17,
|
Type__interface = 17,
|
||||||
Type_object = 18
|
Type_anyPointer = 18
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Type {
|
struct Type {
|
||||||
|
|
@ -203,13 +229,53 @@ struct Type {
|
||||||
} _list;
|
} _list;
|
||||||
struct {
|
struct {
|
||||||
uint64_t typeId;
|
uint64_t typeId;
|
||||||
|
Brand_ptr brand;
|
||||||
} _enum;
|
} _enum;
|
||||||
struct {
|
struct {
|
||||||
uint64_t typeId;
|
uint64_t typeId;
|
||||||
|
Brand_ptr brand;
|
||||||
} _struct;
|
} _struct;
|
||||||
struct {
|
struct {
|
||||||
uint64_t typeId;
|
uint64_t typeId;
|
||||||
|
Brand_ptr brand;
|
||||||
} _interface;
|
} _interface;
|
||||||
|
enum Type_anyPointer_which anyPointer_which;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
uint64_t scopeId;
|
||||||
|
uint16_t parameterIndex;
|
||||||
|
} parameter;
|
||||||
|
struct {
|
||||||
|
uint16_t parameterIndex;
|
||||||
|
} implicitMethodParameter;
|
||||||
|
} anyPointer;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Brand {
|
||||||
|
Brand_Scope_list scopes;
|
||||||
|
};
|
||||||
|
enum Brand_Scope_which {
|
||||||
|
Brand_Scope_bind = 0,
|
||||||
|
Brand_Scope_inherit = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Brand_Scope {
|
||||||
|
uint64_t scopeId;
|
||||||
|
enum Brand_Scope_which which;
|
||||||
|
union {
|
||||||
|
Brand_Binding_list bind;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
enum Brand_Binding_which {
|
||||||
|
Brand_Binding_unbound = 0,
|
||||||
|
Brand_Binding_type = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Brand_Binding {
|
||||||
|
enum Brand_Binding_which which;
|
||||||
|
union {
|
||||||
|
Type_ptr type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
enum Value_which {
|
enum Value_which {
|
||||||
|
|
@ -231,7 +297,7 @@ enum Value_which {
|
||||||
Value__enum = 15,
|
Value__enum = 15,
|
||||||
Value__struct = 16,
|
Value__struct = 16,
|
||||||
Value__interface = 17,
|
Value__interface = 17,
|
||||||
Value_object = 18
|
Value_anyPointer = 18
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Value {
|
struct Value {
|
||||||
|
|
@ -253,12 +319,13 @@ struct Value {
|
||||||
capn_ptr _list;
|
capn_ptr _list;
|
||||||
uint16_t _enum;
|
uint16_t _enum;
|
||||||
capn_ptr _struct;
|
capn_ptr _struct;
|
||||||
capn_ptr object;
|
capn_ptr anyPointer;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Annotation {
|
struct Annotation {
|
||||||
uint64_t id;
|
uint64_t id;
|
||||||
|
Brand_ptr brand;
|
||||||
Value_ptr value;
|
Value_ptr value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -279,12 +346,16 @@ struct CodeGeneratorRequest_RequestedFile_Import {
|
||||||
};
|
};
|
||||||
|
|
||||||
Node_ptr new_Node(struct capn_segment*);
|
Node_ptr new_Node(struct capn_segment*);
|
||||||
|
Node_Parameter_ptr new_Node_Parameter(struct capn_segment*);
|
||||||
Node_NestedNode_ptr new_Node_NestedNode(struct capn_segment*);
|
Node_NestedNode_ptr new_Node_NestedNode(struct capn_segment*);
|
||||||
Field_ptr new_Field(struct capn_segment*);
|
Field_ptr new_Field(struct capn_segment*);
|
||||||
Enumerant_ptr new_Enumerant(struct capn_segment*);
|
Enumerant_ptr new_Enumerant(struct capn_segment*);
|
||||||
|
Superclass_ptr new_Superclass(struct capn_segment*);
|
||||||
Method_ptr new_Method(struct capn_segment*);
|
Method_ptr new_Method(struct capn_segment*);
|
||||||
Method_Param_ptr new_Method_Param(struct capn_segment*);
|
|
||||||
Type_ptr new_Type(struct capn_segment*);
|
Type_ptr new_Type(struct capn_segment*);
|
||||||
|
Brand_ptr new_Brand(struct capn_segment*);
|
||||||
|
Brand_Scope_ptr new_Brand_Scope(struct capn_segment*);
|
||||||
|
Brand_Binding_ptr new_Brand_Binding(struct capn_segment*);
|
||||||
Value_ptr new_Value(struct capn_segment*);
|
Value_ptr new_Value(struct capn_segment*);
|
||||||
Annotation_ptr new_Annotation(struct capn_segment*);
|
Annotation_ptr new_Annotation(struct capn_segment*);
|
||||||
CodeGeneratorRequest_ptr new_CodeGeneratorRequest(struct capn_segment*);
|
CodeGeneratorRequest_ptr new_CodeGeneratorRequest(struct capn_segment*);
|
||||||
|
|
@ -292,12 +363,16 @@ CodeGeneratorRequest_RequestedFile_ptr new_CodeGeneratorRequest_RequestedFile(st
|
||||||
CodeGeneratorRequest_RequestedFile_Import_ptr new_CodeGeneratorRequest_RequestedFile_Import(struct capn_segment*);
|
CodeGeneratorRequest_RequestedFile_Import_ptr new_CodeGeneratorRequest_RequestedFile_Import(struct capn_segment*);
|
||||||
|
|
||||||
Node_list new_Node_list(struct capn_segment*, int len);
|
Node_list new_Node_list(struct capn_segment*, int len);
|
||||||
|
Node_Parameter_list new_Node_Parameter_list(struct capn_segment*, int len);
|
||||||
Node_NestedNode_list new_Node_NestedNode_list(struct capn_segment*, int len);
|
Node_NestedNode_list new_Node_NestedNode_list(struct capn_segment*, int len);
|
||||||
Field_list new_Field_list(struct capn_segment*, int len);
|
Field_list new_Field_list(struct capn_segment*, int len);
|
||||||
Enumerant_list new_Enumerant_list(struct capn_segment*, int len);
|
Enumerant_list new_Enumerant_list(struct capn_segment*, int len);
|
||||||
|
Superclass_list new_Superclass_list(struct capn_segment*, int len);
|
||||||
Method_list new_Method_list(struct capn_segment*, int len);
|
Method_list new_Method_list(struct capn_segment*, int len);
|
||||||
Method_Param_list new_Method_Param_list(struct capn_segment*, int len);
|
|
||||||
Type_list new_Type_list(struct capn_segment*, int len);
|
Type_list new_Type_list(struct capn_segment*, int len);
|
||||||
|
Brand_list new_Brand_list(struct capn_segment*, int len);
|
||||||
|
Brand_Scope_list new_Brand_Scope_list(struct capn_segment*, int len);
|
||||||
|
Brand_Binding_list new_Brand_Binding_list(struct capn_segment*, int len);
|
||||||
Value_list new_Value_list(struct capn_segment*, int len);
|
Value_list new_Value_list(struct capn_segment*, int len);
|
||||||
Annotation_list new_Annotation_list(struct capn_segment*, int len);
|
Annotation_list new_Annotation_list(struct capn_segment*, int len);
|
||||||
CodeGeneratorRequest_list new_CodeGeneratorRequest_list(struct capn_segment*, int len);
|
CodeGeneratorRequest_list new_CodeGeneratorRequest_list(struct capn_segment*, int len);
|
||||||
|
|
@ -305,12 +380,16 @@ CodeGeneratorRequest_RequestedFile_list new_CodeGeneratorRequest_RequestedFile_l
|
||||||
CodeGeneratorRequest_RequestedFile_Import_list new_CodeGeneratorRequest_RequestedFile_Import_list(struct capn_segment*, int len);
|
CodeGeneratorRequest_RequestedFile_Import_list new_CodeGeneratorRequest_RequestedFile_Import_list(struct capn_segment*, int len);
|
||||||
|
|
||||||
void read_Node(struct Node*, Node_ptr);
|
void read_Node(struct Node*, Node_ptr);
|
||||||
|
void read_Node_Parameter(struct Node_Parameter*, Node_Parameter_ptr);
|
||||||
void read_Node_NestedNode(struct Node_NestedNode*, Node_NestedNode_ptr);
|
void read_Node_NestedNode(struct Node_NestedNode*, Node_NestedNode_ptr);
|
||||||
void read_Field(struct Field*, Field_ptr);
|
void read_Field(struct Field*, Field_ptr);
|
||||||
void read_Enumerant(struct Enumerant*, Enumerant_ptr);
|
void read_Enumerant(struct Enumerant*, Enumerant_ptr);
|
||||||
|
void read_Superclass(struct Superclass*, Superclass_ptr);
|
||||||
void read_Method(struct Method*, Method_ptr);
|
void read_Method(struct Method*, Method_ptr);
|
||||||
void read_Method_Param(struct Method_Param*, Method_Param_ptr);
|
|
||||||
void read_Type(struct Type*, Type_ptr);
|
void read_Type(struct Type*, Type_ptr);
|
||||||
|
void read_Brand(struct Brand*, Brand_ptr);
|
||||||
|
void read_Brand_Scope(struct Brand_Scope*, Brand_Scope_ptr);
|
||||||
|
void read_Brand_Binding(struct Brand_Binding*, Brand_Binding_ptr);
|
||||||
void read_Value(struct Value*, Value_ptr);
|
void read_Value(struct Value*, Value_ptr);
|
||||||
void read_Annotation(struct Annotation*, Annotation_ptr);
|
void read_Annotation(struct Annotation*, Annotation_ptr);
|
||||||
void read_CodeGeneratorRequest(struct CodeGeneratorRequest*, CodeGeneratorRequest_ptr);
|
void read_CodeGeneratorRequest(struct CodeGeneratorRequest*, CodeGeneratorRequest_ptr);
|
||||||
|
|
@ -318,12 +397,16 @@ void read_CodeGeneratorRequest_RequestedFile(struct CodeGeneratorRequest_Request
|
||||||
void read_CodeGeneratorRequest_RequestedFile_Import(struct CodeGeneratorRequest_RequestedFile_Import*, CodeGeneratorRequest_RequestedFile_Import_ptr);
|
void read_CodeGeneratorRequest_RequestedFile_Import(struct CodeGeneratorRequest_RequestedFile_Import*, CodeGeneratorRequest_RequestedFile_Import_ptr);
|
||||||
|
|
||||||
void write_Node(const struct Node*, Node_ptr);
|
void write_Node(const struct Node*, Node_ptr);
|
||||||
|
void write_Node_Parameter(const struct Node_Parameter*, Node_Parameter_ptr);
|
||||||
void write_Node_NestedNode(const struct Node_NestedNode*, Node_NestedNode_ptr);
|
void write_Node_NestedNode(const struct Node_NestedNode*, Node_NestedNode_ptr);
|
||||||
void write_Field(const struct Field*, Field_ptr);
|
void write_Field(const struct Field*, Field_ptr);
|
||||||
void write_Enumerant(const struct Enumerant*, Enumerant_ptr);
|
void write_Enumerant(const struct Enumerant*, Enumerant_ptr);
|
||||||
|
void write_Superclass(const struct Superclass*, Superclass_ptr);
|
||||||
void write_Method(const struct Method*, Method_ptr);
|
void write_Method(const struct Method*, Method_ptr);
|
||||||
void write_Method_Param(const struct Method_Param*, Method_Param_ptr);
|
|
||||||
void write_Type(const struct Type*, Type_ptr);
|
void write_Type(const struct Type*, Type_ptr);
|
||||||
|
void write_Brand(const struct Brand*, Brand_ptr);
|
||||||
|
void write_Brand_Scope(const struct Brand_Scope*, Brand_Scope_ptr);
|
||||||
|
void write_Brand_Binding(const struct Brand_Binding*, Brand_Binding_ptr);
|
||||||
void write_Value(const struct Value*, Value_ptr);
|
void write_Value(const struct Value*, Value_ptr);
|
||||||
void write_Annotation(const struct Annotation*, Annotation_ptr);
|
void write_Annotation(const struct Annotation*, Annotation_ptr);
|
||||||
void write_CodeGeneratorRequest(const struct CodeGeneratorRequest*, CodeGeneratorRequest_ptr);
|
void write_CodeGeneratorRequest(const struct CodeGeneratorRequest*, CodeGeneratorRequest_ptr);
|
||||||
|
|
@ -331,12 +414,16 @@ void write_CodeGeneratorRequest_RequestedFile(const struct CodeGeneratorRequest_
|
||||||
void write_CodeGeneratorRequest_RequestedFile_Import(const struct CodeGeneratorRequest_RequestedFile_Import*, CodeGeneratorRequest_RequestedFile_Import_ptr);
|
void write_CodeGeneratorRequest_RequestedFile_Import(const struct CodeGeneratorRequest_RequestedFile_Import*, CodeGeneratorRequest_RequestedFile_Import_ptr);
|
||||||
|
|
||||||
void get_Node(struct Node*, Node_list, int i);
|
void get_Node(struct Node*, Node_list, int i);
|
||||||
|
void get_Node_Parameter(struct Node_Parameter*, Node_Parameter_list, int i);
|
||||||
void get_Node_NestedNode(struct Node_NestedNode*, Node_NestedNode_list, int i);
|
void get_Node_NestedNode(struct Node_NestedNode*, Node_NestedNode_list, int i);
|
||||||
void get_Field(struct Field*, Field_list, int i);
|
void get_Field(struct Field*, Field_list, int i);
|
||||||
void get_Enumerant(struct Enumerant*, Enumerant_list, int i);
|
void get_Enumerant(struct Enumerant*, Enumerant_list, int i);
|
||||||
|
void get_Superclass(struct Superclass*, Superclass_list, int i);
|
||||||
void get_Method(struct Method*, Method_list, int i);
|
void get_Method(struct Method*, Method_list, int i);
|
||||||
void get_Method_Param(struct Method_Param*, Method_Param_list, int i);
|
|
||||||
void get_Type(struct Type*, Type_list, int i);
|
void get_Type(struct Type*, Type_list, int i);
|
||||||
|
void get_Brand(struct Brand*, Brand_list, int i);
|
||||||
|
void get_Brand_Scope(struct Brand_Scope*, Brand_Scope_list, int i);
|
||||||
|
void get_Brand_Binding(struct Brand_Binding*, Brand_Binding_list, int i);
|
||||||
void get_Value(struct Value*, Value_list, int i);
|
void get_Value(struct Value*, Value_list, int i);
|
||||||
void get_Annotation(struct Annotation*, Annotation_list, int i);
|
void get_Annotation(struct Annotation*, Annotation_list, int i);
|
||||||
void get_CodeGeneratorRequest(struct CodeGeneratorRequest*, CodeGeneratorRequest_list, int i);
|
void get_CodeGeneratorRequest(struct CodeGeneratorRequest*, CodeGeneratorRequest_list, int i);
|
||||||
|
|
@ -344,12 +431,16 @@ void get_CodeGeneratorRequest_RequestedFile(struct CodeGeneratorRequest_Requeste
|
||||||
void get_CodeGeneratorRequest_RequestedFile_Import(struct CodeGeneratorRequest_RequestedFile_Import*, CodeGeneratorRequest_RequestedFile_Import_list, int i);
|
void get_CodeGeneratorRequest_RequestedFile_Import(struct CodeGeneratorRequest_RequestedFile_Import*, CodeGeneratorRequest_RequestedFile_Import_list, int i);
|
||||||
|
|
||||||
void set_Node(const struct Node*, Node_list, int i);
|
void set_Node(const struct Node*, Node_list, int i);
|
||||||
|
void set_Node_Parameter(const struct Node_Parameter*, Node_Parameter_list, int i);
|
||||||
void set_Node_NestedNode(const struct Node_NestedNode*, Node_NestedNode_list, int i);
|
void set_Node_NestedNode(const struct Node_NestedNode*, Node_NestedNode_list, int i);
|
||||||
void set_Field(const struct Field*, Field_list, int i);
|
void set_Field(const struct Field*, Field_list, int i);
|
||||||
void set_Enumerant(const struct Enumerant*, Enumerant_list, int i);
|
void set_Enumerant(const struct Enumerant*, Enumerant_list, int i);
|
||||||
|
void set_Superclass(const struct Superclass*, Superclass_list, int i);
|
||||||
void set_Method(const struct Method*, Method_list, int i);
|
void set_Method(const struct Method*, Method_list, int i);
|
||||||
void set_Method_Param(const struct Method_Param*, Method_Param_list, int i);
|
|
||||||
void set_Type(const struct Type*, Type_list, int i);
|
void set_Type(const struct Type*, Type_list, int i);
|
||||||
|
void set_Brand(const struct Brand*, Brand_list, int i);
|
||||||
|
void set_Brand_Scope(const struct Brand_Scope*, Brand_Scope_list, int i);
|
||||||
|
void set_Brand_Binding(const struct Brand_Binding*, Brand_Binding_list, int i);
|
||||||
void set_Value(const struct Value*, Value_list, int i);
|
void set_Value(const struct Value*, Value_list, int i);
|
||||||
void set_Annotation(const struct Annotation*, Annotation_list, int i);
|
void set_Annotation(const struct Annotation*, Annotation_list, int i);
|
||||||
void set_CodeGeneratorRequest(const struct CodeGeneratorRequest*, CodeGeneratorRequest_list, int i);
|
void set_CodeGeneratorRequest(const struct CodeGeneratorRequest*, CodeGeneratorRequest_list, int i);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue