Lines Matching refs:field
22 typedef bool (*pb_encoder_t)(pb_ostream_t *stream, const pb_field_t *field, const void *src) checkr…
25 static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field, const void *pDa…
26 static bool checkreturn encode_field(pb_ostream_t *stream, const pb_field_t *field, const void *pDa…
28 static bool checkreturn encode_extension_field(pb_ostream_t *stream, const pb_field_t *field, const…
29 static bool checkreturn pb_enc_varint(pb_ostream_t *stream, const pb_field_t *field, const void *sr…
30 static bool checkreturn pb_enc_uvarint(pb_ostream_t *stream, const pb_field_t *field, const void *s…
31 static bool checkreturn pb_enc_svarint(pb_ostream_t *stream, const pb_field_t *field, const void *s…
32 static bool checkreturn pb_enc_fixed32(pb_ostream_t *stream, const pb_field_t *field, const void *s…
33 static bool checkreturn pb_enc_fixed64(pb_ostream_t *stream, const pb_field_t *field, const void *s…
34 static bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src…
35 static bool checkreturn pb_enc_string(pb_ostream_t *stream, const pb_field_t *field, const void *sr…
36 static bool checkreturn pb_enc_submessage(pb_ostream_t *stream, const pb_field_t *field, const void…
111 static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field, in encode_array() argument
121 if (PB_ATYPE(field->type) != PB_ATYPE_POINTER && count > field->array_size) in encode_array()
125 if (PB_LTYPE(field->type) <= PB_LTYPE_LAST_PACKABLE) in encode_array()
127 if (!pb_encode_tag(stream, PB_WT_STRING, field->tag)) in encode_array()
131 if (PB_LTYPE(field->type) == PB_LTYPE_FIXED32) in encode_array()
135 else if (PB_LTYPE(field->type) == PB_LTYPE_FIXED64) in encode_array()
145 if (!func(&sizestream, field, p)) in encode_array()
147 p = (const char*)p + field->data_size; in encode_array()
162 if (!func(stream, field, p)) in encode_array()
164 p = (const char*)p + field->data_size; in encode_array()
172 if (!pb_encode_tag_for_field(stream, field)) in encode_array()
179 if (PB_ATYPE(field->type) == PB_ATYPE_POINTER && in encode_array()
180 (PB_LTYPE(field->type) == PB_LTYPE_STRING || in encode_array()
181 PB_LTYPE(field->type) == PB_LTYPE_BYTES)) in encode_array()
183 if (!func(stream, field, *(const void* const*)p)) in encode_array()
188 if (!func(stream, field, p)) in encode_array()
191 p = (const char*)p + field->data_size; in encode_array()
201 const pb_field_t *field, const void *pData) in encode_basic_field() argument
207 func = PB_ENCODERS[PB_LTYPE(field->type)]; in encode_basic_field()
209 if (field->size_offset) in encode_basic_field()
210 pSize = (const char*)pData + field->size_offset; in encode_basic_field()
214 if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) in encode_basic_field()
225 switch (PB_HTYPE(field->type)) in encode_basic_field()
230 if (!pb_encode_tag_for_field(stream, field)) in encode_basic_field()
232 if (!func(stream, field, pData)) in encode_basic_field()
239 if (!pb_encode_tag_for_field(stream, field)) in encode_basic_field()
242 if (!func(stream, field, pData)) in encode_basic_field()
248 if (!encode_array(stream, field, pData, *(const size_t*)pSize, func)) in encode_basic_field()
262 const pb_field_t *field, const void *pData) in encode_callback_field() argument
274 if (!callback->funcs.encode(stream, field, arg)) in encode_callback_field()
282 const pb_field_t *field, const void *pData) in encode_field() argument
284 switch (PB_ATYPE(field->type)) in encode_field()
288 return encode_basic_field(stream, field, pData); in encode_field()
291 return encode_callback_field(stream, field, pData); in encode_field()
303 const pb_field_t *field = (const pb_field_t*)extension->type->arg; in default_extension_encoder() local
304 return encode_field(stream, field, extension->dest); in default_extension_encoder()
310 const pb_field_t *field, const void *pData) in encode_extension_field() argument
313 UNUSED(field); in encode_extension_field()
338 const pb_field_t *field = fields; in pb_encode() local
342 while (field->tag != 0) in pb_encode()
344 pData = (const char*)pData + prev_size + field->data_offset; in pb_encode()
345 if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) in pb_encode()
348 prev_size = field->data_size; in pb_encode()
351 if (PB_ATYPE(field->type) == PB_ATYPE_STATIC && in pb_encode()
352 PB_HTYPE(field->type) == PB_HTYPE_REPEATED) in pb_encode()
354 prev_size *= field->array_size; in pb_encode()
357 if (PB_LTYPE(field->type) == PB_LTYPE_EXTENSION) in pb_encode()
360 if (!encode_extension_field(stream, field, pData)) in pb_encode()
366 if (!encode_field(stream, field, pData)) in pb_encode()
370 field++; in pb_encode()
465 bool checkreturn pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t *field) in pb_encode_tag_for_field() argument
468 switch (PB_LTYPE(field->type)) in pb_encode_tag_for_field()
494 return pb_encode_tag(stream, wiretype, field->tag); in pb_encode_tag_for_field()
557 static bool checkreturn pb_enc_varint(pb_ostream_t *stream, const pb_field_t *field, const void *sr… in pb_enc_varint() argument
563 switch (field->data_size) in pb_enc_varint()
575 static bool checkreturn pb_enc_uvarint(pb_ostream_t *stream, const pb_field_t *field, const void *s… in pb_enc_uvarint() argument
579 switch (field->data_size) in pb_enc_uvarint()
589 static bool checkreturn pb_enc_svarint(pb_ostream_t *stream, const pb_field_t *field, const void *s… in pb_enc_svarint() argument
593 switch (field->data_size) in pb_enc_svarint()
603 static bool checkreturn pb_enc_fixed64(pb_ostream_t *stream, const pb_field_t *field, const void *s… in pb_enc_fixed64() argument
605 UNUSED(field); in pb_enc_fixed64()
609 static bool checkreturn pb_enc_fixed32(pb_ostream_t *stream, const pb_field_t *field, const void *s… in pb_enc_fixed32() argument
611 UNUSED(field); in pb_enc_fixed32()
615 static bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src) in pb_enc_bytes() argument
625 if (PB_ATYPE(field->type) == PB_ATYPE_STATIC && in pb_enc_bytes()
626 PB_BYTES_ARRAY_T_ALLOCSIZE(bytes->size) > field->data_size) in pb_enc_bytes()
634 static bool checkreturn pb_enc_string(pb_ostream_t *stream, const pb_field_t *field, const void *sr… in pb_enc_string() argument
638 size_t max_size = field->data_size; in pb_enc_string()
641 if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) in pb_enc_string()
660 static bool checkreturn pb_enc_submessage(pb_ostream_t *stream, const pb_field_t *field, const void… in pb_enc_submessage() argument
662 if (field->ptr == NULL) in pb_enc_submessage()
665 return pb_encode_submessage(stream, (const pb_field_t*)field->ptr, src); in pb_enc_submessage()