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);
|
|
|
|
|
2007-03-22 17:02:00 +00:00
|
|
|
*count = *(long*)param.csParam;
|
2005-11-08 02:02:16 +00:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|