mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-22 10:29:31 +00:00
31 lines
541 B
C
31 lines
541 B
C
/*
|
|
*
|
|
* (c) 2007 Laurent Vivier <Laurent@lvivier.info>
|
|
*
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <macos/lowmem.h>
|
|
#include <macos/devices.h>
|
|
|
|
DCtlHandle GetDCtlEntry(short refNum)
|
|
{
|
|
DCtlHandle *currentHandle;
|
|
DCtlPtr currentPtr;
|
|
short count;
|
|
int i;
|
|
|
|
count = LMGetUnitTableEntryCount();
|
|
currentHandle = (DCtlEntry ***) LMGetUTableBase();
|
|
for (i = 0; i < count; i++)
|
|
{
|
|
if (!currentHandle[i])
|
|
continue;
|
|
currentPtr = *(currentHandle[i]);
|
|
if (currentPtr->dCtlRefNum == refNum)
|
|
return currentHandle[i];
|
|
}
|
|
return (DCtlHandle)0;
|
|
}
|