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

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

?? fat_sys.c

?? fat16文件系統源碼。需要的請下
?? C
?? 第 1 頁 / 共 3 頁
字號:
		tmp_cluster.b[3] = gl_buffer[fat_buf_count + 0];   
		tmp_cluster.b[2] = gl_buffer[fat_buf_count + 1];
	    tmp_cluster.b[1] = gl_buffer[fat_buf_count + 2];   
		tmp_cluster.b[0] = gl_buffer[fat_buf_count + 3];

		if (tmp_cluster.l == 0x00000000)
           	cluster_free = TRUE;

		if(cluster_free)
		{/* free cluster: add it to the list */
			if (chain[index].number == MAX_CL_PER_FRAG) 
	        {
	            index++;
	            chain[index].number = 1;
	            chain[index].cluster.l = cluster.l;
	        }
	        else
	        {
	            chain[index].number++;
	        }
			cluster.l++;
			cluster2start.l++;
			fat_buf_count += 4;
		}
		else
		{/* cluster already used */
			do
			{
				cluster.l++;
				cluster2start.l++;
				fat_buf_count += 4;
				fat_count_sector();
/*
				if(fat_buf_count == fat_sector_size)
				{
					fat_buf_count = 0;
					phy_read_sector();
				}	
*/
				tmp_cluster.b[3] = gl_buffer[fat_buf_count + 0];   
				tmp_cluster.b[2] = gl_buffer[fat_buf_count + 1];
	    		tmp_cluster.b[1] = gl_buffer[fat_buf_count + 2];   
				tmp_cluster.b[0] = gl_buffer[fat_buf_count + 3];

				if (tmp_cluster.l == 0x00000000)
				{
			        cluster_free = TRUE;
					break;
				}
			}
			while(cluster.l < fat_count_of_clusters);

			if(!cluster_free)
			{
				if (chain[index].number == 1)
		        { /* last cluster is the current one */
		            fat_last_clust_index = index;
		            chain[fat_last_clust_index].number = 0; /* end of list marker */
		        }
		        else
		        {
		            fat_last_clust_index = index + 1;
		            chain[index].number--;
		            chain[fat_last_clust_index].cluster.l = chain[index].cluster.l + chain[index].number;
		            chain[fat_last_clust_index].number = 0; /* end of list marker */
		        }
		        return OK;                        /* end of partition reached */
			}
			index++;
	        chain[index].number = 1;
	        chain[index].cluster.l = cluster.l;
	        cluster.l++;
			cluster2start.l++;
			fat_buf_count +=4;
		}
		nb_cluster++;
	}
	while ((index != (nb_frag - 1)) && (cluster.l < fat_count_of_clusters) && (nb_cluster < fat_max_cluster_number));
	
	fat_last_clust_index = index;
	return OK;

}
#endif //COMPILE_FAT_32


byte fat_set_clusters (fat_st_clust_chain xdata *chain, Byte nb_frag)
{
	if(fat_type_id == FAT_IS_16)
	{
#if COMPILE_FAT_16 == TRUE
		if(fat16_set_clusters(chain,nb_frag) == KO)
			return KO;
#endif
	}
	else if(fat_type_id == FAT_IS_12)
	{
#if COMPILE_FAT_12 == TRUE
		if(fat12_set_clusters(chain,nb_frag) == KO)
			return KO;
#endif
	}
	else if(fat_type_id == FAT_IS_32)
	{
#if COMPILE_FAT_32 == TRUE
		if(fat32_set_clusters(chain,nb_frag) == KO)
			return KO;
#endif
	}
	
    phy_read_close();
			
	/* Mark end of list -> last record number = 0 */
	/* Be careful : 0 value is just a marker      */
	/*              Real value is in fact 1!!!    */
	if (fat_last_clust_index == nb_frag - 1)    /* End of chain cluster -> maximum file size */
	{
		/* The last index must have the end of list marker */
//		fat_last_clust_index = index;
		chain[fat_last_clust_index-1].number--;
		chain[fat_last_clust_index].cluster.l = chain[fat_last_clust_index - 1].cluster.l + chain[fat_last_clust_index-1].number;
		chain[fat_last_clust_index].number = 0;   /* end of list marker */
	}
	else                                            /* max cluster -> end of media */
	{
		if (chain[fat_last_clust_index].number == 1)
		{ /* last cluster is the current one */
//			fat_last_clust_index = index;
			chain[fat_last_clust_index].number = 0; /* end of list marker */
		}
		else
		{
//			fat_last_clust_index = index + 1;
			chain[fat_last_clust_index].number--;
			fat_last_clust_index++;
			chain[fat_last_clust_index].cluster.l = chain[fat_last_clust_index-1].cluster.l + chain[fat_last_clust_index-1].number;
			chain[fat_last_clust_index].number = 0; /* end of list marker */
		}
	} 
	return OK;	
}


