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

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

?? tff.c

?? Embedded SD/MMC HDD CFsource code with AVR PIC
?? C
?? 第 1 頁 / 共 4 頁
字號:

	*nclust = n;
	return FR_OK;
}




/*-----------------------------------------------------------------------*/
/* Delete a File or Directory                                            */
/*-----------------------------------------------------------------------*/

FRESULT f_unlink (
	const char *path		/* Pointer to the file or directory path */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir, *sdir;
	DWORD dsect;
	char fn[8+3+1];
	CLUST dclust;


	res = auto_mount(&path, 1);
	if (res != FR_OK) return res;
	res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
	if (res != FR_OK) return res;			/* Trace failed */
	if (!dir) return FR_INVALID_NAME;		/* It is the root directory */
	if (dir[DIR_Attr] & AM_RDO) return FR_DENIED;	/* It is a R/O object */
	dsect = dj.fs->winsect;
	dclust =
#if _FAT32
		((DWORD)LD_WORD(&dir[DIR_FstClusHI]) << 16) |
#endif
		LD_WORD(&dir[DIR_FstClusLO]);
	if (dir[DIR_Attr] & AM_DIR) {			/* It is a sub-directory */
		dj.clust = dclust;					/* Check if the sub-dir is empty or not */
		dj.sect = clust2sect(dclust);
		dj.index = 2;
		do {
			if (!move_window(dj.sect)) return FR_RW_ERROR;
			sdir = &dj.fs->win[(dj.index & 15) * 32];
			if (sdir[DIR_Name] == 0) break;
			if (sdir[DIR_Name] != 0xE5 && !(sdir[DIR_Attr] & AM_VOL))
				return FR_DENIED;	/* The directory is not empty */
		} while (next_dir_entry(&dj));
	}

	if (!move_window(dsect)) return FR_RW_ERROR;	/* Mark the directory entry 'deleted' */
	dir[DIR_Name] = 0xE5;
	dj.fs->winflag = 1;
	if (!remove_chain(dclust)) return FR_RW_ERROR;	/* Remove the cluster chain */

	return sync();
}




/*-----------------------------------------------------------------------*/
/* Create a Directory                                                    */
/*-----------------------------------------------------------------------*/

FRESULT f_mkdir (
	const char *path		/* Pointer to the directory path */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir, *fw, n;
	char fn[8+3+1];
	DWORD sect, dsect, tim;
	CLUST dclust, pclust;


	res = auto_mount(&path, 1);
	if (res != FR_OK) return res;
	res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
	if (res == FR_OK) return FR_EXIST;		/* Any file or directory is already existing */
	if (res != FR_NO_FILE) return res;

	res = reserve_direntry(&dj, &dir); 		/* Reserve a directory entry */
	if (res != FR_OK) return res;
	sect = dj.fs->winsect;
	dclust = create_chain(0);				/* Allocate a cluster for new directory table */
	if (dclust == 1) return FR_RW_ERROR;
	dsect = clust2sect(dclust);
	if (!dsect) return FR_DENIED;
	if (!move_window(dsect)) return FR_RW_ERROR;

	fw = dj.fs->win;
	memset(fw, 0, 512U);					/* Clear the directory table */
	for (n = 1; n < dj.fs->csize; n++) {
		if (disk_write(0, fw, ++dsect, 1) != RES_OK)
			return FR_RW_ERROR;
	}

	memset(&fw[DIR_Name], ' ', 8+3);		/* Create "." entry */
	fw[DIR_Name] = '.';
	fw[DIR_Attr] = AM_DIR;
	tim = get_fattime();
	ST_DWORD(&fw[DIR_WrtTime], tim);
	memcpy(&fw[32], &fw[0], 32); fw[33] = '.';	/* Create ".." entry */
	pclust = dj.sclust;
#if _FAT32
	ST_WORD(&fw[   DIR_FstClusHI], dclust >> 16);
	if (dj.fs->fs_type == FS_FAT32 && pclust == dj.fs->dirbase) pclust = 0;
	ST_WORD(&fw[32+DIR_FstClusHI], pclust >> 16);
#endif
	ST_WORD(&fw[   DIR_FstClusLO], dclust);
	ST_WORD(&fw[32+DIR_FstClusLO], pclust);
	dj.fs->winflag = 1;

	if (!move_window(sect)) return FR_RW_ERROR;
	memset(&dir[0], 0, 32);						/* Clean-up the new entry */
	memcpy(&dir[DIR_Name], fn, 8+3);			/* Name */
	dir[DIR_NTres] = fn[11];
	dir[DIR_Attr] = AM_DIR;						/* Attribute */
	ST_DWORD(&dir[DIR_WrtTime], tim);			/* Crated time */
	ST_WORD(&dir[DIR_FstClusLO], dclust);		/* Table start cluster */
#if _FAT32
	ST_WORD(&dir[DIR_FstClusHI], dclust >> 16);
#endif

	return sync();
}




