Lines Matching refs:stream

17 bool read_callback(pb_istream_t *stream, uint8_t *buf, size_t count)  in read_callback()  argument
19 faulty_stream_t *state = stream->state; in read_callback()
24 PB_RETURN_ERROR(stream, "simulated"); in read_callback()
31 bool write_callback(pb_ostream_t *stream, const uint8_t *buf, size_t count) in write_callback() argument
33 faulty_stream_t *state = stream->state; in write_callback()
38 PB_RETURN_ERROR(stream, "simulated"); in write_callback()
59 pb_istream_t stream = {&read_callback, NULL, SIZE_MAX}; in main() local
65 stream.bytes_left = msglen; in main()
66 stream.state = &fs; in main()
70 status = pb_decode(&stream, AllTypes_fields, &msg); in main()
76 else if (strcmp(stream.errmsg, "simulated") != 0) in main()
78 fprintf(stderr, "Wrong error in decode: %s\n", stream.errmsg); in main()
83 stream.bytes_left = msglen; in main()
84 stream.state = &fs; in main()
87 status = pb_decode(&stream, AllTypes_fields, &msg); in main()
91 fprintf(stderr, "Decoding failed: %s\n", stream.errmsg); in main()
99 pb_ostream_t stream = {&write_callback, NULL, SIZE_MAX, 0}; in main() local
105 stream.max_size = msglen; in main()
106 stream.bytes_written = 0; in main()
107 stream.state = &fs; in main()
111 status = pb_encode(&stream, AllTypes_fields, &msg); in main()
117 else if (strcmp(stream.errmsg, "simulated") != 0) in main()
119 fprintf(stderr, "Wrong error in encode: %s\n", stream.errmsg); in main()
124 stream.max_size = msglen; in main()
125 stream.bytes_written = 0; in main()
126 stream.state = &fs; in main()
129 status = pb_encode(&stream, AllTypes_fields, &msg); in main()
133 fprintf(stderr, "Encoding failed: %s\n", stream.errmsg); in main()