/nanopb-3.4.0/ |
D | pb_encode.c | 24 static bool checkreturn encode_array(pb_ostream_t *stream, pb_field_iter_t *field); 25 static bool checkreturn pb_check_proto3_default_value(const pb_field_iter_t *field); 26 static bool checkreturn encode_basic_field(pb_ostream_t *stream, const pb_field_iter_t *field); 27 static bool checkreturn encode_callback_field(pb_ostream_t *stream, const pb_field_iter_t *field); 28 static bool checkreturn encode_field(pb_ostream_t *stream, pb_field_iter_t *field); 29 static bool checkreturn encode_extension_field(pb_ostream_t *stream, const pb_field_iter_t *field); 32 static bool checkreturn pb_enc_bool(pb_ostream_t *stream, const pb_field_iter_t *field); 33 static bool checkreturn pb_enc_varint(pb_ostream_t *stream, const pb_field_iter_t *field); 34 static bool checkreturn pb_enc_fixed(pb_ostream_t *stream, const pb_field_iter_t *field); 35 static bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_iter_t *field); [all …]
|
D | pb_decode.c | 27 …kreturn decode_basic_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); 28 …return decode_static_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); 29 …eturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); 30 …turn decode_callback_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); 31 …l checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); 34 static bool pb_field_set_to_default(pb_field_iter_t *field); 36 static bool checkreturn pb_dec_bool(pb_istream_t *stream, const pb_field_iter_t *field); 37 static bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_iter_t *field); 38 static bool checkreturn pb_dec_bytes(pb_istream_t *stream, const pb_field_iter_t *field); 39 static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_iter_t *field); [all …]
|
/nanopb-3.4.0/tests/alltypes_proto3_callback/ |
D | encode_alltypes_callback.c | 13 static bool write_varint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_varint() argument 15 return pb_encode_tag_for_field(stream, field) && in write_varint() 19 static bool write_svarint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_svarint() argument 21 return pb_encode_tag_for_field(stream, field) && in write_svarint() 25 static bool write_fixed32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed32() argument 27 return pb_encode_tag_for_field(stream, field) && in write_fixed32() 31 static bool write_fixed64(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed64() argument 33 return pb_encode_tag_for_field(stream, field) && in write_fixed64() 37 static bool write_double(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_double() argument 41 return pb_encode_tag_for_field(stream, field) && in write_double() [all …]
|
D | decode_alltypes_callback.c | 14 printf("Test %s failed (in field %d).\n", #x, field->tag); \ 18 static bool read_varint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_varint() argument 28 static bool read_svarint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_svarint() argument 38 static bool read_fixed32(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed32() argument 48 static bool read_fixed64(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed64() argument 58 static bool read_double(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_double() argument 80 static bool read_string(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_string() argument 92 static bool read_submsg(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_submsg() argument 106 static bool read_emptymsg(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_emptymsg() argument 112 static bool read_repeated_varint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_repeated_varint() argument [all …]
|
/nanopb-3.4.0/tests/encode_unittests/ |
D | encode_unittests.c | 21 bool fieldcallback(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in fieldcallback() argument 24 if (!pb_encode_tag_for_field(stream, field)) in fieldcallback() 29 bool crazyfieldcallback(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in crazyfieldcallback() argument 34 if (!pb_encode_tag_for_field(stream, field)) in crazyfieldcallback() 145 pb_field_iter_t field; in main() local 146 field.tag = 10; in main() 149 field.type = PB_LTYPE_SVARINT; in main() 150 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x50")); in main() 152 field.type = PB_LTYPE_FIXED64; in main() 153 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x51")); in main() [all …]
|
/nanopb-3.4.0/tests/alltypes_callback/ |
D | encode_alltypes_callback.c | 13 static bool write_varint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_varint() argument 15 return pb_encode_tag_for_field(stream, field) && in write_varint() 19 static bool write_svarint(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_svarint() argument 21 return pb_encode_tag_for_field(stream, field) && in write_svarint() 25 static bool write_fixed32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed32() argument 27 return pb_encode_tag_for_field(stream, field) && in write_fixed32() 31 static bool write_fixed64(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_fixed64() argument 33 return pb_encode_tag_for_field(stream, field) && in write_fixed64() 37 static bool write_double(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_double() argument 41 return pb_encode_tag_for_field(stream, field) && in write_double() [all …]
|
D | decode_alltypes_callback.c | 14 printf("Test %s failed (in field %d).\n", #x, field->tag); \ 18 static bool read_varint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_varint() argument 28 static bool read_svarint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_svarint() argument 38 static bool read_fixed32(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed32() argument 48 static bool read_fixed64(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_fixed64() argument 58 static bool read_double(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_double() argument 80 static bool read_string(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_string() argument 92 static bool read_submsg(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_submsg() argument 107 static bool read_emptymsg(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_emptymsg() argument 113 static bool read_repeated_varint(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_repeated_varint() argument [all …]
|
/nanopb-3.4.0/tests/callbacks/ |
D | encode_callbacks.c | 9 bool encode_string(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_string() argument 13 if (!pb_encode_tag_for_field(stream, field)) in encode_string() 19 bool encode_int32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_int32() argument 21 if (!pb_encode_tag_for_field(stream, field)) in encode_int32() 27 bool encode_fixed32(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_fixed32() argument 31 if (!pb_encode_tag_for_field(stream, field)) in encode_fixed32() 37 bool encode_fixed64(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_fixed64() argument 41 if (!pb_encode_tag_for_field(stream, field)) in encode_fixed64() 47 bool encode_repeatedstring(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_repeatedstring() argument 54 if (!pb_encode_tag_for_field(stream, field)) in encode_repeatedstring()
|
D | decode_callbacks.c | 10 bool print_string(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_string() argument 28 bool print_int32(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_int32() argument 38 bool print_fixed32(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_fixed32() argument 48 bool print_fixed64(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_fixed64() argument
|
/nanopb-3.4.0/tests/oneof_callback/ |
D | decode_oneof.c | 16 bool SubMsg3_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_t *field) in SubMsg3_callback() argument 18 if (istream && field->tag == SubMsg3_strvalue_tag) in SubMsg3_callback() 45 bool print_int32(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_int32() argument 55 bool print_string(pb_istream_t *stream, const pb_field_t *field, void **arg) in print_string() argument 81 bool msg_callback(pb_istream_t *stream, const pb_field_t *field, void **arg) in msg_callback() argument 87 OneOfMessage *topmsg = field->message; in msg_callback() 90 if (field->tag == OneOfMessage_submsg1_tag) in msg_callback() 92 SubMsg1 *msg = field->pData; in msg_callback() 97 else if (field->tag == OneOfMessage_submsg2_tag) in msg_callback() 99 SubMsg2 *msg = field->pData; in msg_callback() [all …]
|
D | encode_oneof.c | 16 bool SubMsg3_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_t *field) in SubMsg3_callback() argument 18 if (ostream && field->tag == SubMsg3_strvalue_tag) in SubMsg3_callback() 21 const char *str = *(const char**)field->pData; in SubMsg3_callback() 23 if (!pb_encode_tag_for_field(ostream, field)) in SubMsg3_callback() 35 bool encode_int32_array(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_int32_array() argument 40 if (!pb_encode_tag_for_field(stream, field)) in encode_int32_array() 49 bool encode_string(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_string() argument 53 if (!pb_encode_tag_for_field(stream, field)) in encode_string()
|
/nanopb-3.4.0/tests/cxx_callback_datatype/ |
D | cxx_callback_datatype.cpp | 10 …Message_submessages_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_t *field) in TestMessage_submessages_callback() argument 13 const std::vector<int> &v = *(const std::vector<int> *)field->pData; in TestMessage_submessages_callback() 15 if (!pb_encode_tag_for_field(ostream, field)) { in TestMessage_submessages_callback() 25 std::vector<int> &v = *(std::vector<int> *)field->pData; in TestMessage_submessages_callback() 36 bool TestMessage_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_t *field) in TestMessage_callback() argument 38 if (field->tag == TestMessage_submessages_tag) { in TestMessage_callback() 39 return TestMessage_submessages_callback(istream, ostream, field); in TestMessage_callback()
|
/nanopb-3.4.0/tests/options/ |
D | options.proto | 32 // Forced callback field 49 required Enum1 field = 1 [default = EnumValue2]; field 61 required Enum2 field = 1 [default = EnumValue1]; field 71 // Message with ignored field 85 // Message with oneof field 93 // Proto3-style optional field in proto2 file 106 // Wide descriptor option in a single field 114 // Default value for has_ field
|
/nanopb-3.4.0/generator/proto/ |
D | nanopb.proto | 14 FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible. 15 FT_CALLBACK = 1; // Always generate a callback field. 16 FT_POINTER = 4; // Always generate a dynamically allocated field. 17 FT_STATIC = 2; // Generate a static field or raise an exception if not possible. 18 FT_IGNORE = 3; // Ignore the field completely. 38 DS_AUTO = 0; // Select minimal size based on field type 46 // a field. When it is used in message or file scope, it applies to all 64 // Force type of field (callback or static allocation) 90 // Proto3 singular field does not generate a "has_" flag 103 // Generate repeated field with fixed count [all …]
|
/nanopb-3.4.0/tests/regression/issue_249/ |
D | test.c | 6 static bool write_array(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_array() argument 11 if (!pb_encode_tag_for_field(stream, field)) in write_array() 20 static bool read_array(pb_istream_t *stream, const pb_field_t *field, void **arg) in read_array() argument
|
/nanopb-3.4.0/generator/ |
D | nanopb_generator.py | 1130 def add_field(self, field): argument 1131 field.union_name = self.name 1132 field.rules = 'ONEOF' 1133 field.anonymous = self.anonymous 1134 self.fields.append(field) 1139 if field.pbtype == 'MSG_W_CB': 1248 for field in self.fields: 1249 if field.requires_custom_field_callback(): 1271 for index, f in enumerate(desc.field): 1279 …field = Field(self.name, f, field_options, self.element_path + (ProtoElement.FIELD, index), self.c… [all …]
|
/nanopb-3.4.0/examples/network_server/ |
D | server.c | 31 …tFilesResponse_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_iter_t *field) in ListFilesResponse_callback() argument 34 if (ostream != NULL && field->tag == ListFilesResponse_file_tag) in ListFilesResponse_callback() 36 DIR *dir = *(DIR**)field->pData; in ListFilesResponse_callback() 48 if (!pb_encode_tag_for_field(ostream, field)) in ListFilesResponse_callback()
|
/nanopb-3.4.0/docs/ |
D | concepts.md | 166 to a structure containing a char array and a size field. 171 repeated field, it maps to an array of whatever type is being 172 repeated. Another field will be created for the actual number of 175 `(nanopb).max_count` is also set, the field for the actual number 181 **Simple integer field:**\ 201 **Bytes field with known maximum size:**\ 205 **Bytes field with fixed length:**\ 220 > **Note:** For the `bytes` datatype, the field length checking may not be 226 `(nanopb).max_size=5` on a `bytes` field, you may be able to store 6 227 bytes there. For the `string` field type, the length limit is exact. [all …]
|
D | reference.md | 16 * `PB_FIELD_32BIT`: Add support for field tag numbers over 65535, fields larger than 64 kiB and arr… 37 Most options are related to specific message or field in `.proto` file. 43 …field. Default value is `FT_DEFAULT`, which defaults to `FT_STATIC` when possible and `FT_CALLBACK… 50 …` fields with a constant length defined by `max_size`. A separate `.size` field will then not be g… 53 * `int_size`: Override the integer type of a field. For example, specify `int_size = IS_8` to conve… 91 - All other lines should start with a field name pattern, followed by 93 - The field name pattern is matched against a string of form 94 `Message.field`. For nested messages, the string is 95 `Message.SubMessage.field`. A whole file can be matched by its 97 - The field name pattern may use the notation recognized by Python [all …]
|
/nanopb-3.4.0/tests/cyclic_messages/ |
D | encode_cyclic_callback.c | 33 static bool encode_tree(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_tree() argument 56 return pb_encode_tag_for_field(stream, field) && in encode_tree() 61 static bool encode_dictionary(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in encode_dictionary() argument 112 if (!pb_encode_tag_for_field(stream, field)) in encode_dictionary()
|
/nanopb-3.4.0/tests/regression/issue_342/ |
D | test_extensions.c | 9 static bool write_string(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) in write_string() argument 11 return pb_encode_tag_for_field(stream, field) && in write_string()
|
/nanopb-3.4.0/tests/regression/issue_544/ |
D | submsg_callback.c | 6 bool msg_callback(pb_istream_t *stream, const pb_field_t *field, void **arg) in msg_callback() argument 10 SubMessage *submsg = (SubMessage*)field->pData; in msg_callback()
|
/nanopb-3.4.0/tests/cxx_descriptor/ |
D | message.proto | 11 optional uint32 field = 1; field
|
/nanopb-3.4.0/tests/regression/issue_306/ |
D | SConscript | 1 # Check that generator gives a warning about large extension field number.
|
/nanopb-3.4.0/tests/regression/issue_487/ |
D | test.proto | 5 optional uint32 field = 1 [default = 0]; field
|