flakystream.h 437 B

12345678910111213141516171819
  1. /* This module implements a custom input stream that can be set to give IO error
  2. * at specific point. */
  3. #ifndef FLAKYSTREAM_H
  4. #define FLAKYSTREAM_H
  5. #include <pb_decode.h>
  6. typedef struct {
  7. pb_istream_t stream;
  8. const uint8_t *buffer;
  9. size_t position;
  10. size_t msglen;
  11. size_t fail_after;
  12. } flakystream_t;
  13. void flakystream_init(flakystream_t *stream, const uint8_t *buffer, size_t msglen, size_t fail_after);
  14. #endif