/*-----------------------------------------------------------------------*/
/* Change File Attribute                                                 */
/*-----------------------------------------------------------------------*/

FRESULT f_chmod (
	const char *path,	/* Pointer to the file path */
	BYTE value,			/* Attribute bits */
	BYTE mask			/* Attribute mask to change */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir;
	char fn[8+3+1];


	res = auto_mount(&path, 1);
	if (res == FR_OK) {
		res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
		if (res == FR_OK) {				/* Trace completed */
			if (!dir) {
				res = FR_INVALID_NAME;	/* Root directory */
			} else {
				mask &= AM_RDO|AM_HID|AM_SYS|AM_ARC;	/* Valid attribute mask */
				dir[DIR_Attr] = (value & mask) | (dir[DIR_Attr] & (BYTE)~mask);	/* Apply attribute change */
				res = sync();
			}
		}
	}
	return res;
}




/*-----------------------------------------------------------------------*/
/* Change Timestamp                                                      */
/*-----------------------------------------------------------------------*/

FRESULT f_utime (
	const char *path,		/* Pointer to the file/directory name */
	const FILINFO *finfo	/* Pointer to the timestamp to be set */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir;
	char fn[8+3+1];


	res = auto_mount(&path, 1);
	if (res == FR_OK) {
		res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
		if (res == FR_OK) {				/* Trace completed */
			if (!dir) {
				res = FR_INVALID_NAME;	/* Root directory */
			} else {
				ST_WORD(&dir[DIR_WrtTime], finfo->ftime);
				ST_WORD(&dir[DIR_WrtDate], finfo->fdate);
				res = sync();
			}
		}
	}
	return res;
}




/*-----------------------------------------------------------------------*/
/* Rename File/Directory                                                 */
/*-----------------------------------------------------------------------*/

FRESULT f_rename (
	const char *path_old,	/* Pointer to the old name */
	const char *path_new	/* Pointer to the new name */
)
{
	FRESULT res;
	DWORD sect_old;
	BYTE *dir_old, *dir_new, direntry[32-11];
	DIR dj;
	char fn[8+3+1];


	res = auto_mount(&path_old, 1);
	if (res != FR_OK) return res;

	res = trace_path(&dj, fn, path_old, &dir_old);	/* Check old object */
	if (res != FR_OK) return res;				/* The old object is not found */
	if (!dir_old) return FR_NO_FILE;
	sect_old = dj.fs->winsect;					/* Save the object information */
	memcpy(direntry, &dir_old[DIR_Attr], 32-11);

	res = trace_path(&dj, fn, path_new, &dir_new);	/* Check new object */
	if (res == FR_OK) return FR_EXIST;			/* The new object name is already existing */
	if (res != FR_NO_FILE) return res;			/* Is there no old name? */
	res = reserve_direntry(&dj, &dir_new); 		/* Reserve a directory entry */
	if (res != FR_OK) return res;

	memcpy(&dir_new[DIR_Attr], direntry, 32-11);	/* Create new entry */
	memcpy(&dir_new[DIR_Name], fn, 8+3);
	dir_new[DIR_NTres] = fn[11];
	dj.fs->winflag = 1;

	if (!move_window(sect_old)) return FR_RW_ERROR;	/* Delete old entry */
	dir_old[DIR_Name] = 0xE5;

	return sync();
}

#endif /* !_FS_READONLY */
#endif /* _FS_MINIMIZE == 0 */
#endif /* _FS_MINIMIZE <= 1 */
#endif /* _FS_MINIMIZE <= 2 */


#if _USE_FORWARD
/*-----------------------------------------------------------------------*/
/* Forward data to the stream directly                                   */
/*-----------------------------------------------------------------------*/

