--- np2/generic/hostdrvs.c 2004/01/12 08:01:00 1.5 +++ np2/generic/hostdrvs.c 2004/06/20 02:57:47 1.9 @@ -1,4 +1,7 @@ #include "compiler.h" + +#if defined(SUPPORT_HOSTDRV) + #if defined(OSLANG_EUC) #include "codecnv.h" #endif @@ -8,7 +11,7 @@ #include "hostdrvs.h" -static const HDRVDIR hddroot = {" ", 0, 0, 0x10, {0}, {0}}; +static const HDRVDIR hddroot = {" ", 0, 0, 0, 0x10, {0}, {0}}; static const BYTE dospathchr[] = { 0xfa, 0x23, // '&%$#"! /.-,+*)( @@ -28,7 +31,7 @@ static void rcnvfcb(char *dst, UINT dlen if (c == 0) { break; } -#if defined(OSLANG_SJIS) || defined(OSLANG_EUC) +#if defined(OSLANG_SJIS) || defined(OSLANG_EUC) || defined(OSLANG_UTF8) if ((((c ^ 0x20) - 0xa1) & 0xff) < 0x3c) { if ((!slen) || (src[0] == '\0')) { break; @@ -74,18 +77,23 @@ static void rcnvfcb(char *dst, UINT dlen static BOOL realname2fcb(char *fcbname, FLINFO *fli) { +#if defined(OSLANG_EUC) || defined(OSLANG_UTF8) + char sjis[MAX_PATH]; +#endif char *realname; char *ext; #if defined(OSLANG_EUC) - char sjis[MAX_PATH]; - codecnv_euc2sjis(sjis, sizeof(sjis), fli->path, sizeof(fli->path)); realname = sjis; +#elif defined(OSLANG_UTF8) + oemtext_oem2sjis(sjis, sizeof(sjis), fli->path, sizeof(fli->path)); + realname = sjis; #else realname = fli->path; #endif FillMemory(fcbname, 11, ' '); + // ToDo: SJISに変換済みなのに OEM依存してる ext = file_getext(realname); rcnvfcb(fcbname+0, 8, realname, ext - realname); rcnvfcb(fcbname+8, 3, ext, (UINT)-1); @@ -134,13 +142,14 @@ LISTARRAY hostdrvs_getpathlist(const cha break; } CopyMemory(hdd->di.fcbname, fcbname, 11); + hdd->di.exist = 1; hdd->di.caps = fli.caps; hdd->di.size = fli.size; hdd->di.attr = fli.attr; hdd->di.date = fli.date; hdd->di.time = fli.time; milstr_ncpy(hdd->realname, fli.path, sizeof(hdd->realname)); - TRACEOUT(("%s -> %11s", fli.path, fcbname)); +// TRACEOUT(("%s -> %11s", fli.path, fcbname)); } } while(file_listnext(flh, &fli) == SUCCESS); if (listarray_getitems(ret) == 0) { @@ -334,11 +343,6 @@ BOOL hostdrvs_newrealpath(HDRVPATH *hdp, // ---- -void hostdrvs_fhdlreopen(LISTARRAY fhdl) { - - (void)fhdl; -} - static BOOL fhdlallclose(void *vpItem, void *vpArg) { long fh; @@ -383,3 +387,5 @@ HDRVFILE hostdrvs_fhdlsea(LISTARRAY fhdl return(ret); } +#endif +