mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-30 22:50:39 +00:00
46 lines
819 B
C
46 lines
819 B
C
|
#include <Files.h>
|
||
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
|
||
|
void gv(StringPtr name)
|
||
|
{
|
||
|
OSErr err;
|
||
|
short vRefNum;
|
||
|
err = GetVol(name, &vRefNum);
|
||
|
|
||
|
if (err) fprintf(stdout, "GetVol(%s): Error = %d\n", name ? name + 1 : (StringPtr)"", err);
|
||
|
else fprintf(stdout, "GetVol(%s): vRefNum = %d\n", name ? name + 1 : (StringPtr)"", vRefNum);
|
||
|
}
|
||
|
|
||
|
|
||
|
void hgv(StringPtr name)
|
||
|
{
|
||
|
OSErr err;
|
||
|
short vRefNum;
|
||
|
long dirID;
|
||
|
|
||
|
err = HGetVol(name, &vRefNum, &dirID);
|
||
|
|
||
|
if (err) fprintf(stdout, "HGetVol(%s): Error = %d\n", name ? name + 1 : (StringPtr)"", err);
|
||
|
else fprintf(stdout, "HGetVol(%s): vRefNum = %d dirID = %d\n",
|
||
|
name ? name + 1 : (StringPtr)"", vRefNum, dirID);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
int main(int argc, char **argv)
|
||
|
{
|
||
|
(void)argc;
|
||
|
(void)argv;
|
||
|
|
||
|
gv(NULL);
|
||
|
gv((StringPtr)"\pMacOS");
|
||
|
|
||
|
|
||
|
hgv(NULL);
|
||
|
hgv((StringPtr)"\pMacOS");
|
||
|
|
||
|
|
||
|
return 0;
|
||
|
}
|