/*
** ppclibemu_install.c
** written by Frank Wille in 2000
**
** compile: vc -o ppclibemu_install vlibm68k:minstart.o ppclibemu_install.c
**          -nostdlib -lamiga
*/

#include <exec/libraries.h>
#include <dos/dosextens.h>
#include <dos/rdargs.h>
#include <proto/exec.h>
#include <proto/dos.h>

struct DosLibrary *DOSBase = NULL;
static char *rev_string = "$VER: ppclibemu_install 1.0 (16.12.00)\r\n";


int main(void)
{
  LONG argv[2];
  struct RDArgs *rda;
  int rc = 10;

  argv[0] = (LONG)"ppc.library";
  argv[1] = 0;
	if (!(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",37)))
		return 20;

	if (rda = ReadArgs("NAME/K,CLOSE/S",argv,NULL)) {
    struct Library *ppcbase;

    if (ppcbase = OpenLibrary((UBYTE *)argv[0],46)) {
      rc = 0;
      if (argv[1])
        CloseLibrary(ppcbase);
    }
    FreeArgs(rda);
  }

  SetIoErr((long)rc);
  CloseLibrary((struct Library *)DOSBase);
  return rc;
}
