Lines Matching refs:substream
359 bool checkreturn pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream) in pb_make_string_substream() argument
365 *substream = *stream; in pb_make_string_substream()
366 if (substream->bytes_left < size) in pb_make_string_substream()
369 substream->bytes_left = (size_t)size; in pb_make_string_substream()
374 bool checkreturn pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream) in pb_close_string_substream() argument
376 if (substream->bytes_left) { in pb_close_string_substream()
377 if (!pb_read(substream, NULL, substream->bytes_left)) in pb_close_string_substream()
381 stream->state = substream->state; in pb_close_string_substream()
384 stream->errmsg = substream->errmsg; in pb_close_string_substream()
482 pb_istream_t substream; in decode_static_field() local
486 if (!pb_make_string_substream(stream, &substream)) in decode_static_field()
489 while (substream.bytes_left > 0 && *size < field->array_size) in decode_static_field()
491 if (!decode_basic_field(&substream, PB_WT_PACKED, field)) in decode_static_field()
500 if (substream.bytes_left != 0) in decode_static_field()
502 if (!pb_close_string_substream(stream, &substream)) in decode_static_field()
670 pb_istream_t substream; in decode_pointer_field()
672 if (!pb_make_string_substream(stream, &substream)) in decode_pointer_field()
675 while (substream.bytes_left) in decode_pointer_field()
691 size_t remain = (substream.bytes_left - 1) / field->data_size + 1; in decode_pointer_field()
697 … if (!allocate_field(&substream, field->pField, field->data_size, allocated_size)) in decode_pointer_field()
707 if (!decode_basic_field(&substream, PB_WT_PACKED, field)) in decode_pointer_field()
715 if (!pb_close_string_substream(stream, &substream)) in decode_pointer_field()
750 pb_istream_t substream; in decode_callback_field() local
753 if (!pb_make_string_substream(stream, &substream)) in decode_callback_field()
758 prev_bytes_left = substream.bytes_left; in decode_callback_field()
759 if (!field->descriptor->field_callback(&substream, NULL, field)) in decode_callback_field()
761 } while (substream.bytes_left > 0 && substream.bytes_left < prev_bytes_left); in decode_callback_field()
763 if (!pb_close_string_substream(stream, &substream)) in decode_callback_field()
774 pb_istream_t substream; in decode_callback_field() local
780 substream = pb_istream_from_buffer(buffer, size); in decode_callback_field()
782 return field->descriptor->field_callback(&substream, NULL, field); in decode_callback_field()
1152 pb_istream_t substream; in pb_decode_ex() local
1153 if (!pb_make_string_substream(stream, &substream)) in pb_decode_ex()
1156 status = pb_decode_inner(&substream, fields, dest_struct, flags); in pb_decode_ex()
1158 if (!pb_close_string_substream(stream, &substream)) in pb_decode_ex()
1572 pb_istream_t substream; in pb_dec_submessage() local
1574 if (!pb_make_string_substream(stream, &substream)) in pb_dec_submessage()
1589 status = callback->funcs.decode(&substream, field, &callback->arg); in pb_dec_submessage()
1591 if (substream.bytes_left == 0) in pb_dec_submessage()
1611 status = pb_decode_inner(&substream, field->submsg_desc, field->pData, flags); in pb_dec_submessage()
1614 if (!pb_close_string_substream(stream, &substream)) in pb_dec_submessage()