home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!think.com!ames!usenet
- From: miller@tgv.com (Vagrant)
- Subject: Re: More than 1 line of command history buffer
- Message-ID: <1992Dec30.182502.7201@news.arc.nasa.gov>
- Sender: usenet@news.arc.nasa.gov
- Reply-To: miller@tgv.com
- Organization: TGV Incorporated in Santa Cruz, CA
- References: <PRZEMEK.92Dec29235033@rrdstrad.nist.gov>
- Date: Wed, 30 Dec 1992 18:25:02 GMT
- Lines: 106
-
-
- In article <PRZEMEK.92Dec29235033@rrdstrad.nist.gov>, przemek@rrdstrad.nist.gov (Przemek Klosowski) writes:
-
- #I like to have the command line editing provided courtesy of VMS
- #system read procedure, and the fact that I can retrieve the previously
- #used command line using the up-arrow key; however, I am spoiled by the
- #DCL 20-line command history (and the readline library I am using on
- #Unix that remembers commands across login sessions). Is there a
- #simple way to increase the command history list size, so that more
- #than one last command is remembered?
-
- I usually use SMG in order to get a bigger command history. I don't
- believe you can expand the buffer that VAXCRTL uses. Here's some
- example code in C below. See the SMG manual for more info.
-
- -bruce
-
-
-
- #module TERM "V1.0"
- #pragma builtins
-
- #include ssdef
- #include descrip
- #include rmsdef
- #include smgmsg
-
- u_word TT_Channel;
-
- /* Special events concerning the terminal. */
- u_word TT_MBX_Chan;
- u_byte TT_MBX_Buffer[256];
- u_long TT_MBX_IOSB[2];
-
- static int Pasteboard_Id;
- static int Display_Id;
- static int KeyBoard_Id;
- static int Key_Table_Id;
- static int preserve_screen = 1; /* Don't clear screen on startup. */
-
-
- /*
- Description:
- Initialize the terminal related stuff (yeah, that's right. stuff.)
- */
-
- int IPNCP_SMG_Init()
- {
- u_long RC;
- $DESCRIPTOR(Input_Device,"SYS$COMMAND");
-
- RC = LIB$ASN_WTH_MBX (
- &Input_Device,
- &sizeof(TT_MBX_Buffer),
- &sizeof(TT_MBX_Buffer),
- &TT_Channel,
- &TT_MBX_Chan);
- if (ERROR(RC)) LIB$SIGNAL(RC);
-
- #ifdef NOTDEF
- RC = SMG$CREATE_PASTEBOARD (
- &Pasteboard_Id, /* We use this to get info about the display.*/
- 0, /* Output device. default is 'SYS$OUTPUT' */
- 0, /* height of the screen. */
- 0, /* width of the screen. */
- &preserve_screen /* Should we clear the screen? */
- );
- if (ERROR(RC)) LIB$SIGNAL(RC);
- #endif /* NOTDEF */
-
- RC = SMG$CREATE_VIRTUAL_KEYBOARD(&KeyBoard_Id);
- if (ERROR(RC)) LIB$SIGNAL(RC);
-
- RC = SMG$CREATE_KEY_TABLE(&Key_Table_Id);
- if (ERROR(RC)) LIB$SIGNAL(RC);
-
- return(SS$_NORMAL);
- }
-
- /*
- Functional Description:
-
- This routine is used to get input for cli$dcl_parse.
- The format of the arguements must be the same as
- LIB$GET_INPUT.
- */
-
- int IPNCP_Get_Input (Get_Str, Prompt_Str, Out_Len)
- struct dsc$descriptor_s *Get_Str, *Prompt_Str;
- int *Out_Len;
- {
- u_long RC;
-
- RC = SMG$READ_COMPOSED_LINE (
- &KeyBoard_Id,
- &Key_Table_Id,
- Get_Str,
- Prompt_Str,
- Out_Len);
- if (RC == SMG$_EOF) return(RMS$_EOF);
-
- if (ERROR(RC)) LIB$SIGNAL(RC);
-
- return(RC);
- }
-
-