Main Page | Data Structures | File List | Data Fields | Globals

mb_file_io.h

00001 /*
00002  *  mb_file_io.h
00003  *
00004  *  Copyright (C) Moritz Bunkus - March 2004
00005  *      
00006  *  mb_file_io is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU Lesser General Public License as published by
00008  *  the Free Software Foundation; either version 2.1, or (at your option)
00009  *  any later version.
00010  *   
00011  *  mb_file_io is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *   
00016  *  You should have received a copy of the GNU Lesser General Public License
00017  *  along with this library; see the file COPYING.  If not, write to
00018  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
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 /* __MB_FILE_IO */

Generated on Thu Jun 24 16:21:13 2004 for librmff by doxygen 1.3.6-20040222