User Tools

Site Tools


cdc:nos2.source:nam5871:ns_hhi

NS$HHI

Table Of Contents

  • [00007] PROC NS$HHI
  • [00009] NS$HHI - HISTORY DISPLAY COMMAND PROCESSOR.
  • [00013] HISTORY DISPLAY COMMAND PROCESSROR.
  • [00038] PROC NS$DBG
  • [00044] PROC MOVEOK
  • [00045] PROC NS$TKD
  • [00046] PROC TSBINFO

Source Code

NS$HHI.txt
  1. *DECK NS$HHI
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT HIS$NS
  5. USETEXT HOC$NS
  6. USETEXT LIN$NS
  7. PROC NS$HHI; # HISTORY DISPLAY COMMAND PROCESSOR #
  8.  
  9. # TITLE NS$HHI - HISTORY DISPLAY COMMAND PROCESSOR. #
  10.  
  11. BEGIN # NS$HHI #
  12. #
  13. ** NS$HHI - HISTORY DISPLAY COMMAND PROCESSROR.
  14. *
  15. * J.C. LEE 1981
  16. *
  17. * THIS ROUTINE PROCESS THE HISTORY COMMAND.
  18. *
  19. * PROC NS$HHI
  20. *
  21. * ENTRY:
  22. * NONE.
  23. *
  24. * EXIT:
  25. * NONE.
  26. *
  27. * METHOD:
  28. * IF COMMAND IS "HISTORY", SEND ONLY THE LAST PAGE OF
  29. * HISTORY BUFFER TEXT LINES TO *KDB*.
  30. * IF COMMAND IS "HISTORY,ALL", SEND THE ENTIRE HISTORY
  31. * BUFFER TEXT LINES TO *KDB*.
  32. *
  33. #
  34.  
  35. $BEGIN
  36. XREF
  37. BEGIN
  38. PROC NS$DBG; # TRACE CALL #
  39. END
  40. $END
  41.  
  42. XREF
  43. BEGIN
  44. PROC MOVEOK; # ALLOW TSB TO MOVE #
  45. PROC NS$TKD; # TRANSFER DISPLAY DATA TO K DISPLAY BUFF #
  46. PROC TSBINFO; # LOCATE TSB #
  47. END
  48.  
  49. DEF HISDSPSIZE # MAX$PW - 1 #; # SIZE OF HISTORY DISPLAY #
  50.  
  51. ITEM DISLC U; # HISTORY DISPLAY LINE COUNT #
  52. ITEM I I; # LOOP VARIABLE #
  53. ITEM HISTFWA U; # FWA OF FIRST LINE OF HISTORY DISPLAY #
  54. ITEM HISTLC U; # HISTORY DISPLAY LINE COUNT #
  55. ITEM HISTWC U; # HISTORY DISPLAY WORD COUNT #
  56. ITEM TSBFWA U; # TSB FWA #
  57. ITEM TSBSIZE U; # TSB SIZE #
  58.  
  59. CONTROL EJECT;
  60.  
  61. $BEGIN
  62. NS$DBG("HHI"); # TRACE CALL #
  63. $END
  64.  
  65. TSBINFO(TSBSIZE,TSBFWA,HISTSBN); # LOCATE HISTORY BUFFER #
  66. P<HIS$BUFFER> = TSBFWA; # FWA OF HISTORY BUFFER #
  67. HISTLC = HIS$LC[0]; # HISTORY BUFFER LINE COUNT #
  68. HISTWC = HIS$WC[0] - HIS$HDRWDL; # HISTORY LINES WORD COUNT #
  69. HISTFWA = P<HIS$BUFFER> + HIS$HDRWDL; # FWA OF FIRST LINE #
  70.  
  71. IF HISTLC GR HISDSPSIZE # LINES EXCEED HISTORY PAGE SIZE #
  72. AND CMD$WORD[PAR$ALL] EQ 0 # NOT HISTORY,ALL COMMAND #
  73. THEN # DISPLAY ONLY THE MOST RECENT 30 LINES IN BUFFER #
  74. BEGIN
  75. IF CMD$WORD[PAR$CMD] EQ 0
  76. THEN # DEFAULT HISTORY DISPLAY IN RESPONSE TO HOP/START #
  77. DISLC = HISDSPSIZE; # HISTORY DISPLAY LINE COUNT #
  78. ELSE # HISTORY COMMAND #
  79. DISLC = HISDSPSIZE - 1;
  80.  
  81. HISTLC = 0; # RESET LINE COUNT #
  82. P<LIN$HEADER> = 0;
  83.  
  84. FOR I=P<HIS$BUFFER>+HISTWC STEP -1 WHILE HISTLC LS DISLC
  85. DO # SCAN HISTORY BUFFER BACKWARD 30 LINES #
  86. BEGIN
  87. IF LIN$ID[I] EQ LIN$IDENT
  88. THEN # A LINE HEADER FOUND #
  89. HISTLC = HISTLC + 1; # INCREMENT LINE COUNT #
  90. END
  91.  
  92. HISTFWA = I + 1; # FWA OF FIRST HISTORY LINE TO DISPLAY #
  93. HISTWC = P<HIS$BUFFER> + HISTWC - I; # DISPLAY WORD COUNT #
  94. END
  95.  
  96. DCW$F$HIS[0] = TRUE; # SET DISPLAY ASSIGNED TO HISTORY DISPLAY #
  97. P<HIS$BUFFER> = HISTFWA; # FWA OF FIRST LINE TO DISPLAY #
  98. NS$TKD(HIS$BUFFER,HISTWC,HISTLC); # SEND DISPLAY TO KDB #
  99. MOVEOK(HISTSBN); # ALLOW HISTORY BUFFER TO MOVE #
  100.  
  101. RETURN;
  102. END # NS$HHI #
  103. TERM
cdc/nos2.source/nam5871/ns_hhi.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator