
#include <exec/types.h>
#include <exec/libraries.h>
#include <clib/exec_protos.h>
#include <exec/execbase.h>
#include <stdio.h>
#include <stdlib.h>

extern struct ExecBase *SysBase;

int
main(ac,av)
int ac;
char **av;
{
    struct Library *found;

    if (ac != 2) {
	puts("Use: remlib <library name>");
	return 10;
    }

    Forbid();
    if (found = (struct Library *)FindName(&SysBase->LibList,av[1]))
	RemLibrary(found);
    Permit();
    if (!found)
	return 5;
    puts("OK, hopefully it is gone.");
    return 0;
}
