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

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

?? fat_dir.c

?? fat16文件系統源碼。需要的請下
?? C
?? 第 1 頁 / 共 3 頁
字號:
	fat_get_dir_entry(&fat_cache.current);  /* update current directory info */
	/* parent dir is also root */
	if(dir_is_root==TRUE)
	{
		if(fat_type_id == FAT_IS_32)
		{
			fat_cache.parent.start_cluster.l = fat32_root_cluster;  
		}
		else
		{
			fat_cache.parent.start_cluster.l = 0;   
		}
		fat_cache.parent.attributes = ATTR_ROOT_DIR;    // mark as root dir //
	}
	else
	{
	 	fat_cache.parent.start_cluster.l = cluster.l;   
		fat_cache.parent.attributes = ATTR_DIRECTORY ;    // mark as root dir //
	}
	 return OK;
}
#endif //COMPILE_FAT_DIR_CREATE

#if COMPILE_FAT_DELETE == TRUE
/*F**************************************************************************
* NAME: fat_dirdelete
*----------------------------------------------------------------------------
* PURPOSE:
*   Delete a selected directory
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   This function works: have no file or subdirectory in the directory
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
Byte fat_dirdelete (void)
{
    Uint16 temp;
	Uint16 temp_all;

  	temp = fat_dir_list_index;
  	temp_all = fat_dir_list_last;
 
  	fat_get_clusters(&dclusters,MAX_DIR_FRAGMENT_NUMBER);
  
  	dir_is_root = FALSE;


    fat_global_id = FILE_DIR;
	fat_scan_dir(TRUE);    

  	if( fat_dir_all_count > 2 ) //this file have subdir or file.
	   	return KO;  
  
    /* FAT update */
    fat_dclust_byte_count = 0;            /* byte 0 of cluster */
    /* reset the allocation list variable */
    fat_dchain_index = 0;
    fat_dchain_nb_clust = 0;              /* start on first contiguous cl */
    /* get file allocation list */
    fat_dir_update_fats(TRUE,&dclusters);


    if(fat_cache.parent.attributes == ATTR_ROOT_DIR)
	{
	    dir_is_root = TRUE;
		if(fat_type_id == FAT_IS_32)
		{
			fat_cache.current.start_cluster.l = 2;
			fat_get_clusters(&dclusters,MAX_DIR_FRAGMENT_NUMBER);
		}
	}
	else
    {
 	    fat_cache.current = fat_cache.parent;
		//fat_dir_start_sect = (fat_cache.current.start_cluster - 2)*fat_cluster_size + fat_ptr_data ;
		fat_get_clusters(&dclusters,MAX_DIR_FRAGMENT_NUMBER);
	}
    
    fat_dir_sector_offset = 0;

    fat_phy_del();

	/* Reconstruct list file */
    if(temp_all == 0)
	    return OK;
	else
	{
      	if(temp == temp_all - 1)
		{
		  	temp -= 1;
		}
	}

    fat_dir_list_index = temp;

	fat_scan_dir(FALSE);
    fat_dir_seek(((Uint32)fat_dir_all_count) * DIR_SIZE );
    fat_get_dir_entry(&fat_cache.current);          // update current file info 

	return OK;
}


/*F**************************************************************************
* NAME: fat_phy_del
*----------------------------------------------------------------------------
* PURPOSE:
*   Delete a selected directory
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   This function works: have no file or subdirectory in the directory
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void fat_phy_del(void)
{
	Uint16 i;
//	Uint32 para;
	Uint16 count;
	Uint32 root_sector;

    fat_scan_dir(FALSE);
    fat_dir_seek(fat_dir_all_count * 32);
    i = fat_dir_sector_offset ;//% fat_sector_size; /*number of bytes to seek in a cluster*/

    phy_read_sector();
    phy_read_close();

	root_sector = fat_dir_current_sect;
	count = 0;

	while (gl_buffer[i+11] == ATTR_LFN_ENTRY)
    {
        /* mark file as deleted */
       	gl_buffer[i] = FILE_DELETED;     
       	i += 32;
	   	count++;
       	if (i == fat_sector_size)
       	{

	       	fat_write_sector(root_sector);

		   	if((dir_is_root == TRUE)&&(fat_type_id != FAT_IS_32))
		   	{
				
	            root_sector++;
			   	phy_read_open(root_sector);    // read entry's sector //
				phy_read_sector();
		   	}
			else
			{
                fat_dir_seek(((Uint32)count)*32);  
                count = 0;
                phy_read_sector();
				root_sector = fat_dir_current_sect;
			}
			phy_read_close();
			    
	        i = 0;
        }

    }

    gl_buffer[i] = FILE_DELETED;

	fat_write_sector(root_sector);
}

