Remove sync/async definitions. Use sync functions for MacOS.

This commit is contained in:
2021-03-14 05:07:03 +00:00
parent 5c109c184b
commit 80cfc123a1
11 changed files with 20 additions and 23 deletions

View File

@@ -70,7 +70,7 @@ void FileAttributes(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -85,7 +85,7 @@ void FileAttributes(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pATTRS"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
if(rc)
{

View File

@@ -69,7 +69,7 @@ void DeleteFiles(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -84,7 +84,7 @@ void DeleteFiles(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pDELETED"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
if(rc)
{

View File

@@ -69,7 +69,7 @@ void DirectoryDepth(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -84,7 +84,7 @@ void DirectoryDepth(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pDEPTH"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
if(rc)
{
@@ -112,7 +112,7 @@ void DirectoryDepth(const char* path)
dirPB.fileParam.ioNamePtr = str255; // Directory name to create
dirPB.fileParam.ioDirID = dirId; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
pos++;
/* Mac OS has no limit, but it will crash because the catalog is single threaded */

View File

@@ -69,7 +69,7 @@ void Filenames(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -84,7 +84,7 @@ void Filenames(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pFILENAME"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
if(rc)
{

View File

@@ -69,7 +69,7 @@ void MillionFiles(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -84,7 +84,7 @@ void MillionFiles(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pMILLION"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
dirId = dirPB.fileParam.ioDirID;

View File

@@ -73,7 +73,7 @@ void Fragmentation(const char* path, size_t clusterSize)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -88,7 +88,7 @@ void Fragmentation(const char* path, size_t clusterSize)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pFRAGS"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
dirId = dirPB.fileParam.ioDirID;

View File

@@ -113,7 +113,7 @@ void Links(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -128,7 +128,7 @@ void Links(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pLINKS"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
if(rc)
{

View File

@@ -11,9 +11,6 @@ enum
fsRtDirID = 2
};
#define PBHGetVInfo(pb, async) ((async) ? PBHGetVInfoAsync(pb) : PBHGetVInfoSync(pb))
#define PBDirCreate(pb, async) ((async) ? PBDirCreateAsync(pb) : PBDirCreateSync(pb))
#define FOUR_CHAR_CODE(x) (x)
/************** PC-DOS applications and FileTypes **************/

View File

@@ -108,7 +108,7 @@ void ResourceFork(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -123,7 +123,7 @@ void ResourceFork(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pRSRC"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
if(rc)
{

View File

@@ -71,7 +71,7 @@ void Timestamps(const char* path)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");
@@ -86,7 +86,7 @@ void Timestamps(const char* path)
dirPB.fileParam.ioNamePtr = (StringPtr) "\pTIMES"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
rc = PBDirCreateSync(&dirPB);
if(rc)
{

View File

@@ -86,7 +86,7 @@ void GetVolumeInfo(const char* path, size_t* clusterSize)
hpb.ioNamePtr = str255;
hpb.ioVRefNum = 0;
hpb.ioVolIndex = -1;
rc = PBHGetVInfo((HParmBlkPtr)&hpb, 0);
rc = PBHGetVInfoSync((HParmBlkPtr)&hpb);
if(rc)
{
printf("Could not get volume information.\n");