--- np2/macosx/fdefine.cpp 2003/11/21 16:01:41 1.5 +++ np2/macosx/fdefine.cpp 2004/01/31 19:45:25 1.9 @@ -8,7 +8,7 @@ void Setfiletype(int ftype, OSType *creator, OSType *fileType) { *creator = 'SMil'; - *fileType = '????'; +// *fileType = '????'; switch(ftype) { // case FTYPE_SMIL: // ¥·¥¹¥Æ¥àͽÌó @@ -82,6 +82,15 @@ static int Getfiletype(FInfo *fndrinfo) case '.HDI': return(FTYPE_HDI); + case '.NHD': + return(FTYPE_NHD); + + case '.HDD': + return(FTYPE_HDD); + + case '.FDI': + return(FTYPE_FDI); + case 'BMP ': return(FTYPE_BMP); } @@ -108,9 +117,18 @@ static int GetFileExt(char* filename) { else if ((!milstr_cmp(p, str_thd))) { ftype = FTYPE_THD; } + else if ((!milstr_cmp(p, str_nhd))) { + ftype = FTYPE_NHD; + } else if ((!milstr_cmp(p, str_hdi))) { ftype = FTYPE_HDI; } + else if ((!milstr_cmp(p, str_hdd))) { + ftype = FTYPE_HDD; + } + else if ((!milstr_cmp(p, str_fdi))) { + ftype = FTYPE_FDI; + } else if ((!milstr_cmp(p, "xdf")) || (!milstr_cmp(p, "dup")) || (!milstr_cmp(p, "hdm"))) { ftype = FTYPE_BETA; } @@ -140,14 +158,14 @@ int file_getftype(char* filename) { FInfo fndrInfo; int ftype; - mkstr255(fname, filename); - FSMakeFSSpec(0, 0, fname, &fss); - if (FSpGetFInfo(&fss, &fndrInfo) != noErr) { - return(FTYPE_NONE); - } - ftype = Getfiletype(&fndrInfo); + ftype = GetFileExt(filename); if (ftype == FTYPE_NONE) { - ftype = GetFileExt(filename); + mkstr255(fname, filename); + FSMakeFSSpec(0, 0, fname, &fss); + if (FSpGetFInfo(&fss, &fndrInfo) != noErr) { + return(FTYPE_NONE); + } + ftype = Getfiletype(&fndrInfo); } return(ftype); }