file.h 609 B

12345678910111213141516171819202122232425262728
  1. /** @file file.h
  2. * @brief Public interface to work with files.
  3. */
  4. #ifndef _faux_file_h
  5. #define _faux_file_h
  6. // For macros definition
  7. #include <sys/types.h>
  8. #include <sys/stat.h>
  9. #include <fcntl.h>
  10. #include "faux/faux.h"
  11. typedef struct faux_file_s faux_file_t;
  12. C_DECL_BEGIN
  13. faux_file_t *faux_file_fdopen(int fd);
  14. faux_file_t *faux_file_open(const char *pathname, int flags, mode_t mode);
  15. int faux_file_close(faux_file_t *file);
  16. int faux_file_fileno(faux_file_t *file);
  17. bool_t faux_file_eof(const faux_file_t *file);
  18. char *faux_file_getline(faux_file_t *file);
  19. C_DECL_END
  20. #endif /* _faux_file_h */