home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / comprgs / term232.lha / Source_Code / termSource / SmallMain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-18  |  1.6 KB  |  74 lines

  1. /*
  2. **    $Id: SmallMain.c,v 1.2 92/08/15 20:13:22 olsen Sta Locker: olsen $
  3. **    $Revision: 1.2 $
  4. **    $Date: 92/08/15 20:13:22 $
  5. **
  6. **    Small main program frontend.
  7. **
  8. **    Copyright ⌐ 1990-1992 by Olaf `Olsen' Barthel & MXM
  9. **        All Rights Reserved
  10. */
  11.  
  12. #include <intuition/intuitionbase.h>
  13. #include <workbench/workbench.h>
  14. #include <exec/execbase.h>
  15. #include <dos/dosextens.h>
  16.  
  17. #include <pragmas/intuition.h>
  18. #include <pragmas/exec.h>
  19. #include <pragmas/dos.h>
  20.  
  21. extern struct TextAttr DefaultFont;
  22.  
  23. LONG __saveds
  24. SmallMain()
  25. {
  26.     SysBase = *(struct ExecBase **)4;
  27.  
  28.     if(SysBase -> AttnFlags & AFF_68020)
  29.         main();
  30.     else
  31.     {
  32.         register struct Process *ThisProcess;
  33.  
  34.         ThisProcess = (struct Process *)SysBase -> ThisTask;
  35.  
  36.         if(ThisProcess -> pr_CLI)
  37.         {
  38.             register struct DosLibrary *DOSBase;
  39.  
  40.             if(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",0))
  41.             {
  42.                 Write(ThisProcess -> pr_COS,"MC68020 or higher required.\a\n",29);
  43.  
  44.                 CloseLibrary(DOSBase);
  45.             }
  46.  
  47.             return(RETURN_FAIL);
  48.         }
  49.         else
  50.         {
  51.             register struct IntuitionBase    *IntuitionBase;
  52.             register struct WBStartup    *WBenchMsg;
  53.  
  54.             WaitPort(&ThisProcess -> pr_MsgPort);
  55.  
  56.             WBenchMsg = (struct WBStartup *)GetMsg(&ThisProcess -> pr_MsgPort);
  57.  
  58.             if(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0))
  59.             {
  60.                 STATIC struct IntuiText BodyText =  {0,1,JAM1,5,3,&DefaultFont,(UBYTE *)"MC68020 or higher required.",NULL};
  61.                 STATIC struct IntuiText SorryText = {0,1,JAM1,6,3,&DefaultFont,(UBYTE *)"Sorry",NULL};
  62.  
  63.                 AutoRequest(NULL,&BodyText,NULL,&SorryText,NULL,NULL,253,46);
  64.  
  65.                 CloseLibrary(IntuitionBase);
  66.             }
  67.  
  68.             Forbid();
  69.  
  70.             ReplyMsg((struct Message *)WBenchMsg);
  71.         }
  72.     }
  73. }
  74.