R From:	HENRY::IN%"info-vax-relay%kl.sri.COM%relay.cs.net@RCA.COM"  4-MAY-1987 07:59 To:	Info-Vax@kl.sri.com  Subj:	Info-Vax Digest   V0 #7     F Info-Vax Digest           Sunday, 3 May 1987        Volume 0 : Issue 7   Today's Topics:    Mail/DECNET interface "   Re: redirection of stdio, et al.   Re: cbreak"   Submission for mod-computers-vax'   Re: How do you ring bell in DCL file? ,   Re: Accessing global variable from FORTRANC   Re: How do you NOT write a <RETURN>? (was:ring bell in DCL file)?    RE: vi written in TPU !   Terminal capture program wanted    VMS pseudo terminal set upF ----------------------------------------------------------------------   Date: Fri, 1 May 87 10:50 CST @ From: SLOANE%UKANVAX.BITNET%wiscvm.wisc.EDU%relay.cs.net@RCA.COM Subject: Mail/DECNET interface  C In reply to Dave Stevens' question about the mail/decnet interface, E there was an article about that very topic in VAX Professional in the E August 1986 issue.  It includes a BASIC program to send mail messages G through DECNET.  Following is a translation of that program to C. Sorry H there are no comments, but the program was written just to play with theG interface, and was never intended to see the light of day.  The program 4 in the article is well documented.  Hope this helps.                      Bob Sloane '                    University of Kansas %                    Computing Services !                    (913) 864-4291 +                    SLOANE@UKANVAX on BITNET N ============================================================================== #include <ssdef.h> #include <stdio.h>   main() {          char    *to_list[10];          char    *text[100];          int     status;            to_list[0] = "SLOANE";         to_list[1] = NULL;  ,         text[0] = "This is a mail message.";/         text[1] = "It contains several lines."; *         text[2] = "This is the last line";         text[3] = NULL;   M         status = decmail( "KUHUB", "One Who Knows", to_list, "One Who Asked", G                                 "Why would I want to do this?", text );            exit( status );  }       /*  main  */   #include <descrip.h> #include <iodef.h> #include <ssdef.h> #include <stdio.h> #include <stsdef.h>   . #define EXIT_IF( cond, sts )    if( cond ) { \B                                         sys$dassgn( mail_chan ); \8                                         return( sts ); \!                                 }    struct iosb_s {          short   io_sts;          short   io_count;          long    io_devinfo;  };   int     mail_chan; int     link_err;  int     errsts;  int     receivers;  ; decmail( node, from_name, to_list, to_show, subject, text )          char    *node;         char    *from_name;          char    **to_list;         char    *to_show;          char    *subject;          char    **text;  { 3         char    node_name[64], object_name[64], *p; 0         int     status, i, to_count, save_count;  "         strcpy( node_name, node );4         if( (p = strchr( node_name, ':' )) != NULL )                 *p = '\0';  9         sprintf( object_name, "%s::\"27=\"", node_name ); G         status = sys$assign( ldescrip(object_name), &mail_chan, 0, 0 );          if( (status & 1) == 0 ) !                 return( status );   &         status = put_msg( from_name );-         EXIT_IF( (status & 1) == 0, status );   /         for( i = 0; to_list[i] != NULL; ++i ) { /                 status = put_msg( to_list[i] ); 5                 EXIT_IF( (status & 1) == 0, status );                  errchk(); 9                 EXIT_IF( (link_err & 1) == 0, link_err ); 5                 EXIT_IF( (errsts & 1) == 0, errsts ); 	         }          to_count = i;   !         status = put_msg( NULL ); -         EXIT_IF( (status & 1) == 0, status );            if( receivers == 0 ) {0                 printf( "No messages sent.\n" );(                 sys$dassgn( mail_chan );%                 return( SS$_NORMAL ); 	         }   $         status = put_msg( to_show );-         EXIT_IF( (status & 1) == 0, status );   $         status = put_msg( subject );-         EXIT_IF( (status & 1) == 0, status );   ,         for( i = 0; text[i] != NULL; ++i ) {,                 status = put_msg( text[i] );5                 EXIT_IF( (status & 1) == 0, status ); 	         }   !         status = put_msg( NULL ); -         EXIT_IF( (status & 1) == 0, status );            save_count = receivers;   +         for( i = 0; i < save_count; ++i ) {                  errchk(); 9                 EXIT_IF( (link_err & 1) == 0, link_err ); 	         }   4         printf( "%d messages sent.\n", save_count );            sys$dassgn( mail_chan );           return( SS$_NORMAL );  }       /*  decmail  */                    errchk() {          char    msg[256];          int     mail_sts;   #         get_msg( msg, sizeof msg );          mail_sts = msg[0];#         if( (link_err & 1) == 0 ) { "                 errsts = link_err;                 return; 	         } #         if( (mail_sts & 1) == 1 ) {                  ++receivers;"                 errsts = mail_sts;                 return; 	         }            for(;;) { +                 get_msg( msg, sizeof msg ); +                 if( (link_err & 1) == 0 ) { *                         errsts = link_err;                         return;                  } (                 if( strlen(msg) != 1 ) {.                         printf( "%s\n", msg );!                         continue;                  } !                 if( msg[0] == 0 )                          return; 	         }    }       /*  errchk  */                   int  put_msg( msg )         char    *msg;  { $         static char     zero = '\0';         struct iosb_s   iosb;          int     status;            if( msg == NULL ) L                 status = sys$qiow( 0, mail_chan, IO$_WRITEVBLK, &iosb, 0, 0,?                                         &zero, 1, 0, 0, 0, 0 );          elseL                 status = sys$qiow( 0, mail_chan, IO$_WRITEVBLK, &iosb, 0, 0,G                                         msg, strlen(msg), 0, 0, 0, 0 );   "         if( status != SS$_NORMAL )!                 return( status );            return( iosb.io_sts ); }       /*  put_msg  */                    get_msg( msg, msg_siz )          char    *msg;          int     msg_siz; {          struct iosb_s   iosb;          int     status;   C         status = sys$qiow( 0, mail_chan, IO$_READVBLK, &iosb, 0, 0, ;                                 msg, msg_siz, 0, 0, 0, 0 );   $         if( status != SS$_NORMAL ) {"                 link_err = status;                 return; 	         } )         if( iosb.io_sts != SS$_NORMAL ) { '                 link_err = iosb.io_sts;                  return; 	         }   "         msg[iosb.io_count] = '\0';         link_err = SS$_NORMAL;   }       /*  get_msg  */    ------------------------------   Date: 30 Apr 87 17:17:35 GMTE From: mcvax!ukc!dcl-cs!sslvax!gdw%seismo.css.GOV%relay.cs.net@RCA.COM ) Subject: Re: redirection of stdio, et al.   R In article <224@unc.cs.unc.edu> mcguffey@unc.cs.unc.edu (Michael McGuffey) writes: > E >Does anyone know of any tools that allow command line redirection of H >stdio under VMS. Something similar to the way unix and msdos does it isF >preferable to some of the methods that have previously been proposed. >  >-mike mcguffey     J Simply redirect the logical SYS$OUTPUT to a file rather than the terminal, ie.       $ ASSIGN <FILE> SYS$OUTPUT       $ <commands>       $ DEASSIGN SYS$OUTPUT --N # Grenville Whelan  -  Software Sciences Ltd, Park Street, Macclesfield, UK  #N # (EMAIL gdw@uk.co.ssl-macc) (UUCP !mcvax!ukc!mcvax!gdw) (TEL +44 625 29241) #  D       "Are you the Police?"  "No ma'am, we're musicians!" -- Elwood.   ------------------------------   Date: 30 Apr 87 13:19:36 GMT> From: eagle!icdoc!iwm%ucbvax.Berkeley.EDU%relay.cs.net@RCA.COM Subject: Re: cbreak   _ In article <8704260033.AA24777@ucbvax.Berkeley.EDU> "*Hobbit*" <hobbit@aim.rutgers.edu> writes: > >I want to do single-character getchar()'s in C, but getchar()L >doesn't do genuine 1-char QIOs.  It seems to want char + <ret>.  Can cbreakJ >mode easily be simulated without replacing the getchar() call with a qio?  J Something that I have used is the Screen manager routines, they are ratherK higher level than QIO and are used by VMS curses although VMS curses doesntcO seem to simulate cbreak. If you are not using curses create a virtual keyboard:e unsigned kb;! SMG$CREATE_VIRTUAL_KEYBOARD(&kb);    then use read_keystrokea  
 short key; SMG$READ_KEYSTROKE(&kb,&key);a  K key is a short because function and arrow keys are  coded as numbers out ofcJ ascii range. I used this method to add arrow key support for the VMS RogueL that was posted a while back. Terminal independent  decoding of arrow keys !     --
 Ian W Moor"   UUCP: seismo!mcvax!ukc!icdoc!iwm   ARPA: iwm%icdoc@ucl:  O  Department of Computing   Whereat a great and far-off voice was heard, saying,iL  Imperial College.         Poop-poop-poopy, and it was even so; and the days@  180 Queensgate            of Poopy Panda were long in the land.  London SW7 Uk.g   ------------------------------   Date: 2 May 87 02:36:59 GMT < From: mcvax!uvabick!uucp%seismo.CSS.GOV%relay.cs.net@RCA.COM) Subject: Submission for mod-computers-vaxn  ) Path: uvabick!mcvax!ukc!dcl-cs!sslvax!gdwn- From: gdw%ssl-macc.co.UK%relay.cs.net@RCA.COMp* Newsgroups: mod.computers.vax,comp.sys.dec) Subject: Re: redirection of stdio, et al. & Message-ID: <627@sslvaxssl-macc.co.uk> Date: 30 Apr 87 17:17:35 GMT  References: <224@unc.cs.unc.edu>/ Reply-To: gdw@ssl-macc.co.uk (Grenville Whelan)=5 Organization: Software Sciences Ltd, Macclesfield, UK.	 Lines: 19e  R In article <224@unc.cs.unc.edu> mcguffey@unc.cs.unc.edu (Michael McGuffey) writes: > E >Does anyone know of any tools that allow command line redirection ofsH >stdio under VMS. Something similar to the way unix and msdos does it isF >preferable to some of the methods that have previously been proposed. >i >-mike mcguffeyt    J Simply redirect the logical SYS$OUTPUT to a file rather than the terminal, ie.       $ ASSIGN <FILE> SYS$OUTPUT       $ <commands>I      $ DEASSIGN SYS$OUTPUT --N # Grenville Whelan  -  Software Sciences Ltd, Park Street, Macclesfield, UK  #N # (EMAIL gdw@uk.co.ssl-macc) (UUCP !mcvax!ukc!mcvax!gdw) (TEL +44 625 29241) #  D       "Are you the Police?"  "No ma'am, we're musicians!" -- Elwood.   ------------------------------    Date: Fri, 1 May 87 23:31:49 PDT2 From: carl%CitHex.Caltech.EDU%relay.cs.net@RCA.COM. Subject: Re: How do you ring bell in DCL file?  H  > I would like to have the terminal bell rung from within a DCL commandF  > file.  Is there a way to specify control characters within a stringI  > used with a 'write sys$output' statement? Can the control character be J  > entered "raw" into the string or is there a character escape mechanism?  L  > I tried everything I could think of and didn't see anything in the orangeO  > wall of manuals. Right now I 'type' a file which has a single bell character 	  > in it.,  G For details of how to do this, type the command "$ HELP SYMBOL".  As an(L example, to create a symbol containing only a control-G (ASCII 7), you could use the following:1         $ BEL :=        !Make BEL a string symboll9         $ BEL[0,8] = 7  !Put an ASCII 7 in the first bytea   ------------------------------   Date: 1 May 87 16:19:44 GMTt: From: tedcrane%tcgould.tn.cornell.EDU%relay.cs.net@RCA.COM3 Subject: Re: Accessing global variable from FORTRAN   N In article <8704300556.AA02237@ucbvax.Berkeley.EDU> KND@DHDMPI5.BITNET writes: >TG >I would like to access a location in a MACRO Subroutine from a FORTRAN 6 >Main Program and don't want to use a COMMON for that.. >The location in MACRO is defined as follows : > ' >                LABEL:: .WORD   number  >tF >The %LOC function in FORTRAN gives me the ADDRESS of 'LABEL'. But how$ >can I get the contents of 'LABEL' ?  F It is most likely that you will have to write a subroutine or function to do this:;  &         subroutine MOVE_GLOBAL(IN,OUT)         integer*2 IN,OUT         OUT = IN         end    and call it:  ,         call MOVE_GLOBAL(%val(LABEL),RESULT)  4 (You can extrapolate the function call form of this)  D The interesting thing is that using VAX FORTRAN, the global variable@ need not be a simple tpye such as <word=integer*2>.  All that isL necessary is to declare the global variable appropriately in the subroutine/E function.  It could be an array or a structure.  You could return anyeK value at all, whether it is one array element, a field from a structure, or) something calculated.T   ------------------------------   Date: 1 May 87 21:24:09 GMTn- From: robert%arizona.EDU%relay.cs.net@RCA.COM C Subject: Re: How do you NOT write a <RETURN>? (was:ring bell in DCL           file)?   J In article <102@blic.BLI.COM>, garvey@blic.BLI.COM (Robert Garvey) writes: >l/ > This is an example of how that could be done: D >       $ clear == "WRITE SYS$OUTPUT esc_chr,""[H"",esc_chr,""[2J"""  G I have been using the above type of statements to do clear screens, but ? they really leave the cursor on the second row since there is a 8 <return> effectively at the end of the write sys$output.  > Is there someway around that?  (In Unix echo -n does the job.) -- Robert J. Drabek Department of Computer Science University of Arizona  Tucson, AZ  85721r   ------------------------------   Date: 1  May 87 16:23 -0800 S From: Ken Wallewein <kenw%noah.arc.cdn%ubc.csnet%RELAY.CS.NET%relay.cs.net@RCA.COM>  Subject: RE: vi written in TPU       ------------------------------   Date: 1 May 87 10:28:44 GMT 8 From: eagle!rde%ucbvax.Berkeley.EDU%relay.cs.net@RCA.COM( Subject: Terminal capture program wanted  H I am after a program to enable recording of a terminal session on VMS. IH saw  an  example  of one during an explanation of a different topic in a0 recent article, but couldn't contact the author.  A The program I saw was called PHOTO, and you typed something like:        $ PHOTO file	     $   .      $ 	     $   . (     $ ! either logout or PHOTO something  B and file would contain all the intermediate terminal transactions.   Any ideas please?0 --            Bob Eager            rde@ukc.UUCP             ...!mcvax!ukc!rde(            Phone: +44 227 66822 ext 7589   ------------------------------   Date: 30 Apr 87 21:45:50 GMTL From: trwrb!ucla-an!medivax!chinson%ucbvax.Berkeley.EDU%relay.cs.net@RCA.COM# Subject: VMS pseudo terminal set up   < I am trying to set ther pseudo-terminals characteristics for7 DECserver 100 tapped into DECnet.   The system calls it 9 LTA[0-7] but you can only set it when the line is active.i! Is there anyother way to set it ?e  
 Chinson Yi UCLA, Dept of Medicine   ------------------------------   End of Info-Vax Digest **********************