home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3987 < prev    next >
Encoding:
Internet Message Format  |  1991-09-09  |  14.6 KB

  1. Path: wupost!uunet!europa.asd.contel.com!darwin.sura.net!noc.sura.net!haven.umd.edu!mimsy!nrlvx1.nrl.navy.mil!koffley
  2. From: koffley@nrlvx1.nrl.navy.mil
  3. Newsgroups: alt.sources
  4. Subject: VMS UAF PROFILE part 13 of 18
  5. Message-ID: <1991Sep5.074634.557@nrlvx1.nrl.navy.mil>
  6. Date: 5 Sep 91 11:46:34 GMT
  7. Organization: NRL SPACE SYSTEMS DIVISION
  8. Lines: 538
  9.  
  10. -+-+-+-+-+-+-+-+ START OF PART 13 -+-+-+-+-+-+-+-+
  11. X`09call SMG$SET_CURSOR_MODE (pasteboard, mask)
  12. X`09call SMG$UNPASTE_VIRTUAL_DISPLAY (disp1, pasteboard)
  13. X
  14. X`09return
  15. X`09end
  16. X
  17. X
  18. X
  19. X
  20. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  21. Vcccc
  22. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  23. Vcccc
  24. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  25. Vcccc
  26. X
  27. X
  28. X`09subroutine SHOW_LASTLOGIN
  29. X
  30. X
  31. X        Include 'uaf.cmn'
  32. X        Include '($smgdef)'
  33. X        Integer*4 line, col, i, j
  34. X        Character*25 string
  35. X
  36. X        bogus_key = .true.
  37. X
  38. XC
  39. XC Reset line and column values.
  40. XC
  41. X        line = 3
  42. X        col = 25
  43. XC
  44. XC Write instructions to the message window
  45. XC
  46. X`09call smg$erase_display (message)
  47. X        call smg$erase_display ( login_board )
  48. X        call smg$put_chars ( login_board, ' Last Interactive Login: ',
  49. X     .   1, 2 ,, smg$m_bold )
  50. X        call smg$put_chars ( login_board, char_last_login_i,
  51. X     .   1, 31 ,, )
  52. X        call smg$put_chars ( login_board, ' Last Non-Interactive Login: ',
  53. X     .   2, 2 ,, smg$m_bold )
  54. X        call smg$put_chars ( login_board, char_last_Login_n,
  55. X     .   2, 31 ,,  )
  56. X
  57. X
  58. X        call smg$put_chars ( message,
  59. X     .   'ControlZ: exit to main display.',
  60. X     .   1, 2 )
  61. X        call smg$put_chars ( message,
  62. X     .   'Show Login Port Info: ',
  63. X     .   2, 2 )
  64. X        call smg$put_chars ( message, ' <PF1> ',
  65. X     .   2, 24 ,, smg$m_bold )
  66. XC
  67. XC Paste virtual displays, end the pasteboard update, and set the cursor
  68. XC to the first position
  69. XC
  70. X        call smg$paste_virtual_display ( login_board, pasteboard, 12,10 )
  71. X        call smg$paste_virtual_display ( message, pasteboard, 22, 1 )
  72. X        call smg$set_cursor_abs ( login_board, line, col )
  73. XC
  74. XC Read a keystroke. Loop until terminator key is hit (ctrlZ).
  75. XC
  76. X        do while (bogus_key)
  77. X           call smg$read_keystroke ( keyboard, term )
  78. XC
  79. XC CtrlW - repaint screen
  80. XC
  81. X           if (term.eq.smg$k_trm_ctrlw) then
  82. X              call smg$repaint_screen ( pasteboard )
  83. X
  84. X           elseif (term.eq.smg$k_trm_pf1) then
  85. X              call smg$unpaste_virtual_display ( login_board, pasteboard )
  86. X`09      call show_ports_menu (pasteboard, main, username,u_len)
  87. X              call smg$repaint_screen ( pasteboard )
  88. X`09      line = 3
  89. X`09      col  = 13
  90. X              call smg$set_cursor_abs ( main, line, col )
  91. X              bogus_key = .false.
  92. XC
  93. XC CtrlZ - exit to main display
  94. XC
  95. X           elseif ((term.eq.smg$k_trm_ctrlz) .or.
  96. X`091          (term .eq. SMG$K_TRM_CR)) then
  97. X              bogus_key = .false.
  98. X
  99. X           endif
  100. X
  101. X        enddo
  102. X
  103. X        call smg$unpaste_virtual_display ( login_board, pasteboard )
  104. X
  105. X        end
  106. X
  107. X
  108. X
  109. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  110. Vcccc
  111. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  112. Vcccc
  113. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  114. Vcccc
  115. X
  116. X
  117. X`09subroutine CENTER_STRING (string, max_buffer_size, status)
  118. X
  119. Xc
  120. Xc`09This subroutine centers a text string for output. It assumes that
  121. Xc`09the input string is 80 characters long or less. The string is
  122. Xc`09centered as though it is to be put into an 80 byte buffer (since
  123. Xc`09most terminals can only handle 80 characters per line). It doesn't
  124. Xc`09hurt if the input string is longer than 80 bytes, however data will
  125. Xc`09be lost due to truncation.
  126. Xc
  127. X
  128. X`09CHARACTER*(*)        string
  129. X`09CHARACTER*1          BLANK  /' '/
  130. X`09CHARACTER*100        TEMP, NULL_STRING
  131. X
  132. X`09INTEGER*4            BEGIN, L, I, J, K, status, max_buffer_size
  133. X
  134. X
  135. X`09status = 0
  136. X
  137. X`09if (max_buffer_size .gt. 100) then
  138. X`09   status = .false.
  139. X`09   return
  140. X`09endif
  141. X
  142. XC
  143. XC---`09Clear out the TEMP string
  144. XC
  145. X`09call REPEAT (null_string , ' ')
  146. X`09TEMP        = NULL_STRING
  147. X
  148. XC
  149. XC---`09Find location of first non-blank character in input string
  150. XC
  151. X`09DO I = 1, max_buffer_size
  152. X`09   IF (string(I:I) .NE. BLANK) GOTO 2
  153. X`09END DO
  154. X
  155. XC
  156. XC---`09If here, then string contains all blanks  ===> return
  157. XC
  158. X`09status = .false.
  159. X`09return
  160. X
  161. X
  162. X2`09LOC = I
  163. X
  164. XC
  165. XC---`09Remove leading blanks (i.e. left justify the string) unless LOC = 1
  166. XC
  167. X
  168. X`09IF (LOC.EQ.1) GOTO 3
  169. X
  170. X`09DO J = LOC-1, 1, -1
  171. X
  172. X`09   DO K = J, max_buffer_size - 1
  173. X`09      string (K:K) = string (K+1:K+1)
  174. X`09   END DO
  175. X
  176. X`09END DO
  177. X
  178. X3`09CONTINUE
  179. X
  180. XC
  181. XC---`09To determine how many meaningful characters string really
  182. XC---`09contains, start from rightmost side and search for first
  183. XC---`09non-blank character. This can be done since the above steps
  184. XC---`09have left-justified the string.
  185. XC
  186. X
  187. X`09DO I = max_buffer_size, 1, -1
  188. X`09   IF (string (I:I) .NE. BLANK) GOTO 4
  189. X`09END DO
  190. X
  191. X4`09CONTINUE
  192. X
  193. XC
  194. XC---`09Now know string has meaningful characters in locations 1:I
  195. XC
  196. X
  197. X`09BEGIN = INT ((float(max_buffer_size) - I) / 2.0) + 1
  198. X
  199. X`09L = 1
  200. X`09DO K = BEGIN, I + BEGIN - 1
  201. X`09   TEMP (K:K) = string (L:L)
  202. X`09   L          = L + 1
  203. X`09END DO
  204. X
  205. XC
  206. XC---`09Set input string equal to nulls
  207. XC
  208. X
  209. X`09string = NULL_STRING
  210. XC
  211. XC---`09Now put centered string into input string
  212. XC
  213. X
  214. X`09string(1:max_buffer_size) = TEMP(1:)
  215. Xd`09write (66,*) string(1:max_buffer_size)
  216. XC
  217. XC---`09Possible upper case to be added here
  218. XC
  219. X
  220. X`09RETURN
  221. X`09END
  222. X
  223. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  224. Vcccc
  225. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  226. Vcccc
  227. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  228. Vcccc
  229. X
  230. X
  231. X`09subroutine SHOW_PORTS_MENU (pasteboard, main, uname, u_len)
  232. X
  233. X
  234. X
  235. X
  236. X`09include              '($FORIOSDEF)'
  237. X`09include              '($SSDEF)'
  238. X`09include              '($LIBDEF)'
  239. X`09include              '($SMGDEF)'
  240. X`09include              'dua2:`5Bkoffley.com`5Duserlog_struc.inc'
  241. X
  242. X`09common / SMG_data /  paste_ID, kybd_ID, num_rows, num_cols, display_ID,
  243. X`091                    mm_id
  244. X
  245. X`09integer*4           qheader (2), status, base_addr, LIB$GET_VM, ordinal,
  246. X`091                   target_Length, paste_ID, kybd_ID, num_rows,`20
  247. X`092                   num_cols, display_ID, mm_id, bitmap_base_addr,
  248. X`093                   pasteboard, cur_row, cur_col, main, mask
  249. X
  250. X`09logical             found
  251. X
  252. X`09record      / link_list /  a
  253. X
  254. X`09data                qheader    /  2*0 /
  255. X
  256. X`09character*(*)        uname
  257. X`09character*20         target_name
  258. X`09character*150        txt, blank
  259. X
  260. X`09character*20         servers (184)
  261. X`09common    / server_info /  servers, bitmap_base_addr
  262. X
  263. X`09integer*4            length, len_trim, ioerror, io_OK, rms_sts, rms_stv,
  264. X`091                    option / 5 /, two / 2 /, one / 1 /,u_Len
  265. X
  266. X`09integer*4    zero, num_bytes, LIB$FREE_VM, bit_num
  267. X
  268. X`09data           zero        / 0   /,
  269. X`091              num_bytes   / 24  /
  270. X
  271. X`09real*4           x, rands
  272. X`09integer*4        randi, lower / 1 /, upper / 181 / ,
  273. X`091                start_seed   / 1055744 /
  274. X
  275. X
  276. X`09x = rands (start_seed)
  277. X
  278. X`09paste_ID = pasteboard
  279. X
  280. X`09istat = LIB$GET_VM (num_bytes, bitmap_base_addr)
  281. X`09if (.not. istat) then
  282. X`09   call LIB$SIGNAL (%val(istat))
  283. X`09endif
  284. X
  285. X`09call zero_page (%val(bitmap_base_addr))
  286. X
  287. X`09call INIT_DISPLAYS
  288. X
  289. X
  290. X`09do while (option .gt. 0)
  291. X
  292. X`09   call SMG$PASTE_VIRTUAL_DISPLAY (mm_ID, paste_ID, 5, 20)
  293. X`09   call READ_MAIN_MENU_OPTION (option)
  294. X`09   call SMG$UNPASTE_VIRTUAL_DISPLAY (mm_id, paste_id)
  295. X
  296. X`09   if (option .eq. 4) then       ! EXIT
  297. X`09      return
  298. X
  299. X`09   elseif (option .eq. 1) then   !  Display full user records
  300. X`09      call SMG$PASTE_VIRTUAL_DISPLAY (display_ID, paste_ID, 8,2)
  301. X`09      target_name = uname(1:u_len)
  302. X`09      call OPEN_AND_READ (target_name, qheader, found)
  303. X`09      if (found) then
  304. X`09         call SHO_QUEUE (qheader)
  305. X`09         call SMG$UNPASTE_VIRTUAL_DISPLAY (display_ID, paste_ID)
  306. X`09      else
  307. Xc`09`09 output meaningful error message
  308. X`09      endif
  309. X
  310. X`09   elseif (option .eq. 2) then   !  Display ports used only
  311. X`09      mask = SMG$M_BOLD + SMG$M_BLINK
  312. X`09      call SMG$PUT_CHARS (main, 'WORKING', 12, 35, ,mask)
  313. X`09      target_name = uname(1:u_len)
  314. X`09      call OPEN_AND_READ (target_name, qheader, found)
  315. X`09      if (found) then
  316. X`09         call SMG$ERASE_CHARS (main, 8, 12, 35)
  317. X`09         call DISPLAY_PORTS_ONLY (qheader)
  318. X`09      else
  319. Xc`09`09 output meaningful error message
  320. X`09      endif
  321. X
  322. X`09   elseif (option .eq. 3) then   !  Display ports used only
  323. X`09      mask = SMG$M_BOLD + SMG$M_BLINK
  324. X`09      call SMG$PUT_CHARS (main, 'WORKING', 12, 35,, mask)
  325. X`09      target_name = uname(1:u_len)
  326. X`09      call OPEN_AND_READ (target_name, qheader, found)
  327. X`09      if (found) then
  328. X`09         call DISPLAY_PORTS_SUMMARY`20
  329. X`09         call SMG$ERASE_CHARS (main, 8, 12, 35)
  330. X`09      else
  331. Xc`09`09 output meaningful error message
  332. X`09      endif
  333. X
  334. X`09   endif
  335. X
  336. X`09enddo
  337. X`09
  338. X
  339. X1000`09end
  340. X
  341. X
  342. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  343. Vcccc
  344. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  345. Vcccc
  346. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  347. Vcccc
  348. X
  349. X
  350. X`09subroutine INSQH (qheader, username, server, time_stamp, mode,
  351. X`091                 master_pid, pid, login_time, uic, terminal)
  352. X
  353. X
  354. X
  355. X
  356. X
  357. X`09integer*4           qheader (2), status, ordinal, num_bytes,
  358. X`091                   new_addr, LIB$GET_VM
  359. X
  360. X`09include              'dua2:`5Bkoffley.com`5Duserlog_struc.inc'
  361. X`09record      / link_list /  qentry
  362. X
  363. X`09data            num_bytes     / 157 /
  364. X
  365. X
  366. X`09status = LIB$GET_VM (num_bytes, new_addr)
  367. X`09if (.not. status) call LIB$SIGNAL (%val(status))
  368. X
  369. X`09if ((qheader(1) .ne. 0) .and. (qheader(2) .ne. 0)) then
  370. X`09   call UPDATE_FORWARD_LINK (%val(qheader(1)), new_addr)
  371. X`09   call UPDATE_BACK_LINK (%val(qheader(2)), new_addr)
  372. X`09   call FILL_NEW_ELEMENT (%val(new_addr), qheader(2), qheader(1),`20
  373. X`091                         username, server, time_stamp, mode,
  374. X`092                         master_pid, pid, login_time, uic, terminal)
  375. X`09   qheader (1) = new_addr`20
  376. X
  377. X`09else
  378. X`09   qheader (1) = new_addr
  379. X`09   qheader (2) = new_addr
  380. X`09   call FILL_NEW_ELEMENT (%val(new_addr), qheader(2), qheader(1),`20
  381. X`091                         username, server, time_stamp, mode,
  382. X`092                         master_pid, pid, login_time, uic, terminal)
  383. X
  384. X`09endif
  385. X
  386. X
  387. X`09return
  388. X`09end
  389. X
  390. X
  391. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  392. Vcccc
  393. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  394. Vcccc
  395. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  396. Vcccc
  397. X
  398. X
  399. X
  400. X
  401. X`09subroutine INSQT (qheader, username, server, time_stamp, mode,
  402. X`091                 master_pid, pid, login_time, uic, terminal)
  403. X
  404. X
  405. X
  406. X`09integer*4           qheader (2), status, ordinal, num_bytes,
  407. X`091                   new_addr, LIB$GET_VM
  408. X
  409. X`09include              'dua2:`5Bkoffley.com`5Duserlog_struc.inc'
  410. X`09record      / link_list /  qentry
  411. X
  412. X`09data            num_bytes     / 157 /
  413. X
  414. X
  415. X`09status = LIB$GET_VM (num_bytes, new_addr)
  416. X`09if (.not. status) call LIB$SIGNAL (%val(status))
  417. X
  418. X`09if ((qheader(1) .ne. 0) .and. (qheader(2) .ne. 0)) then
  419. X`09   call UPDATE_FORWARD_LINK (%val(qheader(1)), new_addr)
  420. X`09   call UPDATE_BACK_LINK (%val(qheader(2)), new_addr)
  421. X`09   call FILL_NEW_ELEMENT (%val(new_addr), qheader(2), qheader(1),`20
  422. X`091                         username, server, time_stamp, mode,
  423. X`092                         master_pid, pid, login_time, uic, terminal)
  424. X`09   qheader (2) = new_addr`20
  425. X
  426. X`09else
  427. X`09   qheader (1) = new_addr
  428. X`09   qheader (2) = new_addr
  429. X`09   call FILL_NEW_ELEMENT (%val(new_addr), qheader(2), qheader(1),`20
  430. X`091                         username, server, time_stamp, mode,
  431. X`092                         master_pid, pid, login_time, uic, terminal)
  432. X
  433. X`09endif
  434. X
  435. X
  436. X`09return
  437. X`09end
  438. X
  439. X
  440. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  441. Vcccc
  442. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  443. Vcccc
  444. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  445. Vcccc
  446. X
  447. X
  448. X
  449. X`09subroutine UPDATE_FORWARD_LINK (qentry, new_addr)
  450. X
  451. X
  452. X`09include              'dua2:`5Bkoffley.com`5Duserlog_struc.inc'
  453. X
  454. X`09record      / link_list /  qentry
  455. X
  456. X
  457. X`09integer*4        new_addr
  458. X
  459. X
  460. X
  461. X`09qentry.forward_link = new_addr
  462. X
  463. X
  464. X
  465. X
  466. X`09return
  467. X`09end
  468. X
  469. X
  470. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  471. Vcccc
  472. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  473. Vcccc
  474. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  475. Vcccc
  476. X
  477. X
  478. X
  479. X
  480. X`09subroutine UPDATE_BACK_LINK (qentry, new_addr)
  481. X
  482. X
  483. X`09include              'dua2:`5Bkoffley.com`5Duserlog_struc.inc'
  484. X
  485. X`09record      / link_list /  qentry
  486. X
  487. X
  488. X`09integer*4        new_addr
  489. X
  490. X
  491. X
  492. X`09qentry.back_link = new_addr
  493. X
  494. X
  495. X
  496. X
  497. X`09return
  498. X`09end
  499. X
  500. X
  501. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  502. Vcccc
  503. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  504. Vcccc
  505. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  506. Vcccc
  507. X
  508. X
  509. X`09subroutine FILL_NEW_ELEMENT (qentry, fl, bl, username, server,
  510. X`091                            time_stamp, mode, master_pid, pid,
  511. X`092                            login_time, uic, terminal)
  512. X
  513. X
  514. X`09include              'dua2:`5Bkoffley.com`5Duserlog_struc.inc'
  515. X
  516. X`09record      / link_list /  qentry
  517. X
  518. X`09integer*4         fl, bl, ord
  519. X
  520. X
  521. X
  522. X`09qentry.forward_link = fl
  523. X`09qentry.back_link    = bl
  524. X`09qentry.username     = username
  525. X`09qentry.server       = server
  526. X`09qentry.time_stamp   = time_stamp
  527. X`09qentry.mode         = mode
  528. X`09qentry.master_PID   = master_pid
  529. X`09qentry.pid          = pid
  530. X`09qentry.login_time   = login_time
  531. X`09qentry.uic          = uic
  532. X`09qentry.terminal     = terminal
  533. X
  534. X`09return
  535. X`09end
  536. X
  537. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  538. Vcccc
  539. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  540. Vcccc
  541. +-+-+-+-+-+-+-+-  END  OF PART 13 +-+-+-+-+-+-+-+-
  542. -- 
  543. \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  544. < Joe Koffley                        KOFFLEY@NRLVAX.NRL.NAVY.MIL             >
  545. < Naval Research Laboratory          KOFFLEY@CCF.NRL.NAVY.MIL                >
  546. < Space Systems Division             AT&T  :  202-767-0894                   >
  547. \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  548.