home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 092.lha / Small / small2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-21  |  1.5 KB  |  61 lines

  1. echo ; /*
  2.  
  3. lc -L small2.c
  4. QUIT
  5.   
  6.    The above code will compile and link this source if you EXECUTE small.c
  7.          
  8.    This version uses _main instead of main as the entry point.  By doing
  9.    this you have stopped yourself from using the standard argc and argv
  10.    arguments passed in through main. Notice also that _exit should be 
  11.    called instead of exit.  If you need to use stdin and stdout for I/O
  12.    ( which we dont here ), you must either use main or open stdin and 
  13.    stdout yourself. */
  14.  
  15. #include "exec/types.h"
  16.  
  17. #include "intuition/intuition.h"
  18. #include "intuition/intuitionbase.h"
  19.  
  20. struct  IntuitionBase *IntuitionBase;
  21.  
  22. static struct IntuiText text = {3,4,JAM1, 0, 0,NULL,"lets get small", NULL};
  23. static struct NewWindow NW = {50,50,200,40,-1,-1,CLOSEWINDOW,
  24.                               WINDOWCLOSE | WINDOWDRAG,
  25.                               NULL,NULL,"small",NULL,NULL,200,40,200,40,
  26.                               WBENCHSCREEN};
  27. static struct Window *W;
  28.  
  29. void _main ()
  30.  
  31. {
  32.    IntuitionBase = (struct IntuitionBase *) 
  33.                    OpenLibrary("intuition.library",0);
  34.  
  35.    if (IntuitionBase == NULL )
  36.       {
  37.       /* the intuition library was not opened so we exit */
  38.       _exit (FALSE);
  39.       }
  40.  
  41.    W = ( struct Window * ) OpenWindow ( &NW );    
  42.  
  43.    if ( W == NULL )
  44.       {
  45.       /* the window wasnt opend */
  46.       _exit (FALSE);
  47.       }
  48.  
  49.    PrintIText ( W->RPort, &text, 5,10 );
  50.  
  51.    Wait ( 1<<W->UserPort->mp_SigBit );
  52.  
  53.    CloseWindow ( W );
  54.  
  55.    CloseLibrary ( IntuitionBase );
  56.  
  57.    _exit(TRUE);
  58.  
  59. }
  60.  
  61.