mirror of
https://github.com/vivier/EMILE.git
synced 2025-02-24 02:29:04 +00:00
Implement GetDCtlEntry()
This commit is contained in:
parent
f88c5d72f1
commit
de9ecab9bc
33
libmacos/GetDCtlEntry.c
Normal file
33
libmacos/GetDCtlEntry.c
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
*
|
||||
* (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;
|
||||
}
|
@ -10,7 +10,7 @@ CPPFLAGS = -I$(TOP) -DARCH_M68K
|
||||
|
||||
LIBRARY = libmacos.a
|
||||
|
||||
SOURCES = CloseDriver.c OpenDriver.c SerGetBuf.c
|
||||
SOURCES = CloseDriver.c OpenDriver.c SerGetBuf.c GetDCtlEntry.c
|
||||
|
||||
HEADERS = libmacos.h \
|
||||
macos/devices.h macos/errors.h macos/events.h macos/files.h \
|
||||
|
Loading…
x
Reference in New Issue
Block a user