Lines Matching refs:stream
17 bool callback(pb_istream_t *stream, uint8_t *buf, size_t count) in callback() argument
19 FILE *file = (FILE*)stream->state; in callback()
40 stream->bytes_left = 0; in callback()
62 bool raw_decode(pb_istream_t *stream, const char *indent) in raw_decode() argument
66 while (stream->bytes_left) in raw_decode()
73 if (!pb_decode_tag(stream, &wire_type, &tag, &eof)) in raw_decode()
81 printf("ERROR: Failed to parse tag: %s\n", PB_GET_ERROR(stream)); in raw_decode()
100 if (!pb_decode_varint(stream, &value)) in raw_decode()
102 printf("\n%sERROR: Failed to parse varint: %s\n", indent, PB_GET_ERROR(stream)); in raw_decode()
114 if (!pb_decode_fixed64(stream, &value)) in raw_decode()
116 printf("\n%sERROR: Failed to parse fixed64: %s\n", indent, PB_GET_ERROR(stream)); in raw_decode()
128 if (!pb_decode_fixed32(stream, &value)) in raw_decode()
130 printf("\n%sERROR: Failed to parse fixed32: %s\n", indent, PB_GET_ERROR(stream)); in raw_decode()
142 if (!pb_make_string_substream(stream, &substream)) in raw_decode()
144 printf("ERROR: Failed to parse string length: %s\n", PB_GET_ERROR(stream)); in raw_decode()
169 pb_close_string_substream(stream, &substream); in raw_decode()
184 pb_istream_t stream = {&callback, NULL, SIZE_MAX}; in main() local
185 stream.state = stdin; in main()
188 if (!raw_decode(&stream, "")) in main()