mirror of
https://github.com/vivier/EMILE.git
synced 2024-11-14 22:04:43 +00:00
34 lines
618 B
C
34 lines
618 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();
|
||
|
printf("\ndctlref ");
|
||
|
for (i = 0; i < count; i++)
|
||
|
{
|
||
|
if (!currentHandle[i])
|
||
|
continue;
|
||
|
currentPtr = *(currentHandle[i]);
|
||
|
printf("%d \n", currentPtr->dCtlRefNum);
|
||
|
if (currentPtr->dCtlRefNum == refNum)
|
||
|
return currentHandle[i];
|
||
|
}
|
||
|
printf("\n");
|
||
|
return (DCtlHandle)0;
|
||
|
}
|