diff --git a/compiler/schema.capnp.c b/compiler/schema.capnp.c index 6fd60c2..d362e52 100644 --- a/compiler/schema.capnp.c +++ b/compiler/schema.capnp.c @@ -79,7 +79,7 @@ void write_Node(const struct Node *s, Node_ptr p) { case Node__struct: capn_write16(p.p, 14, s->_struct.dataWordCount); capn_write16(p.p, 24, s->_struct.pointerCount); - capn_write16(p.p, 26, (uint16_t) s->_struct.preferredListEncoding); + capn_write16(p.p, 26, (uint16_t) (s->_struct.preferredListEncoding)); capn_write1(p.p, 224, s->_struct.isGroup != 0); capn_write16(p.p, 30, s->_struct.discriminantCount); capn_write32(p.p, 32, s->_struct.discriminantOffset); @@ -126,6 +126,102 @@ void set_Node(const struct Node *s, Node_list l, int i) { write_Node(s, p); } +uint64_t Node_get_id(Node_ptr p) +{ + uint64_t id; + id = capn_read64(p.p, 0); + return id; +} + +capn_text Node_get_displayName(Node_ptr p) +{ + capn_text displayName; + displayName = capn_get_text(p.p, 0, capn_val0); + return displayName; +} + +uint32_t Node_get_displayNamePrefixLength(Node_ptr p) +{ + uint32_t displayNamePrefixLength; + displayNamePrefixLength = capn_read32(p.p, 8); + return displayNamePrefixLength; +} + +uint64_t Node_get_scopeId(Node_ptr p) +{ + uint64_t scopeId; + scopeId = capn_read64(p.p, 16); + return scopeId; +} + +Node_Parameter_list Node_get_parameters(Node_ptr p) +{ + Node_Parameter_list parameters; + parameters.p = capn_getp(p.p, 5, 0); + return parameters; +} + +unsigned Node_get_isGeneric(Node_ptr p) +{ + unsigned isGeneric; + isGeneric = (capn_read8(p.p, 36) & 1) != 0; + return isGeneric; +} + +Node_NestedNode_list Node_get_nestedNodes(Node_ptr p) +{ + Node_NestedNode_list nestedNodes; + nestedNodes.p = capn_getp(p.p, 1, 0); + return nestedNodes; +} + +Annotation_list Node_get_annotations(Node_ptr p) +{ + Annotation_list annotations; + annotations.p = capn_getp(p.p, 2, 0); + return annotations; +} + +void Node_set_id(Node_ptr p, uint64_t id) +{ + capn_write64(p.p, 0, id); +} + +void Node_set_displayName(Node_ptr p, capn_text displayName) +{ + capn_set_text(p.p, 0, displayName); +} + +void Node_set_displayNamePrefixLength(Node_ptr p, uint32_t displayNamePrefixLength) +{ + capn_write32(p.p, 8, displayNamePrefixLength); +} + +void Node_set_scopeId(Node_ptr p, uint64_t scopeId) +{ + capn_write64(p.p, 16, scopeId); +} + +void Node_set_parameters(Node_ptr p, Node_Parameter_list parameters) +{ + capn_setp(p.p, 5, parameters.p); +} + +void Node_set_isGeneric(Node_ptr p, unsigned isGeneric) +{ + capn_write1(p.p, 288, isGeneric != 0); +} + +void Node_set_nestedNodes(Node_ptr p, Node_NestedNode_list nestedNodes) +{ + capn_setp(p.p, 1, nestedNodes.p); +} + +void Node_set_annotations(Node_ptr p, Annotation_list annotations) +{ + capn_setp(p.p, 2, annotations.p); +} + Node_Parameter_ptr new_Node_Parameter(struct capn_segment *s) { Node_Parameter_ptr p; p.p = capn_new_struct(s, 0, 1); @@ -155,6 +251,18 @@ void set_Node_Parameter(const struct Node_Parameter *s, Node_Parameter_list l, i write_Node_Parameter(s, p); } +capn_text Node_Parameter_get_name(Node_Parameter_ptr p) +{ + capn_text name; + name = capn_get_text(p.p, 0, capn_val0); + return name; +} + +void Node_Parameter_set_name(Node_Parameter_ptr p, capn_text name) +{ + capn_set_text(p.p, 0, name); +} + Node_NestedNode_ptr new_Node_NestedNode(struct capn_segment *s) { Node_NestedNode_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -186,6 +294,30 @@ void set_Node_NestedNode(const struct Node_NestedNode *s, Node_NestedNode_list l write_Node_NestedNode(s, p); } +capn_text Node_NestedNode_get_name(Node_NestedNode_ptr p) +{ + capn_text name; + name = capn_get_text(p.p, 0, capn_val0); + return name; +} + +uint64_t Node_NestedNode_get_id(Node_NestedNode_ptr p) +{ + uint64_t id; + id = capn_read64(p.p, 0); + return id; +} + +void Node_NestedNode_set_name(Node_NestedNode_ptr p, capn_text name) +{ + capn_set_text(p.p, 0, name); +} + +void Node_NestedNode_set_id(Node_NestedNode_ptr p, uint64_t id) +{ + capn_write64(p.p, 0, id); +} + Field_ptr new_Field(struct capn_segment *s) { Field_ptr p; p.p = capn_new_struct(s, 24, 4); @@ -265,6 +397,54 @@ void set_Field(const struct Field *s, Field_list l, int i) { write_Field(s, p); } +capn_text Field_get_name(Field_ptr p) +{ + capn_text name; + name = capn_get_text(p.p, 0, capn_val0); + return name; +} + +uint16_t Field_get_codeOrder(Field_ptr p) +{ + uint16_t codeOrder; + codeOrder = capn_read16(p.p, 0); + return codeOrder; +} + +Annotation_list Field_get_annotations(Field_ptr p) +{ + Annotation_list annotations; + annotations.p = capn_getp(p.p, 1, 0); + return annotations; +} + +uint16_t Field_get_discriminantValue(Field_ptr p) +{ + uint16_t discriminantValue; + discriminantValue = capn_read16(p.p, 2) ^ 65535u; + return discriminantValue; +} + +void Field_set_name(Field_ptr p, capn_text name) +{ + capn_set_text(p.p, 0, name); +} + +void Field_set_codeOrder(Field_ptr p, uint16_t codeOrder) +{ + capn_write16(p.p, 0, codeOrder); +} + +void Field_set_annotations(Field_ptr p, Annotation_list annotations) +{ + capn_setp(p.p, 1, annotations.p); +} + +void Field_set_discriminantValue(Field_ptr p, uint16_t discriminantValue) +{ + capn_write16(p.p, 2, discriminantValue ^ 65535u); +} + Enumerant_ptr new_Enumerant(struct capn_segment *s) { Enumerant_ptr p; p.p = capn_new_struct(s, 8, 2); @@ -298,6 +478,42 @@ void set_Enumerant(const struct Enumerant *s, Enumerant_list l, int i) { write_Enumerant(s, p); } +capn_text Enumerant_get_name(Enumerant_ptr p) +{ + capn_text name; + name = capn_get_text(p.p, 0, capn_val0); + return name; +} + +uint16_t Enumerant_get_codeOrder(Enumerant_ptr p) +{ + uint16_t codeOrder; + codeOrder = capn_read16(p.p, 0); + return codeOrder; +} + +Annotation_list Enumerant_get_annotations(Enumerant_ptr p) +{ + Annotation_list annotations; + annotations.p = capn_getp(p.p, 1, 0); + return annotations; +} + +void Enumerant_set_name(Enumerant_ptr p, capn_text name) +{ + capn_set_text(p.p, 0, name); +} + +void Enumerant_set_codeOrder(Enumerant_ptr p, uint16_t codeOrder) +{ + capn_write16(p.p, 0, codeOrder); +} + +void Enumerant_set_annotations(Enumerant_ptr p, Annotation_list annotations) +{ + capn_setp(p.p, 1, annotations.p); +} + Superclass_ptr new_Superclass(struct capn_segment *s) { Superclass_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -329,6 +545,30 @@ void set_Superclass(const struct Superclass *s, Superclass_list l, int i) { write_Superclass(s, p); } +uint64_t Superclass_get_id(Superclass_ptr p) +{ + uint64_t id; + id = capn_read64(p.p, 0); + return id; +} + +Brand_ptr Superclass_get_brand(Superclass_ptr p) +{ + Brand_ptr brand; + brand.p = capn_getp(p.p, 0, 0); + return brand; +} + +void Superclass_set_id(Superclass_ptr p, uint64_t id) +{ + capn_write64(p.p, 0, id); +} + +void Superclass_set_brand(Superclass_ptr p, Brand_ptr brand) +{ + capn_setp(p.p, 0, brand.p); +} + Method_ptr new_Method(struct capn_segment *s) { Method_ptr p; p.p = capn_new_struct(s, 24, 5); @@ -372,6 +612,102 @@ void set_Method(const struct Method *s, Method_list l, int i) { write_Method(s, p); } +capn_text Method_get_name(Method_ptr p) +{ + capn_text name; + name = capn_get_text(p.p, 0, capn_val0); + return name; +} + +uint16_t Method_get_codeOrder(Method_ptr p) +{ + uint16_t codeOrder; + codeOrder = capn_read16(p.p, 0); + return codeOrder; +} + +Node_Parameter_list Method_get_implicitParameters(Method_ptr p) +{ + Node_Parameter_list implicitParameters; + implicitParameters.p = capn_getp(p.p, 4, 0); + return implicitParameters; +} + +uint64_t Method_get_paramStructType(Method_ptr p) +{ + uint64_t paramStructType; + paramStructType = capn_read64(p.p, 8); + return paramStructType; +} + +Brand_ptr Method_get_paramBrand(Method_ptr p) +{ + Brand_ptr paramBrand; + paramBrand.p = capn_getp(p.p, 2, 0); + return paramBrand; +} + +uint64_t Method_get_resultStructType(Method_ptr p) +{ + uint64_t resultStructType; + resultStructType = capn_read64(p.p, 16); + return resultStructType; +} + +Brand_ptr Method_get_resultBrand(Method_ptr p) +{ + Brand_ptr resultBrand; + resultBrand.p = capn_getp(p.p, 3, 0); + return resultBrand; +} + +Annotation_list Method_get_annotations(Method_ptr p) +{ + Annotation_list annotations; + annotations.p = capn_getp(p.p, 1, 0); + return annotations; +} + +void Method_set_name(Method_ptr p, capn_text name) +{ + capn_set_text(p.p, 0, name); +} + +void Method_set_codeOrder(Method_ptr p, uint16_t codeOrder) +{ + capn_write16(p.p, 0, codeOrder); +} + +void Method_set_implicitParameters(Method_ptr p, Node_Parameter_list implicitParameters) +{ + capn_setp(p.p, 4, implicitParameters.p); +} + +void Method_set_paramStructType(Method_ptr p, uint64_t paramStructType) +{ + capn_write64(p.p, 8, paramStructType); +} + +void Method_set_paramBrand(Method_ptr p, Brand_ptr paramBrand) +{ + capn_setp(p.p, 2, paramBrand.p); +} + +void Method_set_resultStructType(Method_ptr p, uint64_t resultStructType) +{ + capn_write64(p.p, 16, resultStructType); +} + +void Method_set_resultBrand(Method_ptr p, Brand_ptr resultBrand) +{ + capn_setp(p.p, 3, resultBrand.p); +} + +void Method_set_annotations(Method_ptr p, Annotation_list annotations) +{ + capn_setp(p.p, 1, annotations.p); +} + Type_ptr new_Type(struct capn_segment *s) { Type_ptr p; p.p = capn_new_struct(s, 24, 1); @@ -496,6 +832,18 @@ void set_Brand(const struct Brand *s, Brand_list l, int i) { write_Brand(s, p); } +Brand_Scope_list Brand_get_scopes(Brand_ptr p) +{ + Brand_Scope_list scopes; + scopes.p = capn_getp(p.p, 0, 0); + return scopes; +} + +void Brand_set_scopes(Brand_ptr p, Brand_Scope_list scopes) +{ + capn_setp(p.p, 0, scopes.p); +} + Brand_Scope_ptr new_Brand_Scope(struct capn_segment *s) { Brand_Scope_ptr p; p.p = capn_new_struct(s, 16, 1); @@ -541,6 +889,18 @@ void set_Brand_Scope(const struct Brand_Scope *s, Brand_Scope_list l, int i) { write_Brand_Scope(s, p); } +uint64_t Brand_Scope_get_scopeId(Brand_Scope_ptr p) +{ + uint64_t scopeId; + scopeId = capn_read64(p.p, 0); + return scopeId; +} + +void Brand_Scope_set_scopeId(Brand_Scope_ptr p, uint64_t scopeId) +{ + capn_write64(p.p, 0, scopeId); +} + Brand_Binding_ptr new_Brand_Binding(struct capn_segment *s) { Brand_Binding_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -720,6 +1080,42 @@ void set_Annotation(const struct Annotation *s, Annotation_list l, int i) { write_Annotation(s, p); } +uint64_t Annotation_get_id(Annotation_ptr p) +{ + uint64_t id; + id = capn_read64(p.p, 0); + return id; +} + +Brand_ptr Annotation_get_brand(Annotation_ptr p) +{ + Brand_ptr brand; + brand.p = capn_getp(p.p, 1, 0); + return brand; +} + +Value_ptr Annotation_get_value(Annotation_ptr p) +{ + Value_ptr value; + value.p = capn_getp(p.p, 0, 0); + return value; +} + +void Annotation_set_id(Annotation_ptr p, uint64_t id) +{ + capn_write64(p.p, 0, id); +} + +void Annotation_set_brand(Annotation_ptr p, Brand_ptr brand) +{ + capn_setp(p.p, 1, brand.p); +} + +void Annotation_set_value(Annotation_ptr p, Value_ptr value) +{ + capn_setp(p.p, 0, value.p); +} + CodeGeneratorRequest_ptr new_CodeGeneratorRequest(struct capn_segment *s) { CodeGeneratorRequest_ptr p; p.p = capn_new_struct(s, 0, 2); @@ -751,6 +1147,30 @@ void set_CodeGeneratorRequest(const struct CodeGeneratorRequest *s, CodeGenerato write_CodeGeneratorRequest(s, p); } +Node_list CodeGeneratorRequest_get_nodes(CodeGeneratorRequest_ptr p) +{ + Node_list nodes; + nodes.p = capn_getp(p.p, 0, 0); + return nodes; +} + +CodeGeneratorRequest_RequestedFile_list CodeGeneratorRequest_get_requestedFiles(CodeGeneratorRequest_ptr p) +{ + CodeGeneratorRequest_RequestedFile_list requestedFiles; + requestedFiles.p = capn_getp(p.p, 1, 0); + return requestedFiles; +} + +void CodeGeneratorRequest_set_nodes(CodeGeneratorRequest_ptr p, Node_list nodes) +{ + capn_setp(p.p, 0, nodes.p); +} + +void CodeGeneratorRequest_set_requestedFiles(CodeGeneratorRequest_ptr p, CodeGeneratorRequest_RequestedFile_list requestedFiles) +{ + capn_setp(p.p, 1, requestedFiles.p); +} + CodeGeneratorRequest_RequestedFile_ptr new_CodeGeneratorRequest_RequestedFile(struct capn_segment *s) { CodeGeneratorRequest_RequestedFile_ptr p; p.p = capn_new_struct(s, 8, 2); @@ -784,6 +1204,42 @@ void set_CodeGeneratorRequest_RequestedFile(const struct CodeGeneratorRequest_Re write_CodeGeneratorRequest_RequestedFile(s, p); } +uint64_t CodeGeneratorRequest_RequestedFile_get_id(CodeGeneratorRequest_RequestedFile_ptr p) +{ + uint64_t id; + id = capn_read64(p.p, 0); + return id; +} + +capn_text CodeGeneratorRequest_RequestedFile_get_filename(CodeGeneratorRequest_RequestedFile_ptr p) +{ + capn_text filename; + filename = capn_get_text(p.p, 0, capn_val0); + return filename; +} + +CodeGeneratorRequest_RequestedFile_Import_list CodeGeneratorRequest_RequestedFile_get_imports(CodeGeneratorRequest_RequestedFile_ptr p) +{ + CodeGeneratorRequest_RequestedFile_Import_list imports; + imports.p = capn_getp(p.p, 1, 0); + return imports; +} + +void CodeGeneratorRequest_RequestedFile_set_id(CodeGeneratorRequest_RequestedFile_ptr p, uint64_t id) +{ + capn_write64(p.p, 0, id); +} + +void CodeGeneratorRequest_RequestedFile_set_filename(CodeGeneratorRequest_RequestedFile_ptr p, capn_text filename) +{ + capn_set_text(p.p, 0, filename); +} + +void CodeGeneratorRequest_RequestedFile_set_imports(CodeGeneratorRequest_RequestedFile_ptr p, CodeGeneratorRequest_RequestedFile_Import_list imports) +{ + capn_setp(p.p, 1, imports.p); +} + CodeGeneratorRequest_RequestedFile_Import_ptr new_CodeGeneratorRequest_RequestedFile_Import(struct capn_segment *s) { CodeGeneratorRequest_RequestedFile_Import_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -814,3 +1270,27 @@ void set_CodeGeneratorRequest_RequestedFile_Import(const struct CodeGeneratorReq p.p = capn_getp(l.p, i, 0); write_CodeGeneratorRequest_RequestedFile_Import(s, p); } + +uint64_t CodeGeneratorRequest_RequestedFile_Import_get_id(CodeGeneratorRequest_RequestedFile_Import_ptr p) +{ + uint64_t id; + id = capn_read64(p.p, 0); + return id; +} + +capn_text CodeGeneratorRequest_RequestedFile_Import_get_name(CodeGeneratorRequest_RequestedFile_Import_ptr p) +{ + capn_text name; + name = capn_get_text(p.p, 0, capn_val0); + return name; +} + +void CodeGeneratorRequest_RequestedFile_Import_set_id(CodeGeneratorRequest_RequestedFile_Import_ptr p, uint64_t id) +{ + capn_write64(p.p, 0, id); +} + +void CodeGeneratorRequest_RequestedFile_Import_set_name(CodeGeneratorRequest_RequestedFile_Import_ptr p, capn_text name) +{ + capn_set_text(p.p, 0, name); +} diff --git a/compiler/schema.capnp.h b/compiler/schema.capnp.h index f23a82b..513b435 100644 --- a/compiler/schema.capnp.h +++ b/compiler/schema.capnp.h @@ -133,14 +133,76 @@ struct Node { }; }; +static const size_t Node_word_count = 5; + +static const size_t Node_pointer_count = 6; + +static const size_t Node_struct_bytes_count = 88; + +uint64_t Node_get_id(Node_ptr p); + +capn_text Node_get_displayName(Node_ptr p); + +uint32_t Node_get_displayNamePrefixLength(Node_ptr p); + +uint64_t Node_get_scopeId(Node_ptr p); + +Node_Parameter_list Node_get_parameters(Node_ptr p); + +unsigned Node_get_isGeneric(Node_ptr p); + +Node_NestedNode_list Node_get_nestedNodes(Node_ptr p); + +Annotation_list Node_get_annotations(Node_ptr p); + +void Node_set_id(Node_ptr p, uint64_t id); + +void Node_set_displayName(Node_ptr p, capn_text displayName); + +void Node_set_displayNamePrefixLength(Node_ptr p, uint32_t displayNamePrefixLength); + +void Node_set_scopeId(Node_ptr p, uint64_t scopeId); + +void Node_set_parameters(Node_ptr p, Node_Parameter_list parameters); + +void Node_set_isGeneric(Node_ptr p, unsigned isGeneric); + +void Node_set_nestedNodes(Node_ptr p, Node_NestedNode_list nestedNodes); + +void Node_set_annotations(Node_ptr p, Annotation_list annotations); + struct Node_Parameter { capn_text name; }; +static const size_t Node_Parameter_word_count = 0; + +static const size_t Node_Parameter_pointer_count = 1; + +static const size_t Node_Parameter_struct_bytes_count = 8; + +capn_text Node_Parameter_get_name(Node_Parameter_ptr p); + +void Node_Parameter_set_name(Node_Parameter_ptr p, capn_text name); + struct Node_NestedNode { capn_text name; uint64_t id; }; + +static const size_t Node_NestedNode_word_count = 1; + +static const size_t Node_NestedNode_pointer_count = 1; + +static const size_t Node_NestedNode_struct_bytes_count = 16; + +capn_text Node_NestedNode_get_name(Node_NestedNode_ptr p); + +uint64_t Node_NestedNode_get_id(Node_NestedNode_ptr p); + +void Node_NestedNode_set_name(Node_NestedNode_ptr p, capn_text name); + +void Node_NestedNode_set_id(Node_NestedNode_ptr p, uint64_t id); enum Field_which { Field_slot = 0, Field_group = 1 @@ -173,17 +235,71 @@ struct Field { } ordinal; }; +static const size_t Field_word_count = 3; + +static const size_t Field_pointer_count = 4; + +static const size_t Field_struct_bytes_count = 56; + +capn_text Field_get_name(Field_ptr p); + +uint16_t Field_get_codeOrder(Field_ptr p); + +Annotation_list Field_get_annotations(Field_ptr p); + +uint16_t Field_get_discriminantValue(Field_ptr p); + +void Field_set_name(Field_ptr p, capn_text name); + +void Field_set_codeOrder(Field_ptr p, uint16_t codeOrder); + +void Field_set_annotations(Field_ptr p, Annotation_list annotations); + +void Field_set_discriminantValue(Field_ptr p, uint16_t discriminantValue); + struct Enumerant { capn_text name; uint16_t codeOrder; Annotation_list annotations; }; +static const size_t Enumerant_word_count = 1; + +static const size_t Enumerant_pointer_count = 2; + +static const size_t Enumerant_struct_bytes_count = 24; + +capn_text Enumerant_get_name(Enumerant_ptr p); + +uint16_t Enumerant_get_codeOrder(Enumerant_ptr p); + +Annotation_list Enumerant_get_annotations(Enumerant_ptr p); + +void Enumerant_set_name(Enumerant_ptr p, capn_text name); + +void Enumerant_set_codeOrder(Enumerant_ptr p, uint16_t codeOrder); + +void Enumerant_set_annotations(Enumerant_ptr p, Annotation_list annotations); + struct Superclass { uint64_t id; Brand_ptr brand; }; +static const size_t Superclass_word_count = 1; + +static const size_t Superclass_pointer_count = 1; + +static const size_t Superclass_struct_bytes_count = 16; + +uint64_t Superclass_get_id(Superclass_ptr p); + +Brand_ptr Superclass_get_brand(Superclass_ptr p); + +void Superclass_set_id(Superclass_ptr p, uint64_t id); + +void Superclass_set_brand(Superclass_ptr p, Brand_ptr brand); + struct Method { capn_text name; uint16_t codeOrder; @@ -194,6 +310,44 @@ struct Method { Brand_ptr resultBrand; Annotation_list annotations; }; + +static const size_t Method_word_count = 3; + +static const size_t Method_pointer_count = 5; + +static const size_t Method_struct_bytes_count = 64; + +capn_text Method_get_name(Method_ptr p); + +uint16_t Method_get_codeOrder(Method_ptr p); + +Node_Parameter_list Method_get_implicitParameters(Method_ptr p); + +uint64_t Method_get_paramStructType(Method_ptr p); + +Brand_ptr Method_get_paramBrand(Method_ptr p); + +uint64_t Method_get_resultStructType(Method_ptr p); + +Brand_ptr Method_get_resultBrand(Method_ptr p); + +Annotation_list Method_get_annotations(Method_ptr p); + +void Method_set_name(Method_ptr p, capn_text name); + +void Method_set_codeOrder(Method_ptr p, uint16_t codeOrder); + +void Method_set_implicitParameters(Method_ptr p, Node_Parameter_list implicitParameters); + +void Method_set_paramStructType(Method_ptr p, uint64_t paramStructType); + +void Method_set_paramBrand(Method_ptr p, Brand_ptr paramBrand); + +void Method_set_resultStructType(Method_ptr p, uint64_t resultStructType); + +void Method_set_resultBrand(Method_ptr p, Brand_ptr resultBrand); + +void Method_set_annotations(Method_ptr p, Annotation_list annotations); enum Type_anyPointer_which { Type_anyPointer_unconstrained = 0, Type_anyPointer_parameter = 1, @@ -252,9 +406,25 @@ struct Type { }; }; +static const size_t Type_word_count = 3; + +static const size_t Type_pointer_count = 1; + +static const size_t Type_struct_bytes_count = 32; + struct Brand { Brand_Scope_list scopes; }; + +static const size_t Brand_word_count = 0; + +static const size_t Brand_pointer_count = 1; + +static const size_t Brand_struct_bytes_count = 8; + +Brand_Scope_list Brand_get_scopes(Brand_ptr p); + +void Brand_set_scopes(Brand_ptr p, Brand_Scope_list scopes); enum Brand_Scope_which { Brand_Scope_bind = 0, Brand_Scope_inherit = 1 @@ -267,6 +437,16 @@ struct Brand_Scope { Brand_Binding_list bind; }; }; + +static const size_t Brand_Scope_word_count = 2; + +static const size_t Brand_Scope_pointer_count = 1; + +static const size_t Brand_Scope_struct_bytes_count = 24; + +uint64_t Brand_Scope_get_scopeId(Brand_Scope_ptr p); + +void Brand_Scope_set_scopeId(Brand_Scope_ptr p, uint64_t scopeId); enum Brand_Binding_which { Brand_Binding_unbound = 0, Brand_Binding_type = 1 @@ -278,6 +458,12 @@ struct Brand_Binding { Type_ptr type; }; }; + +static const size_t Brand_Binding_word_count = 1; + +static const size_t Brand_Binding_pointer_count = 1; + +static const size_t Brand_Binding_struct_bytes_count = 16; enum Value_which { Value__void = 0, Value__bool = 1, @@ -323,28 +509,98 @@ struct Value { }; }; +static const size_t Value_word_count = 2; + +static const size_t Value_pointer_count = 1; + +static const size_t Value_struct_bytes_count = 24; + struct Annotation { uint64_t id; Brand_ptr brand; Value_ptr value; }; +static const size_t Annotation_word_count = 1; + +static const size_t Annotation_pointer_count = 2; + +static const size_t Annotation_struct_bytes_count = 24; + +uint64_t Annotation_get_id(Annotation_ptr p); + +Brand_ptr Annotation_get_brand(Annotation_ptr p); + +Value_ptr Annotation_get_value(Annotation_ptr p); + +void Annotation_set_id(Annotation_ptr p, uint64_t id); + +void Annotation_set_brand(Annotation_ptr p, Brand_ptr brand); + +void Annotation_set_value(Annotation_ptr p, Value_ptr value); + struct CodeGeneratorRequest { Node_list nodes; CodeGeneratorRequest_RequestedFile_list requestedFiles; }; +static const size_t CodeGeneratorRequest_word_count = 0; + +static const size_t CodeGeneratorRequest_pointer_count = 2; + +static const size_t CodeGeneratorRequest_struct_bytes_count = 16; + +Node_list CodeGeneratorRequest_get_nodes(CodeGeneratorRequest_ptr p); + +CodeGeneratorRequest_RequestedFile_list CodeGeneratorRequest_get_requestedFiles(CodeGeneratorRequest_ptr p); + +void CodeGeneratorRequest_set_nodes(CodeGeneratorRequest_ptr p, Node_list nodes); + +void CodeGeneratorRequest_set_requestedFiles(CodeGeneratorRequest_ptr p, CodeGeneratorRequest_RequestedFile_list requestedFiles); + struct CodeGeneratorRequest_RequestedFile { uint64_t id; capn_text filename; CodeGeneratorRequest_RequestedFile_Import_list imports; }; +static const size_t CodeGeneratorRequest_RequestedFile_word_count = 1; + +static const size_t CodeGeneratorRequest_RequestedFile_pointer_count = 2; + +static const size_t CodeGeneratorRequest_RequestedFile_struct_bytes_count = 24; + +uint64_t CodeGeneratorRequest_RequestedFile_get_id(CodeGeneratorRequest_RequestedFile_ptr p); + +capn_text CodeGeneratorRequest_RequestedFile_get_filename(CodeGeneratorRequest_RequestedFile_ptr p); + +CodeGeneratorRequest_RequestedFile_Import_list CodeGeneratorRequest_RequestedFile_get_imports(CodeGeneratorRequest_RequestedFile_ptr p); + +void CodeGeneratorRequest_RequestedFile_set_id(CodeGeneratorRequest_RequestedFile_ptr p, uint64_t id); + +void CodeGeneratorRequest_RequestedFile_set_filename(CodeGeneratorRequest_RequestedFile_ptr p, capn_text filename); + +void CodeGeneratorRequest_RequestedFile_set_imports(CodeGeneratorRequest_RequestedFile_ptr p, CodeGeneratorRequest_RequestedFile_Import_list imports); + struct CodeGeneratorRequest_RequestedFile_Import { uint64_t id; capn_text name; }; +static const size_t CodeGeneratorRequest_RequestedFile_Import_word_count = 1; + +static const size_t CodeGeneratorRequest_RequestedFile_Import_pointer_count = 1; + +static const size_t CodeGeneratorRequest_RequestedFile_Import_struct_bytes_count = 16; + +uint64_t CodeGeneratorRequest_RequestedFile_Import_get_id(CodeGeneratorRequest_RequestedFile_Import_ptr p); + +capn_text CodeGeneratorRequest_RequestedFile_Import_get_name(CodeGeneratorRequest_RequestedFile_Import_ptr p); + +void CodeGeneratorRequest_RequestedFile_Import_set_id(CodeGeneratorRequest_RequestedFile_Import_ptr p, uint64_t id); + +void CodeGeneratorRequest_RequestedFile_Import_set_name(CodeGeneratorRequest_RequestedFile_Import_ptr p, capn_text name); + 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*); diff --git a/compiler/test.capnp.c b/compiler/test.capnp.c index db7174c..fa5cc7d 100644 --- a/compiler/test.capnp.c +++ b/compiler/test.capnp.c @@ -2,7 +2,7 @@ /* AUTO GENERATED - DO NOT EDIT */ static const capn_text capn_val0 = {0,""}; static const capn_ptr capn_null = {CAPN_NULL}; -static const uint8_t capn_buf[64] = { +static const uint8_t capn_buf[72] = { 102,111,111,0,0,0,0,0, 98,97,114,0,0,0,0,0, 9,0,0,0,0,0,0,0, @@ -10,9 +10,10 @@ static const uint8_t capn_buf[64] = { 103,43,153,212,0,0,0,0, 199,107,159,6,57,148,96,249, 199,113,196,43,171,117,107,15, - 57,142,59,212,84,138,148,240 + 57,142,59,212,84,138,148,240, + 111,222,0,0,0,0,0,0 }; -static const struct capn_segment capn_seg = {{0},0,0,0,(char*)&capn_buf[0],64,64}; +static const struct capn_segment capn_seg = {{0},0,0,0,(char*)&capn_buf[0],72,72}; union capn_conv_f32 TestWholeFloatDefault_constant = {0x43e40000u}; union capn_conv_f32 TestWholeFloatDefault_bigConstant = {0x7249f2cau}; unsigned TestConstants_boolConst = 1; @@ -36,21 +37,21 @@ capn_list8 TestConstants_int8ListConst = {{2,0,0,0,1,0,2,(char*)&capn_buf[24],(s capn_list16 TestConstants_int16ListConst = {{2,0,0,0,2,0,2,(char*)&capn_buf[32],(struct capn_segment*)&capn_seg}}; capn_list32 TestConstants_int32ListConst = {{2,0,0,0,4,0,2,(char*)&capn_buf[40],(struct capn_segment*)&capn_seg}}; capn_list64 TestConstants_int64ListConst = {{2,0,0,0,8,0,2,(char*)&capn_buf[48],(struct capn_segment*)&capn_seg}}; -capn_list8 TestConstants_uint8ListConst = {{2,1,0,0,1,0,2,(char*)&capn_buf[1664],(struct capn_segment*)&capn_seg}}; -capn_list16 TestConstants_uint16ListConst = {{2,1,0,0,2,0,2,(char*)&capn_buf[1680],(struct capn_segment*)&capn_seg}}; -capn_list32 TestConstants_uint32ListConst = {{2,1,0,0,4,0,1,(char*)&capn_buf[1696],(struct capn_segment*)&capn_seg}}; -capn_list64 TestConstants_uint64ListConst = {{2,1,0,0,8,0,1,(char*)&capn_buf[1712],(struct capn_segment*)&capn_seg}}; -capn_list32 TestConstants_float32ListConst = {{2,1,0,0,4,0,4,(char*)&capn_buf[1728],(struct capn_segment*)&capn_seg}}; -capn_list64 TestConstants_float64ListConst = {{2,1,0,0,8,0,4,(char*)&capn_buf[1752],(struct capn_segment*)&capn_seg}}; -capn_ptr TestConstants_textListConst = {3,1,0,0,0,0,3,(char*)&capn_buf[1792],(struct capn_segment*)&capn_seg}; -capn_ptr TestConstants_dataListConst = {3,1,0,0,0,0,3,(char*)&capn_buf[1848],(struct capn_segment*)&capn_seg}; -TestAllTypes_list TestConstants_structListConst = {{2,1,0,1,48,20,3,(char*)&capn_buf[1920],(struct capn_segment*)&capn_seg}}; -capn_list16 TestConstants_enumListConst = {{2,1,0,0,2,0,2,(char*)&capn_buf[2600],(struct capn_segment*)&capn_seg}}; +capn_list8 TestConstants_uint8ListConst = {{2,0,0,0,1,0,2,(char*)&capn_buf[64],(struct capn_segment*)&capn_seg}}; +capn_list16 TestConstants_uint16ListConst = {{2,1,0,0,2,0,2,(char*)&capn_buf[1664],(struct capn_segment*)&capn_seg}}; +capn_list32 TestConstants_uint32ListConst = {{2,1,0,0,4,0,1,(char*)&capn_buf[1680],(struct capn_segment*)&capn_seg}}; +capn_list64 TestConstants_uint64ListConst = {{2,1,0,0,8,0,1,(char*)&capn_buf[1696],(struct capn_segment*)&capn_seg}}; +capn_list32 TestConstants_float32ListConst = {{2,1,0,0,4,0,4,(char*)&capn_buf[1712],(struct capn_segment*)&capn_seg}}; +capn_list64 TestConstants_float64ListConst = {{2,1,0,0,8,0,4,(char*)&capn_buf[1736],(struct capn_segment*)&capn_seg}}; +capn_ptr TestConstants_textListConst = {3,1,0,0,0,0,3,(char*)&capn_buf[1776],(struct capn_segment*)&capn_seg}; +capn_ptr TestConstants_dataListConst = {3,1,0,0,0,0,3,(char*)&capn_buf[1832],(struct capn_segment*)&capn_seg}; +TestAllTypes_list TestConstants_structListConst = {{2,1,0,1,48,20,3,(char*)&capn_buf[1904],(struct capn_segment*)&capn_seg}}; +capn_list16 TestConstants_enumListConst = {{2,1,0,0,2,0,2,(char*)&capn_buf[2584],(struct capn_segment*)&capn_seg}}; uint32_t globalInt = 12345u; -capn_text globalText = {6,(char*)&capn_buf[2616],(struct capn_segment*)&capn_seg}; -TestAllTypes_ptr globalStruct = {{1,1,0,0,48,20,0,(char*)&capn_buf[2632],(struct capn_segment*)&capn_seg}}; -TestPrintInlineStructs_ptr globalPrintableStruct = {{1,1,0,0,0,2,0,(char*)&capn_buf[2848],(struct capn_segment*)&capn_seg}}; -TestAllTypes_ptr derivedConstant = {{1,1,0,0,48,20,0,(char*)&capn_buf[2880],(struct capn_segment*)&capn_seg}}; +capn_text globalText = {6,(char*)&capn_buf[2600],(struct capn_segment*)&capn_seg}; +TestAllTypes_ptr globalStruct = {{1,1,0,0,48,20,0,(char*)&capn_buf[2616],(struct capn_segment*)&capn_seg}}; +TestPrintInlineStructs_ptr globalPrintableStruct = {{1,1,0,0,0,2,0,(char*)&capn_buf[2832],(struct capn_segment*)&capn_seg}}; +TestAllTypes_ptr derivedConstant = {{1,1,0,0,48,20,0,(char*)&capn_buf[2864],(struct capn_segment*)&capn_seg}}; TestAllTypes_ptr new_TestAllTypes(struct capn_segment *s) { TestAllTypes_ptr p; @@ -65,10 +66,10 @@ TestAllTypes_list new_TestAllTypes_list(struct capn_segment *s, int len) { void read_TestAllTypes(struct TestAllTypes *s, TestAllTypes_ptr p) { capn_resolve(&p.p); s->boolField = (capn_read8(p.p, 0) & 1) != 0; - s->int8Field = (int8_t) capn_read8(p.p, 1); - s->int16Field = (int16_t) capn_read16(p.p, 2); - s->int32Field = (int32_t) capn_read32(p.p, 4); - s->int64Field = (int64_t) capn_read64(p.p, 8); + s->int8Field = (int8_t) ((int8_t)capn_read8(p.p, 1)); + s->int16Field = (int16_t) ((int16_t)capn_read16(p.p, 2)); + s->int32Field = (int32_t) ((int32_t)capn_read32(p.p, 4)); + s->int64Field = (int64_t) ((int64_t)(capn_read64(p.p, 8))); s->uInt8Field = capn_read8(p.p, 16); s->uInt16Field = capn_read16(p.p, 18); s->uInt32Field = capn_read32(p.p, 20); @@ -100,10 +101,10 @@ void read_TestAllTypes(struct TestAllTypes *s, TestAllTypes_ptr p) { void write_TestAllTypes(const struct TestAllTypes *s, TestAllTypes_ptr p) { capn_resolve(&p.p); capn_write1(p.p, 0, s->boolField != 0); - capn_write8(p.p, 1, (uint8_t) s->int8Field); - capn_write16(p.p, 2, (uint16_t) s->int16Field); - capn_write32(p.p, 4, (uint32_t) s->int32Field); - capn_write64(p.p, 8, (uint64_t) s->int64Field); + capn_write8(p.p, 1, (uint8_t) (s->int8Field)); + capn_write16(p.p, 2, (uint16_t) (s->int16Field)); + capn_write32(p.p, 4, (uint32_t) (s->int32Field)); + capn_write64(p.p, 8, (uint64_t) (s->int64Field)); capn_write8(p.p, 16, s->uInt8Field); capn_write16(p.p, 18, s->uInt16Field); capn_write32(p.p, 20, s->uInt32Field); @@ -113,7 +114,7 @@ void write_TestAllTypes(const struct TestAllTypes *s, TestAllTypes_ptr p) { capn_set_text(p.p, 0, s->textField); capn_setp(p.p, 1, s->dataField.p); capn_setp(p.p, 2, s->structField.p); - capn_write16(p.p, 36, (uint16_t) s->enumField); + capn_write16(p.p, 36, (uint16_t) (s->enumField)); capn_setp(p.p, 3, s->voidList); capn_setp(p.p, 4, s->boolList.p); capn_setp(p.p, 5, s->int8List.p); @@ -142,25 +143,409 @@ void set_TestAllTypes(const struct TestAllTypes *s, TestAllTypes_list l, int i) p.p = capn_getp(l.p, i, 0); write_TestAllTypes(s, p); } -capn_text capn_val1 = {3,(char*)&capn_buf[1496],(struct capn_segment*)&capn_seg}; -capn_data capn_val2 = {{2,1,0,0,1,0,3,(char*)&capn_buf[1512],(struct capn_segment*)&capn_seg}}; -TestAllTypes_ptr capn_val3 = {{1,1,0,0,48,20,0,(char*)&capn_buf[1528],(struct capn_segment*)&capn_seg}}; -capn_ptr capn_val4 = {2,0,0,0,0,0,6,(char*)&capn_buf[64],(struct capn_segment*)&capn_seg}; -capn_list1 capn_val5 = {{4,1,0,0,1,0,4,(char*)&capn_buf[3192],(struct capn_segment*)&capn_seg}}; -capn_list8 capn_val6 = {{2,1,0,0,1,0,2,(char*)&capn_buf[3208],(struct capn_segment*)&capn_seg}}; -capn_list16 capn_val7 = {{2,1,0,0,2,0,2,(char*)&capn_buf[3224],(struct capn_segment*)&capn_seg}}; -capn_list32 capn_val8 = {{2,1,0,0,4,0,2,(char*)&capn_buf[3240],(struct capn_segment*)&capn_seg}}; -capn_list64 capn_val9 = {{2,1,0,0,8,0,2,(char*)&capn_buf[3256],(struct capn_segment*)&capn_seg}}; -capn_list8 capn_val10 = {{2,1,0,0,1,0,2,(char*)&capn_buf[3280],(struct capn_segment*)&capn_seg}}; -capn_list16 capn_val11 = {{2,1,0,0,2,0,2,(char*)&capn_buf[3296],(struct capn_segment*)&capn_seg}}; -capn_list32 capn_val12 = {{2,1,0,0,4,0,1,(char*)&capn_buf[3312],(struct capn_segment*)&capn_seg}}; -capn_list64 capn_val13 = {{2,1,0,0,8,0,1,(char*)&capn_buf[3328],(struct capn_segment*)&capn_seg}}; -capn_list32 capn_val14 = {{2,1,0,0,4,0,4,(char*)&capn_buf[3344],(struct capn_segment*)&capn_seg}}; -capn_list64 capn_val15 = {{2,1,0,0,8,0,4,(char*)&capn_buf[3368],(struct capn_segment*)&capn_seg}}; -capn_ptr capn_val16 = {3,1,0,0,0,0,3,(char*)&capn_buf[3408],(struct capn_segment*)&capn_seg}; -capn_ptr capn_val17 = {3,1,0,0,0,0,3,(char*)&capn_buf[3464],(struct capn_segment*)&capn_seg}; + +unsigned TestAllTypes_get_boolField(TestAllTypes_ptr p) +{ + unsigned boolField; + boolField = (capn_read8(p.p, 0) & 1) != 0; + return boolField; +} + +int8_t TestAllTypes_get_int8Field(TestAllTypes_ptr p) +{ + int8_t int8Field; + int8Field = (int8_t) ((int8_t)capn_read8(p.p, 1)); + return int8Field; +} + +int16_t TestAllTypes_get_int16Field(TestAllTypes_ptr p) +{ + int16_t int16Field; + int16Field = (int16_t) ((int16_t)capn_read16(p.p, 2)); + return int16Field; +} + +int32_t TestAllTypes_get_int32Field(TestAllTypes_ptr p) +{ + int32_t int32Field; + int32Field = (int32_t) ((int32_t)capn_read32(p.p, 4)); + return int32Field; +} + +int64_t TestAllTypes_get_int64Field(TestAllTypes_ptr p) +{ + int64_t int64Field; + int64Field = (int64_t) ((int64_t)(capn_read64(p.p, 8))); + return int64Field; +} + +uint8_t TestAllTypes_get_uInt8Field(TestAllTypes_ptr p) +{ + uint8_t uInt8Field; + uInt8Field = capn_read8(p.p, 16); + return uInt8Field; +} + +uint16_t TestAllTypes_get_uInt16Field(TestAllTypes_ptr p) +{ + uint16_t uInt16Field; + uInt16Field = capn_read16(p.p, 18); + return uInt16Field; +} + +uint32_t TestAllTypes_get_uInt32Field(TestAllTypes_ptr p) +{ + uint32_t uInt32Field; + uInt32Field = capn_read32(p.p, 20); + return uInt32Field; +} + +uint64_t TestAllTypes_get_uInt64Field(TestAllTypes_ptr p) +{ + uint64_t uInt64Field; + uInt64Field = capn_read64(p.p, 24); + return uInt64Field; +} + +float TestAllTypes_get_float32Field(TestAllTypes_ptr p) +{ + float float32Field; + float32Field = capn_to_f32(capn_read32(p.p, 32)); + return float32Field; +} + +double TestAllTypes_get_float64Field(TestAllTypes_ptr p) +{ + double float64Field; + float64Field = capn_to_f64(capn_read64(p.p, 40)); + return float64Field; +} + +capn_text TestAllTypes_get_textField(TestAllTypes_ptr p) +{ + capn_text textField; + textField = capn_get_text(p.p, 0, capn_val0); + return textField; +} + +capn_data TestAllTypes_get_dataField(TestAllTypes_ptr p) +{ + capn_data dataField; + dataField = capn_get_data(p.p, 1); + return dataField; +} + +TestAllTypes_ptr TestAllTypes_get_structField(TestAllTypes_ptr p) +{ + TestAllTypes_ptr structField; + structField.p = capn_getp(p.p, 2, 0); + return structField; +} + +enum TestEnum TestAllTypes_get_enumField(TestAllTypes_ptr p) +{ + enum TestEnum enumField; + enumField = (enum TestEnum)(int) capn_read16(p.p, 36); + return enumField; +} + +capn_ptr TestAllTypes_get_voidList(TestAllTypes_ptr p) +{ + capn_ptr voidList; + voidList = capn_getp(p.p, 3, 0); + return voidList; +} + +capn_list1 TestAllTypes_get_boolList(TestAllTypes_ptr p) +{ + capn_list1 boolList; + boolList.p = capn_getp(p.p, 4, 0); + return boolList; +} + +capn_list8 TestAllTypes_get_int8List(TestAllTypes_ptr p) +{ + capn_list8 int8List; + int8List.p = capn_getp(p.p, 5, 0); + return int8List; +} + +capn_list16 TestAllTypes_get_int16List(TestAllTypes_ptr p) +{ + capn_list16 int16List; + int16List.p = capn_getp(p.p, 6, 0); + return int16List; +} + +capn_list32 TestAllTypes_get_int32List(TestAllTypes_ptr p) +{ + capn_list32 int32List; + int32List.p = capn_getp(p.p, 7, 0); + return int32List; +} + +capn_list64 TestAllTypes_get_int64List(TestAllTypes_ptr p) +{ + capn_list64 int64List; + int64List.p = capn_getp(p.p, 8, 0); + return int64List; +} + +capn_list8 TestAllTypes_get_uInt8List(TestAllTypes_ptr p) +{ + capn_list8 uInt8List; + uInt8List.p = capn_getp(p.p, 9, 0); + return uInt8List; +} + +capn_list16 TestAllTypes_get_uInt16List(TestAllTypes_ptr p) +{ + capn_list16 uInt16List; + uInt16List.p = capn_getp(p.p, 10, 0); + return uInt16List; +} + +capn_list32 TestAllTypes_get_uInt32List(TestAllTypes_ptr p) +{ + capn_list32 uInt32List; + uInt32List.p = capn_getp(p.p, 11, 0); + return uInt32List; +} + +capn_list64 TestAllTypes_get_uInt64List(TestAllTypes_ptr p) +{ + capn_list64 uInt64List; + uInt64List.p = capn_getp(p.p, 12, 0); + return uInt64List; +} + +capn_list32 TestAllTypes_get_float32List(TestAllTypes_ptr p) +{ + capn_list32 float32List; + float32List.p = capn_getp(p.p, 13, 0); + return float32List; +} + +capn_list64 TestAllTypes_get_float64List(TestAllTypes_ptr p) +{ + capn_list64 float64List; + float64List.p = capn_getp(p.p, 14, 0); + return float64List; +} + +capn_ptr TestAllTypes_get_textList(TestAllTypes_ptr p) +{ + capn_ptr textList; + textList = capn_getp(p.p, 15, 0); + return textList; +} + +capn_ptr TestAllTypes_get_dataList(TestAllTypes_ptr p) +{ + capn_ptr dataList; + dataList = capn_getp(p.p, 16, 0); + return dataList; +} + +TestAllTypes_list TestAllTypes_get_structList(TestAllTypes_ptr p) +{ + TestAllTypes_list structList; + structList.p = capn_getp(p.p, 17, 0); + return structList; +} + +capn_list16 TestAllTypes_get_enumList(TestAllTypes_ptr p) +{ + capn_list16 enumList; + enumList.p = capn_getp(p.p, 18, 0); + return enumList; +} + +capn_ptr TestAllTypes_get_interfaceList(TestAllTypes_ptr p) +{ + capn_ptr interfaceList; + interfaceList = capn_getp(p.p, 19, 0); + return interfaceList; +} + +void TestAllTypes_set_boolField(TestAllTypes_ptr p, unsigned boolField) +{ + capn_write1(p.p, 0, boolField != 0); +} + +void TestAllTypes_set_int8Field(TestAllTypes_ptr p, int8_t int8Field) +{ + capn_write8(p.p, 1, (uint8_t) (int8Field)); +} + +void TestAllTypes_set_int16Field(TestAllTypes_ptr p, int16_t int16Field) +{ + capn_write16(p.p, 2, (uint16_t) (int16Field)); +} + +void TestAllTypes_set_int32Field(TestAllTypes_ptr p, int32_t int32Field) +{ + capn_write32(p.p, 4, (uint32_t) (int32Field)); +} + +void TestAllTypes_set_int64Field(TestAllTypes_ptr p, int64_t int64Field) +{ + capn_write64(p.p, 8, (uint64_t) (int64Field)); +} + +void TestAllTypes_set_uInt8Field(TestAllTypes_ptr p, uint8_t uInt8Field) +{ + capn_write8(p.p, 16, uInt8Field); +} + +void TestAllTypes_set_uInt16Field(TestAllTypes_ptr p, uint16_t uInt16Field) +{ + capn_write16(p.p, 18, uInt16Field); +} + +void TestAllTypes_set_uInt32Field(TestAllTypes_ptr p, uint32_t uInt32Field) +{ + capn_write32(p.p, 20, uInt32Field); +} + +void TestAllTypes_set_uInt64Field(TestAllTypes_ptr p, uint64_t uInt64Field) +{ + capn_write64(p.p, 24, uInt64Field); +} + +void TestAllTypes_set_float32Field(TestAllTypes_ptr p, float float32Field) +{ + capn_write32(p.p, 32, capn_from_f32(float32Field)); +} + +void TestAllTypes_set_float64Field(TestAllTypes_ptr p, double float64Field) +{ + capn_write64(p.p, 40, capn_from_f64(float64Field)); +} + +void TestAllTypes_set_textField(TestAllTypes_ptr p, capn_text textField) +{ + capn_set_text(p.p, 0, textField); +} + +void TestAllTypes_set_dataField(TestAllTypes_ptr p, capn_data dataField) +{ + capn_setp(p.p, 1, dataField.p); +} + +void TestAllTypes_set_structField(TestAllTypes_ptr p, TestAllTypes_ptr structField) +{ + capn_setp(p.p, 2, structField.p); +} + +void TestAllTypes_set_enumField(TestAllTypes_ptr p, enum TestEnum enumField) +{ + capn_write16(p.p, 36, (uint16_t) (enumField)); +} + +void TestAllTypes_set_voidList(TestAllTypes_ptr p, capn_ptr voidList) +{ + capn_setp(p.p, 3, voidList); +} + +void TestAllTypes_set_boolList(TestAllTypes_ptr p, capn_list1 boolList) +{ + capn_setp(p.p, 4, boolList.p); +} + +void TestAllTypes_set_int8List(TestAllTypes_ptr p, capn_list8 int8List) +{ + capn_setp(p.p, 5, int8List.p); +} + +void TestAllTypes_set_int16List(TestAllTypes_ptr p, capn_list16 int16List) +{ + capn_setp(p.p, 6, int16List.p); +} + +void TestAllTypes_set_int32List(TestAllTypes_ptr p, capn_list32 int32List) +{ + capn_setp(p.p, 7, int32List.p); +} + +void TestAllTypes_set_int64List(TestAllTypes_ptr p, capn_list64 int64List) +{ + capn_setp(p.p, 8, int64List.p); +} + +void TestAllTypes_set_uInt8List(TestAllTypes_ptr p, capn_list8 uInt8List) +{ + capn_setp(p.p, 9, uInt8List.p); +} + +void TestAllTypes_set_uInt16List(TestAllTypes_ptr p, capn_list16 uInt16List) +{ + capn_setp(p.p, 10, uInt16List.p); +} + +void TestAllTypes_set_uInt32List(TestAllTypes_ptr p, capn_list32 uInt32List) +{ + capn_setp(p.p, 11, uInt32List.p); +} + +void TestAllTypes_set_uInt64List(TestAllTypes_ptr p, capn_list64 uInt64List) +{ + capn_setp(p.p, 12, uInt64List.p); +} + +void TestAllTypes_set_float32List(TestAllTypes_ptr p, capn_list32 float32List) +{ + capn_setp(p.p, 13, float32List.p); +} + +void TestAllTypes_set_float64List(TestAllTypes_ptr p, capn_list64 float64List) +{ + capn_setp(p.p, 14, float64List.p); +} + +void TestAllTypes_set_textList(TestAllTypes_ptr p, capn_ptr textList) +{ + capn_setp(p.p, 15, textList); +} + +void TestAllTypes_set_dataList(TestAllTypes_ptr p, capn_ptr dataList) +{ + capn_setp(p.p, 16, dataList); +} + +void TestAllTypes_set_structList(TestAllTypes_ptr p, TestAllTypes_list structList) +{ + capn_setp(p.p, 17, structList.p); +} + +void TestAllTypes_set_enumList(TestAllTypes_ptr p, capn_list16 enumList) +{ + capn_setp(p.p, 18, enumList.p); +} + +void TestAllTypes_set_interfaceList(TestAllTypes_ptr p, capn_ptr interfaceList) +{ + capn_setp(p.p, 19, interfaceList); +} +capn_text capn_val1 = {3,(char*)&capn_buf[1464],(struct capn_segment*)&capn_seg}; +capn_data capn_val2 = {{2,1,0,0,1,0,3,(char*)&capn_buf[1480],(struct capn_segment*)&capn_seg}}; +TestAllTypes_ptr capn_val3 = {{1,1,0,0,48,20,0,(char*)&capn_buf[1496],(struct capn_segment*)&capn_seg}}; +capn_ptr capn_val4 = {2,0,0,0,0,0,6,(char*)&capn_buf[72],(struct capn_segment*)&capn_seg}; +capn_list1 capn_val5 = {{4,1,0,0,1,0,4,(char*)&capn_buf[3160],(struct capn_segment*)&capn_seg}}; +capn_list8 capn_val6 = {{2,1,0,0,1,0,2,(char*)&capn_buf[3176],(struct capn_segment*)&capn_seg}}; +capn_list16 capn_val7 = {{2,1,0,0,2,0,2,(char*)&capn_buf[3192],(struct capn_segment*)&capn_seg}}; +capn_list32 capn_val8 = {{2,1,0,0,4,0,2,(char*)&capn_buf[3208],(struct capn_segment*)&capn_seg}}; +capn_list64 capn_val9 = {{2,1,0,0,8,0,2,(char*)&capn_buf[3224],(struct capn_segment*)&capn_seg}}; +capn_list8 capn_val10 = {{2,1,0,0,1,0,2,(char*)&capn_buf[3248],(struct capn_segment*)&capn_seg}}; +capn_list16 capn_val11 = {{2,1,0,0,2,0,2,(char*)&capn_buf[3264],(struct capn_segment*)&capn_seg}}; +capn_list32 capn_val12 = {{2,1,0,0,4,0,1,(char*)&capn_buf[3280],(struct capn_segment*)&capn_seg}}; +capn_list64 capn_val13 = {{2,1,0,0,8,0,1,(char*)&capn_buf[3296],(struct capn_segment*)&capn_seg}}; +capn_list32 capn_val14 = {{2,1,0,0,4,0,4,(char*)&capn_buf[3312],(struct capn_segment*)&capn_seg}}; +capn_list64 capn_val15 = {{2,1,0,0,8,0,4,(char*)&capn_buf[3336],(struct capn_segment*)&capn_seg}}; +capn_ptr capn_val16 = {3,1,0,0,0,0,3,(char*)&capn_buf[3376],(struct capn_segment*)&capn_seg}; +capn_ptr capn_val17 = {3,1,0,0,0,0,3,(char*)&capn_buf[3432],(struct capn_segment*)&capn_seg}; TestAllTypes_list capn_val18 = {{2,1,0,1,48,20,3,(char*)&capn_buf[8],(struct capn_segment*)&capn_seg}}; -capn_list16 capn_val19 = {{2,1,0,0,2,0,2,(char*)&capn_buf[3528],(struct capn_segment*)&capn_seg}}; +capn_list16 capn_val19 = {{2,1,0,0,2,0,2,(char*)&capn_buf[3496],(struct capn_segment*)&capn_seg}}; TestDefaults_ptr new_TestDefaults(struct capn_segment *s) { TestDefaults_ptr p; @@ -175,10 +560,10 @@ TestDefaults_list new_TestDefaults_list(struct capn_segment *s, int len) { void read_TestDefaults(struct TestDefaults *s, TestDefaults_ptr p) { capn_resolve(&p.p); s->boolField = (capn_read8(p.p, 0) & 1) != 1; - s->int8Field = (int8_t) capn_read8(p.p, 1) ^ -123; - s->int16Field = (int16_t) capn_read16(p.p, 2) ^ -12345; - s->int32Field = (int32_t) capn_read32(p.p, 4) ^ -12345678; - s->int64Field = (int64_t) capn_read64(p.p, 8) ^ ((uint64_t) 0xffff8fb7u << 32) ^ 0x79f22087u; + s->int8Field = (int8_t) ((int8_t)capn_read8(p.p, 1)) ^ -123; + s->int16Field = (int16_t) ((int16_t)capn_read16(p.p, 2)) ^ -12345; + s->int32Field = (int32_t) ((int32_t)capn_read32(p.p, 4)) ^ -12345678; + s->int64Field = (int64_t) ((int64_t)(capn_read64(p.p, 8)) ^ ((int64_t)((uint64_t) 0xffff8fb7u << 32) ^ 0x79f22087u)); s->uInt8Field = capn_read8(p.p, 16) ^ 234u; s->uInt16Field = capn_read16(p.p, 18) ^ 45678u; s->uInt32Field = capn_read32(p.p, 20) ^ 3456789012u; @@ -264,10 +649,10 @@ void read_TestDefaults(struct TestDefaults *s, TestDefaults_ptr p) { void write_TestDefaults(const struct TestDefaults *s, TestDefaults_ptr p) { capn_resolve(&p.p); capn_write1(p.p, 0, s->boolField != 1); - capn_write8(p.p, 1, (uint8_t) s->int8Field ^ -123); - capn_write16(p.p, 2, (uint16_t) s->int16Field ^ -12345); - capn_write32(p.p, 4, (uint32_t) s->int32Field ^ -12345678); - capn_write64(p.p, 8, (uint64_t) s->int64Field ^ ((uint64_t) 0xffff8fb7u << 32) ^ 0x79f22087u); + capn_write8(p.p, 1, (uint8_t) (s->int8Field ^ -123)); + capn_write16(p.p, 2, (uint16_t) (s->int16Field ^ -12345)); + capn_write32(p.p, 4, (uint32_t) (s->int32Field ^ -12345678)); + capn_write64(p.p, 8, (uint64_t) (s->int64Field ^ ((int64_t)((uint64_t) 0xffff8fb7u << 32) ^ 0x79f22087u))); capn_write8(p.p, 16, s->uInt8Field ^ 234u); capn_write16(p.p, 18, s->uInt16Field ^ 45678u); capn_write32(p.p, 20, s->uInt32Field ^ 3456789012u); @@ -277,7 +662,7 @@ void write_TestDefaults(const struct TestDefaults *s, TestDefaults_ptr p) { capn_set_text(p.p, 0, (s->textField.str != capn_val1.str) ? s->textField : capn_val0); capn_setp(p.p, 1, (s->dataField.p.data != capn_val2.p.data) ? s->dataField.p : capn_null); capn_setp(p.p, 2, (s->structField.p.data != capn_val3.p.data) ? s->structField.p : capn_null); - capn_write16(p.p, 36, (uint16_t) s->enumField ^ 5u); + capn_write16(p.p, 36, (uint16_t) (s->enumField ^ 5u)); capn_setp(p.p, 3, (s->voidList.data != capn_val4.data) ? s->voidList : capn_null); capn_setp(p.p, 4, (s->boolList.p.data != capn_val5.p.data) ? s->boolList.p : capn_null); capn_setp(p.p, 5, (s->int8List.p.data != capn_val6.p.data) ? s->int8List.p : capn_null); @@ -307,6 +692,444 @@ void set_TestDefaults(const struct TestDefaults *s, TestDefaults_list l, int i) write_TestDefaults(s, p); } +unsigned TestDefaults_get_boolField(TestDefaults_ptr p) +{ + unsigned boolField; + boolField = (capn_read8(p.p, 0) & 1) != 1; + return boolField; +} + +int8_t TestDefaults_get_int8Field(TestDefaults_ptr p) +{ + int8_t int8Field; + int8Field = (int8_t) ((int8_t)capn_read8(p.p, 1)) ^ -123; + return int8Field; +} + +int16_t TestDefaults_get_int16Field(TestDefaults_ptr p) +{ + int16_t int16Field; + int16Field = (int16_t) ((int16_t)capn_read16(p.p, 2)) ^ -12345; + return int16Field; +} + +int32_t TestDefaults_get_int32Field(TestDefaults_ptr p) +{ + int32_t int32Field; + int32Field = (int32_t) ((int32_t)capn_read32(p.p, 4)) ^ -12345678; + return int32Field; +} + +int64_t TestDefaults_get_int64Field(TestDefaults_ptr p) +{ + int64_t int64Field; + int64Field = (int64_t) ((int64_t)(capn_read64(p.p, 8)) ^ ((int64_t)((uint64_t) 0xffff8fb7u << 32) ^ 0x79f22087u)); + return int64Field; +} + +uint8_t TestDefaults_get_uInt8Field(TestDefaults_ptr p) +{ + uint8_t uInt8Field; + uInt8Field = capn_read8(p.p, 16) ^ 234u; + return uInt8Field; +} + +uint16_t TestDefaults_get_uInt16Field(TestDefaults_ptr p) +{ + uint16_t uInt16Field; + uInt16Field = capn_read16(p.p, 18) ^ 45678u; + return uInt16Field; +} + +uint32_t TestDefaults_get_uInt32Field(TestDefaults_ptr p) +{ + uint32_t uInt32Field; + uInt32Field = capn_read32(p.p, 20) ^ 3456789012u; + return uInt32Field; +} + +uint64_t TestDefaults_get_uInt64Field(TestDefaults_ptr p) +{ + uint64_t uInt64Field; + uInt64Field = capn_read64(p.p, 24) ^ ((uint64_t) 0xab54a98cu << 32) ^ 0xeb1f0ad2u; + return uInt64Field; +} + +float TestDefaults_get_float32Field(TestDefaults_ptr p) +{ + float float32Field; + float32Field = capn_to_f32(capn_read32(p.p, 32) ^ 0x449a5000u); + return float32Field; +} + +double TestDefaults_get_float64Field(TestDefaults_ptr p) +{ + double float64Field; + float64Field = capn_to_f64(capn_read64(p.p, 40) ^ ((uint64_t) 0xc9b58b82u << 32) ^ 0xc0e0bb00u); + return float64Field; +} + +capn_text TestDefaults_get_textField(TestDefaults_ptr p) +{ + capn_text textField; + textField = capn_get_text(p.p, 0, capn_val1); + return textField; +} + +capn_data TestDefaults_get_dataField(TestDefaults_ptr p) +{ + capn_data dataField; + dataField = capn_get_data(p.p, 1); +if (!dataField.p.type) { + dataField = capn_val2; +} + return dataField; +} + +TestAllTypes_ptr TestDefaults_get_structField(TestDefaults_ptr p) +{ + TestAllTypes_ptr structField; + structField.p = capn_getp(p.p, 2, 0); +if (!structField.p.type) { + structField = capn_val3; +} + return structField; +} + +enum TestEnum TestDefaults_get_enumField(TestDefaults_ptr p) +{ + enum TestEnum enumField; + enumField = (enum TestEnum)(int) capn_read16(p.p, 36) ^ 5u; + return enumField; +} + +capn_ptr TestDefaults_get_voidList(TestDefaults_ptr p) +{ + capn_ptr voidList; + voidList = capn_getp(p.p, 3, 0); +if (!voidList.type) { + voidList = capn_val4; +} + return voidList; +} + +capn_list1 TestDefaults_get_boolList(TestDefaults_ptr p) +{ + capn_list1 boolList; + boolList.p = capn_getp(p.p, 4, 0); +if (!boolList.p.type) { + boolList = capn_val5; +} + return boolList; +} + +capn_list8 TestDefaults_get_int8List(TestDefaults_ptr p) +{ + capn_list8 int8List; + int8List.p = capn_getp(p.p, 5, 0); +if (!int8List.p.type) { + int8List = capn_val6; +} + return int8List; +} + +capn_list16 TestDefaults_get_int16List(TestDefaults_ptr p) +{ + capn_list16 int16List; + int16List.p = capn_getp(p.p, 6, 0); +if (!int16List.p.type) { + int16List = capn_val7; +} + return int16List; +} + +capn_list32 TestDefaults_get_int32List(TestDefaults_ptr p) +{ + capn_list32 int32List; + int32List.p = capn_getp(p.p, 7, 0); +if (!int32List.p.type) { + int32List = capn_val8; +} + return int32List; +} + +capn_list64 TestDefaults_get_int64List(TestDefaults_ptr p) +{ + capn_list64 int64List; + int64List.p = capn_getp(p.p, 8, 0); +if (!int64List.p.type) { + int64List = capn_val9; +} + return int64List; +} + +capn_list8 TestDefaults_get_uInt8List(TestDefaults_ptr p) +{ + capn_list8 uInt8List; + uInt8List.p = capn_getp(p.p, 9, 0); +if (!uInt8List.p.type) { + uInt8List = capn_val10; +} + return uInt8List; +} + +capn_list16 TestDefaults_get_uInt16List(TestDefaults_ptr p) +{ + capn_list16 uInt16List; + uInt16List.p = capn_getp(p.p, 10, 0); +if (!uInt16List.p.type) { + uInt16List = capn_val11; +} + return uInt16List; +} + +capn_list32 TestDefaults_get_uInt32List(TestDefaults_ptr p) +{ + capn_list32 uInt32List; + uInt32List.p = capn_getp(p.p, 11, 0); +if (!uInt32List.p.type) { + uInt32List = capn_val12; +} + return uInt32List; +} + +capn_list64 TestDefaults_get_uInt64List(TestDefaults_ptr p) +{ + capn_list64 uInt64List; + uInt64List.p = capn_getp(p.p, 12, 0); +if (!uInt64List.p.type) { + uInt64List = capn_val13; +} + return uInt64List; +} + +capn_list32 TestDefaults_get_float32List(TestDefaults_ptr p) +{ + capn_list32 float32List; + float32List.p = capn_getp(p.p, 13, 0); +if (!float32List.p.type) { + float32List = capn_val14; +} + return float32List; +} + +capn_list64 TestDefaults_get_float64List(TestDefaults_ptr p) +{ + capn_list64 float64List; + float64List.p = capn_getp(p.p, 14, 0); +if (!float64List.p.type) { + float64List = capn_val15; +} + return float64List; +} + +capn_ptr TestDefaults_get_textList(TestDefaults_ptr p) +{ + capn_ptr textList; + textList = capn_getp(p.p, 15, 0); +if (!textList.type) { + textList = capn_val16; +} + return textList; +} + +capn_ptr TestDefaults_get_dataList(TestDefaults_ptr p) +{ + capn_ptr dataList; + dataList = capn_getp(p.p, 16, 0); +if (!dataList.type) { + dataList = capn_val17; +} + return dataList; +} + +TestAllTypes_list TestDefaults_get_structList(TestDefaults_ptr p) +{ + TestAllTypes_list structList; + structList.p = capn_getp(p.p, 17, 0); +if (!structList.p.type) { + structList = capn_val18; +} + return structList; +} + +capn_list16 TestDefaults_get_enumList(TestDefaults_ptr p) +{ + capn_list16 enumList; + enumList.p = capn_getp(p.p, 18, 0); +if (!enumList.p.type) { + enumList = capn_val19; +} + return enumList; +} + +capn_ptr TestDefaults_get_interfaceList(TestDefaults_ptr p) +{ + capn_ptr interfaceList; + interfaceList = capn_getp(p.p, 19, 0); + return interfaceList; +} + +void TestDefaults_set_boolField(TestDefaults_ptr p, unsigned boolField) +{ + capn_write1(p.p, 0, boolField != 1); +} + +void TestDefaults_set_int8Field(TestDefaults_ptr p, int8_t int8Field) +{ + capn_write8(p.p, 1, (uint8_t) (int8Field ^ -123)); +} + +void TestDefaults_set_int16Field(TestDefaults_ptr p, int16_t int16Field) +{ + capn_write16(p.p, 2, (uint16_t) (int16Field ^ -12345)); +} + +void TestDefaults_set_int32Field(TestDefaults_ptr p, int32_t int32Field) +{ + capn_write32(p.p, 4, (uint32_t) (int32Field ^ -12345678)); +} + +void TestDefaults_set_int64Field(TestDefaults_ptr p, int64_t int64Field) +{ + capn_write64(p.p, 8, (uint64_t) (int64Field ^ ((int64_t)((uint64_t) 0xffff8fb7u << 32) ^ 0x79f22087u))); +} + +void TestDefaults_set_uInt8Field(TestDefaults_ptr p, uint8_t uInt8Field) +{ + capn_write8(p.p, 16, uInt8Field ^ 234u); +} + +void TestDefaults_set_uInt16Field(TestDefaults_ptr p, uint16_t uInt16Field) +{ + capn_write16(p.p, 18, uInt16Field ^ 45678u); +} + +void TestDefaults_set_uInt32Field(TestDefaults_ptr p, uint32_t uInt32Field) +{ + capn_write32(p.p, 20, uInt32Field ^ 3456789012u); +} + +void TestDefaults_set_uInt64Field(TestDefaults_ptr p, uint64_t uInt64Field) +{ + capn_write64(p.p, 24, uInt64Field ^ ((uint64_t) 0xab54a98cu << 32) ^ 0xeb1f0ad2u); +} + +void TestDefaults_set_float32Field(TestDefaults_ptr p, float float32Field) +{ + capn_write32(p.p, 32, capn_from_f32(float32Field) ^ 0x449a5000u); +} + +void TestDefaults_set_float64Field(TestDefaults_ptr p, double float64Field) +{ + capn_write64(p.p, 40, capn_from_f64(float64Field) ^ ((uint64_t) 0xc9b58b82u << 32) ^ 0xc0e0bb00u); +} + +void TestDefaults_set_textField(TestDefaults_ptr p, capn_text textField) +{ + capn_set_text(p.p, 0, (textField.str != capn_val1.str) ? textField : capn_val0); +} + +void TestDefaults_set_dataField(TestDefaults_ptr p, capn_data dataField) +{ + capn_setp(p.p, 1, (dataField.p.data != capn_val2.p.data) ? dataField.p : capn_null); +} + +void TestDefaults_set_structField(TestDefaults_ptr p, TestAllTypes_ptr structField) +{ + capn_setp(p.p, 2, (structField.p.data != capn_val3.p.data) ? structField.p : capn_null); +} + +void TestDefaults_set_enumField(TestDefaults_ptr p, enum TestEnum enumField) +{ + capn_write16(p.p, 36, (uint16_t) (enumField ^ 5u)); +} + +void TestDefaults_set_voidList(TestDefaults_ptr p, capn_ptr voidList) +{ + capn_setp(p.p, 3, (voidList.data != capn_val4.data) ? voidList : capn_null); +} + +void TestDefaults_set_boolList(TestDefaults_ptr p, capn_list1 boolList) +{ + capn_setp(p.p, 4, (boolList.p.data != capn_val5.p.data) ? boolList.p : capn_null); +} + +void TestDefaults_set_int8List(TestDefaults_ptr p, capn_list8 int8List) +{ + capn_setp(p.p, 5, (int8List.p.data != capn_val6.p.data) ? int8List.p : capn_null); +} + +void TestDefaults_set_int16List(TestDefaults_ptr p, capn_list16 int16List) +{ + capn_setp(p.p, 6, (int16List.p.data != capn_val7.p.data) ? int16List.p : capn_null); +} + +void TestDefaults_set_int32List(TestDefaults_ptr p, capn_list32 int32List) +{ + capn_setp(p.p, 7, (int32List.p.data != capn_val8.p.data) ? int32List.p : capn_null); +} + +void TestDefaults_set_int64List(TestDefaults_ptr p, capn_list64 int64List) +{ + capn_setp(p.p, 8, (int64List.p.data != capn_val9.p.data) ? int64List.p : capn_null); +} + +void TestDefaults_set_uInt8List(TestDefaults_ptr p, capn_list8 uInt8List) +{ + capn_setp(p.p, 9, (uInt8List.p.data != capn_val10.p.data) ? uInt8List.p : capn_null); +} + +void TestDefaults_set_uInt16List(TestDefaults_ptr p, capn_list16 uInt16List) +{ + capn_setp(p.p, 10, (uInt16List.p.data != capn_val11.p.data) ? uInt16List.p : capn_null); +} + +void TestDefaults_set_uInt32List(TestDefaults_ptr p, capn_list32 uInt32List) +{ + capn_setp(p.p, 11, (uInt32List.p.data != capn_val12.p.data) ? uInt32List.p : capn_null); +} + +void TestDefaults_set_uInt64List(TestDefaults_ptr p, capn_list64 uInt64List) +{ + capn_setp(p.p, 12, (uInt64List.p.data != capn_val13.p.data) ? uInt64List.p : capn_null); +} + +void TestDefaults_set_float32List(TestDefaults_ptr p, capn_list32 float32List) +{ + capn_setp(p.p, 13, (float32List.p.data != capn_val14.p.data) ? float32List.p : capn_null); +} + +void TestDefaults_set_float64List(TestDefaults_ptr p, capn_list64 float64List) +{ + capn_setp(p.p, 14, (float64List.p.data != capn_val15.p.data) ? float64List.p : capn_null); +} + +void TestDefaults_set_textList(TestDefaults_ptr p, capn_ptr textList) +{ + capn_setp(p.p, 15, (textList.data != capn_val16.data) ? textList : capn_null); +} + +void TestDefaults_set_dataList(TestDefaults_ptr p, capn_ptr dataList) +{ + capn_setp(p.p, 16, (dataList.data != capn_val17.data) ? dataList : capn_null); +} + +void TestDefaults_set_structList(TestDefaults_ptr p, TestAllTypes_list structList) +{ + capn_setp(p.p, 17, (structList.p.data != capn_val18.p.data) ? structList.p : capn_null); +} + +void TestDefaults_set_enumList(TestDefaults_ptr p, capn_list16 enumList) +{ + capn_setp(p.p, 18, (enumList.p.data != capn_val19.p.data) ? enumList.p : capn_null); +} + +void TestDefaults_set_interfaceList(TestDefaults_ptr p, capn_ptr interfaceList) +{ + capn_setp(p.p, 19, interfaceList); +} + TestAnyPointer_ptr new_TestAnyPointer(struct capn_segment *s) { TestAnyPointer_ptr p; p.p = capn_new_struct(s, 0, 1); @@ -336,6 +1159,18 @@ void set_TestAnyPointer(const struct TestAnyPointer *s, TestAnyPointer_list l, i write_TestAnyPointer(s, p); } +capn_ptr TestAnyPointer_get_anyPointerField(TestAnyPointer_ptr p) +{ + capn_ptr anyPointerField; + anyPointerField = capn_getp(p.p, 0, 0); + return anyPointerField; +} + +void TestAnyPointer_set_anyPointerField(TestAnyPointer_ptr p, capn_ptr anyPointerField) +{ + capn_setp(p.p, 0, anyPointerField); +} + TestOutOfOrder_ptr new_TestOutOfOrder(struct capn_segment *s) { TestOutOfOrder_ptr p; p.p = capn_new_struct(s, 0, 9); @@ -381,6 +1216,114 @@ void set_TestOutOfOrder(const struct TestOutOfOrder *s, TestOutOfOrder_list l, i write_TestOutOfOrder(s, p); } +capn_text TestOutOfOrder_get_foo(TestOutOfOrder_ptr p) +{ + capn_text foo; + foo = capn_get_text(p.p, 3, capn_val0); + return foo; +} + +capn_text TestOutOfOrder_get_bar(TestOutOfOrder_ptr p) +{ + capn_text bar; + bar = capn_get_text(p.p, 2, capn_val0); + return bar; +} + +capn_text TestOutOfOrder_get_baz(TestOutOfOrder_ptr p) +{ + capn_text baz; + baz = capn_get_text(p.p, 8, capn_val0); + return baz; +} + +capn_text TestOutOfOrder_get_qux(TestOutOfOrder_ptr p) +{ + capn_text qux; + qux = capn_get_text(p.p, 0, capn_val0); + return qux; +} + +capn_text TestOutOfOrder_get_quux(TestOutOfOrder_ptr p) +{ + capn_text quux; + quux = capn_get_text(p.p, 6, capn_val0); + return quux; +} + +capn_text TestOutOfOrder_get_corge(TestOutOfOrder_ptr p) +{ + capn_text corge; + corge = capn_get_text(p.p, 4, capn_val0); + return corge; +} + +capn_text TestOutOfOrder_get_grault(TestOutOfOrder_ptr p) +{ + capn_text grault; + grault = capn_get_text(p.p, 1, capn_val0); + return grault; +} + +capn_text TestOutOfOrder_get_garply(TestOutOfOrder_ptr p) +{ + capn_text garply; + garply = capn_get_text(p.p, 7, capn_val0); + return garply; +} + +capn_text TestOutOfOrder_get_waldo(TestOutOfOrder_ptr p) +{ + capn_text waldo; + waldo = capn_get_text(p.p, 5, capn_val0); + return waldo; +} + +void TestOutOfOrder_set_foo(TestOutOfOrder_ptr p, capn_text foo) +{ + capn_set_text(p.p, 3, foo); +} + +void TestOutOfOrder_set_bar(TestOutOfOrder_ptr p, capn_text bar) +{ + capn_set_text(p.p, 2, bar); +} + +void TestOutOfOrder_set_baz(TestOutOfOrder_ptr p, capn_text baz) +{ + capn_set_text(p.p, 8, baz); +} + +void TestOutOfOrder_set_qux(TestOutOfOrder_ptr p, capn_text qux) +{ + capn_set_text(p.p, 0, qux); +} + +void TestOutOfOrder_set_quux(TestOutOfOrder_ptr p, capn_text quux) +{ + capn_set_text(p.p, 6, quux); +} + +void TestOutOfOrder_set_corge(TestOutOfOrder_ptr p, capn_text corge) +{ + capn_set_text(p.p, 4, corge); +} + +void TestOutOfOrder_set_grault(TestOutOfOrder_ptr p, capn_text grault) +{ + capn_set_text(p.p, 1, grault); +} + +void TestOutOfOrder_set_garply(TestOutOfOrder_ptr p, capn_text garply) +{ + capn_set_text(p.p, 7, garply); +} + +void TestOutOfOrder_set_waldo(TestOutOfOrder_ptr p, capn_text waldo) +{ + capn_set_text(p.p, 5, waldo); +} + TestUnion_ptr new_TestUnion(struct capn_segment *s) { TestUnion_ptr p; p.p = capn_new_struct(s, 64, 2); @@ -401,19 +1344,19 @@ void read_TestUnion(struct TestUnion *s, TestUnion_ptr p) { break; case TestUnion_union0_u0f0s8: case TestUnion_union0_u0f1s8: - s->union0.u0f1s8 = (int8_t) capn_read8(p.p, 8); + s->union0.u0f1s8 = (int8_t) ((int8_t)capn_read8(p.p, 8)); break; case TestUnion_union0_u0f0s16: case TestUnion_union0_u0f1s16: - s->union0.u0f1s16 = (int16_t) capn_read16(p.p, 8); + s->union0.u0f1s16 = (int16_t) ((int16_t)capn_read16(p.p, 8)); break; case TestUnion_union0_u0f0s32: case TestUnion_union0_u0f1s32: - s->union0.u0f1s32 = (int32_t) capn_read32(p.p, 8); + s->union0.u0f1s32 = (int32_t) ((int32_t)capn_read32(p.p, 8)); break; case TestUnion_union0_u0f0s64: case TestUnion_union0_u0f1s64: - s->union0.u0f1s64 = (int64_t) capn_read64(p.p, 8); + s->union0.u0f1s64 = (int64_t) ((int64_t)(capn_read64(p.p, 8))); break; case TestUnion_union0_u0f0sp: case TestUnion_union0_u0f1sp: @@ -433,22 +1376,22 @@ void read_TestUnion(struct TestUnion *s, TestUnion_ptr p) { case TestUnion_union1_u1f0s8: case TestUnion_union1_u1f1s8: case TestUnion_union1_u1f2s8: - s->union1.u1f2s8 = (int8_t) capn_read8(p.p, 17); + s->union1.u1f2s8 = (int8_t) ((int8_t)capn_read8(p.p, 17)); break; case TestUnion_union1_u1f0s16: case TestUnion_union1_u1f1s16: case TestUnion_union1_u1f2s16: - s->union1.u1f2s16 = (int16_t) capn_read16(p.p, 18); + s->union1.u1f2s16 = (int16_t) ((int16_t)capn_read16(p.p, 18)); break; case TestUnion_union1_u1f0s32: case TestUnion_union1_u1f1s32: case TestUnion_union1_u1f2s32: - s->union1.u1f2s32 = (int32_t) capn_read32(p.p, 20); + s->union1.u1f2s32 = (int32_t) ((int32_t)capn_read32(p.p, 20)); break; case TestUnion_union1_u1f0s64: case TestUnion_union1_u1f1s64: case TestUnion_union1_u1f2s64: - s->union1.u1f2s64 = (int64_t) capn_read64(p.p, 24); + s->union1.u1f2s64 = (int64_t) ((int64_t)(capn_read64(p.p, 24))); break; case TestUnion_union1_u1f0sp: case TestUnion_union1_u1f1sp: @@ -470,16 +1413,16 @@ void read_TestUnion(struct TestUnion *s, TestUnion_ptr p) { s->union2.u2f0s1 = (capn_read8(p.p, 32) & 1) != 0; break; case TestUnion_union2_u2f0s8: - s->union2.u2f0s8 = (int8_t) capn_read8(p.p, 33); + s->union2.u2f0s8 = (int8_t) ((int8_t)capn_read8(p.p, 33)); break; case TestUnion_union2_u2f0s16: - s->union2.u2f0s16 = (int16_t) capn_read16(p.p, 36); + s->union2.u2f0s16 = (int16_t) ((int16_t)capn_read16(p.p, 36)); break; case TestUnion_union2_u2f0s32: - s->union2.u2f0s32 = (int32_t) capn_read32(p.p, 40); + s->union2.u2f0s32 = (int32_t) ((int32_t)capn_read32(p.p, 40)); break; case TestUnion_union2_u2f0s64: - s->union2.u2f0s64 = (int64_t) capn_read64(p.p, 48); + s->union2.u2f0s64 = (int64_t) ((int64_t)(capn_read64(p.p, 48))); break; default: break; @@ -490,16 +1433,16 @@ void read_TestUnion(struct TestUnion *s, TestUnion_ptr p) { s->union3.u3f0s1 = (capn_read8(p.p, 32) & 2) != 0; break; case TestUnion_union3_u3f0s8: - s->union3.u3f0s8 = (int8_t) capn_read8(p.p, 34); + s->union3.u3f0s8 = (int8_t) ((int8_t)capn_read8(p.p, 34)); break; case TestUnion_union3_u3f0s16: - s->union3.u3f0s16 = (int16_t) capn_read16(p.p, 38); + s->union3.u3f0s16 = (int16_t) ((int16_t)capn_read16(p.p, 38)); break; case TestUnion_union3_u3f0s32: - s->union3.u3f0s32 = (int32_t) capn_read32(p.p, 44); + s->union3.u3f0s32 = (int32_t) ((int32_t)capn_read32(p.p, 44)); break; case TestUnion_union3_u3f0s64: - s->union3.u3f0s64 = (int64_t) capn_read64(p.p, 56); + s->union3.u3f0s64 = (int64_t) ((int64_t)(capn_read64(p.p, 56))); break; default: break; @@ -516,19 +1459,19 @@ void write_TestUnion(const struct TestUnion *s, TestUnion_ptr p) { break; case TestUnion_union0_u0f0s8: case TestUnion_union0_u0f1s8: - capn_write8(p.p, 8, (uint8_t) s->union0.u0f1s8); + capn_write8(p.p, 8, (uint8_t) (s->union0.u0f1s8)); break; case TestUnion_union0_u0f0s16: case TestUnion_union0_u0f1s16: - capn_write16(p.p, 8, (uint16_t) s->union0.u0f1s16); + capn_write16(p.p, 8, (uint16_t) (s->union0.u0f1s16)); break; case TestUnion_union0_u0f0s32: case TestUnion_union0_u0f1s32: - capn_write32(p.p, 8, (uint32_t) s->union0.u0f1s32); + capn_write32(p.p, 8, (uint32_t) (s->union0.u0f1s32)); break; case TestUnion_union0_u0f0s64: case TestUnion_union0_u0f1s64: - capn_write64(p.p, 8, (uint64_t) s->union0.u0f1s64); + capn_write64(p.p, 8, (uint64_t) (s->union0.u0f1s64)); break; case TestUnion_union0_u0f0sp: case TestUnion_union0_u0f1sp: @@ -548,22 +1491,22 @@ void write_TestUnion(const struct TestUnion *s, TestUnion_ptr p) { case TestUnion_union1_u1f0s8: case TestUnion_union1_u1f1s8: case TestUnion_union1_u1f2s8: - capn_write8(p.p, 17, (uint8_t) s->union1.u1f2s8); + capn_write8(p.p, 17, (uint8_t) (s->union1.u1f2s8)); break; case TestUnion_union1_u1f0s16: case TestUnion_union1_u1f1s16: case TestUnion_union1_u1f2s16: - capn_write16(p.p, 18, (uint16_t) s->union1.u1f2s16); + capn_write16(p.p, 18, (uint16_t) (s->union1.u1f2s16)); break; case TestUnion_union1_u1f0s32: case TestUnion_union1_u1f1s32: case TestUnion_union1_u1f2s32: - capn_write32(p.p, 20, (uint32_t) s->union1.u1f2s32); + capn_write32(p.p, 20, (uint32_t) (s->union1.u1f2s32)); break; case TestUnion_union1_u1f0s64: case TestUnion_union1_u1f1s64: case TestUnion_union1_u1f2s64: - capn_write64(p.p, 24, (uint64_t) s->union1.u1f2s64); + capn_write64(p.p, 24, (uint64_t) (s->union1.u1f2s64)); break; case TestUnion_union1_u1f0sp: case TestUnion_union1_u1f1sp: @@ -585,16 +1528,16 @@ void write_TestUnion(const struct TestUnion *s, TestUnion_ptr p) { capn_write1(p.p, 256, s->union2.u2f0s1 != 0); break; case TestUnion_union2_u2f0s8: - capn_write8(p.p, 33, (uint8_t) s->union2.u2f0s8); + capn_write8(p.p, 33, (uint8_t) (s->union2.u2f0s8)); break; case TestUnion_union2_u2f0s16: - capn_write16(p.p, 36, (uint16_t) s->union2.u2f0s16); + capn_write16(p.p, 36, (uint16_t) (s->union2.u2f0s16)); break; case TestUnion_union2_u2f0s32: - capn_write32(p.p, 40, (uint32_t) s->union2.u2f0s32); + capn_write32(p.p, 40, (uint32_t) (s->union2.u2f0s32)); break; case TestUnion_union2_u2f0s64: - capn_write64(p.p, 48, (uint64_t) s->union2.u2f0s64); + capn_write64(p.p, 48, (uint64_t) (s->union2.u2f0s64)); break; default: break; @@ -605,16 +1548,16 @@ void write_TestUnion(const struct TestUnion *s, TestUnion_ptr p) { capn_write1(p.p, 257, s->union3.u3f0s1 != 0); break; case TestUnion_union3_u3f0s8: - capn_write8(p.p, 34, (uint8_t) s->union3.u3f0s8); + capn_write8(p.p, 34, (uint8_t) (s->union3.u3f0s8)); break; case TestUnion_union3_u3f0s16: - capn_write16(p.p, 38, (uint16_t) s->union3.u3f0s16); + capn_write16(p.p, 38, (uint16_t) (s->union3.u3f0s16)); break; case TestUnion_union3_u3f0s32: - capn_write32(p.p, 44, (uint32_t) s->union3.u3f0s32); + capn_write32(p.p, 44, (uint32_t) (s->union3.u3f0s32)); break; case TestUnion_union3_u3f0s64: - capn_write64(p.p, 56, (uint64_t) s->union3.u3f0s64); + capn_write64(p.p, 56, (uint64_t) (s->union3.u3f0s64)); break; default: break; @@ -632,6 +1575,102 @@ void set_TestUnion(const struct TestUnion *s, TestUnion_list l, int i) { write_TestUnion(s, p); } +unsigned TestUnion_get_bit0(TestUnion_ptr p) +{ + unsigned bit0; + bit0 = (capn_read8(p.p, 16) & 1) != 0; + return bit0; +} + +unsigned TestUnion_get_bit2(TestUnion_ptr p) +{ + unsigned bit2; + bit2 = (capn_read8(p.p, 16) & 4) != 0; + return bit2; +} + +unsigned TestUnion_get_bit3(TestUnion_ptr p) +{ + unsigned bit3; + bit3 = (capn_read8(p.p, 16) & 8) != 0; + return bit3; +} + +unsigned TestUnion_get_bit4(TestUnion_ptr p) +{ + unsigned bit4; + bit4 = (capn_read8(p.p, 16) & 16) != 0; + return bit4; +} + +unsigned TestUnion_get_bit5(TestUnion_ptr p) +{ + unsigned bit5; + bit5 = (capn_read8(p.p, 16) & 32) != 0; + return bit5; +} + +unsigned TestUnion_get_bit6(TestUnion_ptr p) +{ + unsigned bit6; + bit6 = (capn_read8(p.p, 16) & 64) != 0; + return bit6; +} + +unsigned TestUnion_get_bit7(TestUnion_ptr p) +{ + unsigned bit7; + bit7 = (capn_read8(p.p, 16) & 128) != 0; + return bit7; +} + +uint8_t TestUnion_get_byte0(TestUnion_ptr p) +{ + uint8_t byte0; + byte0 = capn_read8(p.p, 35); + return byte0; +} + +void TestUnion_set_bit0(TestUnion_ptr p, unsigned bit0) +{ + capn_write1(p.p, 128, bit0 != 0); +} + +void TestUnion_set_bit2(TestUnion_ptr p, unsigned bit2) +{ + capn_write1(p.p, 130, bit2 != 0); +} + +void TestUnion_set_bit3(TestUnion_ptr p, unsigned bit3) +{ + capn_write1(p.p, 131, bit3 != 0); +} + +void TestUnion_set_bit4(TestUnion_ptr p, unsigned bit4) +{ + capn_write1(p.p, 132, bit4 != 0); +} + +void TestUnion_set_bit5(TestUnion_ptr p, unsigned bit5) +{ + capn_write1(p.p, 133, bit5 != 0); +} + +void TestUnion_set_bit6(TestUnion_ptr p, unsigned bit6) +{ + capn_write1(p.p, 134, bit6 != 0); +} + +void TestUnion_set_bit7(TestUnion_ptr p, unsigned bit7) +{ + capn_write1(p.p, 135, bit7 != 0); +} + +void TestUnion_set_byte0(TestUnion_ptr p, uint8_t byte0) +{ + capn_write8(p.p, 35, byte0); +} + TestUnnamedUnion_ptr new_TestUnnamedUnion(struct capn_segment *s) { TestUnnamedUnion_ptr p; p.p = capn_new_struct(s, 16, 2); @@ -687,6 +1726,18 @@ void set_TestUnnamedUnion(const struct TestUnnamedUnion *s, TestUnnamedUnion_lis write_TestUnnamedUnion(s, p); } +capn_text TestUnnamedUnion_get_before(TestUnnamedUnion_ptr p) +{ + capn_text before; + before = capn_get_text(p.p, 0, capn_val0); + return before; +} + +void TestUnnamedUnion_set_before(TestUnnamedUnion_ptr p, capn_text before) +{ + capn_set_text(p.p, 0, before); +} + TestUnionInUnion_ptr new_TestUnionInUnion(struct capn_segment *s) { TestUnionInUnion_ptr p; p.p = capn_new_struct(s, 16, 0); @@ -702,14 +1753,14 @@ void read_TestUnionInUnion(struct TestUnionInUnion *s, TestUnionInUnion_ptr p) { s->outer_which = (enum TestUnionInUnion_outer_which)(int) capn_read16(p.p, 8); switch (s->outer_which) { case TestUnionInUnion_outer_baz: - s->outer.baz = (int32_t) capn_read32(p.p, 0); + s->outer.baz = (int32_t) ((int32_t)capn_read32(p.p, 0)); break; case TestUnionInUnion_outer_inner: s->outer.inner_which = (enum TestUnionInUnion_outer_inner_which)(int) capn_read16(p.p, 4); switch (s->outer.inner_which) { case TestUnionInUnion_outer_inner_foo: case TestUnionInUnion_outer_inner_bar: - s->outer.inner.bar = (int32_t) capn_read32(p.p, 0); + s->outer.inner.bar = (int32_t) ((int32_t)capn_read32(p.p, 0)); break; default: break; @@ -724,14 +1775,14 @@ void write_TestUnionInUnion(const struct TestUnionInUnion *s, TestUnionInUnion_p capn_write16(p.p, 8, s->outer_which); switch (s->outer_which) { case TestUnionInUnion_outer_baz: - capn_write32(p.p, 0, (uint32_t) s->outer.baz); + capn_write32(p.p, 0, (uint32_t) (s->outer.baz)); break; case TestUnionInUnion_outer_inner: capn_write16(p.p, 4, s->outer.inner_which); switch (s->outer.inner_which) { case TestUnionInUnion_outer_inner_foo: case TestUnionInUnion_outer_inner_bar: - capn_write32(p.p, 0, (uint32_t) s->outer.inner.bar); + capn_write32(p.p, 0, (uint32_t) (s->outer.inner.bar)); break; default: break; @@ -767,17 +1818,17 @@ void read_TestGroups(struct TestGroups *s, TestGroups_ptr p) { s->groups_which = (enum TestGroups_groups_which)(int) capn_read16(p.p, 4); switch (s->groups_which) { case TestGroups_groups_foo: - s->groups.foo.corge = (int32_t) capn_read32(p.p, 0); - s->groups.foo.grault = (int64_t) capn_read64(p.p, 8); + s->groups.foo.corge = (int32_t) ((int32_t)capn_read32(p.p, 0)); + s->groups.foo.grault = (int64_t) ((int64_t)(capn_read64(p.p, 8))); s->groups.foo.garply = capn_get_text(p.p, 0, capn_val0); break; case TestGroups_groups_bar: - s->groups.bar.corge = (int32_t) capn_read32(p.p, 0); + s->groups.bar.corge = (int32_t) ((int32_t)capn_read32(p.p, 0)); s->groups.bar.grault = capn_get_text(p.p, 0, capn_val0); - s->groups.bar.garply = (int64_t) capn_read64(p.p, 8); + s->groups.bar.garply = (int64_t) ((int64_t)(capn_read64(p.p, 8))); break; case TestGroups_groups_baz: - s->groups.baz.corge = (int32_t) capn_read32(p.p, 0); + s->groups.baz.corge = (int32_t) ((int32_t)capn_read32(p.p, 0)); s->groups.baz.grault = capn_get_text(p.p, 0, capn_val0); s->groups.baz.garply = capn_get_text(p.p, 1, capn_val0); break; @@ -790,17 +1841,17 @@ void write_TestGroups(const struct TestGroups *s, TestGroups_ptr p) { capn_write16(p.p, 4, s->groups_which); switch (s->groups_which) { case TestGroups_groups_foo: - capn_write32(p.p, 0, (uint32_t) s->groups.foo.corge); - capn_write64(p.p, 8, (uint64_t) s->groups.foo.grault); + capn_write32(p.p, 0, (uint32_t) (s->groups.foo.corge)); + capn_write64(p.p, 8, (uint64_t) (s->groups.foo.grault)); capn_set_text(p.p, 0, s->groups.foo.garply); break; case TestGroups_groups_bar: - capn_write32(p.p, 0, (uint32_t) s->groups.bar.corge); + capn_write32(p.p, 0, (uint32_t) (s->groups.bar.corge)); capn_set_text(p.p, 0, s->groups.bar.grault); - capn_write64(p.p, 8, (uint64_t) s->groups.bar.garply); + capn_write64(p.p, 8, (uint64_t) (s->groups.bar.garply)); break; case TestGroups_groups_baz: - capn_write32(p.p, 0, (uint32_t) s->groups.baz.corge); + capn_write32(p.p, 0, (uint32_t) (s->groups.baz.corge)); capn_set_text(p.p, 0, s->groups.baz.grault); capn_set_text(p.p, 1, s->groups.baz.garply); break; @@ -925,10 +1976,10 @@ void set_TestInterleavedGroups(const struct TestInterleavedGroups *s, TestInterl p.p = capn_getp(l.p, i, 0); write_TestInterleavedGroups(s, p); } -TestUnion_ptr capn_val20 = {{1,1,0,0,64,2,0,(char*)&capn_buf[3544],(struct capn_segment*)&capn_seg}}; -TestUnion_ptr capn_val21 = {{1,1,0,0,64,2,0,(char*)&capn_buf[3632],(struct capn_segment*)&capn_seg}}; -TestUnnamedUnion_ptr capn_val22 = {{1,1,0,0,16,2,0,(char*)&capn_buf[3728],(struct capn_segment*)&capn_seg}}; -TestUnnamedUnion_ptr capn_val23 = {{1,1,0,0,16,2,0,(char*)&capn_buf[3768],(struct capn_segment*)&capn_seg}}; +TestUnion_ptr capn_val20 = {{1,1,0,0,64,2,0,(char*)&capn_buf[3512],(struct capn_segment*)&capn_seg}}; +TestUnion_ptr capn_val21 = {{1,1,0,0,64,2,0,(char*)&capn_buf[3600],(struct capn_segment*)&capn_seg}}; +TestUnnamedUnion_ptr capn_val22 = {{1,1,0,0,16,2,0,(char*)&capn_buf[3696],(struct capn_segment*)&capn_seg}}; +TestUnnamedUnion_ptr capn_val23 = {{1,1,0,0,16,2,0,(char*)&capn_buf[3736],(struct capn_segment*)&capn_seg}}; TestUnionDefaults_ptr new_TestUnionDefaults(struct capn_segment *s) { TestUnionDefaults_ptr p; @@ -977,6 +2028,66 @@ void set_TestUnionDefaults(const struct TestUnionDefaults *s, TestUnionDefaults_ write_TestUnionDefaults(s, p); } +TestUnion_ptr TestUnionDefaults_get_s16s8s64s8Set(TestUnionDefaults_ptr p) +{ + TestUnion_ptr s16s8s64s8Set; + s16s8s64s8Set.p = capn_getp(p.p, 0, 0); +if (!s16s8s64s8Set.p.type) { + s16s8s64s8Set = capn_val20; +} + return s16s8s64s8Set; +} + +TestUnion_ptr TestUnionDefaults_get_s0sps1s32Set(TestUnionDefaults_ptr p) +{ + TestUnion_ptr s0sps1s32Set; + s0sps1s32Set.p = capn_getp(p.p, 1, 0); +if (!s0sps1s32Set.p.type) { + s0sps1s32Set = capn_val21; +} + return s0sps1s32Set; +} + +TestUnnamedUnion_ptr TestUnionDefaults_get_unnamed1(TestUnionDefaults_ptr p) +{ + TestUnnamedUnion_ptr unnamed1; + unnamed1.p = capn_getp(p.p, 2, 0); +if (!unnamed1.p.type) { + unnamed1 = capn_val22; +} + return unnamed1; +} + +TestUnnamedUnion_ptr TestUnionDefaults_get_unnamed2(TestUnionDefaults_ptr p) +{ + TestUnnamedUnion_ptr unnamed2; + unnamed2.p = capn_getp(p.p, 3, 0); +if (!unnamed2.p.type) { + unnamed2 = capn_val23; +} + return unnamed2; +} + +void TestUnionDefaults_set_s16s8s64s8Set(TestUnionDefaults_ptr p, TestUnion_ptr s16s8s64s8Set) +{ + capn_setp(p.p, 0, (s16s8s64s8Set.p.data != capn_val20.p.data) ? s16s8s64s8Set.p : capn_null); +} + +void TestUnionDefaults_set_s0sps1s32Set(TestUnionDefaults_ptr p, TestUnion_ptr s0sps1s32Set) +{ + capn_setp(p.p, 1, (s0sps1s32Set.p.data != capn_val21.p.data) ? s0sps1s32Set.p : capn_null); +} + +void TestUnionDefaults_set_unnamed1(TestUnionDefaults_ptr p, TestUnnamedUnion_ptr unnamed1) +{ + capn_setp(p.p, 2, (unnamed1.p.data != capn_val22.p.data) ? unnamed1.p : capn_null); +} + +void TestUnionDefaults_set_unnamed2(TestUnionDefaults_ptr p, TestUnnamedUnion_ptr unnamed2) +{ + capn_setp(p.p, 3, (unnamed2.p.data != capn_val23.p.data) ? unnamed2.p : capn_null); +} + TestNestedTypes_ptr new_TestNestedTypes(struct capn_segment *s) { TestNestedTypes_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -996,8 +2107,8 @@ void read_TestNestedTypes(struct TestNestedTypes *s, TestNestedTypes_ptr p) { void write_TestNestedTypes(const struct TestNestedTypes *s, TestNestedTypes_ptr p) { capn_resolve(&p.p); capn_setp(p.p, 0, s->nestedStruct.p); - capn_write16(p.p, 0, (uint16_t) s->outerNestedEnum ^ 1u); - capn_write16(p.p, 2, (uint16_t) s->innerNestedEnum ^ 2u); + capn_write16(p.p, 0, (uint16_t) (s->outerNestedEnum ^ 1u)); + capn_write16(p.p, 2, (uint16_t) (s->innerNestedEnum ^ 2u)); } void get_TestNestedTypes(struct TestNestedTypes *s, TestNestedTypes_list l, int i) { TestNestedTypes_ptr p; @@ -1010,6 +2121,42 @@ void set_TestNestedTypes(const struct TestNestedTypes *s, TestNestedTypes_list l write_TestNestedTypes(s, p); } +TestNestedTypes_NestedStruct_ptr TestNestedTypes_get_nestedStruct(TestNestedTypes_ptr p) +{ + TestNestedTypes_NestedStruct_ptr nestedStruct; + nestedStruct.p = capn_getp(p.p, 0, 0); + return nestedStruct; +} + +enum TestNestedTypes_NestedEnum TestNestedTypes_get_outerNestedEnum(TestNestedTypes_ptr p) +{ + enum TestNestedTypes_NestedEnum outerNestedEnum; + outerNestedEnum = (enum TestNestedTypes_NestedEnum)(int) capn_read16(p.p, 0) ^ 1u; + return outerNestedEnum; +} + +enum TestNestedTypes_NestedStruct_NestedEnum TestNestedTypes_get_innerNestedEnum(TestNestedTypes_ptr p) +{ + enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum; + innerNestedEnum = (enum TestNestedTypes_NestedStruct_NestedEnum)(int) capn_read16(p.p, 2) ^ 2u; + return innerNestedEnum; +} + +void TestNestedTypes_set_nestedStruct(TestNestedTypes_ptr p, TestNestedTypes_NestedStruct_ptr nestedStruct) +{ + capn_setp(p.p, 0, nestedStruct.p); +} + +void TestNestedTypes_set_outerNestedEnum(TestNestedTypes_ptr p, enum TestNestedTypes_NestedEnum outerNestedEnum) +{ + capn_write16(p.p, 0, (uint16_t) (outerNestedEnum ^ 1u)); +} + +void TestNestedTypes_set_innerNestedEnum(TestNestedTypes_ptr p, enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum) +{ + capn_write16(p.p, 2, (uint16_t) (innerNestedEnum ^ 2u)); +} + TestNestedTypes_NestedStruct_ptr new_TestNestedTypes_NestedStruct(struct capn_segment *s) { TestNestedTypes_NestedStruct_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1027,8 +2174,8 @@ void read_TestNestedTypes_NestedStruct(struct TestNestedTypes_NestedStruct *s, T } void write_TestNestedTypes_NestedStruct(const struct TestNestedTypes_NestedStruct *s, TestNestedTypes_NestedStruct_ptr p) { capn_resolve(&p.p); - capn_write16(p.p, 0, (uint16_t) s->outerNestedEnum ^ 1u); - capn_write16(p.p, 2, (uint16_t) s->innerNestedEnum ^ 2u); + capn_write16(p.p, 0, (uint16_t) (s->outerNestedEnum ^ 1u)); + capn_write16(p.p, 2, (uint16_t) (s->innerNestedEnum ^ 2u)); } void get_TestNestedTypes_NestedStruct(struct TestNestedTypes_NestedStruct *s, TestNestedTypes_NestedStruct_list l, int i) { TestNestedTypes_NestedStruct_ptr p; @@ -1041,6 +2188,30 @@ void set_TestNestedTypes_NestedStruct(const struct TestNestedTypes_NestedStruct write_TestNestedTypes_NestedStruct(s, p); } +enum TestNestedTypes_NestedEnum TestNestedTypes_NestedStruct_get_outerNestedEnum(TestNestedTypes_NestedStruct_ptr p) +{ + enum TestNestedTypes_NestedEnum outerNestedEnum; + outerNestedEnum = (enum TestNestedTypes_NestedEnum)(int) capn_read16(p.p, 0) ^ 1u; + return outerNestedEnum; +} + +enum TestNestedTypes_NestedStruct_NestedEnum TestNestedTypes_NestedStruct_get_innerNestedEnum(TestNestedTypes_NestedStruct_ptr p) +{ + enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum; + innerNestedEnum = (enum TestNestedTypes_NestedStruct_NestedEnum)(int) capn_read16(p.p, 2) ^ 2u; + return innerNestedEnum; +} + +void TestNestedTypes_NestedStruct_set_outerNestedEnum(TestNestedTypes_NestedStruct_ptr p, enum TestNestedTypes_NestedEnum outerNestedEnum) +{ + capn_write16(p.p, 0, (uint16_t) (outerNestedEnum ^ 1u)); +} + +void TestNestedTypes_NestedStruct_set_innerNestedEnum(TestNestedTypes_NestedStruct_ptr p, enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum) +{ + capn_write16(p.p, 2, (uint16_t) (innerNestedEnum ^ 2u)); +} + TestUsing_ptr new_TestUsing(struct capn_segment *s) { TestUsing_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1058,8 +2229,8 @@ void read_TestUsing(struct TestUsing *s, TestUsing_ptr p) { } void write_TestUsing(const struct TestUsing *s, TestUsing_ptr p) { capn_resolve(&p.p); - capn_write16(p.p, 2, (uint16_t) s->outerNestedEnum ^ 1u); - capn_write16(p.p, 0, (uint16_t) s->innerNestedEnum ^ 2u); + capn_write16(p.p, 2, (uint16_t) (s->outerNestedEnum ^ 1u)); + capn_write16(p.p, 0, (uint16_t) (s->innerNestedEnum ^ 2u)); } void get_TestUsing(struct TestUsing *s, TestUsing_list l, int i) { TestUsing_ptr p; @@ -1072,6 +2243,30 @@ void set_TestUsing(const struct TestUsing *s, TestUsing_list l, int i) { write_TestUsing(s, p); } +enum TestNestedTypes_NestedEnum TestUsing_get_outerNestedEnum(TestUsing_ptr p) +{ + enum TestNestedTypes_NestedEnum outerNestedEnum; + outerNestedEnum = (enum TestNestedTypes_NestedEnum)(int) capn_read16(p.p, 2) ^ 1u; + return outerNestedEnum; +} + +enum TestNestedTypes_NestedStruct_NestedEnum TestUsing_get_innerNestedEnum(TestUsing_ptr p) +{ + enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum; + innerNestedEnum = (enum TestNestedTypes_NestedStruct_NestedEnum)(int) capn_read16(p.p, 0) ^ 2u; + return innerNestedEnum; +} + +void TestUsing_set_outerNestedEnum(TestUsing_ptr p, enum TestNestedTypes_NestedEnum outerNestedEnum) +{ + capn_write16(p.p, 2, (uint16_t) (outerNestedEnum ^ 1u)); +} + +void TestUsing_set_innerNestedEnum(TestUsing_ptr p, enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum) +{ + capn_write16(p.p, 0, (uint16_t) (innerNestedEnum ^ 2u)); +} + TestLists_ptr new_TestLists(struct capn_segment *s) { TestLists_ptr p; p.p = capn_new_struct(s, 0, 10); @@ -1119,6 +2314,126 @@ void set_TestLists(const struct TestLists *s, TestLists_list l, int i) { write_TestLists(s, p); } +TestLists_Struct0_list TestLists_get_list0(TestLists_ptr p) +{ + TestLists_Struct0_list list0; + list0.p = capn_getp(p.p, 0, 0); + return list0; +} + +TestLists_Struct1_list TestLists_get_list1(TestLists_ptr p) +{ + TestLists_Struct1_list list1; + list1.p = capn_getp(p.p, 1, 0); + return list1; +} + +TestLists_Struct8_list TestLists_get_list8(TestLists_ptr p) +{ + TestLists_Struct8_list list8; + list8.p = capn_getp(p.p, 2, 0); + return list8; +} + +TestLists_Struct16_list TestLists_get_list16(TestLists_ptr p) +{ + TestLists_Struct16_list list16; + list16.p = capn_getp(p.p, 3, 0); + return list16; +} + +TestLists_Struct32_list TestLists_get_list32(TestLists_ptr p) +{ + TestLists_Struct32_list list32; + list32.p = capn_getp(p.p, 4, 0); + return list32; +} + +TestLists_Struct64_list TestLists_get_list64(TestLists_ptr p) +{ + TestLists_Struct64_list list64; + list64.p = capn_getp(p.p, 5, 0); + return list64; +} + +TestLists_StructP_list TestLists_get_listP(TestLists_ptr p) +{ + TestLists_StructP_list listP; + listP.p = capn_getp(p.p, 6, 0); + return listP; +} + +capn_ptr TestLists_get_int32ListList(TestLists_ptr p) +{ + capn_ptr int32ListList; + int32ListList = capn_getp(p.p, 7, 0); + return int32ListList; +} + +capn_ptr TestLists_get_textListList(TestLists_ptr p) +{ + capn_ptr textListList; + textListList = capn_getp(p.p, 8, 0); + return textListList; +} + +capn_ptr TestLists_get_structListList(TestLists_ptr p) +{ + capn_ptr structListList; + structListList = capn_getp(p.p, 9, 0); + return structListList; +} + +void TestLists_set_list0(TestLists_ptr p, TestLists_Struct0_list list0) +{ + capn_setp(p.p, 0, list0.p); +} + +void TestLists_set_list1(TestLists_ptr p, TestLists_Struct1_list list1) +{ + capn_setp(p.p, 1, list1.p); +} + +void TestLists_set_list8(TestLists_ptr p, TestLists_Struct8_list list8) +{ + capn_setp(p.p, 2, list8.p); +} + +void TestLists_set_list16(TestLists_ptr p, TestLists_Struct16_list list16) +{ + capn_setp(p.p, 3, list16.p); +} + +void TestLists_set_list32(TestLists_ptr p, TestLists_Struct32_list list32) +{ + capn_setp(p.p, 4, list32.p); +} + +void TestLists_set_list64(TestLists_ptr p, TestLists_Struct64_list list64) +{ + capn_setp(p.p, 5, list64.p); +} + +void TestLists_set_listP(TestLists_ptr p, TestLists_StructP_list listP) +{ + capn_setp(p.p, 6, listP.p); +} + +void TestLists_set_int32ListList(TestLists_ptr p, capn_ptr int32ListList) +{ + capn_setp(p.p, 7, int32ListList); +} + +void TestLists_set_textListList(TestLists_ptr p, capn_ptr textListList) +{ + capn_setp(p.p, 8, textListList); +} + +void TestLists_set_structListList(TestLists_ptr p, capn_ptr structListList) +{ + capn_setp(p.p, 9, structListList); +} + TestLists_Struct0_ptr new_TestLists_Struct0(struct capn_segment *s) { TestLists_Struct0_ptr p; p.p = capn_new_struct(s, 0, 0); @@ -1175,6 +2490,18 @@ void set_TestLists_Struct1(const struct TestLists_Struct1 *s, TestLists_Struct1_ write_TestLists_Struct1(s, p); } +unsigned TestLists_Struct1_get_f(TestLists_Struct1_ptr p) +{ + unsigned f; + f = (capn_read8(p.p, 0) & 1) != 0; + return f; +} + +void TestLists_Struct1_set_f(TestLists_Struct1_ptr p, unsigned f) +{ + capn_write1(p.p, 0, f != 0); +} + TestLists_Struct8_ptr new_TestLists_Struct8(struct capn_segment *s) { TestLists_Struct8_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1204,6 +2531,18 @@ void set_TestLists_Struct8(const struct TestLists_Struct8 *s, TestLists_Struct8_ write_TestLists_Struct8(s, p); } +uint8_t TestLists_Struct8_get_f(TestLists_Struct8_ptr p) +{ + uint8_t f; + f = capn_read8(p.p, 0); + return f; +} + +void TestLists_Struct8_set_f(TestLists_Struct8_ptr p, uint8_t f) +{ + capn_write8(p.p, 0, f); +} + TestLists_Struct16_ptr new_TestLists_Struct16(struct capn_segment *s) { TestLists_Struct16_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1233,6 +2572,18 @@ void set_TestLists_Struct16(const struct TestLists_Struct16 *s, TestLists_Struct write_TestLists_Struct16(s, p); } +uint16_t TestLists_Struct16_get_f(TestLists_Struct16_ptr p) +{ + uint16_t f; + f = capn_read16(p.p, 0); + return f; +} + +void TestLists_Struct16_set_f(TestLists_Struct16_ptr p, uint16_t f) +{ + capn_write16(p.p, 0, f); +} + TestLists_Struct32_ptr new_TestLists_Struct32(struct capn_segment *s) { TestLists_Struct32_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1262,6 +2613,18 @@ void set_TestLists_Struct32(const struct TestLists_Struct32 *s, TestLists_Struct write_TestLists_Struct32(s, p); } +uint32_t TestLists_Struct32_get_f(TestLists_Struct32_ptr p) +{ + uint32_t f; + f = capn_read32(p.p, 0); + return f; +} + +void TestLists_Struct32_set_f(TestLists_Struct32_ptr p, uint32_t f) +{ + capn_write32(p.p, 0, f); +} + TestLists_Struct64_ptr new_TestLists_Struct64(struct capn_segment *s) { TestLists_Struct64_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1291,6 +2654,18 @@ void set_TestLists_Struct64(const struct TestLists_Struct64 *s, TestLists_Struct write_TestLists_Struct64(s, p); } +uint64_t TestLists_Struct64_get_f(TestLists_Struct64_ptr p) +{ + uint64_t f; + f = capn_read64(p.p, 0); + return f; +} + +void TestLists_Struct64_set_f(TestLists_Struct64_ptr p, uint64_t f) +{ + capn_write64(p.p, 0, f); +} + TestLists_StructP_ptr new_TestLists_StructP(struct capn_segment *s) { TestLists_StructP_ptr p; p.p = capn_new_struct(s, 0, 1); @@ -1320,6 +2695,18 @@ void set_TestLists_StructP(const struct TestLists_StructP *s, TestLists_StructP_ write_TestLists_StructP(s, p); } +capn_text TestLists_StructP_get_f(TestLists_StructP_ptr p) +{ + capn_text f; + f = capn_get_text(p.p, 0, capn_val0); + return f; +} + +void TestLists_StructP_set_f(TestLists_StructP_ptr p, capn_text f) +{ + capn_set_text(p.p, 0, f); +} + TestLists_Struct0c_ptr new_TestLists_Struct0c(struct capn_segment *s) { TestLists_Struct0c_ptr p; p.p = capn_new_struct(s, 0, 1); @@ -1349,6 +2736,18 @@ void set_TestLists_Struct0c(const struct TestLists_Struct0c *s, TestLists_Struct write_TestLists_Struct0c(s, p); } +capn_text TestLists_Struct0c_get_pad(TestLists_Struct0c_ptr p) +{ + capn_text pad; + pad = capn_get_text(p.p, 0, capn_val0); + return pad; +} + +void TestLists_Struct0c_set_pad(TestLists_Struct0c_ptr p, capn_text pad) +{ + capn_set_text(p.p, 0, pad); +} + TestLists_Struct1c_ptr new_TestLists_Struct1c(struct capn_segment *s) { TestLists_Struct1c_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1380,6 +2779,30 @@ void set_TestLists_Struct1c(const struct TestLists_Struct1c *s, TestLists_Struct write_TestLists_Struct1c(s, p); } +unsigned TestLists_Struct1c_get_f(TestLists_Struct1c_ptr p) +{ + unsigned f; + f = (capn_read8(p.p, 0) & 1) != 0; + return f; +} + +capn_text TestLists_Struct1c_get_pad(TestLists_Struct1c_ptr p) +{ + capn_text pad; + pad = capn_get_text(p.p, 0, capn_val0); + return pad; +} + +void TestLists_Struct1c_set_f(TestLists_Struct1c_ptr p, unsigned f) +{ + capn_write1(p.p, 0, f != 0); +} + +void TestLists_Struct1c_set_pad(TestLists_Struct1c_ptr p, capn_text pad) +{ + capn_set_text(p.p, 0, pad); +} + TestLists_Struct8c_ptr new_TestLists_Struct8c(struct capn_segment *s) { TestLists_Struct8c_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1411,6 +2834,30 @@ void set_TestLists_Struct8c(const struct TestLists_Struct8c *s, TestLists_Struct write_TestLists_Struct8c(s, p); } +uint8_t TestLists_Struct8c_get_f(TestLists_Struct8c_ptr p) +{ + uint8_t f; + f = capn_read8(p.p, 0); + return f; +} + +capn_text TestLists_Struct8c_get_pad(TestLists_Struct8c_ptr p) +{ + capn_text pad; + pad = capn_get_text(p.p, 0, capn_val0); + return pad; +} + +void TestLists_Struct8c_set_f(TestLists_Struct8c_ptr p, uint8_t f) +{ + capn_write8(p.p, 0, f); +} + +void TestLists_Struct8c_set_pad(TestLists_Struct8c_ptr p, capn_text pad) +{ + capn_set_text(p.p, 0, pad); +} + TestLists_Struct16c_ptr new_TestLists_Struct16c(struct capn_segment *s) { TestLists_Struct16c_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1442,6 +2889,30 @@ void set_TestLists_Struct16c(const struct TestLists_Struct16c *s, TestLists_Stru write_TestLists_Struct16c(s, p); } +uint16_t TestLists_Struct16c_get_f(TestLists_Struct16c_ptr p) +{ + uint16_t f; + f = capn_read16(p.p, 0); + return f; +} + +capn_text TestLists_Struct16c_get_pad(TestLists_Struct16c_ptr p) +{ + capn_text pad; + pad = capn_get_text(p.p, 0, capn_val0); + return pad; +} + +void TestLists_Struct16c_set_f(TestLists_Struct16c_ptr p, uint16_t f) +{ + capn_write16(p.p, 0, f); +} + +void TestLists_Struct16c_set_pad(TestLists_Struct16c_ptr p, capn_text pad) +{ + capn_set_text(p.p, 0, pad); +} + TestLists_Struct32c_ptr new_TestLists_Struct32c(struct capn_segment *s) { TestLists_Struct32c_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1473,6 +2944,30 @@ void set_TestLists_Struct32c(const struct TestLists_Struct32c *s, TestLists_Stru write_TestLists_Struct32c(s, p); } +uint32_t TestLists_Struct32c_get_f(TestLists_Struct32c_ptr p) +{ + uint32_t f; + f = capn_read32(p.p, 0); + return f; +} + +capn_text TestLists_Struct32c_get_pad(TestLists_Struct32c_ptr p) +{ + capn_text pad; + pad = capn_get_text(p.p, 0, capn_val0); + return pad; +} + +void TestLists_Struct32c_set_f(TestLists_Struct32c_ptr p, uint32_t f) +{ + capn_write32(p.p, 0, f); +} + +void TestLists_Struct32c_set_pad(TestLists_Struct32c_ptr p, capn_text pad) +{ + capn_set_text(p.p, 0, pad); +} + TestLists_Struct64c_ptr new_TestLists_Struct64c(struct capn_segment *s) { TestLists_Struct64c_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1504,6 +2999,30 @@ void set_TestLists_Struct64c(const struct TestLists_Struct64c *s, TestLists_Stru write_TestLists_Struct64c(s, p); } +uint64_t TestLists_Struct64c_get_f(TestLists_Struct64c_ptr p) +{ + uint64_t f; + f = capn_read64(p.p, 0); + return f; +} + +capn_text TestLists_Struct64c_get_pad(TestLists_Struct64c_ptr p) +{ + capn_text pad; + pad = capn_get_text(p.p, 0, capn_val0); + return pad; +} + +void TestLists_Struct64c_set_f(TestLists_Struct64c_ptr p, uint64_t f) +{ + capn_write64(p.p, 0, f); +} + +void TestLists_Struct64c_set_pad(TestLists_Struct64c_ptr p, capn_text pad) +{ + capn_set_text(p.p, 0, pad); +} + TestLists_StructPc_ptr new_TestLists_StructPc(struct capn_segment *s) { TestLists_StructPc_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1535,6 +3054,30 @@ void set_TestLists_StructPc(const struct TestLists_StructPc *s, TestLists_Struct write_TestLists_StructPc(s, p); } +capn_text TestLists_StructPc_get_f(TestLists_StructPc_ptr p) +{ + capn_text f; + f = capn_get_text(p.p, 0, capn_val0); + return f; +} + +uint64_t TestLists_StructPc_get_pad(TestLists_StructPc_ptr p) +{ + uint64_t pad; + pad = capn_read64(p.p, 0); + return pad; +} + +void TestLists_StructPc_set_f(TestLists_StructPc_ptr p, capn_text f) +{ + capn_set_text(p.p, 0, f); +} + +void TestLists_StructPc_set_pad(TestLists_StructPc_ptr p, uint64_t pad) +{ + capn_write64(p.p, 0, pad); +} + TestFieldZeroIsBit_ptr new_TestFieldZeroIsBit(struct capn_segment *s) { TestFieldZeroIsBit_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1567,7 +3110,43 @@ void set_TestFieldZeroIsBit(const struct TestFieldZeroIsBit *s, TestFieldZeroIsB p.p = capn_getp(l.p, i, 0); write_TestFieldZeroIsBit(s, p); } -TestLists_ptr capn_val24 = {{1,1,0,0,0,10,0,(char*)&capn_buf[3824],(struct capn_segment*)&capn_seg}}; + +unsigned TestFieldZeroIsBit_get_bit(TestFieldZeroIsBit_ptr p) +{ + unsigned bit; + bit = (capn_read8(p.p, 0) & 1) != 0; + return bit; +} + +unsigned TestFieldZeroIsBit_get_secondBit(TestFieldZeroIsBit_ptr p) +{ + unsigned secondBit; + secondBit = (capn_read8(p.p, 0) & 2) != 1; + return secondBit; +} + +uint8_t TestFieldZeroIsBit_get_thirdField(TestFieldZeroIsBit_ptr p) +{ + uint8_t thirdField; + thirdField = capn_read8(p.p, 1) ^ 123u; + return thirdField; +} + +void TestFieldZeroIsBit_set_bit(TestFieldZeroIsBit_ptr p, unsigned bit) +{ + capn_write1(p.p, 0, bit != 0); +} + +void TestFieldZeroIsBit_set_secondBit(TestFieldZeroIsBit_ptr p, unsigned secondBit) +{ + capn_write1(p.p, 1, secondBit != 1); +} + +void TestFieldZeroIsBit_set_thirdField(TestFieldZeroIsBit_ptr p, uint8_t thirdField) +{ + capn_write8(p.p, 1, thirdField ^ 123u); +} +TestLists_ptr capn_val24 = {{1,1,0,0,0,10,0,(char*)&capn_buf[3792],(struct capn_segment*)&capn_seg}}; TestListDefaults_ptr new_TestListDefaults(struct capn_segment *s) { TestListDefaults_ptr p; @@ -1601,6 +3180,21 @@ void set_TestListDefaults(const struct TestListDefaults *s, TestListDefaults_lis write_TestListDefaults(s, p); } +TestLists_ptr TestListDefaults_get_lists(TestListDefaults_ptr p) +{ + TestLists_ptr lists; + lists.p = capn_getp(p.p, 0, 0); +if (!lists.p.type) { + lists = capn_val24; +} + return lists; +} + +void TestListDefaults_set_lists(TestListDefaults_ptr p, TestLists_ptr lists) +{ + capn_setp(p.p, 0, (lists.p.data != capn_val24.p.data) ? lists.p : capn_null); +} + TestLateUnion_ptr new_TestLateUnion(struct capn_segment *s) { TestLateUnion_ptr p; p.p = capn_new_struct(s, 24, 3); @@ -1613,9 +3207,9 @@ TestLateUnion_list new_TestLateUnion_list(struct capn_segment *s, int len) { } void read_TestLateUnion(struct TestLateUnion *s, TestLateUnion_ptr p) { capn_resolve(&p.p); - s->foo = (int32_t) capn_read32(p.p, 0); + s->foo = (int32_t) ((int32_t)capn_read32(p.p, 0)); s->bar = capn_get_text(p.p, 0, capn_val0); - s->baz = (int16_t) capn_read16(p.p, 4); + s->baz = (int16_t) ((int16_t)capn_read16(p.p, 4)); s->theUnion_which = (enum TestLateUnion_theUnion_which)(int) capn_read16(p.p, 6); switch (s->theUnion_which) { case TestLateUnion_theUnion_grault: @@ -1647,9 +3241,9 @@ void read_TestLateUnion(struct TestLateUnion *s, TestLateUnion_ptr p) { } void write_TestLateUnion(const struct TestLateUnion *s, TestLateUnion_ptr p) { capn_resolve(&p.p); - capn_write32(p.p, 0, (uint32_t) s->foo); + capn_write32(p.p, 0, (uint32_t) (s->foo)); capn_set_text(p.p, 0, s->bar); - capn_write16(p.p, 4, (uint16_t) s->baz); + capn_write16(p.p, 4, (uint16_t) (s->baz)); capn_write16(p.p, 6, s->theUnion_which); switch (s->theUnion_which) { case TestLateUnion_theUnion_grault: @@ -1690,6 +3284,42 @@ void set_TestLateUnion(const struct TestLateUnion *s, TestLateUnion_list l, int write_TestLateUnion(s, p); } +int32_t TestLateUnion_get_foo(TestLateUnion_ptr p) +{ + int32_t foo; + foo = (int32_t) ((int32_t)capn_read32(p.p, 0)); + return foo; +} + +capn_text TestLateUnion_get_bar(TestLateUnion_ptr p) +{ + capn_text bar; + bar = capn_get_text(p.p, 0, capn_val0); + return bar; +} + +int16_t TestLateUnion_get_baz(TestLateUnion_ptr p) +{ + int16_t baz; + baz = (int16_t) ((int16_t)capn_read16(p.p, 4)); + return baz; +} + +void TestLateUnion_set_foo(TestLateUnion_ptr p, int32_t foo) +{ + capn_write32(p.p, 0, (uint32_t) (foo)); +} + +void TestLateUnion_set_bar(TestLateUnion_ptr p, capn_text bar) +{ + capn_set_text(p.p, 0, bar); +} + +void TestLateUnion_set_baz(TestLateUnion_ptr p, int16_t baz) +{ + capn_write16(p.p, 4, (uint16_t) (baz)); +} + TestOldVersion_ptr new_TestOldVersion(struct capn_segment *s) { TestOldVersion_ptr p; p.p = capn_new_struct(s, 8, 2); @@ -1702,13 +3332,13 @@ TestOldVersion_list new_TestOldVersion_list(struct capn_segment *s, int len) { } void read_TestOldVersion(struct TestOldVersion *s, TestOldVersion_ptr p) { capn_resolve(&p.p); - s->old1 = (int64_t) capn_read64(p.p, 0); + s->old1 = (int64_t) ((int64_t)(capn_read64(p.p, 0))); s->old2 = capn_get_text(p.p, 0, capn_val0); s->old3.p = capn_getp(p.p, 1, 0); } void write_TestOldVersion(const struct TestOldVersion *s, TestOldVersion_ptr p) { capn_resolve(&p.p); - capn_write64(p.p, 0, (uint64_t) s->old1); + capn_write64(p.p, 0, (uint64_t) (s->old1)); capn_set_text(p.p, 0, s->old2); capn_setp(p.p, 1, s->old3.p); } @@ -1722,7 +3352,43 @@ void set_TestOldVersion(const struct TestOldVersion *s, TestOldVersion_list l, i p.p = capn_getp(l.p, i, 0); write_TestOldVersion(s, p); } -capn_text capn_val25 = {3,(char*)&capn_buf[1576],(struct capn_segment*)&capn_seg}; + +int64_t TestOldVersion_get_old1(TestOldVersion_ptr p) +{ + int64_t old1; + old1 = (int64_t) ((int64_t)(capn_read64(p.p, 0))); + return old1; +} + +capn_text TestOldVersion_get_old2(TestOldVersion_ptr p) +{ + capn_text old2; + old2 = capn_get_text(p.p, 0, capn_val0); + return old2; +} + +TestOldVersion_ptr TestOldVersion_get_old3(TestOldVersion_ptr p) +{ + TestOldVersion_ptr old3; + old3.p = capn_getp(p.p, 1, 0); + return old3; +} + +void TestOldVersion_set_old1(TestOldVersion_ptr p, int64_t old1) +{ + capn_write64(p.p, 0, (uint64_t) (old1)); +} + +void TestOldVersion_set_old2(TestOldVersion_ptr p, capn_text old2) +{ + capn_set_text(p.p, 0, old2); +} + +void TestOldVersion_set_old3(TestOldVersion_ptr p, TestOldVersion_ptr old3) +{ + capn_setp(p.p, 1, old3.p); +} +capn_text capn_val25 = {3,(char*)&capn_buf[1544],(struct capn_segment*)&capn_seg}; TestNewVersion_ptr new_TestNewVersion(struct capn_segment *s) { TestNewVersion_ptr p; @@ -1736,18 +3402,18 @@ TestNewVersion_list new_TestNewVersion_list(struct capn_segment *s, int len) { } void read_TestNewVersion(struct TestNewVersion *s, TestNewVersion_ptr p) { capn_resolve(&p.p); - s->old1 = (int64_t) capn_read64(p.p, 0); + s->old1 = (int64_t) ((int64_t)(capn_read64(p.p, 0))); s->old2 = capn_get_text(p.p, 0, capn_val0); s->old3.p = capn_getp(p.p, 1, 0); - s->new1 = (int64_t) capn_read64(p.p, 8) ^ ((uint64_t) 0u << 32) ^ 0x3dbu; + s->new1 = (int64_t) ((int64_t)(capn_read64(p.p, 8)) ^ ((int64_t)((uint64_t) 0u << 32) ^ 0x3dbu)); s->new2 = capn_get_text(p.p, 2, capn_val25); } void write_TestNewVersion(const struct TestNewVersion *s, TestNewVersion_ptr p) { capn_resolve(&p.p); - capn_write64(p.p, 0, (uint64_t) s->old1); + capn_write64(p.p, 0, (uint64_t) (s->old1)); capn_set_text(p.p, 0, s->old2); capn_setp(p.p, 1, s->old3.p); - capn_write64(p.p, 8, (uint64_t) s->new1 ^ ((uint64_t) 0u << 32) ^ 0x3dbu); + capn_write64(p.p, 8, (uint64_t) (s->new1 ^ ((int64_t)((uint64_t) 0u << 32) ^ 0x3dbu))); capn_set_text(p.p, 2, (s->new2.str != capn_val25.str) ? s->new2 : capn_val0); } void get_TestNewVersion(struct TestNewVersion *s, TestNewVersion_list l, int i) { @@ -1761,6 +3427,66 @@ void set_TestNewVersion(const struct TestNewVersion *s, TestNewVersion_list l, i write_TestNewVersion(s, p); } +int64_t TestNewVersion_get_old1(TestNewVersion_ptr p) +{ + int64_t old1; + old1 = (int64_t) ((int64_t)(capn_read64(p.p, 0))); + return old1; +} + +capn_text TestNewVersion_get_old2(TestNewVersion_ptr p) +{ + capn_text old2; + old2 = capn_get_text(p.p, 0, capn_val0); + return old2; +} + +TestNewVersion_ptr TestNewVersion_get_old3(TestNewVersion_ptr p) +{ + TestNewVersion_ptr old3; + old3.p = capn_getp(p.p, 1, 0); + return old3; +} + +int64_t TestNewVersion_get_new1(TestNewVersion_ptr p) +{ + int64_t new1; + new1 = (int64_t) ((int64_t)(capn_read64(p.p, 8)) ^ ((int64_t)((uint64_t) 0u << 32) ^ 0x3dbu)); + return new1; +} + +capn_text TestNewVersion_get_new2(TestNewVersion_ptr p) +{ + capn_text new2; + new2 = capn_get_text(p.p, 2, capn_val25); + return new2; +} + +void TestNewVersion_set_old1(TestNewVersion_ptr p, int64_t old1) +{ + capn_write64(p.p, 0, (uint64_t) (old1)); +} + +void TestNewVersion_set_old2(TestNewVersion_ptr p, capn_text old2) +{ + capn_set_text(p.p, 0, old2); +} + +void TestNewVersion_set_old3(TestNewVersion_ptr p, TestNewVersion_ptr old3) +{ + capn_setp(p.p, 1, old3.p); +} + +void TestNewVersion_set_new1(TestNewVersion_ptr p, int64_t new1) +{ + capn_write64(p.p, 8, (uint64_t) (new1 ^ ((int64_t)((uint64_t) 0u << 32) ^ 0x3dbu))); +} + +void TestNewVersion_set_new2(TestNewVersion_ptr p, capn_text new2) +{ + capn_set_text(p.p, 2, (new2.str != capn_val25.str) ? new2 : capn_val0); +} + TestStructUnion_ptr new_TestStructUnion(struct capn_segment *s) { TestStructUnion_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1837,6 +3563,30 @@ void set_TestStructUnion_SomeStruct(const struct TestStructUnion_SomeStruct *s, write_TestStructUnion_SomeStruct(s, p); } +capn_text TestStructUnion_SomeStruct_get_someText(TestStructUnion_SomeStruct_ptr p) +{ + capn_text someText; + someText = capn_get_text(p.p, 0, capn_val0); + return someText; +} + +capn_text TestStructUnion_SomeStruct_get_moreText(TestStructUnion_SomeStruct_ptr p) +{ + capn_text moreText; + moreText = capn_get_text(p.p, 1, capn_val0); + return moreText; +} + +void TestStructUnion_SomeStruct_set_someText(TestStructUnion_SomeStruct_ptr p, capn_text someText) +{ + capn_set_text(p.p, 0, someText); +} + +void TestStructUnion_SomeStruct_set_moreText(TestStructUnion_SomeStruct_ptr p, capn_text moreText) +{ + capn_set_text(p.p, 1, moreText); +} + TestPrintInlineStructs_ptr new_TestPrintInlineStructs(struct capn_segment *s) { TestPrintInlineStructs_ptr p; p.p = capn_new_struct(s, 0, 2); @@ -1868,6 +3618,30 @@ void set_TestPrintInlineStructs(const struct TestPrintInlineStructs *s, TestPrin write_TestPrintInlineStructs(s, p); } +capn_text TestPrintInlineStructs_get_someText(TestPrintInlineStructs_ptr p) +{ + capn_text someText; + someText = capn_get_text(p.p, 0, capn_val0); + return someText; +} + +TestPrintInlineStructs_InlineStruct_list TestPrintInlineStructs_get_structList(TestPrintInlineStructs_ptr p) +{ + TestPrintInlineStructs_InlineStruct_list structList; + structList.p = capn_getp(p.p, 1, 0); + return structList; +} + +void TestPrintInlineStructs_set_someText(TestPrintInlineStructs_ptr p, capn_text someText) +{ + capn_set_text(p.p, 0, someText); +} + +void TestPrintInlineStructs_set_structList(TestPrintInlineStructs_ptr p, TestPrintInlineStructs_InlineStruct_list structList) +{ + capn_setp(p.p, 1, structList.p); +} + TestPrintInlineStructs_InlineStruct_ptr new_TestPrintInlineStructs_InlineStruct(struct capn_segment *s) { TestPrintInlineStructs_InlineStruct_ptr p; p.p = capn_new_struct(s, 8, 1); @@ -1880,12 +3654,12 @@ TestPrintInlineStructs_InlineStruct_list new_TestPrintInlineStructs_InlineStruct } void read_TestPrintInlineStructs_InlineStruct(struct TestPrintInlineStructs_InlineStruct *s, TestPrintInlineStructs_InlineStruct_ptr p) { capn_resolve(&p.p); - s->int32Field = (int32_t) capn_read32(p.p, 0); + s->int32Field = (int32_t) ((int32_t)capn_read32(p.p, 0)); s->textField = capn_get_text(p.p, 0, capn_val0); } void write_TestPrintInlineStructs_InlineStruct(const struct TestPrintInlineStructs_InlineStruct *s, TestPrintInlineStructs_InlineStruct_ptr p) { capn_resolve(&p.p); - capn_write32(p.p, 0, (uint32_t) s->int32Field); + capn_write32(p.p, 0, (uint32_t) (s->int32Field)); capn_set_text(p.p, 0, s->textField); } void get_TestPrintInlineStructs_InlineStruct(struct TestPrintInlineStructs_InlineStruct *s, TestPrintInlineStructs_InlineStruct_list l, int i) { @@ -1899,6 +3673,30 @@ void set_TestPrintInlineStructs_InlineStruct(const struct TestPrintInlineStructs write_TestPrintInlineStructs_InlineStruct(s, p); } +int32_t TestPrintInlineStructs_InlineStruct_get_int32Field(TestPrintInlineStructs_InlineStruct_ptr p) +{ + int32_t int32Field; + int32Field = (int32_t) ((int32_t)capn_read32(p.p, 0)); + return int32Field; +} + +capn_text TestPrintInlineStructs_InlineStruct_get_textField(TestPrintInlineStructs_InlineStruct_ptr p) +{ + capn_text textField; + textField = capn_get_text(p.p, 0, capn_val0); + return textField; +} + +void TestPrintInlineStructs_InlineStruct_set_int32Field(TestPrintInlineStructs_InlineStruct_ptr p, int32_t int32Field) +{ + capn_write32(p.p, 0, (uint32_t) (int32Field)); +} + +void TestPrintInlineStructs_InlineStruct_set_textField(TestPrintInlineStructs_InlineStruct_ptr p, capn_text textField) +{ + capn_set_text(p.p, 0, textField); +} + TestWholeFloatDefault_ptr new_TestWholeFloatDefault(struct capn_segment *s) { TestWholeFloatDefault_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -1930,6 +3728,30 @@ void set_TestWholeFloatDefault(const struct TestWholeFloatDefault *s, TestWholeF write_TestWholeFloatDefault(s, p); } +float TestWholeFloatDefault_get_field(TestWholeFloatDefault_ptr p) +{ + float field; + field = capn_to_f32(capn_read32(p.p, 0) ^ 0x42f60000u); + return field; +} + +float TestWholeFloatDefault_get_bigField(TestWholeFloatDefault_ptr p) +{ + float bigField; + bigField = capn_to_f32(capn_read32(p.p, 4) ^ 0x71c9f2cau); + return bigField; +} + +void TestWholeFloatDefault_set_field(TestWholeFloatDefault_ptr p, float field) +{ + capn_write32(p.p, 0, capn_from_f32(field) ^ 0x42f60000u); +} + +void TestWholeFloatDefault_set_bigField(TestWholeFloatDefault_ptr p, float bigField) +{ + capn_write32(p.p, 4, capn_from_f32(bigField) ^ 0x71c9f2cau); +} + TestEmptyStruct_ptr new_TestEmptyStruct(struct capn_segment *s) { TestEmptyStruct_ptr p; p.p = capn_new_struct(s, 0, 0); @@ -2015,6 +3837,30 @@ void set_TestSturdyRef(const struct TestSturdyRef *s, TestSturdyRef_list l, int write_TestSturdyRef(s, p); } +TestSturdyRefHostId_ptr TestSturdyRef_get_hostId(TestSturdyRef_ptr p) +{ + TestSturdyRefHostId_ptr hostId; + hostId.p = capn_getp(p.p, 0, 0); + return hostId; +} + +capn_ptr TestSturdyRef_get_objectId(TestSturdyRef_ptr p) +{ + capn_ptr objectId; + objectId = capn_getp(p.p, 1, 0); + return objectId; +} + +void TestSturdyRef_set_hostId(TestSturdyRef_ptr p, TestSturdyRefHostId_ptr hostId) +{ + capn_setp(p.p, 0, hostId.p); +} + +void TestSturdyRef_set_objectId(TestSturdyRef_ptr p, capn_ptr objectId) +{ + capn_setp(p.p, 1, objectId); +} + TestSturdyRefHostId_ptr new_TestSturdyRefHostId(struct capn_segment *s) { TestSturdyRefHostId_ptr p; p.p = capn_new_struct(s, 0, 1); @@ -2044,6 +3890,18 @@ void set_TestSturdyRefHostId(const struct TestSturdyRefHostId *s, TestSturdyRefH write_TestSturdyRefHostId(s, p); } +capn_text TestSturdyRefHostId_get_host(TestSturdyRefHostId_ptr p) +{ + capn_text host; + host = capn_get_text(p.p, 0, capn_val0); + return host; +} + +void TestSturdyRefHostId_set_host(TestSturdyRefHostId_ptr p, capn_text host) +{ + capn_set_text(p.p, 0, host); +} + TestSturdyRefObjectId_ptr new_TestSturdyRefObjectId(struct capn_segment *s) { TestSturdyRefObjectId_ptr p; p.p = capn_new_struct(s, 8, 0); @@ -2060,7 +3918,7 @@ void read_TestSturdyRefObjectId(struct TestSturdyRefObjectId *s, TestSturdyRefOb } void write_TestSturdyRefObjectId(const struct TestSturdyRefObjectId *s, TestSturdyRefObjectId_ptr p) { capn_resolve(&p.p); - capn_write16(p.p, 0, (uint16_t) s->tag); + capn_write16(p.p, 0, (uint16_t) (s->tag)); } void get_TestSturdyRefObjectId(struct TestSturdyRefObjectId *s, TestSturdyRefObjectId_list l, int i) { TestSturdyRefObjectId_ptr p; @@ -2073,6 +3931,18 @@ void set_TestSturdyRefObjectId(const struct TestSturdyRefObjectId *s, TestSturdy write_TestSturdyRefObjectId(s, p); } +enum TestSturdyRefObjectId_Tag TestSturdyRefObjectId_get_tag(TestSturdyRefObjectId_ptr p) +{ + enum TestSturdyRefObjectId_Tag tag; + tag = (enum TestSturdyRefObjectId_Tag)(int) capn_read16(p.p, 0); + return tag; +} + +void TestSturdyRefObjectId_set_tag(TestSturdyRefObjectId_ptr p, enum TestSturdyRefObjectId_Tag tag) +{ + capn_write16(p.p, 0, (uint16_t) (tag)); +} + TestProvisionId_ptr new_TestProvisionId(struct capn_segment *s) { TestProvisionId_ptr p; p.p = capn_new_struct(s, 0, 0); @@ -2199,7 +4069,7 @@ void read_TestNameAnnotation(struct TestNameAnnotation *s, TestNameAnnotation_pt s->badFieldName = (capn_read8(p.p, 0) & 1) != 0; break; case TestNameAnnotation_bar: - s->bar = (int8_t) capn_read8(p.p, 0); + s->bar = (int8_t) ((int8_t)capn_read8(p.p, 0)); break; default: break; @@ -2224,12 +4094,12 @@ void write_TestNameAnnotation(const struct TestNameAnnotation *s, TestNameAnnota capn_write1(p.p, 0, s->badFieldName != 0); break; case TestNameAnnotation_bar: - capn_write8(p.p, 0, (uint8_t) s->bar); + capn_write8(p.p, 0, (uint8_t) (s->bar)); break; default: break; } - capn_write16(p.p, 4, (uint16_t) s->anotherBadFieldName); + capn_write16(p.p, 4, (uint16_t) (s->anotherBadFieldName)); capn_write16(p.p, 6, s->badlyNamedUnion_which); switch (s->badlyNamedUnion_which) { case TestNameAnnotation_badlyNamedUnion_baz: @@ -2282,3 +4152,27 @@ void set_TestNameAnnotation_NestedStruct(const struct TestNameAnnotation_NestedS p.p = capn_getp(l.p, i, 0); write_TestNameAnnotation_NestedStruct(s, p); } + +unsigned TestNameAnnotation_NestedStruct_get_badNestedFieldName(TestNameAnnotation_NestedStruct_ptr p) +{ + unsigned badNestedFieldName; + badNestedFieldName = (capn_read8(p.p, 0) & 1) != 0; + return badNestedFieldName; +} + +TestNameAnnotation_NestedStruct_ptr TestNameAnnotation_NestedStruct_get_anotherBadNestedFieldName(TestNameAnnotation_NestedStruct_ptr p) +{ + TestNameAnnotation_NestedStruct_ptr anotherBadNestedFieldName; + anotherBadNestedFieldName.p = capn_getp(p.p, 0, 0); + return anotherBadNestedFieldName; +} + +void TestNameAnnotation_NestedStruct_set_badNestedFieldName(TestNameAnnotation_NestedStruct_ptr p, unsigned badNestedFieldName) +{ + capn_write1(p.p, 0, badNestedFieldName != 0); +} + +void TestNameAnnotation_NestedStruct_set_anotherBadNestedFieldName(TestNameAnnotation_NestedStruct_ptr p, TestNameAnnotation_NestedStruct_ptr anotherBadNestedFieldName) +{ + capn_setp(p.p, 0, anotherBadNestedFieldName.p); +} diff --git a/compiler/test.capnp.h b/compiler/test.capnp.h index 45dec27..7406a69 100644 --- a/compiler/test.capnp.h +++ b/compiler/test.capnp.h @@ -279,6 +279,140 @@ struct TestAllTypes { capn_ptr interfaceList; }; +static const size_t TestAllTypes_word_count = 6; + +static const size_t TestAllTypes_pointer_count = 20; + +static const size_t TestAllTypes_struct_bytes_count = 208; + +unsigned TestAllTypes_get_boolField(TestAllTypes_ptr p); + +int8_t TestAllTypes_get_int8Field(TestAllTypes_ptr p); + +int16_t TestAllTypes_get_int16Field(TestAllTypes_ptr p); + +int32_t TestAllTypes_get_int32Field(TestAllTypes_ptr p); + +int64_t TestAllTypes_get_int64Field(TestAllTypes_ptr p); + +uint8_t TestAllTypes_get_uInt8Field(TestAllTypes_ptr p); + +uint16_t TestAllTypes_get_uInt16Field(TestAllTypes_ptr p); + +uint32_t TestAllTypes_get_uInt32Field(TestAllTypes_ptr p); + +uint64_t TestAllTypes_get_uInt64Field(TestAllTypes_ptr p); + +float TestAllTypes_get_float32Field(TestAllTypes_ptr p); + +double TestAllTypes_get_float64Field(TestAllTypes_ptr p); + +capn_text TestAllTypes_get_textField(TestAllTypes_ptr p); + +capn_data TestAllTypes_get_dataField(TestAllTypes_ptr p); + +TestAllTypes_ptr TestAllTypes_get_structField(TestAllTypes_ptr p); + +enum TestEnum TestAllTypes_get_enumField(TestAllTypes_ptr p); + +capn_ptr TestAllTypes_get_voidList(TestAllTypes_ptr p); + +capn_list1 TestAllTypes_get_boolList(TestAllTypes_ptr p); + +capn_list8 TestAllTypes_get_int8List(TestAllTypes_ptr p); + +capn_list16 TestAllTypes_get_int16List(TestAllTypes_ptr p); + +capn_list32 TestAllTypes_get_int32List(TestAllTypes_ptr p); + +capn_list64 TestAllTypes_get_int64List(TestAllTypes_ptr p); + +capn_list8 TestAllTypes_get_uInt8List(TestAllTypes_ptr p); + +capn_list16 TestAllTypes_get_uInt16List(TestAllTypes_ptr p); + +capn_list32 TestAllTypes_get_uInt32List(TestAllTypes_ptr p); + +capn_list64 TestAllTypes_get_uInt64List(TestAllTypes_ptr p); + +capn_list32 TestAllTypes_get_float32List(TestAllTypes_ptr p); + +capn_list64 TestAllTypes_get_float64List(TestAllTypes_ptr p); + +capn_ptr TestAllTypes_get_textList(TestAllTypes_ptr p); + +capn_ptr TestAllTypes_get_dataList(TestAllTypes_ptr p); + +TestAllTypes_list TestAllTypes_get_structList(TestAllTypes_ptr p); + +capn_list16 TestAllTypes_get_enumList(TestAllTypes_ptr p); + +capn_ptr TestAllTypes_get_interfaceList(TestAllTypes_ptr p); + +void TestAllTypes_set_boolField(TestAllTypes_ptr p, unsigned boolField); + +void TestAllTypes_set_int8Field(TestAllTypes_ptr p, int8_t int8Field); + +void TestAllTypes_set_int16Field(TestAllTypes_ptr p, int16_t int16Field); + +void TestAllTypes_set_int32Field(TestAllTypes_ptr p, int32_t int32Field); + +void TestAllTypes_set_int64Field(TestAllTypes_ptr p, int64_t int64Field); + +void TestAllTypes_set_uInt8Field(TestAllTypes_ptr p, uint8_t uInt8Field); + +void TestAllTypes_set_uInt16Field(TestAllTypes_ptr p, uint16_t uInt16Field); + +void TestAllTypes_set_uInt32Field(TestAllTypes_ptr p, uint32_t uInt32Field); + +void TestAllTypes_set_uInt64Field(TestAllTypes_ptr p, uint64_t uInt64Field); + +void TestAllTypes_set_float32Field(TestAllTypes_ptr p, float float32Field); + +void TestAllTypes_set_float64Field(TestAllTypes_ptr p, double float64Field); + +void TestAllTypes_set_textField(TestAllTypes_ptr p, capn_text textField); + +void TestAllTypes_set_dataField(TestAllTypes_ptr p, capn_data dataField); + +void TestAllTypes_set_structField(TestAllTypes_ptr p, TestAllTypes_ptr structField); + +void TestAllTypes_set_enumField(TestAllTypes_ptr p, enum TestEnum enumField); + +void TestAllTypes_set_voidList(TestAllTypes_ptr p, capn_ptr voidList); + +void TestAllTypes_set_boolList(TestAllTypes_ptr p, capn_list1 boolList); + +void TestAllTypes_set_int8List(TestAllTypes_ptr p, capn_list8 int8List); + +void TestAllTypes_set_int16List(TestAllTypes_ptr p, capn_list16 int16List); + +void TestAllTypes_set_int32List(TestAllTypes_ptr p, capn_list32 int32List); + +void TestAllTypes_set_int64List(TestAllTypes_ptr p, capn_list64 int64List); + +void TestAllTypes_set_uInt8List(TestAllTypes_ptr p, capn_list8 uInt8List); + +void TestAllTypes_set_uInt16List(TestAllTypes_ptr p, capn_list16 uInt16List); + +void TestAllTypes_set_uInt32List(TestAllTypes_ptr p, capn_list32 uInt32List); + +void TestAllTypes_set_uInt64List(TestAllTypes_ptr p, capn_list64 uInt64List); + +void TestAllTypes_set_float32List(TestAllTypes_ptr p, capn_list32 float32List); + +void TestAllTypes_set_float64List(TestAllTypes_ptr p, capn_list64 float64List); + +void TestAllTypes_set_textList(TestAllTypes_ptr p, capn_ptr textList); + +void TestAllTypes_set_dataList(TestAllTypes_ptr p, capn_ptr dataList); + +void TestAllTypes_set_structList(TestAllTypes_ptr p, TestAllTypes_list structList); + +void TestAllTypes_set_enumList(TestAllTypes_ptr p, capn_list16 enumList); + +void TestAllTypes_set_interfaceList(TestAllTypes_ptr p, capn_ptr interfaceList); + struct TestDefaults { unsigned boolField : 1; int8_t int8Field; @@ -314,10 +448,154 @@ struct TestDefaults { capn_ptr interfaceList; }; +static const size_t TestDefaults_word_count = 6; + +static const size_t TestDefaults_pointer_count = 20; + +static const size_t TestDefaults_struct_bytes_count = 208; + +unsigned TestDefaults_get_boolField(TestDefaults_ptr p); + +int8_t TestDefaults_get_int8Field(TestDefaults_ptr p); + +int16_t TestDefaults_get_int16Field(TestDefaults_ptr p); + +int32_t TestDefaults_get_int32Field(TestDefaults_ptr p); + +int64_t TestDefaults_get_int64Field(TestDefaults_ptr p); + +uint8_t TestDefaults_get_uInt8Field(TestDefaults_ptr p); + +uint16_t TestDefaults_get_uInt16Field(TestDefaults_ptr p); + +uint32_t TestDefaults_get_uInt32Field(TestDefaults_ptr p); + +uint64_t TestDefaults_get_uInt64Field(TestDefaults_ptr p); + +float TestDefaults_get_float32Field(TestDefaults_ptr p); + +double TestDefaults_get_float64Field(TestDefaults_ptr p); + +capn_text TestDefaults_get_textField(TestDefaults_ptr p); + +capn_data TestDefaults_get_dataField(TestDefaults_ptr p); + +TestAllTypes_ptr TestDefaults_get_structField(TestDefaults_ptr p); + +enum TestEnum TestDefaults_get_enumField(TestDefaults_ptr p); + +capn_ptr TestDefaults_get_voidList(TestDefaults_ptr p); + +capn_list1 TestDefaults_get_boolList(TestDefaults_ptr p); + +capn_list8 TestDefaults_get_int8List(TestDefaults_ptr p); + +capn_list16 TestDefaults_get_int16List(TestDefaults_ptr p); + +capn_list32 TestDefaults_get_int32List(TestDefaults_ptr p); + +capn_list64 TestDefaults_get_int64List(TestDefaults_ptr p); + +capn_list8 TestDefaults_get_uInt8List(TestDefaults_ptr p); + +capn_list16 TestDefaults_get_uInt16List(TestDefaults_ptr p); + +capn_list32 TestDefaults_get_uInt32List(TestDefaults_ptr p); + +capn_list64 TestDefaults_get_uInt64List(TestDefaults_ptr p); + +capn_list32 TestDefaults_get_float32List(TestDefaults_ptr p); + +capn_list64 TestDefaults_get_float64List(TestDefaults_ptr p); + +capn_ptr TestDefaults_get_textList(TestDefaults_ptr p); + +capn_ptr TestDefaults_get_dataList(TestDefaults_ptr p); + +TestAllTypes_list TestDefaults_get_structList(TestDefaults_ptr p); + +capn_list16 TestDefaults_get_enumList(TestDefaults_ptr p); + +capn_ptr TestDefaults_get_interfaceList(TestDefaults_ptr p); + +void TestDefaults_set_boolField(TestDefaults_ptr p, unsigned boolField); + +void TestDefaults_set_int8Field(TestDefaults_ptr p, int8_t int8Field); + +void TestDefaults_set_int16Field(TestDefaults_ptr p, int16_t int16Field); + +void TestDefaults_set_int32Field(TestDefaults_ptr p, int32_t int32Field); + +void TestDefaults_set_int64Field(TestDefaults_ptr p, int64_t int64Field); + +void TestDefaults_set_uInt8Field(TestDefaults_ptr p, uint8_t uInt8Field); + +void TestDefaults_set_uInt16Field(TestDefaults_ptr p, uint16_t uInt16Field); + +void TestDefaults_set_uInt32Field(TestDefaults_ptr p, uint32_t uInt32Field); + +void TestDefaults_set_uInt64Field(TestDefaults_ptr p, uint64_t uInt64Field); + +void TestDefaults_set_float32Field(TestDefaults_ptr p, float float32Field); + +void TestDefaults_set_float64Field(TestDefaults_ptr p, double float64Field); + +void TestDefaults_set_textField(TestDefaults_ptr p, capn_text textField); + +void TestDefaults_set_dataField(TestDefaults_ptr p, capn_data dataField); + +void TestDefaults_set_structField(TestDefaults_ptr p, TestAllTypes_ptr structField); + +void TestDefaults_set_enumField(TestDefaults_ptr p, enum TestEnum enumField); + +void TestDefaults_set_voidList(TestDefaults_ptr p, capn_ptr voidList); + +void TestDefaults_set_boolList(TestDefaults_ptr p, capn_list1 boolList); + +void TestDefaults_set_int8List(TestDefaults_ptr p, capn_list8 int8List); + +void TestDefaults_set_int16List(TestDefaults_ptr p, capn_list16 int16List); + +void TestDefaults_set_int32List(TestDefaults_ptr p, capn_list32 int32List); + +void TestDefaults_set_int64List(TestDefaults_ptr p, capn_list64 int64List); + +void TestDefaults_set_uInt8List(TestDefaults_ptr p, capn_list8 uInt8List); + +void TestDefaults_set_uInt16List(TestDefaults_ptr p, capn_list16 uInt16List); + +void TestDefaults_set_uInt32List(TestDefaults_ptr p, capn_list32 uInt32List); + +void TestDefaults_set_uInt64List(TestDefaults_ptr p, capn_list64 uInt64List); + +void TestDefaults_set_float32List(TestDefaults_ptr p, capn_list32 float32List); + +void TestDefaults_set_float64List(TestDefaults_ptr p, capn_list64 float64List); + +void TestDefaults_set_textList(TestDefaults_ptr p, capn_ptr textList); + +void TestDefaults_set_dataList(TestDefaults_ptr p, capn_ptr dataList); + +void TestDefaults_set_structList(TestDefaults_ptr p, TestAllTypes_list structList); + +void TestDefaults_set_enumList(TestDefaults_ptr p, capn_list16 enumList); + +void TestDefaults_set_interfaceList(TestDefaults_ptr p, capn_ptr interfaceList); + struct TestAnyPointer { capn_ptr anyPointerField; }; +static const size_t TestAnyPointer_word_count = 0; + +static const size_t TestAnyPointer_pointer_count = 1; + +static const size_t TestAnyPointer_struct_bytes_count = 8; + +capn_ptr TestAnyPointer_get_anyPointerField(TestAnyPointer_ptr p); + +void TestAnyPointer_set_anyPointerField(TestAnyPointer_ptr p, capn_ptr anyPointerField); + struct TestOutOfOrder { capn_text foo; capn_text bar; @@ -329,6 +607,48 @@ struct TestOutOfOrder { capn_text garply; capn_text waldo; }; + +static const size_t TestOutOfOrder_word_count = 0; + +static const size_t TestOutOfOrder_pointer_count = 9; + +static const size_t TestOutOfOrder_struct_bytes_count = 72; + +capn_text TestOutOfOrder_get_foo(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_bar(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_baz(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_qux(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_quux(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_corge(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_grault(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_garply(TestOutOfOrder_ptr p); + +capn_text TestOutOfOrder_get_waldo(TestOutOfOrder_ptr p); + +void TestOutOfOrder_set_foo(TestOutOfOrder_ptr p, capn_text foo); + +void TestOutOfOrder_set_bar(TestOutOfOrder_ptr p, capn_text bar); + +void TestOutOfOrder_set_baz(TestOutOfOrder_ptr p, capn_text baz); + +void TestOutOfOrder_set_qux(TestOutOfOrder_ptr p, capn_text qux); + +void TestOutOfOrder_set_quux(TestOutOfOrder_ptr p, capn_text quux); + +void TestOutOfOrder_set_corge(TestOutOfOrder_ptr p, capn_text corge); + +void TestOutOfOrder_set_grault(TestOutOfOrder_ptr p, capn_text grault); + +void TestOutOfOrder_set_garply(TestOutOfOrder_ptr p, capn_text garply); + +void TestOutOfOrder_set_waldo(TestOutOfOrder_ptr p, capn_text waldo); enum TestUnion_union0_which { TestUnion_union0_u0f0s0 = 0, TestUnion_union0_u0f0s1 = 1, @@ -444,6 +764,44 @@ struct TestUnion { } union3; uint8_t byte0; }; + +static const size_t TestUnion_word_count = 8; + +static const size_t TestUnion_pointer_count = 2; + +static const size_t TestUnion_struct_bytes_count = 80; + +unsigned TestUnion_get_bit0(TestUnion_ptr p); + +unsigned TestUnion_get_bit2(TestUnion_ptr p); + +unsigned TestUnion_get_bit3(TestUnion_ptr p); + +unsigned TestUnion_get_bit4(TestUnion_ptr p); + +unsigned TestUnion_get_bit5(TestUnion_ptr p); + +unsigned TestUnion_get_bit6(TestUnion_ptr p); + +unsigned TestUnion_get_bit7(TestUnion_ptr p); + +uint8_t TestUnion_get_byte0(TestUnion_ptr p); + +void TestUnion_set_bit0(TestUnion_ptr p, unsigned bit0); + +void TestUnion_set_bit2(TestUnion_ptr p, unsigned bit2); + +void TestUnion_set_bit3(TestUnion_ptr p, unsigned bit3); + +void TestUnion_set_bit4(TestUnion_ptr p, unsigned bit4); + +void TestUnion_set_bit5(TestUnion_ptr p, unsigned bit5); + +void TestUnion_set_bit6(TestUnion_ptr p, unsigned bit6); + +void TestUnion_set_bit7(TestUnion_ptr p, unsigned bit7); + +void TestUnion_set_byte0(TestUnion_ptr p, uint8_t byte0); enum TestUnnamedUnion_which { TestUnnamedUnion_foo = 0, TestUnnamedUnion_bar = 1 @@ -459,6 +817,16 @@ struct TestUnnamedUnion { uint16_t middle; capn_text after; }; + +static const size_t TestUnnamedUnion_word_count = 2; + +static const size_t TestUnnamedUnion_pointer_count = 2; + +static const size_t TestUnnamedUnion_struct_bytes_count = 32; + +capn_text TestUnnamedUnion_get_before(TestUnnamedUnion_ptr p); + +void TestUnnamedUnion_set_before(TestUnnamedUnion_ptr p, capn_text before); enum TestUnionInUnion_outer_inner_which { TestUnionInUnion_outer_inner_foo = 0, TestUnionInUnion_outer_inner_bar = 1 @@ -479,6 +847,12 @@ struct TestUnionInUnion { int32_t baz; } outer; }; + +static const size_t TestUnionInUnion_word_count = 2; + +static const size_t TestUnionInUnion_pointer_count = 0; + +static const size_t TestUnionInUnion_struct_bytes_count = 16; enum TestGroups_groups_which { TestGroups_groups_foo = 0, TestGroups_groups_bar = 2, @@ -505,6 +879,12 @@ struct TestGroups { } baz; } groups; }; + +static const size_t TestGroups_word_count = 2; + +static const size_t TestGroups_pointer_count = 2; + +static const size_t TestGroups_struct_bytes_count = 32; enum TestInterleavedGroups_group1_which { TestInterleavedGroups_group1_qux = 0, TestInterleavedGroups_group1_corge = 1, @@ -551,6 +931,12 @@ struct TestInterleavedGroups { } group2; }; +static const size_t TestInterleavedGroups_word_count = 6; + +static const size_t TestInterleavedGroups_pointer_count = 6; + +static const size_t TestInterleavedGroups_struct_bytes_count = 96; + struct TestUnionDefaults { TestUnion_ptr s16s8s64s8Set; TestUnion_ptr s0sps1s32Set; @@ -558,22 +944,90 @@ struct TestUnionDefaults { TestUnnamedUnion_ptr unnamed2; }; +static const size_t TestUnionDefaults_word_count = 0; + +static const size_t TestUnionDefaults_pointer_count = 4; + +static const size_t TestUnionDefaults_struct_bytes_count = 32; + +TestUnion_ptr TestUnionDefaults_get_s16s8s64s8Set(TestUnionDefaults_ptr p); + +TestUnion_ptr TestUnionDefaults_get_s0sps1s32Set(TestUnionDefaults_ptr p); + +TestUnnamedUnion_ptr TestUnionDefaults_get_unnamed1(TestUnionDefaults_ptr p); + +TestUnnamedUnion_ptr TestUnionDefaults_get_unnamed2(TestUnionDefaults_ptr p); + +void TestUnionDefaults_set_s16s8s64s8Set(TestUnionDefaults_ptr p, TestUnion_ptr s16s8s64s8Set); + +void TestUnionDefaults_set_s0sps1s32Set(TestUnionDefaults_ptr p, TestUnion_ptr s0sps1s32Set); + +void TestUnionDefaults_set_unnamed1(TestUnionDefaults_ptr p, TestUnnamedUnion_ptr unnamed1); + +void TestUnionDefaults_set_unnamed2(TestUnionDefaults_ptr p, TestUnnamedUnion_ptr unnamed2); + struct TestNestedTypes { TestNestedTypes_NestedStruct_ptr nestedStruct; enum TestNestedTypes_NestedEnum outerNestedEnum; enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum; }; +static const size_t TestNestedTypes_word_count = 1; + +static const size_t TestNestedTypes_pointer_count = 1; + +static const size_t TestNestedTypes_struct_bytes_count = 16; + +TestNestedTypes_NestedStruct_ptr TestNestedTypes_get_nestedStruct(TestNestedTypes_ptr p); + +enum TestNestedTypes_NestedEnum TestNestedTypes_get_outerNestedEnum(TestNestedTypes_ptr p); + +enum TestNestedTypes_NestedStruct_NestedEnum TestNestedTypes_get_innerNestedEnum(TestNestedTypes_ptr p); + +void TestNestedTypes_set_nestedStruct(TestNestedTypes_ptr p, TestNestedTypes_NestedStruct_ptr nestedStruct); + +void TestNestedTypes_set_outerNestedEnum(TestNestedTypes_ptr p, enum TestNestedTypes_NestedEnum outerNestedEnum); + +void TestNestedTypes_set_innerNestedEnum(TestNestedTypes_ptr p, enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum); + struct TestNestedTypes_NestedStruct { enum TestNestedTypes_NestedEnum outerNestedEnum; enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum; }; +static const size_t TestNestedTypes_NestedStruct_word_count = 1; + +static const size_t TestNestedTypes_NestedStruct_pointer_count = 0; + +static const size_t TestNestedTypes_NestedStruct_struct_bytes_count = 8; + +enum TestNestedTypes_NestedEnum TestNestedTypes_NestedStruct_get_outerNestedEnum(TestNestedTypes_NestedStruct_ptr p); + +enum TestNestedTypes_NestedStruct_NestedEnum TestNestedTypes_NestedStruct_get_innerNestedEnum(TestNestedTypes_NestedStruct_ptr p); + +void TestNestedTypes_NestedStruct_set_outerNestedEnum(TestNestedTypes_NestedStruct_ptr p, enum TestNestedTypes_NestedEnum outerNestedEnum); + +void TestNestedTypes_NestedStruct_set_innerNestedEnum(TestNestedTypes_NestedStruct_ptr p, enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum); + struct TestUsing { enum TestNestedTypes_NestedEnum outerNestedEnum; enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum; }; +static const size_t TestUsing_word_count = 1; + +static const size_t TestUsing_pointer_count = 0; + +static const size_t TestUsing_struct_bytes_count = 8; + +enum TestNestedTypes_NestedEnum TestUsing_get_outerNestedEnum(TestUsing_ptr p); + +enum TestNestedTypes_NestedStruct_NestedEnum TestUsing_get_innerNestedEnum(TestUsing_ptr p); + +void TestUsing_set_outerNestedEnum(TestUsing_ptr p, enum TestNestedTypes_NestedEnum outerNestedEnum); + +void TestUsing_set_innerNestedEnum(TestUsing_ptr p, enum TestNestedTypes_NestedStruct_NestedEnum innerNestedEnum); + struct TestLists { TestLists_Struct0_list list0; TestLists_Struct1_list list1; @@ -587,76 +1041,310 @@ struct TestLists { capn_ptr structListList; }; +static const size_t TestLists_word_count = 0; + +static const size_t TestLists_pointer_count = 10; + +static const size_t TestLists_struct_bytes_count = 80; + +TestLists_Struct0_list TestLists_get_list0(TestLists_ptr p); + +TestLists_Struct1_list TestLists_get_list1(TestLists_ptr p); + +TestLists_Struct8_list TestLists_get_list8(TestLists_ptr p); + +TestLists_Struct16_list TestLists_get_list16(TestLists_ptr p); + +TestLists_Struct32_list TestLists_get_list32(TestLists_ptr p); + +TestLists_Struct64_list TestLists_get_list64(TestLists_ptr p); + +TestLists_StructP_list TestLists_get_listP(TestLists_ptr p); + +capn_ptr TestLists_get_int32ListList(TestLists_ptr p); + +capn_ptr TestLists_get_textListList(TestLists_ptr p); + +capn_ptr TestLists_get_structListList(TestLists_ptr p); + +void TestLists_set_list0(TestLists_ptr p, TestLists_Struct0_list list0); + +void TestLists_set_list1(TestLists_ptr p, TestLists_Struct1_list list1); + +void TestLists_set_list8(TestLists_ptr p, TestLists_Struct8_list list8); + +void TestLists_set_list16(TestLists_ptr p, TestLists_Struct16_list list16); + +void TestLists_set_list32(TestLists_ptr p, TestLists_Struct32_list list32); + +void TestLists_set_list64(TestLists_ptr p, TestLists_Struct64_list list64); + +void TestLists_set_listP(TestLists_ptr p, TestLists_StructP_list listP); + +void TestLists_set_int32ListList(TestLists_ptr p, capn_ptr int32ListList); + +void TestLists_set_textListList(TestLists_ptr p, capn_ptr textListList); + +void TestLists_set_structListList(TestLists_ptr p, capn_ptr structListList); + struct TestLists_Struct0 { }; +static const size_t TestLists_Struct0_word_count = 0; + +static const size_t TestLists_Struct0_pointer_count = 0; + +static const size_t TestLists_Struct0_struct_bytes_count = 0; + struct TestLists_Struct1 { unsigned f : 1; }; +static const size_t TestLists_Struct1_word_count = 1; + +static const size_t TestLists_Struct1_pointer_count = 0; + +static const size_t TestLists_Struct1_struct_bytes_count = 8; + +unsigned TestLists_Struct1_get_f(TestLists_Struct1_ptr p); + +void TestLists_Struct1_set_f(TestLists_Struct1_ptr p, unsigned f); + struct TestLists_Struct8 { uint8_t f; }; +static const size_t TestLists_Struct8_word_count = 1; + +static const size_t TestLists_Struct8_pointer_count = 0; + +static const size_t TestLists_Struct8_struct_bytes_count = 8; + +uint8_t TestLists_Struct8_get_f(TestLists_Struct8_ptr p); + +void TestLists_Struct8_set_f(TestLists_Struct8_ptr p, uint8_t f); + struct TestLists_Struct16 { uint16_t f; }; +static const size_t TestLists_Struct16_word_count = 1; + +static const size_t TestLists_Struct16_pointer_count = 0; + +static const size_t TestLists_Struct16_struct_bytes_count = 8; + +uint16_t TestLists_Struct16_get_f(TestLists_Struct16_ptr p); + +void TestLists_Struct16_set_f(TestLists_Struct16_ptr p, uint16_t f); + struct TestLists_Struct32 { uint32_t f; }; +static const size_t TestLists_Struct32_word_count = 1; + +static const size_t TestLists_Struct32_pointer_count = 0; + +static const size_t TestLists_Struct32_struct_bytes_count = 8; + +uint32_t TestLists_Struct32_get_f(TestLists_Struct32_ptr p); + +void TestLists_Struct32_set_f(TestLists_Struct32_ptr p, uint32_t f); + struct TestLists_Struct64 { uint64_t f; }; +static const size_t TestLists_Struct64_word_count = 1; + +static const size_t TestLists_Struct64_pointer_count = 0; + +static const size_t TestLists_Struct64_struct_bytes_count = 8; + +uint64_t TestLists_Struct64_get_f(TestLists_Struct64_ptr p); + +void TestLists_Struct64_set_f(TestLists_Struct64_ptr p, uint64_t f); + struct TestLists_StructP { capn_text f; }; +static const size_t TestLists_StructP_word_count = 0; + +static const size_t TestLists_StructP_pointer_count = 1; + +static const size_t TestLists_StructP_struct_bytes_count = 8; + +capn_text TestLists_StructP_get_f(TestLists_StructP_ptr p); + +void TestLists_StructP_set_f(TestLists_StructP_ptr p, capn_text f); + struct TestLists_Struct0c { capn_text pad; }; +static const size_t TestLists_Struct0c_word_count = 0; + +static const size_t TestLists_Struct0c_pointer_count = 1; + +static const size_t TestLists_Struct0c_struct_bytes_count = 8; + +capn_text TestLists_Struct0c_get_pad(TestLists_Struct0c_ptr p); + +void TestLists_Struct0c_set_pad(TestLists_Struct0c_ptr p, capn_text pad); + struct TestLists_Struct1c { unsigned f : 1; capn_text pad; }; +static const size_t TestLists_Struct1c_word_count = 1; + +static const size_t TestLists_Struct1c_pointer_count = 1; + +static const size_t TestLists_Struct1c_struct_bytes_count = 16; + +unsigned TestLists_Struct1c_get_f(TestLists_Struct1c_ptr p); + +capn_text TestLists_Struct1c_get_pad(TestLists_Struct1c_ptr p); + +void TestLists_Struct1c_set_f(TestLists_Struct1c_ptr p, unsigned f); + +void TestLists_Struct1c_set_pad(TestLists_Struct1c_ptr p, capn_text pad); + struct TestLists_Struct8c { uint8_t f; capn_text pad; }; +static const size_t TestLists_Struct8c_word_count = 1; + +static const size_t TestLists_Struct8c_pointer_count = 1; + +static const size_t TestLists_Struct8c_struct_bytes_count = 16; + +uint8_t TestLists_Struct8c_get_f(TestLists_Struct8c_ptr p); + +capn_text TestLists_Struct8c_get_pad(TestLists_Struct8c_ptr p); + +void TestLists_Struct8c_set_f(TestLists_Struct8c_ptr p, uint8_t f); + +void TestLists_Struct8c_set_pad(TestLists_Struct8c_ptr p, capn_text pad); + struct TestLists_Struct16c { uint16_t f; capn_text pad; }; +static const size_t TestLists_Struct16c_word_count = 1; + +static const size_t TestLists_Struct16c_pointer_count = 1; + +static const size_t TestLists_Struct16c_struct_bytes_count = 16; + +uint16_t TestLists_Struct16c_get_f(TestLists_Struct16c_ptr p); + +capn_text TestLists_Struct16c_get_pad(TestLists_Struct16c_ptr p); + +void TestLists_Struct16c_set_f(TestLists_Struct16c_ptr p, uint16_t f); + +void TestLists_Struct16c_set_pad(TestLists_Struct16c_ptr p, capn_text pad); + struct TestLists_Struct32c { uint32_t f; capn_text pad; }; +static const size_t TestLists_Struct32c_word_count = 1; + +static const size_t TestLists_Struct32c_pointer_count = 1; + +static const size_t TestLists_Struct32c_struct_bytes_count = 16; + +uint32_t TestLists_Struct32c_get_f(TestLists_Struct32c_ptr p); + +capn_text TestLists_Struct32c_get_pad(TestLists_Struct32c_ptr p); + +void TestLists_Struct32c_set_f(TestLists_Struct32c_ptr p, uint32_t f); + +void TestLists_Struct32c_set_pad(TestLists_Struct32c_ptr p, capn_text pad); + struct TestLists_Struct64c { uint64_t f; capn_text pad; }; +static const size_t TestLists_Struct64c_word_count = 1; + +static const size_t TestLists_Struct64c_pointer_count = 1; + +static const size_t TestLists_Struct64c_struct_bytes_count = 16; + +uint64_t TestLists_Struct64c_get_f(TestLists_Struct64c_ptr p); + +capn_text TestLists_Struct64c_get_pad(TestLists_Struct64c_ptr p); + +void TestLists_Struct64c_set_f(TestLists_Struct64c_ptr p, uint64_t f); + +void TestLists_Struct64c_set_pad(TestLists_Struct64c_ptr p, capn_text pad); + struct TestLists_StructPc { capn_text f; uint64_t pad; }; +static const size_t TestLists_StructPc_word_count = 1; + +static const size_t TestLists_StructPc_pointer_count = 1; + +static const size_t TestLists_StructPc_struct_bytes_count = 16; + +capn_text TestLists_StructPc_get_f(TestLists_StructPc_ptr p); + +uint64_t TestLists_StructPc_get_pad(TestLists_StructPc_ptr p); + +void TestLists_StructPc_set_f(TestLists_StructPc_ptr p, capn_text f); + +void TestLists_StructPc_set_pad(TestLists_StructPc_ptr p, uint64_t pad); + struct TestFieldZeroIsBit { unsigned bit : 1; unsigned secondBit : 1; uint8_t thirdField; }; +static const size_t TestFieldZeroIsBit_word_count = 1; + +static const size_t TestFieldZeroIsBit_pointer_count = 0; + +static const size_t TestFieldZeroIsBit_struct_bytes_count = 8; + +unsigned TestFieldZeroIsBit_get_bit(TestFieldZeroIsBit_ptr p); + +unsigned TestFieldZeroIsBit_get_secondBit(TestFieldZeroIsBit_ptr p); + +uint8_t TestFieldZeroIsBit_get_thirdField(TestFieldZeroIsBit_ptr p); + +void TestFieldZeroIsBit_set_bit(TestFieldZeroIsBit_ptr p, unsigned bit); + +void TestFieldZeroIsBit_set_secondBit(TestFieldZeroIsBit_ptr p, unsigned secondBit); + +void TestFieldZeroIsBit_set_thirdField(TestFieldZeroIsBit_ptr p, uint8_t thirdField); + struct TestListDefaults { TestLists_ptr lists; }; + +static const size_t TestListDefaults_word_count = 0; + +static const size_t TestListDefaults_pointer_count = 1; + +static const size_t TestListDefaults_struct_bytes_count = 8; + +TestLists_ptr TestListDefaults_get_lists(TestListDefaults_ptr p); + +void TestListDefaults_set_lists(TestListDefaults_ptr p, TestLists_ptr lists); enum TestLateUnion_theUnion_which { TestLateUnion_theUnion_qux = 0, TestLateUnion_theUnion_corge = 1, @@ -686,12 +1374,48 @@ struct TestLateUnion { } anotherUnion; }; +static const size_t TestLateUnion_word_count = 3; + +static const size_t TestLateUnion_pointer_count = 3; + +static const size_t TestLateUnion_struct_bytes_count = 48; + +int32_t TestLateUnion_get_foo(TestLateUnion_ptr p); + +capn_text TestLateUnion_get_bar(TestLateUnion_ptr p); + +int16_t TestLateUnion_get_baz(TestLateUnion_ptr p); + +void TestLateUnion_set_foo(TestLateUnion_ptr p, int32_t foo); + +void TestLateUnion_set_bar(TestLateUnion_ptr p, capn_text bar); + +void TestLateUnion_set_baz(TestLateUnion_ptr p, int16_t baz); + struct TestOldVersion { int64_t old1; capn_text old2; TestOldVersion_ptr old3; }; +static const size_t TestOldVersion_word_count = 1; + +static const size_t TestOldVersion_pointer_count = 2; + +static const size_t TestOldVersion_struct_bytes_count = 24; + +int64_t TestOldVersion_get_old1(TestOldVersion_ptr p); + +capn_text TestOldVersion_get_old2(TestOldVersion_ptr p); + +TestOldVersion_ptr TestOldVersion_get_old3(TestOldVersion_ptr p); + +void TestOldVersion_set_old1(TestOldVersion_ptr p, int64_t old1); + +void TestOldVersion_set_old2(TestOldVersion_ptr p, capn_text old2); + +void TestOldVersion_set_old3(TestOldVersion_ptr p, TestOldVersion_ptr old3); + struct TestNewVersion { int64_t old1; capn_text old2; @@ -699,6 +1423,32 @@ struct TestNewVersion { int64_t new1; capn_text new2; }; + +static const size_t TestNewVersion_word_count = 2; + +static const size_t TestNewVersion_pointer_count = 3; + +static const size_t TestNewVersion_struct_bytes_count = 40; + +int64_t TestNewVersion_get_old1(TestNewVersion_ptr p); + +capn_text TestNewVersion_get_old2(TestNewVersion_ptr p); + +TestNewVersion_ptr TestNewVersion_get_old3(TestNewVersion_ptr p); + +int64_t TestNewVersion_get_new1(TestNewVersion_ptr p); + +capn_text TestNewVersion_get_new2(TestNewVersion_ptr p); + +void TestNewVersion_set_old1(TestNewVersion_ptr p, int64_t old1); + +void TestNewVersion_set_old2(TestNewVersion_ptr p, capn_text old2); + +void TestNewVersion_set_old3(TestNewVersion_ptr p, TestNewVersion_ptr old3); + +void TestNewVersion_set_new1(TestNewVersion_ptr p, int64_t new1); + +void TestNewVersion_set_new2(TestNewVersion_ptr p, capn_text new2); enum TestStructUnion_un_which { TestStructUnion_un__struct = 0, TestStructUnion_un_object = 1 @@ -712,56 +1462,188 @@ struct TestStructUnion { } un; }; +static const size_t TestStructUnion_word_count = 1; + +static const size_t TestStructUnion_pointer_count = 1; + +static const size_t TestStructUnion_struct_bytes_count = 16; + struct TestStructUnion_SomeStruct { capn_text someText; capn_text moreText; }; +static const size_t TestStructUnion_SomeStruct_word_count = 0; + +static const size_t TestStructUnion_SomeStruct_pointer_count = 2; + +static const size_t TestStructUnion_SomeStruct_struct_bytes_count = 16; + +capn_text TestStructUnion_SomeStruct_get_someText(TestStructUnion_SomeStruct_ptr p); + +capn_text TestStructUnion_SomeStruct_get_moreText(TestStructUnion_SomeStruct_ptr p); + +void TestStructUnion_SomeStruct_set_someText(TestStructUnion_SomeStruct_ptr p, capn_text someText); + +void TestStructUnion_SomeStruct_set_moreText(TestStructUnion_SomeStruct_ptr p, capn_text moreText); + struct TestPrintInlineStructs { capn_text someText; TestPrintInlineStructs_InlineStruct_list structList; }; +static const size_t TestPrintInlineStructs_word_count = 0; + +static const size_t TestPrintInlineStructs_pointer_count = 2; + +static const size_t TestPrintInlineStructs_struct_bytes_count = 16; + +capn_text TestPrintInlineStructs_get_someText(TestPrintInlineStructs_ptr p); + +TestPrintInlineStructs_InlineStruct_list TestPrintInlineStructs_get_structList(TestPrintInlineStructs_ptr p); + +void TestPrintInlineStructs_set_someText(TestPrintInlineStructs_ptr p, capn_text someText); + +void TestPrintInlineStructs_set_structList(TestPrintInlineStructs_ptr p, TestPrintInlineStructs_InlineStruct_list structList); + struct TestPrintInlineStructs_InlineStruct { int32_t int32Field; capn_text textField; }; +static const size_t TestPrintInlineStructs_InlineStruct_word_count = 1; + +static const size_t TestPrintInlineStructs_InlineStruct_pointer_count = 1; + +static const size_t TestPrintInlineStructs_InlineStruct_struct_bytes_count = 16; + +int32_t TestPrintInlineStructs_InlineStruct_get_int32Field(TestPrintInlineStructs_InlineStruct_ptr p); + +capn_text TestPrintInlineStructs_InlineStruct_get_textField(TestPrintInlineStructs_InlineStruct_ptr p); + +void TestPrintInlineStructs_InlineStruct_set_int32Field(TestPrintInlineStructs_InlineStruct_ptr p, int32_t int32Field); + +void TestPrintInlineStructs_InlineStruct_set_textField(TestPrintInlineStructs_InlineStruct_ptr p, capn_text textField); + struct TestWholeFloatDefault { float field; float bigField; }; +static const size_t TestWholeFloatDefault_word_count = 1; + +static const size_t TestWholeFloatDefault_pointer_count = 0; + +static const size_t TestWholeFloatDefault_struct_bytes_count = 8; + +float TestWholeFloatDefault_get_field(TestWholeFloatDefault_ptr p); + +float TestWholeFloatDefault_get_bigField(TestWholeFloatDefault_ptr p); + +void TestWholeFloatDefault_set_field(TestWholeFloatDefault_ptr p, float field); + +void TestWholeFloatDefault_set_bigField(TestWholeFloatDefault_ptr p, float bigField); + struct TestEmptyStruct { }; +static const size_t TestEmptyStruct_word_count = 0; + +static const size_t TestEmptyStruct_pointer_count = 0; + +static const size_t TestEmptyStruct_struct_bytes_count = 0; + struct TestConstants { }; +static const size_t TestConstants_word_count = 0; + +static const size_t TestConstants_pointer_count = 0; + +static const size_t TestConstants_struct_bytes_count = 0; + struct TestSturdyRef { TestSturdyRefHostId_ptr hostId; capn_ptr objectId; }; +static const size_t TestSturdyRef_word_count = 0; + +static const size_t TestSturdyRef_pointer_count = 2; + +static const size_t TestSturdyRef_struct_bytes_count = 16; + +TestSturdyRefHostId_ptr TestSturdyRef_get_hostId(TestSturdyRef_ptr p); + +capn_ptr TestSturdyRef_get_objectId(TestSturdyRef_ptr p); + +void TestSturdyRef_set_hostId(TestSturdyRef_ptr p, TestSturdyRefHostId_ptr hostId); + +void TestSturdyRef_set_objectId(TestSturdyRef_ptr p, capn_ptr objectId); + struct TestSturdyRefHostId { capn_text host; }; +static const size_t TestSturdyRefHostId_word_count = 0; + +static const size_t TestSturdyRefHostId_pointer_count = 1; + +static const size_t TestSturdyRefHostId_struct_bytes_count = 8; + +capn_text TestSturdyRefHostId_get_host(TestSturdyRefHostId_ptr p); + +void TestSturdyRefHostId_set_host(TestSturdyRefHostId_ptr p, capn_text host); + struct TestSturdyRefObjectId { enum TestSturdyRefObjectId_Tag tag; }; +static const size_t TestSturdyRefObjectId_word_count = 1; + +static const size_t TestSturdyRefObjectId_pointer_count = 0; + +static const size_t TestSturdyRefObjectId_struct_bytes_count = 8; + +enum TestSturdyRefObjectId_Tag TestSturdyRefObjectId_get_tag(TestSturdyRefObjectId_ptr p); + +void TestSturdyRefObjectId_set_tag(TestSturdyRefObjectId_ptr p, enum TestSturdyRefObjectId_Tag tag); + struct TestProvisionId { }; +static const size_t TestProvisionId_word_count = 0; + +static const size_t TestProvisionId_pointer_count = 0; + +static const size_t TestProvisionId_struct_bytes_count = 0; + struct TestRecipientId { }; +static const size_t TestRecipientId_word_count = 0; + +static const size_t TestRecipientId_pointer_count = 0; + +static const size_t TestRecipientId_struct_bytes_count = 0; + struct TestThirdPartyCapId { }; +static const size_t TestThirdPartyCapId_word_count = 0; + +static const size_t TestThirdPartyCapId_pointer_count = 0; + +static const size_t TestThirdPartyCapId_struct_bytes_count = 0; + struct TestJoinResult { }; + +static const size_t TestJoinResult_word_count = 0; + +static const size_t TestJoinResult_pointer_count = 0; + +static const size_t TestJoinResult_struct_bytes_count = 0; enum TestNameAnnotation_which { TestNameAnnotation_badFieldName = 0, TestNameAnnotation_bar = 1 @@ -780,17 +1662,36 @@ struct TestNameAnnotation { enum TestNameAnnotation_BadlyNamedEnum anotherBadFieldName; enum TestNameAnnotation_badlyNamedUnion_which badlyNamedUnion_which; union { - struct { - } badlyNamedGroup; + /* struct { -empty- } badlyNamedGroup; */ TestNameAnnotation_NestedStruct_ptr baz; } badlyNamedUnion; }; +static const size_t TestNameAnnotation_word_count = 1; + +static const size_t TestNameAnnotation_pointer_count = 1; + +static const size_t TestNameAnnotation_struct_bytes_count = 16; + struct TestNameAnnotation_NestedStruct { unsigned badNestedFieldName : 1; TestNameAnnotation_NestedStruct_ptr anotherBadNestedFieldName; }; +static const size_t TestNameAnnotation_NestedStruct_word_count = 1; + +static const size_t TestNameAnnotation_NestedStruct_pointer_count = 1; + +static const size_t TestNameAnnotation_NestedStruct_struct_bytes_count = 16; + +unsigned TestNameAnnotation_NestedStruct_get_badNestedFieldName(TestNameAnnotation_NestedStruct_ptr p); + +TestNameAnnotation_NestedStruct_ptr TestNameAnnotation_NestedStruct_get_anotherBadNestedFieldName(TestNameAnnotation_NestedStruct_ptr p); + +void TestNameAnnotation_NestedStruct_set_badNestedFieldName(TestNameAnnotation_NestedStruct_ptr p, unsigned badNestedFieldName); + +void TestNameAnnotation_NestedStruct_set_anotherBadNestedFieldName(TestNameAnnotation_NestedStruct_ptr p, TestNameAnnotation_NestedStruct_ptr anotherBadNestedFieldName); + TestAllTypes_ptr new_TestAllTypes(struct capn_segment*); TestDefaults_ptr new_TestDefaults(struct capn_segment*); TestAnyPointer_ptr new_TestAnyPointer(struct capn_segment*);