[Mac-emacs-devel] mac-to-posix-filename
Brought to you by:
akochoi
From: Immanuel L. <imm...@en...> - 2002-07-29 10:27:00
|
I have changed the posix_to_mac_pathname and mac_to_posix_pathname functions in mac.c to use the CFxxx functions so that they are properly aware of mount points etc. My emacs has been working properly with these for about a week. Immanuel. #ifdef MAC_OSX int posix_to_mac_pathname(const char* ufn, char *mfn, int mfnbuflen) { CFStringRef thePosixPath = CFStringCreateWithCString(NULL, ufn, kCFStringEncodingMacRoman); CFURLRef theURLRef = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, thePosixPath, kCFURLPOSIXPathStyle, false); CFStringRef theMacPath = CFURLCopyFileSystemPath(theURLRef, kCFURLHFSPathStyle); CFStringGetCString(theMacPath, mfn, mfnbuflen, kCFStringEncodingMacRoman); CFRelease(theMacPath); CFRelease(theURLRef); CFRelease(thePosixPath); return true; } mac_to_posix_pathname(const char* mfn, char* ufn, int ufnbuflen) { CFStringRef theMacPath = CFStringCreateWithCString(NULL, mfn, kCFStringEncodingMacRoman); CFURLRef theURLRef = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, theMacPath, kCFURLHFSPathStyle, false); CFStringRef thePosixPath = CFURLCopyFileSystemPath(theURLRef, kCFURLPOSIXPathStyle); CFStringGetCString(thePosixPath, ufn, ufnbuflen, kCFStringEncodingMacRoman); CFRelease(theMacPath); CFRelease(theURLRef); CFRelease(thePosixPath); return true; } #else // old functions *************************************************************************** His endeavours to improve these conditions by innovations in the current methods of teaching are fully described in his writings; these made him unpopular with his brethren in the order and led to his removals to the monastery of Pomposa near Ferrara, Italy. Here the same lot seems to have befallen him. About Guido of Arezzo Immanuel Litzroth Software Development Engineer Enfocus Software Kleindokkaai 3-5 B-9000 Gent Belgium Voice: +32 9 269 23 90 Fax : +32 9 269 16 91 Email: Imm...@en... web : www.enfocus.be *************************************************************************** |