#endif // #if COMPILE_FAT_DELETE == TRUE

/*F**************************************************************************
* NAME: fat_dir_seek
*----------------------------------------------------------------------------
* PARAMS:
*   offset: offset to current position in signed word value
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Seek from the current position to a new offset computing relative 
*   poisition +/- scan size limited to a 16 bit offset
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   We consider here that the seek size is minor to the cluster size !!!
*   if you want to do a more than a cluster seek, issue two successive 
*   dseek commands
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/ 
Byte fat_dir_seek (Uint32 offset)
{
	Uint16   nb_sect;                     /* number of sectors to seek */
	Uint32   next_cluster;                /* the possible next cluster to load */
	Uint16   target_cluster;              /* the cluster to reach */
	Uint16   i;

//  	fat_dir_current_offs = 0;
  	fat_dir_current_offs = offset;     /* Calculate the absolute byte pos */
  	nb_sect = (Uint16)((fat_dir_current_offs) / fat_sector_size);
	if(fat_type_id != FAT_IS_32)
  		fat_dir_current_sect = fat_ptr_rdir + nb_sect;
  	fat_dir_sector_offset = fat_dir_current_offs % (((Uint32)fat_sector_size) * fat_cluster_size);
  	fat_dclust_byte_count = fat_dir_sector_offset; //offset in a cluster 
  	fat_dir_sector_offset %= fat_sector_size;                   

  	if ((dir_is_root == FALSE) || (fat_type_id == FAT_IS_32))                 // Sub-directory   /
  	{  
	  	// Find the # cluster 
     	target_cluster = (nb_sect / fat_cluster_size);
     	fat_dchain_index = 0;
		if(fat_type_id == FAT_IS_32)
     		next_cluster = dclusters[fat_dchain_index].cluster.l;
	 	else
			next_cluster = dclusters[fat_dchain_index].cluster.w[1];

     	fat_dchain_nb_clust = 1;
    	for (i = 0; i < target_cluster; i++)
    	{
      		if (dclusters[fat_dchain_index].number <= fat_dchain_nb_clust)
        	{ // new fragment 
          		fat_dchain_index++;
          		fat_dchain_nb_clust = 1;
          		if(fat_type_id == FAT_IS_32)
     	      		next_cluster = dclusters[fat_dchain_index].cluster.l;
	      		else
		      		next_cluster = dclusters[fat_dchain_index].cluster.w[1];
        	}
       		else
        	{ // not new fragment 
          		//next_cluster = dclusters[fat_dchain_index].cluster + fat_dchain_nb_clust;
		  		if(fat_type_id == FAT_IS_32)
     	      		next_cluster = dclusters[fat_dchain_index].cluster.l;
	      		else
		      		next_cluster = dclusters[fat_dchain_index].cluster.w[1];
          
				next_cluster += fat_dchain_nb_clust;
          		fat_dchain_nb_clust++;
        	}
    	}

    	fat_dir_current_sect = (((Uint32)(next_cluster) * fat_cluster_size)
                           + fat_ptr_data + (nb_sect % fat_cluster_size));
  	}
  
    phy_read_open(fat_dir_current_sect);
    return OK;  
}


/*F**************************************************************************
* NAME: fat_dgetsector
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Return the directory data page at the current position
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/ 
void fat_dgetsector (void)
{
  	Uint32 next_cluster;  
    /* new cluster in allocation list */
//  	if((fat_dclust_byte_count % (fat_sector_size * fat_cluster_size)) == 0 )
	if(((fat_dclust_byte_count / fat_sector_size) % fat_cluster_size) == 0 )
  	{
	    //fat_dclust_byte_count=0;
		/* extract if necessary the next cluster from the allocation list */
		if ((dclusters[fat_dchain_index].number == fat_dchain_nb_clust)&&(dclusters[0].number != 0))
		{ /* new fragment */
		  	fat_dchain_index++;
		  	fat_dchain_nb_clust = 1;
		  	next_cluster = dclusters[fat_dchain_index].cluster.l;
		  	fat_dir_current_sect = fat_ptr_data + ((Uint32)(next_cluster) * fat_cluster_size);
		  	phy_read_open(fat_dir_current_sect);
		}
		else
		{ /* no new fragment */
		  	if(dclusters[fat_dchain_index].number == 0)
		  	 	fat_dchain_nb_clust = 0;
		  	//next_cluster = dclusters[fat_dchain_index].cluster + fat_dchain_nb_clust;
		  	next_cluster = dclusters[fat_dchain_index].cluster.l + fat_dchain_nb_clust;
		  	fat_dir_current_sect = fat_ptr_data + ((Uint32)(next_cluster) * fat_cluster_size);
		  //if((fat_dchain_index == 0)&&(fat_dchain_nb_clust == 0))
          //{
			  phy_read_open(fat_dir_current_sect);
          //}
		    fat_dchain_nb_clust++;                /* one more cluster read */
		}
		//fat_dir_current_sect = fat_ptr_data + ((Uint32)(next_cluster) * fat_cluster_size);
		//phy_read_open(fat_dir_current_sect);
  	}
    fat_dclust_byte_count += fat_sector_size;                  /* one more byte read */
    phy_read_sector();
}


