libisofs  1.2.8
Data Fields
iso_filesystem Struct Reference

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. More...
 
int version
 
int(* get_root )(IsoFilesystem *fs, IsoFileSource **root)
 Get the root of a filesystem. More...
 
int(* get_by_path )(IsoFilesystem *fs, const char *path, IsoFileSource **file)
 Retrieve a file from its absolute path inside the filesystem. More...
 
unsigned int(* get_id )(IsoFilesystem *fs)
 Get filesystem identifier. More...
 
int(* open )(IsoFilesystem *fs)
 Opens the filesystem for several read operations. More...
 
int(* close )(IsoFilesystem *fs)
 Close the filesystem, thus freeing all system resources. More...
 
void(* free )(IsoFilesystem *fs)
 Free implementation specific data. More...
 
unsigned int refcount
 
void * data
 

Detailed Description

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.

Since
0.6.2

Definition at line 531 of file libisofs.h.

Field Documentation

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.

Returns
1 on success, < 0 on error (has to be a valid libisofs error code)

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.

Parameters
fileReturns a pointer to a IsoFileSource object representing the file. It has to be disposed by iso_file_source_unref() when no longer needed.
Returns
1 success, < 0 error (has to be a valid libisofs error code) Error codes: ISO_FILE_ACCESS_DENIED ISO_FILE_BAD_PATH ISO_FILE_DOESNT_EXIST ISO_OUT_OF_MEM ISO_FILE_ERROR ISO_NULL_POINTER

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.

Returns
1 on success, < 0 on error (has to be a valid libisofs error code)

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.

Returns
1 on success, < 0 on error (has to be a valid libisofs error code)

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.


The documentation for this struct was generated from the following file:

Generated for libisofs by  doxygen 1.8.3.1