libisofs
1.2.8
|
An IsoFilesystem is a handler for a source of files, or a "filesystem". More...
#include <libisofs.h>
Data Fields | |
char | type [4] |
Type of filesystem. | |
int | version |
int(* | get_root )(IsoFilesystem *fs, IsoFileSource **root) |
Get the root of a filesystem. | |
int(* | get_by_path )(IsoFilesystem *fs, const char *path, IsoFileSource **file) |
Retrieve a file from its absolute path inside the filesystem. | |
unsigned int(* | get_id )(IsoFilesystem *fs) |
Get filesystem identifier. | |
int(* | open )(IsoFilesystem *fs) |
Opens the filesystem for several read operations. | |
int(* | close )(IsoFilesystem *fs) |
Close the filesystem, thus freeing all system resources. | |
void(* | free )(IsoFilesystem *fs) |
Free implementation specific data. | |
unsigned int | refcount |
void * | data |
An IsoFilesystem is a handler for a source of files, or a "filesystem".
That is defined as a set of files that are organized in a hierarchical structure.
A filesystem allows libisofs to access files from several sources in an homogeneous way, thus abstracting the underlying operations needed to access and read file contents. Note that this doesn't need to be tied to the disc filesystem used in the partition being accessed. For example, we have an IsoFilesystem implementation to access any mounted filesystem, using standard POSIX functions. It is also legal, of course, to implement an IsoFilesystem to deal with a specific filesystem over raw partitions. That is what we do, for example, to access an ISO Image.
Each file inside an IsoFilesystem is represented as an IsoFileSource object, that defines POSIX-like interface for accessing files.
Definition at line 531 of file libisofs.h.
int(* iso_filesystem::close)(IsoFilesystem *fs) |
Close the filesystem, thus freeing all system resources.
You should call this function if you have previously open() it. Note that you can open()/close() a filesystem several times.
Definition at line 604 of file libisofs.h.
void* iso_filesystem::data |
Definition at line 614 of file libisofs.h.
void(* iso_filesystem::free)(IsoFilesystem *fs) |
Free implementation specific data.
Should never be called by user. Use iso_filesystem_unref() instead.
Definition at line 610 of file libisofs.h.
int(* iso_filesystem::get_by_path)(IsoFilesystem *fs, const char *path, IsoFileSource **file) |
Retrieve a file from its absolute path inside the filesystem.
file | Returns a pointer to a IsoFileSource object representing the file. It has to be disposed by iso_file_source_unref() when no longer needed. |
Definition at line 567 of file libisofs.h.
unsigned int(* iso_filesystem::get_id)(IsoFilesystem *fs) |
Get filesystem identifier.
If the filesystem is able to generate correct values of the st_dev and st_ino fields for the struct stat of each file, this should return an unique number, greater than 0.
To get a identifier for your filesystem implementation you should use iso_fs_global_id, incrementing it by one each time.
Otherwise, if you can't ensure values in the struct stat are valid, this should return 0.
Definition at line 583 of file libisofs.h.
int(* iso_filesystem::get_root)(IsoFilesystem *fs, IsoFileSource **root) |
Get the root of a filesystem.
Definition at line 549 of file libisofs.h.
int(* iso_filesystem::open)(IsoFilesystem *fs) |
Opens the filesystem for several read operations.
Calling this funcion is not needed at all, each time that the underlying system resource needs to be accessed, it is openned propertly. However, if you plan to execute several operations on the filesystem, it is a good idea to open it previously, to prevent several open/close operations to occur.
Definition at line 595 of file libisofs.h.
unsigned int iso_filesystem::refcount |
Definition at line 613 of file libisofs.h.
char iso_filesystem::type[4] |
Type of filesystem.
"file" -> local filesystem "iso " -> iso image filesystem
Definition at line 538 of file libisofs.h.
int iso_filesystem::version |
Definition at line 541 of file libisofs.h.