Commit 20617dcb authored by cRTrn13's avatar cRTrn13

file handler

parent 2f70bb2b
#include "file.h"
Fhat ILE_H* file_open(const char* filename, uint8_t mode)
{
//file_open_linux(filename, mode);
}
FILE_H* file_close(FILE_H* file)
FILE_H* file_seek(FILE_H* file, int64_t offset, int64_t origin);
FILE_H* file_tell(FILE_H* file);
FILE_H* file_read(FILE_H* file, uint8_t *buf, int64_t count);
FILE_H* file_write(FILE_H* file, uint8_t *buf, int64_t count);
......@@ -18,5 +18,10 @@ struct file
};
FILE_H* file_open(const char* filename, uint8_t mode);
FILE_H* file_close(FILE_H* file);
FILE_H* file_seek(FILE_H* file, int64_t offset, int64_t origin);
FILE_H* file_tell(FILE_H* file);
FILE_H* file_read(FILE_H* file, uint8_t *buf, int64_t count);
FILE_H* file_write(FILE_H* file, uint8_t *buf, int64_t count);
#endif /* FILE_H_ */
#include <malloc.h>
#include "file.h"
void file_close_linux(FILE_H* file);
int64_t file_seek_linux(FILE_H* file, int64_t offset, int64_t origin);
int64_t file_tell_linux(FILE_H* file);
int file_read_linux(FILE_H* file, uint8_t *buf, int64_t count);
int file_write_linux(FILE_H* file, uint8_t *buf, int64_t count);
FILE_H* file_open_linux(const char* filename, uint8_t mode)
{
FILE_H *file = malloc(sizeof(FILE_H));
file->close = file_close_linux;
file->seek = file_seek_linux;
file->read = file_read_linux;
file->write = file_write_linux;
file->tell = file_tell_linux;
return file;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment