echo ; /*

lc -L small2.c
QUIT
  
   The above code will compile and link this source if you EXECUTE small.c
         
   This version uses _main instead of main as the entry point.  By doing
   this you have stopped yourself from using the standard argc and argv
   arguments passed in through main. Notice also that _exit should be 
   called instead of exit.  If you need to use stdin and stdout for I/O
   ( which we dont here ), you must either use main or open stdin and 
   stdout yourself. */

#include "exec/types.h"

#include "intuition/intuition.h"
#include "intuition/intuitionbase.h"

struct  IntuitionBase *IntuitionBase;

static struct IntuiText text = {3,4,JAM1, 0, 0,NULL,"lets get small", NULL};
static struct NewWindow NW = {50,50,200,40,-1,-1,CLOSEWINDOW,
                              WINDOWCLOSE | WINDOWDRAG,
                              NULL,NULL,"small",NULL,NULL,200,40,200,40,
                              WBENCHSCREEN};
static struct Window *W;

void _main ()

{
   IntuitionBase = (struct IntuitionBase *) 
                   OpenLibrary("intuition.library",0);

   if (IntuitionBase == NULL )
      {
      /* the intuition library was not opened so we exit */
      _exit (FALSE);
      }

   W = ( struct Window * ) OpenWindow ( &NW );    

   if ( W == NULL )
      {
      /* the window wasnt opend */
      _exit (FALSE);
      }

   PrintIText ( W->RPort, &text, 5,10 );

   Wait ( 1<<W->UserPort->mp_SigBit );

   CloseWindow ( W );

   CloseLibrary ( IntuitionBase );

   _exit(TRUE);

}

