void __regargs __autoopenfail(char *);

#include <constructor.h>
#include <proto/exec.h>
#include <proto/muimaster.h>

struct Library *MUIMasterBase;
static void *libbase;
extern long __oslibversion;

CBMLIB_CONSTRUCTOR(openmui)
  {
  libbase=MUIMasterBase=(void *)OpenLibrary("muimaster.library",8);
  if(MUIMasterBase == NULL)
    {
    __autoopenfail("muimaster.library");
    return 1;
    }
  return 0;
  }

CBMLIB_DESTRUCTOR(closemui)
  {
  if(libbase)
    {
    CloseLibrary((struct Library *)libbase);
    libbase=MUIMasterBase=NULL;
    }
  }
