C SUBROUTINE TTYINI C COPYRIGHT (C) 1983 GLENN EVERHART C PERMISSION IS GIVEN TO ANYONE TO USE, DISTRIBUTE, OR COPY THIS C PROGRAM FREELY BUT NOT TO SELL IT COMMERICALLY. SUBROUTINE TTYINI C *** VMS V4 FLAVOR *** C PERFORM INITS ON UNIT 5. NORMALLY EITHER DO NOTHING OR C REPLACE WITH SOMETHING THAT WORKS FOR YOUR SYSTEM. TYPICAL C ACTIONS: C SET THE TERMINAL NOT TO WRAP AROUND C ATTACH TERMINAL SO TYPE-AHEAD WORKS C SET UP TERMINAL TO MUNGE AROUND THE ESCAPE SEQUENCES TO ALLOW C SPECIAL FUNCTION AND/OR ARROW KEYS TO WORK. C VMS VERSION ... HIGHLY SYSTEM DEPENDENT... INTEGER*4 TTCHAN,STAT,SYS$ASSIGN,SYS$QIOW INTEGER*2 IOSB(4) LOGICAL*1 AKP(2) INTEGER*4 MODEBF(3),IWRK,IW2 C ** UNCOMMENT IN VMS V4.X INTEGER*4 IW3 INCLUDE '($IODEF)' INCLUDE '($TTDEF)' COMMON /TTCHN/TTCHAN DATA AKP/27,'='/ STAT=SYS$ASSIGN('TT',TTCHAN,,) IW2=IO$_SENSEMODE STAT=SYS$QIOW(,%VAL(TTCHAN),%VAL(IW2),IOSB,,,MODEBF,%VAL(12),,,,) IW2=TTM$_WRAP IWRK=.NOT.(IW2) MODEBF(2)=MODEBF(2).AND.IWRK IW2=TT$M_ESCAPE C ** UNCOMMENT IN VMS V4.X IW3=TTM$_EDITING C COMPLEMENT "EDITING" MASK TO TURN OFF TERMINAL C CMD LINE EDITING CHARS... C IW3=-IW3-1 C NEGATIVE = COMPLEMENT+1 C IN 2'S COMPLEMENT ARITHMETIC. IWRK=IW2 MODEBF(2)=MODEBF(2).OR.IWRK C ** UNCOMMENT FOR VMS V4 MODEBF(2)=MODEBF(2).AND..NOT.IW3 C TURN ON DESIRED CHARACTERISTICS (REALLY NEED THE ESCAPE CHARAC. C BADLY...) IW2=IO$_SETMODE STAT=SYS$QIOW(,%VAL(TTCHAN),%VAL(IW2),IOSB,,,MODEBF,%VAL(12),,,,) C NOW HAVING SET THE TERMINAL UP, GET BACK OUTTA HERE... C FIRST SET AUXILIARY KEYPAD MODE UP ON UNIT 6 THOUGH. WRITE(6,2000)AKP 2000 FORMAT(2A1) RETURN END C C SUBROUTINE GETTTL(LINE) C READ IN A TERMINAL LINE ON VAX... C VMS VERSION. FOR STANDARD VANILLA VERSION COMMENT C OUT ALL BUT THE FORTRAN READ AND UNCOMMENT THAT... SUBROUTINE GETTTL(LINE) LOGICAL*1 LINE(132) C C C ****++++ VMS SPECIFIC BELOW INTEGER*4 TTCHAN,STAT,SYS$ASSIGN,SYS$QIOW INTEGER*2 IOSB(4) INTEGER*4 MODEBF(3),IWRK INTEGER*2 MODPUB,LIMODE COMMON/MODPUB/MODPUB,LIMODE C MODPUB HAS MODE (0 OR 1) USED IN CMD INTERPRETATION C SO WE CAN ZOT OUT MESSAGES HERE IF DESIRED... C GENERALLY DO SO ONLY IF INITIAL CHAR IS / (FOR CMDS) INCLUDE '($IODEF)' INCLUDE '($TTDEF)' COMMON /TTCHN/TTCHAN DO 1 N1=1,132 1 LINE(N1)=0 C NOTE TTCHAN IS SET UP IN TTYINI ABOVE C CHANGE CODE TO READ-VIRTUAL-BLOCK C IWRK=IO$_TTYREADALL IWRK=IO$_READVBLK STAT=SYS$QIOW(,%VAL(TTCHAN),%VAL(IWRK),IOSB,,,LINE,%VAL(132),,,,) C THAT OUGHT TO PULL EVERYTHING IN... C SINCE WE ZERO THE BUFFER INITIALLY, FORGET THE COUNT. IT ONLY C MATTERS IF BUFFER NEEDS TO BE CLEARED PAST IT... C ****++++ VMS SPECIFIC ABOVE C C DUMMY CODE FOR FORTRAN READ... C ********* C **** HERE IS THE SECTION OF CODE YOU NEED FOR NON-VMS-SPECIFIC VERSION C READ(5,1000)LINE C1000 FORMAT(132A1) C ********* C ADD CODE FOR EXTRA CALL FOR NON-VT100 OR NON-VT200 TERMINALS C TO MUNGE NONSTANDARD "ESCAPE" KEYS. CURRENTLY ONLY DO FOR COLORSCAN 10. CALL ESCTRN(LINE) C ESCTRN SHOULD JUST RETURN IF NOTHING WEIRD IS GOING ON... RETURN END