EMILE/libmacos/SerGetBuf.c
2007-09-03 17:51:12 +00:00

28 lines
422 B
C

/*
*
* (c) 2004,2005 Laurent Vivier <Laurent@lvivier.info>
*
*/
#include <sys/types.h>
#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)&param);
*count = *(long*)param.csParam;
return res;
}