/** * パス セパレータを削除 * @param[in,out] lpPathName パス */ void DOSIOCALL file_cutseparator(OEMCHAR* lpPathName) { const int pos = OEMSTRLEN(lpPathName) - 1; if ((pos > 0) && // 2文字以上でー (lpPathName[pos] == '\\') && // ケツが \ でー (!milstr_kanji2nd(lpPathName, pos)) && // 漢字の2バイト目ぢゃなくてー ((pos != 1) || (lpPathName[0] != '\\')) && // '\\' ではなくてー ((pos != 2) || (lpPathName[1] != ':'))) // '?:\' ではなかったら { lpPathName[pos] = '\0'; } }
/** * パス セパレータを追加 * @param[in,out] lpPathName パス * @param[in] cchPathName バッファ長 */ void DOSIOCALL file_setseparator(OEMCHAR* lpPathName, int cchPathName) { const int pos = OEMSTRLEN(lpPathName) - 1; if ((pos < 0) || ((pos == 1) && (lpPathName[1] == ':')) || ((lpPathName[pos] == '\\') && (!milstr_kanji2nd(lpPathName, pos))) || ((pos + 2) >= cchPathName)) { return; } lpPathName[pos + 1] = '\\'; lpPathName[pos + 2] = '\0'; }
void DOSIOCALL file_cutseparator(OEMCHAR *path) { int pos; pos = OEMSTRLEN(path) - 1; if ((pos > 0) && // 2文字以上でー (path[pos] == '\\') && // ケツが \ でー (!milstr_kanji2nd(path, pos)) && // 漢字の2バイト目ぢゃなくてー ((pos != 1) || (path[0] != '\\')) && // '\\' ではなくてー ((pos != 2) || (path[1] != ':'))) { // '?:\' ではなかったら path[pos] = '\0'; } }
void DOSIOCALL file_setseparator(OEMCHAR *path, int maxlen) { int pos; pos = OEMSTRLEN(path) - 1; if ((pos < 0) || ((pos == 1) && (path[1] == ':')) || ((path[pos] == '\\') && (!milstr_kanji2nd(path, pos))) || ((pos + 2) >= maxlen)) { return; } path[++pos] = '\\'; path[++pos] = '\0'; }
void debugsub_status(void) { static int filenum = 0; FILEH fh; OEMCHAR work[512]; const OEMCHAR *p; OEMSPRINTF(work, file_i386reg, filenum); fh = file_create_c(work); if (fh != FILEH_INVALID) { p = debugsub_regs(); file_write(fh, p, OEMSTRLEN(p) * sizeof(OEMCHAR)); OEMSPRINTF(work, str_picstat, pic.pi[0].imr, pic.pi[0].irr, pic.pi[0].isr, pic.pi[1].imr, pic.pi[1].irr, pic.pi[1].isr, mouseif.upd8255.portc, sysport.c); file_write(fh, work, OEMSTRLEN(work) * sizeof(OEMCHAR)); OEMSPRINTF(work, OEMTEXT("CS = %.8x:%.8x") OEMTEXT(CRLITERAL), CPU_STAT_SREGBASE(CPU_CS_INDEX), CPU_STAT_SREGLIMIT(CPU_CS_INDEX)); file_write(fh, work, OEMSTRLEN(work) * sizeof(OEMCHAR)); file_close(fh); } OEMSPRINTF(work, file_i386cs, filenum); debugwriteseg(work, &CPU_STAT_SREG(CPU_CS_INDEX), CPU_EIP & 0xffff0000, 0x10000); OEMSPRINTF(work, file_i386ds, filenum); debugwriteseg(work, &CPU_STAT_SREG(CPU_DS_INDEX), 0, 0x10000); OEMSPRINTF(work, file_i386es, filenum); debugwriteseg(work, &CPU_STAT_SREG(CPU_ES_INDEX), 0, 0x10000); OEMSPRINTF(work, file_i386ss, filenum); debugwriteseg(work, &CPU_STAT_SREG(CPU_SS_INDEX), CPU_ESP & 0xffff0000, 0x10000); filenum++; }
static BOOL checkext(OEMCHAR *path, const OEMCHAR *ext) { const OEMCHAR *p; if (ext == NULL) { return(TRUE); } p = file_getext(path); while(*ext) { if (!file_cmpname(p, ext)) { return(TRUE); } ext += OEMSTRLEN(ext) + 1; } return(FALSE); }