private.h 523 B

12345678910111213141516171819202122
  1. #include "faux/faux.h"
  2. #include "faux/file.h"
  3. /** @brief Chunk size to allocate buffer */
  4. #define FAUX_FILE_CHUNK_SIZE 128
  5. struct faux_chunk_s {
  6. void *buf; // Allocated buffer
  7. size_t size; // Size of allocated buffer
  8. void *start; // Pointer to data start
  9. void *end; // Pointer to data end
  10. };
  11. typedef struct faux_chunk_s faux_chunk_t;
  12. struct faux_file_s {
  13. int fd; // File descriptor
  14. char *buf; // Data buffer
  15. size_t buf_size; // Current buffer size
  16. size_t len; // Current data length
  17. bool_t eof; // EOF flag
  18. };