User Tools

Site Tools


cdc:nos2.source:nam5871:nvfophc

NVFOPHC

Table Of Contents

  • [00006] PROC NVFOPHC
  • [00011] PERFORM HISTORY COMMAND.
  • [00040] PROC SSTAQE

Source Code

NVFOPHC.txt
  1. *DECK NVFOPHC
  2. USETEXT TEXTNVF
  3. USETEXT TEXTSS
  4. USETEXT TXCMDNV
  5. USETEXT TXTAPSS
  6. PROC NVFOPHC;
  7. # TITLE NVFOPHC - PROCESS HISTORY COMMAND #
  8.  
  9. BEGIN # NVFOPHC #
  10. #
  11. ** NVFOPHC - PERFORM HISTORY COMMAND.
  12. *
  13. * A. LIM. 82/04/07.
  14. *
  15. * THIS PROCEDURE-S MAIN FUNCTION IS TO PERFORM A HOP HISTORY
  16. * COMMAND. IT IS CALLED INTO EXECUTION BY:
  17. * *NVFODHC* *NVFOAPE*
  18. *
  19. * PROC NVFOPHC
  20. *
  21. * ENTRY HOP HISTORY COMMAND IN *WCBUF[1]*, *HDRCMD[1]*, AND
  22. * *PARMS[0]* WITH *WCBUF* DEFINED IN TEXTSS, AND
  23. * *HDRCMD* AND *PARMS* DEFINED IN TXCMDNV.
  24. *
  25. * EXIT TERMINAL-TEXT LINES SENT TO CONNECTION-TRAFFIC-QUEUE
  26. * *CTQ*.
  27. *
  28. * METHOD IF COMMAND IS "HISTORY,ALL", SEND THE ENTIRE HISTORY
  29. * BUFFER TEXT LINES TO *CTQ*.
  30. * IF COMMAND IS "HISTORY", SEND ONLY THE LAST PAGE OF
  31. * HISTORY BUFFER TO *CTQ*
  32. #
  33.  
  34.  
  35. #
  36. **** PROC NVFOPHC XREF LIST
  37. #
  38. XREF
  39. BEGIN
  40. PROC SSTAQE; # SS- ACCEPT A QUEUE ENTRY #
  41. END
  42. #
  43. ****
  44. #
  45.  
  46.  
  47. ITEM HPTR I; # HISTORY BUF PTR (PER CM WORD) #
  48. ITEM I I; # LOOP INDUCTION VAR #
  49. ITEM J I; # LOOP INDUCTION VAR #
  50. ITEM NLINES I; # LOOP EXIT VAR #
  51.  
  52.  
  53. # BLANKLN - A BLANK LINE. #
  54.  
  55. ARRAY BLANKLN[00:00] S(1);
  56. BEGIN
  57. ITEM BLK$BLANK C(00,00,08) = [" "];
  58. ITEM BLK$ZERO U(00,48,12) = [0];
  59. END
  60.  
  61.  
  62. CONTROL EJECT;
  63.  
  64. WCB$WORD[1] = 0; # CLEAR WC WORD 1 #
  65. ABHWORD[1] = 0; # CLEAR ABH WORD 1 #
  66. ABHABT[1] = HOPTX$; # PRESET ABT TO HOP TEXT #
  67.  
  68. #
  69. * IF HISTORY BUFFER EMPTY, SEND A NULL TEXT WITH INPUT ALLOW FLAG
  70. * SET TO CONNECTION-TRAFFIC-QUEUE, AND QUIT.
  71. #
  72. IF HSBL EQ 0
  73. THEN
  74. BEGIN # HISTORY BUFFER EMPTY, SEND A NULL TEXT TO CTQ #
  75. WCB$WC[1] = 2;
  76. WCB$IAF[1] = TRUE; # SET INPUT-ALLOW-FLAG #
  77. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],MSGBUF[0]);
  78. RETURN; # EXIT #
  79. END
  80.  
  81.  
  82. # DETERMINE IF "HISTORY,ALL" OR "HISTORY" COMMAND #
  83.  
  84. IF HDR$SPCNT[1] GR 2
  85. THEN
  86. BEGIN # "HISTORY,ALL", SEND HEADERS #
  87. WCB$WC[1] = SSBUILD$ + 2; # SEND NVF BUILD MSG #
  88. SBD$ANAME[0] = "NVF ";
  89. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],SBUILD[0]);
  90. WCB$WORD[1] = 0; # CLEAR WC WORD 1 #
  91. WCB$WC[1] = LCFVRN$ + 2; # SEND LCF VERSION MSG #
  92. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],LCFVRN[0]);
  93. WCB$WORD[1] = 0;
  94. WCB$WC[1] = 3; # SEND A BLANK LINE #
  95. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],BLANKLN[0]);
  96. HPTR = 0; # SET HIS-BUF PTR TO BEGINNING OF BUF #
  97. END
  98. ELSE
  99. BEGIN # "HISTORY" #
  100. IF HSBCNT LQ LEFTPL
  101. THEN
  102. HPTR = 0; # H-BUF CONTAINS ONLY 1 PAGE OR LESS LINES#
  103. ELSE
  104. BEGIN # MORE THAN 1 PAGE #
  105. NLINES = 0;
  106. FOR HPTR = HSBL-1 STEP -1 WHILE (NLINES LQ LEFTPL)
  107. DO
  108. BEGIN # SKIP BACKWARD LEFTPL LINES #
  109. IF HSB$ZERO[HPTR] EQ 0
  110. THEN
  111. NLINES = NLINES + 1; # END OF A LINE #
  112. END
  113. HPTR = HPTR + 2; # ADJUST HPTR #
  114. END
  115. END
  116.  
  117. J = 0;
  118. WCB$WORD[1] = 0;
  119. FOR I = HPTR STEP 1 WHILE I LS HSBL
  120. DO
  121. BEGIN # PROCESS ALL LINES IN H-BUF #
  122. MSG$WORD[J] = HSB$WORD[I]; # MOVE 1 WORD FR H-BUF TO M-BUF #
  123. J = J + 1; # INCREMENT INDEX #
  124. WCB$WC[1] = WCB$WC[1] + 1; # INCREMENT WC COUNT #
  125. IF HSB$ZERO[I] EQ 0
  126. THEN
  127. BEGIN # END OF LINE #
  128. IF I EQ HSBL - 1
  129. THEN
  130. BEGIN # LAST LINE #
  131. WCB$IAF[1] = TRUE; # SET IAF TRUE #
  132. END
  133. WCB$WC[1] = WCB$WC[1] + 2; # ADD WC AND ABH WORDS #
  134. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],MSGBUF[0]); # SEND TEXT #
  135. J = 0; # RESET INDEX #
  136. WCB$WORD[1] = 0; # CLEAR WC WORD #
  137. END
  138. END
  139.  
  140. END # NVFOPHC #
  141.  
  142. TERM
cdc/nos2.source/nam5871/nvfophc.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator