欢迎来到天天文库
浏览记录
ID:62525207
大小:117.30 KB
页数:38页
时间:2021-05-12
《SD卡FAT16文件系统源代码.docx》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、*@return-4filealreadyopenedforreading*FATLib.h:interfacefortheFATLib.*classFATLib:aportableFATdecoderclasswhichishardwareindependent.*Allhardwarespecificoperationsareabstractedwiththe*classHALayer.TheFATLibclassoperateswithonlythebuffer*whichitpassestotheclassHALayer**Author:IvanSham*Date:JUl
2、y1,2004*Version:2.0*Note:DevelopedforWilliamHueandPeteRizun*******************************************************************ChangeLog**Date
3、Author
4、Reasonforchange**Aug31/04WilliamHue*****Jul18/04AlexJiang******Jan02/05WilliamHue***/Changedchartypestounsignedchar.Putmoreparenthesesinabs()mac
5、ro.PortedtoFABbeltclip.Madelocalvariablesandfunctionsstaticandmovedtofatlib.c.Prefixedpublicfuntioswith"fat_".Variousbugfixesandclean-upforCircuitCellararticle.#ifndef_FATLIB_#define_FATLIB_#include"HALayer.h"#defineUNKNOWN0#defineFAT161#defineDIRECTORYTRUE#defineFILEFALSE*@return-4filealread
6、yopenedforreading#defineREADTRUE#defineWRITEFALSE#defineBUFFER_SIZE2#defineabs(x)(((x)>0)?(x):(-(x)))////memberfunctions:///***initializethesystem*@return0UNKNOWNfilesystem*@return1FAT16filesystem*@return3couldnotsetblocklength*@return4couldnotinitializememorycard**/unsignedcharfat_initialize
7、(void);*closesthefileindicatedbytheinput**@paramfileHandle*handleoffiletobeclosed*@return0filesucessfullyclosed*@return-1*@return-2invalidfilehandleinvalidfilesystem*@return-4filealreadyopenedforreading*@return-4filealreadyopenedforreadingsignedcharfat_close(signedcharfileHandle);/***opensthe
8、fileindicatedbytheinputpathname.Ifthepathname*pointstoavalidfile,thefileisaddedtothelistofcurrently*openedfilesforreadingandtheuniquefilehandleisreturned.@parampathnameapointertothelocationofthefiletobeopened*@parambufthebuffertobeusedtoaccesstheMMC/SDcard*@return-4filealreadyopenedforreading
9、*@return-4filealreadyopenedforreading*@return-1invalidpathname*@return-4filealreadyopenedforreadingfiledoesnotexist*@return-4filealreadyopenedforreading*@return-3filealreadyopenedforwriting*@return-4filealreadyopenedforreading*@return-10*@ret
此文档下载收益归作者所有