home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-24 | 4.0 KB | 66 lines | [TEXT/MMCC] |
- //------------------------------------------------------------------------------
- // File: minimum system.cp
- // Date: 10/21/94
- // Author: Bretton Wade
- //
- // Description: this file contains the minimum system requirements
- //
- //------------------------------------------------------------------------------
-
- #include "minimum system.h"
-
- //------------------------------------------------------------------------------
- // Handle failure if minimum system is not present
- //------------------------------------------------------------------------------
- static void MinimumSystemError (short errString) // handle minimum system requirements failure
- { // begin
- Str255 str; // place to get the error string
- GetIndString (str, 256, errString); // get the error string
- ParamText (str, 0, 0, 0); // set the error string parameter
- Alert (257, 0); // give the alert about the error
- ResetAlrtStage (); // no more beeps
- ExitToShell (); // quit immediately
- } // end
-
- //------------------------------------------------------------------------------
- // Ensure required features
- //------------------------------------------------------------------------------
- void MinimumSystem (void) // check for minimum system requirements
- { // begin
- short **requirements = (short **) GetResource ('reqd', 128); // get the requirements resource
- long result; // the result for gestalt services
- if ((*requirements)[0]) // if the application requires system 7
- { // begin
- Gestalt (gestaltSystemVersion, &result); // get the system version
- if (result < 0x0700) // require 7.0 or greater
- MinimumSystemError (1); // fail with OS less than v7
- } // end
- if ((*requirements)[1]) // if the application requires the thread manager
- { // begin
- if (Gestalt (gestaltThreadMgrAttr, &result)) // get the thread manager selector
- MinimumSystemError (2); // fail with thread manager not present
- } // end
- if ((*requirements)[2]) // if the application requires quicktime
- { // begin
- if (Gestalt (gestaltQuickTime, &result)) // get the quicktime selector
- MinimumSystemError (3); // fail with Quicktime not present
- } // end
- #ifndef powerc
- if ((*requirements)[3]) // if the application requires a 68020 or greater
- { // begin
- Gestalt (gestaltProcessorType, &result); // get the Processor Type
- if (result < gestalt68020) // require that the system have a 68020 or greater
- MinimumSystemError (4); // fail with 68020 or > not present
- } // end
- if ((*requirements)[4]) // if the application requires an FPU
- { // begin
- Gestalt (gestaltFPUType, &result); // get the FPU Type
- if (result == gestaltNoFPU) // require that the system have an FPU
- MinimumSystemError (5); // fail with FPU not present
- } // end
- #endif
- ReleaseResource (Handle (requirements)); // let go of the requirements data
- } // end
-
- //------------------------------------------------------------------------------
-