FRESULT f_forward (
	FIL *fp, 						/* Pointer to the file object */
	UINT (*func)(const BYTE*,UINT),	/* Pointer to the streaming function */
	UINT btr,						/* Number of bytes to forward */
	UINT *br						/* Pointer to number of bytes forwarded */
)
{
	FRESULT res;
	DWORD remain;
	UINT rcnt;
	CLUST clust;


	*br = 0;
	res = validate(fp->fs, fp->id);					/* Check validity of the object */
	if (res != FR_OK) return res;
	if (fp->flag & FA__ERROR) return FR_RW_ERROR;	/* Check error flag */
	if (!(fp->flag & FA_READ)) return FR_DENIED;	/* Check access mode */
	remain = fp->fsize - fp->fptr;
	if (btr > remain) btr = (UINT)remain;			/* Truncate btr by remaining bytes */

	for ( ;  btr && (*func)(NULL, 0);				/* Repeat until all data transferred */
		fp->fptr += rcnt, *br += rcnt, btr -= rcnt) {
		if ((fp->fptr % 512U) == 0) {				/* On the sector boundary? */
			if (fp->csect >= fp->fs->csize) {		/* On the cluster boundary? */
				clust = (fp->fptr == 0) ?			/* On the top of the file? */
					fp->org_clust : get_cluster(fp->curr_clust);
				if (clust < 2 || clust >= fp->fs->max_clust) goto ff_error;
				fp->curr_clust = clust;				/* Update current cluster */
				fp->csect = 0;						/* Reset sector address in the cluster */
			}
			fp->csect++;							/* Next sector address in the cluster */
		}
		if (!move_window(clust2sect(fp->curr_clust) + fp->csect - 1))	/* Move sector window */
			goto ff_error;
		rcnt = 512U - (WORD)(fp->fptr % 512U);		/* Forward data from sector window */
		if (rcnt > btr) rcnt = btr;
		rcnt = (*func)(&fp->fs->win[(WORD)fp->fptr % 512U], rcnt);
		if (rcnt == 0) goto ff_error;
	}

	return FR_OK;

ff_error:	/* Abort this function due to an unrecoverable error */
	fp->flag |= FA__ERROR;
	return FR_RW_ERROR;
}
#endif /* _USE_FORWARD */



#if _USE_STRFUNC >= 1
/*-----------------------------------------------------------------------*/
/* Get a string from the file                                            */
/*-----------------------------------------------------------------------*/
char* fgets (
	char* buff,	/* Pointer to the string buffer to read */
	int len,	/* Size of string buffer */
	FIL* fil	/* Pointer to the file object */
)
{
	int i = 0;
	char *p = buff;
	UINT rc;


	while (i < len - 1) {			/* Read bytes until buffer gets filled */
		f_read(fil, p, 1, &rc);
		if (rc != 1) break;			/* Break when no data to read */
#if _USE_STRFUNC >= 2
		if (*p == '\r') continue;	/* Strip '\r' */
#endif
		i++;
		if (*p++ == '\n') break;	/* Break when reached end of line */
	}
	*p = 0;
	return i ? buff : 0;			/* When no data read (eof or error), return with error. */
}



#if !_FS_READONLY
#include <stdarg.h>
/*-----------------------------------------------------------------------*/
/* Put a character to the file                                           */
/*-----------------------------------------------------------------------*/
int fputc (
	int chr,	/* A character to be output */
	FIL* fil	/* Ponter to the file object */
)
{
	UINT bw;
	char c;


#if _USE_STRFUNC >= 2
	if (chr == '\n') fputc ('\r', fil);	/* LF -> CRLF conversion */
#endif
	if (!fil) {	/* Special value may be used to switch the destination to any other device */
	/*	put_console(chr);	*/
		return chr;
	}
	c = (char)chr;
	f_write(fil, &c, 1, &bw);	/* Write a byte to the file */
	return bw ? chr : EOF;		/* Return the resulut */
}




/*-----------------------------------------------------------------------*/
/* Put a string to the file                                              */
/*-----------------------------------------------------------------------*/
int fputs (
	const char* str,	/* Pointer to the string to be output */
	FIL* fil			/* Pointer to the file object */
)
{
	int n;


	for (n = 0; *str; str++, n++) {
		if (fputc(*str, fil) == EOF) return EOF;
	}
	return n;
}




