--- np2/macosx/macossub.cpp 2003/10/16 17:59:36 1.1.1.1 +++ np2/macosx/macossub.cpp 2003/11/21 16:01:41 1.4 @@ -20,7 +20,7 @@ UINT32 macos_gettick(void) { UnsignedWide current; Microseconds(¤t); - return((UINT32)(current.lo / 1000)); + return((UINT32)((current.hi * 4294967) + (current.lo / 1000))); } @@ -69,8 +69,10 @@ static void char2str(char *dst, int size CFStringRef cfsr; cfsr = CFStringCreateWithCharacters(NULL, uni, unicnt); - CFStringGetCString(cfsr, dst, size, CFStringGetSystemEncoding()); - CFRelease(cfsr); + if (cfsr) { + CFStringGetCString(cfsr, dst, size, CFStringGetSystemEncoding()); + CFRelease(cfsr); + } } void *file_list1st(const char *dir, FLDATA *fl) { @@ -152,6 +154,28 @@ void file_listclose(void *hdl) { } } +bool getLongFileName(char* dst, const char* path) { + FSSpec fss; + Str255 fname; + FSRef fref; + HFSUniStr255 name; + + if (*path == '\0') { + return(false); + } + mkstr255(fname, path); + FSMakeFSSpec(0, 0, fname, &fss); + FSpMakeFSRef(&fss, &fref); + if (FSGetCatalogInfo(&fref, kFSCatInfoNone, NULL, &name, NULL, NULL) != noErr) { + return(false); + } + char2str(dst, 512, name.unicode, name.length); + if (!dst) { + return(false); + } + return(true); +} + #else typedef struct { @@ -246,5 +270,9 @@ void file_listclose(void *hdl) { } } +bool getLongFileName(char* dst, const char* path) { + return(false); +} #endif +