Commit 8de90f89 authored by cRTrn13's avatar cRTrn13

file forward declares

parent 73cd5873
......@@ -23,12 +23,12 @@ int64_t file_tell(FILE_H *file)
return file->tell(file);
}
int file_read(FILE_H *file, uint8_t *buf, int64_t count)
int file_read(FILE_H *file, uint8_t *buf, int64_t size)
{
return file->read(file, buf, count);
return file->read(file, buf, size);
}
int file_write(FILE_H *file, uint8_t *buf, int64_t count)
int file_write(FILE_H *file, uint8_t *buf, int64_t size)
{
return file->write(file, buf, count);
return file->write(file, buf, size);
}
......@@ -18,8 +18,8 @@ struct file
void (*close)(FILE_H *file);
int64_t (*seek)(FILE_H *file, int64_t offset, int32_t origin);
int64_t (*tell)(FILE_H *file);
int (*read)(FILE_H *file, uint8_t *buf, int64_t count);
int (*write)(FILE_H *file, uint8_t *buf, int64_t count);
int (*read)(FILE_H *file, uint8_t *buf, int64_t size);
int (*write)(FILE_H *file, uint8_t *buf, int64_t size);
};
struct file_type
......@@ -32,7 +32,7 @@ FILE_H *file_open(const char *filename, const char *mode);
void file_close(FILE_H *file);
int64_t file_seek(FILE_H *file, int64_t offset, int32_t origin);
int64_t file_tell(FILE_H *file);
int file_read(FILE_H *file, uint8_t *buf, int64_t count);
int file_write(FILE_H *file, uint8_t *buf, int64_t count);
int file_read(FILE_H *file, uint8_t *buf, int64_t size);
int file_write(FILE_H *file, uint8_t *buf, int64_t size);
#endif /* FILE_H_ */
......@@ -4,6 +4,14 @@
#include "file.h"
FILE_H *file_open_linux(const char* filename, const char *mode);
void file_close_linux(FILE_H *file);
int64_t file_seek_linux(FILE_H *file, int64_t offset, int32_t origin);
int64_t file_tell_linux(FILE_H *file);
int file_read_linux(FILE_H *file, uint8_t *buf, int64_t size);
int file_write_linux(FILE_H *file, uint8_t *buf, int64_t size);
void file_close_linux(FILE_H *file)
{
fclose((FILE *)file->internal);
......@@ -19,14 +27,14 @@ int64_t file_tell_linux(FILE_H *file)
return ftell((FILE *)file->internal);
}
int file_read_linux(FILE_H *file, uint8_t *buf, int64_t count)
int file_read_linux(FILE_H *file, uint8_t *buf, int64_t size)
{
return fread(buf, count, 1, (FILE *)file->internal);
return fread(buf, size, 1, (FILE *)file->internal);
}
int file_write_linux(FILE_H *file, uint8_t *buf, int64_t count)
int file_write_linux(FILE_H *file, uint8_t *buf, int64_t size)
{
return fwrite(buf, count, 1, (FILE *)file->internal);
return fwrite(buf, size, 1, (FILE *)file->internal);
}
FILE_H *file_open_linux(const char* filename, const char *mode)
......
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