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

  1. echo ; /*
  2.  
  3. lc -L small3.c
  4. QUIT
  5.   
  6.    The above code will compile and link this source if you EXECUTE small.c
  7.    
  8.    All that is changed in this routine is a definition of the function
  9.    MemCleanup.  This can be done only if you are not in some way implicitly
  10.    allocating memory that needs to be cleaned up by a call to MemCleanup.
  11.    You can tell if you need the routine by looking at your link map for
  12.    references to MEM1.o.  If there are any, you can not stub MemCleanup.        
  13.    */
  14.  
  15. #include "exec/types.h"
  16.  
  17. #include "intuition/intuition.h"
  18. #include "intuition/intuitionbase.h"
  19.  
  20. VOID MemCleanup (){}
  21.  
  22. struct  IntuitionBase *IntuitionBase;
  23.  
  24. static struct IntuiText text = {3,4,JAM1, 0, 0,NULL,"lets get small", NULL};
  25. static struct NewWindow NW = {50,50,200,40,-1,-1,CLOSEWINDOW,
  26.                               WINDOWCLOSE | WINDOWDRAG,
  27.                               NULL,NULL,"small",NULL,NULL,200,40,200,40,
  28.                               WBENCHSCREEN};
  29. static struct Window *W;
  30.  
  31. void _main ()
  32.  
  33. {
  34.    IntuitionBase = (struct IntuitionBase *) 
  35.                    OpenLibrary("intuition.library",0);
  36.  
  37.    if (IntuitionBase == NULL )
  38.       {
  39.       /* the intuition library was not opened so we exit */
  40.       _exit (FALSE);
  41.       }
  42.  
  43.    W = ( struct Window * ) OpenWindow ( &NW );    
  44.  
  45.    if ( W == NULL )
  46.       {
  47.       /* the window wasnt opend */
  48.       _exit (FALSE);
  49.       }
  50.  
  51.    PrintIText ( W->RPort, &text, 5,10 );
  52.  
  53.    Wait ( 1<<W->UserPort->mp_SigBit );
  54.  
  55.    CloseWindow ( W );
  56.  
  57.    CloseLibrary ( IntuitionBase );
  58.  
  59.    _exit(TRUE);
  60.  
  61. }
  62.  
  63.