|
|
| version 1.3, 2004/01/10 17:24:01 | version 1.4, 2004/01/10 17:36:07 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #if defined(OSLANG_EUC) | |
| #include "codecnv.h" | |
| #endif | |
| #include "dosio.h" | #include "dosio.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "hostdrv.h" | #include "hostdrv.h" |
| Line 25 static void rcnvfcb(char *dst, UINT dlen | Line 28 static void rcnvfcb(char *dst, UINT dlen |
| if (c == 0) { | if (c == 0) { |
| break; | break; |
| } | } |
| #if defined(OSLANG_SJIS) || defined(OSLANG_EUC) | |
| if ((((c ^ 0x20) - 0xa1) & 0xff) < 0x3c) { | if ((((c ^ 0x20) - 0xa1) & 0xff) < 0x3c) { |
| if ((!slen) || (src[0] == '\0')) { | if ((!slen) || (src[0] == '\0')) { |
| break; | break; |
| Line 37 static void rcnvfcb(char *dst, UINT dlen | Line 41 static void rcnvfcb(char *dst, UINT dlen |
| dst += 2; | dst += 2; |
| dlen -= 2; | dlen -= 2; |
| } | } |
| else { | else if (((c - 0x20) & 0xff) < 0x60) { |
| if (((c - 'a') & 0xff) < 26) { | if (((c - 'a') & 0xff) < 26) { |
| c -= 0x20; | c -= 0x20; |
| } | } |
| if ((c >= 0x20) && (c < 0x80) && | if (dospathchr[(c >> 3) - (0x20 >> 3)] & (1 << (c & 7))) { |
| (dospathchr[(c >> 3) - (0x20 >> 3)] & (1 << (c & 7)))) { | |
| *dst++ = c; | *dst++ = c; |
| dlen--; | dlen--; |
| } | } |
| } | } |
| else if (((c - 0xa0) & 0xff) < 0x40) { | |
| *dst++ = c; | |
| dlen--; | |
| } | |
| #else | |
| if (((c - 0x20) & 0xff) < 0x60) { | |
| if (((c - 'a') & 0xff) < 26) { | |
| c -= 0x20; | |
| } | |
| if (dospathchr[(c >> 3) - (0x20 >> 3)] & (1 << (c & 7))) { | |
| *dst++ = c; | |
| dlen--; | |
| } | |
| } | |
| else if (c >= 0x80) { | |
| *dst++ = c; | |
| dlen--; | |
| } | |
| #endif | |
| } | } |
| } | } |
| Line 55 static BOOL realname2fcb(char *fcbname, | Line 77 static BOOL realname2fcb(char *fcbname, |
| char *realname; | char *realname; |
| char *ext; | char *ext; |
| #if defined(OSLANG_EUC) | |
| char sjis[MAX_PATH]; | |
| codecnv_euc2sjis(sjis, sizeof(sjis), fli->path, sizeof(fli->path)); | |
| realname = sjis; | |
| #else | |
| realname = fli->path; | realname = fli->path; |
| #endif | |
| FillMemory(fcbname, 11, ' '); | FillMemory(fcbname, 11, ' '); |
| ext = file_getext(realname); | ext = file_getext(realname); |
| rcnvfcb(fcbname+0, 8, realname, ext - realname); | rcnvfcb(fcbname+0, 8, realname, ext - realname); |