diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-07-10 09:47:34 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-07-10 09:47:34 +0000 |
commit | 8299df966a58236b31c0028fd7ce799c4ac6e625 (patch) | |
tree | 09250c8a4c22a4fb109a7b7a0265454b3c4d5bca /src/os_mac.c | |
parent | 325b7a2fb5b970b77f7b9ec28ba15eb794f6edf8 (diff) | |
download | vim-8299df966a58236b31c0028fd7ce799c4ac6e625.zip |
updated for version 7.0007
Diffstat (limited to 'src/os_mac.c')
-rw-r--r-- | src/os_mac.c | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/src/os_mac.c b/src/os_mac.c index d38f12a61..d1eb03d9a 100644 --- a/src/os_mac.c +++ b/src/os_mac.c @@ -1301,27 +1301,27 @@ mch_copy_file_attribute(from, to) char_u *from; char_u *to; { - FSSpec frFSSpec; - FSSpec toFSSpec; - FInfo fndrInfo; - Str255 name; - ResType type; - ResType sink; - Handle resource; - short idxTypes; - short nbTypes; - short idxResources; - short nbResources; - short ID; - short frRFid; - short toRFid; - short attrs_orig; - short attrs_copy; - short temp; + FSSpec frFSSpec; + FSSpec toFSSpec; + FInfo fndrInfo; + Str255 name; + ResType type; + ResType sink; + Handle resource; + short idxTypes; + short nbTypes; + short idxResources; + short nbResources; + short ID; + short frRFid; + short toRFid; + short attrs_orig; + short attrs_copy; + short temp; /* TODO: Handle error */ - (void) GetFSSpecFromPath (from, &frFSSpec); - (void) GetFSSpecFromPath (to , &toFSSpec); + (void)GetFSSpecFromPath(from, &frFSSpec); + (void)GetFSSpecFromPath(to , &toFSSpec); /* Copy resource fork */ temp = 0; @@ -1332,51 +1332,51 @@ mch_copy_file_attribute(from, to) if (frRFid != -1) { FSpCreateResFile(&toFSSpec, 'TEXT', UNKNOWN_CREATOR, 0); - toRFid = FSpOpenResFile (&toFSSpec, fsRdWrPerm); + toRFid = FSpOpenResFile(&toFSSpec, fsRdWrPerm); - UseResFile (frRFid); + UseResFile(frRFid); nbTypes = Count1Types(); for (idxTypes = 1; idxTypes <= nbTypes; idxTypes++) { - Get1IndType (&type, idxTypes); - nbResources = Count1Resources(type); - - for (idxResources = 1; idxResources <= nbResources; idxResources++) - { - attrs_orig = 0; /* in case GetRes fails */ - attrs_copy = 0; /* in case GetRes fails */ - resource = Get1IndResource(type, idxResources); - GetResInfo (resource, &ID, &sink, name); - HLock (resource); - attrs_orig = GetResAttrs (resource); - DetachResource (resource); - - - UseResFile (toRFid); - AddResource (resource, type, ID, name); - attrs_copy = GetResAttrs (resource); - attrs_copy = (attrs_copy & 0x2) | (attrs_orig & 0xFD); - SetResAttrs (resource, attrs_copy); - WriteResource (resource); - UpdateResFile (toRFid); - - temp = GetResAttrs (resource); - - /*SetResAttrs (resource, 0);*/ - HUnlock(resource); - ReleaseResource (resource); - UseResFile (frRFid); + Get1IndType(&type, idxTypes); + nbResources = Count1Resources(type); + + for (idxResources = 1; idxResources <= nbResources; idxResources++) + { + attrs_orig = 0; /* in case GetRes fails */ + attrs_copy = 0; /* in case GetRes fails */ + resource = Get1IndResource(type, idxResources); + GetResInfo(resource, &ID, &sink, name); + HLock(resource); + attrs_orig = GetResAttrs(resource); + DetachResource(resource); + + + UseResFile(toRFid); + AddResource(resource, type, ID, name); + attrs_copy = GetResAttrs(resource); + attrs_copy = (attrs_copy & 0x2) | (attrs_orig & 0xFD); + SetResAttrs(resource, attrs_copy); + WriteResource(resource); + UpdateResFile(toRFid); + + temp = GetResAttrs(resource); + + /*SetResAttrs (resource, 0);*/ + HUnlock(resource); + ReleaseResource(resource); + UseResFile(frRFid); } } - CloseResFile (toRFid); - CloseResFile (frRFid); - } + CloseResFile(toRFid); + CloseResFile(frRFid); + } #endif /* Copy Finder Info */ - (void) FSpGetFInfo (&frFSSpec, &fndrInfo); - (void) FSpSetFInfo (&toFSSpec, &fndrInfo); + (void)FSpGetFInfo(&frFSSpec, &fndrInfo); + (void)FSpSetFInfo(&toFSSpec, &fndrInfo); return (temp == attrs_copy); } @@ -1386,13 +1386,13 @@ mch_has_resource_fork (file) char_u *file; { FSSpec fileFSSpec; - short fileRFid; + short fileRFid; /* TODO: Handle error */ - (void) GetFSSpecFromPath (file, &fileFSSpec); - fileRFid = FSpOpenResFile (&fileFSSpec, fsCurPerm); + (void)GetFSSpecFromPath(file, &fileFSSpec); + fileRFid = FSpOpenResFile(&fileFSSpec, fsCurPerm); if (fileRFid != -1) - CloseResFile (fileRFid); + CloseResFile(fileRFid); return (fileRFid != -1); } |