From:	ADVAX::"FILESERV@Dayton.SAIC.COM"  5-APR-1991 07:06:33.63
To:	ARISIA::EVERHART
CC:	
Subj:	NEWS_V60-3_PATCH.19

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Fri, 5 Apr 91 07:03:23 EST
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA24956 for ; Fri, 5 Apr 91 06:34:05 -0500
From: FILESERV-Mgr@Dayton.SAIC.COM
Received: from dayvc.dayton.saic.com by mcnc.mcnc.org (5.59/MCNC/3-21-91)
	id AA02679; Thu, 4 Apr 91 18:26:22 -0500
	for ARISIA.dnet.ge.com!EVERHART
Message-Id: <9104042326.AA02679@mcnc.mcnc.org>
Received: by Dayton.SAIC.COM (MX V2.2-2) id 4819; Thu, 04 Apr 1991 18:25:48 EST
Date: Thu, 04 Apr 1991 18:25:48 EST
Reply-To: FILESERV@Dayton.SAIC.COM
Subject: NEWS_V60-3_PATCH.19
To: ARISIA::EVERHART
 
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On 20-MAR-1991 18:41:18.51   By user AKE (Earle Ake - SAIC (513) 429-6500)
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$!+ THIS PACKAGE DISTRIBUTED IN 3 PARTS, TO KEEP EACH PART
$!  BELOW 30 BLOCKS
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. NEWSMENU.C;3
$!       2. NEWSMENU.H;1
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
X/*
X**++
X**  FACILITY:
X**`09NEWSMENU.C
X**
X**  ABSTRACT:
X**`09This module contains the code and data needed to run the menus system.
X**
X**  AUTHOR:
X**`09Geoffrey Weatherall
X**      University of Waikato
X**      Hamilton
X**      NEW ZEALAND
X**
X**  COPYRIGHT:
X**`09Copyright ) 1991, with the same conditions as for the rest of the
X**                        NEWS system.
X**
X**  MODIFICATION HISTORY:
X**  Version History:
X**  V6.0 4 Jan 1991 initial
X**--
X**/
X
X#module NEWSMENU "V6.0"
X#include "newsinclude.h"
X#include "newsdefine.h"
X
X#include "newsvariables.h"
X
X
X#define menu_escape_pressed "--escape pressed-- ."
X/* the definitions below are returned by run_menu to get_menu_input when a
X   special condition occurs - such as user abort or display scrolling at
X   level 3 (news_context).`20
X */
X#define escape_option -2
X#define level_3_up -3
X#define level_3_down -4
X#define level_3_page_up -5
X#define level_3_page_down -6
X/***************************************************************************
V******
X *
X * Constants
X *
X * MAX_TEXT - the max number of characters in a menu option
X * MAX_COMMAND - the max number of characters in a command
X * MAX_ITEMS - the maximum number of option/items in a menu ie 7 1 2
X * MAX_MENUS - the maximum number of menus
X * KEY_RIGHT_ARROW - key to move menu highlighter right
X * KEY_LEFT_ARROW - key to move menu highlighter left
X * KEY_RETURN - key that selects option highlighter is on
X * KEY_ABORT - key that aborts menu
X * KEY_HELP - help that gets help
X * KEY_PAGE_UP - key that pages display up
X * KEY_PAGE_DOWN - key that pages display down
X * KEY_UP_ARROW - key that move display up one line
X * KEY_DOWN_ARROW - key that moves display down one line
X *
X ***************************************************************************
V***/
X
X#define MAX_TEXT 20  `20
X#define MAX_COMMAND 40
X#define MAX_ITEMS 9
X#define MAX_MENUS 30
X#define KEY_RIGHT_ARROW SMG$K_TRM_RIGHT`20
X#define KEY_LEFT_ARROW SMG$K_TRM_LEFT
X#define KEY_RETURN SMG$K_TRM_CR
X#define KEY_ABORT SMG$K_TRM_F11
X#define KEY_HELP SMG$K_TRM_HELP
X#define KEY_PAGE_UP SMG$K_TRM_PREV_SCREEN
X#define KEY_PAGE_DOWN SMG$K_TRM_NEXT_SCREEN
X#define KEY_UP_ARROW SMG$K_TRM_UP
X#define KEY_DOWN_ARROW SMG$K_TRM_DOWN
X`0C
X
X
Xint my_pb;  /* the display used my the menu */
Xint menu_rows = 2; /* number of rows in the display */
X
X/*`20
X * The user may wish to scroll and item up and down while reading it after
X * having started a menu.  In order to scroll an item and keep the menu
X * active the menu must temporarily return control to the code in the
X * module "NEWSDISPLAY", and after "NEWSDISPLAY" has scrolled the item
X * the menu must restart.  The paragraph below describes how this is done.
X *
X * First the current menu and the option within the menu are stored in`20
X * saved_menu and saved option.  Then the pasteboard batching level is`20
X * restored.  The the "auto_restart" flag is set true.  Then the command
X * which will cause the scrolling is returned to "NEWSDISPLAY" which does
X * the scrolling.  Then instead of the next command being read in the menu
X * is restarted and the current menu and option are restore, and the`20
X * "auto_restart" flag is cleared.
X */
Xint saved_option, saved_menu;
Xint auto_restart = 0;
X
Xtypedef struct `7B
X                char text_of_option`5B MAX_TEXT `5D; /* text of an option */
V `20
X                int  start_possition;            /* not user setable */
X                unsigned  quick_key_value;       /* ascii of quick key */
X                int  quick_key_possition;        /* offset in text */
X                char resultant_command`5B MAX_COMMAND `5D;/* option's comman
Vd */
X                int  next_menu;                  /* option's submenu */
X                char assistance_text`5B80`5D;        /* help the user */
X               `7D MENU_ITEM;
X
Xtypedef struct `7B
X                int       number_of_options;    /* options in this menu */
X                MENU_ITEM option`5B MAX_ITEMS `5D;  /* array of options */
X               `7D A_MENU;
X`0C
X
X
X      /* over the next few pages all the menus are stored in an array */
X
XA_MENU menu`5B MAX_MENUS `5D =`7B /* menus are numbered 0 .. MAX_MENU-1 */
X/*`20
X Text      Leave    Quick-Key Quick-Offset  Command Text   Next Menu
X----------------------------------------------------------------------------
V--*/
X
X`7B /* first menu at newsgroup level        MENU 0 */
X`7B 8 `7D,`7B
X "New"      , 0 , 'n'     ,   0 ,           "READ/NEW" ,       -1 ,
X           "Read the next unread item, beginning in the newsgroup pointed to
V" ,
X "Items"      , 0 , 'i'     , 0 ,           "DIR/ITEMS" ,         -1 ,
X           "See the list of items in the newsgroup pointed to" ,
X "Dir"      , 0 , 'd'     ,   0 ,           "" ,                3 ,
X           "Select the type of directory to be shown `7B`7D" ,
X "enRolment",0 , 'r'     ,   2,           "" ,                 4 ,
X           "Join or leave the newsgroup pointed to `7B`7D" ,
X "Post"      , 0 , 'p'     , 0 ,           "POST" ,            -1 ,
X           "Add a item to the newgroup pointed to" ,
X "preVious"      , 0 , 'v'     , 3 ,       "READ/PREVIOUS" ,   -1 ,
X           "Re-read the last item read" ,
X "Exit"      , 0 , 'e'     , 0 ,           "EXIT" ,            -1 ,
X           "Finishing using NEWS" ,
X "Other"      , 0 , 'o'     , 0 ,           "" ,                6 ,
X           "Various other commands `7B`7D"`20
X       `7D`20
X`7D, /* end - first menu at newsgroup level */
X`0C
X
X
X`7B  /* first menu when at level 2 ie item list       MENU 1 */
X`7B  8  `7D,`7B
X"New"      , 0 , 'n'     ,  0 ,           "READ/NEW" ,                -1 ,
X           "Read the next unread item below the pointer",`20
X"Read"      , 0 , 'r'     , 0 ,           "" ,                        7 ,
X           "Select a reading command `7B`7D",`20
X"Stream"    , 0  , 's'    , 0  ,          "" ,                15 ,
X           "Follow the current conversation stream forwards or backwards `7B
V`7D",
X"Add"      , 0 , 'a'     ,  0 ,           "" ,                9 ,
X           "Add a item to the current newsgroup `7B`7D",`20
X"sKip"      , 0 , 'k'     , 1 ,           "" ,                10 ,
X           "Skip some items `7B`7D",`20
X"Newsgroups"      , 0 , 'g'     , 4 ,           "NEWSGROUPS" ,  -1 ,
X           "See the list of newsgroups",
X"Exit"      , 0 , 'e'     , 0 ,           "EXIT" ,                -1 ,
X           "Finish using NEWS",`20
X"Other"      , 0 , 'o'     , 0 ,           "" ,                11 ,
X           "Select other commands such as edit a file or quit `7B`7D",`20
X       `7D
X`7D,  /* first menu at level two     */`20
X`0C
X
X
X`7B  /* first menu when at level three, ie reading an item     MENU 2 */
X`7B 9 `7D,`7B
X"New"      , 0 , 'n'     , 0 ,           "READ/NEW" ,                -1 ,
X           "Read the next unread item",`20
X"neXt"      , 0 , 'x'     , 2 ,           "READ/NEXT" ,                -1 ,
X           "Skip the rest of this item and begin reading the next",`20
X"Move"      , 0 , 'm'     , 0 ,           ""               , 14 ,
X           "Move around in the current item `7B`7D",
X"Read"      , 0 , 'r'     , 0 ,           "" ,                13 ,
X           "Select a type of read `7B`7D",`20
X"Stream"    , 0  , 's'    , 0  ,          "" ,                15 ,
X           "Follow the current conversation stream forwards or backwards `7B
V`7D",
X"Add"      , 0 , 'a'     , 0 ,           "" ,                9 ,
X           "Add a item to the current newsgroup `7B`7D",`20
X"Items"      , 0 , 'i'     , 0 ,           "DIR/ITEMS" ,          -1 ,
X           "See the list of items in this newsgroup",`20
X"newsGroups"      , 0 , 'g'     , 4 ,           "NEWSGROUPS" ,
V                -1 ,
X           "See the list of newsgroups",`20
X"Other"      , 0 , 'o'     , 0 ,           "" ,                16 ,
X           "Select a command not listed here `7B`7D"
X       `7D
X`7D,  /* first menu at level three    */`20
X`0C
X
X
X`7B  /* directory type     MENU 3 */
X`7B 3 `7D,`7B
X"Registered"      , 0 , 'r'     , 0 ,           "DIR/REGISTERED" , -1 ,
X           "Show a directory of only the newsgroups you are registered in",`
V20
X"New"      , 0 , 'n'     , 0 ,           "DIR/NEW" ,                -1 ,
X           "Show a directory of your registered newsgroups that have unread
V items",`20
X"All"      , 0 , 'a'     , 0 ,           "DIR/ALL" ,                -1 ,
X           "Show a directory of all newsgroups"
X       `7D
X`7D,  /*  directory type   */`20
X`0C
X
X
X`7B  /* enrolment action - register/deregister MENU 4 */
X`7B 2 `7D,`7B
X"Register"      , 0 , 'r'     , 0 ,           "REGISTER" ,  -1 ,
X           "Register in the current newsgroup",`20
X"Deregister"      , 0 , 'd'     , 0 ,           "DEREGISTER" ,  -1 ,
X           "Deregister from the current newsgroup"
X       `7D
X`7D,  /* enrolment action    */`20
X`0C
X
X
X`7B  /* what to clear - marks `7C`7C kill   MENU 5 */
X`7B 2 `7D,`7B
X"Marks"      , 0 , 'm'     , 0 ,           "DELETE MARKER" , -1 ,
X           "Remove all marks",`20
X"Filters"      , 0 , 'f'     , 0 ,           "CLEAR KILL" , -1 ,
X           "Remove all filters skipping subjects and senders "
X       `7D
X`7D,  /*  what to clear   */`20
X`0C
X
X
X`7B  /* other commands from level 1  MENU 6 */
X`7B 5 `7D,`7B
X"Quit"      , 0 , 'q'     , 0 ,           "QUIT" ,                -1 ,
X           "Finish using NEWS and do not keep a record of items read",`20
X"sHell"         , 0  , 'h'    , 1 ,           ""        , 17   ,
X           "Temporarily return to $ prompt or edit a file `7B`7D",
X"Noscreen"      , 0 , 'n'     , 0 ,           "NOSCREEN" ,        -1 ,
X           "Switch to scrolling screen mode; use SCREEN to return to current
V mode",
X"Clear"      , 0 , 'c'     , 0 ,           "" ,                5 ,
X           "Clear kill filters or marks `7B`7D" ,
X"See"      , 0 ,  's'     , 0 ,           ""              ,  18 ,
X           "See skip filters and marks `7B`7D",
X       `7D
X`7D,  /** other commands from level 1     */`20
X`0C
X
X
X`7B  /* read options for level 2  MENU 7 */
X`7B 8 `7D,`7B
X"Header"      , 0 , 'h'     , 0 ,           "READ/HEADER" ,       -1,
X           "See the header of the item pointed to",`20
X"Previous"      , 0 , 'p'     , 0 ,           "READ/PREVIOUS" ,   -1 ,
X           "See the last messages read",
X"Editor"      , 0 , 'e'     , 0 ,           "READ/EDITOR" ,       -1 ,
X           "Place the item pointed to in an editor (so FIND etc can be used)
V",`20
X"Newest"      , 0 , 'n'     , 0 ,           "READ *" ,                -1 ,
X           "Read the newest item in this newsgroup",`20
X"Last"      , 0 , 'l'     , 0 ,           "READ/LAST" ,                -1 ,
X           "Read the item listed before the pointer",`20
X"Marked"      , 0 , 'm'     , 0 ,           "READ/MARKER" ,                -
V1 ,
X           "Read the next marked item",`20
X"Decrypted"      , 0 , 'd'     , 0 ,           "READ/ROT13" ,      -1 ,
X           "Use the ROT13 method to decrypt the item pointed to",`20
X"Unread"      , 0 , 'u'     , 0 ,           "UNREAD" ,                -1 ,
X           "Remove the record of having read the item pointed to"`20
X
X       `7D
X`7D,  /* * read options for level 2    */`20
X`0C
X
X
X`7B  /* export options for level 2  MENU 8 */
X`7B 2 `7D,`7B
X"Print"      , 0 , 'p'     , 0 ,           "PRINT/NOWAIT" ,  -1 ,
X           "Print the current item on the system printers",`20
X"Extract"      , 0 , 'e'     , 0 ,           "EXTRACT" ,     -1 ,
X           "Copies the current item into a file"
X       `7D
+-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
