#include <StdIO.h>
#include <Intuition/IntuitionBase.h>
#include <Intuition/Intuition.h>

struct IntuitionBase
   *OpenLibrary();

struct IntuitionBase
   *IntuitionBase = NULL;

main(Args, Coords)
int
   Args;
char
   *Coords[];
   {
      void
         ShowUsage();

      short int
         X,
         Y;

      if (Args != 3)
         ShowUsage();
      else
         {
            X = atoi(Coords[1] );
            Y = atoi(Coords[2] );

            if ( (X < 0) || (X > 639) || (Y < 0) || (Y > 399) )
               ShowUsage();
            else
               {
                  IntuitionBase = (struct IntuitionBase *)OpenLibrary(       \
                   "intuition.library", LIBRARY_VERSION);

                  if (IntuitionBase != NULL)
                     {
                        IntuitionBase->MouseX = (long int)X;
                        IntuitionBase->MouseY = (long int)Y;

                        ActivateWindow(IntuitionBase->ActiveWindow);

                        CloseLibrary(IntuitionBase);
                     }
                  else
                     {
                        printf("Error openning intuition.library.\n");
                     }
               }

         }
   }

void ShowUsage()
   {
      printf("Proper usage is: MMove X Y.  ");
      printf("Where X is 0 - 639 and Y is 0 - 399.\n");
   }
