file.h
Go to the documentation of this file.00001 /*######################################################################## 00002 00003 The contents of this file are subject to the Mozilla Public License 00004 Version 1.0(the "License"); You may NOT use this file except in 00005 compliance with the License. You may obtain a copy of the License at 00006 http:// www.mozilla.org/MPL/ 00007 Software distributed under the License is distributed on an "AS IS" 00008 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00009 the License for the specific language governing rights and limitations 00010 under the License. 00011 00012 The Initial Developer of the Original Code is Shivang Patel. 00013 00014 Copyright(C) 2002. All Rights Reserved. 00015 00016 Authors: Shivang Patel 00017 Jaap de Haan(jdh) 00018 00019 ########################################################################*/ 00020 00021 #if !defined FVS__FILE_HEADER__INCLUDED__ 00022 #define FVS__FILE_HEADER__INCLUDED__ 00023 00024 00025 /* basic type definitions */ 00026 #include "fvstypes.h" 00027 00028 00034 typedef /*@mutable@*/ FvsHandle_t FvsFile_t; 00035 00036 00042 /*@only@*/ /*@null@*/ FvsFile_t FileCreate(void); 00043 00044 00051 void FileDestroy(/*@only@*/ /*@out@*/ /*@null@*/ FvsFile_t file); 00052 00053 00057 typedef enum FvsFileOptions_t 00058 { 00060 FvsFileRead = (1<<1), 00062 FvsFileWrite = (1<<2), 00064 FvsFileCreate = (1<<3) 00065 } FvsFileOptions_t; 00066 00067 00077 FvsError_t FileOpen(FvsFile_t file, const FvsString_t name, const FvsFileOptions_t flags); 00078 00079 00086 FvsError_t FileClose(FvsFile_t file); 00087 00088 00097 FvsUint_t FileRead(FvsFile_t file, /*@out@*/ FvsPointer_t data, const FvsUint_t length) 00098 /*@modifies data@*/; 00099 00100 00109 FvsUint_t FileWrite(FvsFile_t file, /*@in@*/ const FvsPointer_t data, const FvsUint_t length); 00110 00111 00117 FvsByte_t FileGetByte(FvsFile_t file); 00118 00119 00125 FvsWord_t FileGetWord(FvsFile_t file); 00126 00127 00133 FvsBool_t FileIsOpen(const FvsFile_t file); 00134 00135 00141 FvsBool_t FileIsAtEOF(const FvsFile_t file); 00142 00143 00149 FvsError_t FileCommit(FvsFile_t file); 00150 00151 00157 FvsError_t FileSeekToBegin(FvsFile_t file); 00158 00159 00165 FvsError_t FileSeekToEnd(FvsFile_t file); 00166 00167 00174 FvsError_t FileSeek(FvsFile_t file, const FvsUint_t position); 00175 00176 00182 FvsUint_t FileGetPosition(FvsFile_t file); 00183 00184 00185 #endif /* FVS__FILE_HEADER__INCLUDED__ */ 00186