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

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

?? fat.c

?? fat16文件系統源碼。需要的請下
?? C
?? 第 1 頁 / 共 3 頁
字號:
  fat_get_dir_file_list(id);                /* create list of entries */

  if (fat_dir_list_last == 0)
    return KO;                              /* no requested (id) entry */

  fat_dir_list_index = 0;                   /* point on first root entry */

  /* extract info from table */
  if (fat_dseek(fat_dir_entry_list[0] * DIR_SIZE) == OK)
  {
    fat_get_dir_entry(&fat_cache.current);  /* update current file info */
    /* parent dir is also root */
    fat_cache.parent.start_cluster = 0;   
    fat_cache.parent.attributes = ATTR_ROOT_DIR;  /* mark as root dir */
    return OK;
  }
  else
    return KO;                              /* low level error */
}

/*F**************************************************************************
* NAME: fat_read_cluster12
*----------------------------------------------------------------------------
* PARAMS:
*   init : initialize the parity bit or not
* return:
*   FAT12 cluster value
*----------------------------------------------------------------------------
* PURPOSE:
*   Read in fat12 file system a cluster value   
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/

Uint16 fat_read_cluster (Byte init)
{
static Byte fat12_parity;
static  Uint16 cluster;
   INT8U a,b;


  if (fat_is_fat16)
  {
     a = Hard_read_byte();
     b = Hard_read_byte();
     cluster = fat_caculate_offset(a,b,0,0);
  
   // ((Byte*)&cluster)[1] = Hard_read_byte();
   // ((Byte*)&cluster)[0] = Hard_read_byte();
    return cluster;
  }

  if (init)
  {
    fat12_parity = 0;
    cluster = 0;
  }

  if (fat12_parity == 0)
  {
    a = Hard_read_byte();
    b = Hard_read_byte();
    cluster = fat_caculate_offset(a,b,0,0);
    fat12_parity = 1;
    return (cluster & 0x0FFF);
  }
  else
  {
    cluster = (cluster & 0xF000) >> 12;
    cluster += (Hard_read_byte() << 4);
    fat12_parity = 0;
    return (cluster);
  }
}



/*F**************************************************************************
* NAME: fat_get_clusters
*----------------------------------------------------------------------------
* PARAMS:
*   chain:   allocation list address
*   nb_frag: maximum number of fragment 
*
* return:
*   - OK: allocation done
*   - KO: allocation done but truncated: file too much fragmented
*----------------------------------------------------------------------------
* PURPOSE:
*   Prepare a list of the file clusters:
*     chain[n].cluster contains the starting cluster number of a fragment
*     chain[n].number contains the number of contiguous clusters in fragment
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   File cluster list is limited by the nb_frag parameter.
*   If memory is too much fragmented, file may not be fully played.
*   Last list item always has single cluster
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/

Byte fat_get_clusters (fat_st_clust_chain  *chain, Byte nb_frag)
{
Byte   index;                               // index in chain
Uint16 i; 
Uint16 new_cluster;
Uint16 old_cluster;
Uint16 temp;
  nb_frag = nb_frag - 1;                    // set limit (index start at 0) 

  // build the first entry of the allocation list 
  chain[0].number = 1;
  chain[0].cluster = fat_cache.current.start_cluster - 2; // 2 = 1st cluster 
  old_cluster = fat_cache.current.start_cluster;

  index = 0;

  
  // calculate the first offset in fat and read the corresponding sector  
  if (fat_is_fat16)
  { 
    Hard_read_open(fat_ptr_fats + (old_cluster / (SECTOR_SIZE / 2)));
    // compute offset in sector 
    for (i = (old_cluster % (SECTOR_SIZE / 2)); i != 0; i--)
    { 
      fat_read_cluster(0);
    }
    // read first entry 
    new_cluster = fat_read_cluster(0);
    temp = LAST_CLUSTER16;
  }
  else
  {
    Hard_read_open(fat_ptr_fats);
    new_cluster = fat_read_cluster(1);
    for (i = old_cluster; i != 0; i--)
    {
      new_cluster = fat_read_cluster(0);
    }
    temp = LAST_CLUSTER12;
  }
    
  while (new_cluster != temp)   // loop until last cluster found 
  {
    if ((new_cluster == (old_cluster + 1)) && (chain[index].number != MAX_CL_PER_FRAG))
    { // contiguous cluster up to 255 or 65535 
      chain[index].number++;
    }
    else
    { // compute fragmentation 
      index++;
      chain[index].number = 1;
      chain[index].cluster = new_cluster - 2;  // 2 = 1st cluster 
      for (i = new_cluster - old_cluster - 1; i != 0; i--)
      {
        fat_read_cluster(0);
      }
    }
    old_cluster = new_cluster;
    if (index == nb_frag)
    { // end of chain reached 
      // last fragment always contains a single cluster 
      chain[nb_frag].number = 1;          
      fat_last_clust_index = nb_frag;
      Hard_read_close();                  // close physical read 
      return  KO;                         // file too much fragmented 
    }
    else
    {
      // read new entry 
      new_cluster = fat_read_cluster(0);
    }
  }

  // end of file: last fragment must always contain a single cluster 
  if (chain[index].number == 1)
  { // last cluster is the current one 
    fat_last_clust_index = index;
  }
  else
  {
    fat_last_clust_index = index + 1;
    chain[index].number--;
    chain[fat_last_clust_index].cluster = chain[index].cluster + chain[index].number;
    chain[fat_last_clust_index].number = 1; 
  }
  Hard_read_close();                        // close physical read 
       
  return OK;
}


/*F**************************************************************************
* NAME: fat_fopen
*----------------------------------------------------------------------------
* PARAMS:
*   mode: READ:   open file for read
*         WRITE:  open file for write
*
* return:
*   - OK: file opened
*   - KO: file not opened: - file is empty
*                          - low level read error
*----------------------------------------------------------------------------
* PURPOSE:
*   Open the file in read or write mode
*----------------------------------------------------------------------------
* EXAMPLE:
*   if (fat_get_root_directory(FILE_WAV) == OK)       // Select first WAV file in root
*   {
*     fat_fopen(WRITE);                               // Open this file in WRITE mode
*     for (j = 0; j < 10; j++)
*       fat_fputc(buff[j]);
*     fat_fclose();
*   }
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*   For write mode, there must be an entry in the root and entry data must be
*   updated.
*****************************************************************************/

