rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* patches to rc 1.4
@ 1993-10-04 12:20 Christopher Vance
  0 siblings, 0 replies; only message in thread
From: Christopher Vance @ 1993-10-04 12:20 UTC (permalink / raw)
  To: rc; +Cc: cjsv

The following patches are with respect to Tom Culliton's complete
list, including the recent builtin read, although most of the changes
revealed here were made to virgin 1.4 before any patches were posted.
My patches were mostly made to enable identical source files to be
compiled on several architectures.

These sources now compile on
	Pyramid OSx 5.1a	cc -Xa		(has no stdarg.h)
	DomainOS 10.4		cc		(both M68K and A88K)
	SunOS 4.1.3		gcc
and closely related sources at one time did compile on
	ConvexOS 10.1		cc

I can't remember if I also compiled the same sources on AIX 3.1;
besides, my account on that machine doesn't have a home directory
anymore...

Since I made the original changes in November, our Convex has
disappeared, so I can't verify that these sources still compile on
ConvexOS.  (A pity, since it had the best ANSI/POSIX environment I've
used.)

The details of which particular compiler required which change is now
lost in history.  Also, a number of OS upgrades since then may have
made some of the patches unnecessary.

The patches to trip.rc may fail on some versions of patch, but should
be simple to apply by hand if have some version of gnu emacs.

I can also provide these patches with respect to virgin 1.4 if
requested.

-- Christopher


*** /tmp/,RCSt1008584	Mon Oct  4 21:58:48 1993
--- addon.c	Mon Oct  4 21:58:22 1993
***************
*** 3,10
     builtins.
  */
  
- #include "rc.h"		/* for bool TRUE, FALSE, configuration options */
- 
  #ifdef	DWS
  
  /*

--- 3,8 -----
     builtins.
  */
  
  #ifdef	DWS
  
  /*
***************
*** 15,20
  #include <sys/file.h>
  #include <sys/stat.h>
  
  #include "addon.h"
  
  #include "addon/access.c"

--- 13,19 -----
  #include <sys/file.h>
  #include <sys/stat.h>
  
+ #include "rc.h"		/* for bool TRUE, FALSE */
  #include "addon.h"
  
  #include "addon/access.c"
***************
*** 26,31
  #ifndef	DWS
  #include <sys/types.h>
  
  #include "addon.h"
  #endif
  

--- 25,31 -----
  #ifndef	DWS
  #include <sys/types.h>
  
+ #include "rc.h"		/* for bool TRUE, FALSE */
  #include "addon.h"
  #endif
  
*** /tmp/,RCSt1008584	Mon Oct  4 21:58:50 1993
--- config.h-dist	Mon Oct  4 21:58:08 1993
***************
*** 108,132
  #define NOJOB
   */
  
- /*
-  * Define the macro NEED_VARARGS if your C compiler doesn't have stdarg.h,
-  * but does have varargs.h.  This macro assumes (as is true for the Pyramid)
-  * that va_alist can appear *after* other arguments in the argument list.
- #define NEED_VARARGS
-  */
- 
- /*
-  * Define the macro NEED_STRINGS if your C compiler doesn't have string.h,
-  * but does have strings.h.
- #define NEED_STRINGS
-  */
- 
- /*
-  * Define the macro NEED_ERRNO if your C compiler doesn't declare errno
-  * but does have strings.h.
- #define NEED_STRINGS
-  */
- 
  /* Beginning of defaults section: */
  
  #ifndef CUSTOM

--- 108,113 -----
  #define NOJOB
   */
  
  /* Beginning of defaults section: */
  
  #ifndef CUSTOM
***************
*** 153,159
  #define PROTECT_ENV
  #undef DEFAULTPATH
  #define DEFAULTPATH "/usr/ucb", "/usr/bin", "."
