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

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

?? ui.c

?? stm32+ucos-ii
?? C
字號:
/*****************************************************************************\
*              efs - General purpose Embedded Filesystem library              *
*          --------------------- -----------------------------------          *
*                                                                             *
* Filename : ui.c                                                             *
* Description : This file contains functions which will be presented to the   *
*               user of this library.                                         *
*                                                                             *
* 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 "ui.h"
/*****************************************************************************/

/*****************************************************************************
 * short listfiles(char *dir)
 *
 * Deschription: This function returns the number of files / directories
 * inside the given directory.
 *
 * Return value: number of files/directories in the given directory or -1
 * if directory does not exist.
\*****************************************************************************/

short listFiles(FileSystem *fs, char *dirname)
{
	unsigned long startCluster;
	unsigned char fileEntryCount;
	unsigned short counter=0;
	unsigned long offset=0;
	FileRecord fileEntry;
	FileLocation loc;
	unsigned char buf[512];
	File dir;
	unsigned short i;
	
	/* Find out if we are searching in the root dir or in */
	if(dirname[0]=='/' && dirname[1]=='\0')
	{
		if( (fs->type == FAT12) || (fs->type == FAT16) )
		{
			for(i=0;i<=(fs->volumeId.RootEntryCount/16);i++)
			{
				loc.Sector=fs->FirstSectorRootDir + i;
				part_readBuf(fs->part,loc.Sector,buf);
				/* I STOPPED HERE*/
				/* FIXME */
			}
		}
	}
	else /* Normal directory */
	{
		/* Check if path given is a directory */
		if(fs_findFile(fs,dirname,&loc,0)!=2)
		{
			FUNC_OUT((TXT("")));
			return(-1);
		}
	
		/* Find out what the startcluster of the directory is */
		part_readBuf(fs->part,loc.Sector, buf);
		fileEntry = *(((FileRecord*)buf) + loc.Offset);
		startCluster = (((unsigned long)fileEntry.FirstClusterHigh)<<16) 
			+ fileEntry.FirstClusterLow;

	    /* Init of dir */
		dir.fs=fs;
		dir.Cache.LogicCluster=-1;
		dir.Cache.FirstCluster=startCluster;
		dir.DirEntry.Attribute=ATTR_DIRECTORY;
	
		while((file_fread(&dir,offset,512,buf)))
		{
			//DBG((TXT("Read 512 bytes from dir with offset %li.\n"),offset));
			for(fileEntryCount=0;fileEntryCount<16;fileEntryCount++)
			{
				fileEntry = *(((FileRecord*)buf) + fileEntryCount);
				if( !( (fileEntry.Attribute & 0x0F) == 0x0F ) )
				{
					if
					(
					 (fileEntry.FileName[0]>='A' && fileEntry.FileName[0]<='Z')
					 ||
					 (fileEntry.FileName[0]>='0' && fileEntry.FileName[0]<='9')
					)
					{
						//DBG((TXT("Filename: %s\n"),fileEntry.FileName));
						counter++;
					}
				}
			}
			offset+=512;
		}
	}
	
	FUNC_OUT((TXT("")));
	return(counter);
	
	//return(-1);
}
/*****************************************************************************/

/* ****************************************************************************  
 * esint16 rmfile(FileSystem *fs,euint8* filename)
 * Description: This function takes a filename as argument and deletes it,
 * by freeing it's clusterchain, and deleting it's entry from the directory.
 * Return value: 0 on success, -1 on errors, like file not found.
*/
esint16 rmfile(FileSystem *fs,euint8* filename)
{
	FileLocation loc;
	ClusterChain cache;
	euint8* buf;
	euint32 firstCluster=0;
	
	if((fs_findFile(fs,(eint8*)filename,&loc,0))==1){
		buf=part_getSect(fs->part,loc.Sector,IOM_MODE_READWRITE);
		firstCluster = ex_getb16(buf,loc.Offset*32+20);
		firstCluster <<= 16;
		firstCluster += ex_getb16(buf,loc.Offset*32+26);
		/* Bugfix:
		 * By clearing the entire structure, you mark end of directory.
		 * If this is not the case, files that are further away cannot
		* be opened anymore by implementations that follow the spec. */
		/*memClr(buf+(loc.Offset*32),32);*/
		*(buf+(loc.Offset*32)+0) = 0xE5; /* Mark file deleted */
		part_relSect(fs->part,buf);
		cache.DiscCluster = cache.LastCluster = cache.Linear = cache.LogicCluster = 0;
		cache.FirstCluster = firstCluster;
 		fat_unlinkClusterChain(fs,&cache);
		return(0);
	}
	return(-1);
}

