Lines Matching refs:BYTE
217 #define ABORT(fs, res) { fp->err = (BYTE)(res); LEAVE_FF(fs, res); }
480 static const BYTE LfnOfs[] = {1,3,5,7,9,14,16,18,20,22,24,28,30}; /* FAT: Offset of LFN character…
485 static BYTE DirBuf[MAXDIRB(FF_MAX_LFN)]; /* Directory entry block scratchpad buffer */
495 #define DEF_NAMBUF WCHAR lbuf[FF_MAX_LFN+1]; BYTE dbuf[MAXDIRB(FF_MAX_LFN)]; /* LFN working …
508 …fn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; (fs)->dirbuf = (BYTE*)(lfn+FF_MAX_LFN+1)…
533 static const BYTE *ExCvt, *DbcTbl; /* Pointer to current SBCS up-case table and DBCS code range ta…
535 static const BYTE Ct437[] = TBL_CT437;
536 static const BYTE Ct720[] = TBL_CT720;
537 static const BYTE Ct737[] = TBL_CT737;
538 static const BYTE Ct771[] = TBL_CT771;
539 static const BYTE Ct775[] = TBL_CT775;
540 static const BYTE Ct850[] = TBL_CT850;
541 static const BYTE Ct852[] = TBL_CT852;
542 static const BYTE Ct855[] = TBL_CT855;
543 static const BYTE Ct857[] = TBL_CT857;
544 static const BYTE Ct860[] = TBL_CT860;
545 static const BYTE Ct861[] = TBL_CT861;
546 static const BYTE Ct862[] = TBL_CT862;
547 static const BYTE Ct863[] = TBL_CT863;
548 static const BYTE Ct864[] = TBL_CT864;
549 static const BYTE Ct865[] = TBL_CT865;
550 static const BYTE Ct866[] = TBL_CT866;
551 static const BYTE Ct869[] = TBL_CT869;
552 static const BYTE Dc932[] = TBL_DC932;
553 static const BYTE Dc936[] = TBL_DC936;
554 static const BYTE Dc949[] = TBL_DC949;
555 static const BYTE Dc950[] = TBL_DC950;
559 static const BYTE ExCvt[] = MKCVTBL(TBL_CT, FF_CODE_PAGE);
563 static const BYTE DbcTbl[] = MKCVTBL(TBL_DC, FF_CODE_PAGE);
581 static WORD ld_word (const BYTE* ptr) /* Load a 2-byte little-endian word */ in ld_word()
590 static DWORD ld_dword (const BYTE* ptr) /* Load a 4-byte little-endian word */ in ld_dword()
602 static QWORD ld_qword (const BYTE* ptr) /* Load an 8-byte little-endian word */ in ld_qword()
619 static void st_word (BYTE* ptr, WORD val) /* Store a 2-byte word in little-endian */ in st_word()
621 *ptr++ = (BYTE)val; val >>= 8; in st_word()
622 *ptr++ = (BYTE)val; in st_word()
625 static void st_dword (BYTE* ptr, DWORD val) /* Store a 4-byte word in little-endian */ in st_dword()
627 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
628 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
629 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
630 *ptr++ = (BYTE)val; in st_dword()
634 static void st_qword (BYTE* ptr, QWORD val) /* Store an 8-byte word in little-endian */ in st_qword()
636 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
637 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
638 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
639 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
640 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
641 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
642 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
643 *ptr++ = (BYTE)val; in st_qword()
671 static int dbc_1st (BYTE c) in dbc_1st()
691 static int dbc_2nd (BYTE c) in dbc_2nd()
733 BYTE b; in tchar2uni()
736 uc = (BYTE)*p++; /* Get a unit */ in tchar2uni()
752 b = (BYTE)*p++; in tchar2uni()
766 BYTE b; in tchar2uni()
769 wc = (BYTE)*p++; /* Get a byte */ in tchar2uni()
770 if (dbc_1st((BYTE)wc)) { /* Is it a DBC 1st byte? */ in tchar2uni()
771 b = (BYTE)*p++; /* Get 2nd byte */ in tchar2uni()
788 static BYTE put_utf ( /* Returns number of encoding units written (0:buffer overflow or wrong enc… in put_utf()
1203 BYTE *p; in put_fat()
1214 *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val; /* Put 1st byte */ in put_fat()
1219 … *p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F)); /* Put 2nd byte */ in put_fat()
1267 BYTE bm, bv; in find_bitmap()
1308 BYTE bm; in change_bitmap()
1621 BYTE *ibuf; in dir_clear()
1806 const BYTE* dir /* Pointer to the key entry */
1823 BYTE* dir, /* Pointer to the key entry */
1843 BYTE* dir /* Pointer to the directory entry containing the part of LFN */
1879 BYTE* dir /* Pointer to the LFN entry */
1917 BYTE* dir, /* Pointer to the LFN entry to be created */
1918 BYTE ord, /* LFN order (1-20) */
1919 BYTE sum /* Checksum of the corresponding SFN */
1953 BYTE* dst, /* Pointer to the buffer to store numbered SFN */
1954 const BYTE* src, /* Pointer to SFN */
1959 BYTE ns[8], c;
1983 c = (BYTE)((seq % 16) + '0');
2010 static BYTE sum_sfn (
2011 const BYTE* dir /* Pointer to the SFN entry */
2014 BYTE sum = 0;
2033 const BYTE* dir /* Directory entry block to be calculated */
2072 BYTE dat, /* Byte to be calculated (byte-by-byte processing) */
2088 BYTE* dirb, /* Pointer to the direcotry entry block 85+C0+C1s */
2134 … BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory direcotry entry block 85+C0+C1s */
2207 dp->obj.stat = (BYTE)obj->c_size;
2232 BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the direcotry entry block 85+C0+C1s */
2259 BYTE* dirb, /* Pointer to the direcotry entry block buffer */
2264 BYTE nc1, nlen;
2311 BYTE attr, b;
2313 BYTE ord = 0xFF, sum = 0xFF;
2348 b &= (BYTE)~LLEF; ord = b;
2388 BYTE c;
2390 BYTE a, ord, sum;
2397 BYTE nc;
2433 c &= (BYTE)~LLEF; ord = c; /* LFN start order */
2471 BYTE sn[12], sum;
2532 put_lfn(fs->lfnbuf, dp->dir, (BYTE)nent, sum);
2622 BYTE lcf;
2665 … if (dbc_1st((BYTE)wc) && si != 8 && si != 11 && dbc_2nd(dp->dir[si])) { /* Make a DBC if needed */
2734 chr = (BYTE)*(*ptr)++; /* Get a byte */
2742 if (dbc_1st((BYTE)chr)) { /* Get DBC 2nd byte if needed */
2743 chr = dbc_2nd((BYTE)**ptr) ? chr << 8 | (BYTE)*(*ptr)++ : 0;
2805 BYTE b, cf;
2895 dp->fn[i++] = (BYTE)(wc >> 8); /* Put 1st byte */
2908 dp->fn[i++] = (BYTE)wc;
2926 BYTE c, d, *sfn;
2937 c = (BYTE)p[si++];
2948 c = (BYTE)p[si++]; /* Get a byte */
2969 d = (BYTE)p[si++]; /* Get 2nd byte */
3002 BYTE ns;
3083 static BYTE check_fs ( /* 0:FAT, 1:exFAT, 2:Valid BS but not FAT, 3:Not a BS, 4:Disk error */
3112 BYTE mode /* !=0: Check write protection for write access */
3115 BYTE fmt, *pt;
3126 mode &= (BYTE)~FA_READ; /* Desired access mode, write access or not */
3423 BYTE mode /* Access mode and file open mode flags */
3621 BYTE *rbuff = (BYTE*)buff;
3680 fp->flag &= (BYTE)~FA_DIRTY;
3720 const BYTE *wbuff = (const BYTE*)buff;
3764 fp->flag &= (BYTE)~FA_DIRTY;
3785 fp->flag &= (BYTE)~FA_DIRTY;
3837 BYTE *dir;
3846 fp->flag &= (BYTE)~FA_DIRTY;
3875 fp->flag &= (BYTE)~FA_MODIFIED;
3893 fp->flag &= (BYTE)~FA_MODIFIED;
3999 CurrVol = (BYTE)i;
4171 fp->flag &= (BYTE)~FA_DIRTY;
4251 fp->flag &= (BYTE)~FA_DIRTY;
4522 BYTE bm;
4610 fp->flag &= (BYTE)~FA_DIRTY;
4813 BYTE buf[FF_FS_EXFAT ? SZDIRE * 2 : SZDIRE], *dir;
4832 BYTE nf, nn;
4917 BYTE attr, /* Attribute bits */
4918 BYTE mask /* Attribute mask to change */
4936 …fs->dirbuf[XDIR_Attr] = (attr & mask) | (fs->dirbuf[XDIR_Attr] & (BYTE)~mask); /* Apply attribute…
4941 …dj.dir[DIR_Attr] = (attr & mask) | (dj.dir[DIR_Attr] & (BYTE)~mask); /* Apply attribute change …
5052 … if (dbc_1st((BYTE)wc) && si < 11) wc = wc << 8 | dj.dir[si++]; /* Is it a DBC? */
5109 BYTE dirvn[22];
5149 wc = (BYTE)*label++;
5150 if (dbc_1st((BYTE)wc)) wc = dbc_2nd((BYTE)*label) ? wc << 8 | (BYTE)*label++ : 0;
5161 if (wc >= 0x100) dirvn[di++] = (BYTE)(wc >> 8);
5162 dirvn[di++] = (BYTE)wc;
5175 dj.dir[XDIR_NumLabel] = (BYTE)di; /* Change the volume label */
5195 dj.dir[XDIR_NumLabel] = (BYTE)di;
5225 BYTE opt /* Operation mode 0:Find and prepare or 1:Find and allocate */
5314 UINT (*func)(const BYTE*,UINT), /* Pointer to the streaming function */ argument
5324 BYTE *dbuf;
5358 fp->flag &= (BYTE)~FA_DIRTY;
5385 BYTE opt, /* Format option */
5395 BYTE fmt, sys, *buf, *pte, part; void *pdrv;
5434 buf = (BYTE*)work; /* Working buffer */
5480 BYTE b;
5530 sum = xsum32(buf[i + 0] = (BYTE)ch, sum); /* Put it into the write buffer */
5531 sum = xsum32(buf[i + 1] = (BYTE)(ch >> 8), sum);
5718 buf[BPB_SecPerClus] = (BYTE)pau; /* Cluster size [sector] */
5720 buf[BPB_NumFATs] = (BYTE)n_fats; /* Number of FATs */
5825 pte[PTE_EdSec] = (BYTE)(((n >> 2) & 0xC0) | 63); /* End sector */
5826 pte[PTE_EdCyl] = (BYTE)n; /* End cylinder */
5852 BYTE s_hd, e_hd, *p, *buf = (BYTE*)work;
5863 buf = (BYTE*)work;
5872 e_hd = (BYTE)(n - 1);
5895 p[2] = (BYTE)(((b_cyl >> 2) & 0xC0) | 1); /* Start sector */
5896 p[3] = (BYTE)b_cyl; /* Start cylinder */
5899 p[6] = (BYTE)(((e_cyl >> 2) & 0xC0) | 63); /* End sector */
5900 p[7] = (BYTE)e_cyl; /* End cylinder */
5929 …static const BYTE* const tables[] = {Ct437, Ct720, Ct737, Ct771, Ct775, Ct850, Ct852, Ct857, Ct860…