/*F**************************************************************************
* NAME: fat_create_entry
*----------------------------------------------------------------------------
* PARAMS:
*   cluster: starting cluster 
* return:
*   - OK : new root entry created
*   - KO : no more space in file list
*----------------------------------------------------------------------------
* PURPOSE:
*   Create an entry in parent directory
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   
*     
*   Index of file is determinated:
*     if deleted dir like DIRVEXXX exist, then index = min index
*     else indice = max index read + 1
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/

#if COMPILE_FAT_WRITE == TRUE
Byte fat_create_entry(Uint32 cluster)
{
 	Uint16 i;
	Uint16 j,number=0;
    Uint16  count=0;
	Uint16 indice;
	Uint16 indice_min;
	Uint16 indice_max;
	Uint16 pos;
	Uint16 temp;
	Uint16 index;
	// Uint16 k;
	Uint32 root_sector;
	Byte flag;
	Byte exist,byExist;
	Byte deleted_flag;
//	bit del;
	Uint16 offset;
	Uint16 dir_index;
    Uint16 dir_last;
//   Uint16 dir_count;
//	Uint16 cluster_number;

	flag=FALSE;
    exist = FALSE;
	deleted_flag = FALSE;
	indice = 0x00;
 	index = 0;
    dir_index = 0;
    dir_last = 0;
	/* determinate file index */
	indice_min = 0xFFFF;
	indice_max = 0x00;

	if((dir_is_root == TRUE) && (fat_type_id != FAT_IS_32))
    {
	    phy_read_open(fat_ptr_rdir);
	}
    else
	{
		fat_dclust_byte_count = 0;
        fat_dchain_index = 0;
        fat_dchain_nb_clust = 0;
	}

	do
	{
		if(number % fat_sector_size==0)
		{
	       if((dir_is_root == TRUE)&&(fat_type_id != FAT_IS_32))
		   {		    
	          phy_read_sector();
		   }
		   else
		   {
              fat_dgetsector();
		   }
		   number = 0;
        }

		j = number;
		number += DIR_SIZE ;

		if(exist == FALSE)
		{
			if(gl_buffer[j] == FILE_DELETED)
			{
				offset = index;
				exist = TRUE;
			}
		}

		/* check if it's SUBDIR?? directory */
		//if((gl_buffer[11+j] & ATTR_DIRECTORY )!= ATTR_DIRECTORY)
	//	{

		byExist = 0;
		if(fat_global_id == FILE_DIR)
		{
/*
			if((gl_buffer[1 + j] == 'R')&&
			    (gl_buffer[2 + j] == 'I')&&
			    (gl_buffer[3 + j] == 'V')&&
			    (gl_buffer[4 + j] == 'E'))
			{
				byExist = 1;
			}
*/
		}
		else if(fat_global_id == FILE_MP3)
		{
			if((gl_buffer[1 + j] == 'O')&&
			    (gl_buffer[2 + j] == 'I')&&
			    (gl_buffer[3 + j] == 'C')&&
			    (gl_buffer[4 + j] == 'E')&&
				(gl_buffer[8 + j] == 'M')&&
				(gl_buffer[9 + j] == 'P')&&	
				(gl_buffer[10 + j] == '3'))			
			{
				byExist = 1;
			}
		}
		else if(fat_global_id == FILE_AV6)
		{
			if((gl_buffer[1 + j] == 'O')&&
			    (gl_buffer[2 + j] == 'I')&&
			    (gl_buffer[3 + j] == 'C')&&
			    (gl_buffer[4 + j] == 'E')&&
				(gl_buffer[8 + j] == 'A')&&
				(gl_buffer[9 + j] == 'V')&&	
				(gl_buffer[10 + j] == '6'))			
			{
				byExist = 1;
			}
		}
		else if(fat_global_id == FILE_IMA)
		{
			if((gl_buffer[1 + j] == 'O')&&
			    (gl_buffer[2 + j] == 'I')&&
			    (gl_buffer[3 + j] == 'C')&&
			    (gl_buffer[4 + j] == 'E')&&
				(gl_buffer[8 + j] == 'I')&&
				(gl_buffer[9 + j] == 'M')&&	
				(gl_buffer[10 + j] == 'A'))			
			{
				byExist = 1;
			}
		}

        if(byExist)
		{
			/* caclulate actual index */
			temp = (gl_buffer[5 + j] - '0')*100;
			temp += (gl_buffer[6 + j] - '0')*10;
			temp += (gl_buffer[7 + j] - '0');
			

			if(gl_buffer[0 + j] == FILE_DELETED) /* if directory is deleted */
			{
				if(temp <= indice_min)
				{
					indice_min = temp;
					pos = index;     /* if index is the lower, take it */
				}
				deleted_flag = 1;
			}
			else          /* if file not deleted, then save max value */
			{
				if(temp > indice_max)
				{
					indice_max = temp;
				}
				if((exist == FALSE) && (deleted_flag == 0))
				{
				    	dir_index++;
				}
				dir_last++;
			}
			flag=TRUE;
		 }
         index++;
         if(dir_is_root == TRUE)
		 {
              if(index == fat_root_entries)
			  {
			      if((gl_buffer[j] !=FILE_NOT_EXIST) && (gl_buffer[j] != FILE_DELETED))
				      return KO;
				  break;
			  }
         }
	  }
	  while(gl_buffer[0 + j] != FILE_NOT_EXIST);
	  phy_read_close();

	   if(indice_min == 0xffff) // don't find an earsed dir //
	   {
	   		if(flag == TRUE)  // subdir exist //
			{
				indice = indice_max + 1;
			}
			else   // subdir no exist //
			{
				indice = 0x00;
			}
			index--;  
			if(exist == TRUE)
		    {
		   	    index = offset;
		    }   
		}
		else
		{
			indice = indice_min;
			index = pos;
		}
		
		/* construct the entry */
