added port of dosfsck. Does not work yet as I cannot figure how to open the device...
[reactos.git] / rosapps / sysutils / dosfsck / io.h
1 /* io.h - Virtual disk input/output */
2
3 /* Written 1993 by Werner Almesberger */
4
5 /* FAT32, VFAT, Atari format support, and various fixes additions May 1998
6 * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
7
8
9 #ifndef _IO_H
10 #define _IO_H
11
12 //#include <sys/types.h> /* for loff_t */
13 #include "dosfsck.h"
14
15 /* In earlier versions, an own llseek() was used, but glibc lseek() is
16 * sufficient (or even better :) for 64 bit offsets in the meantime */
17 #define llseek lseek
18
19 void fs_open(char *path,int rw);
20
21 /* Opens the file system PATH. If RW is zero, the file system is opened
22 read-only, otherwise, it is opened read-write. */
23
24 void fs_read(loff_t pos,int size,void *data);
25
26 /* Reads SIZE bytes starting at POS into DATA. Performs all applicable
27 changes. */
28
29 int fs_test(loff_t pos,int size);
30
31 /* Returns a non-zero integer if SIZE bytes starting at POS can be read without
32 errors. Otherwise, it returns zero. */
33
34 void fs_write(loff_t pos,int size,void *data);
35
36 /* If write_immed is non-zero, SIZE bytes are written from DATA to the disk,
37 starting at POS. If write_immed is zero, the change is added to a list in
38 memory. */
39
40 int fs_close(int write);
41
42 /* Closes the file system, performs all pending changes if WRITE is non-zero
43 and removes the list of changes. Returns a non-zero integer if the file
44 system has been changed since the last fs_open, zero otherwise. */
45
46 int fs_changed(void);
47
48 /* Determines whether the file system has changed. See fs_close. */
49
50 extern unsigned device_no;
51
52 /* Major number of device (0 if file) and size (in 512 byte sectors) */
53
54 #endif