- #define DEFAULTINTERP "/bin/sh"
  #endif
  
  /*

--- 134,139 -----
  #define PROTECT_ENV
  #undef DEFAULTPATH
  #define DEFAULTPATH "/usr/ucb", "/usr/bin", "."
  #endif
  
  /*
***************
*** 188,194
  #if defined(host_mips) && defined(MIPSEB) && defined(SYSTYPE_BSD43)
  #define NODIRENT
  #define PROTECT_ENV
- #define NEED_ERRNO
  #endif
  
  /*

--- 168,173 -----
  #if defined(host_mips) && defined(MIPSEB) && defined(SYSTYPE_BSD43)
  #define NODIRENT
  #define PROTECT_ENV
  #endif
  
  /*
***************
*** 216,244
  #define NOLIMITS
  #define word _word
  #define DEFAULTINTERP "/bin/sh"
- #endif
- 
- /*
-  * Suggested settings for DomainOS 10.4
-  */
- 
- #ifdef apollo
- #define DEFAULTINTERP "/bin/sh"
- #define PROTECT_ENV
- #define NODIRENT
- #endif
- 
- /*
-  * Suggested settings for OSx 5.1a
-  */
- 
- #ifdef pyr
- #define DEFAULTINTERP "/bin/sh"
- #define PROTECT_ENV
- #define NODIRENT
- #define NEED_ERRNO
- #define NEED_STRINGS
- #define NEED_VARARGS
  #endif
  
  #endif /* CUSTOM */

--- 195,200 -----
  #define NOLIMITS
  #define word _word
  #define DEFAULTINTERP "/bin/sh"
  #endif
  
  #endif /* CUSTOM */
*** /tmp/,RCSt1008584	Mon Oct  4 21:58:52 1993
--- fn.c	Mon Oct  4 21:58:10 1993
***************
*** 94,100
  			sigcommon:
  			default:
  				if (sighandlers[i] != SIG_DFL) {
! 					rc_signal(i, (sighandler*)SIG_DFL);
  					delete_fn(signals[i].name);
  				}
  			}

--- 94,100 -----
  			sigcommon:
  			default:
  				if (sighandlers[i] != SIG_DFL) {
! 					rc_signal(i, SIG_DFL);
  					delete_fn(signals[i].name);
  				}
  			}
***************
*** 167,173
  			if (streq(signals[i].name, name)) {
  				handlers[i] = newdef;
  				if (def == NULL)
! 					rc_signal(i, (sighandler*)SIG_IGN);
  				else
  					rc_signal(i, fn_handler);
  				break;

--- 167,173 -----
  			if (streq(signals[i].name, name)) {
  				handlers[i] = newdef;
  				if (def == NULL)
! 					rc_signal(i, SIG_IGN);
  				else
  					rc_signal(i, fn_handler);
  				break;
***************
*** 241,247
  				rc_signal(i, def_sigterm);
  				break;
  			default:
! 				rc_signal(i, (sighandler*)SIG_DFL);
  			}
  		}
  	if (streq(name, "sigexit"))

--- 241,247 -----
  				rc_signal(i, def_sigterm);
  				break;
  			default:
! 				rc_signal(i, SIG_DFL);
  			}
  		}
  	if (streq(name, "sigexit"))
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:01 1993
--- list.c	Mon Oct  4 21:58:13 1993
***************
*** 22,29
  
  /* Copy list into malloc space (for storing a variable) */
  
