Skip to content

Commit

Permalink
Merge pull request #8 from clehner/master
Browse files Browse the repository at this point in the history
A couple more glue functions
  • Loading branch information
autc04 committed Sep 29, 2014
2 parents 073047e + 6f2812c commit 831cbc3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions libretro/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,35 @@ pascal OSErr Create (ConstStr255Param fileName, short vRefNum, OSType creator,
// save finder info
return PBSetFInfoSync(&pb);
}

pascal OSErr GetWDInfo(short wdRefNum, short *vRefNum, long *dirID,
long *procID)
{
OSErr err;
WDPBRec pb;
memset(&pb, 0, sizeof(pb));
pb.ioVRefNum = wdRefNum;
err = PBGetWDInfo(&pb, false);
*vRefNum = pb.ioWDVRefNum;
*dirID = pb.ioWDDirID;
*procID = pb.ioWDProcID;
return err;
}

pascal OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum)
{
ParamBlockRec pb;
OSErr err;
memset(&pb, 0, sizeof(pb));

pb.ioParam.ioNamePtr = (StringPtr)name;

err = PBOpenSync(&pb);
*drvrRefNum = pb.ioParam.ioRefNum;
return err;
}

pascal OSErr CloseDriver(short refNum)
{
return FSClose(refNum);
}

0 comments on commit 831cbc3

Please sign in to comment.