00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __MB_FILE_IO_H
00023 #define __MB_FILE_IO_H
00024
00025 #include <inttypes.h>
00026
00027 #define MB_OPEN_MODE_READING 0
00028 #define MB_OPEN_MODE_WRITING 1
00029
00030 typedef void *(*mb_file_open_t)(const char *path, int mode);
00031 typedef int (*mb_file_close_t)(void *file);
00032 typedef int64_t (*mb_file_read_t)(void *file, void *buffer, int64_t bytes);
00033 typedef int64_t (*mb_file_write_t)(void *file, const void *buffer,
00034 int64_t bytes);
00035 typedef int64_t (*mb_file_tell_t)(void *file);
00036 typedef int64_t (*mb_file_seek_t)(void *file, int64_t offset, int whence);
00037
00038 typedef struct {
00039 mb_file_open_t open;
00040 mb_file_close_t close;
00041 mb_file_read_t read;
00042 mb_file_write_t write;
00043 mb_file_tell_t tell;
00044 mb_file_seek_t seek;
00045 } mb_file_io_t;
00046
00047 extern mb_file_io_t std_mb_file_io;
00048
00049 #endif