# fsAbstract.h

Go to the documentation of this file.

    00001 #ifndef FSABSTRACT_H
    00002 #define FSABSTRACT_H
    00003
    00004 #include <stdio.h>
    00005 #include <dirent.h>
    00006 #include <sys/types.h>
    00007 #include <device.h>
    00008 #include "file.h"
    00009
    00010 class vfs_abstract {
    00011  protected:
    00012   vfs_abstract * prev;
    00013   vfs_abstract * next;
    00014   device_t * device;
    00015  public:
    00016   /* File I/O */
    00017   virtual int     vfs_open(const char *, fileDescriptor *,int,...) { return -1; };
    00018   virtual int     vfs_close(fileDescriptor *) { return -1; };
    00019   virtual size_t  vfs_read(fileDescriptor *, void *, off_t, size_t)
    00020                   { return 0; };
    00021   virtual size_t  vfs_write(fileDescriptor *, void *, off_t, size_t)
    00022                   { return 0; };
    00023
    00024   /* Dir I/O */
    00025   virtual int     vfs_opendir(DIR *,const char *) { return -1; };
    00026   virtual int     vfs_closedir(DIR *) { return -1; };
    00027   virtual int     vfs_mkdir(const char *, mode_t) { return -1; };
    00028   virtual int     vfs_rmdir(const char *) { return -1; };
    00029   virtual int     vfs_readdir(DIR *,struct dirent *) { return -1; };
    00030
    00031   /* FS Functions */
    00032   virtual int     vfs_init(void) { return -1; };
    00033   virtual int     vfs_format(device_t *) { return -1; };
    00034   virtual void *  vfs_mknod(const char *, mode_t) { return NULL; };
    00035   virtual int     vfs_purge(void) { return -1; };
    00036   virtual int     vfs_stop(void) { return -1; };
    00037   virtual int     vfs_sync(void) { return -1; };
    00038
    00039   /* Misc Functions */
    00040   virtual int     vfs_unlink(const char *) { return -1; };
    00041   virtual int     vfs_rename(const char *,const char *) { return -1; };
    00042
    00043   virtual     ~vfs_abstract(void) { };
    00044 }; // vfs_FS
    00045
    00046 #endif // !FSABSTRACT_H