/*
	   if(exist == TRUE)
	   {
	   	    index = offset;
	   }
*/
	   if((dir_is_root == TRUE)&&(fat_type_id != FAT_IS_32))
	   {
	      root_sector = fat_ptr_rdir + (index / (fat_sector_size >> 5));/* root sector address */
	      phy_read_open(root_sector);
		  j = (index % (fat_sector_size >> 5)) * DIR_SIZE ;             /* Position of entry in the sector */
	   }
	   else
	   { 
	      //fat_dir_current_offs = 0;
	      fat_dir_seek(((Uint32)index) * DIR_SIZE); 
          root_sector = fat_dir_current_sect;
		  j = fat_dir_sector_offset;// % fat_sector_size;
	   }
	    
	    phy_read_sector();
		phy_read_close();

/*
		if(fat_global_id == FILE_DIR)
		{
			gl_buffer[0+j] = 'D';
	        gl_buffer[1+j] = 'R';
	        gl_buffer[2+j] = 'I';
	        gl_buffer[3+j] = 'V';
	        gl_buffer[4+j] = 'E';
	        gl_buffer[8+j] = ' ';
	        gl_buffer[9+j] = ' ';
	        gl_buffer[10+j] = ' ';
  	    	gl_buffer[11+j] = ATTR_DIRECTORY;       
		}
		else
		{
*/
		    gl_buffer[0+j] = 'V';
	        gl_buffer[1+j] = 'O';
	        gl_buffer[2+j] = 'I';
	        gl_buffer[3+j] = 'C';
	        gl_buffer[4+j] = 'E';

			if(fat_global_id == FILE_MP3)
			{
		        gl_buffer[8+j] = 'M';
		        gl_buffer[9+j] = 'P';
	        	gl_buffer[10+j] = '3';
			}
			else 
			{
		        gl_buffer[8+j] = 'A';
		        gl_buffer[9+j] = 'V';
			    gl_buffer[10+j] = '6';
			}
			gl_buffer[11+j] = 0x00;
//		}

        gl_buffer[5+j] = '0'+ (indice / 100);
        gl_buffer[6+j] = '0' + ((indice % 100) / 10);
        gl_buffer[7+j] = '0' + ((indice % 100) % 10);

        if(fat_global_id == FILE_DIR)
		{
            memcpy(gl_buffer+j,lfn_name,8);
			gl_buffer[8+j] = ' ';
		    gl_buffer[9+j] = ' ';
	        gl_buffer[10+j] = ' ';
  	    	gl_buffer[11+j] = ATTR_DIRECTORY; 
		}

        for(i=12;i<32;i++)
		   gl_buffer[i+j] = 0x00;

		if(fat_type_id == FAT_IS_32)
		{
			gl_buffer[20+j] = (Byte)(cluster >> 16);	
			gl_buffer[21+j] = (Byte)(cluster >> 24);		
		}

	    gl_buffer[26+j] = (Byte)(cluster);    /* Low word first cluster number */
	    gl_buffer[27+j] = (Byte)(cluster >> 8);	
	   //j = (index % 16) * DIR_SIZE ;             /* Position of entry in the sector */
		if(fat_global_id != FILE_DIR)
		{
		    gl_buffer[j + 28] = fat_file_size.b[3];
		    gl_buffer[j + 29] = fat_file_size.b[2];
		    gl_buffer[j + 30] = fat_file_size.b[1];
		    gl_buffer[j + 31] = fat_file_size.b[0];
		}

        fat_write_sector(root_sector);

        fat_dir_list_index = dir_index;
        fat_dir_list_last = dir_last + 1;
		fat_dir_seek(index * DIR_SIZE);	

	    return OK;
}

