Lines Matching refs:BYTE

235 #define ABORT(fs, res)		{ fp->err = (BYTE)(res); LEAVE_FF(fs, res); }
254 #define LD2PD(vol) (BYTE)(vol) /* Each logical drive is associated with the same physical drive num…
469 static BYTE CurrVol; /* Current drive number set by f_chdrive() */
475 static volatile BYTE SysLock; /* System lock flag to protect Files[] (0:no mutex, 1:unlocked, 2:lo…
476 static volatile BYTE SysLockVolume; /* Volume id who is locking Files[] */
490 static const BYTE GUID_MS_Basic[16] = {0xA2,0xA0,0xD0,0xEB,0xE5,0xB9,0x33,0x44,0x87,0xC0,0x68,0xB6,…
518 static const BYTE LfnOfs[] = {1,3,5,7,9,14,16,18,20,22,24,28,30}; /* FAT: Offset of LFN characters …
523 static BYTE DirBuf[MAXDIRB(FF_MAX_LFN)]; /* Directory entry block scratchpad buffer */
533 #define DEF_NAMBUF WCHAR lbuf[FF_MAX_LFN+1]; BYTE dbuf[MAXDIRB(FF_MAX_LFN)]; /* LFN working buffer…
546 …fn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; (fs)->dirbuf = (BYTE*)(lfn+FF_MAX_LFN+1)…
571 static const BYTE* ExCvt; /* Pointer to SBCS up-case table Ct???[] (null:disabled) */
572 static const BYTE* DbcTbl; /* Pointer to DBCS code range table Dc???[] (null:disabled) */
574 static const BYTE Ct437[] = TBL_CT437;
575 static const BYTE Ct720[] = TBL_CT720;
576 static const BYTE Ct737[] = TBL_CT737;
577 static const BYTE Ct771[] = TBL_CT771;
578 static const BYTE Ct775[] = TBL_CT775;
579 static const BYTE Ct850[] = TBL_CT850;
580 static const BYTE Ct852[] = TBL_CT852;
581 static const BYTE Ct855[] = TBL_CT855;
582 static const BYTE Ct857[] = TBL_CT857;
583 static const BYTE Ct860[] = TBL_CT860;
584 static const BYTE Ct861[] = TBL_CT861;
585 static const BYTE Ct862[] = TBL_CT862;
586 static const BYTE Ct863[] = TBL_CT863;
587 static const BYTE Ct864[] = TBL_CT864;
588 static const BYTE Ct865[] = TBL_CT865;
589 static const BYTE Ct866[] = TBL_CT866;
590 static const BYTE Ct869[] = TBL_CT869;
591 static const BYTE Dc932[] = TBL_DC932;
592 static const BYTE Dc936[] = TBL_DC936;
593 static const BYTE Dc949[] = TBL_DC949;
594 static const BYTE Dc950[] = TBL_DC950;
598 static const BYTE ExCvt[] = MKCVTBL(TBL_CT, FF_CODE_PAGE);
602 static const BYTE DbcTbl[] = MKCVTBL(TBL_DC, FF_CODE_PAGE);
620 static WORD ld_word (const BYTE* ptr) /* Load a 2-byte little-endian word */ in ld_word()
629 static DWORD ld_dword (const BYTE* ptr) /* Load a 4-byte little-endian word */ in ld_dword()
641 static QWORD ld_qword (const BYTE* ptr) /* Load an 8-byte little-endian word */ in ld_qword()
658 static void st_word (BYTE* ptr, WORD val) /* Store a 2-byte word in little-endian */ in st_word()
660 *ptr++ = (BYTE)val; val >>= 8; in st_word()
661 *ptr++ = (BYTE)val; in st_word()
664 static void st_dword (BYTE* ptr, DWORD val) /* Store a 4-byte word in little-endian */ in st_dword()
666 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
667 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
668 *ptr++ = (BYTE)val; val >>= 8; in st_dword()
669 *ptr++ = (BYTE)val; in st_dword()
673 static void st_qword (BYTE* ptr, QWORD val) /* Store an 8-byte word in little-endian */ in st_qword()
675 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
676 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
677 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
678 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
679 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
680 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
681 *ptr++ = (BYTE)val; val >>= 8; in st_qword()
682 *ptr++ = (BYTE)val; in st_qword()
694 static int dbc_1st (BYTE c) in dbc_1st()
714 static int dbc_2nd (BYTE c) in dbc_2nd()
756 BYTE tb; in tchar2uni()
759 uc = (BYTE)*p++; /* Get an encoding unit */ in tchar2uni()
771 tb = (BYTE)*p++; in tchar2uni()
785 BYTE sb; in tchar2uni()
788 wc = (BYTE)*p++; /* Get a byte */ in tchar2uni()
789 if (dbc_1st((BYTE)wc)) { /* Is it a DBC 1st byte? */ in tchar2uni()
790 sb = (BYTE)*p++; /* Get 2nd byte */ in tchar2uni()
1135BYTE perc_inuse = (fs->free_clst <= fs->n_fatent - 2) ? (BYTE)((QWORD)(fs->n_fatent - 2 - fs->free… in sync_fs()
1262 BYTE *p; in put_fat()
1273 *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val; /* Update 1st byte */ in put_fat()
1278 …*p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F)); /* Update 2nd byte… in put_fat()
1326 BYTE bm, bv; in find_bitmap()
1367 BYTE bm; in change_bitmap()
1683 BYTE *ibuf; in dir_clear()
1868 const BYTE* dir /* Pointer to the key entry */
1885 BYTE* dir, /* Pointer to the key entry */
1905 BYTE* dir /* Pointer to the LFN entry */
1941 const BYTE* dir /* Pointer to the LFN entry */
1979 BYTE* dir, /* Pointer to the LFN entry to be created */
1980 BYTE ord, /* LFN order (1-20) */
1981 BYTE sum /* Checksum of the corresponding SFN */
2015 BYTE* dst, /* Pointer to the buffer to store numbered SFN */
2016 const BYTE* src, /* Pointer to SFN in directory form */
2021 BYTE ns[8], c;
2045 c = (BYTE)((seq % 16) + '0'); seq /= 16;
2071 static BYTE sum_sfn (
2072 const BYTE* dir /* Pointer to the SFN entry */
2075 BYTE sum = 0;
2094 const BYTE* dir /* Directory entry block to be calculated */
2133 BYTE dat, /* Byte to be calculated (byte-by-byte processing) */
2154 BYTE *dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory directory entry block 85+C0+C1s */
2228 dp->obj.stat = (BYTE)obj->c_size;
2253 BYTE *dirb = dp->obj.fs->dirbuf; /* Pointer to the entry set 85+C0+C1s */
2282 BYTE* dirb, /* Pointer to the directory entry block buffer */
2287 BYTE n_c1, nlen;
2334 BYTE attr, b;
2336 BYTE ord = 0xFF, sum = 0xFF;
2371 b &= (BYTE)~LLEF; ord = b;
2411 BYTE c;
2413 BYTE a, ord, sum;
2420 BYTE nc;
2455 c &= (BYTE)~LLEF;
2495 BYTE sn[12], sum;
2556 put_lfn(fs->lfnbuf, dp->dir, (BYTE)n_ent, sum);
2646 BYTE lcf;
2721 if (dbc_1st((BYTE)wc) && si != 8 && si != 11 && dbc_2nd(dp->dir[si])) { /* Make a DBC if needed */
2797 chr = (BYTE)*(*ptr)++; /* Get a byte */
2805 if (dbc_1st((BYTE)chr)) { /* Get DBC 2nd byte if needed */
2806 chr = dbc_2nd((BYTE)**ptr) ? chr << 8 | (BYTE)*(*ptr)++ : 0;
2875 BYTE b, cf;
2971 dp->fn[i++] = (BYTE)(wc >> 8); /* Put 1st byte */
2984 dp->fn[i++] = (BYTE)wc;
3002 BYTE c, d;
3003 BYTE *sfn;
3014 c = (BYTE)p[si++];
3025 c = (BYTE)p[si++]; /* Get a byte */
3046 d = (BYTE)p[si++]; /* Get 2nd byte */
3079 BYTE ns;
3239 BYTE d /* A byte to be processed */
3242 BYTE b;
3256 const BYTE* gpth /* Pointer to the GPT header */
3281 BYTE *buff, /* Output buffer */
3291 *buff++ = (BYTE)seed;
3313 BYTE b;
3404 BYTE mode /* Desiered access mode to check write protection */
3429 mode &= (BYTE)~FA_READ; /* Desired access mode, write access or not */
3604 fs->fs_type = (BYTE)fmt;/* FAT sub-type (the filesystem object gets valid) */
3675 BYTE opt /* Mount option: 0=Do not mount (delayed mount), 1=Mount immediately */
3703 fs->ldrv = (BYTE)vol; /* Owner volume ID */
3735 BYTE mode /* Access mode and open mode flags */
3942 BYTE *rbuff = (BYTE*)buff;
4000 fp->flag &= (BYTE)~FA_DIRTY;
4041 const BYTE *wbuff = (const BYTE*)buff;
4084 fp->flag &= (BYTE)~FA_DIRTY;
4105 fp->flag &= (BYTE)~FA_DIRTY;
4157 BYTE *dir;
4166 fp->flag &= (BYTE)~FA_DIRTY;
4195 fp->flag &= (BYTE)~FA_MODIFIED;
4213 fp->flag &= (BYTE)~FA_MODIFIED;
4277 CurrVol = (BYTE)vol; /* Set it as current volume */
4336 CurrVol = (BYTE)i;
4513 fp->flag &= (BYTE)~FA_DIRTY;
4593 fp->flag &= (BYTE)~FA_DIRTY;
4870 BYTE bm;
4960 fp->flag &= (BYTE)~FA_DIRTY;
5163 BYTE buf[FF_FS_EXFAT ? SZDIRE * 2 : SZDIRE], *dir;
5183 BYTE nf, nn;
5267 BYTE attr, /* Attribute bits */
5268 BYTE mask /* Attribute mask to change */
5287 …fs->dirbuf[XDIR_Attr] = (attr & mask) | (fs->dirbuf[XDIR_Attr] & (BYTE)~mask); /* Apply attribute …
5292 … dj.dir[DIR_Attr] = (attr & mask) | (dj.dir[DIR_Attr] & (BYTE)~mask); /* Apply attribute change */
5407 if (dbc_1st((BYTE)wc) && si < 11) wc = wc << 8 | dj.dir[si++]; /* Is it a DBC? */
5467 BYTE dirvn[22];
5510 wc = (BYTE)*label++;
5511 if (dbc_1st((BYTE)wc)) wc = dbc_2nd((BYTE)*label) ? wc << 8 | (BYTE)*label++ : 0;
5522 if (wc >= 0x100) dirvn[di++] = (BYTE)(wc >> 8);
5523 dirvn[di++] = (BYTE)wc;
5536 dj.dir[XDIR_NumLabel] = (BYTE)di; /* Change the volume label */
5556 dj.dir[XDIR_NumLabel] = (BYTE)di;
5586 BYTE opt /* Operation mode 0:Find and prepare or 1:Find and allocate */
5681 UINT (*func)(const BYTE*,UINT), /* Pointer to the streaming function */ argument
5692 BYTE *dbuf;
5725 fp->flag &= (BYTE)~FA_DIRTY;
5758 BYTE drv, /* Physical drive number */
5760 BYTE sys, /* System ID for each partition (for only MBR) */
5761 BYTE *buf /* Working buffer for a sector */
5767 BYTE *pte;
5768 BYTE hd, n_hd, sc, n_sc;
5779 …static const BYTE gpt_mbr[16] = {0x00, 0x00, 0x02, 0x00, 0xEE, 0xFE, 0xFF, 0x00, 0x01, 0x00, 0x00,…
5875 hd = (BYTE)(nxt_alloc32 / n_sc % n_hd); /* Partition start CHS head */
5876 sc = (BYTE)(nxt_alloc32 % n_sc + 1); /* Partition start CHS sector */
5878 pte[PTE_StSec] = (BYTE)((cy >> 2 & 0xC0) | sc);
5879 pte[PTE_StCyl] = (BYTE)cy;
5882 hd = (BYTE)((nxt_alloc32 + sz_part32 - 1) / n_sc % n_hd); /* Partition end CHS head */
5883 sc = (BYTE)((nxt_alloc32 + sz_part32 - 1) % n_sc + 1); /* Partition end CHS sector */
5885 pte[PTE_EdSec] = (BYTE)((cy >> 2 & 0xC0) | sc);
5886 pte[PTE_EdCyl] = (BYTE)cy;
5910 BYTE fsopt, fsty, sys, pdrv, ipart;
5911 BYTE *buf;
5912 BYTE *pte;
5958 buf = (BYTE*)work; /* Working buffer */
6096 sum = xsum32(buf[i + 0] = (BYTE)ch, sum); /* Put it into the write buffer */
6097 sum = xsum32(buf[i + 1] = (BYTE)(ch >> 8), sum);
6287 buf[BPB_SecPerClus] = (BYTE)pau; /* Cluster size [sector] */
6289 buf[BPB_NumFATs] = (BYTE)n_fat; /* Number of FATs */
6406 BYTE pdrv, /* Physical drive number */
6411 BYTE *buf = (BYTE*)work;
6453 BYTE s[4];
6473 if (dbc_1st((BYTE)wc)) { /* DBC 1st byte? */
6588 BYTE bs[4];
6591 BYTE buf[SZ_PUTC_BUF]; /* Write buffer */
6632 pb->bs[pb->wi = 0] = (BYTE)c; /* Save 1st byte */
6633 if ((BYTE)c < 0x80) break; /* Single byte code? */
6634 if (((BYTE)c & 0xE0) == 0xC0) pb->ct = 1; /* 2-byte sequence? */
6635 if (((BYTE)c & 0xF0) == 0xE0) pb->ct = 2; /* 3-byte sequence? */
6636 if (((BYTE)c & 0xF8) == 0xF0) pb->ct = 3; /* 4-byte sequence? */
6639 if (((BYTE)c & 0xC0) != 0x80) { /* Broken sequence? */
6642 pb->bs[++pb->wi] = (BYTE)c; /* Save the trailing byte */
6674 pb->buf[i++] = (BYTE)(hs >> 8);
6675 pb->buf[i++] = (BYTE)hs;
6678 pb->buf[i++] = (BYTE)(wc >> 8);
6679 pb->buf[i++] = (BYTE)wc;
6684 pb->buf[i++] = (BYTE)(0xF0 | hs >> 8);
6685 pb->buf[i++] = (BYTE)(0x80 | (hs >> 2 & 0x3F));
6686 pb->buf[i++] = (BYTE)(0x80 | (hs & 3) << 4 | (wc >> 6 & 0x0F));
6687 pb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F));
6690 pb->buf[i++] = (BYTE)wc;
6694 pb->buf[i++] = (BYTE)(0xC0 | wc >> 6);
6697 pb->buf[i++] = (BYTE)(0xE0 | wc >> 12);
6698 pb->buf[i++] = (BYTE)(0x80 | (wc >> 6 & 0x3F));
6700 pb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F));
6708 pb->buf[i++] = (BYTE)(wc >> 8); nc++;
6710 pb->buf[i++] = (BYTE)wc;
6714 pb->buf[i++] = (BYTE)c;
7088 …static const BYTE *const tables[22] = {Ct437, Ct720, Ct737, Ct771, Ct775, Ct850, Ct852, Ct855, Ct8…