From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 21-JAN-1989 21:36
To:	MRGATE::"ARISIA::EVERHART"
Subj:	long term scheduler - part 4 of 5


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 19 JAN 89 20:27:27 PDT
Received: from RELAY.CS.NET by KL.SRI.COM with TCP; Thu, 19 Jan 89 20:24:21 PST
Received: from relay2.cs.net by RELAY.CS.NET id bz21839; 19 Jan 89 20:43 EST
Received: from a.cs.okstate.edu by RELAY.CS.NET id ad18099; 19 Jan 89 19:34 EST
Received: from nemo.math.okstate.edu by a.cs.okstate.edu id ab10453;
          19 Jan 89 9:49 CST
Date: Thu, 19 Jan 89 09:39 CDT
From: Gregg Wonderly <GREGG%nemo.math.okstate.edu@RELAY.CS.NET>
Subject: long term scheduler - part 4 of 5
To: info-vax@KL.SRI.COM
X-VMS-To: in%"info-vax@kl.sri.com"

$Part4:
$ File_is="SMGDEF.TXT"
$ Check_Sum_is=2120019194
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X!*** MODULE $SMGDEF ***
X!  Definitions for RTL Screen Management
X! 
X!  Input terminator codes
X! 
X!  Control characters
X`009PARAMETER SMG$K_TRM_CTRLA = '00000001'X`009!  SOH
X`009PARAMETER SMG$K_TRM_CTRLB = '00000002'X`009!  STX
X`009PARAMETER SMG$K_TRM_CTRLC = '00000003'X`009!  ETX
X`009PARAMETER SMG$K_TRM_CTRLD = '00000004'X`009!  EOT
X`009PARAMETER SMG$K_TRM_CTRLE = '00000005'X`009!  ENQ
X`009PARAMETER SMG$K_TRM_CTRLF = '00000006'X`009!  ACK
X`009PARAMETER SMG$K_TRM_CTRLG = '00000007'X`009!  BEL
X`009PARAMETER SMG$K_TRM_CTRLH = '00000008'X`009!  BS
X`009PARAMETER SMG$K_TRM_CTRLI = '00000009'X`009!  HT
X`009PARAMETER SMG$K_TRM_CTRLJ = '0000000A'X`009!  LF
X`009PARAMETER SMG$K_TRM_CTRLK = '0000000B'X`009!  VT
X`009PARAMETER SMG$K_TRM_CTRLL = '0000000C'X`009!  FF
X`009PARAMETER SMG$K_TRM_CTRLM = '0000000D'X`009!  CR
X`009PARAMETER SMG$K_TRM_CTRLN = '0000000E'X`009!  SO
X`009PARAMETER SMG$K_TRM_CTRLO = '0000000F'X`009!  SI
X`009PARAMETER SMG$K_TRM_CTRLP = '00000010'X`009!  DLE
X`009PARAMETER SMG$K_TRM_CTRLQ = '00000011'X`009!  DC1
X`009PARAMETER SMG$K_TRM_CTRLR = '00000012'X`009!  DC2
X`009PARAMETER SMG$K_TRM_CTRLS = '00000013'X`009!  DC3
X`009PARAMETER SMG$K_TRM_CTRLT = '00000014'X`009!  DC4
X`009PARAMETER SMG$K_TRM_CTRLU = '00000015'X`009!  NAK
X`009PARAMETER SMG$K_TRM_CTRLV = '00000016'X`009!  SYN
X`009PARAMETER SMG$K_TRM_CTRLW = '00000017'X`009!  ETB
X`009PARAMETER SMG$K_TRM_CTRLX = '00000018'X`009!  CAN
X`009PARAMETER SMG$K_TRM_CTRLY = '00000019'X`009!  EM
X`009PARAMETER SMG$K_TRM_CTRLZ = '0000001A'X`009!  SUB
X`009PARAMETER SMG$K_TRM_ESCAPE = '0000001B'X !  ESC
X!  FS
X!  GS
X!  RS
X!  US
X`009PARAMETER SMG$K_TRM_SPACE = '00000020'X`009!  SP
X`009PARAMETER SMG$K_TRM_EXCLAMATION_POINT = '00000021'X !  !
X`009PARAMETER SMG$K_TRM_DOUBLE_QUOTE = '00000022'X !  "
X`009PARAMETER SMG$K_TRM_NUMBER_SIGN = '00000023'X !  #
X`009PARAMETER SMG$K_TRM_DOLLAR_SIGN = '00000024'X !  $
X`009PARAMETER SMG$K_TRM_PERCENT_SIGN = '00000025'X !  %
X`009PARAMETER SMG$K_TRM_AMPERSAND = '00000026'X !  &
X`009PARAMETER SMG$K_TRM_QUOTE = '00000027'X`009!  '
X`009PARAMETER SMG$K_TRM_LEFT_PAREN = '00000028'X !  (
X`009PARAMETER SMG$K_TRM_RIGHT_PAREN = '00000029'X !  )
X`009PARAMETER SMG$K_TRM_ASTERISK = '0000002A'X !  *
X`009PARAMETER SMG$K_TRM_PLUS_SIGN = '0000002B'X !  +
X!  ,
X`009PARAMETER SMG$K_TRM_DASH = '0000002D'X`009!  -
X`009PARAMETER SMG$K_TRM_DOT = '0000002E'X`009!  .
X`009PARAMETER SMG$K_TRM_SLASH = '0000002F'X`009!  /
X`009PARAMETER SMG$K_TRM_ZERO = '00000030'X`009!  0
X`009PARAMETER SMG$K_TRM_ONE = '00000031'X`009!  1
X`009PARAMETER SMG$K_TRM_TWO = '00000032'X`009!  2
X`009PARAMETER SMG$K_TRM_THREE = '00000033'X`009!  3
X`009PARAMETER SMG$K_TRM_FOUR = '00000034'X`009!  4
X`009PARAMETER SMG$K_TRM_FIVE = '00000035'X`009!  5
X`009PARAMETER SMG$K_TRM_SIX = '00000036'X`009!  6
X`009PARAMETER SMG$K_TRM_SEVEN = '00000037'X`009!  7
X`009PARAMETER SMG$K_TRM_EIGHT = '00000038'X`009!  8
X`009PARAMETER SMG$K_TRM_NINE = '00000039'X`009!  9
X`009PARAMETER SMG$K_TRM_COLON = '0000003A'X`009!  :
X`009PARAMETER SMG$K_TRM_SEMICOLON = '0000003B'X !  ;
X`009PARAMETER SMG$K_TRM_LESS_THAN = '0000003C'X !  <
X`009PARAMETER SMG$K_TRM_EQUAL = '0000003D'X`009!  =
X`009PARAMETER SMG$K_TRM_GREATER_THAN = '0000003E'X !  >
X`009PARAMETER SMG$K_TRM_QUESTION_MARK = '0000003F'X !  ?
X`009PARAMETER SMG$K_TRM_AT_SIGN = '00000040'X !  @
X`009PARAMETER SMG$K_TRM_UPPERCASE_A = '00000041'X !  A
X`009PARAMETER SMG$K_TRM_UPPERCASE_B = '00000042'X !  B
X`009PARAMETER SMG$K_TRM_UPPERCASE_C = '00000043'X !  C
X`009PARAMETER SMG$K_TRM_UPPERCASE_D = '00000044'X !  D
X`009PARAMETER SMG$K_TRM_UPPERCASE_E = '00000045'X !  E
X`009PARAMETER SMG$K_TRM_UPPERCASE_F = '00000046'X !  F
X`009PARAMETER SMG$K_TRM_UPPERCASE_G = '00000047'X !  G
X`009PARAMETER SMG$K_TRM_UPPERCASE_H = '00000048'X !  H
X`009PARAMETER SMG$K_TRM_UPPERCASE_I = '00000049'X !  I
X`009PARAMETER SMG$K_TRM_UPPERCASE_J = '0000004A'X !  J
X`009PARAMETER SMG$K_TRM_UPPERCASE_K = '0000004B'X !  K
X`009PARAMETER SMG$K_TRM_UPPERCASE_L = '0000004C'X !  L
X`009PARAMETER SMG$K_TRM_UPPERCASE_M = '0000004D'X !  M
X`009PARAMETER SMG$K_TRM_UPPERCASE_N = '0000004E'X !  N
X`009PARAMETER SMG$K_TRM_UPPERCASE_O = '0000004F'X !  O
X`009PARAMETER SMG$K_TRM_UPPERCASE_P = '00000050'X !  P
X`009PARAMETER SMG$K_TRM_UPPERCASE_Q = '00000051'X !  Q
X`009PARAMETER SMG$K_TRM_UPPERCASE_R = '00000052'X !  R
X`009PARAMETER SMG$K_TRM_UPPERCASE_S = '00000053'X !  S
X`009PARAMETER SMG$K_TRM_UPPERCASE_T = '00000054'X !  T
X`009PARAMETER SMG$K_TRM_UPPERCASE_U = '00000055'X !  U
X`009PARAMETER SMG$K_TRM_UPPERCASE_V = '00000056'X !  V
X`009PARAMETER SMG$K_TRM_UPPERCASE_W = '00000057'X !  W
X`009PARAMETER SMG$K_TRM_UPPERCASE_X = '00000058'X !  X
X`009PARAMETER SMG$K_TRM_UPPERCASE_Y = '00000059'X !  Y
X`009PARAMETER SMG$K_TRM_UPPERCASE_Z = '0000005A'X !  Z
X`009PARAMETER SMG$K_TRM_LEFT_BRACKET = '0000005B'X !  [
X`009PARAMETER SMG$K_TRM_BACKSLASH = '0000005C'X !  \
X`009PARAMETER SMG$K_TRM_RIGHT_BRACKET = '0000005D'X !  ]
X`009PARAMETER SMG$K_TRM_CARET = '0000005E'X`009!  ^
X`009PARAMETER SMG$K_TRM_UNDERLINE = '0000005F'X !  _
X`009PARAMETER SMG$K_TRM_GRAVE_ACCENT = '00000060'X !  ``
X`009PARAMETER SMG$K_TRM_LOWERCASE_A = '00000061'X !  a
X`009PARAMETER SMG$K_TRM_LOWERCASE_B = '00000062'X !  b
X`009PARAMETER SMG$K_TRM_LOWERCASE_C = '00000063'X !  c
X`009PARAMETER SMG$K_TRM_LOWERCASE_D = '00000064'X !  d
X`009PARAMETER SMG$K_TRM_LOWERCASE_E = '00000065'X !  e
X`009PARAMETER SMG$K_TRM_LOWERCASE_F = '00000066'X !  f
X`009PARAMETER SMG$K_TRM_LOWERCASE_G = '00000067'X !  g
X`009PARAMETER SMG$K_TRM_LOWERCASE_H = '00000068'X !  h
X`009PARAMETER SMG$K_TRM_LOWERCASE_I = '00000069'X !  i
X`009PARAMETER SMG$K_TRM_LOWERCASE_J = '0000006A'X !  j
X`009PARAMETER SMG$K_TRM_LOWERCASE_K = '0000006B'X !  k
X`009PARAMETER SMG$K_TRM_LOWERCASE_L = '0000006C'X !  l
X`009PARAMETER SMG$K_TRM_LOWERCASE_M = '0000006D'X !  m
X`009PARAMETER SMG$K_TRM_LOWERCASE_N = '0000006E'X !  n
X`009PARAMETER SMG$K_TRM_LOWERCASE_O = '0000006F'X !  o
X`009PARAMETER SMG$K_TRM_LOWERCASE_P = '00000070'X !  p
X`009PARAMETER SMG$K_TRM_LOWERCASE_Q = '00000071'X !  q
X`009PARAMETER SMG$K_TRM_LOWERCASE_R = '00000072'X !  r
X`009PARAMETER SMG$K_TRM_LOWERCASE_S = '00000073'X !  s
X`009PARAMETER SMG$K_TRM_LOWERCASE_T = '00000074'X !  t
X`009PARAMETER SMG$K_TRM_LOWERCASE_U = '00000075'X !  u
X`009PARAMETER SMG$K_TRM_LOWERCASE_V = '00000076'X !  v
X`009PARAMETER SMG$K_TRM_LOWERCASE_W = '00000077'X !  w
X`009PARAMETER SMG$K_TRM_LOWERCASE_X = '00000078'X !  x
X`009PARAMETER SMG$K_TRM_LOWERCASE_Y = '00000079'X !  y
X`009PARAMETER SMG$K_TRM_LOWERCASE_Z = '0000007A'X !  z
X`009PARAMETER SMG$K_TRM_LEFT_BRACE = '0000007B'X !  left curly brace
X`009PARAMETER SMG$K_TRM_VERTICAL_LINE = '0000007C'X !  |
X`009PARAMETER SMG$K_TRM_RIGHT_BRACE = '0000007D'X !  right curly brace
X`009PARAMETER SMG$K_TRM_TILDE = '0000007E'X`009!  ~
X`009PARAMETER SMG$K_TRM_DELETE = '0000007F'X !  DEL
X!  Synonyms for control characters
X`009PARAMETER SMG$K_TRM_BS = '00000008'X
X`009PARAMETER SMG$K_TRM_HT = '00000009'X
X`009PARAMETER SMG$K_TRM_LF = '0000000A'X
X`009PARAMETER SMG$K_TRM_CR = '0000000D'X
X!  Keypad keys
X`009PARAMETER SMG$K_TRM_PF1 = '00000100'X
X`009PARAMETER SMG$K_TRM_PF2 = '00000101'X
X`009PARAMETER SMG$K_TRM_PF3 = '00000102'X
X`009PARAMETER SMG$K_TRM_PF4 = '00000103'X
X`009PARAMETER SMG$K_TRM_KP0 = '00000104'X
X`009PARAMETER SMG$K_TRM_KP1 = '00000105'X
X`009PARAMETER SMG$K_TRM_KP2 = '00000106'X
X`009PARAMETER SMG$K_TRM_KP3 = '00000107'X
X`009PARAMETER SMG$K_TRM_KP4 = '00000108'X
X`009PARAMETER SMG$K_TRM_KP5 = '00000109'X
X`009PARAMETER SMG$K_TRM_KP6 = '0000010A'X
X`009PARAMETER SMG$K_TRM_KP7 = '0000010B'X
X`009PARAMETER SMG$K_TRM_KP8 = '0000010C'X
X`009PARAMETER SMG$K_TRM_KP9 = '0000010D'X
X`009PARAMETER SMG$K_TRM_ENTER = '0000010E'X
X`009PARAMETER SMG$K_TRM_MINUS = '0000010F'X
X`009PARAMETER SMG$K_TRM_COMMA = '00000110'X
X`009PARAMETER SMG$K_TRM_PERIOD = '00000111'X !  Cursor positioning keys
X`009PARAMETER SMG$K_TRM_UP = '00000112'X
X`009PARAMETER SMG$K_TRM_DOWN = '00000113'X
X`009PARAMETER SMG$K_TRM_LEFT = '00000114'X
X`009PARAMETER SMG$K_TRM_RIGHT = '00000115'X
X!  Function keys
X`009PARAMETER SMG$K_TRM_F1 = '00000119'X
X`009PARAMETER SMG$K_TRM_F2 = '0000011A'X
X`009PARAMETER SMG$K_TRM_F3 = '0000011B'X
X`009PARAMETER SMG$K_TRM_F4 = '0000011C'X
X`009PARAMETER SMG$K_TRM_F5 = '0000011D'X
X`009PARAMETER SMG$K_TRM_F6 = '0000011E'X
X`009PARAMETER SMG$K_TRM_F7 = '0000011F'X
X`009PARAMETER SMG$K_TRM_F8 = '00000120'X
X`009PARAMETER SMG$K_TRM_F9 = '00000121'X
X`009PARAMETER SMG$K_TRM_F10 = '00000122'X
X`009PARAMETER SMG$K_TRM_F11 = '00000123'X
X`009PARAMETER SMG$K_TRM_F12 = '00000124'X
X`009PARAMETER SMG$K_TRM_F13 = '00000125'X
X`009PARAMETER SMG$K_TRM_F14 = '00000126'X
X`009PARAMETER SMG$K_TRM_HELP = '00000127'X`009!  F15
X`009PARAMETER SMG$K_TRM_DO = '00000128'X`009!  F16
X`009PARAMETER SMG$K_TRM_F17 = '00000129'X
X`009PARAMETER SMG$K_TRM_F18 = '0000012A'X
X`009PARAMETER SMG$K_TRM_F19 = '0000012B'X
X`009PARAMETER SMG$K_TRM_F20 = '0000012C'X
X!  Synonyms for function keys
X`009PARAMETER SMG$K_TRM_F15 = '00000127'X
X`009PARAMETER SMG$K_TRM_F16 = '00000128'X
X!  Editing keys
X`009PARAMETER SMG$K_TRM_FIND = '00000137'X`009!  E1
X`009PARAMETER SMG$K_TRM_INSERT_HERE = '00000138'X !  E2
X`009PARAMETER SMG$K_TRM_REMOVE = '00000139'X !  E3
X`009PARAMETER SMG$K_TRM_SELECT = '0000013A'X !  E4
X`009PARAMETER SMG$K_TRM_PREV_SCREEN = '0000013B'X !  E5
X`009PARAMETER SMG$K_TRM_NEXT_SCREEN = '0000013C'X !  E6
X!  Synonyms for editing keys
X`009PARAMETER SMG$K_TRM_E1 = '00000137'X`009!  FIND
X`009PARAMETER SMG$K_TRM_E2 = '00000138'X`009!  INSERT_HERE
X`009PARAMETER SMG$K_TRM_E3 = '00000139'X`009!  REMOVE
X`009PARAMETER SMG$K_TRM_E4 = '0000013A'X`009!  SELECT
X`009PARAMETER SMG$K_TRM_E5 = '0000013B'X`009!  PREV_SCREEN
X`009PARAMETER SMG$K_TRM_E6 = '0000013C'X`009!  NEXT_SCREEN
X!  Conditions
V`009PARAMETER SMG$K_TRM_CANCELLED = '000001FC'X !  I/O cancelled by SMG$CANCEL
X_INPUT
X`009PARAMETER SMG$K_TRM_TIMEOUT = '000001FD'X !  Timeout period expired
X`009PARAMETER SMG$K_TRM_BUFFER_FULL = '000001FE'X !  Buffer is full
X`009PARAMETER SMG$K_TRM_UNKNOWN = '000001FF'X !  Unknown terminator
X! 
X!  Key definition attributes
X! 
X`009PARAMETER SMG$M_KEY_NOECHO = '00000001'X
X`009PARAMETER SMG$M_KEY_TERMINATE = '00000002'X
X`009PARAMETER SMG$M_KEY_LOCK = '00000004'X
X`009PARAMETER SMG$M_KEY_PROTECTED = '00000008'X
X`009PARAMETER SMG$M_KEY_SETSTATE = '00000010'X
X`009STRUCTURE /SMG$R_KEY_DEF_ATTR/
X`009    PARAMETER SMG$S_KEY_NOECHO = 1
X`009    PARAMETER SMG$V_KEY_NOECHO = 0`009`009!  Don't echo strings
X`009    PARAMETER SMG$S_KEY_TERMINATE = 1
X`009    PARAMETER SMG$V_KEY_TERMINATE = 1`009!  This key terminates read
X`009    PARAMETER SMG$S_KEY_LOCK = 1
X`009    PARAMETER SMG$V_KEY_LOCK = 2`009`009!  Lock new state
X`009    PARAMETER SMG$S_KEY_PROTECTED = 1
X`009    PARAMETER SMG$V_KEY_PROTECTED = 3`009!  Definition is protected
X`009    PARAMETER SMG$S_KEY_SETSTATE = 1
V`009    PARAMETER SMG$V_KEY_SETSTATE = 4`009!  Definition sets a state (output
X only)
X`009BYTE %FILL (1)
X`009END STRUCTURE`009! SMG$R_KEY_DEF_ATTR
X!  SCREEN MANAGEMENT REQUEST TYPES 
X`009PARAMETER SMG$C_CHANGE_RENDITION = '0000000A'X !  SMG$CHANGE_RENDITION
X`009PARAMETER SMG$C_DELETE_CHARS = '0000000B'X !  SMG$DELETE_CHARS
X`009PARAMETER SMG$C_ERASE_DISPLAY = '0000000C'X !  SMG$ERASE_DISPLAY
X`009PARAMETER SMG$C_ERASE_LINE = '0000000D'X !  SMG$ERASE_LINE
X`009PARAMETER SMG$C_HOME_CURSOR = '0000000E'X !  SMG$HOME_CURSOR
X`009PARAMETER SMG$C_INSERT_CHARS = '0000000F'X !  SMG$INSERT_CHARS
X`009PARAMETER SMG$C_INSERT_LINE = '00000010'X !  SMG$INSERT_LINE
X`009PARAMETER SMG$C_PUT_CHARS = '00000011'X`009!  SMG$PUT_CHARS
X`009PARAMETER SMG$C_PUT_LINE = '00000012'X`009!  SMG$PUT_LINE
V`009PARAMETER SMG$C_PUT_DISPLAY_ENCODED = '00000013'X !  SMG$PUT_VIRTUAL_DISPL
XAY_ENCODED
X`009PARAMETER SMG$C_RETURN_CURSOR_POS = '00000014'X !  SMG$RETURN_CURSOR_POS
X`009PARAMETER SMG$C_PUT_WITH_SCROLL = '00000015'X !  SMG$PUT_WITH_SCROLL
X`009PARAMETER SMG$C_SET_CURSOR_ABS = '00000016'X !  SMG$SET_CURSOR_ABS
X`009PARAMETER SMG$C_SET_CURSOR_REL = '00000017'X !  SMG$SET_CURSOR_REL
X`009PARAMETER SMG$C_DELETE_LINE = '00000018'X !  SMG$DELETE_LINE
X`009PARAMETER SMG$C_ERASE_CHARS = '00000019'X !  SMG$ERASE_CHARS
V`009PARAMETER SMG$C_SCROLL_DISPLAY_AREA = '0000001A'X !  SMG$SCROLL_DISPLAY_AR
XEA
V`009PARAMETER SMG$C_CHANGE_VIRTUAL_DISPLAY = '0000001B'X !  SMG$CHANGE_VIRTUAL
X_DISPLAY
X`009PARAMETER SMG$C_LABEL_BORDER = '0000001C'X !  SMG$LABEL_BORDER
X`009PARAMETER SMG$C_END_DISPLAY_UPDATE = '0000001D'X !  SMG$END_DISPLAY_UPDATE
X!  Character Set Codes
X`009PARAMETER SMG$C_UNITED_KINGDOM = '00000000'X
X`009PARAMETER SMG$C_ASCII = '00000001'X
X`009PARAMETER SMG$C_SPEC_GRAPHICS = '00000002'X !  Special Graphics
X`009PARAMETER SMG$C_ALT_CHAR = '00000003'X`009!  Alternate - Standard Char.
X`009PARAMETER SMG$C_ALT_GRAPHICS = '00000004'X !  Alternate - Special Graphics
X! 
X! `009The following constants define corner cursor positions used in
X! `009SMG$HOME_CURSOR.
X! 
X`009PARAMETER SMG$C_UPPER_LEFT = '00000000'X
X`009PARAMETER SMG$C_LOWER_LEFT = '00000001'X
X`009PARAMETER SMG$C_UPPER_RIGHT = '00000002'X
X`009PARAMETER SMG$C_LOWER_RIGHT = '00000003'X
X! 
X! `009The following constants define label positions used in
X! `009SMG$LABEL_BORDER.
X! 
X`009PARAMETER SMG$K_TOP = '00000000'X
X`009PARAMETER SMG$K_BOTTOM = '00000001'X
X`009PARAMETER SMG$K_LEFT = '00000002'X
X`009PARAMETER SMG$K_RIGHT = '00000003'X
X! 
X!         DEFINE BIT MASKS AND VALUES FOR SCREEN ATTRIBUTES
X! 
X`009PARAMETER SMG$M_BOLD = '00000001'X
X`009PARAMETER SMG$M_REVERSE = '00000002'X
X`009PARAMETER SMG$M_BLINK = '00000004'X
X`009PARAMETER SMG$M_UNDERLINE = '00000008'X
X`009PARAMETER SMG$M_NORMAL = '00000000'X`009!  no bits set 
X! 
X`009PARAMETER SMG$M_BUF_ENABLED = '00000001'X
X`009PARAMETER SMG$M_MINUPD = '00000002'X
X`009PARAMETER SMG$M_CLEAR_SCREEN = '00000004'X
X`009PARAMETER SMG$M_NOTABS = '00000008'X
V`009PARAMETER SMG$K_BUF_ENABLED = '00000000'X !  Enable Buffering bitvector in
Xdex
V`009PARAMETER SMG$K_MINUPD = '00000001'X`009!  Enable minimal update bitvector
X index
X`009PARAMETER SMG$K_CLEAR_SCREEN = '00000002'X !  Clear screen on exit
X`009PARAMETER SMG$K_NOTABS = '00000003'X`009!  Don't use physical tabs
X! 
X`009PARAMETER SMG$C_COLOR_UNKNOWN = '00000000'X
X`009PARAMETER SMG$C_COLOR_WHITE = '00000001'X
X`009PARAMETER SMG$C_COLOR_BLACK = '00000002'X
X! 
X`009PARAMETER SMG$K_UNKNOWN = '00000000'X`009!  non-graphics or unknown type
X`009PARAMETER SMG$K_VT05 = '00000001'X`009!  vt05 series terminal
X`009PARAMETER SMG$K_VT52 = '00000002'X`009!  vt52 series terminal
X`009PARAMETER SMG$K_VT100 = '00000003'X`009!  vt100 series terminal
X`009PARAMETER SMG$K_VTFOREIGN = '00000004'X`009!  foreign terminal (ft1-8)
X`009PARAMETER SMG$K_HARDCOPY = '00000005'X`009!  hardcopy device
X`009PARAMETER SMG$K_VTTERMTABLE = '00000006'X !  video terminal
X! 
X`009PARAMETER SMG$M_BORDER = '00000001'X
X`009PARAMETER SMG$M_TRUNC_ICON = '00000002'X
X`009PARAMETER SMG$M_DISPLAY_CONTROLS = '00000004'X
X`009PARAMETER SMG$M_USER_DISPLAY = '00000008'X
X`009PARAMETER SMG$M_UP = '00000001'X
X`009PARAMETER SMG$M_DOWN = '00000002'X
X`009PARAMETER SMG$M_RIGHT = '00000004'X
X`009PARAMETER SMG$M_LEFT = '00000008'X
X`009PARAMETER SMG$K_FIRST_PRIV_TYPE = '000000BF'X
X`009STRUCTURE /SMGDEF/
X`009UNION
X`009    MAP
X`009        PARAMETER SMG$S_BOLD = 1
X`009        PARAMETER SMG$V_BOLD = 0`009`009!  Bold rendition
X`009        PARAMETER SMG$S_REVERSE = 1
X`009        PARAMETER SMG$V_REVERSE = 1`009`009!  Reverse video rendition
X`009        PARAMETER SMG$S_BLINK = 1
X`009        PARAMETER SMG$V_BLINK = 2`009`009!  Blink rendition
X`009        PARAMETER SMG$S_UNDERLINE = 1
X`009        PARAMETER SMG$V_UNDERLINE = 3`009`009!  Underline rendition
X`009    BYTE %FILL (1)
X`009    END MAP
X! `009DEFINE BITS, MASKS, AND FIELDS FOR THE CONTROL MODES.
X! 
X`009    MAP
X`009        PARAMETER SMG$S_BUF_ENABLED = 1
X`009        PARAMETER SMG$V_BUF_ENABLED = 0`009`009!  Enable buffering
X`009        PARAMETER SMG$S_MINUPD = 1
V`009        PARAMETER SMG$V_MINUPD = 1`009`009!  Enable minimal update (defaul
Xt)
X`009        PARAMETER SMG$S_CLEAR_SCREEN = 1
X`009        PARAMETER SMG$V_CLEAR_SCREEN = 2`009!  Clear screen on exit
X`009        PARAMETER SMG$S_NOTABS = 1
X`009        PARAMETER SMG$V_NOTABS = 3`009`009!  Don't use physical tabs
X`009    BYTE %FILL (1)
X`009    END MAP
X! `009Master color wheel for screen background colors.
X! 
X!  The following constants correspond to the internal types defined
X!  in SMGTERM.REQ.  These names used to be for public use - the SMGTERM names
X!  used to be needed for compatibility with SCR$ and SMG$ code.
X!  Use of these names is now very highly discouraged.
X! 
X! `009The following masks define values to be used
X! `009to specify a display attribute.  These may be added
X! `009together to specify multiple attributes.
X! 
X`009    MAP
X`009        PARAMETER SMG$S_BORDER = 1
X`009        PARAMETER SMG$V_BORDER = 0`009`009!  Display is bordered
X`009        PARAMETER SMG$S_TRUNC_ICON = 1
V`009        PARAMETER SMG$V_TRUNC_ICON = 1`009`009!  Truncation icon enabled i
Xf set
X`009        PARAMETER SMG$S_DISPLAY_CONTROLS = 1
V`009        PARAMETER SMG$V_DISPLAY_CONTROLS = 2`009!  Display carriage contro
Xls if set
X`009        PARAMETER SMG$S_USER_DISPLAY = 1
V`009        PARAMETER SMG$V_USER_DISPLAY = 3`009!  User display for DEBUG if s
Xet
X`009    BYTE %FILL (1)
X`009    END MAP
X! 
X! `009When an out-of-band AST triggers, the user's AST routine
X! `009will get called.  The first argument passed to his
X! `009routine is the address of a Band Information Table.
X! `009The offsets into this table are described below.
X! `009To make it easy to access from certain languages,
X! `009the table is arranged so that it is convenient to
X! `009reference it as a longword vector as well as a byte block.
X! 
X`009    MAP
X`009        INTEGER*4 SMG$L_PASTEBOARD_ID`009`009!  Pasteboard ID
X`009        INTEGER*4 SMG$L_ARG`009`009`009!  User's AST argument
X`009        UNION
X`009            MAP
X`009            BYTE      SMG$B_CHARACTER`009`009!  The character typed
X`009            END MAP
X`009            MAP
X`009            INTEGER*4 SMG$L_CHARACTER`009`009!  The character and 3 spaces
X`009            END MAP
X`009        END UNION
X`009    END MAP
X! `009When SMG$GET_PASTEBOARD_ATTRIBUTES is called,
X! `009it returns data in a pasteboard information block.
X! `009The following structure is used to reference fields
X! `009in this block.
X! `009Items marked with a plus (+) will be 0 unless the
X! `009device is a terminal (DEVCLASS=DC$_TERM).
X`009    MAP
X`009        INTEGER*4 SMG$L_DEVCHAR`009`009`009!  Device characteristics
X`009        INTEGER*4 SMG$L_DEVDEPEND`009`009!  Specific characteristics (1)
X`009        INTEGER*4 SMG$L_DEVDEPEND2`009`009!  Specific characteristics (2)
X`009        BYTE      SMG$B_DEVCLASS`009`009!  Device class (e.g. DC$_TERM)
X`009        BYTE      SMG$B_SMG_DEVTYPE`009`009!  Internal SMG device type
V`009        BYTE      SMG$B_PHY_DEVTYPE`009`009!  Physical device type (e.g. D
XT$_VT100)
X`009        BYTE      SMG$B_ROWS`009`009`009!  Number of rows on device
X`009        INTEGER*2 SMG$W_WIDTH`009`009`009!  Terminal width
X`009        BYTE      SMG$B_COLOR`009`009`009!  Reserved for future use
X`009        BYTE      SMG$B_PARITY`009`009`009!  Parity attributes (+)
X`009        INTEGER*2 SMG$W_SPEED`009`009`009!  Terminal Speed (+)
X`009        INTEGER*2 SMG$W_FILL`009`009`009!  Fill characteristics (+)
X`009        INTEGER*2 SMG$W_CURSOR_ROW`009`009!  Row where physical cursor is
X!  (1-origin)
X`009        INTEGER*2 SMG$W_CURSOR_COL`009`009!  Col where physical cursor is
X!  (1-origin)
X`009        INTEGER*4 SMG$L_CURSOR_DID`009`009!  Display id of topmost
X!  display that cursor is in.
X!  0 if cursor is not in a
X!  virtual display
X`009    END MAP
X! `009When SMG$GET_KEYBOARD_ATTRIBUTES is called,
X! `009it returns data in a keyboard information block.
X! `009The following structure is used to reference fields
X! `009in this block.
X! `009Items marked with a plus (+) will be 0 unless the
X! `009device is a terminal (DEVCLASS=DC$_TERM).
X`009    MAP
X`009        INTEGER*4 SMG$l_fill1`009`009`009!  Device characteristics
X`009        INTEGER*4 SMG$l_fill2`009`009`009!  Specific characteristics (1)
X`009        INTEGER*4 SMG$l_fill3`009`009`009!  Specific characteristics (2)
X`009        BYTE      SMG$b_fill4`009`009`009!  Device class (e.g. DC$_TERM)
X`009        BYTE      SMG$B_RECALL_SIZE`009`009!  Size of recall buffer (+)
V`009        BYTE      SMG$b_fill5`009`009`009!  Physical device type (e.g. DT$
X_VT100)
V`009        BYTE      SMG$B_TYPEAHEAD_CHAR`009`009!  First char in typeahead b
Xuffer (+)
X`009        INTEGER*2 SMG$w_fill6`009`009`009!  Terminal width
V`009        INTEGER*2 SMG$W_TYPEAHEAD_COUNT`009`009!  Number of chars in typea
Xhead buffer (+)
X`009    END MAP
X! 
X! `009Directions are set up as a structure, assuming that directions
X! `009may be combined in the future (ie. diagonal movement).
X! 
X`009    MAP
X`009        PARAMETER SMG$S_UP = 1
X`009        PARAMETER SMG$V_UP = 0`009`009`009!  Scroll up
X`009        PARAMETER SMG$S_DOWN = 1
X`009        PARAMETER SMG$V_DOWN = 1`009`009!  Scroll down
X`009        PARAMETER SMG$S_RIGHT = 1
X`009        PARAMETER SMG$V_RIGHT = 2`009`009!  Scroll right
X`009        PARAMETER SMG$S_LEFT = 1
X`009        PARAMETER SMG$V_LEFT = 3`009`009!  Scroll left
X`009    BYTE %FILL (1)
X`009    END MAP
X`009END UNION
X`009END STRUCTURE`009! SMGDEF
X 
$ GoSub Convert_File
$ File_is="STATEDEF.INC"
$ Check_Sum_is=1728388139
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X        parameter SCH$C_COLPG = 1
X        parameter SCH$C_MWAIT = 2
X        parameter SCH$C_CEF = 3
X        parameter SCH$C_PFW = 4
X        parameter SCH$C_LEF = 5
X        parameter SCH$C_LEFO = 6
X        parameter SCH$C_HIB = 7
X        parameter SCH$C_HIBO = 8
X        parameter SCH$C_SUSP = 9
X        parameter SCH$C_SUSPO = 10
X        parameter SCH$C_FPG = 11
X        parameter SCH$C_COM = 12
X        parameter SCH$C_COMO = 13
X        parameter SCH$C_CUR = 14
$ GoSub Convert_File
$ File_is="STRUCT.INC"
$ Check_Sum_is=610564018
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X*
X*       This structure's size is used in gdata.mar.  If you add something
X*       here, you must change the value PROC_INFO_LEN there.
X*
X        structure /proc_info/
X            integer cputim
X            integer pid
X            integer curprio
X            integer baseprio
X            integer uic
X            integer imagecnt
X            integer state
X            character*14 username
X            character imagname(MAXIMAGE)
X        end structure
X
X*
X*       This structure's size is used in gdata.mar.  If you add something
X*       here, you must change the value PREV_INFO_LEN there.
X*
X
X        structure /prev_info/
X            integer curprio
X            integer baseprio
X            integer cputim
X            integer pid
X            integer cpuused
X            integer state
X            integer proc
X            integer imagecnt
X            integer downcnt
X            integer idlecnt
X            integer strategy
X            integer bias
X            integer activecnt
X            character*14 username
X            logical newimage
X            logical adj
X            logical hog
X            logical used
X            logical upd
X        end structure
X
X*
X*       There is one of these structures per queue being monitored
X*
X        structure /queue_info/
X            character queuename(1:100)
X            integer queuelen
X            real maxavg(1:3)
X            real minavg(1:3)
X            logical used
X            logical paused
X        end structure
$ GoSub Convert_File
$ File_is="STRUCT.MAR"
$ Check_Sum_is=1953974537
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X;
X;`009Definition of offsets to prev structure elements
X;
X`009.macro`009$struct
Xprev_curprio=0
Xprev_baseprio=4
Xprev_cputim=8
Xprev_pid=12
Xprev_cpuused=16
Xprev_state=20
Xprev_proc=24
Xprev_imagecnt=28
Xprev_downcnt=32
Xprev_idlecnt=36
Xprev_strategy=40
Xprev_bias=44
Xprev_username=48
Xprev_newimage=62
Xprev_adj=66
Xprev_hog=70
Xprev_used=74
Xprev_upd=78
X`009.endm
$ GoSub Convert_File
$ File_is="BEGIN_DATA.FOR"
$ Check_Sum_is=758445054
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
V******************************************************************************
X*
X*
X*       Prepare to output the process information lines.  Here, we move the
X*       virtual displays on the pasteboard so that they are one after the
X*       other on the display, going from top to bottom.
X*
V******************************************************************************
X*
X
X        logical function begin_data (vid1, vid2, vid3, vid4,
X     .                               pbid, rows, cols, cnt, update)
X            implicit none
X
X            include 'smgdef.txt'
X
X            integer smg$repaste_virtual_display, smg$cursor_row
X            integer currow, vid1, vid2, vid3, vid4, stat, pbid, rows, cols
X            integer smg$end_display_update, smg$set_display_scroll_region
X            integer smg$move_virtual_display, cnt, smg$begin_display_update
X            logical update
X
X            external lib$signal
X
X*           Display the load average header.
X
X            stat = smg$end_display_update (vid3)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Display the queues information.
X
X            stat = smg$end_display_update (vid2)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Display the process info header.
X
X            stat = smg$end_display_update (vid4)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Calculate the row that it should be on.
X
X            currow = smg$cursor_row (vid2) + smg$cursor_row (vid3) - 1
X
X*           Move the process info header to the proper screen row.
X
X            stat = smg$move_virtual_display (vid4, pbid, currow, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Calculate the row where the process info show start.
X
X            currow = currow + smg$cursor_row (vid4) - 1
X
X*           Move that display to that line on the screen.
X
X            stat = smg$move_virtual_display (vid1, pbid, currow, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Create a scrolling region so that all data will be visible on
X*           the screen.  If more lines are displayed than will fit on the
X*           rest of the screen than the display will scroll.
X
X            stat = smg$set_display_scroll_region (vid1, 1, rows - currow + 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           If the number of lines to display on the screen do not exceed the
X*           length of the screen, then use minimal updating (via batching)
X*           on the display.
X
X            update = .false.
X            if (cnt .le. rows-currow) then
X                stat = smg$begin_display_update (vid1)
X                if ((stat .and. 1).eq.0) then
X                    call lib$signal (%val(stat))
X                endif
X                update = .true.
X            endif
X        end
$ GoSub Convert_File
$ File_is="BLENGTH.FOR"
$ Check_Sum_is=2020491011
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X******************************************************************************
X*
X*       Return the length of the string up to the first blank character.
X*
X******************************************************************************
X
X        integer function blength (str)
X            implicit none
X            character str(0:*)
X            integer i
X
X            i = 0
X            do while (str(i) .gt. ' ')
X                i = i + 1
X            end do
X            blength = i
X        end
$ GoSub Convert_File
$ File_is="END_DISPLAY.FOR"
$ Check_Sum_is=1577926294
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
V******************************************************************************
X*
X*
X*       Finish this particular update of the screen.  If upd is .true. then
X*       a smg$begin_display_update was called in reset_display to batch the
X*       output to the process display.  In this case we will call
X*       smg$end_display_update to terminate the batching.
X*
V******************************************************************************
X*
X
X        logical function end_display (vid1, vid2, vid3, vid4, pbid, upd)
X            implicit none
X
X            integer vid1, vid2, vid3, vid4, stat, currow, pbid
X            integer smg$cursor_row, smg$erase_display, smg$set_cursor_abs
X            integer smg$end_display_update, smg$set_cursor_mode
X
X            logical upd
X
X            include 'smgdef.txt'
X
X*           Get the current row.
X
X            currow = smg$cursor_row (vid1)
X
X*           Erase to the end of the display.
X
X            stat = smg$erase_display (vid1, currow, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           If output is batched, then finish the update.
X
X            if (upd) then
X                stat = smg$end_display_update (vid1)
X                if ((stat .and. 1).eq.0) then
X                    call lib$signal (%val(stat))
X                endif
X            endif
X
X*           Turn the cursor back on.
X
X            stat = smg$set_cursor_mode (pbid, 0)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Move the cursor to the top left hand corner of the screen.
X
X            stat = smg$set_cursor_abs (vid3, 1, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            end_display = .true.
X        end
$ GoSub Convert_File
$ File_is="END_SMG.FOR"
$ Check_Sum_is=92212093
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X******************************************************************************
X*
X*       Terminate SMG on the pasteboard by deleting it.
X*
X******************************************************************************
X
X        logical function end_smg (vid, pbid)
X            implicit none
X            integer vid, pbid, smg$delete_pasteboard, stat
X            integer smg$delete_virtual_display
X
X            include 'smgdef.txt'
X
X            stat = smg$delete_pasteboard (pbid)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            end_smg = .true.
X        end
$ GoSub Convert_File
$ File_is="INIT_DISPLAY.FOR"
$ Check_Sum_is=74800960
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
V******************************************************************************
X*
X*
X*       Initialize the displays, and paste them to the pasteboard at an
X*       arbitrary initial location.  They will be moved later to align then
X*       on the screen.
X*
V******************************************************************************
X*
X
X        logical function init_display (vid1, vid2, vid3, vid4, pbid)
X            implicit none
X            integer vid1, vid2, pbid, smg$paste_virtual_display, stat
X            integer smg$erase_display, vid3, vid4
X            external lib$signal
X
X`009`009`009include 'gdata.inc'
X            include 'smgdef.txt'
X
X            init_display = .false.
X            stat = smg$paste_virtual_display (vid3, pbid, 1, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$paste_virtual_display (vid2, pbid, 4, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$paste_virtual_display (vid4, pbid, 4+queuecnt, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$paste_virtual_display (vid1, pbid, 7+queuecnt, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            init_display = .true.
X        end
$ GoSub Convert_File
$ File_is="PUT_DATA.FOR"
$ Check_Sum_is=1650398010
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
V******************************************************************************
X*
X*
X*       Display a line of process information on the screen.  If scroll is
X*       true, then we will use put_with_scroll to display the line, otherwise
X*       put_line is used.  This should keep the last line displayed at the
X*       bottom of the screen instead of causing the display to scroll after
X*       it is displayed.
X*
V******************************************************************************
X*
X
X        logical function put_data (prev_idx, vid, scroll)
X            implicit none
X            include 'statedef.inc'
X            integer prev_idx, vid, i, j, ending, descr1(1:2), k
X            character image(1:32), lower, state*5
X            logical scroll
X
X            include 'smgdef.txt'
X            include 'gdata.inc'
X
X            external sys$fao, lower
X            integer sys$fao, stat, len, smg$put_with_scroll, smg$put_line
X            character*512 outbuf
X            character*1 adj
X
X            state = '*****'
X
X            if (prev(prev_idx).state .eq. SCH$C_CEF) THEN
X                state = 'CEF'
X            else if (prev(prev_idx).state .eq. SCH$C_COM) THEN
X                state = 'COM'
X            else if (prev(prev_idx).state .eq. SCH$C_COMO) THEN
X                state = 'COMO'
X            else if (prev(prev_idx).state .eq. SCH$C_CUR) THEN
X                state = 'CUR'
X            else if (prev(prev_idx).state .eq. SCH$C_COLPG) THEN
X                state = 'COLPG'
X            else if (prev(prev_idx).state .eq. SCH$C_FPG) THEN
X                state = 'FPG'
X            else if (prev(prev_idx).state .eq. SCH$C_HIB) THEN
X                state = 'HIB'
X            else if (prev(prev_idx).state .eq. SCH$C_HIBO) THEN
X                state = 'HIBO'
X            else if (prev(prev_idx).state .eq. SCH$C_LEF) THEN
X                state = 'LEF'
X            else if (prev(prev_idx).state .eq. SCH$C_LEFO) THEN
X                state = 'LEFO'
X            else if (prev(prev_idx).state .eq. SCH$C_MWAIT) THEN
X                state = 'MWAIT'
X            else if (prev(prev_idx).state .eq. SCH$C_PFW) THEN
X                state = 'PFW'
X            else if (prev(prev_idx).state .eq. SCH$C_SUSP) THEN
X                state = 'SUSP'
X            else if (prev(prev_idx).state .eq. SCH$C_SUSPO) THEN
X                state = 'SUSPO'
X            endif
X
X            do i=1,32
X                image(i) = ' '
X            end do
X
X            k = prev(prev_idx).proc
X            i = MAXIMAGE-1
X
X            do while (procs(k).imagname(i) .eq. ' ' .and. i .gt. 0)
X                i = i - 1
X            end do
X
X            do while (procs(k).imagname(i) .ne. '.' .and. i .gt. 0)
X                i = i - 1
X            end do
X
X            ending = i - 1
X
X            do while (procs(k).imagname(i) .ne. ']' .and. i .gt. 0)
X                i = i - 1
X            end do
X
X            if (i.gt.0 .and. ending .gt. 0) then
X                do j=1,ending-i
X                    image(j) = lower (procs(k).imagname(j+i))
X                end do
X                descr1(1) = ending-i
X            else
X                descr1(1) = 1
X            endif
X
X            descr1(2) = %loc(image)
X
X            put_data = .false.
X
X            len = 0
X
X*           Set the "this process is adjusted" string.
X
X            adj = ' '
X            if (prev(prev_idx).adj) adj = '*'
X            if (prev(prev_idx).hog) adj = '#'
X            if (prev(prev_idx).strategy.eq.SCH$IGNORE) adj = 'I'
X            if (prev(prev_idx).strategy.eq.SCH$SMASH) adj = 'S'
X            if (prev(prev_idx).strategy.eq.SCH$NEWIMAGE) adj = 'N'
X
X*           Format the output line.
X
V            stat = sys$fao ('!AS!8XL!3* !2ZL/!2ZL  !2ZL:!2ZL.!2ZL  !2ZL !2ZL:!
X2ZL:!2ZL.!2ZL  !16AS !12AS !5AS',
X     .                      len, %descr(outbuf),
X     .                      adj,
X     .                      %val(prev(prev_idx).pid),
X     .                      %val(prev(prev_idx).curprio),
X     .                      %val(prev(prev_idx).baseprio),
X     .                      %val(mod (prev(prev_idx).cpuused / (60*100), 60)),
X     .                      %val(mod (prev(prev_idx).cpuused / 100, 60)),
X     .                      %val(mod (prev(prev_idx).cpuused, 100)),
X     .                      %val(prev(prev_idx).cputim / (3600*100*24)),
V     .                      %val(mod (prev(prev_idx).cputim / (60*60*100), 24)
X),
X     .                      %val(mod (prev(prev_idx).cputim / (60*100), 60)),
X     .                      %val(mod (prev(prev_idx).cputim / 100, 60)),
X     .                      %val(mod (prev(prev_idx).cputim, 100)),
X     .                      %descr(prev(prev_idx).username),
X     .                      %ref(descr1),
X     .                      %descr(state)
X     .                  )
X            
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Truncate the line to the size returned by $FAO.
X
X            outbuf = outbuf (1:len)
X
X*           Display the line on the screen.
X
X            if (scroll) then
X                if (prev(prev_idx).newimage) then
X                    stat = smg$put_with_scroll (vid, %descr(outbuf),
V     .                                                          ,SMG$M_REVERSE
X)
X                else
X                    stat = smg$put_with_scroll (vid, %descr(outbuf))
X                endif
X            else
X                if (prev(prev_idx).newimage) then
X                    stat = smg$put_line (vid, %descr(outbuf), , SMG$M_REVERSE)
X                else
X                    stat = smg$put_line (vid, %descr(outbuf))
X                endif
X            endif
X
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            put_data = .true.
X        end
X
X
X        character function lower (ch)
X            implicit none
X            character ch, c
X            integer foo
X            equivalence (foo,c)
X
X            c = ch
X            if (foo .gt. 64 .and. foo .le. 97) foo = foo + 32
X            lower = c
X        end
$ GoSub Convert_File
$ File_is="PUT_QUEUE.FOR"
$ Check_Sum_is=39333667
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
V******************************************************************************
X*
X*
X*       Add a line to the display containing the list of queues being watched.
X*       Just the index into the queue array is passed to simplify things.
X*
V******************************************************************************
X*
X
X        logical function put_queue (idx, vid)
X            implicit none
X            integer idx, vid
X
X            include 'smgdef.txt'
X            include 'gdata.inc'
X
X            integer smg$set_cursor_abs, stat
X            integer smg$put_with_scroll
X            external lib$signal, sys$fao
X            integer len, sys$fao
X            character*512 outbuf
X            character paused
X
X            put_queue = .false.
X
X*           Set the paused vs not paused string.
X
X            paused = ' '
X            if (queues(idx).paused) paused = '*'
X
X*           Format the output string.
X
X            stat = sys$fao (
V     .         '!AS!25AD !3UL.!2ZL !3UL.!2ZL !3UL.!2ZL!10* !3UL.!2ZL !3UL.!2ZL
X !3UL.!2ZL',
X     .                      len, %descr (outbuf),
X     .                      %descr (paused),
X     .                      %val (queues(idx).queuelen),
X     .                      %ref (queues(idx).queuename),
X     .                      %val (ifix (queues(idx).minavg(1))),
V     .                      %val ( mod (ifix (queues(idx).minavg(1)*100),100))
X,
X     .                      %val (ifix (queues(idx).minavg(2))),
V     .                      %val ( mod (ifix (queues(idx).minavg(2)*100),100))
X,
X     .                      %val (ifix (queues(idx).minavg(3))),
V     .                      %val ( mod (ifix (queues(idx).minavg(3)*100),100))
X,
X     .                      %val (ifix (queues(idx).maxavg(1))),
V     .                      %val ( mod (ifix (queues(idx).maxavg(1)*100),100))
X,
X     .                      %val (ifix (queues(idx).maxavg(2))),
V     .                      %val ( mod (ifix (queues(idx).maxavg(2)*100),100))
X,
X     .                      %val (ifix (queues(idx).maxavg(3))),
V     .                      %val ( mod (ifix (queues(idx).maxavg(3)*100),100))
X)
X
X
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Truncate the line to the length returned by $FAO.
X
X            outbuf=outbuf(1:len)
X
X*           Put it onto the display.
X
X            stat = smg$put_with_scroll (vid, %descr(outbuf))
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            put_queue = .true.
X        end
$ GoSub Convert_File
$ File_is="RESET_DISPLAY.FOR"
$ Check_Sum_is=1965670029
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
V******************************************************************************
X*
X*
X*       Reset the displays for the next update sequence.
X*
V******************************************************************************
X*
X
X        logical function reset_display (pbid, vid1, vid2, vid3, vid4, avg)
X            implicit none
X
X            include 'gdata.inc'
X            include 'smgdef.txt'
X
X            real avg(1:3)
X            integer vid1, vid2, vid3, vid4, stat, intv, pbid
X            integer smg$begin_display_update, smg$set_cursor_mode
X            integer smg$set_cursor_abs
X            integer smg$put_with_scroll
X            external lib$signal, sys$fao
X            integer len, descr(1:2), sys$fao
X            character*512 outbuf
X
X            reset_display = .false.
X
X            intv = interval * 100
X
X*           Turn the cursor off during update.
X
X            stat = smg$set_cursor_mode (pbid, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Batch output on all but the top display.
X
X            stat = smg$begin_display_update (vid4)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$begin_display_update (vid3)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$begin_display_update (vid2)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Move the cursor to the top of all displays.
X
X            stat = smg$set_cursor_abs (vid1, 1, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$set_cursor_abs (vid2, 1, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$set_cursor_abs (vid3, 1, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$set_cursor_abs (vid4, 1, 1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Format the load average information.
X
V            stat = sys$fao (' Current Load Averages:  1 Min: !3UL.!2ZL,  5 Min
X: !3UL.!2ZL,  15 Min: !3UL.!2ZL',
X     .                      len, %descr (outbuf),
X     .                      %val (ifix (avg(1))),
X     .                      %val (mod (ifix (avg(1)* 100), 100)),
X     .                      %val (ifix (avg(2))),
X     .                      %val (mod (ifix (avg(2)* 100), 100)),
X     .                      %val (ifix (avg(3))),
X     .                      %val (mod (ifix (avg(3)* 100), 100)))
X
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Truncate the string to the length returned by $FAO.
X
X            outbuf=outbuf(1:len)
X
X*           Put in on the display.
X
X            stat = smg$put_with_scroll (vid3, %descr(outbuf), , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Put the rest of the header info up.
X
X            stat = smg$put_with_scroll (vid3,
V     .         '                                  Minimum Avg                 
X Maximum Avg      ',
X     .         , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$put_with_scroll (vid3,
V     .         '   Queue Name                  1      5     15               1
X      5     15    ',
X     .         , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Format the top line of the process header.
X
X            stat = sys$fao (
V     .         ' Cpu: !2UL !2ZL:!2ZL:!2ZL.!2ZL of !2UL !2ZL:!2ZL:!2ZL.!2ZL, Pr
Xiorities: Up = !UL / Down = !UL / Hog = !UL ',
X     .                      len, %descr(outbuf),
X     .                      %val(sumtime/(3600*100*24)),
X     .                      %val(mod (sumtime, (3600*100*24))/(3600*100)),
X     .                      %val(mod (sumtime, (3600*100))/(60*100)),
X     .                      %val(mod (sumtime, (60*100))/100),
X     .                      %val(mod (sumtime, 100)),
X     .                      %val(intv/(3600*100*24)),
X     .                      %val(mod (intv, (3600*100*24))/(3600*100)),
X     .                      %val(mod (intv, (3600*100))/(60*100)),
X     .                      %val(mod (intv, (60*100))/100),
X     .                      %val(mod (intv, 100)),
X     .                      %val(up_prio), %val(down_prio), %val(hog_prio)
X     .          )
X
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Truncate it to the length returned by $FAO.
X
X            outbuf=outbuf(1:len)
X
X*           Put it onto the screen.
X
X            stat = smg$put_with_scroll (vid4, %descr(outbuf), , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Put up the rest of the header info.
X
X            stat = sys$fao (
V     .         ' Counts: Hog !UL / Down: !UL / Idle: !UL / Max: !UL,   Percent
Xs: Max !UL / Min: !UL ',
X     .                      len, %descr(outbuf),
X     .                      %val(hog_count),
X     .                      %val(down_count),
X     .                      %val(idle_cnt),
X     .                      %val(max_active),
X     .                      %val(max_percent),
X     .                      %val(min_percent)
X     . )
X
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Truncate it to the length returned by $FAO.
X
X            outbuf=outbuf(1:len)
X
X*           Put it onto the screen.
X
X            stat = smg$put_with_scroll (vid4, %descr(outbuf), , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = sys$fao (
V     .         ' I/O Difference: !UL,  System Groups are <= !UL,  Min Time: !2
XZL:!2ZL:!2ZL.!2ZL    ',
X     .                      len, %descr(outbuf),
X     .                      %val (io_diff),
X     .                      %val (sysgrp),
X     .                      %val(mod (min_time, (3600*100*24))/(3600*100)),
X     .                      %val(mod (min_time, (3600*100))/(60*100)),
X     .                      %val(mod (min_time, (60*100))/100),
X     .                      %val(mod (min_time, 100))
X     . )
X
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Truncate it to the length returned by $FAO.
X
X            outbuf=outbuf(1:len)
X
X*           Put it onto the screen.
X
X            stat = smg$put_with_scroll (vid4, %descr(outbuf), , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$put_with_scroll (vid4, 
V     .         ' Process   Current  Current       Total                       
X                  ',
X     .         , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            stat = smg$put_with_scroll (vid4,
V     .         '   ID       Prio      CPU          CPU       Username        I
Xmagename    State ',
X     .         , SMG$M_REVERSE)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            reset_display = .true.
X        end
$ GoSub Convert_File
$ File_is="SMG_START.FOR"
$ Check_Sum_is=1904019476
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X******************************************************************************
X*
X*       Initialize the SMG package getting a pasteboard to use, and 4
X*       virtual displays.
X*
X******************************************************************************
X
X        logical function smg_start (term, rows, cols, pbid, vid1, vid2,
X     .`009`009`009`009`009`009`009`009vid3, vid4)
X            implicit none
X            character term(*)
X            integer id, rows, cols, pbid, vid1, vid2, vid3, vid4, stat
X            integer descr(1:2), blength
X            external blength, lib$signal
X            integer smg$create_pasteboard, smg$control_mode
X            integer smg$create_virtual_display
X
X            include 'smgdef.txt'
X
X            smg_start = .false.
X
X            descr(1) = blength (term)
X            descr(2) = %loc (term)
X
X*           Create a pasteboard to put the displays on.
X
X            stat = smg$create_pasteboard (pbid, descr, rows, cols)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Use minimal updating.
X
X            stat = smg$control_mode (pbid, smg$m_minupd)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Create a virtual display for the process information
X
X            stat = smg$create_virtual_display (rows, cols, vid1)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Create a virtual display for the queue information
X
X            stat = smg$create_virtual_display (rows, cols, vid2)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Create a virtual display for the load average information.
X
X            stat = smg$create_virtual_display (rows, cols, vid3)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X*           Create a virtual display for the process info header.
X
X            stat = smg$create_virtual_display (rows, cols, vid4)
X            if ((stat .and. 1).eq.0) then
X                call lib$signal (%val(stat))
X            endif
X
X            smg_start = .true.
X        end
$ GoSub Convert_File
$ Exit

