2005-11-08 02:02:16 +00:00
|
|
|
/*
|
|
|
|
*
|
2006-09-15 14:55:39 +00:00
|
|
|
* (c) 2004,2005 Laurent Vivier <Laurent@lvivier.info>
|
2005-11-08 02:02:16 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-09-03 17:51:12 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2005-11-08 02:02:16 +00:00
|
|
|
#include <macos/devices.h>
|
|
|
|
#include <macos/serial.h>
|
|
|
|
|
|
|
|
OSErr SerGetBuf(short refNum, long *count)
|
|
|
|
{
|
|
|
|
int res;
|
|
|
|
CntrlParam param;
|
|
|
|
|
|
|
|
param.ioCompletion = 0;
|
|
|
|
param.ioVRefNum = 0;
|
|
|
|
param.ioCRefNum = refNum;
|
|
|
|
param.csCode = kSERDInputCount;
|
|
|
|
|
|
|
|
res = PBStatusSync((ParmBlkPtr)¶m);
|
|
|
|
|
2011-12-16 04:14:24 +00:00
|
|
|
*count = param.csParamLong;
|
2005-11-08 02:02:16 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|