Lines Matching refs:BYTE

234 #define ABORT(fs, res)		{ fp->err = (BYTE)(res); LEAVE_FF(fs, res); }
253 #define LD2PD(vol) (BYTE)(vol) /* Each logical drive is associated with the same physical drive num…
468 static BYTE CurrVol; /* Current drive */
485 static const BYTE GUID_MS_Basic[16] = {0xA2,0xA0,0xD0,0xEB,0xE5,0xB9,0x33,0x44,0x87,0xC0,0x68,0xB6,…
513 static const BYTE LfnOfs[] = {1,3,5,7,9,14,16,18,20,22,24,28,30}; /* FAT: Offset of LFN characters …
518 static BYTE DirBuf[MAXDIRB(FF_MAX_LFN)]; /* Directory entry block scratchpad buffer */
528 #define DEF_NAMBUF WCHAR lbuf[FF_MAX_LFN+1]; BYTE dbuf[MAXDIRB(FF_MAX_LFN)]; /* LFN working buffer…
541 …fn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; (fs)->dirbuf = (BYTE*)(lfn+FF_MAX_LFN+1)…
566 static const BYTE *ExCvt, *DbcTbl; /* Pointer to current SBCS up-case table and DBCS code range tab…
568 static const BYTE Ct437[] = TBL_CT437;
569 static const BYTE Ct720[] = TBL_CT720;
570 static const BYTE Ct737[] = TBL_CT737;
571 static const BYTE Ct771[] = TBL_CT771;
572 static const BYTE Ct775[] = TBL_CT775;
573 static const BYTE Ct850[] = TBL_CT850;
574 static const BYTE Ct852[] = TBL_CT852;
575 static const BYTE Ct855[] = TBL_CT855;
576 static const BYTE Ct857[] = TBL_CT857;
577 static const BYTE Ct860[] = TBL_CT860;
578 static const BYTE Ct861[] = TBL_CT861;
579 static const BYTE Ct862[] = TBL_CT862;
580 static const BYTE Ct863[] = TBL_CT863;
581 static const BYTE Ct864[] = TBL_CT864;
582 static const BYTE Ct865[] = TBL_CT865;
583 static const BYTE Ct866[] = TBL_CT866;
584 static const BYTE Ct869[] = TBL_CT869;
585 static const BYTE Dc932[] = TBL_DC932;
586 static const BYTE Dc936[] = TBL_DC936;
587 static const BYTE Dc949[] = TBL_DC949;
588 static const BYTE Dc950[] = TBL_DC950;
592 static const BYTE ExCvt[] = MKCVTBL(TBL_CT, FF_CODE_PAGE);
596 static const BYTE DbcTbl[] = MKCVTBL(TBL_DC, FF_CODE_PAGE);
614 static WORD ld_word (const BYTE* ptr) /* Load a 2-byte little-endian word */ in ld_word()
623 static DWORD ld_dword (const BYTE* ptr) /* Load a 4-byte little-endian word */ in ld_dword()
635 static QWORD ld_qword (const BYTE* ptr) /* Load an 8-byte little-endian word */ in ld_qword()
652 static void st_word (BYTE* ptr, WORD val) /* Store a 2-byte word in little-endian */ in st_word()
654 *ptr++ = (BYTE)val; val >>= 8; in st_word()
655 *ptr++ = (BYTE)val; in st_word()
658 static void st_dword (BYTE* ptr, DWORD val) /* Store a 4-byte word in little-endian */ in st_dword()
660 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
661 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
662 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
663 *ptr++ = (BYTE)val; in st_dword()
667 static void st_qword (BYTE* ptr, QWORD val) /* Store an 8-byte word in little-endian */ in st_qword()
669 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
670 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
671 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
672 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
673 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
674 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
675 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
676 *ptr++ = (BYTE)val; in st_qword()
688 static int dbc_1st (BYTE c) in dbc_1st()
708 static int dbc_2nd (BYTE c) in dbc_2nd()
750 BYTE b; in tchar2uni()
753 uc = (BYTE)*p++; /* Get an encoding unit */ in tchar2uni()
765 b = (BYTE)*p++; in tchar2uni()
779 BYTE b; in tchar2uni()
782 wc = (BYTE)*p++; /* Get a byte */ in tchar2uni()
783 if (dbc_1st((BYTE)wc)) { /* Is it a DBC 1st byte? */ in tchar2uni()
784 b = (BYTE)*p++; /* Get 2nd byte */ in tchar2uni()
1216 BYTE *p; in put_fat()
1227 *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val; /* Update 1st byte */ in put_fat()
1232 …*p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F)); /* Update 2nd byte… in put_fat()
1280 BYTE bm, bv; in find_bitmap()
1321 BYTE bm; in change_bitmap()
1634 BYTE *ibuf; in dir_clear()
1819 const BYTE* dir /* Pointer to the key entry */
1836 BYTE* dir, /* Pointer to the key entry */
1856 BYTE* dir /* Pointer to the directory entry containing the part of LFN */
1892 BYTE* dir /* Pointer to the LFN entry */
1930 BYTE* dir, /* Pointer to the LFN entry to be created */
1931 BYTE ord, /* LFN order (1-20) */
1932 BYTE sum /* Checksum of the corresponding SFN */
1966 BYTE* dst, /* Pointer to the buffer to store numbered SFN */
1967 const BYTE* src, /* Pointer to SFN in directory form */
1972 BYTE ns[8], c;
1996 c = (BYTE)((seq % 16) + '0'); seq /= 16;
2022 static BYTE sum_sfn (
2023 const BYTE* dir /* Pointer to the SFN entry */
2026 BYTE sum = 0;
2045 const BYTE* dir /* Directory entry block to be calculated */
2084 BYTE dat, /* Byte to be calculated (byte-by-byte processing) */
2105 BYTE *dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory direcotry entry block 85+C0+C1s */
2178 dp->obj.stat = (BYTE)obj->c_size;
2203 BYTE *dirb = dp->obj.fs->dirbuf; /* Pointer to the direcotry entry block 85+C0+C1s */
2230 BYTE* dirb, /* Pointer to the direcotry entry block buffer */
2235 BYTE nc1, nlen;
2282 BYTE attr, b;
2284 BYTE ord = 0xFF, sum = 0xFF;
2319 b &= (BYTE)~LLEF; ord = b;
2359 BYTE c;
2361 BYTE a, ord, sum;
2368 BYTE nc;
2404 c &= (BYTE)~LLEF; ord = c; /* LFN start order */
2442 BYTE sn[12], sum;
2503 put_lfn(fs->lfnbuf, dp->dir, (BYTE)n_ent, sum);
2593 BYTE lcf;
2662 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;
2807 BYTE b, cf;
2902 dp->fn[i++] = (BYTE)(wc >> 8); /* Put 1st byte */
2915 dp->fn[i++] = (BYTE)wc;
2933 BYTE c, d, *sfn;
2944 c = (BYTE)p[si++];
2955 c = (BYTE)p[si++]; /* Get a byte */
2976 d = (BYTE)p[si++]; /* Get 2nd byte */
3009 BYTE ns;
3172 BYTE d /* A byte to be processed */
3175 BYTE b;
3189 const BYTE* gpth /* Pointer to the GPT header */
3212 BYTE* buff, /* Output buffer */
3222 *buff++ = (BYTE)seed;
3244 BYTE b;
3335 BYTE mode /* !=0: Check write protection for write access */
3360 mode &= (BYTE)~FA_READ; /* Desired access mode, write access or not */
3537 fs->fs_type = (BYTE)fmt;/* FAT sub-type */
3608 BYTE opt /* Mount option: 0=Do not mount (delayed mount), 1=Mount immediately */
3635 if (!ff_cre_syncobj((BYTE)vol, &fs->sobj)) return FR_INT_ERR;
3656 BYTE mode /* Access mode and open mode flags */
3863 BYTE *rbuff = (BYTE*)buff;
3921 fp->flag &= (BYTE)~FA_DIRTY;
3962 const BYTE *wbuff = (const BYTE*)buff;
4005 fp->flag &= (BYTE)~FA_DIRTY;
4026 fp->flag &= (BYTE)~FA_DIRTY;
4078 BYTE *dir;
4087 fp->flag &= (BYTE)~FA_DIRTY;
4116 fp->flag &= (BYTE)~FA_MODIFIED;
4134 fp->flag &= (BYTE)~FA_MODIFIED;
4198 CurrVol = (BYTE)vol; /* Set it as current volume */
4257 CurrVol = (BYTE)i;
4432 fp->flag &= (BYTE)~FA_DIRTY;
4512 fp->flag &= (BYTE)~FA_DIRTY;
4785 BYTE bm;
4875 fp->flag &= (BYTE)~FA_DIRTY;
5078 BYTE buf[FF_FS_EXFAT ? SZDIRE * 2 : SZDIRE], *dir;
5098 BYTE nf, nn;
5182 BYTE attr, /* Attribute bits */
5183 BYTE mask /* Attribute mask to change */
5202 …fs->dirbuf[XDIR_Attr] = (attr & mask) | (fs->dirbuf[XDIR_Attr] & (BYTE)~mask); /* Apply attribute …
5207 … dj.dir[DIR_Attr] = (attr & mask) | (dj.dir[DIR_Attr] & (BYTE)~mask); /* Apply attribute change */
5320 if (dbc_1st((BYTE)wc) && si < 11) wc = wc << 8 | dj.dir[si++]; /* Is it a DBC? */
5378 BYTE dirvn[22];
5418 wc = (BYTE)*label++;
5419 if (dbc_1st((BYTE)wc)) wc = dbc_2nd((BYTE)*label) ? wc << 8 | (BYTE)*label++ : 0;
5430 if (wc >= 0x100) dirvn[di++] = (BYTE)(wc >> 8);
5431 dirvn[di++] = (BYTE)wc;
5444 dj.dir[XDIR_NumLabel] = (BYTE)di; /* Change the volume label */
5464 dj.dir[XDIR_NumLabel] = (BYTE)di;
5494 BYTE opt /* Operation mode 0:Find and prepare or 1:Find and allocate */
5583 UINT (*func)(const BYTE*,UINT), /* Pointer to the streaming function */ argument
5594 BYTE *dbuf;
5627 fp->flag &= (BYTE)~FA_DIRTY;
5660 BYTE drv, /* Physical drive number */
5662 BYTE sys, /* System ID (for only MBR, temp setting) */
5663 BYTE* buf /* Working buffer for a sector */
5669 BYTE *pte;
5670 BYTE hd, n_hd, sc, n_sc;
5681 …static const BYTE gpt_mbr[16] = {0x00, 0x00, 0x02, 0x00, 0xEE, 0xFE, 0xFF, 0x00, 0x01, 0x00, 0x00,…
5777 hd = (BYTE)(nxt_alloc32 / n_sc % n_hd); /* Start head */
5778 sc = (BYTE)(nxt_alloc32 % n_sc + 1); /* Start sector */
5780 pte[PTE_StSec] = (BYTE)((cy >> 2 & 0xC0) | sc);
5781 pte[PTE_StCyl] = (BYTE)cy;
5784 hd = (BYTE)((nxt_alloc32 + sz_part32 - 1) / n_sc % n_hd); /* End head */
5785 sc = (BYTE)((nxt_alloc32 + sz_part32 - 1) % n_sc + 1); /* End sector */
5787 pte[PTE_EdSec] = (BYTE)((cy >> 2 & 0xC0) | sc);
5788 pte[PTE_EdCyl] = (BYTE)cy;
5812 BYTE fsopt, fsty, sys, *buf, *pte, pdrv, ipart;
5855 buf = (BYTE*)work; /* Working buffer */
5993 sum = xsum32(buf[i + 0] = (BYTE)ch, sum); /* Put it into the write buffer */
5994 sum = xsum32(buf[i + 1] = (BYTE)(ch >> 8), sum);
6183 buf[BPB_SecPerClus] = (BYTE)pau; /* Cluster size [sector] */
6185 buf[BPB_NumFATs] = (BYTE)n_fat; /* Number of FATs */
6304 BYTE pdrv, /* Physical drive number */
6309 BYTE *buf = (BYTE*)work;
6346 BYTE s[4];
6366 if (dbc_1st((BYTE)wc)) { /* DBC 1st byte? */
6479 BYTE bs[4];
6482 BYTE buf[SZ_PUTC_BUF]; /* Write buffer */
6523 pb->bs[pb->wi = 0] = (BYTE)c; /* Save 1st byte */
6524 if ((BYTE)c < 0x80) break; /* Single byte? */
6525 if (((BYTE)c & 0xE0) == 0xC0) pb->ct = 1; /* 2-byte sequence? */
6526 if (((BYTE)c & 0xF0) == 0xE0) pb->ct = 2; /* 3-byte sequence? */
6527 if (((BYTE)c & 0xF1) == 0xF0) pb->ct = 3; /* 4-byte sequence? */
6530 if (((BYTE)c & 0xC0) != 0x80) { /* Broken sequence? */
6533 pb->bs[++pb->wi] = (BYTE)c; /* Save the trailing byte */
6565 pb->buf[i++] = (BYTE)(hs >> 8);
6566 pb->buf[i++] = (BYTE)hs;
6569 pb->buf[i++] = (BYTE)(wc >> 8);
6570 pb->buf[i++] = (BYTE)wc;
6575 pb->buf[i++] = (BYTE)(0xF0 | hs >> 8);
6576 pb->buf[i++] = (BYTE)(0x80 | (hs >> 2 & 0x3F));
6577 pb->buf[i++] = (BYTE)(0x80 | (hs & 3) << 4 | (wc >> 6 & 0x0F));
6578 pb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F));
6581 pb->buf[i++] = (BYTE)wc;
6585 pb->buf[i++] = (BYTE)(0xC0 | wc >> 6);
6588 pb->buf[i++] = (BYTE)(0xE0 | wc >> 12);
6589 pb->buf[i++] = (BYTE)(0x80 | (wc >> 6 & 0x3F));
6591 pb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F));
6599 pb->buf[i++] = (BYTE)(wc >> 8); nc++;
6601 pb->buf[i++] = (BYTE)wc;
6605 pb->buf[i++] = (BYTE)c;
6964 …static const BYTE* const tables[22] = {Ct437, Ct720, Ct737, Ct771, Ct775, Ct850, Ct852, Ct855, Ct8…