/*****************************************************************************/
esint8 mkdir(FileSystem *fs,eint8* dirname)
{
	FileLocation loc;
	FileRecord direntry;
	euint32 nc,parentdir;
	euint8* buf;
	eint8 ffname[11];
	
	if( fs_findFile(fs,dirname,&loc,&parentdir) ){
		return(-1);
	}
	if(parentdir==0)return(-2);
	
	if(!fs_findFreeFile(fs,dirname,&loc,0))return(-3);
	
	/* You may never search for a free cluster, and the call
	 * functions that may cause changes to the FAT table, that
	 * is why getNextFreeCluster has to be called AFTER calling
	 * fs_findFreeFile, which may have to expand a directory in
	 * order to store the new filerecord !! 
	 */
	
	nc = fs_getNextFreeCluster(fs,fs_giveFreeClusterHint(fs));
	if(nc==0)return(0);
	
	fs_clearCluster(fs,nc);
	
	buf = part_getSect(fs->part,loc.Sector,IOM_MODE_READWRITE);

	dir_getFatFileName(dirname,ffname);
	memClr(&direntry,sizeof(direntry));
	memCpy(ffname,&direntry,11);
	direntry.FileSize = 0;
	direntry.FirstClusterHigh=nc>>16;
	direntry.FirstClusterLow=nc&0xFFFF;
	direntry.Attribute = ATTR_DIRECTORY;
	memCpy(&direntry,buf+(32*loc.Offset),32);
		
	part_relSect(fs->part,buf);
	
	buf = part_getSect(fs->part,fs_clusterToSector(fs,nc),IOM_MODE_READWRITE);
	
	memClr(&direntry,sizeof(direntry));
	memCpy(".          ",&direntry,11);
	direntry.Attribute = ATTR_DIRECTORY;
	direntry.FileSize = 0;
	direntry.FirstClusterHigh=nc>>16;
	direntry.FirstClusterLow=nc&0xFFFF;
	memCpy(&direntry,buf,32);
	
	if(fs->type == FAT32 && parentdir == fs->volumeId.RootCluster){
		parentdir = 0;
	}
	if(fs->type != FAT32 && parentdir<=1){
		parentdir = 0;
	} 
	
	memClr(&direntry,sizeof(direntry));
	memCpy("..         ",&direntry,11);
	direntry.Attribute = ATTR_DIRECTORY;
	direntry.FileSize = 0;
	direntry.FirstClusterHigh=parentdir>>16;
	direntry.FirstClusterLow=parentdir&0xFFFF;
	memCpy(&direntry,buf+32,32);

	part_relSect(fs->part,buf);
	
	fat_setNextClusterAddress(fs,nc,fat_giveEocMarker(fs));

	return(0);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品视频免费看| 国产一区二区三区电影在线观看 | 91精品国产综合久久精品| 精品国产在天天线2019| 自拍偷拍国产精品| 国产一区视频导航| 欧美乱妇15p| 中文字幕日韩精品一区| 久久成人免费网| 欧美日韩一区二区在线观看视频| 精品国产髙清在线看国产毛片| 一区二区三区资源| 不卡一卡二卡三乱码免费网站| 日韩精品一区在线| 婷婷一区二区三区| 91麻豆国产福利精品| 国产亚洲综合av| 日韩电影免费在线观看网站| 在线免费不卡电影| √…a在线天堂一区| 国产精品一区免费视频| 日韩一区二区免费高清| 亚洲综合图片区| 97久久精品人人澡人人爽| 日本一区二区高清| 国产一区二区成人久久免费影院| 7777精品伊人久久久大香线蕉 | 91久久精品一区二区三| 久久久久久亚洲综合| 国产综合成人久久大片91| 精品美女被调教视频大全网站| 奇米一区二区三区av| 欧美日韩一区二区欧美激情| 亚洲国产精品人人做人人爽| 91国产丝袜在线播放| 一区二区高清视频在线观看| 色综合亚洲欧洲| 亚洲免费资源在线播放| 91在线无精精品入口| 一区二区在线免费观看| 一本久道中文字幕精品亚洲嫩| 亚洲你懂的在线视频| 日本黄色一区二区| 亚洲va欧美va人人爽| 欧美一区二区三区影视| 美女性感视频久久| 26uuu欧美| 成人爽a毛片一区二区免费| 中文在线一区二区| 色婷婷激情久久| 一区二区三区美女视频| 91精品国产91热久久久做人人| 蜜桃av一区二区三区电影| 精品久久久久99| 成人精品免费看| 亚洲六月丁香色婷婷综合久久| 欧美性生交片4| 秋霞午夜av一区二区三区| 久久青草欧美一区二区三区| 成人激情免费电影网址| 一区二区三区国产豹纹内裤在线| 欧美精品一二三区| 国产一区二区不卡老阿姨| 中文字幕在线不卡视频| 欧美日韩高清一区二区| 免费国产亚洲视频| 成人欧美一区二区三区| 欧美亚洲国产bt| 激情丁香综合五月| 一区二区三区.www| 精品久久久久久久久久久院品网| 成人av在线播放网址| 亚洲成精国产精品女| 久久久不卡影院| 欧美专区日韩专区| 国产精品亚洲视频| 午夜久久久久久久久| 欧美韩国日本综合| 欧美一区二区三区思思人| 国产69精品久久99不卡| 五月综合激情日本mⅴ| 国产精品美女久久久久久2018 | 蜜桃av一区二区| 亚洲欧美日韩中文播放| 精品久久国产老人久久综合| 欧美亚洲综合一区| 国产精品888| 蜜桃视频在线观看一区| 一级女性全黄久久生活片免费| 久久精品视频一区二区三区| 欧美高清性hdvideosex| 99re免费视频精品全部| 国产精品99久久久| 蜜桃视频一区二区| 爽好多水快深点欧美视频| 国产精品沙发午睡系列990531| 欧美成人精品1314www| 欧美日韩国产影片| 91性感美女视频| 懂色中文一区二区在线播放| 狠狠久久亚洲欧美| 日韩avvvv在线播放| 亚洲成人自拍偷拍| 亚洲国产综合视频在线观看| 国产精品国产a| 国产精品热久久久久夜色精品三区| 久久亚洲综合色一区二区三区| 欧美一区二区三区视频免费 | 成人毛片在线观看| 国产成人精品免费网站| 韩国成人精品a∨在线观看| 久久99精品一区二区三区三区| 日日夜夜精品视频天天综合网| 亚洲尤物在线视频观看| 一区二区成人在线| 夜夜嗨av一区二区三区网页| 亚洲男人的天堂一区二区| 中文字幕乱码一区二区免费| 久久伊99综合婷婷久久伊| 91在线视频官网| 亚洲人成精品久久久久久| 97久久精品人人爽人人爽蜜臀| 高清国产一区二区| 成人免费视频一区| 99这里只有精品| 91亚洲精华国产精华精华液| 91福利在线导航| 欧美日韩精品三区| 欧美成人一区二区三区片免费 | 欧美一级在线免费| 欧美v国产在线一区二区三区| 久久综合色8888| 国产精品毛片大码女人| 亚洲精品少妇30p| 亚洲成人先锋电影| 老司机精品视频在线| 国产精品亚洲а∨天堂免在线| 99这里都是精品| 欧美视频一区二区三区在线观看| 欧美一区二区在线免费观看| 精品久久久久一区| 中文字幕一区二区三区乱码在线 | 在线精品视频免费播放| 欧美日韩一级片在线观看| 精品日产卡一卡二卡麻豆| 日本一区二区视频在线观看| 夜夜操天天操亚洲| 美洲天堂一区二卡三卡四卡视频| 久久99国产精品免费网站| 99精品视频一区二区三区| 欧美剧情电影在线观看完整版免费励志电影| 在线综合+亚洲+欧美中文字幕| 国产日韩欧美精品一区| 亚洲成人资源在线| 国产精品亚洲人在线观看| 欧美专区日韩专区| 国产午夜亚洲精品理论片色戒| 亚洲自拍欧美精品| 国产精品一二三区| 欧美日韩免费观看一区三区| 久久久www成人免费毛片麻豆 | 欧美精品一二三四| 白白色 亚洲乱淫| 91麻豆自制传媒国产之光| 欧美二区在线观看| 国产精品国产三级国产普通话99| 亚洲成人激情综合网| 成人黄色在线视频| 日韩一级高清毛片| 一区二区三区在线观看欧美| 国产综合成人久久大片91| 欧美日韩精品免费观看视频| 国产精品色在线观看| 经典一区二区三区| 欧美影院精品一区| 中文字幕一区二区三区在线观看| 极品美女销魂一区二区三区| 欧洲精品一区二区三区在线观看| 国产午夜精品一区二区三区视频 | 成人综合婷婷国产精品久久蜜臀| 欧美精选在线播放| 亚洲欧美电影一区二区| 懂色av一区二区三区免费看| 67194成人在线观看| 一区二区三区在线看| 99久久婷婷国产| 国产日韩欧美制服另类| 精品一区二区三区的国产在线播放| 欧美性极品少妇| 亚洲精品国产第一综合99久久| 福利电影一区二区| 国产婷婷色一区二区三区四区| 久久精品国产精品亚洲红杏| 91精品国产综合久久精品app| 亚洲国产日韩综合久久精品| 色妹子一区二区| 亚洲精品伦理在线| 色综合久久久久| 亚洲一区二区三区四区中文字幕| 91在线视频免费91|