2 * Creation Date: <2001/05/06 17:12:45 samuel>
3 * Time-stamp: <2003/10/22 11:43:45 samuel>
7 * Generic file system access
9 * Copyright (C) 2001, 2002, 2003 Samuel Rydh (samuel@ibrium.se)
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation
21 typedef struct fs_ops fs_ops_t;
22 typedef struct opaque_struct file_desc_t;
24 #define fs_open_path( fs, path ) (fs)->open_path( fs, path )
25 #define fs_search_rom( fs ) (fs)->search_rom( fs )
26 #define fs_search_file( fs, name ) (fs)->search_file( fs, name )
27 #define fs_vol_name( fs, buf, size ) (fs)->vol_name( fs, buf, size )
31 int fd; /* owner block device */
34 void (*close_fs)( fs_ops_t *fs );
35 file_desc_t *(*open_path)( fs_ops_t *fs, const char *path );
36 file_desc_t *(*search_rom)( fs_ops_t *fs );
37 file_desc_t *(*search_file)( fs_ops_t *fs, const char *name );
38 char *(*vol_name)( fs_ops_t *fs, char *buf, int size );
41 void (*close)( file_desc_t *file );
42 int (*read)( file_desc_t *file, void *buf, size_t count );
43 int (*lseek)( file_desc_t *file, off_t offset, int whence );
44 char *(*get_path)( file_desc_t *file, char *buf, int len );
45 void (*dir)( file_desc_t *file );
47 const char *(*get_fstype)( fs_ops_t *fs );
50 extern fs_ops_t *fs_open( int fs_type, int fd );
51 extern void fs_close( fs_ops_t *fs );
52 const char *fs_get_name( fs_ops_t *fs );
55 extern int fs_hfsp_open( int fd, fs_ops_t *fs );
56 extern int fs_hfsp_probe( int fd, long long offs );
58 static inline int fs_hfsp_open( int fd, fs_ops_t *fs ) { return -1; }
59 static inline int fs_hfsp_probe( int fd, long long offs ) { return -1; }
63 extern int fs_hfs_open( int fd, fs_ops_t *fs );
64 extern int fs_hfs_probe( int fd, long long offs );
66 static inline int fs_hfs_open( int fd, fs_ops_t *fs ) { return -1; }
67 static inline int fs_hfs_probe( int fd, long long offs ) { return -1; }
71 extern int fs_iso9660_open( int fd, fs_ops_t *fs );
72 extern int fs_iso9660_probe( int fd, long long offs );
74 static inline int fs_iso9660_open( int fd, fs_ops_t *fs ) { return -1; }
75 static inline int fs_iso9660_probe( int fd, long long offs ) { return -1; }
79 extern int fs_ext2_open( int fd, fs_ops_t *fs );
80 extern int fs_ext2_probe( int fd, long long offs );
82 static inline int fs_ext2_open( int fd, fs_ops_t *fs ) { return -1; }
83 static inline int fs_ext2_probe( int fd, long long offs ) { return -1; }
87 extern int fs_grubfs_open( int fd, fs_ops_t *fs );
88 extern int fs_grubfs_probe( int fd, long long offs );
90 static inline int fs_grubfs_open( int fd, fs_ops_t *fs ) { return -1; }
91 static inline int fs_grubfs_probe( int fd, long long offs ) { return -1; }
97 extern char *get_hfs_vol_name( int fd, char *buf, int size );