#endif //COMPILE_FAT_WRITE



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩国产成人精品影院| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 亚洲国产裸拍裸体视频在线观看乱了| 最新国产精品久久精品| 日韩欧美亚洲国产另类| 精品va天堂亚洲国产| 国产色产综合色产在线视频| 亚洲精品免费视频| 亚洲欧美综合另类在线卡通| 亚洲一区二区高清| 黄色精品一二区| 91亚洲精品乱码久久久久久蜜桃 | 久久亚洲欧美国产精品乐播| 国产女人18水真多18精品一级做| 亚洲精品免费在线播放| 免费高清在线一区| 国产老肥熟一区二区三区| 成人网男人的天堂| 欧美性受极品xxxx喷水| 一区二区在线观看免费 | 色婷婷av一区二区三区软件 | 蜜桃一区二区三区在线观看| 国产综合成人久久大片91| 国产黄人亚洲片| 欧美性受xxxx黑人xyx| 精品国产3级a| 一区二区三区色| 国内久久婷婷综合| 色综合天天综合网国产成人综合天| 91麻豆精品在线观看| 欧美一区二区三区四区久久| 国产精品麻豆欧美日韩ww| 亚洲最快最全在线视频| 精品午夜一区二区三区在线观看| 99麻豆久久久国产精品免费优播| 欧美mv日韩mv| 亚洲一区二区三区激情| 国产99久久久国产精品潘金网站| 91精品国模一区二区三区| 国产精品嫩草99a| 亚洲成av人片一区二区| 国产成人久久精品77777最新版本| 91麻豆免费视频| 精品粉嫩aⅴ一区二区三区四区| 亚洲精品国产品国语在线app| 国产成人精品亚洲日本在线桃色 | 亚洲一区欧美一区| 国产91精品久久久久久久网曝门 | 国产日韩欧美高清在线| 亚洲午夜久久久久| 成人av午夜影院| 久久综合色播五月| 美美哒免费高清在线观看视频一区二区 | 国产精品99久久不卡二区| 欧美一区二区性放荡片| 夜夜嗨av一区二区三区网页 | 亚洲人成网站色在线观看| 久久99精品久久久久| 日韩一区二区三区电影 | 欧美午夜精品一区二区蜜桃 | www.亚洲在线| 久久综合一区二区| 日韩电影在线观看电影| 在线看不卡av| 亚洲精品一二三| 成人手机在线视频| 久久久久国产免费免费| 久久精工是国产品牌吗| 欧美日韩精品一区视频| 亚洲另类色综合网站| proumb性欧美在线观看| 国产亚洲综合性久久久影院| 美女免费视频一区| 日韩一区二区视频在线观看| 午夜精品福利一区二区蜜股av| 在线亚洲一区观看| 亚洲另类色综合网站| 9人人澡人人爽人人精品| 中文一区二区在线观看| 风间由美性色一区二区三区| 久久久青草青青国产亚洲免观| 国产精品一区二区视频| 精品国产一区二区三区久久久蜜月 | 亚洲尤物在线视频观看| 色就色 综合激情| 国产精品二三区| 91免费观看国产| 亚洲人亚洲人成电影网站色| 91久久国产最好的精华液| 一区二区三区精品| 欧美专区日韩专区| 日本不卡视频一二三区| 日韩午夜在线播放| 久久99九九99精品| 国产精品嫩草影院av蜜臀| 99在线精品一区二区三区| 国产三级精品视频| 在线观看亚洲a| 午夜亚洲国产au精品一区二区| 日韩精品一区在线观看| 国产专区欧美精品| 国产精品卡一卡二| 欧美在线观看一区二区| 日韩精品一级中文字幕精品视频免费观看| 欧美日韩精品欧美日韩精品一综合| 日韩av成人高清| 久久人人超碰精品| 成人av网址在线| 午夜欧美电影在线观看| 欧美一区二区三区免费视频| 美女一区二区久久| 国产亚洲人成网站| 色婷婷综合久久久| 午夜成人免费视频| 国产欧美日韩麻豆91| 97se亚洲国产综合在线| 亚洲国产sm捆绑调教视频| 日韩精品一区二区三区蜜臀| 国产69精品一区二区亚洲孕妇| 国产成人自拍在线| 亚洲女子a中天字幕| 日韩一区二区电影在线| 精品午夜久久福利影院| 色视频成人在线观看免| 国产91色综合久久免费分享| 色婷婷久久久久swag精品 | 中文字幕色av一区二区三区| 26uuu久久天堂性欧美| 欧美电影免费提供在线观看| 在线一区二区三区| 色综合久久中文字幕综合网| av爱爱亚洲一区| 91麻豆国产在线观看| caoporen国产精品视频| 99久久99久久久精品齐齐 | 久久久久免费观看| 精品一区二区免费在线观看| 国产亚洲综合性久久久影院| 成人av小说网| 日本在线不卡一区| 国产精品全国免费观看高清 | 亚洲精品大片www| 日韩免费看网站| 色欲综合视频天天天| 国产精品综合在线视频| 99久久久无码国产精品| 久久国产精品99久久久久久老狼| 亚洲激情五月婷婷| 国产日韩欧美一区二区三区乱码 | 国产一区二区视频在线| 亚洲mv在线观看| 亚洲美女淫视频| 日本一区二区成人在线| 精品剧情v国产在线观看在线| 欧美性感一区二区三区| 不卡欧美aaaaa| 国产aⅴ精品一区二区三区色成熟| 久久精品久久久精品美女| 午夜私人影院久久久久| 一区二区欧美在线观看| 中文字幕在线不卡视频| 国产人成亚洲第一网站在线播放 | 粉嫩欧美一区二区三区高清影视| 玖玖九九国产精品| 亚洲成人久久影院| 一区二区三区国产豹纹内裤在线 | 欧美日韩免费一区二区三区 | 麻豆精品在线播放| 天天综合色天天综合色h| 夜夜操天天操亚洲| 亚洲在线中文字幕| 亚洲尤物视频在线| 亚洲国产精品麻豆| 亚洲一区在线视频| 亚洲bt欧美bt精品| 日韩国产欧美三级| 日本一道高清亚洲日美韩| 日韩和的一区二区| 免费av成人在线| 久草中文综合在线| 黑人精品欧美一区二区蜜桃 | 国产精品少妇自拍| 综合色天天鬼久久鬼色| 亚洲人快播电影网| 亚洲精品国产品国语在线app| 亚洲影视在线播放| 五月婷婷另类国产| 美女网站色91| 国产精品一级黄| av一区二区三区四区| 91麻豆123| 久久蜜桃av一区精品变态类天堂| 精品va天堂亚洲国产| 国产清纯白嫩初高生在线观看91| 中文字幕欧美国产| 亚洲天天做日日做天天谢日日欢| 亚洲愉拍自拍另类高清精品| 石原莉奈在线亚洲二区| 久久成人综合网| 国产成人欧美日韩在线电影|