00001 /***************************************************************************************** 00002 Copyright (c) 2002-2004 The UbixOS Project 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, are 00006 permitted provided that the following conditions are met: 00007 00008 Redistributions of source code must retain the above copyright notice, this list of 00009 conditions, the following disclaimer and the list of authors. Redistributions in binary 00010 form must reproduce the above copyright notice, this list of conditions, the following 00011 disclaimer and the list of authors in the documentation and/or other materials provided 00012 with the distribution. Neither the name of the UbixOS Project nor the names of its 00013 contributors may be used to endorse or promote products derived from this software 00014 without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 00017 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00018 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 00019 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00020 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00021 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00022 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 00023 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 00026 $Id$ 00027 00028 *****************************************************************************************/ 00029 00030 #ifndef _VFS_H 00031 #define _VFS_H 00032 00033 #include <ubixos/types.h> 00034 #include <vfs/file.h> 00035 #include <vfs/mount.h> 00036 00037 #define maxFd 32 00038 #define fdAvail 1 00039 #define fdOpen 2 00040 #define fdRead 3 00041 #define fdEof 4 00042 00043 00044 #define fileRead 0x0001 00045 #define fileWrite 0x0002 00046 #define fileBinary 0x0004 00047 #define fileAppend 0x0008 00048 00049 struct fileSystem { 00050 struct fileSystem *prev; 00051 struct fileSystem *next; 00052 int (*vfsInitFS)(void *); 00053 int (*vfsRead)(void *,char *,long,long); 00054 int (*vfsWrite)(void *,char *,long,long); 00055 int (*vfsOpenFile)(void *,void *); 00056 int (*vfsUnlink)(char *,void *); 00057 int (*vfsMakeDir)(char *,void *); 00058 int (*vfsRemDir)(char *); 00059 int (*vfsSync)(void); 00060 int vfsType; 00061 }; 00062 00063 00064 /* VFS Functions */ 00065 int vfs_init(); 00066 /* 00067 *int vfsRegisterFS(int,void *,void *,void *,void *,void *,void *,void *,void *); 00068 */ 00069 int vfsRegisterFS(struct fileSystem); 00070 00071 struct fileSystem *vfsFindFS(int); 00072 00073 00074 00075 //File IO 00076 fileDescriptor *fopen(const char *file,const char *flags); 00077 00078 00079 #endif 00080 00081 /*** 00082 $Log$ 00083 Revision 1.1.1.1 2006/06/01 12:46:13 reddawg 00084 ubix2 00085 00086 Revision 1.2 2005/10/12 00:13:37 reddawg 00087 Removed 00088 00089 Revision 1.1.1.1 2005/09/26 17:23:58 reddawg 00090 no message 00091 00092 Revision 1.5 2004/07/23 09:10:06 reddawg 00093 ubixfs: cleaned up some functions played with the caching a bit 00094 vfs: renamed a bunch of functions 00095 cleaned up a few misc bugs 00096 00097 END 00098 ***/ 00099
1.4.7