FileIO.h 511 B

123456789101112131415161718192021222324
  1. //
  2. // Created by miti on 21/07/19.
  3. //
  4. #ifndef DECRYPTORAPP_FILEIO_H
  5. #define DECRYPTORAPP_FILEIO_H
  6. // For reading from/writing to file -sealing.
  7. #include <fcntl.h>
  8. #include <sys/types.h>
  9. #include <sys/stat.h>
  10. #include <errno.h>
  11. namespace FileIO {
  12. int write_to_fd(int fd, uint8_t* msg, uint32_t* expected_msg_length);
  13. int read_from_fd(int fd, uint8_t* msg, uint32_t* expected_msg_length);
  14. size_t check_if_file_exists_return_size(char* filename, int* fd_ptr);
  15. };
  16. #endif //DECRYPTORAPP_FILEIO_H