1
0
Fork 0

file abs layer

This commit is contained in:
cRTrn13 2009-10-15 09:52:36 +00:00
parent ab438302bf
commit 70d0d533c6
2 changed files with 25 additions and 0 deletions

22
src/file/file.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef FILE_H_
#define FILE_H_
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
typedef struct file FILE_H;
struct file
{
void* internal;
void (*close)(FILE_H* file);
int64_t (*seek)(FILE_H* file, int64_t offset, int64_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);
};
FILE_H* file_open(const char* filename, uint8_t mode);
#endif /* FILE_H_ */

3
src/file/file_linux.c Normal file
View File

@ -0,0 +1,3 @@
#include "file.h"