00001 /***************************************************************************** 00002 * 00003 * $RCSfile: file__io_8h-source.html,v $ 00004 * 00005 * File Stream API / VFS API Wrapper Functions 00006 * 00007 * 00008 * This program is Copyright (C) 03/2005 Matthias Prinke 00009 * <matthias.prinke@surfeu.de> and covered by GNU's GPL. 00010 * In particular, this program is free software and comes WITHOUT 00011 * ANY WARRANTY. 00012 * 00013 * $Author: mp $ 00014 * 00015 * $Date: 2007-10-08 20:40:32 $ 00016 * 00017 * $Revision: 1.1.2.1 $ 00018 * 00019 * $Log: file__io_8h-source.html,v $ 00019 * Revision 1.1.2.1 2007-10-08 20:40:32 mp 00019 * updated for gps4palm V0.9.5 beta 00019 * 00020 * Revision 1.3 2005-05-15 10:42:25 mp 00021 * moved functions to linker section 'maps' 00022 * 00023 * Revision 1.2 2005/05/14 12:22:29 mp 00024 * added FileDescrType 00025 * added parameter fd to fread(), fclose(), feof(), rewind(), and fseek() 00026 * added return value to fopen 00027 * 00028 * Revision 1.1 2005/05/13 18:36:12 mp 00029 * moved functions from MapForm, added fseek() 00030 * 00031 * 00032 ****************************************************************************/ 00033 00034 #ifndef FILE_IO_H 00035 #define FILE_IO_H 00036 #include <Extensions/ExpansionMgr/VFSMgr.h> 00037 00038 #define FILEIO_SECTION __attribute__ ((section ("maps"))) 00039 00040 #define SEEK_SET 0 /* Seek from beginning of file. */ 00041 #define SEEK_CUR 1 /* Seek from current position. */ 00042 #define SEEK_END 2 /* Seek from end of file. */ 00043 00044 typedef struct { 00045 FileHand fh; /**< File Stream API file handle */ 00046 FileRef fr; /**< VFS API file reference */ 00047 } FileDescrType; 00048 00049 unsigned long fread(FileDescrType fd, void *buf, 00050 unsigned long size) FILEIO_SECTION; 00051 FileDescrType fopen(UInt32 filecard, const char *filename, 00052 const char *dir, Err *err) FILEIO_SECTION; 00053 void fclose(FileDescrType fd) FILEIO_SECTION; 00054 int feof(FileDescrType fd) FILEIO_SECTION; 00055 void rewind(FileDescrType fd) FILEIO_SECTION; 00056 int fseek(FileDescrType fd, long offset, int whence) FILEIO_SECTION; 00057 00058 #endif