Home
last modified time | relevance | path

Searched refs:field (Results 1 – 25 of 61) sorted by relevance

123

/nanopb-2.7.6/
Dpb_encode.c24 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 …]
Dpb_decode.c27 …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-2.7.6/tests/alltypes_proto3_callback/
Dencode_alltypes_callback.c13 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 …]
Ddecode_alltypes_callback.c14 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-2.7.6/tests/encode_unittests/
Dencode_unittests.c21 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-2.7.6/tests/alltypes_callback/
Dencode_alltypes_callback.c13 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 …]
Ddecode_alltypes_callback.c14 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-2.7.6/tests/callbacks/
Dencode_callbacks.c9 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()
Ddecode_callbacks.c10 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-2.7.6/tests/oneof_callback/
Ddecode_oneof.c16 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 …]
Dencode_oneof.c16 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-2.7.6/tests/cxx_callback_datatype/
Dcxx_callback_datatype.cpp10 …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-2.7.6/tests/options/
Doptions.proto32 // 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-2.7.6/generator/
Dnanopb_generator.py1030 def add_field(self, field): argument
1031 field.union_name = self.name
1032 field.rules = 'ONEOF'
1033 field.anonymous = self.anonymous
1034 self.fields.append(field)
1039 if field.pbtype == 'MSG_W_CB':
1148 for field in self.fields:
1149 if field.requires_custom_field_callback():
1171 for f in desc.field:
1179 field = Field(self.name, f, field_options)
[all …]
/nanopb-2.7.6/tests/regression/issue_249/
Dtest.c6 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-2.7.6/generator/proto/
Dnanopb.proto14 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-2.7.6/examples/network_server/
Dserver.c31 …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-2.7.6/docs/
Dconcepts.md166 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 …]
Dreference.md15 * `PB_FIELD_32BIT`: Add support for field tag numbers over 65535, fields larger than 64 kiB and arr…
38field. Default value is `FT_DEFAULT`, which defaults to `FT_STATIC` when possible and `FT_CALLBACK…
45 …` fields with a constant length defined by `max_size`. A separate `.size` field will then not be g…
48 * `int_size`: Override the integer type of a field. For example, specify `int_size = IS_8` to conve…
86 - All other lines should start with a field name pattern, followed by
88 - The field name pattern is matched against a string of form
89 `Message.field`. For nested messages, the string is
90 `Message.SubMessage.field`. A whole file can be matched by its
92 - The field name pattern may use the notation recognized by Python
149 The options can be defined in file, message and field scopes:
[all …]
/nanopb-2.7.6/tests/cyclic_messages/
Dencode_cyclic_callback.c33 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-2.7.6/tests/regression/issue_342/
Dtest_extensions.c9 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-2.7.6/tests/regression/issue_544/
Dsubmsg_callback.c6 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-2.7.6/tests/cxx_descriptor/
Dmessage.proto11 optional uint32 field = 1; field
/nanopb-2.7.6/tests/regression/issue_306/
DSConscript1 # Check that generator gives a warning about large extension field number.
/nanopb-2.7.6/tests/regression/issue_487/
Dtest.proto5 optional uint32 field = 1 [default = 0]; field

123