vfs.h

00001 /**************************************************************************************
00002  Copyright (c) 2002 The UbixOS Project
00003  All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
00006 
00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
00011 
00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00019 
00020  $Id$
00021 
00022 **************************************************************************************/
00023 
00024 #ifndef _VFS_H
00025 #define _VFS_H
00026 
00027 #include <ubixos/types.h>
00028 
00029 #define maxFd   32
00030 #define fdAvail 1
00031 #define fdOpen  2
00032 #define fdRead  3
00033 #define fdEof   4
00034 
00035 
00036 #define fileRead    0x0001
00037 #define fileWrite   0x0002
00038 #define fileBinary  0x0004
00039 #define fileAppend  0x0008
00040 
00041 typedef struct fileDescriptorStruct {
00042   struct fileDescriptorStruct *prev;
00043   struct fileDescriptorStruct *next;
00044   struct mountPoints          *mp;
00045   uInt16         status;
00046   uInt16         mode;
00047   uInt32         offset;
00048   uInt32         size;
00049   uInt16         length;
00050   uInt32         start;
00051   uInt8          fileName[22];
00052   char           *buffer;
00053   uInt32         dirBlock;
00054   uInt32         perms;
00055   } fileDescriptor;
00056 
00057 struct fileSystem {
00058   struct fileSystem *prev;
00059   struct fileSystem *next;
00060   int               (*vfsInitFS)(void *);
00061   int               (*vfsRead)(void *,char *,long,long);
00062   int               (*vfsWrite)(void *,char *,long,long);
00063   int               (*vfsOpenFile)(void *,void *);
00064   int               (*vfsUnlink)(char *,void *);
00065   int               (*vfsMakeDir)(char *,void *);
00066   int               (*vfsRemDir)(char *);
00067   int               (*vfsSync)(void);
00068   int               vfsType;
00069   };
00070 
00071 
00072 /* VFS Functions */
00073 int vfsInit();
00074 int vfsRegisterFS(int,void *,void *,void *,void *,void *,void *,void *,void *);
00075 struct fileSystem *vfsFindFS(int);
00076 
00077 
00078 
00079 //File IO
00080 fileDescriptor *fopen(const char *file,const char *flags);
00081 
00082 
00083 #endif
00084 

Generated on Wed Apr 28 17:49:42 2004 for Ubixos by doxygen 1.3.3