/*-----------------------------------------------------------------------*/
/* Put a formatted string to the file                                    */
/*-----------------------------------------------------------------------*/
int fprintf (
	FIL* fil,			/* Pointer to the file object */
	const char* str,	/* Pointer to the format string */
	...					/* Optional arguments... */
)
{
	va_list arp;
	UCHAR c, f, r;
	ULONG val;
	char s[16];
	int i, w, res, cc;


	va_start(arp, str);

	for (cc = res = 0; cc != EOF; res += cc) {
		c = *str++;
		if (c == 0) break;			/* End of string */
		if (c != '%') {				/* Non escape cahracter */
			cc = fputc(c, fil);
			if (cc != EOF) cc = 1;
			continue;
		}
		w = f = 0;
		c = *str++;
		if (c == '0') {				/* Flag: '0' padding */
			f = 1; c = *str++;
		}
		while (c >= '0' && c <= '9') {	/* Precision */
			w = w * 10 + (c - '0');
			c = *str++;
		}
		if (c == 'l') {				/* Prefix: Size is long int */
			f |= 2; c = *str++;
		}
		if (c == 's') {				/* Type is string */
			cc = fputs(va_arg(arp, char*), fil);
			continue;
		}
		if (c == 'c') {				/* Type is character */
			cc = fputc(va_arg(arp, char), fil);
			if (cc != EOF) cc = 1;
			continue;
		}
		r = 0;
		if (c == 'd') r = 10;		/* Type is signed decimal */
		if (c == 'u') r = 10;		/* Type is unsigned decimal */
		if (c == 'X') r = 16;		/* Type is unsigned hexdecimal */
		if (r == 0) break;			/* Unknown type */
		if (f & 2) {				/* Get the value */
			val = (ULONG)va_arg(arp, long);
		} else {
			val = (c == 'd') ? (ULONG)(long)va_arg(arp, int) : (ULONG)va_arg(arp, unsigned int);
		}
		/* Put numeral string */
		if (c == 'd') {
			if (val >= 0x80000000) {
				val = 0 - val;
				f |= 4;
			}
		}
		i = sizeof(s) - 1; s[i] = 0;
		do {
			c = (UCHAR)(val % r + '0');
			if (c > '9') c += 7;
			s[--i] = c;
			val /= r;
		} while (i && val);
		if (i && (f & 4)) s[--i] = '-';
		w = sizeof(s) - 1 - w;
		while (i && i > w) s[--i] = (f & 1) ? '0' : ' ';
		cc = fputs(&s[i], fil);
	}

	va_end(arp);
	return (cc == EOF) ? cc : res;
}