/*F**************************************************************************
* NAME: fat_get_dir_entry
*----------------------------------------------------------------------------
* PARAMS:
*   entry: directory entry structure
* return: none
*----------------------------------------------------------------------------
* PURPOSE:
*   Get from directory all information about a directory or file entry
*----------------------------------------------------------------------------
* NOTE:
*   This function reads directly datas from sectors
*   It automaticaly computes difference between LFN and normal entries
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
void fat_get_dir_entry (fat_st_dir_entry xdata *entry)
{
	Byte     exit_flag = FALSE;
	Byte     lfn_entry_found = FALSE;
	Byte    i;
	Uint16  num;
	Uint16  j;
	Byte flag;
	byte count;

  	num = fat_dir_sector_offset; /*number of bytes to seek in a cluster*/
  	flag = FALSE;
  	count = 0;

 	for (i = MAX_FILENAME_LEN; i != 0; lfn_name[--i] = '\0');

  	phy_read_sector();

  	//num = num%fat_sector_size;

  	while (!exit_flag)
  	/* loop while the entry is not a normal one. */
  	{
	    /* read the directory entry */
      	if(flag == TRUE)
      	{
		    if ((dir_is_root == TRUE)&&(fat_type_id != FAT_IS_32))
		    { 
				 if((num%fat_sector_size)==0)
				 {
				  	  //phy_read_open(fat_ptr_rdir+n);
					  phy_read_sector();
				      num=0;		
				 }
			}
		    else
		    { /* subdir can be fragmented -> dgetc() */
				 if(num % fat_sector_size == 0 )
				 {
			         fat_dgetsector();
					 num=0;
				 }
			}
      	}
      
        j = num;			  
	    num += DIR_SIZE;
        flag = TRUE;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久免费网| 欧美男人的天堂一二区| 精品久久久久久久久久久久久久久久久 | 欧美日韩免费一区二区三区视频| 5566中文字幕一区二区电影| 亚洲欧洲日本在线| 国产高清不卡二三区| 欧美一卡二卡三卡| 午夜精品福利在线| 色婷婷综合久色| 国产精品丝袜黑色高跟| 国产精品91一区二区| 日韩小视频在线观看专区| 亚洲一区二区三区四区的 | 丝袜美腿亚洲一区二区图片| 成人av动漫在线| 久久蜜臀精品av| 久久99精品国产麻豆婷婷洗澡| 欧美精品tushy高清| 一区二区三区久久久| 91色在线porny| 国产精品国产三级国产有无不卡| 国产最新精品精品你懂的| 日韩欧美不卡一区| 日韩高清在线一区| 欧美日韩成人综合天天影院| 亚洲综合色自拍一区| 91啪在线观看| 亚洲天堂久久久久久久| 97精品电影院| 亚洲欧美日本在线| 色天天综合久久久久综合片| 亚洲欧洲av一区二区三区久久| 成人国产精品免费网站| 亚洲国产电影在线观看| 成人在线视频一区| 欧美国产日本韩| 成人午夜私人影院| 国产欧美一区二区三区鸳鸯浴| 国产美女精品在线| 久久精品在线观看| 成人av免费在线观看| 亚洲四区在线观看| 在线视频国产一区| 亚洲成人一区二区| 欧美一级理论片| 蜜桃久久精品一区二区| 欧美精品一区二区久久久| 韩国精品在线观看| 欧美激情一区二区三区不卡| 成人免费视频网站在线观看| 最新不卡av在线| 欧美在线观看视频一区二区| 亚洲网友自拍偷拍| 欧美一区二区成人6969| 精品在线播放午夜| 国产午夜精品理论片a级大结局| 成人av在线资源网| 一区二区三区四区精品在线视频| 欧美亚洲日本国产| 日本不卡123| 国产拍欧美日韩视频二区| 91亚洲精品一区二区乱码| 亚洲国产精品麻豆| 日韩女优av电影在线观看| 国产成人免费在线观看| 亚洲视频小说图片| 7777精品伊人久久久大香线蕉经典版下载 | 久久噜噜亚洲综合| av一区二区三区四区| 亚洲国产精品一区二区www在线| 欧美日韩国产精品成人| 激情综合色综合久久综合| 中文字幕第一区二区| 欧美亚洲一区二区在线观看| 久久国产视频网| 成人欧美一区二区三区视频网页 | 91丝袜呻吟高潮美腿白嫩在线观看| 一区二区高清在线| 欧美岛国在线观看| 成年人网站91| 污片在线观看一区二区| 久久久夜色精品亚洲| 色妞www精品视频| 六月丁香综合在线视频| 亚洲欧洲无码一区二区三区| 欧美日韩久久久一区| 国产一二精品视频| 亚洲444eee在线观看| 国产网站一区二区三区| 欧美日韩精品系列| 国产精品亚洲综合一区在线观看| 亚洲精品免费播放| www国产精品av| 色乱码一区二区三区88| 激情偷乱视频一区二区三区| 尤物在线观看一区| 久久久影视传媒| 欧美另类久久久品| 成人免费观看视频| 美腿丝袜亚洲综合| 樱花草国产18久久久久| 国产日韩精品一区二区三区 | 成人午夜短视频| 日韩二区三区在线观看| 亚洲视频 欧洲视频| 久久亚洲精华国产精华液 | 成人黄色国产精品网站大全在线免费观看| 亚洲伊人伊色伊影伊综合网| 中文一区二区完整视频在线观看| 在线播放中文字幕一区| 99久免费精品视频在线观看| 免费观看一级特黄欧美大片| 亚洲美女区一区| 久久九九久久九九| 91精品国产黑色紧身裤美女| 日本乱人伦一区| 国产成人免费视频| 激情亚洲综合在线| 免费观看久久久4p| 亚洲国产日韩a在线播放| 中文字幕视频一区| 亚洲国产成人私人影院tom| 欧美一区二区三区视频| 欧美亚洲国产一区二区三区| 成人99免费视频| 国产精品一区二区无线| 久久精品国产77777蜜臀| 亚洲一区二区三区美女| 最新不卡av在线| 精品成人一区二区三区| 男男视频亚洲欧美| 欧美一区二区三级| 午夜精品久久久久久久99樱桃| 色中色一区二区| 国产成人精品一区二| 久久99精品一区二区三区三区| 丝袜美腿成人在线| 亚洲一区二区三区四区五区中文 | 久久久综合精品| 2021国产精品久久精品| 日韩欧美一卡二卡| 日韩一区二区三区av| 91麻豆精品国产91久久久更新时间| 日本高清不卡在线观看| 色综合久久久网| 91免费看`日韩一区二区| av资源站一区| 99视频精品在线| 91一区二区三区在线播放| www.欧美.com| 色综合亚洲欧洲| 91蝌蚪porny| 色94色欧美sute亚洲线路二| 91热门视频在线观看| 色一区在线观看| 日本精品视频一区二区| 欧美丝袜丝交足nylons图片| 欧美性生活一区| 欧美日韩国产一级片| 欧美日韩国产首页在线观看| 欧美精品一二三| 日韩亚洲电影在线| 26uuu色噜噜精品一区| 久久久国产精品麻豆| 日韩一区二区在线免费观看| 粉嫩久久99精品久久久久久夜| 国产欧美一区二区三区鸳鸯浴 | 久久精品二区亚洲w码| 另类欧美日韩国产在线| 麻豆91精品视频| 国产另类ts人妖一区二区| 国产超碰在线一区| 9人人澡人人爽人人精品| 一本色道**综合亚洲精品蜜桃冫| 色吊一区二区三区| 欧美日韩成人综合| 精品久久五月天| 国产精品免费看片| 亚洲一区二区av在线| 奇米影视一区二区三区小说| 精彩视频一区二区| 成a人片亚洲日本久久| 在线精品视频免费播放| 在线不卡a资源高清| 久久久久久电影| 亚洲日本成人在线观看| 亚洲成a人片综合在线| 久久99国产精品成人| 成人激情免费电影网址| 欧美亚洲动漫另类| 欧美mv日韩mv亚洲| 国产精品乱码久久久久久 | 国产蜜臀97一区二区三区| 日韩毛片精品高清免费| 三级在线观看一区二区| 国产成人8x视频一区二区| 在线视频国内自拍亚洲视频| 精品久久五月天| 亚洲激情在线播放|