Lines Matching refs:size
130 size_t size; in encode_array() local
151 size = 4 * (size_t)count; in encode_array()
155 size = 8 * (size_t)count; in encode_array()
168 size = sizestream.bytes_written; in encode_array()
171 if (!pb_encode_varint(stream, (pb_uint64_t)size)) in encode_array()
175 return pb_write(stream, NULL, size); /* Just sizing.. */ in encode_array()
297 return bytes->size == 0; in pb_check_proto3_default_value()
554 bool pb_get_encoded_size(size_t *size, const pb_msgdesc_t *fields, const void *src_struct) in pb_get_encoded_size() argument
561 *size = stream.bytes_written; in pb_get_encoded_size()
702 bool checkreturn pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size) in pb_encode_string() argument
704 if (!pb_encode_varint(stream, (pb_uint64_t)size)) in pb_encode_string()
707 return pb_write(stream, buffer, size); in pb_encode_string()
714 size_t size; in pb_encode_submessage() local
725 size = substream.bytes_written; in pb_encode_submessage()
727 if (!pb_encode_varint(stream, (pb_uint64_t)size)) in pb_encode_submessage()
731 return pb_write(stream, NULL, size); /* Just sizing */ in pb_encode_submessage()
733 if (stream->bytes_written + size > stream->max_size) in pb_encode_submessage()
740 substream.max_size = size; in pb_encode_submessage()
754 if (substream.bytes_written != size) in pb_encode_submessage()
855 bytes->size > field->data_size - offsetof(pb_bytes_array_t, bytes)) in pb_enc_bytes()
860 return pb_encode_string(stream, bytes->bytes, (size_t)bytes->size); in pb_enc_bytes()
865 size_t size = 0; in pb_enc_string() local
889 size = 0; /* Treat null pointer as an empty string */ in pb_enc_string()
896 while (size < max_size && *p != '\0') in pb_enc_string()
898 size++; in pb_enc_string()
913 return pb_encode_string(stream, (const pb_byte_t*)str, size); in pb_enc_string()