[comp.os.minix] Vn diffs for Minix, part 2/2

nick@ultima.cs.uts.oz (Nick Andrew) (07/13/89)

echo x - pagefile.c.d
sed '/^X/s///' > pagefile.c.d << '/'
X*** Orig/pagefile.c	Sat Jul  1 22:01:58 1989
X--- Minix/pagefile.c	Thu Jul 13 20:31:17 1989
X***************
X*** 14,20 ****
X  #include <fcntl.h>
X  #endif
X  
X! #include <sys/file.h>
X  
X  #include "tune.h"
X  #include "node.h"
X--- 14,22 ----
X  #include <fcntl.h>
X  #endif
X  
X! #ifndef	MINIX
X! #include <sys/file.h>
X! #endif
X  
X  #include "tune.h"
X  #include "node.h"
X***************
X*** 48,55 ****
X  	Lrec = -1;
X  	tmpnam (tmpart);
X  	Pgsize = sizeof (HEAD) + L_allow * sizeof(BODY);
X! 	if ((Tdes = open(tmpart,O_RDWR|O_CREAT,0600)) < 0)
X! 		printex ("can't open %s",tmpart);
X  	unlink (tmpart);
X  }
X  
X--- 50,68 ----
X  	Lrec = -1;
X  	tmpnam (tmpart);
X  	Pgsize = sizeof (HEAD) + L_allow * sizeof(BODY);
X! 
X! #ifdef	MINIX
X! 	/* Minix doesn'h have O_CREAT or 3-argument open */
X! 	if ((Tdes = open(tmpart,O_RDWR)) < 0) {
X! 		creat(tmpart,0644);
X! 		if ((Tdes = open(tmpart,O_RDWR)) < 0)
X! 			printex ("can't open %s",tmpart);
X! 	}
X! #else
X! 	if ((Tdes = open(tmpart,O_RDWR|O_CREAT,0600)) < 0)
X! 		printex ("can't open %s",tmpart);
X! #endif
X! 
X  	unlink (tmpart);
X  }
X  
/
echo x - printex.c.d
sed '/^X/s///' > printex.c.d << '/'
X*** Orig/printex.c	Sat Jul  1 20:12:35 1989
X--- Minix/printex.c	Thu Jul 13 20:31:17 1989
X***************
X*** 25,31 ****
X  	{
X  		++topflag;
X  		term_set (STOP);
X! 		tty_set (COOKED);
X  		fflush (stdout);
X  		fprintf (stderr,s,a,b,c,d,e,f);
X  		fprintf (stderr," (error code %d)\n",errno);
X--- 25,36 ----
X  	{
X  		++topflag;
X  		term_set (STOP);
X! #ifndef	MINIX
X! 		tty_set (COOKED);
X! #else
X! /* COOKED is defined in Minix! */
X! 		tty_set (XCOOKED);
X! #endif
X  		fflush (stdout);
X  		fprintf (stderr,s,a,b,c,d,e,f);
X  		fprintf (stderr," (error code %d)\n",errno);
/
echo x - reader.c.d
sed '/^X/s///' > reader.c.d << '/'
X*** Orig/reader.c	Sat Jul  1 22:02:02 1989
X--- Minix/reader.c	Thu Jul 13 20:31:19 1989
X***************
X*** 76,82 ****
X  	char c,  buf[RECLEN];
X  	char lasave[RECLEN];
X  	char pstr[24], dgname[48];
X! 	char getpgch(), *index(), *digest_extract(), *tgetstr();
X  	char *any;
X  	FILE *vns_aopen();
X  	long ftell();
X--- 76,82 ----
X  	char c,  buf[RECLEN];
X  	char lasave[RECLEN];
X  	char pstr[24], dgname[48];
X! 	char getpgch(), *index(), *dige_extract(), *tgetstr();
X  	char *any;
X  	FILE *vns_aopen();
X  	long ftell();
X***************
X*** 93,99 ****
X  	if (Digest)
X  	{
X  		lines = atoi(Fname);
X! 		if ((Fname = digest_extract(dgname,lines,&hdr,&Rew_pos)) == NULL)
X  		{
X  			rerrmsg("couldn't extract article %d from digest",lines);
X  			printf(any);
X--- 93,99 ----
X  	if (Digest)
X  	{
X  		lines = atoi(Fname);
X! 		if ((Fname = dige_extract(dgname,lines,&hdr,&Rew_pos)) == NULL)
X  		{
X  			rerrmsg("couldn't extract article %d from digest",lines);
X  			printf(any);
X***************
X*** 825,831 ****
X  			rot_line(buf);
X  		++Rlines;
X  		if( regex(reg, buf) != NULL ){	/* Got it */
X! 			rerrmsg("\n\tSkipping ....\n\n");
X  			regfree(reg);
X  			return;
X  		}
X--- 825,836 ----
X  			rot_line(buf);
X  		++Rlines;
X  		if( regex(reg, buf) != NULL ){	/* Got it */
X! #ifdef	MINIX
X! /* inverse video mucks up this line somehow */
X! 			rerrmsg("\tSkipping ...\n\n");
X! #else
X! 			rerrmsg("\n\tSkipping ....\n\n");
X! #endif
X  			regfree(reg);
X  			return;
X  		}
/
echo x - regcompat.c
sed '/^X/s///' > regcompat.c << '/'
X/* regcompat.c */
X/* file: regcompat.c
X** author: Peter S. Housel 11/21/88
X** Compatibility routines for regular expressions. more.c uses the
X** re_comp() and re_exec() routines, while Minix only has regcomp() and
X** regexec() (from Henry Spencer's freely redistributable regexp package).
X** Note that the third argument to regexec() is a beginning-of-line flag
X** and was probably added by Andrew Tannenbaum. It will probably be ignored
X** if your copy of the regexp routines only expects two args.
X**/
X
X#include <regexp.h>
X/* following just for debugging #define NULL	0 */
X#include <stdio.h>
X
Xstatic regexp *re_exp = NULL;	/* currently compiled regular expression */
Xstatic char *re_err = NULL;	/* current regexp error */
X
Xchar *re_comp(str)
Xchar *str;
X{
X if(str == NULL)
X    return NULL;
X
X if(re_exp != NULL)
X    free(re_exp);
X
X if((re_exp = regcomp(str)) != NULL)
X    return NULL;
X
X return re_err != NULL ? re_err : "string didn't compile";
X}
X
Xint re_exec(str)
Xchar *str;
X{
X if(re_exp == NULL)
X    return -1;
X return regexec(re_exp, str, 1);
X}
X
Xregerror(str)
Xchar *str;
X{
X re_err = str;
X}
/
echo x - session.c.d
sed '/^X/s///' > session.c.d << '/'
X*** Orig/session.c	Sat Jul  1 22:02:11 1989
X--- Minix/session.c	Thu Jul 13 20:31:23 1989
X***************
X*** 343,349 ****
X  			(Page.h.group)->flags |= FLG_ACC;
X  			Dskip = count - 1;
X  			Drec = Crec - RECBIAS;
X! 			if (digest_page(Drec,Dskip) >= 0)
X  			{
X  				show();
X  				Crec = RECBIAS;
X--- 343,349 ----
X  			(Page.h.group)->flags |= FLG_ACC;
X  			Dskip = count - 1;
X  			Drec = Crec - RECBIAS;
X! 			if (dige_page(Drec,Dskip) >= 0)
X  			{
X  				show();
X  				Crec = RECBIAS;
X***************
X*** 546,552 ****
X  	find_page (Cur_page);
X  	if (Dskip >= 0)
X  	{
X! 		if (digest_page(Drec,Dskip) >= 0)
X  		{
X  			Crec = RECBIAS;
X  			Highrec = Page.h.artnum + RECBIAS;
X--- 546,552 ----
X  	find_page (Cur_page);
X  	if (Dskip >= 0)
X  	{
X! 		if (dige_page(Drec,Dskip) >= 0)
X  		{
X  			Crec = RECBIAS;
X  			Highrec = Page.h.artnum + RECBIAS;
X***************
X*** 643,653 ****
X  		term_set (ERASE);
X  		for (i=0; i < num && readfile(fn[i], fn[i+1] ,&pc) >= 0; ++i)
X  		{
X! 			if (Digest)
X! 				unlink (fn[i]);
X! 		}
X! 		if (Digest && fn[i] != NULL)
X! 			unlink (fn[i]);
X  		if (pc != 0)
X  			forward (pc);
X  		else
X--- 643,660 ----
X  		term_set (ERASE);
X  		for (i=0; i < num && readfile(fn[i], fn[i+1] ,&pc) >= 0; ++i)
X  		{
X! #ifndef	MINIX
X! /* I don't believe this code is correct at all!!! */
X! 			if (Digest)
X! 				unlink (fn[i]);
X! #endif	!MINIX
X! 		}
X! 
X! #ifndef	MINIX
X! /* I don't believe this code is correct at all!!! */
X! 		if (Digest && fn[i] != NULL)
X! 			unlink (fn[i]);
X! #endif	!MINIX
X  		if (pc != 0)
X  			forward (pc);
X  		else
X***************
X*** 912,917 ****
X--- 919,927 ----
X  		}
X  		++idx;
X  		putchar (s[i]);
X+ #ifdef	MINIX
X+ 		fflush(stdout);
X+ #endif
X  	}
X  
X  	if (iline)
/
echo x - sig_set.c.d
sed '/^X/s///' > sig_set.c.d << '/'
X*** Orig/sig_set.c	Sat Jul  1 20:12:40 1989
X--- Minix/sig_set.c	Thu Jul 13 20:31:24 1989
X***************
X*** 7,13 ****
X  */
X  
X  #include <stdio.h>
X! #include <sys/signal.h>
X  #include <sgtty.h>
X  #include <setjmp.h>
X  #include "tty.h"
X--- 7,20 ----
X  */
X  
X  #include <stdio.h>
X! 
X! #ifndef	MINIX
X! /* why? */
X! #include <sys/signal.h>
X! #else
X! #include <signal.h>
X! #endif
X! 
X  #include <sgtty.h>
X  #include <setjmp.h>
X  #include "tty.h"
/
echo x - stat.c.d
sed '/^X/s///' > stat.c.d << '/'
X*** Orig/stat.c	Sat Jul  1 20:12:43 1989
X--- Minix/stat.c	Thu Jul 13 20:31:25 1989
X***************
X*** 10,16 ****
X  #ifdef SYSV
X  #include <fcntl.h>
X  #endif
X! #include <sys/file.h>
X  #include <sys/stat.h>
X  #include <pwd.h>
X  #include "config.h"
X--- 10,21 ----
X  #ifdef SYSV
X  #include <fcntl.h>
X  #endif
X! 
X! #ifndef	MINIX
X! /* Minix doesn't have sys/file.h for some reason */
X! #include <sys/file.h>
X! #endif
X! 
X  #include <sys/stat.h>
X  #include <pwd.h>
X  #include "config.h"
/
echo x - std.c.d
sed '/^X/s///' > std.c.d << '/'
X*** Orig/std.c	Sat Jul  1 20:11:54 1989
X--- Minix/std.c	Thu Jul 13 20:31:28 1989
X***************
X*** 1,11 ****
X  #include <stdio.h>
X  #include <pwd.h>
X  #include <ctype.h>
X! #include <sys/param.h>
X  #include "server.h"
X  #include "config_std.h"
X  #include "std.h"
X  
X  #ifndef MAXPATHLEN
X  #define MAXPATHLEN 240
X  #endif
X--- 1,20 ----
X  #include <stdio.h>
X  #include <pwd.h>
X  #include <ctype.h>
X! 
X! #ifndef	MINIX
X! /* Minix is missing it */
X! #include <sys/param.h>
X! #endif
X! 
X  #include "server.h"
X  #include "config_std.h"
X  #include "std.h"
X  
X+ #ifdef	MINIX
X+ #define clearerr(p) (((p)->_flags) &= ~_ERR)
X+ #endif
X+ 
X  #ifndef MAXPATHLEN
X  #define MAXPATHLEN 240
X  #endif
/
echo x - tty.h.d
sed '/^X/s///' > tty.h.d << '/'
X*** Orig/tty.h	Sat Jul  1 20:13:41 1989
X--- Minix/tty.h	Thu Jul 13 20:31:32 1989
X***************
X*** 17,23 ****
X  #define RESTART 108
X  
X  #define RAWMODE 200
X! #define COOKED 201
X! #define SAVEMODE 202
X! #define RESTORE 203
X! #define BACKSTOP 204
X--- 17,27 ----
X  #define RESTART 108
X  
X  #define RAWMODE 200
X! #ifndef	MINIX
X! #define COOKED 201
X! #else
X! #define XCOOKED 201
X! #endif
X! #define SAVEMODE 202
X! #define RESTORE 203
X! #define BACKSTOP 204
/
echo x - tty_set.c.d
sed '/^X/s///' > tty_set.c.d << '/'
X*** Orig/tty_set.c	Sat Jul  1 20:13:00 1989
X--- Minix/tty_set.c	Thu Jul 13 20:31:33 1989
X***************
X*** 6,11 ****
X--- 6,16 ----
X  ** see copyright disclaimer / history in vn.c source file
X  */
X  
X+ #ifdef	MINIX
X+ /* Minix uses non-SysV type ioctls */
X+ #undef	SYSV
X+ #endif
X+ 
X  #ifdef SYSV
X  #include <termio.h>
X  #else
X***************
X*** 91,97 ****
X  #endif
X  		S_flag = IO_GOT|IO_RAW;
X  		break;
X! 	case COOKED:
X  		if ((S_flag & IO_RAW) != 0)
X  		{
X  #ifdef SYSV
X--- 96,106 ----
X  #endif
X  		S_flag = IO_GOT|IO_RAW;
X  		break;
X! #ifndef	MINIX
X! 	case COOKED:
X! #else
X! 	case XCOOKED:
X! #endif
X  		if ((S_flag & IO_RAW) != 0)
X  		{
X  #ifdef SYSV
X***************
X*** 109,115 ****
X  	case SAVEMODE:
X  		if ((S_flag & IO_RAW) != 0)
X  		{
X! 			tty_set(COOKED);
X  			R_ignore = 0;
X  		}
X  		else
X--- 118,128 ----
X  	case SAVEMODE:
X  		if ((S_flag & IO_RAW) != 0)
X  		{
X! #ifndef	MINIX
X! 			tty_set(COOKED);
X! #else
X! 			tty_set(XCOOKED);
X! #endif
X  			R_ignore = 0;
X  		}
X  		else
/
echo x - userlist.c.d
sed '/^X/s///' > userlist.c.d << '/'
X*** Orig/userlist.c	Sat Jul  1 22:02:15 1989
X--- Minix/userlist.c	Thu Jul 13 20:31:34 1989
X***************
X*** 15,21 ****
X  extern PAGE Page;
X  extern char *List_sep;
X  
X! static char Pattern[MAX_C] = "";
X  
X  /*
X  	generate user list of articles - either article numbers
X--- 15,26 ----
X  extern PAGE Page;
X  extern char *List_sep;
X  
X! #ifndef	MINIX
X! static char Pattern[MAX_C] = "";
X! #else
X! /* Minix, in its C compiler wisdom(?), only defines 1 word for the above */
X! static char Pattern[MAX_C] = {0};
X! #endif
X  
X  /*
X  	generate user list of articles - either article numbers
/
echo x - vn.c.d
sed '/^X/s///' > vn.c.d << '/'
X*** Orig/vn.c	Sat Jul  1 22:02:18 1989
X--- Minix/vn.c	Thu Jul 13 20:31:35 1989
X***************
X*** 297,303 ****
X  		fprintf (stderr,"\nNo News\n");
X  	}
X  
X! 	tty_set (COOKED);
X  
X  	/* exiting, don't worry about FLG_ECHG resetting */
X  	vns_write(Newsorder,Ncount);
X--- 297,307 ----
X  		fprintf (stderr,"\nNo News\n");
X  	}
X  
X! #ifndef	MINIX
X! 	tty_set (COOKED);
X! #else
X! 	tty_set (XCOOKED);
X! #endif
X  
X  	/* exiting, don't worry about FLG_ECHG resetting */
X  	vns_write(Newsorder,Ncount);
/
echo x - vn.h.d
sed '/^X/s///' > vn.h.d << '/'
X*** Orig/vn.h	Sat Jul  1 22:02:19 1989
X--- Minix/vn.h	Thu Jul 13 20:31:36 1989
X***************
X*** 66,74 ****
X  #define ALTBOTTOM 'G'
X  #define MIDMOVE 'M'
X  #define PRTVERSION '"'
X! #define HELP_HEAD "[...] = effect of optional number preceding command\n\
X! pipes are specified by filenames beginning with |\n\
X! articles specified as a list of numbers, title search string, or\n\
X! 	* to specify marked articles.  ! may be used to negate any\n"
X! 
X! #define HHLINES 5	/* lines (CRs + 1) contained in HELP_HEAD */
X--- 66,69 ----
X  #define ALTBOTTOM 'G'
X  #define MIDMOVE 'M'
X  #define PRTVERSION '"'
X! 
/
exit 0
-- 
			"Zeta Microcomputer Software"
ACSnet:    nick@nswitgould.cs.uts.oz	nick@ultima.cs.uts.oz
UUCP:      ...!uunet!munnari!ultima.cs.uts.oz!nick
Fidonet:   Nick Andrew on 3:713/602 (Zeta)