mirror of
https://github.com/sheumann/AFPBridge.git
synced 2024-06-05 02:29:30 +00:00
Check for presence of AppleShare FST and don't load if it is missing.
We also don't load if the Marinetti tool stub is missing (we can't easily check for the Marinetti init).
This commit is contained in:
parent
3b2f1b6a25
commit
35bcc701d3
30
afpbridge.c
30
afpbridge.c
|
@ -4,10 +4,15 @@
|
|||
#include <locator.h>
|
||||
#include <desk.h>
|
||||
#include <orca.h>
|
||||
#include <gsos.h>
|
||||
#include "installcmds.h"
|
||||
#include "aspinterface.h"
|
||||
#include "asmglue.h"
|
||||
|
||||
extern Word *unloadFlagPtr;
|
||||
|
||||
FSTInfoRecGS fstInfoRec;
|
||||
|
||||
void pollTask(void);
|
||||
|
||||
static struct RunQRec {
|
||||
|
@ -20,7 +25,29 @@ static struct RunQRec {
|
|||
} runQRec;
|
||||
|
||||
|
||||
void setUnloadFlag(void) {
|
||||
if (*unloadFlagPtr == 0)
|
||||
*unloadFlagPtr = 1;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
unsigned int i;
|
||||
|
||||
/*
|
||||
* Check for presence of AppleShare FST. We error out and unload
|
||||
* if it's not present. Our code doesn't directly depend on the
|
||||
* AppleShare FST, but in practice it's not useful without it.
|
||||
* This also ensures lower-level AppleTalk stuff is present.
|
||||
*/
|
||||
fstInfoRec.pCount = 2;
|
||||
fstInfoRec.fileSysID = 0;
|
||||
for (i = 1; fstInfoRec.fileSysID != appleShareFSID; i++) {
|
||||
fstInfoRec.fstNum = i;
|
||||
GetFSTInfoGS(&fstInfoRec);
|
||||
if (toolerror() == paramRangeErr)
|
||||
goto error;
|
||||
}
|
||||
|
||||
LoadOneTool(54, 0x0300); /* load Marinetti 3.0+ */
|
||||
if (toolerror())
|
||||
goto error;
|
||||
|
@ -45,7 +72,10 @@ int main(void) {
|
|||
runQRec.proc = pollTask;
|
||||
AddToRunQ((Pointer)&runQRec);
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
setUnloadFlag();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user