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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? fat16.c

?? MMC/SD操作
?? C
?? 第 1 頁 / 共 4 頁
字號:
}/** * \ingroup fat16_fs * Callback function for seeking through subdirectory entries. */uint8_t fat16_dir_entry_seek_callback(uint8_t* buffer, uint32_t offset, void* p){    struct fat16_read_callback_arg* arg = p;    /* skip deleted entries */    if(buffer[0] == FAT16_DIRENTRY_DELETED)        return 1;    if(arg->entry_cur == arg->entry_num)    {        arg->entry_offset = offset;        arg->byte_count = buffer[11] == 0x0f ?                          ((buffer[0] & FAT16_DIRENTRY_LFNSEQMASK) + 1) * 32 :                          32;        return 0;    }    /* if we read a 8.3 entry, we reached a new directory entry */    if(buffer[11] != 0x0f)        ++arg->entry_cur;    return 1;}/** * \ingroup fat16_fs * Callback function for reading a directory entry. */uint8_t fat16_dir_entry_read_callback(uint8_t* buffer, uint32_t offset, void* p){    struct fat16_dir_entry_struct* dir_entry = p;    /* there should not be any deleted entries */    if(buffer[0] == FAT16_DIRENTRY_DELETED)        return 0;    if(!dir_entry->entry_offset)        dir_entry->entry_offset = offset;        switch(fat16_interpret_dir_entry(dir_entry, buffer))    {        case 0: /* failure */            return 0;        case 1: /* buffer successfully parsed, continue */            return 1;        case 2: /* directory entry complete, finish */            return 0;    }    return 0;}/** * \ingroup fat16_fs * Interprets a raw directory entry and puts the contained * information into the directory entry. *  * For a single file there may exist multiple directory * entries. All except the last one are lfn entries, which * contain parts of the long filename. The last directory * entry is a traditional 8.3 style one. It contains all * other information like size, cluster, date and time. *  * \param[in,out] dir_entry The directory entry to fill. * \param[in] raw_entry A pointer to 32 bytes of raw data. * \returns 0 on failure, 1 on success and 2 if the *          directory entry is complete. */uint8_t fat16_interpret_dir_entry(struct fat16_dir_entry_struct* dir_entry, const uint8_t* raw_entry){    if(!dir_entry || !raw_entry || !raw_entry[0])        return 0;    char* long_name = dir_entry->long_name;    if(raw_entry[11] == 0x0f)    {        uint16_t char_offset = ((raw_entry[0] & 0x3f) - 1) * 13;        if(char_offset + 12 < sizeof(dir_entry->long_name))        {            /* Lfn supports unicode, but we do not, for now.             * So we assume pure ascii and read only every             * second byte.             */            long_name[char_offset + 0] = raw_entry[1];            long_name[char_offset + 1] = raw_entry[3];            long_name[char_offset + 2] = raw_entry[5];            long_name[char_offset + 3] = raw_entry[7];            long_name[char_offset + 4] = raw_entry[9];            long_name[char_offset + 5] = raw_entry[14];            long_name[char_offset + 6] = raw_entry[16];            long_name[char_offset + 7] = raw_entry[18];            long_name[char_offset + 8] = raw_entry[20];            long_name[char_offset + 9] = raw_entry[22];            long_name[char_offset + 10] = raw_entry[24];            long_name[char_offset + 11] = raw_entry[28];            long_name[char_offset + 12] = raw_entry[30];        }        return 1;    }    else    {        /* if we do not have a long name, take the short one */        if(long_name[0] == '\0')        {            uint8_t i;            for(i = 0; i < 8; ++i)            {                if(raw_entry[i] == ' ')                    break;                long_name[i] = raw_entry[i];            }            if(raw_entry[8] != ' ')            {                long_name[i++] = '.';                uint8_t j = 8;                for(; j < 11; ++j)                {                    if(raw_entry[j] != ' ')                    {                        long_name[i++] = raw_entry[j];                    }                    else                    {                        break;                    }                }            }             long_name[i] = '\0';        }                /* extract properties of file and store them within the structure */        dir_entry->attributes = raw_entry[11];        dir_entry->cluster = ((uint16_t) raw_entry[26]) |                             ((uint16_t) raw_entry[27] << 8);        dir_entry->file_size = ((uint32_t) raw_entry[28]) |                               ((uint32_t) raw_entry[29] << 8) |                               ((uint32_t) raw_entry[30] << 16) |                               ((uint32_t) raw_entry[31] << 24);        return 2;    }}/** * \ingroup fat16_file * Retrieves the directory entry of a path. * * The given path may both describe a file or a directory. * * \param[in] fs The FAT16 filesystem on which to search. * \param[in] path The path of which to read the directory entry. * \param[out] dir_entry The directory entry to fill. * \returns 0 on failure, 1 on success. * \see fat16_read_dir */uint8_t fat16_get_dir_entry_of_path(struct fat16_fs_struct* fs, const char* path, struct fat16_dir_entry_struct* dir_entry){    if(!fs || !path || path[0] == '\0' || !dir_entry)        return 0;    if(path[0] == '/')        ++path;    /* begin with the root directory */    memset(dir_entry, 0, sizeof(*dir_entry));    dir_entry->attributes = FAT16_ATTRIB_DIR;    if(path[0] == '\0')        return 1;    while(1)    {        struct fat16_dir_struct* dd = fat16_open_dir(fs, dir_entry);        if(!dd)            break;        /* extract the next hierarchy we will search for */        const char* sep_pos = strchr(path, '/');        if(!sep_pos)            sep_pos = path + strlen(path);        uint8_t length_to_sep = sep_pos - path;                /* read directory entries */        while(fat16_read_dir(dd, dir_entry))        {            /* check if we have found the next hierarchy */            if((strlen(dir_entry->long_name) != length_to_sep ||                strncmp(path, dir_entry->long_name, length_to_sep) != 0))                continue;            fat16_close_dir(dd);            dd = 0;            if(path[length_to_sep] == '\0')                /* we iterated through the whole path and have found the file */                return 1;            if(dir_entry->attributes & FAT16_ATTRIB_DIR)            {                /* we found a parent directory of the file we are searching for */                path = sep_pos + 1;                break;            }            /* a parent of the file exists, but not the file itself */            return 0;        }        fat16_close_dir(dd);    }        return 0;}/** * \ingroup fat16_fs * Retrieves the next following cluster of a given cluster. * * Using the filesystem file allocation table, this function returns * the number of the cluster containing the data directly following * the data within the cluster with the given number. * * \param[in] fs The filesystem for which to determine the next cluster. * \param[in] cluster_num The number of the cluster for which to determine its successor. * \returns The wanted cluster number, or 0 on error. */uint16_t fat16_get_next_cluster(const struct fat16_fs_struct* fs, uint16_t cluster_num){    if(!fs || cluster_num < 2)        return 0;    /* read appropriate fat entry */    uint8_t fat_entry[2];    if(!fs->partition->device_read(fs->header.fat_offset + 2 * cluster_num, fat_entry, 2))        return 0;    /* determine next cluster from fat */    cluster_num = ((uint16_t) fat_entry[0]) |                  ((uint16_t) fat_entry[1] << 8);        if(cluster_num == FAT16_CLUSTER_FREE ||       cluster_num == FAT16_CLUSTER_BAD ||       (cluster_num >= FAT16_CLUSTER_RESERVED_MIN && cluster_num <= FAT16_CLUSTER_RESERVED_MAX) ||       (cluster_num >= FAT16_CLUSTER_LAST_MIN && cluster_num <= FAT16_CLUSTER_LAST_MAX))        return 0;        return cluster_num;}/** * \ingroup fat16_fs * Appends a cluster to an existing cluster chain. * * Set cluster_num to zero to allocate the first cluster * within the chain. * * \param[in] fs The file system on which to operate. * \param[in] cluster_num The cluster to which to append a free one. * \returns 0 on failure, the number of the new cluster on success. */uint16_t fat16_append_cluster(const struct fat16_fs_struct* fs, uint16_t cluster_num){#if FAT16_WRITE_SUPPORT    if(!fs)        return 0;        uint32_t fat_offset_from = fs->header.fat_offset;    uint32_t fat_offset_to = fat_offset_from + fs->header.fat_size;    uint32_t fat_offset = fat_offset_from;    device_read_t device_read = fs->partition->device_read;    device_write_t device_write = fs->partition->device_write;    uint16_t cluster_new = 0;    uint8_t buffer[2];    while(1)    {        if(!device_read(fat_offset, buffer, sizeof(buffer)))            return 0;        /* check if this is a free cluster */        if(buffer[0] == (FAT16_CLUSTER_FREE & 0xff) &&           buffer[1] == ((FAT16_CLUSTER_FREE >> 8) & 0xff))            break;        ++cluster_new;        fat_offset += sizeof(buffer);                /* abort if we reached the end of the fat */        if(fat_offset >= fat_offset_to)            return 0;    }    buffer[0] = FAT16_CLUSTER_LAST_MAX & 0xff;    buffer[1] = (FAT16_CLUSTER_LAST_MAX >> 8) & 0xff;    if(!device_write(fat_offset_from + 2 * cluster_new, buffer, sizeof(buffer)))        return 0;        if(cluster_num >= 2)    {        buffer[0] = cluster_new & 0xff;        buffer[1] = (cluster_new >> 8) & 0xff;        device_write(fat_offset_from + 2 * cluster_num, buffer, sizeof(buffer));    }    return cluster_new;    #else    return 0;#endif}/** * \ingroup fat16_fs * Frees a cluster. * * Marks the specified cluster as free. It may then again be * used for future file allocations. * * \param[in] fs The filesystem on which to operate. * \param[in] cluster_num The cluster which to free. * \returns 0 on failure, 1 on success. */uint8_t fat16_free_cluster(struct fat16_fs_struct* fs, uint16_t cluster_num){#if FAT16_WRITE_SUPPORT    if(!fs || cluster_num < 2)        return 0;    uint32_t fat_offset = fs->header.fat_offset;    uint8_t buffer[2];        buffer[0] = FAT16_CLUSTER_FREE & 0xff;    buffer[1] = (FAT16_CLUSTER_FREE >> 8) & 0xff;    return fs->partition->device_write(fat_offset + 2 * cluster_num, buffer, 2);#else    return 0;#endif}/** * \ingroup fat16_file * Opens a file on a FAT16 filesystem. * * \param[in] fs The filesystem on which the file to open lies. * \param[in] dir_entry The directory entry of the file to open. * \returns The file handle, or 0 on failure. * \see fat16_close_file */struct fat16_file_struct* fat16_open_file(struct fat16_fs_struct* fs, const struct fat16_dir_entry_struct* dir_entry){    if(!fs || !dir_entry || (dir_entry->attributes & FAT16_ATTRIB_DIR))        return 0;    struct fat16_file_struct* fd = malloc(sizeof(*fd));    if(!fd)        return 0;        memcpy(&fd->dir_entry, dir_entry, sizeof(*dir_entry));    fd->fs = fs;    fd->pos = 0;    return fd;}/** * \ingroup fat16_file * Closes a file. * * \param[in] fd The file handle of the file to close. * \see fat16_open_file */void fat16_close_file(struct fat16_file_struct* fd){    if(fd)        free(fd);}/** * \ingroup fat16_file * Reads data from a file. *  * The data requested is read from the current file location. * * \param[in] fd The file handle of the file from which to read. * \param[out] buffer The buffer into which to write. * \param[in] buffer_len The amount of data to read. * \returns The number of bytes read, 0 on end of file, or -1 on failure. * \see fat16_write_file */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线观看免费一区| 最新不卡av在线| 亚洲成人免费视频| 欧美乱妇23p| 日韩精品久久理论片| 精品欧美一区二区在线观看 | 日本一区二区视频在线| 成人午夜av电影| 亚洲人成小说网站色在线| 色老综合老女人久久久| 日韩黄色在线观看| 久久久影视传媒| a在线欧美一区| 午夜伊人狠狠久久| 亚洲精品在线电影| av高清久久久| 亚洲va欧美va国产va天堂影院| 欧美一级一区二区| 国产成人av福利| 成人免费在线播放视频| 欧美少妇一区二区| 国产精品亚洲专一区二区三区 | 国产视频在线观看一区二区三区| 成人av电影在线| 水野朝阳av一区二区三区| 精品国产乱码久久久久久浪潮| 欧洲中文字幕精品| 精品亚洲porn| 亚洲男人电影天堂| 日韩一级二级三级| 99久久精品免费精品国产| 五月天一区二区| 国产精品麻豆一区二区| 91精品国产综合久久久久久久久久 | 婷婷开心久久网| 亚洲国产高清在线观看视频| 欧美视频一区二区三区| 国产成人在线免费观看| 一区二区在线观看视频在线观看| 欧美第一区第二区| 91免费观看在线| 国产一区二区三区香蕉| 亚洲精品国产精品乱码不99| 日韩一二三区视频| 91成人免费在线视频| 国产成人亚洲综合a∨猫咪| 亚洲国产日韩一区二区| 精品国产乱码久久久久久浪潮| 91国产成人在线| 国产成人在线色| 麻豆极品一区二区三区| 亚洲一区日韩精品中文字幕| 国产日韩欧美精品一区| 欧美一区二区三区系列电影| 成人性生交大片免费看中文网站| 日本麻豆一区二区三区视频| 亚洲一区二区综合| 18欧美乱大交hd1984| 精品黑人一区二区三区久久 | 久久精品亚洲乱码伦伦中文| 日韩一级黄色大片| 欧美疯狂做受xxxx富婆| 在线亚洲免费视频| 色综合久久综合网欧美综合网| 国产精品77777| 国产不卡高清在线观看视频| 91社区在线播放| 成人avav影音| 懂色av中文一区二区三区| 久99久精品视频免费观看| 美女高潮久久久| 麻豆久久久久久| 国产精品国产三级国产aⅴ入口 | 日本不卡一二三| 日韩在线观看一区二区| 日韩制服丝袜av| 日韩高清欧美激情| 久久99精品视频| 国产一区二区三区精品视频| 国内精品久久久久影院色| 国产一区欧美日韩| 国产精品77777| 不卡欧美aaaaa| 91在线云播放| 欧洲生活片亚洲生活在线观看| 日本二三区不卡| 在线观看免费一区| 欧美日韩一区二区电影| 91精品麻豆日日躁夜夜躁| 日韩一区二区三区在线视频| 日韩午夜在线观看视频| 久久一日本道色综合| 久久精品亚洲精品国产欧美kt∨| 国产欧美日韩不卡免费| 日韩理论片网站| 亚洲成年人影院| 精品一区二区在线免费观看| 成熟亚洲日本毛茸茸凸凹| 99久久免费视频.com| 欧美亚洲综合在线| 日韩欧美国产三级电影视频| 日本一区二区三区在线观看| 亚洲裸体xxx| 另类调教123区| 成人国产电影网| 欧美日韩免费观看一区三区| 欧美mv日韩mv国产| 中文字幕一区二区三区不卡| 成人免费av网站| 精品视频在线免费看| 欧美成人一区二区| 亚洲欧洲日韩综合一区二区| 亚洲国产精品嫩草影院| 极品尤物av久久免费看| 色综合久久88色综合天天6| 欧美福利一区二区| 国产精品伦理在线| 香蕉av福利精品导航| 国产成人在线视频播放| 欧美日韩在线免费视频| 国产丝袜美腿一区二区三区| 亚洲一区中文在线| 成人一区在线观看| 欧美精品乱码久久久久久按摩| 国产欧美日本一区二区三区| 亚洲在线一区二区三区| 国产成人综合自拍| 51精品久久久久久久蜜臀| 国产精品国产精品国产专区不片| 日韩成人一级片| 色综合久久久久网| 久久综合av免费| 亚洲成人综合视频| 日韩国产欧美三级| 一本色道亚洲精品aⅴ| 26uuu精品一区二区在线观看| 亚洲欧美激情一区二区| 国内精品伊人久久久久影院对白| 欧美日韩黄视频| 日韩码欧中文字| 国产精品自拍一区| 正在播放一区二区| 国产乱人伦偷精品视频免下载| 欧美日韩精品免费| 亚洲人成网站色在线观看| 成人精品视频网站| 国产亚洲污的网站| 久久超碰97中文字幕| 3d成人动漫网站| 亚洲成av人影院| 在线国产电影不卡| 一区二区三区中文字幕| 成人av网站在线观看免费| 国产三级精品三级| 久久激五月天综合精品| 91精品一区二区三区在线观看| 亚洲一区二区三区激情| 91久久免费观看| 亚洲激情图片一区| 91性感美女视频| 亚洲欧美日韩国产一区二区三区| 成人动漫视频在线| 国产精品色噜噜| eeuss鲁片一区二区三区| 国产精品久久福利| 99精品久久99久久久久| 日韩一区在线看| 色噜噜久久综合| 亚洲午夜成aⅴ人片| 欧美午夜精品久久久| 亚洲成av人影院在线观看网| 欧美蜜桃一区二区三区| 日韩精品电影一区亚洲| 欧美一区二区啪啪| 精品在线观看视频| 国产日产欧产精品推荐色| 成人精品免费看| 亚洲色图视频网| 欧美日韩高清一区二区不卡| 日韩精品亚洲一区二区三区免费| 欧美精品在线视频| 国内精品写真在线观看| 国产日韩高清在线| 99国产麻豆精品| 五月天久久比比资源色| 欧美成人一区二区三区片免费| 国产精品1区2区| 亚洲人被黑人高潮完整版| 欧美中文字幕亚洲一区二区va在线| 午夜精品久久久久久久99水蜜桃| 欧美一级艳片视频免费观看| 国产九九视频一区二区三区| 亚洲欧洲精品成人久久奇米网| 欧美视频在线观看一区| 久久精工是国产品牌吗| 中文字幕av在线一区二区三区| 日本电影欧美片| 精品无人区卡一卡二卡三乱码免费卡| 国产日韩精品一区二区三区| 欧美最新大片在线看|