|
|
| version 1.2, 2003/11/03 10:19:43 | version 1.4, 2003/11/21 16:01:41 |
|---|---|
| Line 20 UINT32 macos_gettick(void) { | Line 20 UINT32 macos_gettick(void) { |
| UnsignedWide current; | UnsignedWide current; |
| Microseconds(¤t); | Microseconds(¤t); |
| return((UINT32)(current.lo / 1000)); | return((UINT32)((current.hi * 4294967) + (current.lo / 1000))); |
| } | } |
| Line 69 static void char2str(char *dst, int size | Line 69 static void char2str(char *dst, int size |
| CFStringRef cfsr; | CFStringRef cfsr; |
| cfsr = CFStringCreateWithCharacters(NULL, uni, unicnt); | cfsr = CFStringCreateWithCharacters(NULL, uni, unicnt); |
| CFStringGetCString(cfsr, dst, size, CFStringGetSystemEncoding()); | if (cfsr) { |
| CFRelease(cfsr); | CFStringGetCString(cfsr, dst, size, CFStringGetSystemEncoding()); |
| CFRelease(cfsr); | |
| } | |
| } | } |
| void *file_list1st(const char *dir, FLDATA *fl) { | void *file_list1st(const char *dir, FLDATA *fl) { |
| Line 156 bool getLongFileName(char* dst, const ch | Line 158 bool getLongFileName(char* dst, const ch |
| FSSpec fss; | FSSpec fss; |
| Str255 fname; | Str255 fname; |
| FSRef fref; | FSRef fref; |
| char buffer[1024]; | HFSUniStr255 name; |
| char *ret, *val; | |
| if (*path == '\0') { | if (*path == '\0') { |
| return(false); | return(false); |
| } | } |
| mkstr255(fname, path); | mkstr255(fname, path); |
| if (FSMakeFSSpec(0, 0, fname, &fss) != noErr) { | FSMakeFSSpec(0, 0, fname, &fss); |
| return(false); | FSpMakeFSRef(&fss, &fref); |
| } | if (FSGetCatalogInfo(&fref, kFSCatInfoNone, NULL, &name, NULL, NULL) != noErr) { |
| if (FSpMakeFSRef(&fss, &fref) != noErr) { | |
| return(false); | return(false); |
| } | } |
| if (FSRefMakePath(&fref, (UInt8*)buffer, 1024) != noErr) { | char2str(dst, 512, name.unicode, name.length); |
| if (!dst) { | |
| return(false); | return(false); |
| } | } |
| val = buffer; | |
| ret = val; | |
| while(*val != '\0') { | |
| if (*val++ == '/') { | |
| ret = val; | |
| } | |
| } | |
| strcpy(dst, ret); | |
| return(true); | return(true); |
| } | } |