亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? file.c

?? efs文件系統源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*****************************************************************************\*                     EFSL - Embedded Filesystems Library                     **                     -----------------------------------                     **                                                                             ** Filename : file.c                                                           ** Release  : 0.3 - devel                                                      ** Description : This file contains functions dealing with files such as:      **               fopen, fread and fwrite.                                      **                                                                             ** This program is free software; you can redistribute it and/or               ** modify it under the terms of the GNU General Public License                 ** as published by the Free Software Foundation; version 2                     ** of the License.                                                             **                                                                             ** This program is distributed in the hope that it will be useful,             ** but WITHOUT ANY WARRANTY; without even the implied warranty of              ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               ** GNU General Public License for more details.                                **                                                                             ** As a special exception, if other files instantiate templates or             ** use macros or inline functions from this file, or you compile this          ** file and link it with other works to produce a work based on this file,     ** this file does not by itself cause the resulting work to be covered         ** by the GNU General Public License. However the source code for this         ** file must still be made available in accordance with section (3) of         ** the GNU General Public License.                                             **                                                                             ** This exception does not invalidate any other reasons why a work based       ** on this file might be covered by the GNU General Public License.            **                                                                             **                                                    (c)2006 Lennart Yseboodt **                                                    (c)2006 Michael De Nil   *\*****************************************************************************//*****************************************************************************/#include "file.h"/*****************************************************************************//* ****************************************************************************   * euint32 file_fread(File *file,euint32 offset, euint32 size,euint8 *buf) * Description: This function reads 'size' bytes from 'file' starting at * 'offset' and puts the result in '*buf'. * Return value: amount of bytes actually read (can differ from the given * size when the file was smaller*/euint32 file_fread(File *file,euint32 offset, euint32 size,euint8 *buf){	euint32 bytes_read=0,size_left=size,coffset=offset;	euint32 cclus,csec,cbyte;	euint32 rclus,rsec;	euint32 btr;	euint8 *tbuf;			if(!file_getAttr(file,FILE_STATUS_OPEN))return(0);		if(offset>=file->FileSize)		size_left=0; /* Offset check */		if( (offset+size > file->FileSize) && size_left!=0)		size_left=file->FileSize-offset;		while(size_left>0){			cclus = coffset/(512*file->fs->volumeId.SectorsPerCluster);		csec = (coffset/(512))%file->fs->volumeId.SectorsPerCluster;		cbyte = coffset%512;				if(cbyte!=0 || size_left<512){			btr = 512-(coffset%512)>=size_left?size_left:512-(coffset%512);		}else{			btr = 512;		}		if((fat_LogicToDiscCluster(file->fs,&(file->Cache),cclus))!=0){			return(0);		}		rclus=file->Cache.DiscCluster;		rsec=fs_clusterToSector(file->fs,rclus);						if(btr==512){			/*part_readBuf(file->fs->part,rsec+csec,buf+bytes_read);*/			part_directSectorRead(file->fs->part,rsec+csec,buf+bytes_read);		}else{			/*part_readBuf(file->fs->part,rsec+csec,tbuf);*/			tbuf = part_getSect(file->fs->part,rsec+csec,IOM_MODE_READONLY);			memCpy(tbuf+(coffset%512),buf+bytes_read,btr);			part_relSect(file->fs->part,tbuf);		}				coffset+=btr;		bytes_read+=btr;		size_left-=btr;	}			return(bytes_read);}/*****************************************************************************//* ****************************************************************************   * euint32 file_read (File *file,euint32 size,euint8 *buf) * Description: This function reads from a file, taking the FilePtr into account * and advancing it according to the freadcall. * Return value: Value obtained from fread*/euint32 file_read(File *file,euint32 size,euint8 *buf){	euint32 r;		r=file_fread(file,file->FilePtr,size,buf);	file->FilePtr+=r;	return(r);}/*****************************************************************************//* ****************************************************************************   * euint32 file_write(File *file, euint32 size,euint8 *buf) * Description: This function writes to a file, taking FilePtr into account * and advancing it according to the fwritecall. * Return value: Value obtained from fread*/euint32 file_write(File *file, euint32 size,euint8 *buf){	euint32 r;		r=file_fwrite(file,file->FilePtr,size,buf);	file->FilePtr+=r;	return(r);}/*****************************************************************************//* ****************************************************************************   * esint16 file_setpos(File *file,euint32 pos) * Description: This function does a sanity check on the requested position * and changes the fileptr accordingly. * Return value: 0 on success and -1 on failure.*/esint16 file_setpos(File *file,euint32 pos){	if(pos<=file->FileSize){		file->FilePtr=pos;		return(0);	}	return(-1);}/*****************************************************************************//* ****************************************************************************   * euint32 file_fwrite(File* file,euint32 offset,euint32 size,euint8* buf) * Description: This function writes to a file, at offset 'offset' and size 'size'. * It also updates the FileSize in the object, and discstructure. * Return value: Bytes actually written.*/euint32 file_fwrite(File* file,euint32 offset,euint32 size,euint8* buf){	euint32 need_cluster;	euint32 cclus,csec,cbyte;	euint32 size_left=size,bytes_written=0;	euint32 rclus,rsec;	euint32 coffset=offset;	euint16 btr;	euint8 *tbuf;	if(!file_getAttr(file,FILE_STATUS_OPEN) || !file_getAttr(file,FILE_STATUS_WRITE))return(0);		if(offset>file->FileSize){		offset=file->FileSize;	}		need_cluster = file_requiredCluster(file,offset,size);		if(need_cluster){		if(fat_allocClusterChain(file->fs,&(file->Cache),need_cluster+CLUSTER_PREALLOC_FILE)!=0){			return(0);		}	}		while(size_left>0){			cclus = coffset/(512*file->fs->volumeId.SectorsPerCluster);		csec = (coffset/(512))%file->fs->volumeId.SectorsPerCluster;		cbyte = coffset%512;				if(cbyte!=0 || size_left<512){			btr = 512-(coffset%512)>=size_left?size_left:512-(coffset%512);		}else{			btr = 512;		}		if((fat_LogicToDiscCluster(file->fs,&(file->Cache),cclus))!=0){			file->FileSize+=bytes_written;			dir_setFileSize(file->fs,&(file->Location),file->FileSize);			return(bytes_written);		}		rclus=file->Cache.DiscCluster;		rsec=fs_clusterToSector(file->fs,rclus);				if(btr==512){			/*part_writeBuf(file->fs->part,rsec+csec,buf+bytes_written);*/			part_directSectorWrite(file->fs->part,rsec+csec,buf+bytes_written);		}else{			/*part_readBuf(file->fs->part,rsec+csec,tbuf);*/			tbuf = part_getSect(file->fs->part,rsec+csec,IOM_MODE_READWRITE);			memCpy(buf+bytes_written,tbuf+(coffset%512),btr);			/*part_writeBuf(file->fs->part,rsec+csec,tbuf);*/			part_relSect(file->fs->part,tbuf);		}				coffset+=btr;		bytes_written+=btr;		size_left-=btr;	}		if(bytes_written>file->FileSize-offset){		file->FileSize+=bytes_written-(file->FileSize-offset);    }		return(bytes_written);	}/* ***************************************************************************\ * signed eint8 file_fopen(FileSystem *fs,File* file,eint8* filename)       * Description: This functions opens a file.                                * This function is about to be redesigned. No Docs.                        * Return value:*/esint8 file_fopen(File* file,FileSystem *fs,eint8* filename,eint8 mode){    FileLocation loc;    FileRecord wtmp;    eint8 fatfilename[11];    euint32 sec;    dir_getFatFileName(filename,fatfilename);	    switch(mode)	{        case MODE_READ:            if(fs_findFile(fs,filename,&loc,0)==1)			{                dir_getFileStructure(fs,&(file->DirEntry), &loc);                file_initFile(file,fs,&loc);				file_setAttr(file,FILE_STATUS_OPEN,1);				file_setAttr(file,FILE_STATUS_WRITE,0);                return(0);            }            return(-1);            break;        case MODE_WRITE:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产高清影视| 欧美激情在线免费观看| 亚欧色一区w666天堂| 欧美性感一区二区三区| 日韩av在线发布| 欧美电视剧在线观看完整版| 国产真实乱子伦精品视频| 国产亚洲一区二区三区四区| 国产伦精品一区二区三区视频青涩| 久久久噜噜噜久久中文字幕色伊伊 | 自拍偷自拍亚洲精品播放| 成人av在线影院| 一区二区三区四区中文字幕| 91成人免费在线视频| 午夜视频在线观看一区二区三区| 欧美一区二区二区| 成人免费视频一区| 一区二区三区 在线观看视频| 欧美久久久久中文字幕| 精品伊人久久久久7777人| 久久精品视频免费| 91久久免费观看| 免费在线欧美视频| 中文字幕精品—区二区四季| 91欧美激情一区二区三区成人| 天天综合色天天综合色h| 久久先锋影音av鲁色资源| 91玉足脚交白嫩脚丫在线播放| 天天综合网天天综合色| 国产视频一区二区在线观看| 色伊人久久综合中文字幕| 日韩av不卡一区二区| 国产欧美久久久精品影院| 欧美三区在线观看| 国产成人精品影视| 日韩福利电影在线观看| 国产精品国产三级国产aⅴ中文| 欧美日韩综合不卡| 国产成人精品综合在线观看 | 99热精品一区二区| 日韩**一区毛片| 中文字幕一区二区三区不卡| 欧美高清性hdvideosex| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产福利一区在线| 同产精品九九九| 中文字幕亚洲精品在线观看| 日韩欧美国产小视频| 91久久香蕉国产日韩欧美9色| 久久99这里只有精品| 亚洲综合久久久久| 中文字幕第一区综合| 欧美精品视频www在线观看| 大陆成人av片| 久久99国产乱子伦精品免费| 亚洲一二三四区不卡| 中文字幕va一区二区三区| 国产精品久久久久久久久图文区 | 一区二区三区91| 国产精品乱人伦一区二区| 日韩欧美一区二区视频| 欧美日韩久久不卡| 色一区在线观看| 99久久精品国产观看| 国产一区二区视频在线播放| 日韩成人精品视频| 午夜精品一区在线观看| 亚洲精品日韩综合观看成人91| 国产精品日韩成人| 国产欧美在线观看一区| 亚洲精品在线一区二区| 欧美变态tickling挠脚心| 欧美日韩国产bt| 欧美日韩精品一区二区三区四区| 97se亚洲国产综合在线| 99视频有精品| 色综合天天综合给合国产| 国产白丝精品91爽爽久久| 国产激情一区二区三区桃花岛亚洲| 久草热8精品视频在线观看| 男人的j进女人的j一区| 蜜臀va亚洲va欧美va天堂| 同产精品九九九| 蜜臀91精品一区二区三区 | 国产午夜精品久久久久久免费视| 精品久久久久久最新网址| 日韩片之四级片| 久久一日本道色综合| 久久久久久夜精品精品免费| 国产亚洲一区字幕| 1000部国产精品成人观看| 亚洲男人电影天堂| 亚洲影视资源网| 日韩黄色一级片| 久久激情综合网| 国产一区二区剧情av在线| 国产成人免费视频网站高清观看视频 | 欧亚一区二区三区| 欧美美女bb生活片| 精品国产91久久久久久久妲己 | 国产精品色一区二区三区| 国产精品另类一区| 亚洲柠檬福利资源导航| 亚洲午夜av在线| 麻豆国产精品官网| 国产成人免费在线视频| 91蜜桃网址入口| 欧美电影影音先锋| 国产性色一区二区| 亚洲图片自拍偷拍| 国产一区二区0| 色综合久久88色综合天天| 欧美精品色综合| 欧美激情一区二区在线| 亚洲成人黄色小说| 国产不卡免费视频| 欧美绝品在线观看成人午夜影视| 精品日韩欧美在线| 亚洲摸摸操操av| 美腿丝袜亚洲三区| 91在线免费看| 精品国产91洋老外米糕| 亚洲欧美日韩精品久久久久| 日韩高清在线观看| 99精品国产99久久久久久白柏| 欧美丰满美乳xxx高潮www| 中文字幕免费一区| 奇米色777欧美一区二区| 成人黄色网址在线观看| 欧美一区日本一区韩国一区| 国产精品不卡视频| 久久精品99久久久| 欧美亚洲综合色| 欧美国产综合一区二区| 蜜臀av性久久久久蜜臀av麻豆| 91视频国产观看| 久久精品视频免费| 美脚の诱脚舐め脚责91| 欧洲一区二区av| 国产精品视频在线看| 久久er99精品| 欧美精品精品一区| 亚洲日本欧美天堂| 国产成人日日夜夜| 精品国产精品网麻豆系列| 亚洲一区二区在线免费看| 丰满亚洲少妇av| 精品久久一区二区| 奇米一区二区三区av| 欧美色爱综合网| 一区二区三区在线视频免费观看| 国产美女主播视频一区| 日韩女优毛片在线| 日本成人中文字幕| 欧美日韩1234| 亚洲v精品v日韩v欧美v专区| 91视视频在线观看入口直接观看www| 国产亚洲欧美在线| 国产精品1024| 国产亚洲一区二区三区在线观看| 久久精品国产一区二区| 91精品国产手机| 石原莉奈在线亚洲二区| 欧美男男青年gay1069videost| 一区二区三区在线播放| 日本电影亚洲天堂一区| 亚洲精品中文在线影院| 99在线精品一区二区三区| 国产精品嫩草久久久久| 成人久久视频在线观看| 国产亚洲精品久| 国产.欧美.日韩| 中文字幕成人在线观看| a级精品国产片在线观看| 一区二区中文字幕在线| 色哟哟国产精品| 亚洲电影欧美电影有声小说| 欧美日韩美少妇| 日韩电影网1区2区| 精品99久久久久久| 国产一区二区毛片| 国产精品免费久久久久| av男人天堂一区| 一区二区三区精品在线| 欧美私人免费视频| 免费高清在线视频一区·| 日韩视频国产视频| 国产精品亚洲第一区在线暖暖韩国| 久久久久久免费网| 成人av影视在线观看| 玉足女爽爽91| 91精品欧美综合在线观看最新| 美女一区二区视频| 中文字幕乱码亚洲精品一区| 色综合久久久久综合体| 一区二区三区美女视频| 日韩欧美在线网站| 成人白浆超碰人人人人| 无码av中文一区二区三区桃花岛| 精品奇米国产一区二区三区|