Here are some useful patches to rn for A/UX

Herb Weiner herbw at wiskit.pdx.com
Fri Nov 30 12:51:00 AEST 1990


This is an UNOFFICIAL patch for rn 4.3.
Patches through patch 47 should be applied before applying this patch.
This patch is being emailed to Larry Wall (lwall at jpl-devvax.jpl.nasa.gov)
and is being posted to comp.unix.aux.
This patch was created by Herb Weiner (herbw at wiskit.pdx.com)
and is hereby placed into the public domain.
This patch is provided on an AS IS basis.  Use it at your own risk.

This patch contains two completely independent changes (apply either or
both):

1.  On A/UX 2.0, if the console window is resized while rn has a read
    pending, rn terminates with an error.  This is fixed by the change
    to final.c.  This change is A/UX specific, and is conditionally
    compiled only if _AUX_SOURCE is defined.  The added line specifies
    that rn is to use 4.2 BSD-compatible (safe) signals, and that read,
    write, ioctl, and wait calls which are interrupted by a signal will
    resume at the point they were interrupted rather than generating an
    error.

2.  A new switch, -p<number> is added to rn.  This change should work
    correctly with any implementation of rn, although it has been tested
    only with A/UX 2.0.  The affected files are rn.1 (the man page),
    term.h, term.c, and sw.c.  The description from the man page follows:

    -p<number> tells rn how many lines to display before pausing for input.
    This switch is useful if you are using a terminal or workstation
    with a scroll buffer larger than the window size, and you do not want
    rn to pause at the end of each screen full of text.  For example,
    -p100 specifies that 100 lines are to be displayed before pausing
    for input.  The -p switch works well with the -l switch.  If the
    -p switch is not specified, the number of lines is a function of
    the terminal or window size.

Herb Weiner (herbw at wiskit.pdx.com)

*** final.c	Sat Nov 10 02:08:44 1990
--- ../rn/final.c	Sat Nov 10 02:06:13 1990
***************
*** 49,54
  void
  final_init()
  {
  #ifdef SIGTSTP
      sigset(SIGTSTP, stop_catcher);	/* job control signals */
      sigset(SIGTTOU, stop_catcher);	/* job control signals */

--- 49,59 -----
  void
  final_init()
  {
+ #ifdef _AUX_SOURCE
+ #include <compat.h>
+     setcompat (COMPAT_BSDSIGNALS | COMPAT_SYSCALLS); /* for Apple A/UX 2.0 */
+ #endif _AUX_SOURCE
+ 
  #ifdef SIGTSTP
      sigset(SIGTSTP, stop_catcher);	/* job control signals */
      sigset(SIGTTOU, stop_catcher);	/* job control signals */
*** rn.1	Sat Nov 10 02:05:04 1990
--- ../rn/rn.1	Thu Nov 29 14:27:15 1990
***************
*** 947,952
  forces normal (non-mailbox) format in creating new save files.
  Ordinarily you are asked which format you want.
  .TP 5
  .B \-q
  bypasses the automatic check for new newsgroups when starting 
  .I rn.

--- 947,973 -----
  forces normal (non-mailbox) format in creating new save files.
  Ordinarily you are asked which format you want.
  .TP 5
+ .B \-p<number>
+ tells
+ .I rn
+ how many lines to display before pausing for input.
+ This switch is useful if you are using a terminal or workstation
+ with a scroll buffer larger than the window size, and you do not want
+ .I rn
+ to pause at the end of each screen full of text.
+ For example,
+ .B \-p100
+ specifies that 100 lines are to be displayed before pausing for input.
+ The
+ .B \-p
+ switch works well with the
+ .B \-l
+ switch.
+ If the
+ .B \-p
+ switch is not specified, the number of lines is
+ a function of the terminal or window size.
+ .TP 5
  .B \-q
  bypasses the automatic check for new newsgroups when starting 
  .I rn.
*** term.h	Sat Nov 10 02:08:21 1990
--- ../rn/term.h	Sat Nov 10 02:06:04 1990
***************
*** 174,179
  EXT char PC INIT(0);		/* pad character for use by tputs() */
  EXT short ospeed INIT(0);	/* terminal output speed, for use by tputs() */
  EXT int LINES INIT(0), COLS INIT(0);	/* size of screen */
  EXT int just_a_sec INIT(960);			/* 1 sec at current baud rate */
  					/* (number of nulls) */
  

--- 174,180 -----
  EXT char PC INIT(0);		/* pad character for use by tputs() */
  EXT short ospeed INIT(0);	/* terminal output speed, for use by tputs() */
  EXT int LINES INIT(0), COLS INIT(0);	/* size of screen */
+ EXT int FORCELINES INIT(0);	/* -p=forcelines option */
  EXT int just_a_sec INIT(960);			/* 1 sec at current baud rate */
  					/* (number of nulls) */
  
*** sw.c	Sat Nov 10 02:08:13 1990
--- ../rn/sw.c	Sat Nov 10 02:05:47 1990
***************
*** 311,316
  	    fputs("This isn't readnews.  Don't use -n.\n\n",stdout) FLUSH;
  	    break;
  #endif
  	case 'r':
  	    findlast = upordown;
  	    break;

--- 311,322 -----
  	    fputs("This isn't readnews.  Don't use -n.\n\n",stdout) FLUSH;
  	    break;
  #endif
+ 	case 'p':
+ 	    s++;
+ 	    if (*s == '=') s++;
+ 		FORCELINES = atoi(s);
+ 	    LINES = FORCELINES;
+ 	    break;
  	case 'r':
  	    findlast = upordown;
  	    break;
*** term.c	Sat Nov 10 02:08:44 1990
--- ../rn/term.c	Sat Nov 10 02:05:30 1990
***************
*** 223,229
  	UE = SE;
  	UG = SG;
      }
!     LINES = tgetnum("li");		/* lines per page */
      COLS = tgetnum("co");		/* columns on page */
  
  #ifdef TIOCGWINSZ

--- 223,232 -----
  	UE = SE;
  	UG = SG;
      }
