mirror of
https://github.com/vivier/EMILE.git
synced 2024-11-14 22:04:43 +00:00
36 lines
550 B
C
36 lines
550 B
C
/*
|
|
*
|
|
* (c) 2005 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
|
*
|
|
*/
|
|
|
|
#include <string.h>
|
|
|
|
#include <macos/devices.h>
|
|
|
|
/*
|
|
* OpenDriver:
|
|
*
|
|
* http://developer.apple.com/documentation/mac/Devices/Devices-23.html
|
|
*
|
|
*/
|
|
|
|
OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum)
|
|
{
|
|
OSErr err;
|
|
ParamBlockRec param;
|
|
|
|
memset(¶m, 0, sizeof(ParamBlockRec));
|
|
|
|
param.ioNamePtr = (unsigned char*)name;
|
|
param.ioPermssn = fsCurPerm;
|
|
|
|
err = PBOpenSync(¶m);
|
|
if (err != noErr)
|
|
return err;
|
|
|
|
*drvrRefNum = param.ioRefNum;
|
|
|
|
return param.ioResult;
|
|
}
|