ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/AmigaOS/extfs_amiga.cpp
(Generate patch)

Comparing BasiliskII/src/AmigaOS/extfs_amiga.cpp (file contents):
Revision 1.9 by cebix, 2000-07-22T16:07:19Z vs.
Revision 1.15 by gbeauche, 2008-01-01T09:40:31Z

# Line 1 | Line 1
1   /*
2   *  extfs_amiga.cpp - MacOS file system for access native file system access, AmigaOS specific stuff
3   *
4 < *  Basilisk II (C) 1997-2000 Christian Bauer
4 > *  Basilisk II (C) 1997-2008 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 19 | Line 19
19   */
20  
21   #include <exec/types.h>
22 + #define __USE_SYSBASE
23   #include <proto/dos.h>
24 + #include <inline/dos.h>
25  
26   #include <sys/types.h>
27   #include <sys/stat.h>
# Line 156 | Line 158 | static const ext2type e2t_translation[]
158          {".z", FOURCC('Z','I','V','M'), FOURCC('L','Z','I','V')},
159          {".gz", FOURCC('G','z','i','p'), FOURCC('G','z','i','p')},
160          {".hqx", FOURCC('T','E','X','T'), FOURCC('S','I','T','x')},
161 +        {".bin", FOURCC('T','E','X','T'), FOURCC('S','I','T','x')},
162          {".pdf", FOURCC('P','D','F',' '), FOURCC('C','A','R','O')},
163          {".ps", FOURCC('T','E','X','T'), FOURCC('t','t','x','t')},
164          {".sit", FOURCC('S','I','T','!'), FOURCC('S','I','T','x')},
# Line 210 | Line 213 | static const ext2type e2t_translation[]
213          {NULL, 0, 0}    // End marker
214   };
215  
216 < void get_finfo(const char *path, uint32 finfo, uint32 fxinfo)
216 > void get_finfo(const char *path, uint32 finfo, uint32 fxinfo, bool is_dir)
217   {
218          // Set default finder info
219          Mac_memset(finfo, 0, SIZEOF_FInfo);
# Line 231 | Line 234 | void get_finfo(const char *path, uint32
234          }
235  
236          // No Finder info file, translate file name extension to MacOS type/creator
237 <        struct stat st;
235 <        if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode)) {
237 >        if (!is_dir) {
238                  int path_len = strlen(path);
239                  for (int i=0; e2t_translation[i].ext; i++) {
240                          int ext_len = strlen(e2t_translation[i].ext);
# Line 247 | Line 249 | void get_finfo(const char *path, uint32
249          }
250   }
251  
252 < void set_finfo(const char *path, uint32 finfo, uint32 fxinfo)
252 > void set_finfo(const char *path, uint32 finfo, uint32 fxinfo, bool is_dir)
253   {
254          // Open Finder info file
255          int fd = open_finf(path, O_RDWR);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines