program tcs c! PARAMETER TT$M_EIGHTBIT = '00008000'X implicit integer*4 (a - z) character DEF_DEVICE*2 /'TT'/ character DEVICE*4 logical*1 dev_name(16) logical*1 buffer(12) logical*4 param CHARACTER*3 scr_dat (7) /'OUT','VT200','120','DVK','P600','LQ2','RKD'/ INTEGER scr_tabl(7) / 0,0, '00000100'X, '00000101'X, 2, 3, 4/ CHARACTER*3 keybd_dat (3) /'OUT','RUS','LAT'/ INTEGER keybd_tabl(3) /0, 256, 512/ integer NULL /'00000000'X/ character dev*5, scrn*3, keyboard*3 integer*2 ldev, dev_cod logical*1 switchd, switchs, switchk integer*2 iostat(4) external SS$_normal external io$_setmode, io$_sensemode, io$_setchar, dvi$_devnam equivalence (dev_name(1),device) equivalence (buffer(5),param) common /item_list/ 1 ldev, dev_cod, adr_dev, r_dev, 6 empty c Analize intup command c ---------------------- empty = 0 switchd = .false. switchs = .false. switchk = .false. c_status=cli$present('DEVICE') if (c_status) then c_status = cli$get_value('DEVICE',device) switchd = .true. end if c_screen=cli$present('SCREEN') if (c_screen) then c_status = cli$get_value('SCREEN',SCRN) switchs = .true. do i = 1,7 if (scr_dat(i) .eq. scrn) then screen = scr_tabl (i) go to 15 end if end do go to 1000 end if 15 c_key=cli$present('KEYBOARD') if (c_key) then c_status = cli$get_value('KEYBOARD',KEYBOARD) switchk = .true. do i = 1,3 if (keybd_dat(i) .eq. keyboard) then keybd = keybd_tabl (i) go to 25 end if end do go to 1000 end if c Assign a chanal to terminal c ---------------------------- 25 if (.not.switchd) then status = sys$assign (DEF_DEVICE, ichnl, , ) if (.not. status) call lib$stop (%val(status)) else status = sys$assign (device, ichnl, , ) if (.not. status) call lib$stop (%val(status)) end if c Get terminal characterstics c --------------------------- func = %loc(io$_sensemode) status = sys$qiow( , %val(ichnl), %val(func),iostat , , , 1 buffer, %val(12), , , , ) if (.not. status) call lib$stop (%val(status)) C Set Terminal Eightbit - Noeightbit C ---------------------------------- if (scrn.eq.'OUT'.and.keyboard.eq.'OUT') then param = param .and. (.not. tt$m_eightbit) else param = param .or. tt$m_eightbit end if func = %loc(io$_setmode) status = sys$qiow( , %val(ichnl), %val(func),iostat , , , 1 buffer, %val(12), , , , ) if (.not. status) call lib$stop (%val(status)) c Get terminal name if it is default c ------------------------------------ if (.not.switchd) then ldev = 5 dev_cod = %loc(dvi$_devnam) adr_dev = %loc(dev) r_cpu = %loc(rdev) status = sys$getdvi( , %val(ichnl),,ldev, , , ,) if (.not. status) call lib$stop (%val(status)) device(1:4) = dev (2:5) end if c Settind Nedded Characteristics For RS-driver c -------------------------------------------- fanc_normal = %loc(ss$_normal) status = sys$assign ('RS', ichnl1, , ) if (.not. status) call lib$stop (%val(status)) if (status .ne. fanc_normal) call lib$stop (%val(status)) read(device(4:4),'(i)') dev_number func = %loc(io$_setmode) if (c_screen) then status = sys$qiow( , %val(ichnl1), %val(func),iostat , , , 1 dev_name, %val(3),%val(dev_number),%val(1), screen, ) if (.not. status) call lib$stop (%val(status)) if (iostat(1) .ne. fanc_normal) call lib$stop (%val(iostat(1))) end if if (c_key) then status = sys$qiow( , %val(ichnl1), %val(func),iostat , , , 1 dev_name, %val(3),%val(dev_number),%val(0),keybd, ) if (.not. status) call lib$stop (%val(status)) if (iostat(1) .ne. fanc_normal) call lib$stop (%val(iostat(1))) end if if (scrn.eq.'VT2') call lib$do_command ('type sys$system:univ.cha') if (scrn.eq.'OUT'.and.keyboard.eq.'OUT')stop 'RS-driver is disconected' if (.NOT.switchk .and. .NOT.switchs) stop 'Qualifier required' if (.NOT.switchs) stop 'Screen definition is not changed' if (.NOT.switchk) stop 'Keyboard definition is not changed' stop 'RS-driver is connected' 1000 stop 'Error in input' end