This commit is contained in:
parent
69170141f5
commit
d9d3020a36
|
@ -39,9 +39,9 @@ CONFIGFILE *configfile_open(const char *path)
|
|||
DEBUG(DBG_CONFIGFILE, "Opening configfile %s... (0x%08x)\n", path, kf);
|
||||
|
||||
if ((fp = file_open(path, "rb"))) {
|
||||
file_seeko(fp, 0, SEEK_END);
|
||||
kf->size = file_tello(fp);
|
||||
file_seeko(fp, 0, SEEK_SET);
|
||||
file_seek(fp, 0, SEEK_END);
|
||||
kf->size = file_tell(fp);
|
||||
file_seek(fp, 0, SEEK_SET);
|
||||
|
||||
kf->buf = malloc(kf->size);
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
//#endif
|
||||
|
||||
#define file_close(X) X->close(X)
|
||||
#define file_seeko(X,Y,Z) X->seeko(X,Y,Z)
|
||||
#define file_tello(X) X->tello(X)
|
||||
#define file_seek(X,Y,Z) X->seek(X,Y,Z)
|
||||
#define file_tell(X) X->tell(X)
|
||||
#define file_eof(X) X->eof(X)
|
||||
#define file_read(X,Y,Z) X->read(X,Y,Z)
|
||||
#define file_write(X,Y,Z) X->write(X,Y,Z)
|
||||
|
@ -21,8 +21,8 @@ struct file
|
|||
{
|
||||
void* internal;
|
||||
void (*close)(FILE_H *file);
|
||||
int64_t (*seeko)(FILE_H *file, int64_t offset, int32_t origin);
|
||||
int64_t (*tello)(FILE_H *file);
|
||||
int64_t (*seek)(FILE_H *file, int64_t offset, int32_t origin);
|
||||
int64_t (*tell)(FILE_H *file);
|
||||
int (*eof)(FILE_H *file);
|
||||
int (*read)(FILE_H *file, uint8_t *buf, int64_t size);
|
||||
int (*write)(FILE_H *file, uint8_t *buf, int64_t size);
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
FILE_H *file_open_linux(const char* filename, const char *mode);
|
||||
void file_close_linux(FILE_H *file);
|
||||
int64_t file_seeko_linux(FILE_H *file, int64_t offset, int32_t origin);
|
||||
int64_t file_tello_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_eof_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);
|
||||
|
@ -58,10 +58,10 @@ FILE_H *file_open_linux(const char* filename, const char *mode)
|
|||
|
||||
DEBUG(DBG_CONFIGFILE, "Opening LINUX file %s... (0x%08x)\n", filename, file);
|
||||
file->close = file_close_linux;
|
||||
file->seeko = file_seeko_linux;
|
||||
file->seek = file_seek_linux;
|
||||
file->read = file_read_linux;
|
||||
file->write = file_write_linux;
|
||||
file->tello = file_tello_linux;
|
||||
file->tell = file_tell_linux;
|
||||
|
||||
if ((fp = fopen(filename, mode))) {
|
||||
file->internal = fp;
|
||||
|
|
Loading…
Reference in New Issue