| 12345678910111213141516171819202122232425262728293031 |
- //
- // Created by miti on 21/07/19.
- //
- #ifndef DECRYPTORAPP_FILEIO_H
- #define DECRYPTORAPP_FILEIO_H
- // For reading from/writing to file -sealing.
- #include <fcntl.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <errno.h>
- #include <stdint.h> // For uint8_t* as argument.
- #include <unistd.h> // For lseek
- #include <stdio.h> // For fopen
- namespace FileIO {
- int write_to_filename(char* filename, uint8_t* msg, size_t* expected_msg_length);
- int read_from_filename(char* filename, uint8_t* msg, size_t* expected_msg_length);
- int write_to_fd(int fd, uint8_t* msg, size_t* expected_msg_length);
- int read_from_fd(int fd, uint8_t* msg, size_t* expected_msg_length);
- size_t check_if_file_exists_return_size(char* filename);
- };
- #endif //DECRYPTORAPP_FILEIO_H
|