Byte fat_fopen (Byte mode)
{
  if (mode == READ)
  {
    if (fat_cache.current.size.l == 0)
    {
      return KO;                            // file empty 
    }
    else
    {
      fat_fclust_byte_count = 0;            // byte 0 of cluster 
  
      // reset the allocation list variable 
      fat_fchain_index = 0;
      fat_fchain_nb_clust = 0;              // start on first contiguous cl 
      // get file allocation list 
      fat_get_clusters(fclusters, MAX_FILE_FRAGMENT_NUMBER);
  
      // seek to the beginning of the file 
      fat_open_mode = READ;

      return Hard_read_open(fat_ptr_data + ((Uint32)(fclusters[0].cluster)*fat_cluster_size));
    }
  }
  else
  {
    fat_fclust_byte_count = 0;              // byte 0 of cluster 
    fat_file_size.l = 0;
    flag_end_disk_file = FALSE;
    // reset the allocation list variable 
    fat_fchain_index = 0;
    fat_fchain_nb_clust = 0;                // start on first contiguous cl 
    fat_root_entry = fat_dclust_byte_count / 32;
    // get file allocation list 
    fat_get_clusters(fclusters, MAX_FILE_FRAGMENT_NUMBER);
    fat_open_mode = WRITE;
    return Hard_write_open(fat_ptr_data + ((Uint32)(fclusters[0].cluster) 
                                           * fat_cluster_size));
  }
}


/*F**************************************************************************
* NAME: fat_fgetc
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*   byte read
*----------------------------------------------------------------------------
* PURPOSE:
*   Read one byte from file
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*   As this function is called very often it must be short and optimized
*   in execution time
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
Byte fat_fgetc (void)
{  
  if(   ( (Byte)fat_fclust_byte_count == 0x00 ) && 
        ( (((Byte)(fat_fclust_byte_count >> 8)) & fat_cluster_mask) == 0x00 )
    )

 // if ((((Byte*)&fat_fclust_byte_count)[1] == 0x00) &&
 //     ((((Byte*)&fat_fclust_byte_count)[0] & fat_cluster_mask) == 0x00))
  {     
    /* extract if necessary the next cluster from the allocation list */
    if (fclusters[fat_fchain_index].number == fat_fchain_nb_clust)
    { /* new fragment */
      fat_fchain_index++;
      fat_fchain_nb_clust = 1;
      Hard_read_close();

      Hard_read_open(fat_ptr_data + ((Uint32)(fclusters[fat_fchain_index].cluster) * fat_cluster_size));
    }
    else
    { /* no new fragment */
      fat_fchain_nb_clust++;                /* one more cluster read */
    }
  }
  fat_fclust_byte_count++;                  /* one more byte read */
  return Hard_read_byte();
}


