From:	MERC::"uunet!WKUVX1.BITNET!FILESERV-Mgr"  6-MAY-1992 20:46:11.49
To:	galaxy::gleeve
CC:	
Subj:	NOTICE.02_OF_06

-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+
XProcedure hg$substitute_topic (the_buffer, target, new, level)
XLocal`09temp
X`09,save_pos
X`09,x
X`09;
X  on_error;
X  endon_error;
X
X  save_pos := mark(none);
X  position(beginning_of(the_buffer));
X  loop
X`09x := search(target, forward);
X`09exitif x = 0;
X`09position (x);
X`09erase_character(length(x));
X`09move_vertical(-1);
X`09if (length(current_line) = 0)
X`09then copy_text("`7C");
X`09endif;
X`09move_vertical(1);
X`09copy_text(".!------------------------------------------------------");
X`09split_line;
X`09copy_text(new);
X`09move_horizontal(-current_offset);
X`09move_vertical(1);
X`09if level <> "" then
X`09`09copy_text(level + " ");
X`09else
X`09    if qualifier_level = 0
X`09    then
X`09        copy_text("2 Qualifiers");
X`09`09split_line; split_line;
X`09`09copy_text(new); split_line;
X`09`09qualifier_level := 1;
X`09    endif;
X`09endif;
X`09move_horizontal(-current_offset);
X`09move_vertical(1);
X`09if length(current_line) = 0 then copy_text(".sk"); endif;
X  endloop;
X
X  position(save_pos);
X
XEndProcedure;`09`09! hg$substitute_topic
X
X!===========================================================================
V====
XProcedure tpu$init_procedure
XLocal`09temp
X`09,orig_filespec
X`09,f
X`09;
X
X   on_error
X   endon_error;
X
X !Prompt user for information
X
X  orig_filespec := get_info(command_line, "file_name");
X  if orig_filespec = ""
X  then
X`09message("No .HELP file given");
X`09quit;
X  endif;
X  f := file_parse(orig_filespec, ".HELP");`09`09!Add .LIS ending
X
X    ! Create a buffer and window for editing
X
X  main_buf := create_buffer ("MAIN",f);
X  set (eob_text, main_buf, "`5BEnd of buffer`5D");
X
X  position (beginning_of(main_buf));
X
X  eve_convert_help;
X
X  f := file_parse(orig_filespec,"","",NAME);
X
X  write_file (main_buf, f+".RNH");
X
X quit;
XEndProcedure;`09`09!TPU$INIT_PROCEDURE
X
Xtpu$init_procedure;
$ CALL UNPACK [.NOTICE]CVTHELP.TPU;1 1399685451
$ create 'f'
X!
X!  MMS file for NOTICE
X!
X
X.IFDEF DEBUG
Xlflags = /DEBUG/TRACE
Xbflags = /DEBUG
X.ELSE
Xlflags = /notrace
X.ENDIF
X
Xnotice :`09notice.exe, notice.hlp
X`09!Notice build complete
X
Xnotice.exe :`09notice.obj, hg$put_output.obj, notice_cld.obj, notice_msg.obj
X`09link $(lflags)/executable=$(MMS$TARGET) $(MMS$SOURCE_LIST)
X
Xnotice.obj :`09`09notice.b32
Xhg$put_output.obj :`09hg$put_output.b32
Xnotice_cld.obj :`09notice_cld.cld
Xnotice_msg.obj :`09notice_msg.msg
X
Xnotice.hlp :`09`09notice.rnh
X`09runoff $(MMS$SOURCE)
X
Xnotice.rnh :`09`09notice.help, cvthelp.tpu
X`09edit/tpu/nosection/nodisplay/command=cvthelp.tpu $(MMS$SOURCE)
X
Xcvthelp.tpu :
X`09@!
$ CALL UNPACK [.NOTICE]DESCRIP.MMS;1 1731010853
$ create 'f'
X%TITLE`09'HG$PUT_OUTPUT'
XMODULE`09HG$PUT_OUTPUT (IDENT = '01-000') =
XBEGIN
X!++
X!
X!  Facility:`09I/O routines
X!
X!  Author:`09Hunter Goatley
X!`09`09goathunter@WKUVX1.BITNET
X!
X!  Date:`09March 13, 1992
X!
X!  Abstract:
X!
X!`09This file contains the routines necessary to provide TYPE/PAGE
X!`09emulation.  It is useful for pausing screenfuls of output so that
X!`09the text doesn't scroll off the screen before the user has a chance
X!`09to read it.
X!
X!  Modified by:
X!
X!`0901-000`09`09Hunter Goatley`09`0913-MAR-1992 07:59
X!`09`09Genesis.
X!
X!--
XLIBRARY 'SYS$LIBRARY:STARLET';
X
XSWITCHES ADDRESSING_MODE (EXTERNAL = GENERAL, NONEXTERNAL = WORD_RELATIVE);
X
XFORWARD ROUTINE
X`09hg$put_output,`09`09`09`09!The output routine
X`09hg$put_outexh;`09`09`09`09!The exit handler
X
XEXTERNAL ROUTINE
X`09LIB$PUT_OUTPUT,`09`09`09`09!Write to SYS$OUTPUT
X`09SMG$CREATE_PASTEBOARD,`09`09`09!Create an SMG$ pasteboard
X`09SMG$CREATE_VIRTUAL_DISPLAY,`09`09!Create an SMG$ virtual display
X`09SMG$CREATE_VIRTUAL_KEYBOARD,`09`09!Create an SMG$ keyboard
X`09SMG$DELETE_PASTEBOARD,`09`09`09!Delete an SMG$ pasteboard
X`09SMG$DELETE_VIRTUAL_DISPLAY,`09`09!Delete an SMG$ virtual display
X`09SMG$DELETE_VIRTUAL_KEYBOARD,`09`09!Delete an SMG$ keyboard
X`09SMG$ERASE_CHARS,`09`09`09!Erase characters from display
X`09SMG$PASTE_VIRTUAL_DISPLAY,`09`09!Paste a virtual display
X`09SMG$PUT_CHARS,`09`09`09`09!Write characters to a display
X`09SMG$PUT_LINE,`09`09`09`09!Write a line to a display
X`09SMG$READ_KEYSTROKE,`09`09`09!Read a key from the keyboard
X`09SMG$UNPASTE_VIRTUAL_DISPLAY;`09`09!Unpaste a virtual display
X
XLITERAL
X`09txt$c_bufsiz`09= 256,
X`09true`09`09= 1,
X`09false`09`09= 0;
X
XMACRO
X`09$STATICDESC (len, addr) =`09!Static descriptor declaration
X`09`09$BBLOCK`5BDSC$C_S_BLN`5D
X`09`09PRESET`09(`5BDSC$W_LENGTH`5D = len,
X`09`09`09 `5BDSC$B_DTYPE`5D`09= DSC$K_DTYPE_T,
X`09`09`09 `5BDSC$B_CLASS`5D`09= DSC$K_CLASS_S,
X`09`09`09 `5BDSC$A_POINTER`5D= addr)
X`09%;
X
X`0C
X%SBTTL`09'HG$PUT_OUTPUT'
XGLOBAL ROUTINE hg$put_output (string_a) =
XBEGIN
X!+
X!
X!  Routine:`09PUT_OUTPUT
X!
X!  Functional Description:
X!
X!`09This routine is called to write a line to SYS$OUTPUT.  It keeps
X!`09track of how many lines have been displayed and prompts the user
X!`09to press `5BRETURN`5D if a full-screen is displayed.
X!
X!`09For terminals, SMG$ is used to manage the screen.  If SYS$OUTPUT
X!`09is not a terminal (i.e., a file), LIB$PUT_OUTPUT is used and no
X!`09checks on the line count are made.
X!
X!  Environment:
X!
X!`09User mode.
X!
X!  Formal parameters:
X!
X!`09string_a`09- Address of string descriptor for output string
X!
X!  Implicit inputs:
X!
X!`09fao_out, line, module_header, header_buff
X!
X!  Outputs:
X!
X!`09None.
X!
X!  Returns:
X!
X!`09R0`09- Status
X!
X!-
XBIND
X`09string`09`09= .string_a`09: $BBLOCK;
X
XBIND
X`09sys$output`09= %ASCID'SYS$OUTPUT',
X`09key_prompt`09= %ASCID'Press RETURN to continue, CTRL-Z to exit';
X
XOWN
X`09vd1,`09`09`09`09`09!Main text virtual display
X`09vd2,`09`09`09`09`09!"Press RETURN...." display
X`09pb,`09`09`09`09`09!The pasteboard
X`09kb,`09`09`09`09`09!The keyboard
X`09rows,`09`09`09`09`09!The number of rows in pb
X`09columns,`09`09`09`09!The number of columns in pb
X`09key_prompt_col,`09`09`09`09!The column number for prompt
X`09terminal,`09`09`09`09!Terminal flag (true/false)
X`09line_count,`09`09`09`09!Number of lines printed
X`09exit_status,`09`09`09`09!Exit status for exit handler
X`09iosb`09`09: $BBLOCK`5B8`5D,`09`09!I/O status block
X`09exh_block`09: VECTOR`5B8,LONG`5D
X`09`09INITIAL (0, hg$put_outexh, 5, exit_status, vd1, vd2, pb, kb);
X
XREGISTER
X`09status;`09`09`09`09`09!The status
X
X  !
X  !  The first time this routine is called, call $GETDVI to see if
X  !  SYS$OUTPUT is a terminal or not.  If it is, then make the appropriate
X  !  SMG$ calls to set up the pasteboard and the virtual displays.
X  !
X  IF (.rows EQLU 0)
X  THEN
X     BEGIN
X     status = SMG$CREATE_PASTEBOARD (pb, sys$output, rows, columns,
X`09`09`090, terminal);
X
X     terminal = (IF (.terminal EQLU SMG$K_VTTERMTABLE)`09!Is it a terminal?
X`09`09 THEN`09`09`09`09`09!Set flag to true or
X`09`09    true`09`09`09`09!... false for fast
X`09`09 ELSE`09`09`09`09`09!... checking later on
X`09`09    false);`09`09`09`09!...
X     IF .terminal`09`09`09`09`09!If terminal, then get
X     THEN`09`09`09`09`09`09!... the page size
X`09IF (.rows GTRU 4)`09`09`09!If there are at least 4 rows
X`09THEN`09`09`09`09`09!... on the screen, then use
X`09   BEGIN`09`09`09`09!... SMG for the output
X`09   rows = .rows - 2;`09`09`09!Leave two lines for the prompt
X`09   status = SMG$CREATE_VIRTUAL_DISPLAY (rows, columns, vd1);
X`09   rows = .rows - 1;`09!Display last line at top after scroll
X`09   status = SMG$CREATE_VIRTUAL_DISPLAY (%REF(1), columns, vd2);
X`09   status = SMG$PASTE_VIRTUAL_DISPLAY (vd1, pb, %REF(1), %REF(1));
X`09   status = SMG$PASTE_VIRTUAL_DISPLAY (vd2, pb, %REF(.rows+3), %REF(1));
X`09   status = SMG$CREATE_VIRTUAL_KEYBOARD (kb);
X`09   key_prompt_col = (.columns-.key_prompt<0,16,0>) / 2;
X`09   status = $DCLEXH (DESBLK = exh_block);
X`09   END
X`09ELSE
X`09   terminal = false;`09`09`09`09!Set no terminal
X
X     IF NOT(.terminal)`09`09`09`09`09!If it's not a terminal,
X     THEN`09`09`09`09`09`09!... delete the SMG$
X`09status = SMG$DELETE_PASTEBOARD (pb, %REF(0));`09!... pasteboard
X
X     line_count = 0;`09`09`09`09`09!Initialize the count
X     END;
X
X  !
X  !  Now we're ready to write the string to SYS$OUTPUT.
X  !
X  !  If SYS$OUTPUT is a terminal, add a <LF><CR> pair to the string and
X  !  write it using $QIOW.  If we hit the maximum number of lines to display
V,
X  !  then prompt the user to press a key before returning.
X  !
X  !  If SYS$OUTPUT is *not* a terminal, just use LIB$PUT_OUTPUT.
X  !
X  IF .terminal
X  THEN
X     BEGIN
X     status = SMG$PUT_LINE (vd1, string);`09`09!Write string to vd1
X     line_count = .line_count + 1;`09`09`09!Bump number of lines
X     !
X     !  If the number of lines written is equal to the page length - 2,
X     !  then prompt the user to press a key before continuing....
X     !
X     IF (.line_count EQLU .rows)
X     THEN
X`09BEGIN
X`09LOCAL`09key_pressed;
X`09status = SMG$PUT_CHARS (vd2, key_prompt, %REF(1),
X`09`09`09`09key_prompt_col,0,
X`09`09`09`09UPLIT(SMG$M_REVERSE));
X`09status = SMG$READ_KEYSTROKE (kb, key_pressed);
X`09status = SMG$ERASE_CHARS (vd2, %REF(.key_prompt<0,16,0>), %REF(1),
X`09`09`09`09   key_prompt_col);
X`09!
X`09!  Exit the program (via $EXIT) if any key other than RETURN or
X`09!  SPACE was typed (SPACE is accepted for "more" compatibility).
X`09!
X`09IF ((.key_pressed<0,16,0> NEQU SMG$K_TRM_CR) AND
X`09    (.key_pressed<0,16,0> NEQU SMG$K_TRM_SPACE))
X`09THEN
X`09   $EXIT (CODE = SS$_NORMAL);
X`09line_count = 0;`09`09`09`09`09!And reset line counter
X`09END;
X     END
X  ELSE`09`09`09`09`09`09`09!Not a terminal, so
X     LIB$PUT_OUTPUT (string);`09`09`09`09!... just use LIB$ rtn
X
X
X  RETURN (SS$_NORMAL);`09`09`09`09`09!Always return success
X
XEND;
X
X`0C
XROUTINE hg$put_outexh (estatus_a, vd1_a, vd2_a, pb_a, kb_a) =
XBEGIN
X!++
X!
X!  Routine:`09HG$PUT_OUTEXH
X!
X!  Abstract:
X!
X!`09This routine is established as an exit handler to delete the
X!`09pasteboard and the keyboard.  The virtual displays are not deleted,
X!`09though, because the screen is cleared if they are.
X!
X!--
XBIND
X`09estatus`09= .estatus_a,
X`09vd1`09= .vd1_a,
X`09vd2`09= .vd2_a,
X`09pb`09= .pb_a,
X`09kb`09= .kb_a;
X
XREGISTER
X`09status;
X
X  !
X  !If the virtual displays are deleted, the text disappears---just let
X  !the image rundown free up the memory.....
X  !
X!  status = SMG$DELETE_VIRTUAL_DISPLAY (vd1);
X!  status = SMG$DELETE_VIRTUAL_DISPLAY (vd2);
X  status = SMG$DELETE_VIRTUAL_KEYBOARD (kb);
X  RETURN (SMG$DELETE_PASTEBOARD (pb, %REF(0)));
X
XEND;
X
XEND
XELUDOM
$ CALL UNPACK [.NOTICE]HG$PUT_OUTPUT.B32;1 1394796366
$ create 'f'
X`09.TITLE  HG$PUT_OUTPUT HG$PUT_OUTPUT
X`09.IDENT  \01-000\
X`09.PSECT  $PLIT$,NOWRT,NOEXE,2
XP.AAB:`09.ASCII  \SYS$OUTPUT\<0><0>
XP.AAA:`09.LONG   17694730
X`09.ADDRESS P.AAB
XP.AAD:`09.ASCII  \Press RETURN to continue, CTRL-Z to exit\
XP.AAC:`09.LONG   17694760
X`09.ADDRESS P.AAD
XP.AAE:`09.LONG   2
X`09.PSECT  $OWN$,NOEXE,2
XU.6:`09.BLKB   4
XU.7:`09.BLKB   4
XU.8:`09.BLKB   4
XU.9:`09.BLKB   4
XU.10:`09.BLKB   4
XU.11:`09.BLKB   4
XU.12:`09.BLKB   4
XU.13:`09.BLKB   4
XU.14:`09.BLKB   4
XU.15:`09.BLKB   4
XU.16:`09.BLKB   8
XU.17:`09.LONG   0
X`09.ADDRESS U.2
X`09.LONG   5
X`09.ADDRESS U.15, U.6, U.7, U.8, U.9
XU.4=`09`09    P.AAA
XU.5=`09`09    P.AAC
X`09.EXTRN  LIB$PUT_OUTPUT, SMG$CREATE_PASTEBOARD, SMG$CREATE_VIRTUAL_DISPLAY
V, SMG$CREATE_VIRTUAL_KEYBOARD
X`09.EXTRN  SMG$DELETE_PASTEBOARD, SMG$DELETE_VIRTUAL_DISPLAY, SMG$DELETE_VIR
VTUAL_KEYBOARD, SMG$ERASE_CHARS
X`09.EXTRN  SMG$PASTE_VIRTUAL_DISPLAY, SMG$PUT_CHARS, SMG$PUT_LINE, SMG$READ_
VKEYSTROKE, SMG$UNPASTE_VIRTUAL_DISPLAY
X`09.EXTRN  SYS$DCLEXH, SYS$EXIT
X`09.PSECT  $CODE$,NOWRT,2
XU.1:
X`09.ENTRY  HG$PUT_OUTPUT, `5EM<R2,R3,R4,R5>
X`09MOVAB   G`5ESMG$PASTE_VIRTUAL_DISPLAY, R5
X`09MOVAB   G`5ESMG$CREATE_VIRTUAL_DISPLAY, R4
X`09MOVAB   W`5EU.5, R3
X`09MOVAB   W`5EU.10, R2
X`09SUBL2   #12, SP
X`09TSTL    (R2)
X`09BEQL    1$
X`09BRW     8$
X1$:`09PUSHAB  12(R2)
X`09CLRL    -(SP)
X`09PUSHAB  4(R2)
X`09PUSHL   R2
X`09PUSHAB  -48(R3)
X`09PUSHAB  -8(R2)
X`09CALLS   #6, G`5ESMG$CREATE_PASTEBOARD
X`09CMPL    12(R2), #6
X`09BNEQ    2$
X`09MOVL    #1, R1
X`09BRB     3$
X2$:`09CLRL    R1
X3$:`09MOVL    R1, 12(R2)
X`09BLBC    12(R2), 6$
X`09CMPL    (R2), #4
X`09BLEQU   4$
X`09SUBL2   #2, (R2)
X`09PUSHAB  -16(R2)
X`09PUSHAB  4(R2)
X`09PUSHL   R2
X`09CALLS   #3, (R4)
X`09DECL    (R2)
X`09PUSHAB  -12(R2)
X`09PUSHAB  4(R2)
X`09MOVL    #1, 12(SP)
X`09PUSHAB  12(SP)
X`09CALLS   #3, (R4)
X`09MOVL    #1, 4(SP)
X`09PUSHAB  4(SP)
X`09MOVL    #1, 4(SP)
X`09PUSHAB  4(SP)
X`09PUSHAB  -8(R2)
X`09PUSHAB  -16(R2)
X`09CALLS   #4, (R5)
X`09MOVL    #1, 4(SP)
X`09PUSHAB  4(SP)
X`09ADDL3   #3, (R2), 4(SP)
X`09PUSHAB  4(SP)
X`09PUSHAB  -8(R2)
X`09PUSHAB  -12(R2)
X`09CALLS   #4, (R5)
X`09PUSHAB  -4(R2)
X`09CALLS   #1, -
X`09`09G`5ESMG$CREATE_VIRTUAL_KEYBOARD
X`09MOVZWL  (R3), R1
X`09SUBL3   R1, 4(R2), R1
X`09DIVL3   #2, R1, 8(R2)
X`09PUSHAB  32(R2)
X`09CALLS   #1, G`5ESYS$DCLEXH
X`09BRB     5$
X4$:`09CLRL    12(R2)
X5$:`09BLBS    12(R2), 7$
X6$:`09CLRL    4(SP)
X`09PUSHAB  4(SP)
X`09PUSHAB  -8(R2)
X`09CALLS   #2, G`5ESMG$DELETE_PASTEBOARD
X7$:`09CLRL    16(R2)
X8$:`09BLBC    12(R2), 10$
X`09PUSHL   4(AP)
X`09PUSHAB  -16(R2)
X`09CALLS   #2, G`5ESMG$PUT_LINE
X`09INCL    16(R2)
X`09CMPL    16(R2), (R2)
X`09BNEQ    11$
X`09PUSHAB  8(R3)
X`09CLRL    -(SP)
X`09PUSHAB  8(R2)
X`09MOVL    #1, 16(SP)
X`09PUSHAB  16(SP)
X`09PUSHL   R3
X`09PUSHAB  -12(R2)
X`09CALLS   #6, G`5ESMG$PUT_CHARS
X`09PUSHAB  8(SP)
X`09PUSHAB  -4(R2)
X`09CALLS   #2, G`5ESMG$READ_KEYSTROKE
X`09PUSHAB  8(R2)
X`09MOVL    #1, 8(SP)
X`09PUSHAB  8(SP)
X`09MOVZWL  (R3), 8(SP)
X`09PUSHAB  8(SP)
X`09PUSHAB  -12(R2)
X`09CALLS   #4, G`5ESMG$ERASE_CHARS
X`09CMPW    8(SP), #13
X`09BEQL    9$
X`09CMPW    8(SP), #32
X`09BEQL    9$
X`09PUSHL   #1
X`09CALLS   #1, G`5ESYS$EXIT
X9$:`09CLRL    16(R2)
X`09BRB     11$
X10$:`09PUSHL   4(AP)
X`09CALLS   #1, G`5ELIB$PUT_OUTPUT
X11$:`09MOVL    #1, R0
X`09RET
XU.2:`09.WORD   `5EM<>
X`09SUBL2   #4, SP
X`09PUSHL   20(AP)
X`09CALLS   #1, -
X`09`09G`5ESMG$DELETE_VIRTUAL_KEYBOARD
X`09CLRL    (SP)
X`09PUSHL   SP
X`09PUSHL   16(AP)
X`09CALLS   #2, G`5ESMG$DELETE_PASTEBOARD
X`09RET
X`09.END
$ GOTO PART3