#endif /* !_FS_READONLY */
#endif /* _USE_STRFUNC >= 1*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本在线高清不卡dvd| 日本在线不卡视频| 成人黄色小视频| 国产精品美女www爽爽爽| 高清久久久久久| 国产精品二区一区二区aⅴ污介绍| 国产九色sp调教91| 国产精品毛片久久久久久久| 91美女在线观看| 亚洲成人一区二区| 日韩欧美不卡一区| 国产成人精品在线看| 亚洲人成精品久久久久久| 欧美日韩高清一区二区不卡| 久久成人18免费观看| 国产精品麻豆网站| 精品视频在线免费看| 久久99国产精品免费| 中文字幕亚洲电影| 在线播放视频一区| 粗大黑人巨茎大战欧美成人| 亚洲综合色自拍一区| 26uuu国产一区二区三区| 成人黄色av电影| 日韩专区欧美专区| 欧美国产激情一区二区三区蜜月 | 在线综合+亚洲+欧美中文字幕| 毛片av一区二区| 国产精品人成在线观看免费| 在线不卡免费欧美| 成人激情校园春色| 免费精品视频在线| 亚洲情趣在线观看| 精品嫩草影院久久| 日韩免费电影一区| 色婷婷综合久色| 韩国女主播一区| 亚洲一区二区四区蜜桃| 国产亚洲成年网址在线观看| 在线不卡一区二区| 色先锋久久av资源部| 国产福利电影一区二区三区| 婷婷久久综合九色国产成人| 中文字幕佐山爱一区二区免费| 日韩一区二区免费在线观看| 91网站最新地址| 国产剧情在线观看一区二区| 免费人成网站在线观看欧美高清| 亚洲日韩欧美一区二区在线| 国产拍欧美日韩视频二区| 337p亚洲精品色噜噜噜| 一本大道久久a久久精品综合| 国产在线视频精品一区| 亚洲同性同志一二三专区| 久久亚洲二区三区| 日韩亚洲欧美综合| 欧美美女bb生活片| 欧美色手机在线观看| 99精品黄色片免费大全| 国产久卡久卡久卡久卡视频精品| 男人的j进女人的j一区| 午夜激情综合网| 亚洲另类色综合网站| 亚洲欧美激情小说另类| 国产精品网友自拍| 国产亚洲一区二区三区| 久久久久久97三级| 久久亚洲一区二区三区四区| 日韩精品在线一区| 日韩欧美国产电影| 欧美不卡一区二区三区四区| 制服丝袜成人动漫| 日韩一级成人av| 精品国产百合女同互慰| 欧美大尺度电影在线| 欧美经典一区二区三区| 国产婷婷精品av在线| 国产色综合久久| 中文字幕乱码亚洲精品一区| 中文乱码免费一区二区| 国产精品久久久久7777按摩| 亚洲婷婷综合色高清在线| 中文字幕中文字幕在线一区| 亚洲欧美区自拍先锋| 一区二区三区四区乱视频| 亚洲国产一二三| 日韩精品久久久久久| 日本va欧美va瓶| 国产在线不卡视频| 国产不卡视频一区| 96av麻豆蜜桃一区二区| 色94色欧美sute亚洲线路一ni| 欧美日韩一级视频| 日韩你懂的在线播放| 国产清纯白嫩初高生在线观看91 | 日韩欧美国产精品一区| 精品国精品国产| 国产日韩精品一区二区浪潮av| 国产精品视频观看| 一区二区三区日韩精品视频| 日韩高清不卡一区| 国产精品一区在线观看乱码| 一本久久综合亚洲鲁鲁五月天| 欧美少妇bbb| 26uuu亚洲综合色| 亚洲素人一区二区| 免费精品视频在线| 不卡的av在线播放| 欧美精品免费视频| 欧美激情一区三区| 亚洲欧美国产毛片在线| 日本欧美一区二区在线观看| 久久99久久精品| 色呦呦国产精品| 精品少妇一区二区三区在线视频| 国产欧美一区二区精品秋霞影院 | 欧美极品xxx| 亚洲第一在线综合网站| 国产一区二区视频在线| 91视频xxxx| 久久综合久久综合久久综合| 一区二区免费视频| av电影一区二区| 精品日产卡一卡二卡麻豆| 亚洲精品自拍动漫在线| 国产一区二区看久久| 91福利在线看| 久久久精品国产免费观看同学| 亚洲一区二区三区中文字幕 | 欧美色精品在线视频| 精品国产乱码久久久久久久 | 国产精品视频麻豆| 亚洲v日本v欧美v久久精品| 国产在线精品一区二区不卡了 | www.66久久| 2020国产精品自拍| 亚洲成av人片在线观看| 成人91在线观看| 久久久久久久久免费| 日韩精品一二区| 欧洲国内综合视频| 中文字幕色av一区二区三区| 国产一区二区三区黄视频 | 日本不卡在线视频| 欧洲另类一二三四区| 国产精品视频yy9299一区| 国产资源精品在线观看| 欧美日韩第一区日日骚| 一个色综合网站| 91论坛在线播放| 国产精品久久久久国产精品日日| 国产一区 二区| 日韩欧美亚洲另类制服综合在线| 午夜成人免费电影| 欧美日韩国产精选| 亚洲综合丁香婷婷六月香| 99国产精品久| 国产精品美女视频| 99riav久久精品riav| 中文字幕中文字幕一区| 国产成人精品综合在线观看| 久久嫩草精品久久久精品| 韩国三级在线一区| 精品国产精品网麻豆系列| 久久精品国产77777蜜臀| 欧美一区二区三区四区视频 | 黑人巨大精品欧美一区| 精品久久久久久久久久久院品网 | 久久99九九99精品| 欧美成人伊人久久综合网| 美女性感视频久久| 欧美电影免费观看高清完整版 | 一区二区三区日韩欧美精品| 在线精品视频免费播放| 韩国一区二区三区| 欧美videos中文字幕| 日本女人一区二区三区| 精品乱人伦一区二区三区| 国产成人午夜99999| 中文字幕一区二区三中文字幕| 97精品超碰一区二区三区| 亚洲一区二区三区四区在线观看| 欧美性欧美巨大黑白大战| 午夜一区二区三区在线观看| 欧美精品一卡两卡| 精品一区二区三区视频| 久久久久国产一区二区三区四区| 成人免费视频视频| 亚洲美女免费在线| 欧美一区二区三区精品| 国产乱淫av一区二区三区| 亚洲天堂成人网| 欧美片在线播放| 国产伦精品一区二区三区免费| 国产精品视频观看| 欧美日韩国产综合一区二区三区| 蜜臀久久99精品久久久久宅男| 久久久www成人免费无遮挡大片| 99久久精品国产毛片| 秋霞av亚洲一区二区三|