sysVRefNum
SysEnvRec structure
#include <OSUtils.h>
typedef struct SysEnvRec { Size Offset Description
short environsVersion; 2 0 version of this structure
short machineType; 2 2 Macintosh type code, -2...4 (see below)
short systemVersion; 2 4 hiByte= major, lowByte= minor; 0=
pre-4.1
short processor; 2 6 1=68K, 2=68010, 3=68020; 0=newer
Boolean hasFPU; 2 8 TRUE = has MC68881 numeric co processor
Boolean hasColorQD; 2 10 TRUE = supports color Quickdraw functions
short keyboardType; 2 12 Keyboard type code (see below)
short atDrvrVersNum; 2 14 AppleTalk version if open (else, 0)
short sysVRefNum; 2 16 Volume ID (or working dir) of open System
file
} SysEnvRec; 18
typedef SysEnvRec *SysEnvPtr;

Notes: This structure is obtained via a call to SysEnvirons. Its size may
increase in the future and new constants may be returned in any of the
fields. For this reason, your appplication should be prepared to handle
unexpected values if it calls SysEnvirons. This topic discusses the data
returned by version 1 of the structure; ie, when you call SysEnvirons(
1,... ).
Machine Type
The machineType field will hold one of the following:
envXL -2 Mac XL / Lisa
envMac -1 Original Mac with 64K ROMs
envMachUnknown 0 Some Mac newer than Mac II
env512KE 1 Mac 512K Enhanced
envMacPlus 2 Mac Plus
envSE 3 Mac SE
envMacII 4 Mac II
envMacIIx 5 Mac IIx
envMacIIcx 6 Mac IIcx
envSE30 7 Mac SE30
envPor table 8 Mac Por table
envMacIIci 9 Mac IIci
envMacIIfx 11 Mac IIfx
envMacClassic 15 Mac Classic
envMacIIsi 16 Mac IIsi
envMacLC 17 Mac LC
envMacQuadra900 18 Mac Quadra 900
envMacPowerBook170 19 Mac PowerBook 170
envMacQuadra700 20 Mac Quadra 700
envMacClassicII 21 Mac Classic II
envMacPowerBook100 22 Mac PowerBook 100
envMacPowerBook140 23 Mac PowerBook 140
envMacQuadra950 24 Mac Quadra 950
envMacLCII 35 Mac LC II
envMacPowerBook145 52 Mac PowerBook 145
System Version
The systemVersion field is to be interpreted as two 1-byte values. The hi
byte is the major version number; the lo byte is the minor release number.
For instance, 0x0410 is version 4.1 and 0x0604 is version 6.4. Thus, you
can easily find if a system is the same or later than a specified release:
if ( theSysEnv. systemVersion > 0x0600 ) { ... it's 6.0 or later... }
CPU / FPU Type
The processor field will hold one of the following:
envCPUUnknown 0 some CPU newer than 68020
env68000 1 MC68000 processor
env68010 2 MC68010 processor
env68020 3 MC68020 processor
env68030 4 MC68030 processor
env68040 5 MC68040 processor
The hasFPU field will hold one of the following:
FALSE 0 no 68881 available (other FPU may be, though...)
TRUE 1 MC68881 Floating-Point processor available
Keyboard Type
We are advised to attempt to write keyboard-independent programs and
you may (attempt to) do so by using charCodes rather then keyCodes (see
GetNextEvent). Anyway, the keyboardType field will hold one of the
following:
envUnknownKbd 0 Some newer keyboard than listed below
envMacKbd 1 Original Keyboard See Original Mac Keyboard
envMacAndPad 2 Original with separate keypad
envMacPlusKbd 3 Macintosh Plus Keyboard. See Mac Plus Keyboard
envAExtendKbd 4 Apple Extended Keyboard. See Extended Keyboard
envStandADBKbd 5 Standard ADB keyboard. See Mac II Keyboard
envPrtblADBKbd 6 Portable keyboard
envPrtbISOKbd 7 Portable keyboard (ISO)
envStdISOADBKbd 8 Apple Standard Keyboard (ISO)
envExtISOADBKbd 9 Apple Extended Keyboard (ISO)
envADBKbdII 10 Apple Keyboard II
envADBISOKbdII 11 Apple Keyboard II (ISO)
envPwrBkADBKbd 12 PowerBook Keyboard
envPwrBkISOKbd 13 PowerBook Keyboard (ISO)
"Blessed Folder"
The sysVRefNum returns the volume ID or working directory ID of the
directory containing the most recently opened System File. This directory
is a good place to store and find general control and configuration files.
Using SysEnvirons to learn the location of the Blessed Folder is better
than the old method of checking the boot disk.