! /*extern List *listcpy(List *s, void *(*alloc)(SIZE_T)) {*/
! extern List *listcpy(List *s, allocf *alloc) {
  	List *top, *r;
  	for (top = r = NULL; s != NULL; s = s->n) {
  		if (top == NULL)

--- 22,28 -----
  
  /* Copy list into malloc space (for storing a variable) */
  
! extern List *listcpy(List *s, void *(*alloc)(SIZE_T)) {
  	List *top, *r;
  	for (top = r = NULL; s != NULL; s = s->n) {
  		if (top == NULL)
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:02 1993
--- main.c	Mon Oct  4 21:58:27 1993
***************
*** 8,16
  
  static bool dashoh;
  
- #ifdef NEED_VARARGS
- static void assigndefault();
- #else
  static void assigndefault(char *,...);
  #endif
  static void checkfd(int, redirtype);

--- 8,13 -----
  
  static bool dashoh;
  
  static void assigndefault(char *,...);
  static void checkfd(int, enum redirtype);
  
***************
*** 12,19
  static void assigndefault();
  #else
  static void assigndefault(char *,...);
! #endif
! static void checkfd(int, redirtype);
  
  extern void main(int argc, char *argv[], char *envp[]) {
  	char *dashsee[2], *dollarzero, *null[1];

--- 9,15 -----
  static bool dashoh;
  
  static void assigndefault(char *,...);
! static void checkfd(int, enum redirtype);
  
  extern void main(int argc, char *argv[], char *envp[]) {
  	char *dashsee[2], *dollarzero, *null[1];
***************
*** 104,112
  	rc_exit(getstatus());
  }
  
- #ifdef NEED_VARARGS
- static void assigndefault(name, va_alist) char *name; va_dcl {
- #else
  static void assigndefault(char *name,...) {
  #endif
  	va_list ap;

--- 100,105 -----
  	rc_exit(getstatus());
  }
  
  static void assigndefault(char *name,...) {
  	va_list ap;
  	List *l;
***************
*** 108,114
  static void assigndefault(name, va_alist) char *name; va_dcl {
  #else
  static void assigndefault(char *name,...) {
- #endif
  	va_list ap;
  	List *l;
  	char *v;

--- 101,106 -----
  }
  
  static void assigndefault(char *name,...) {
  	va_list ap;
  	List *l;
  	char *v;
***************
*** 112,120
  	va_list ap;
  	List *l;
  	char *v;
- #ifdef NEED_VARARGS
- 	va_start(ap);
- #else
  	va_start(ap, name);
  #endif
  	for (l = NULL; (v = va_arg(ap, char *)) != NULL;)

--- 104,109 -----
  	va_list ap;
  	List *l;
  	char *v;
  	va_start(ap, name);
  	for (l = NULL; (v = va_arg(ap, char *)) != NULL;)
  		l = append(l, word(v, NULL));
***************
*** 116,122
  	va_start(ap);
  #else
  	va_start(ap, name);
- #endif
  	for (l = NULL; (v = va_arg(ap, char *)) != NULL;)
  		l = append(l, word(v, NULL));
  	varassign(name, l, FALSE);

--- 105,110 -----
  	List *l;
  	char *v;
  	va_start(ap, name);
  	for (l = NULL; (v = va_arg(ap, char *)) != NULL;)
  		l = append(l, word(v, NULL));
  	varassign(name, l, FALSE);
***************
*** 127,133
  
  /* open an fd on /dev/null if it is inherited closed */
  
! static void checkfd(int fd, redirtype r) {
  	int new = rc_open("/dev/null", r);
  	if (new != fd && new != -1)
  		close(new);

--- 115,121 -----
  
  /* open an fd on /dev/null if it is inherited closed */
  
! static void checkfd(int fd, enum redirtype r) {
  	int new = rc_open("/dev/null", r);
  	if (new != fd && new != -1)
  		close(new);
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:03 1993
--- mksignal	Mon Oct  4 21:58:14 1993
***************
*** 7,14
  echo
  echo 'Sigmsgs signals[] = {'
  
! sed '	s/\/\*[ 	]*(P)[ 	]*//
! 	s/\/\*[ 	]*//
  	s/[ 	]*\*\///
  	s/([@*+!]) //
  	s/[ 	]*([a-zA-Z,->& ]*)[ 	]*//

--- 7,13 -----
  echo
  echo 'Sigmsgs signals[] = {'
  
! sed '	s/\/\*[ 	]*//
  	s/[ 	]*\*\///
  	s/([@*+!]) //
  	s/[ 	]*([a-zA-Z,->& ]*)[ 	]*//
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:06 1993
--- print.c	Mon Oct  4 21:58:16 1993
***************
*** 175,182
   * conversion table management
   */
  
! /*static Conv fmttab[MAXCONV];*/
! static bool (*fmttab[MAXCONV])(Format *, int);
  
  static void inittab(void) {
  	int i;

--- 175,181 -----
   * conversion table management
   */
  
! static Conv fmttab[MAXCONV];
  
  static void inittab(void) {
  	int i;
***************
*** 202,208
  		fmttab[i] = digitconv;
  }
  
! /*extern bool (*fmtinstall(int c, bool (*f)(Format *, int)))(Format *, int) {*/
  /*Conv fmtinstall(int c, Conv f) {*/
  extern bool (*fmtinstall(c, f))() int c; bool f(); {
  	/*Conv oldf;*/

--- 201,207 -----
  		fmttab[i] = digitconv;
  }
  
! extern bool (*fmtinstall(int c, bool (*f)(Format *, int)))(Format *, int) {
  /*Conv fmtinstall(int c, Conv f) {*/
  	Conv oldf;
  	if (fmttab[0] == NULL)
***************
*** 204,212
  
  /*extern bool (*fmtinstall(int c, bool (*f)(Format *, int)))(Format *, int) {*/
  /*Conv fmtinstall(int c, Conv f) {*/
! extern bool (*fmtinstall(c, f))() int c; bool f(); {
! 	/*Conv oldf;*/
! 	bool (*oldf)(Format *, int);
  	if (fmttab[0] == NULL)
  		inittab();
  	c &= MAXCONV - 1;

--- 203,209 -----
  
  extern bool (*fmtinstall(int c, bool (*f)(Format *, int)))(Format *, int) {
  /*Conv fmtinstall(int c, Conv f) {*/
! 	Conv oldf;
  	if (fmttab[0] == NULL)
  		inittab();
  	c &= MAXCONV - 1;
***************
*** 271,279
   * the public entry points
   */
  
- #ifdef NEED_VARARGS
- extern int fmtprint(format, fmt, va_alist) Format *format; const char *fmt; va_dcl {
- #else
  extern int fmtprint(Format *format, const char *fmt,...) {
  #endif
  	int n = -format->flushed;

--- 268,273 -----
   * the public entry points
   */
  
  extern int fmtprint(Format *format, const char *fmt,...) {
  	int n = -format->flushed;
  	va_list saveargs = format->args;
***************
*** 275,281
  extern int fmtprint(format, fmt, va_alist) Format *format; const char *fmt; va_dcl {
  #else
  extern int fmtprint(Format *format, const char *fmt,...) {
- #endif
  	int n = -format->flushed;
  	va_list saveargs = format->args;
  

--- 269,274 -----
   */
  
  extern int fmtprint(Format *format, const char *fmt,...) {
  	int n = -format->flushed;
  	va_list saveargs = format->args;
  
***************
*** 279,287
  	int n = -format->flushed;
  	va_list saveargs = format->args;
  
- #ifdef NEED_VARARGS
- 	va_start(format->args);
- #else
  	va_start(format->args, fmt);
  #endif
  	n += printfmt(format, fmt);

--- 272,277 -----
  	int n = -format->flushed;
  	va_list saveargs = format->args;
  
  	va_start(format->args, fmt);
  	n += printfmt(format, fmt);
  	va_end(format->args);
***************
*** 283,289
  	va_start(format->args);
  #else
  	va_start(format->args, fmt);
- #endif
  	n += printfmt(format, fmt);
  	va_end(format->args);
  	format->args = saveargs;

--- 273,278 -----
  	va_list saveargs = format->args;
  
  	va_start(format->args, fmt);
  	n += printfmt(format, fmt);
  	va_end(format->args);
  	format->args = saveargs;
***************
*** 300,308
  	writeall(format->u.n, buf, n);
  }
  
- #ifdef NEED_VARARGS
- extern int fprint(fd, fmt, va_alist) int fd; const char *fmt; va_dcl {
- #else
  extern int fprint(int fd, const char *fmt,...) {
  #endif
  	char buf[1024];

--- 289,294 -----
  	writeall(format->u.n, buf, n);
  }
  
  extern int fprint(int fd, const char *fmt,...) {
  	char buf[1024];
  	Format format;
***************
*** 304,310
  extern int fprint(fd, fmt, va_alist) int fd; const char *fmt; va_dcl {
  #else
  extern int fprint(int fd, const char *fmt,...) {
- #endif
  	char buf[1024];
  	Format format;
  

--- 290,295 -----
  }
  
  extern int fprint(int fd, const char *fmt,...) {
  	char buf[1024];
  	Format format;
  
***************
*** 315,323
  	format.flushed	= 0;
  	format.u.n	= fd;
  
- #ifdef NEED_VARARGS
- 	va_start(format.args);
- #else
  	va_start(format.args, fmt);
  #endif
  	printfmt(&format, fmt);

--- 300,305 -----
  	format.flushed	= 0;
  	format.u.n	= fd;
  
  	va_start(format.args, fmt);
  	printfmt(&format, fmt);
  	va_end(format.args);
***************
*** 319,325
  	va_start(format.args);
  #else
  	va_start(format.args, fmt);
- #endif
  	printfmt(&format, fmt);
  	va_end(format.args);
  

--- 301,306 -----
  	format.u.n	= fd;
  
  	va_start(format.args, fmt);
  	printfmt(&format, fmt);
  	va_end(format.args);
  
***************
*** 356,364
  	return format->bufbegin;
  }
  
- #ifdef NEED_VARARGS
- extern char *mprint(fmt, va_alist) const char *fmt; va_dcl {
- #else
  extern char *mprint(const char *fmt,...) {
  #endif
  	Format format;

--- 337,342 -----
  	return format->bufbegin;
  }
  
  extern char *mprint(const char *fmt,...) {
  	Format format;
  	char *result;
***************
*** 360,366
  extern char *mprint(fmt, va_alist) const char *fmt; va_dcl {
  #else
  extern char *mprint(const char *fmt,...) {
- #endif
  	Format format;
  	char *result;
  	format.u.n = 1;

--- 338,343 -----
  }
  
  extern char *mprint(const char *fmt,...) {
  	Format format;
  	char *result;
  	format.u.n = 1;
***************
*** 364,372
  	Format format;
  	char *result;
  	format.u.n = 1;
- #ifdef NEED_VARARGS
- 	va_start(format.args);
- #else
  	va_start(format.args, fmt);
  #endif
  	result = memprint(&format, fmt, ealloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);

--- 341,346 -----
  	Format format;
  	char *result;
  	format.u.n = 1;
  	va_start(format.args, fmt);
  	result = memprint(&format, fmt, ealloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
***************
*** 368,374
  	va_start(format.args);
  #else
  	va_start(format.args, fmt);
- #endif
  	result = memprint(&format, fmt, ealloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;

--- 342,347 -----
  	char *result;
  	format.u.n = 1;
  	va_start(format.args, fmt);
  	result = memprint(&format, fmt, ealloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;
***************
*** 374,382
  	return result;
  }
  
- #ifdef NEED_VARARGS
- extern char *nprint(fmt, va_alist) const char *fmt; va_dcl {
- #else
  extern char *nprint(const char *fmt,...) {
  #endif
  	Format format;

--- 347,352 -----
  	return result;
  }
  
  extern char *nprint(const char *fmt,...) {
  	Format format;
  	char *result;
***************
*** 378,384
  extern char *nprint(fmt, va_alist) const char *fmt; va_dcl {
  #else
  extern char *nprint(const char *fmt,...) {
- #endif
  	Format format;
  	char *result;
  	format.u.n = 0;

--- 348,353 -----
  }
  
  extern char *nprint(const char *fmt,...) {
  	Format format;
  	char *result;
  	format.u.n = 0;
***************
*** 382,390
  	Format format;
  	char *result;
  	format.u.n = 0;
- #ifdef NEED_VARARGS
- 	va_start(format.args);
- #else
  	va_start(format.args, fmt);
  #endif
  	result = memprint(&format, fmt, nalloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);

--- 351,356 -----
  	Format format;
  	char *result;
  	format.u.n = 0;
  	va_start(format.args, fmt);
  	result = memprint(&format, fmt, nalloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
***************
*** 386,392
  	va_start(format.args);
  #else
  	va_start(format.args, fmt);
- #endif
  	result = memprint(&format, fmt, nalloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;

--- 352,357 -----
  	char *result;
  	format.u.n = 0;
  	va_start(format.args, fmt);
  	result = memprint(&format, fmt, nalloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:07 1993
--- proto.h	Mon Oct  4 21:58:16 1993
***************
*** 14,24
  	of the same macros.
  */
  
- #ifdef NEED_STRINGS
- #define strchr index
- #define strrchr rindex
- #endif
- 
  #ifndef ALIGN_T
  typedef long ALIGN_T;
  #endif

--- 14,19 -----
  	of the same macros.
  */
  
  #ifndef ALIGN_T
  typedef long ALIGN_T;
  #endif
***************
*** 81,86
  
  /* fake errno.h for mips (which doesn't declare errno in errno.h!?!?) */
  
! #ifdef NEED_ERRNO
  extern int errno;
  #endif

--- 76,81 -----
  
  /* fake errno.h for mips (which doesn't declare errno in errno.h!?!?) */
  
! #ifdef host_mips
  extern int errno;
  #endif
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:09 1993
--- rc.h	Mon Oct  4 21:58:17 1993
***************
*** 7,15
  #undef FALSE
  #undef TRUE
  
- #ifdef NEED_VARARGS
- #include <varargs.h>
- #else
  #include <stdarg.h>
  #endif
  

--- 7,12 -----
  #undef FALSE
  #undef TRUE
  
  #include <stdarg.h>
  
  typedef void builtin_t(char **);
***************
*** 11,17
  #include <varargs.h>
  #else
  #include <stdarg.h>
- #endif
  
  typedef void builtin_t(char **);
  typedef struct Block Block;

--- 8,13 -----
  #undef TRUE
  
  #include <stdarg.h>
  
  typedef void builtin_t(char **);
  typedef struct Block Block;
***************
*** 166,177
  #define streq(x, y) (*(x) == *(y) && strcmp(x, y) == 0)
  #define conststrlen(x) (sizeof (x) - 1)
  
- /* function typedefs are more tricky */
- 
- typedef void *allocf(SIZE_T);
- typedef void (sighandler)(int);
- typedef void sigfunc(int);
- 
  /* rc prototypes */
  
  /* main.c */

--- 162,167 -----
  #define streq(x, y) (*(x) == *(y) && strcmp(x, y) == 0)
  #define conststrlen(x) (sizeof (x) - 1)
  
  /* rc prototypes */
  
  /* main.c */
***************
*** 316,324
  */
  extern bool (*fmtinstall(int, bool (*)(Format *, int)))(Format *, int);
  extern int printfmt(Format *, const char *);
- #ifdef NEED_VARARGS
- extern int fmtprint();
- #else
  extern int fmtprint(Format *, const char *,...);
  #endif
  extern void fmtappend(Format *, const char *, SIZE_T);

--- 306,311 -----
  */
  extern bool (*fmtinstall(int, bool (*)(Format *, int)))(Format *, int);
  extern int printfmt(Format *, const char *);
  extern int fmtprint(Format *, const char *,...);
  extern void fmtappend(Format *, const char *, SIZE_T);
  extern void fmtcat(Format *, const char *);
***************
*** 320,326
  extern int fmtprint();
  #else
  extern int fmtprint(Format *, const char *,...);
- #endif
  extern void fmtappend(Format *, const char *, SIZE_T);
  extern void fmtcat(Format *, const char *);
  #ifdef NEED_VARARGS

--- 307,312 -----
  extern bool (*fmtinstall(int, bool (*)(Format *, int)))(Format *, int);
  extern int printfmt(Format *, const char *);
  extern int fmtprint(Format *, const char *,...);
  extern void fmtappend(Format *, const char *, SIZE_T);
  extern void fmtcat(Format *, const char *);
  extern int fprint(int fd, const char *fmt,...);
***************
*** 323,333
  #endif
  extern void fmtappend(Format *, const char *, SIZE_T);
  extern void fmtcat(Format *, const char *);
- #ifdef NEED_VARARGS
- extern int fprint();
- extern char *mprint();
- extern char *nprint();
- #else
  extern int fprint(int fd, const char *fmt,...);
  extern char *mprint(const char *fmt,...);
  extern char *nprint(const char *fmt,...);

--- 309,314 -----
  extern int fmtprint(Format *, const char *,...);
  extern void fmtappend(Format *, const char *, SIZE_T);
  extern void fmtcat(Format *, const char *);
  extern int fprint(int fd, const char *fmt,...);
  extern char *mprint(const char *fmt,...);
  extern char *nprint(const char *fmt,...);
***************
*** 331,337
  extern int fprint(int fd, const char *fmt,...);
  extern char *mprint(const char *fmt,...);
  extern char *nprint(const char *fmt,...);
- #endif
  /*
     the following macro should by rights be coded as an expression, not
     a statement, but certain compilers (notably DEC) have trouble with

--- 312,317 -----
  extern int fprint(int fd, const char *fmt,...);
  extern char *mprint(const char *fmt,...);
  extern char *nprint(const char *fmt,...);
  /*
     the following macro should by rights be coded as an expression, not
     a statement, but certain compilers (notably DEC) have trouble with
***************
*** 356,363
  extern void catcher(int);
  extern void sigchk(void);
  extern void (*rc_signal(int, void (*)(int)))(int);
! /*extern void (*sighandlers[])(int);*/
! extern sighandler *sighandlers[];
  extern volatile SIG_ATOMIC_T slow, interrupt_happened;
  #define SIGCHK sigchk()
  

--- 336,342 -----
  extern void catcher(int);
  extern void sigchk(void);
  extern void (*rc_signal(int, void (*)(int)))(int);
! extern void (*sighandlers[])(int);
  extern volatile SIG_ATOMIC_T slow, interrupt_happened;
  #define SIGCHK sigchk()
  
***************
*** 372,380
  extern void ssetstatus(char **);
  
  /* tree.c */
- #ifdef NEED_VARARGS
- extern Node *mk();
- #else
  extern Node *mk(int /*nodetype*/,...);
  #endif
  extern Node *treecpy(Node *, void *(*)(SIZE_T));

--- 351,356 -----
  extern void ssetstatus(char **);
  
  /* tree.c */
  extern Node *mk(int /*nodetype*/,...);
  extern Node *treecpy(Node *, void *(*)(SIZE_T));
  extern void treefree(Node *);
***************
*** 376,382
  extern Node *mk();
  #else
  extern Node *mk(int /*nodetype*/,...);
- #endif
  extern Node *treecpy(Node *, void *(*)(SIZE_T));
  extern void treefree(Node *);
  

--- 352,357 -----
  
  /* tree.c */
  extern Node *mk(int /*nodetype*/,...);
  extern Node *treecpy(Node *, void *(*)(SIZE_T));
  extern void treefree(Node *);
  
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:11 1993
--- signal.c	Mon Oct  4 21:58:18 1993
***************
*** 50,57
  	(*h)(s);
  }
  
! /*extern void (*rc_signal(int s, void (*h)(int)))(int) {*/
! extern sigfunc *rc_signal(int s, sigfunc *h) {
  	void (*old)(int);
  	SIGCHK;
  	old = sighandlers[s];

--- 50,56 -----
  	(*h)(s);
  }
  
! extern void (*rc_signal(int s, void (*h)(int)))(int) {
  	void (*old)(int);
  	SIGCHK;
  	old = sighandlers[s];
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:12 1993
--- tree.c	Mon Oct  4 21:58:19 1993
***************
*** 4,12
  
  /* make a new node, pass it back to yyparse. Used to generate the parsetree. */
  
- #ifdef NEED_VARARGS
- extern Node *mk(t, va_alist) int t; va_dcl {
- #else
  extern Node *mk(int /*nodetype*/ t,...) {
  #endif
  	va_list ap;

--- 4,9 -----
  
  /* make a new node, pass it back to yyparse. Used to generate the parsetree. */
  
  extern Node *mk(int /*nodetype*/ t,...) {
  	va_list ap;
  	Node *n;
***************
*** 8,14
  extern Node *mk(t, va_alist) int t; va_dcl {
  #else
  extern Node *mk(int /*nodetype*/ t,...) {
- #endif
  	va_list ap;
  	Node *n;
  #ifdef NEED_VARARGS

--- 5,10 -----
  /* make a new node, pass it back to yyparse. Used to generate the parsetree. */
  
  extern Node *mk(int /*nodetype*/ t,...) {
  	va_list ap;
  	Node *n;
  	va_start(ap, t);
***************
*** 11,19
  #endif
  	va_list ap;
  	Node *n;
- #ifdef NEED_VARARGS
- 	va_start(ap);
- #else
  	va_start(ap, t);
  #endif
  	switch (t) {

--- 7,12 -----
  extern Node *mk(int /*nodetype*/ t,...) {
  	va_list ap;
  	Node *n;
  	va_start(ap, t);
  	switch (t) {
  	default:
***************
*** 15,21
  	va_start(ap);
  #else
  	va_start(ap, t);
- #endif
  	switch (t) {
  	default:
  		panic("unexpected node in mk");

--- 8,13 -----
  	va_list ap;
  	Node *n;
  	va_start(ap, t);
  	switch (t) {
  	default:
  		panic("unexpected node in mk");
***************
*** 73,80
  
  /* copy a tree to malloc space. Used when storing the definition of a function */
  
! /*extern Node *treecpy(Node *s, void *(*alloc)(SIZE_T)) {*/
! extern Node *treecpy(Node *s, allocf *alloc) {
  	Node *n;
  	if (s == NULL)
  		return NULL;

--- 65,71 -----
  
  /* copy a tree to malloc space. Used when storing the definition of a function */
  
! extern Node *treecpy(Node *s, void *(*alloc)(SIZE_T)) {
  	Node *n;
  	if (s == NULL)
  		return NULL;
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:13 1993
--- trip.rc	Mon Oct  4 21:58:30 1993
***************
*** 81,88
  if (!~ `` '' {cat 2} foo) fail dup put wrong contents in file : `` '' {cat 2}
  rm -f 1 2
  
! # cat doesn't seem to mind this on a Pyramid
! expect error from cat, closing stdin '('no error reported on Pyramid')'
  cat >[0=]
  
  submatch 'cat>(1 2 3)' 'multi-word filename in redirection' 'redirection error'

--- 81,87 -----
  if (!~ `` '' {cat 2} foo) fail dup put wrong contents in file : `` '' {cat 2}
  rm -f 1 2
  
! expect error from cat, closing stdin
  cat >[0=]
  
  submatch 'cat>(1 2 3)' 'multi-word filename in redirection' 'redirection error'
***************
*** 281,291
  
  expect list of variables and functions
  whatis
- 
- # during port to Pyramid (or was it Convex?), all elements seemed to
- # be missing their first character
- expect list of files in this directory
- echo *
  
  submatch 'whatis -f' 'whatis: bad option: -f' 'bad option to whatis'
  

--- 280,285 -----
  
  expect list of variables and functions
  whatis
  
  submatch 'whatis -f' 'whatis: bad option: -f' 'bad option to whatis'
  
*** /tmp/,RCSt1008584	Mon Oct  4 21:59:15 1993
--- walk.c	Mon Oct  4 21:58:21 1993
***************
*** 44,52
  		if ((pid = rc_fork()) == 0) {
  #if !defined(NOJOB) && defined(SIGTTOU) && defined(SIGTTIN) && defined(SIGTSTP)
  			setsigdefaults(FALSE);
! 			rc_signal(SIGTTOU, (sighandler*)SIG_IGN);	/* Berkeleyized version: put it in a new pgroup. */
! 			rc_signal(SIGTTIN, (sighandler*)SIG_IGN);
! 			rc_signal(SIGTSTP, (sighandler*)SIG_IGN);
  			setpgrp(0, getpid());
  #else
  			setsigdefaults(TRUE);		/* ignore SIGINT, SIGQUIT, SIGTERM */

--- 44,52 -----
  		if ((pid = rc_fork()) == 0) {
  #if !defined(NOJOB) && defined(SIGTTOU) && defined(SIGTTIN) && defined(SIGTSTP)
  			setsigdefaults(FALSE);
! 			rc_signal(SIGTTOU, SIG_IGN);	/* Berkeleyized version: put it in a new pgroup. */
! 			rc_signal(SIGTTIN, SIG_IGN);
! 			rc_signal(SIGTSTP, SIG_IGN);
  			setpgrp(0, getpid());
  #else
  			setsigdefaults(TRUE);		/* ignore SIGINT, SIGQUIT, SIGTERM */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-10-04 13:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-10-04 12:20 patches to rc 1.4 Christopher Vance

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).