! ----- VIDEO_TERMINAL.FUN ----- ! ! ----- FUNCTION THAT RETURNS TRUE IF THE TERMINAL IS A ----- ! ----- VT1xx/VT2xx/VT3xx/VT4xx VIDEO TERMINAL ----- ! ! ----- Last Change 07/02/93 by Brian Lomasky ----- ! FUNCTION WORD VIDEO_TERMINAL %INCLUDE "NUSER.INC" %INCLUDE "$DVIDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB" ! ----- SYSTEM SERVICE ERROR CODES AND FUNCTION VALUES ----- EXTERNAL LONG CONSTANT SS$_IVDEVNAM ! INVALID DEVICE NAME EXTERNAL LONG CONSTANT SS$_IVLOGNAM ! INVALID LOGICAL NAME EXTERNAL LONG CONSTANT SS$_NOSUCHDEV ! NO SUCH DEVICE RECORD DVIBUF ! $GETDVIW RECORD VARIANT CASE WORD BUFFER_LENGTH WORD ITEM_CODE LONG BUFFER_ADDRESS LONG RETURN_LENGTH_ADDRESS CASE LONG LIST_TERMINATOR END VARIANT END RECORD DVIBUF DECLARE LONG DEVICE_TYPE ! DEVICE TYPE FROM $GETDVIW DECLARE LONG DEVICE_TYPE_LENGTH ! LENGTH OF DEVICE_TYPE DIM DVIBUF DVIITEM(1%) ! EQUATE $GETDVIW RECORD DECLARE LONG LOCAL_STATUS ! SYSTEM SERVICE STATUS DECLARE STRING TEMP_STRING ! TEMPORARY STRING EXTERNAL LONG FUNCTION & SYS$GETDVIW ! GET DEVICE INFORMATION/WAIT ! ----- STORE DATA FOR $GETDVIW ----- DVIITEM(0%)::BUFFER_LENGTH = 4% DVIITEM(0%)::ITEM_CODE = DVI$_DEVTYPE DVIITEM(0%)::BUFFER_ADDRESS = LOC(DEVICE_TYPE) DVIITEM(0%)::RETURN_LENGTH_ADDRESS = LOC( & DEVICE_TYPE_LENGTH) DVIITEM(1%)::LIST_TERMINATOR = 0% TEMP_STRING = "TT:" ! GET INFO ABOUT OUR TERMINAL LOCAL_STATUS = SYS$GETDVIW(, , TEMP_STRING, DVIITEM() & BY REF, , , , ) SELECT LOCAL_STATUS CASE SS$_NORMAL ! ----- SEE IF VT1xx/VT2xx/VT3xx/VT4xx TERMINAL ----- ! ----- TYPE ----- IF DEVICE_TYPE < 96% OR DEVICE_TYPE > 113% THEN ! ----- RETURN "NON-VTXXX" STATUS ----- VIDEO_TERMINAL = FALSE ELSE ! ----- TERMINAL IS CAPABLE OF HANDLING ----- ! ----- THE VT1XX/VT2XX/VT3XX/VT4XX ----- ! ----- ESCAPE SEQUENCES TO CLEAR THE ----- ! ----- SCREEN AND HOME ----- VIDEO_TERMINAL = TRUE END IF CASE ELSE VIDEO_TERMINAL = FALSE ! RETURN "NON-VTXXX" STATUS END SELECT END FUNCTION