!     if (FORCELINES > 0)
!         LINES = FORCELINES;
!     else
!         LINES = tgetnum("li");	/* lines per page */
      COLS = tgetnum("co");		/* columns on page */
  
  #ifdef TIOCGWINSZ
***************
*** 229,235
  #ifdef TIOCGWINSZ
      { struct winsize ws;
  	if (ioctl(0, TIOCGWINSZ, &ws) >= 0 && ws.ws_row > 0 && ws.ws_col > 0) {
! 	    LINES = ws.ws_row;
  	    COLS = ws.ws_col;
  	}
      }

--- 232,239 -----
  #ifdef TIOCGWINSZ
      { struct winsize ws;
  	if (ioctl(0, TIOCGWINSZ, &ws) >= 0 && ws.ws_row > 0 && ws.ws_col > 0) {
! 	    if (FORCELINES == 0)
! 	        LINES = ws.ws_row;
  	    COLS = ws.ws_col;
  	}
      }
***************
*** 251,257
      }
  #ifdef TIOCGWINSZ
  	if (ioctl(1, TIOCGWINSZ, &winsize)>=0) {
! 		if (winsize.ws_row>0) LINES=winsize.ws_row;
  		if (winsize.ws_col>0) COLS=winsize.ws_col;
  	}
  #endif

--- 255,261 -----
      }
  #ifdef TIOCGWINSZ
  	if (ioctl(1, TIOCGWINSZ, &winsize)>=0) {
! 		if ((winsize.ws_row>0) && (FORCELINES == 0)) LINES=winsize.ws_row;
  		if (winsize.ws_col>0) COLS=winsize.ws_col;
  	}
  #endif
***************
*** 1097,1103
       struct winsize ws;
  
       if (ioctl(0, TIOCGWINSZ, &ws) >= 0 && ws.ws_row > 0 && ws.ws_col > 0) {
!           LINES = ws.ws_row;
            COLS = ws.ws_col;
            line_col_calcs();
       }

--- 1101,1108 -----
       struct winsize ws;
  
       if (ioctl(0, TIOCGWINSZ, &ws) >= 0 && ws.ws_row > 0 && ws.ws_col > 0) {
!           if (FORCELINES == 0)
!               LINES = ws.ws_row;
            COLS = ws.ws_col;
            line_col_calcs();
       }



More information about the Comp.unix.aux mailing list