/* Remove a specified version of arplibrary */ /* This will ALWAYS remove the library, no matter what - USE WITH CARE */ /* SDB */ #include #include #include #include struct ArpBase *ArpBase, *OpenLibrary(); struct EnvironmentBase *EB; extern struct ExecBase *SysBase; main(argc, argv) char **argv; { register int i; register ULONG v; struct ArpBase *FindName(); if (argc <= 1) printf("Usage remlib \n"), exit(100); argv++; v = atoi(*argv); Forbid(); ArpBase = (struct ArpBase *)(&SysBase->LibList); while( ArpBase = FindName(ArpBase, "arp.library")) { if (ArpBase->LibNode.lib_Version == v) break; } if (!ArpBase) printf("Version %ld of arplib not found!\n", v), Permit(),exit(100); /* Make sure you want to do this! */ if (v >= 12) { EB = (struct EnvironmentBase *)ArpBase->EnvBase; *EB->EnvSpace = 0; } while (ArpBase->LibNode.lib_OpenCnt > 1) CloseLibrary(ArpBase); if (ArpBase->LibNode.lib_OpenCnt) RemLibrary(ArpBase), CloseLibrary(ArpBase); else RemLibrary(ArpBase); Permit(); }