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

Comparing BasiliskII/src/extfs.cpp (file contents):
Revision 1.22 by cebix, 2000-07-25T11:13:24Z vs.
Revision 1.26 by cebix, 2001-07-06T17:36:06Z

# Line 1 | Line 1
1   /*
2   *  extfs.cpp - MacOS file system for native file system access
3   *
4 < *  Basilisk II (C) 1997-2000 Christian Bauer
4 > *  Basilisk II (C) 1997-2001 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 107 | Line 107 | static bool ready = false;
107   static struct stat root_stat;
108  
109   // File system ID/media type
110 < const int16 MY_FSID = 0x6261;   // 'ba'
111 < const uint32 MY_MEDIA_TYPE = FOURCC('b','a','s','i');
110 > const int16 MY_FSID = EMULATOR_ID_2;
111 > const uint32 MY_MEDIA_TYPE = EMULATOR_ID_4;
112  
113   // CNID of root and root's parent
114   const uint32 ROOT_ID = 2;
# Line 976 | Line 976 | static int16 fs_volume_mount(uint32 pb)
976          // Init VCB
977          WriteMacInt16(vcb + vcbSigWord, 0x4244);
978   #if defined(__BEOS__) || defined(WIN32)
979 <        WriteMacInt32(vcb + vcbCrDate, root_stat.st_crtime + TIME_OFFSET);
979 >        WriteMacInt32(vcb + vcbCrDate, TimeToMacTime(root_stat.st_crtime));
980   #else
981          WriteMacInt32(vcb + vcbCrDate, 0);
982   #endif
983 <        WriteMacInt32(vcb + vcbLsMod, root_stat.st_mtime + TIME_OFFSET);
983 >        WriteMacInt32(vcb + vcbLsMod, TimeToMacTime(root_stat.st_mtime));
984          WriteMacInt32(vcb + vcbVolBkUp, 0);
985          WriteMacInt16(vcb + vcbNmFls, 1);                       //!!
986          WriteMacInt16(vcb + vcbNmRtDirs, 1);            //!!
# Line 1039 | Line 1039 | static int16 fs_get_vol_info(uint32 pb,
1039          if (ReadMacInt32(pb + ioNamePtr))
1040                  pstrcpy((char *)Mac2HostAddr(ReadMacInt32(pb + ioNamePtr)), VOLUME_NAME);
1041   #if defined(__BEOS__) || defined(WIN32)
1042 <        WriteMacInt32(pb + ioVCrDate, root_stat.st_crtime + TIME_OFFSET);
1042 >        WriteMacInt32(pb + ioVCrDate, TimeToMacTime(root_stat.st_crtime));
1043   #else
1044          WriteMacInt32(pb + ioVCrDate, 0);
1045   #endif
1046 <        WriteMacInt32(pb + ioVLsMod, root_stat.st_mtime + TIME_OFFSET);
1046 >        WriteMacInt32(pb + ioVLsMod, TimeToMacTime(root_stat.st_mtime));
1047          WriteMacInt16(pb + ioVAtrb, 0);
1048          WriteMacInt16(pb + ioVNmFls, 1);                        //!!
1049          WriteMacInt16(pb + ioVBitMap, 0);
# Line 1231 | Line 1231 | read_next_de:
1231          WriteMacInt32(pb + ioDirID, fs_item->id);
1232  
1233   #if defined(__BEOS__) || defined(WIN32)
1234 <        WriteMacInt32(pb + ioFlCrDat, st.st_crtime + TIME_OFFSET);
1234 >        WriteMacInt32(pb + ioFlCrDat, TimeToMacTime(st.st_crtime));
1235   #else
1236          WriteMacInt32(pb + ioFlCrDat, 0);
1237   #endif
1238 <        WriteMacInt32(pb + ioFlMdDat, st.st_mtime + TIME_OFFSET);
1238 >        WriteMacInt32(pb + ioFlMdDat, TimeToMacTime(st.st_mtime));
1239  
1240 <        get_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0);
1240 >        get_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0, false);
1241  
1242          WriteMacInt16(pb + ioFlStBlk, 0);
1243          WriteMacInt32(pb + ioFlLgLen, st.st_size);
# Line 1274 | Line 1274 | static int16 fs_set_file_info(uint32 pb,
1274                  return fnfErr;
1275  
1276          // Set Finder info
1277 <        set_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0);
1277 >        set_finfo(full_path, pb + ioFlFndrInfo, hfs ? pb + ioFlXFndrInfo : 0, false);
1278  
1279          //!! times
1280          return noErr;
# Line 1353 | Line 1353 | read_next_de:
1353          WriteMacInt32(pb + ioDirID, fs_item->id);
1354          WriteMacInt32(pb + ioFlParID, fs_item->parent_id);
1355   #if defined(__BEOS__) || defined(WIN32)
1356 <        WriteMacInt32(pb + ioFlCrDat, st.st_crtime + TIME_OFFSET);
1356 >        WriteMacInt32(pb + ioFlCrDat, TimeToMacTime(st.st_crtime));
1357   #else
1358          WriteMacInt32(pb + ioFlCrDat, 0);
1359   #endif
# Line 1363 | Line 1363 | read_next_de:
1363                  fs_item->mtime = mtime;
1364                  cached = false;
1365          }
1366 <        WriteMacInt32(pb + ioFlMdDat, mtime + TIME_OFFSET);
1366 >        WriteMacInt32(pb + ioFlMdDat, TimeToMacTime(mtime));
1367          WriteMacInt32(pb + ioFlBkDat, 0);
1368  
1369 <        get_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo);
1369 >        get_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo, S_ISDIR(st.st_mode));
1370  
1371          if (S_ISDIR(st.st_mode)) {
1372  
# Line 1422 | Line 1422 | static int16 fs_set_cat_info(uint32 pb)
1422                  return errno2oserr();
1423  
1424          // Set Finder info
1425 <        set_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo);
1425 >        set_finfo(full_path, pb + ioFlFndrInfo, pb + ioFlXFndrInfo, S_ISDIR(st.st_mode));
1426  
1427          //!! times
1428          return noErr;
# Line 1510 | Line 1510 | static int16 fs_open(uint32 pb, uint32 d
1510          WriteMacInt32(fcb + fcbVPtr, vcb);
1511          WriteMacInt32(fcb + fcbClmpSize, CLUMP_SIZE);
1512  
1513 <        get_finfo(full_path, fs_data + fsPB, 0);
1513 >        get_finfo(full_path, fs_data + fsPB, 0, false);
1514          WriteMacInt32(fcb + fcbFType, ReadMacInt32(fs_data + fsPB + fdType));
1515  
1516          WriteMacInt32(fcb + fcbCatPos, fd);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines