Implement GetDCtlEntry()

This commit is contained in:
Laurent Vivier 2007-09-29 21:23:45 +00:00
parent f88c5d72f1
commit de9ecab9bc
2 changed files with 34 additions and 1 deletions

33
libmacos/GetDCtlEntry.c Normal file
View 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;
}

View File

@ -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 \