iso_filesystem Struct Reference

#include <libisofs.h>


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 Linux 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 356 of file 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

Field Documentation

Type of filesystem.

"file" -> local filesystem "iso " -> iso image filesystem

Definition at line 363 of file libisofs.h.

Definition at line 366 of file libisofs.h.

Get the root of a filesystem.

Returns:
1 on success, < 0 on error

int(* iso_filesystem::get_by_path)(IsoFilesystem *fs, const char *path, IsoFileSource **file)

Retrieve a file from its absolute path inside the filesystem.

Returns:
1 success, < 0 error Error codes: ISO_FILE_ACCESS_DENIED ISO_FILE_BAD_PATH ISO_FILE_DOESNT_EXIST ISO_OUT_OF_MEM ISO_FILE_ERROR ISO_NULL_POINTER

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.

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

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

Free implementation specific data.

Should never be called by user. Use iso_filesystem_unref() instead.

Definition at line 435 of file libisofs.h.

Definition at line 436 of file libisofs.h.


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

Generated on Wed Aug 6 12:55:38 2008 for libisofs by  doxygen 1.5.6