/*F**************************************************************************
* NAME: fat_feof
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Return the file end flag
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
Byte fat_feof (void)
{
  if (fat_fchain_index >= fat_last_clust_index)
  {
    if (fat_open_mode == READ)
      return (fat_fclust_byte_count >= (Uint16)fat_cache.current.size.l);
    else
      return flag_end_disk_file;
  }
  else
  {
    return FALSE;
  }
}


/*F**************************************************************************
* NAME: fat_fclose
*----------------------------------------------------------------------------
* PARAMS:
*
* return:
*----------------------------------------------------------------------------
* PURPOSE:
*   Close opened file
*----------------------------------------------------------------------------
* EXAMPLE:
*----------------------------------------------------------------------------
* NOTE:
*----------------------------------------------------------------------------
* REQUIREMENTS:
*****************************************************************************/
//void fat_fclose (void)
//{
//  if (fat_open_mode == READ)
//  {
//    Hard_read_close();                      /* close reading */
//  }
 // else
 // {
 //   Hard_write_close();                     /* close writing */
 //   fat_update_entry_fat();                 /* Update entry and fat */
 // }
//}













?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美在线另类| 欧美日本一区二区在线观看| 欧美不卡视频一区| 日韩极品在线观看| 色屁屁一区二区| 亚洲日本成人在线观看| 成人小视频在线| 国产欧美日韩不卡免费| 国产mv日韩mv欧美| 中文字幕av不卡| 国产一区二区福利视频| 久久品道一品道久久精品| 国产自产视频一区二区三区| 日韩视频一区在线观看| 亚洲va欧美va天堂v国产综合| 极品销魂美女一区二区三区| 26uuu久久天堂性欧美| 久久精品国产精品青草| 久久精品这里都是精品| 成人小视频在线观看| 亚洲视频一区在线| 91福利视频久久久久| 亚洲一区二区三区四区五区黄| 欧美亚洲综合久久| 日韩专区在线视频| 日韩精品自拍偷拍| 粉嫩蜜臀av国产精品网站| 国产精品成人一区二区艾草 | 国产乱国产乱300精品| 国产欧美日韩麻豆91| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲乱码国产乱码精品精98午夜| 色国产精品一区在线观看| 香蕉av福利精品导航| 欧美色综合影院| 激情久久五月天| 久久久噜噜噜久噜久久综合| 成人理论电影网| 亚洲曰韩产成在线| 欧美tk—视频vk| 成人理论电影网| 亚洲国产wwwccc36天堂| 欧美电影一区二区三区| 日韩中文字幕av电影| 久久久久久久免费视频了| 97超碰欧美中文字幕| 午夜精品久久久久久久99樱桃| 精品国产乱码久久久久久免费| 国产精品一区二区男女羞羞无遮挡| 亚洲欧美日韩在线| 日韩精品一区二区三区中文精品| 成人免费的视频| 日韩精品欧美精品| 亚洲欧美日韩国产中文在线| 日韩欧美高清在线| 在线观看亚洲精品| 国产高清亚洲一区| 亚洲国产成人tv| 国产精品久久福利| 日韩亚洲欧美一区二区三区| 播五月开心婷婷综合| 日本视频一区二区| 欧美国产日本视频| 欧美一区日韩一区| 成人免费视频视频在线观看免费| 无码av免费一区二区三区试看 | 欧美午夜在线观看| 蜜乳av一区二区| √…a在线天堂一区| 91精品综合久久久久久| 久久成人免费电影| 亚洲免费观看视频| 中文字幕av一区 二区| 精品国产一区二区三区久久影院| 欧美性猛片aaaaaaa做受| 高清视频一区二区| 国产乱理伦片在线观看夜一区| 首页综合国产亚洲丝袜| 亚洲乱码国产乱码精品精小说 | 91在线免费播放| 国产精品一级片| 激情图区综合网| 婷婷久久综合九色国产成人| 亚洲卡通欧美制服中文| 亚洲色图制服诱惑| 国产精品色哟哟| 国产日韩精品一区二区浪潮av| 日韩三级在线免费观看| 欧美精品日日鲁夜夜添| 欧美性猛交xxxx乱大交退制版| 91年精品国产| 色婷婷久久综合| 国产美女在线观看一区| 国产老肥熟一区二区三区| 开心九九激情九九欧美日韩精美视频电影 | 国产中文字幕一区| 国精品**一区二区三区在线蜜桃| 蜜桃在线一区二区三区| 精品一区二区三区免费视频| 久久 天天综合| 国产精品性做久久久久久| 国产精品99久久久久久似苏梦涵 | 久久久天堂av| 国产日产欧美一区二区三区 | 国产又黄又大久久| 精油按摩中文字幕久久| 免费观看在线综合| 麻豆精品久久精品色综合| 蜜臀国产一区二区三区在线播放 | 欧美激情综合五月色丁香| 国产亚洲综合在线| 欧美精品一区二区精品网| 欧美精品一区二区三区蜜桃 | 欧美放荡的少妇| 日韩欧美一区二区免费| 久久蜜桃香蕉精品一区二区三区| 国产日韩欧美精品综合| 亚洲美女淫视频| 午夜电影网一区| 国产一区视频在线看| 91亚洲精华国产精华精华液| 成人高清av在线| 91香蕉视频黄| 欧美精品黑人性xxxx| 精品处破学生在线二十三| 国产欧美日韩久久| 一区二区三区高清在线| 首页亚洲欧美制服丝腿| 国产一区二区三区观看| 国产成人aaa| 欧美日韩日日夜夜| 欧美激情自拍偷拍| 亚洲国产一区二区视频| 久久99久久99| 91成人在线精品| 日韩精品在线一区二区| 亚洲欧美日韩久久| 久久精品国产精品亚洲精品| 99久久婷婷国产| 欧美一区二区成人| 国产精品久久夜| 免费三级欧美电影| 91免费版在线看| 91精品在线观看入口| 国产亚洲视频系列| 亚洲成人www| 成人动漫一区二区| 日韩写真欧美这视频| 亚洲天堂中文字幕| 韩国精品主播一区二区在线观看 | 亚洲高清免费观看| 97久久超碰国产精品电影| 337p粉嫩大胆色噜噜噜噜亚洲 | 亚洲第一狼人社区| 成人激情黄色小说| 精品久久人人做人人爽| 亚洲第一成人在线| av激情综合网| 久久精品人人做人人爽人人| 亚洲综合在线免费观看| 国产盗摄一区二区| 国产清纯在线一区二区www| 国产成人无遮挡在线视频| 欧美激情一区二区三区不卡| 国产激情视频一区二区三区欧美 | 久久不见久久见免费视频1| 欧美一级在线观看| 久久se这里有精品| 精品国产乱码久久久久久夜甘婷婷| 麻豆国产欧美一区二区三区| 欧美刺激午夜性久久久久久久| 强制捆绑调教一区二区| 精品美女一区二区| 国产乱码字幕精品高清av| 国产日韩视频一区二区三区| 成人高清免费在线播放| 亚洲精品乱码久久久久| 欧美无人高清视频在线观看| 亚洲va天堂va国产va久| 日韩欧美国产午夜精品| 国产乱人伦偷精品视频免下载 | 精品一区二区三区影院在线午夜| 精品国产污污免费网站入口 | 亚洲免费资源在线播放| 欧美日韩在线播放| 毛片一区二区三区| 久久蜜桃av一区二区天堂| 99精品热视频| 天堂久久久久va久久久久| 久久综合久久综合久久综合| 国产91露脸合集magnet| 亚洲精品精品亚洲| 欧美顶级少妇做爰| 丰满少妇在线播放bd日韩电影| 樱花草国产18久久久久| 日韩欧美激情四射| 91在线免费看| 久久福利视频一区二区| 国产精品伦一区二区三级视频| 91国产免费观看|