|
Packit |
ff56ff |
/* io.h - Virtual disk input/output
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
|
|
Packit |
ff56ff |
Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
|
|
Packit |
ff56ff |
Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
This program is free software: you can redistribute it and/or modify
|
|
Packit |
ff56ff |
it under the terms of the GNU General Public License as published by
|
|
Packit |
ff56ff |
the Free Software Foundation, either version 3 of the License, or
|
|
Packit |
ff56ff |
(at your option) any later version.
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
This program is distributed in the hope that it will be useful,
|
|
Packit |
ff56ff |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
ff56ff |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
ff56ff |
GNU General Public License for more details.
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
You should have received a copy of the GNU General Public License
|
|
Packit |
ff56ff |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
The complete text of the GNU General Public License
|
|
Packit |
ff56ff |
can be found in /usr/share/common-licenses/GPL-3 file.
|
|
Packit |
ff56ff |
*/
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
/* FAT32, VFAT, Atari format support, and various fixes additions May 1998
|
|
Packit |
ff56ff |
* by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
#ifndef _IO_H
|
|
Packit |
ff56ff |
#define _IO_H
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
#include <fcntl.h> /* for off_t */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
void fs_open(char *path, int rw);
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
/* Opens the filesystem PATH. If RW is zero, the filesystem is opened
|
|
Packit |
ff56ff |
read-only, otherwise, it is opened read-write. */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
void fs_read(off_t pos, int size, void *data);
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
/* Reads SIZE bytes starting at POS into DATA. Performs all applicable
|
|
Packit |
ff56ff |
changes. */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
int fs_test(off_t pos, int size);
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
/* Returns a non-zero integer if SIZE bytes starting at POS can be read without
|
|
Packit |
ff56ff |
errors. Otherwise, it returns zero. */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
void fs_write(off_t pos, int size, void *data);
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
/* If write_immed is non-zero, SIZE bytes are written from DATA to the disk,
|
|
Packit |
ff56ff |
starting at POS. If write_immed is zero, the change is added to a list in
|
|
Packit |
ff56ff |
memory. */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
int fs_close(int write);
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
/* Closes the filesystem, performs all pending changes if WRITE is non-zero
|
|
Packit |
ff56ff |
and removes the list of changes. Returns a non-zero integer if the file
|
|
Packit |
ff56ff |
system has been changed since the last fs_open, zero otherwise. */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
int fs_changed(void);
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
/* Determines whether the filesystem has changed. See fs_close. */
|
|
Packit |
ff56ff |
|
|
Packit |
ff56ff |
#endif
|