[comp.sources.atari.st] v02i072: gcclib2 -- Patches to GCC library part01/07

koreth%panarthea.ebay@sun.com (Steven Grimm) (08/20/89)

Submitted-by: uunet.UU.NET!unido!sbsvax!roeder (Edgar Roeder)
Posting-number: Volume 2, Issue 72
Archive-name: gcclib2/part01



This is my version of the gcc library. It was used to port GNU Emacs and many
other unix programs to the st. See the README for more details.
- Edgar
--------------------------------------------------------------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 7)."
# Contents:  MANIFEST README abort.c access.c.cdiff atol.c calloc.c
#   chdir.c chmod.c creat.c ctype.c.cdiff env.c exit.c fcntl.c
#   fdopen.c.cdiff fgets.c.cdiff fhandle.c files.c.cdiff fprintf.c
#   fputc.c.cdiff freopen.c.cdiff ftell.c getpage.c getpid.c include
#   include/assert.h include/param.h include/sgtty.h include/stdarg.h
#   include/sys include/sys/dir.h include/sys/errno.h
#   include/sys/file.h include/sys/ioctl.h include/sys/param.h
#   include/sys/signal.h include/sys/stat.h include/sys/time.h
#   include/sys/times.h include/sys/types.h include/time.h
#   include/times.h include/types.h link.c lseek.c mkdir.c parse-op.c
#   perror.c rand.c random.c readdir.c.cdiff rename.c scanf.c.cdiff
#   signame.c strcpy.c.cdiff strlen.c.cdiff times.c uid.c unlink.c
#   utime.c vsprintf.c
# Wrapped by roeder@sbsvax on Wed Aug 16 22:02:54 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(3555 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X MANIFEST                   1	This shipping list
X README                     1	
X abort.c                    1	
X access.c.cdiff             1	
X alrm_nas.s                 3	
X atexit.c                   2	
X atol.c                     1	
X calloc.c                   1	
X chdir.c                    1	
X chmod.c                    1	
X close.c                    2	
X closedir.c.cdiff           2	
X console.c.cdiff            2	
X convert.c                  2	
X creat.c                    1	
X crt0.s                     5	
X ctime.c                    2	
X ctype.c.cdiff              1	
X env.c                      1	
X exit.c                     1	
X fclose.c                   2	
X fcntl.c                    1	
X fdopen.c.cdiff             1	
X fflush.c                   2	
X fgets.c.cdiff              1	
X fhandle.c                  1	
X files.c.cdiff              1	
X fopen.c                    2	
X fprintf.c                  1	
X fputc.c.cdiff              1	
X freopen.c.cdiff            1	
X ftell.c                    1	
X getpage.c                  1	
X getpid.c                   1	
X getwd.c                    2	
X include                    1	
X include/assert.h           1	
X include/ctype.h            2	
X include/dir.h              2	
X include/errno.h            3	
X include/fcntl.h            2	
X include/file.h             2	
X include/ioctl.h            2	
X include/osbind.h           6	
X include/param.h            1	
X include/sgtty.h            1	
X include/siglist.h          2	
X include/signal.h           3	
X include/stat.h             3	
X include/stdarg.h           1	
X include/stdio.h            3	
X include/stdlib.h           3	
X include/sys                1	
X include/sys/dir.h          1	
X include/sys/errno.h        1	
X include/sys/file.h         1	
X include/sys/ioctl.h        1	
X include/sys/param.h        1	
X include/sys/signal.h       1	
X include/sys/stat.h         1	
X include/sys/time.h         1	
X include/sys/times.h        1	
X include/sys/types.h        1	
X include/sysvars.h          2	
X include/tchars.h           2	
X include/time.h             1	
X include/times.h            1	
X include/types.h            1	
X ioctl.c.cdiff              3	
X isatty.c.cdiff             2	
X link.c                     1	
X localtim.c                 2	
X lseek.c                    1	
X malloc.c                   7	
X memory.c.cdiff             4	
X mkdir.c                    1	
X open.c                     3	
X opendir.c.cdiff            3	
X parse-op.c                 1	
X pause.c                    2	
X perror.c                   1	
X pexecv.c                   4	
X rand.c                     1	
X random.c                   1	
X read.c                     5	
X readdir.c.cdiff            1	
X rename.c                   1	
X scanf.c.cdiff              1	
X sfguts.c.cdiff             2	
X signal.c                   4	
X signame.c                  1	
X st-error.c                 3	
X stat.c                     4	
X std-guts.h                 2	
X std-init.c                 3	
X strcpy.c.cdiff             1	
X strlen.c.cdiff             1	
X strstr.c                   2	
X system.c                   4	
X tchars.c                   2	
X time.c                     3	
X timer.c                    4	
X times.c                    1	
X trap-1.c                   3	
X trap-13.c                  3	
X trap-14.c                  2	
X uid.c                      1	
X unlink.c                   1	
X utime.c                    1	
X vsprintf.c                 1	
X write.c.cdiff              3	
END_OF_FILE
if test 3555 -ne `wc -c <'MANIFEST'`; then
    echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(2275 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XThis is my version of the GNU C compiler library. I used it to port GNU Emacs
Xto the Atari ST. I have included the original files when the diffs would be
Xlarger. Context diffs are produced against the current version at the
Xterminator archive server. Also included are some of the include files which
Xhave changed.  The changes are:
X	- Filenames are converted from unix to tos syntax and vice versa in
X	  all file handling routines. So you need no longer worry about the
X	  use of slashes in filenames when porting programs from unix. The
X	  old writing with backslash is also supported.
X	- The time function now returns seconds since Jan 1 1970. All time
X	  functions have changed to deal with this format.
X	- Error numbers are now positive (according to the ANSI standard).
X	- stat/fstat now get similar information than their unix counterparts.
X	- O_APPEND is now handled correctly.
X	- Some error checks have been included in string functions.
X	- crt0.s uses xArg parameter passing (also provided by Pexecv).
X	- Some routines now return more reasonable values than before (getpid).
X	- read recognizes Alternate as Meta key and gives escape sequences for
X	  the function keys. O_NDELAY mode is now implemented.
X	- The signal stuff was almost completly rewritten. More signals are
X	  now possible. SIGINT as generated by tos can be ignored. SIGTSTP
X	  gives you an interactive shell. SIGALRM and SIGHUP are served even in
X	  the middle of an operating system call.
X	- The bindings in osbind.h have been rewritten to inline functions. Now
X	  they are faster and (for Super()) more correct.
X	- Resident shells at _shell_p are recognized and can be accessed with
X	  three new system calls.
X	- Information about the running time can be obtained from clock() or
X	  times().
X	- atexit() is now supported.
XWhenever possible i tried to make my routines conforming to the new ANSI C
Xstandard or the corresponding unix-library functions. Because porting is easier
Xif you have a good library, if i had to choose between a change in a program
Xor a new library routine, i most of the time took the latter decision.
XSure there would be only some small changes for this particular program.
X
X- Edgar
X
X				If something can be done automatically,
X				the computer should do the work for you.
END_OF_FILE
if test 2275 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'abort.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'abort.c'\"
else
echo shar: Extracting \"'abort.c'\" \(546 characters\)
sed "s/^X//" >'abort.c' <<'END_OF_FILE'
X#include <signal.h>
X#include <stdio.h>
X
Xabort()
X{
X  int * stackp;
X  int i;
X
X  stackp = (int * )&stackp;
X  fprintf(stderr, "\r\n\n!!! Aborting!!! stack = \r\n");
X  for(i = 0 ; i < 16 ; i++)
X  	fprintf(stderr,"%lx: %lx\r\n", stackp, *stackp++);
X  getchar();
X  raise(SIGABRT);
X  exit(-999);
X}
X
X_abort_internal(line, file)
Xint line;
Xchar * file;
X{
X  fprintf(stderr, "Aborting at line %d of file %s\r\n", line, file);
X  abort();		/* note that this won't work of compile this
X			   with the define that got us to this fun in
X			   the first place */
X}
END_OF_FILE
if test 546 -ne `wc -c <'abort.c'`; then
    echo shar: \"'abort.c'\" unpacked with wrong size!
fi
# end of 'abort.c'
fi
if test -f 'access.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'access.c.cdiff'\"
else
echo shar: Extracting \"'access.c.cdiff'\" \(405 characters\)
sed "s/^X//" >'access.c.cdiff' <<'END_OF_FILE'
X*** terminator/access.c	Fri Aug 11 18:51:39 1989
X--- new-lib/access.c	Thu Jul  6 16:51:42 1989
X***************
X*** 6,7 ****
X--- 6,9 ----
X   *
X+  * er	: added user/group/other distinction
X+  *
X   * $Log:	access.c,v $
X***************
X*** 24,26 ****
X  		return -1;
X! 	if ((statb.st_mode & mode) == mode)
X  		return 0;
X--- 26,28 ----
X  		return -1;
X! 	if (((statb.st_mode >> 6) & mode) == mode)
X  		return 0;
END_OF_FILE
if test 405 -ne `wc -c <'access.c.cdiff'`; then
    echo shar: \"'access.c.cdiff'\" unpacked with wrong size!
fi
# end of 'access.c.cdiff'
fi
if test -f 'atol.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'atol.c'\"
else
echo shar: Extracting \"'atol.c'\" \(51 characters\)
sed "s/^X//" >'atol.c' <<'END_OF_FILE'
X
Xlong atol(char *num) { return((long)atoi(num)); }
END_OF_FILE
if test 51 -ne `wc -c <'atol.c'`; then
    echo shar: \"'atol.c'\" unpacked with wrong size!
fi
# end of 'atol.c'
fi
if test -f 'calloc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'calloc.c'\"
else
echo shar: Extracting \"'calloc.c'\" \(229 characters\)
sed "s/^X//" >'calloc.c' <<'END_OF_FILE'
X#define NULL	(char *) 0
X
Xextern char	*malloc();
X
Xchar * calloc(n, sz)
Xunsigned n, sz;
X{
X  char *r, *s;
X  unsigned total;
X
X  total = n * sz;
X  if ((r = s = malloc(total)) != NULL)
X	{
X	while (total--)
X		*s++ = 0;
X	}
X  return(r);
X}
END_OF_FILE
if test 229 -ne `wc -c <'calloc.c'`; then
    echo shar: \"'calloc.c'\" unpacked with wrong size!
fi
# end of 'calloc.c'
fi
if test -f 'chdir.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'chdir.c'\"
else
echo shar: Extracting \"'chdir.c'\" \(129 characters\)
sed "s/^X//" >'chdir.c' <<'END_OF_FILE'
X#include <osbind.h>
X
Xint chdir(char *d)
X{
X	char	dir[strlen(d)+1];
X
X	strcpy(dir,d);
X	unix_to_tos(dir);
X	return(Dsetpath(dir));
X}
X
END_OF_FILE
if test 129 -ne `wc -c <'chdir.c'`; then
    echo shar: \"'chdir.c'\" unpacked with wrong size!
fi
# end of 'chdir.c'
fi
if test -f 'chmod.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'chmod.c'\"
else
echo shar: Extracting \"'chmod.c'\" \(332 characters\)
sed "s/^X//" >'chmod.c' <<'END_OF_FILE'
X#include <types.h>
X#include <osbind.h>
X#include <stat.h>
X
Xint
Xchmod(char *f, int filemode)
X{
X	char	filename[strlen(f)+1];
X	int	ret;
X	int	attr;
X
X	strcpy(filename,f);
X	unix_to_tos(filename);
X	attr = 0;
X	if(!(filemode & S_IWRITE)) attr |= FA_RDONLY;
X	if(!(filemode & S_IREAD)) attr |= FA_HIDDEN;
X	return(Fattrib(filename, 1, attr));
X}
END_OF_FILE
if test 332 -ne `wc -c <'chmod.c'`; then
    echo shar: \"'chmod.c'\" unpacked with wrong size!
fi
# end of 'chmod.c'
fi
if test -f 'creat.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'creat.c'\"
else
echo shar: Extracting \"'creat.c'\" \(114 characters\)
sed "s/^X//" >'creat.c' <<'END_OF_FILE'
X#include <file.h>
X
Xint
Xcreat(char *filename, int mode)
X{
X	return(open(filename,O_WRONLY|O_CREAT|O_TRUNC,mode));
X}
END_OF_FILE
if test 114 -ne `wc -c <'creat.c'`; then
    echo shar: \"'creat.c'\" unpacked with wrong size!
fi
# end of 'creat.c'
fi
if test -f 'ctype.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ctype.c.cdiff'\"
else
echo shar: Extracting \"'ctype.c.cdiff'\" \(332 characters\)
sed "s/^X//" >'ctype.c.cdiff' <<'END_OF_FILE'
X*** terminator/ctype.c	Fri Aug 11 18:51:57 1989
X--- new-lib/ctype.c	Mon Feb  6 18:19:30 1989
X***************
X*** 37,39 ****
X  	_L|_P,	_L|_P,	_L|_P,	_P,			/* 'x'  .. '{'  */
X! 	_P,	_P,	_P,	_P			/* '|'  .. #x7F  */
X  	};
X--- 37,39 ----
X  	_L|_P,	_L|_P,	_L|_P,	_P,			/* 'x'  .. '{'  */
X! 	_P,	_P,	_P,	_P|_C			/* '|'  .. #x7F  */
X  	};
END_OF_FILE
if test 332 -ne `wc -c <'ctype.c.cdiff'`; then
    echo shar: \"'ctype.c.cdiff'\" unpacked with wrong size!
fi
# end of 'ctype.c.cdiff'
fi
if test -f 'env.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'env.c'\"
else
echo shar: Extracting \"'env.c'\" \(318 characters\)
sed "s/^X//" >'env.c' <<'END_OF_FILE'
X/* stuff for reading env vars sent in by Gulam */
X
Xextern char ** environ;
X
Xchar * getenv (tag)
Xchar * tag;
X{
X  char ** var;
X  char * name;
X  int	len;
X
X  for (var = environ ; name = *var ; var++)
X	{
X	if ((!strncmp(name, tag, len = strlen(tag))) 
X	    && (name[len] == '='))
X		return(name + len + 1);
X	}
X  return(0);
X}
END_OF_FILE
if test 318 -ne `wc -c <'env.c'`; then
    echo shar: \"'env.c'\" unpacked with wrong size!
fi
# end of 'env.c'
fi
if test -f 'exit.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'exit.c'\"
else
echo shar: Extracting \"'exit.c'\" \(449 characters\)
sed "s/^X//" >'exit.c' <<'END_OF_FILE'
X#include <stdio.h>
X
Xstruct func_list {
X	void			(*func)(void);
X	struct func_list	*next_entry;
X} *_atexit_list = (struct func_list *) 0;
X
Xvoid
Xexit(value)
Xint value;
X{
X  void	(*f)(void);
X
X  while(_atexit_list) {
X	f = _atexit_list->func;
X	/* free(_atexit_list) not necessary, because we _exit anyway */
X	_atexit_list = _atexit_list->next_entry;
X	(*f)();
X  }
X  _fflush_all_files();
X  fflush(stdin);
X  fflush(stdout);
X  fflush(stderr);
X  _exit(value);
X}
END_OF_FILE
if test 449 -ne `wc -c <'exit.c'`; then
    echo shar: \"'exit.c'\" unpacked with wrong size!
fi
# end of 'exit.c'
fi
if test -f 'fcntl.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'fcntl.c'\"
else
echo shar: Extracting \"'fcntl.c'\" \(327 characters\)
sed "s/^X//" >'fcntl.c' <<'END_OF_FILE'
X#include <file.h>
X#include <fcntl.h>
X#include <errno.h>
X
Xint
Xfcntl(int fd, int func, int flags)
X{
X	int	ret;
X
X	if(fd >= N_HANDLES) {
X		errno = EBADF;
X		return -1;
X	}
X	ret = __handle_stat[fd] & O_NDELAY;
X	if(func == F_SETFL) {
X		flags |= __handle_stat[fd] & (FH_ISATTY|FH_ISAFILE);
X		__handle_stat[fd] = flags;
X	}
X	return ret;
X}
END_OF_FILE
if test 327 -ne `wc -c <'fcntl.c'`; then
    echo shar: \"'fcntl.c'\" unpacked with wrong size!
fi
# end of 'fcntl.c'
fi
if test -f 'fdopen.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'fdopen.c.cdiff'\"
else
echo shar: Extracting \"'fdopen.c.cdiff'\" \(435 characters\)
sed "s/^X//" >'fdopen.c.cdiff' <<'END_OF_FILE'
X*** terminator/fdopen.c	Fri Aug 11 18:52:05 1989
X--- new-lib/fdopen.c	Tue Aug 15 16:30:22 1989
X***************
X*** 1,2 ****
X- 
X  /* fdopen */
X--- 1 ----
X***************
X*** 18,20 ****
X    f->flags = _parse_open_options(mode); 
X!   f->file_position = 0;
X  /* should really check first... */
X--- 17,19 ----
X    f->flags = _parse_open_options(mode); 
X!   f->file_position = lseek(handle, 0L, L_INCR);
X  /* should really check first... */
END_OF_FILE
if test 435 -ne `wc -c <'fdopen.c.cdiff'`; then
    echo shar: \"'fdopen.c.cdiff'\" unpacked with wrong size!
fi
# end of 'fdopen.c.cdiff'
fi
if test -f 'fgets.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'fgets.c.cdiff'\"
else
echo shar: Extracting \"'fgets.c.cdiff'\" \(561 characters\)
sed "s/^X//" >'fgets.c.cdiff' <<'END_OF_FILE'
X*** terminator/fgets.c	Fri Aug 11 18:52:10 1989
X--- new-lib/fgets.c	Thu Mar  2 22:33:20 1989
X***************
X*** 2,3 ****
X--- 2,4 ----
X  /* fgets */
X+ /* repaired somewhat by ERS -- gets didn't used to work */
X  
X***************
X*** 68,71 ****
X  {
X!   fgets(buf, 99999999, stdin);
X!   return(buf);
X  }
X--- 69,80 ----
X  {
X!   char *t;
X!   if ( fgets(buf, 99999999, stdin) ) {
X!         for (t = buf; *t; t++) ;
X!         if ((t > buf) && (*(t-1) == '\n')) {
X!            --t; *t = '\0';
X!         }
X!         return(buf);
X!   }
X!   else
X!       return NULL;
X  }
END_OF_FILE
if test 561 -ne `wc -c <'fgets.c.cdiff'`; then
    echo shar: \"'fgets.c.cdiff'\" unpacked with wrong size!
fi
# end of 'fgets.c.cdiff'
fi
if test -f 'fhandle.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'fhandle.c'\"
else
echo shar: Extracting \"'fhandle.c'\" \(217 characters\)
sed "s/^X//" >'fhandle.c' <<'END_OF_FILE'
X/* file handle stat keeper, prevents excessive calls to isatty */
X
X#include "std-guts.h"
X#include "file.h"
X
Xchar	__handle_stat[N_HANDLES];	/* for isatty and fcntl */
Xchar	*__handle_to_name[N_HANDLES];	/* for fstat */
END_OF_FILE
if test 217 -ne `wc -c <'fhandle.c'`; then
    echo shar: \"'fhandle.c'\" unpacked with wrong size!
fi
# end of 'fhandle.c'
fi
if test -f 'files.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'files.c.cdiff'\"
else
echo shar: Extracting \"'files.c.cdiff'\" \(584 characters\)
sed "s/^X//" >'files.c.cdiff' <<'END_OF_FILE'
X*** terminator/files.c	Fri Aug 11 18:52:13 1989
X--- new-lib/files.c	Tue Aug 15 16:59:04 1989
X***************
X*** 75,77 ****
X  /* too bad we don't have package FS here... */
X! _close_all_files()
X  {
X--- 75,79 ----
X  /* too bad we don't have package FS here... */
X! /* we don't really need to close all open files because the operating */
X! /* system does this job for us when we exit */
X! _fflush_all_files()
X  {
X***************
X*** 81,83 ****
X  	if (_all_open_files[i])
X! 		fclose(_all_open_files[i]);
X  }
X--- 83,85 ----
X  	if (_all_open_files[i])
X! 		fflush(_all_open_files[i]);
X  }
END_OF_FILE
if test 584 -ne `wc -c <'files.c.cdiff'`; then
    echo shar: \"'files.c.cdiff'\" unpacked with wrong size!
fi
# end of 'files.c.cdiff'
fi
if test -f 'fprintf.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'fprintf.c'\"
else
echo shar: Extracting \"'fprintf.c'\" \(419 characters\)
sed "s/^X//" >'fprintf.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <stdio.h>
X
Xstatic void __fprintf_putc(c, f)
Xchar c;
XFILE * f;
X{
X  fputc(c, f);
X}
X
Xvoid fprintf(f, template, args)
XFILE * f;
Xchar * template;
Xlong args;
X{
X  _printf_guts(template, &args, __fprintf_putc, f);
X  if (isatty(fileno(f)))
X	fflush(f);
X}
X
Xvoid
Xvfprintf(FILE *f, const char *format, va_list arg)
X{
X	_printf_guts(format, arg, __fprintf_putc, f);
X	if (isatty(fileno(f)))
X		fflush(f);
X}
END_OF_FILE
if test 419 -ne `wc -c <'fprintf.c'`; then
    echo shar: \"'fprintf.c'\" unpacked with wrong size!
fi
# end of 'fprintf.c'
fi
if test -f 'fputc.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'fputc.c.cdiff'\"
else
echo shar: Extracting \"'fputc.c.cdiff'\" \(551 characters\)
sed "s/^X//" >'fputc.c.cdiff' <<'END_OF_FILE'
X*** terminator/fputc.c	Fri Aug 11 18:52:16 1989
X--- new-lib/fputc.c	Wed Aug 16 00:50:36 1989
X***************
X*** 1,2 ****
X- 
X  /* fputc */
X--- 1 ----
X***************
X*** 10,12 ****
X--- 9,15 ----
X  {
X+   long	new_pos;
X+ 
X    if (!f || !f->open_p || ((f->flags & 0x03) == O_RDONLY)) return(EOF);
X+   if (f->flags & O_APPEND && !(f->flags & O_DIRTY))
X+         fseek(f, 0L, L_XTND);	/* ++ sb */
X    if (f->buf_index >= BUFSIZE)
X***************
X*** 17,18 ****
X--- 20,22 ----
X    f->buf_index++;
X+   f->flags |= O_DIRTY;
X    if (f->buf_max < f->buf_index)
END_OF_FILE
if test 551 -ne `wc -c <'fputc.c.cdiff'`; then
    echo shar: \"'fputc.c.cdiff'\" unpacked with wrong size!
fi
# end of 'fputc.c.cdiff'
fi
if test -f 'freopen.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'freopen.c.cdiff'\"
else
echo shar: Extracting \"'freopen.c.cdiff'\" \(585 characters\)
sed "s/^X//" >'freopen.c.cdiff' <<'END_OF_FILE'
X*** terminator/freopen.c	Fri Aug 11 18:52:18 1989
X--- new-lib/freopen.c	Tue Aug 15 23:33:20 1989
X***************
X*** 1,3 ****
X- 
X- 
X  /* freopen */
X--- 1 ----
X***************
X*** 32,34 ****
X    new_flags = _parse_open_options(mode);
X!   new_handle = open(pathname, new_flags, 0);
X    if (new_handle < 0)
X--- 30,32 ----
X    new_flags = _parse_open_options(mode);
X!   new_handle = open(pathname, new_flags, 0644);
X    if (new_handle < 0)
X***************
X*** 41,42 ****
X--- 39,42 ----
X    f->last_file_error = 0;
X+   f->file_position = lseek(new_handle, 0L, L_INCR);
X+   f->eof_p = 0;
X  
END_OF_FILE
if test 585 -ne `wc -c <'freopen.c.cdiff'`; then
    echo shar: \"'freopen.c.cdiff'\" unpacked with wrong size!
fi
# end of 'freopen.c.cdiff'
fi
if test -f 'ftell.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ftell.c'\"
else
echo shar: Extracting \"'ftell.c'\" \(159 characters\)
sed "s/^X//" >'ftell.c' <<'END_OF_FILE'
X
X/* ftell */
X
X#include "std-guts.h"
X
Xint ftell(f)
Xstruct file * f;
X{
X  if (!f || !f->open_p)
X	return(-1);
X    else
X	return(f->file_position + f->buf_index);
X}
END_OF_FILE
if test 159 -ne `wc -c <'ftell.c'`; then
    echo shar: \"'ftell.c'\" unpacked with wrong size!
fi
# end of 'ftell.c'
fi
if test -f 'getpage.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'getpage.c'\"
else
echo shar: Extracting \"'getpage.c'\" \(35 characters\)
sed "s/^X//" >'getpage.c' <<'END_OF_FILE'
Xint
Xgetpagesize()
X{
X	return 256;
X}
END_OF_FILE
if test 35 -ne `wc -c <'getpage.c'`; then
    echo shar: \"'getpage.c'\" unpacked with wrong size!
fi
# end of 'getpage.c'
fi
if test -f 'getpid.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'getpid.c'\"
else
echo shar: Extracting \"'getpid.c'\" \(103 characters\)
sed "s/^X//" >'getpid.c' <<'END_OF_FILE'
X
X/* this is, of course, complete bullshit */
X
Xint getpid()
X{
X  extern long	_base;
X
X  return(_base);
X}
X
END_OF_FILE
if test 103 -ne `wc -c <'getpid.c'`; then
    echo shar: \"'getpid.c'\" unpacked with wrong size!
fi
# end of 'getpid.c'
fi
if test ! -d 'include' ; then
    echo shar: Creating directory \"'include'\"
    mkdir 'include'
fi
if test -f 'include/assert.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/assert.h'\"
else
echo shar: Extracting \"'include/assert.h'\" \(382 characters\)
sed "s/^X//" >'include/assert.h' <<'END_OF_FILE'
X#undef assert
X
X#ifdef NDEBUG
X#define assert(ignore)
X#else
X
X#define assert(expression)  \
X  do { if (!(expression)) __assert ((expression), __FILE__, __LINE__); } while (0)
X
X#define __assert(expression, file, line)  \
X  { _eprintf ("Failed assertion " #expression		\
X	      " at line %d of `" file "'.\n", line);	\
X    abort (); }
X
Xvoid _eprintf ();		/* Defined in gnulib */
X
X#endif
END_OF_FILE
if test 382 -ne `wc -c <'include/assert.h'`; then
    echo shar: \"'include/assert.h'\" unpacked with wrong size!
fi
# end of 'include/assert.h'
fi
if test -f 'include/param.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/param.h'\"
else
echo shar: Extracting \"'include/param.h'\" \(531 characters\)
sed "s/^X//" >'include/param.h' <<'END_OF_FILE'
X/*
X *		Cross Development System for Atari ST 
X *     Copyright (c) 1988, Memorial University of Newfoundland
X *
X * $Header: param.h,v 1.1 88/01/29 17:22:30 m68k Exp $
X *
X * $Log:	param.h,v $
X * Revision 1.1  88/01/29  17:22:30  m68k
X * Initial revision
X * 
X */
X#define	MAXPATHLEN	259		/* 256 + 2 for a: and 1 for null */
X#define MAXHOSTNAMELEN	MAXPATHLEN
X#define	NOFILE		20		/* max. number of open files/proc */
X#define	NCARGS		127		/* max number of chars in argv */
X#define	CANBSIZ		NCARGS		/* max # chars of input on one line */
END_OF_FILE
if test 531 -ne `wc -c <'include/param.h'`; then
    echo shar: \"'include/param.h'\" unpacked with wrong size!
fi
# end of 'include/param.h'
fi
if test -f 'include/sgtty.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sgtty.h'\"
else
echo shar: Extracting \"'include/sgtty.h'\" \(395 characters\)
sed "s/^X//" >'include/sgtty.h' <<'END_OF_FILE'
X/*
X *		Cross Development System for Atari ST 
X *     Copyright (c) 1988, Memorial University of Newfoundland
X *
X * $Header: sgtty.h,v 1.1 88/02/03 20:14:18 m68k Exp $
X *
X * $Log:	sgtty.h,v $
X * Revision 1.1  88/02/03  20:14:18  m68k
X * Initial revision
X * 
X */
X#ifndef	_IOCTL_
X# include <ioctl.h>
X#endif	/* _IOCTL_ */
X
X#define gtty(x,y)	ioctl(x,TIOCGETP,y)
X#define stty(x,y)	ioctl(x,TIOCSETP,y)
END_OF_FILE
if test 395 -ne `wc -c <'include/sgtty.h'`; then
    echo shar: \"'include/sgtty.h'\" unpacked with wrong size!
fi
# end of 'include/sgtty.h'
fi
if test -f 'include/stdarg.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/stdarg.h'\"
else
echo shar: Extracting \"'include/stdarg.h'\" \(446 characters\)
sed "s/^X//" >'include/stdarg.h' <<'END_OF_FILE'
X/* this is not right, e.g. if there is a char param it takes up 4 Bytes on */
X/* the stack and this is not sizeof(char) --> these functions should better */
X/* be inline functions (er) */
X
Xtypedef char * va_list;
X#define va_start(args, last_nonvararg) args = ((char * ) (&last_nonvararg) + sizeof(last_nonvararg))
X#define va_end(args)
X#define va_arg(args, elt_type) ((elt_type * ) (args += sizeof(elt_type)))[-1]
X#define va_dcl	va_list va_alist;
END_OF_FILE
if test 446 -ne `wc -c <'include/stdarg.h'`; then
    echo shar: \"'include/stdarg.h'\" unpacked with wrong size!
fi
# end of 'include/stdarg.h'
fi
if test ! -d 'include/sys' ; then
    echo shar: Creating directory \"'include/sys'\"
    mkdir 'include/sys'
fi
if test -f 'include/sys/dir.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/dir.h'\"
else
echo shar: Extracting \"'include/sys/dir.h'\" \(17 characters\)
sed "s/^X//" >'include/sys/dir.h' <<'END_OF_FILE'
X#include <dir.h>
END_OF_FILE
if test 17 -ne `wc -c <'include/sys/dir.h'`; then
    echo shar: \"'include/sys/dir.h'\" unpacked with wrong size!
fi
# end of 'include/sys/dir.h'
fi
if test -f 'include/sys/errno.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/errno.h'\"
else
echo shar: Extracting \"'include/sys/errno.h'\" \(19 characters\)
sed "s/^X//" >'include/sys/errno.h' <<'END_OF_FILE'
X#include <errno.h>
END_OF_FILE
if test 19 -ne `wc -c <'include/sys/errno.h'`; then
    echo shar: \"'include/sys/errno.h'\" unpacked with wrong size!
fi
# end of 'include/sys/errno.h'
fi
if test -f 'include/sys/file.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/file.h'\"
else
echo shar: Extracting \"'include/sys/file.h'\" \(18 characters\)
sed "s/^X//" >'include/sys/file.h' <<'END_OF_FILE'
X#include <file.h>
END_OF_FILE
if test 18 -ne `wc -c <'include/sys/file.h'`; then
    echo shar: \"'include/sys/file.h'\" unpacked with wrong size!
fi
# end of 'include/sys/file.h'
fi
if test -f 'include/sys/ioctl.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/ioctl.h'\"
else
echo shar: Extracting \"'include/sys/ioctl.h'\" \(19 characters\)
sed "s/^X//" >'include/sys/ioctl.h' <<'END_OF_FILE'
X#include <ioctl.h>
END_OF_FILE
if test 19 -ne `wc -c <'include/sys/ioctl.h'`; then
    echo shar: \"'include/sys/ioctl.h'\" unpacked with wrong size!
fi
# end of 'include/sys/ioctl.h'
fi
if test -f 'include/sys/param.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/param.h'\"
else
echo shar: Extracting \"'include/sys/param.h'\" \(19 characters\)
sed "s/^X//" >'include/sys/param.h' <<'END_OF_FILE'
X#include <param.h>
END_OF_FILE
if test 19 -ne `wc -c <'include/sys/param.h'`; then
    echo shar: \"'include/sys/param.h'\" unpacked with wrong size!
fi
# end of 'include/sys/param.h'
fi
if test -f 'include/sys/signal.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/signal.h'\"
else
echo shar: Extracting \"'include/sys/signal.h'\" \(20 characters\)
sed "s/^X//" >'include/sys/signal.h' <<'END_OF_FILE'
X#include <signal.h>
END_OF_FILE
if test 20 -ne `wc -c <'include/sys/signal.h'`; then
    echo shar: \"'include/sys/signal.h'\" unpacked with wrong size!
fi
# end of 'include/sys/signal.h'
fi
if test -f 'include/sys/stat.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/stat.h'\"
else
echo shar: Extracting \"'include/sys/stat.h'\" \(18 characters\)
sed "s/^X//" >'include/sys/stat.h' <<'END_OF_FILE'
X#include <stat.h>
END_OF_FILE
if test 18 -ne `wc -c <'include/sys/stat.h'`; then
    echo shar: \"'include/sys/stat.h'\" unpacked with wrong size!
fi
# end of 'include/sys/stat.h'
fi
if test -f 'include/sys/time.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/time.h'\"
else
echo shar: Extracting \"'include/sys/time.h'\" \(18 characters\)
sed "s/^X//" >'include/sys/time.h' <<'END_OF_FILE'
X#include <time.h>
END_OF_FILE
if test 18 -ne `wc -c <'include/sys/time.h'`; then
    echo shar: \"'include/sys/time.h'\" unpacked with wrong size!
fi
# end of 'include/sys/time.h'
fi
if test -f 'include/sys/times.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/times.h'\"
else
echo shar: Extracting \"'include/sys/times.h'\" \(184 characters\)
sed "s/^X//" >'include/sys/times.h' <<'END_OF_FILE'
X#ifndef SYS_TIMES_H
X#define SYS_TIMES_H
X#ifndef TYPES_H
X#include <types.h>
X#endif
X
Xstruct tms {
X	time_t	tms_utime;
X	time_t	tms_stime;
X	time_t	tms_cutime;
X	time_t	tms_cstime;
X};
X#endif
END_OF_FILE
if test 184 -ne `wc -c <'include/sys/times.h'`; then
    echo shar: \"'include/sys/times.h'\" unpacked with wrong size!
fi
# end of 'include/sys/times.h'
fi
if test -f 'include/sys/types.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/sys/types.h'\"
else
echo shar: Extracting \"'include/sys/types.h'\" \(19 characters\)
sed "s/^X//" >'include/sys/types.h' <<'END_OF_FILE'
X#include <types.h>
END_OF_FILE
if test 19 -ne `wc -c <'include/sys/types.h'`; then
    echo shar: \"'include/sys/types.h'\" unpacked with wrong size!
fi
# end of 'include/sys/types.h'
fi
if test -f 'include/time.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/time.h'\"
else
echo shar: Extracting \"'include/time.h'\" \(629 characters\)
sed "s/^X//" >'include/time.h' <<'END_OF_FILE'
X#ifndef _TIME_H
X#define _TIME_H
X#include <types.h>
X
X#define CLK_TCK	200
X
Xstruct tm {
X	int	tm_sec;		/* 0..59 (on ST only the even values) */
X	int	tm_min;		/* 0..59 */
X	int	tm_hour;	/* 0..23 */
X	int	tm_mday;	/* day in month 1..31 */
X	int	tm_mon;		/* month 0..11 */
X	int	tm_year;	/* year - 1970 */
X	int	tm_wday;	/* day in week 0..6 (0 = sunday) */
X	int	tm_yday;	/* day in year 0..365 */
X	int	tm_isdst;	/* daylight saving time */
X};
X
Xextern struct tm	*gmtime(const time_t * const timep);
Xextern struct tm	*localtime(const time_t * const timep);
Xextern char		*asctime(struct tm * t);
Xextern clock_t		clock(void);
X#endif /* _TIME_H */
END_OF_FILE
if test 629 -ne `wc -c <'include/time.h'`; then
    echo shar: \"'include/time.h'\" unpacked with wrong size!
fi
# end of 'include/time.h'
fi
if test -f 'include/times.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/times.h'\"
else
echo shar: Extracting \"'include/times.h'\" \(199 characters\)
sed "s/^X//" >'include/times.h' <<'END_OF_FILE'
X#ifndef SYS_TIMES_H
X#define SYS_TIMES_H
X#ifndef TYPES_H
X#include <types.h>
X#endif
X
Xstruct tms {
X	time_t	tms_utime;
X	time_t	tms_stime;
X	time_t	tms_cutime;
X	time_t	tms_cstime;
X};
X
X#define	HZ	60
X#endif
END_OF_FILE
if test 199 -ne `wc -c <'include/times.h'`; then
    echo shar: \"'include/times.h'\" unpacked with wrong size!
fi
# end of 'include/times.h'
fi
if test -f 'include/types.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/types.h'\"
else
echo shar: Extracting \"'include/types.h'\" \(596 characters\)
sed "s/^X//" >'include/types.h' <<'END_OF_FILE'
X#ifndef _TYPES_H
X/*
X *		Cross Development System for Atari ST 
X *     Copyright (c) 1988, Memorial University of Newfoundland
X *
X * $Header: types.h,v 1.1 88/01/29 17:22:35 m68k Exp $
X *
X * $Log:	types.h,v $
X * Revision 1.1  88/01/29  17:22:35  m68k
X * Initial revision
X * 
X */
Xtypedef unsigned char	u_char;
Xtypedef unsigned short	u_short;
Xtypedef unsigned long	u_long;
X
Xtypedef u_long		ino_t;
Xtypedef short		dev_t;
Xtypedef long		off_t;
Xtypedef long		time_t;
Xtypedef u_long		clock_t;
Xtypedef u_short		uid_t;
Xtypedef u_short		gid_t;
Xtypedef char *		caddr_t;
X
X#define _TYPES_H
X#endif	/* types.h */
END_OF_FILE
if test 596 -ne `wc -c <'include/types.h'`; then
    echo shar: \"'include/types.h'\" unpacked with wrong size!
fi
# end of 'include/types.h'
fi
if test -f 'link.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'link.c'\"
else
echo shar: Extracting \"'link.c'\" \(70 characters\)
sed "s/^X//" >'link.c' <<'END_OF_FILE'
Xint	link (const char * fromname, const char * toname)
X{
X	return(1);
X}
END_OF_FILE
if test 70 -ne `wc -c <'link.c'`; then
    echo shar: \"'link.c'\" unpacked with wrong size!
fi
# end of 'link.c'
fi
if test -f 'lseek.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'lseek.c'\"
else
echo shar: Extracting \"'lseek.c'\" \(343 characters\)
sed "s/^X//" >'lseek.c' <<'END_OF_FILE'
X/* seek to a position in a file */
X
X#include <osbind.h>
X
X#ifdef DEBUG
Xextern int stderr;
X#endif
X
Xint lseek(fd, offset, mode)
Xint fd;
Xlong offset;
Xint mode; 
X{
X  int result;
X
X  if (fd == 1234) return(0);
X  result = Fseek(offset, fd, mode);
X#ifdef DEBUG
X  fprintf(stderr, "lseek(%d, %d, %d)->%d\n", fd, offset, mode);
X#endif
X  return(result);
X}
END_OF_FILE
if test 343 -ne `wc -c <'lseek.c'`; then
    echo shar: \"'lseek.c'\" unpacked with wrong size!
fi
# end of 'lseek.c'
fi
if test -f 'mkdir.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mkdir.c'\"
else
echo shar: Extracting \"'mkdir.c'\" \(194 characters\)
sed "s/^X//" >'mkdir.c' <<'END_OF_FILE'
X#include <osbind.h>
X
Xint mkdir(dir, useless_eunuchs_ism)
Xchar * dir;
Xint useless_eunuchs_ism;
X{
X  char	name[strlen(dir)+1];
X
X  strcpy(name, dir);
X  unix_to_tos(name);
X  return(Dcreate(name));
X}
END_OF_FILE
if test 194 -ne `wc -c <'mkdir.c'`; then
    echo shar: \"'mkdir.c'\" unpacked with wrong size!
fi
# end of 'mkdir.c'
fi
if test -f 'parse-op.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'parse-op.c'\"
else
echo shar: Extracting \"'parse-op.c'\" \(567 characters\)
sed "s/^X//" >'parse-op.c' <<'END_OF_FILE'
X#include <fcntl.h>
X
Xshort _parse_open_options(options)
Xchar * options;
X{
X  int open_flags = 0;
X  int extra = 0;
X/* this version's better, but still not quite right... */
X  for ( ; *options ; options++)
X	switch (*options)
X		{
X		case 'w': 
X			extra |= O_CREAT | O_TRUNC;
X			open_flags = O_WRONLY;
X			break;
X		case 'r':
X			open_flags = O_RDONLY;
X			break;
X		case 'a':
X			open_flags = O_WRONLY;
X			extra |= O_CREAT | O_APPEND;
X			break;
X		case '+': 
X			open_flags = O_RDWR; 
X			break;
X		case 'b':
X			extra |= FILE_BINARY_P; 
X			break;
X		}
X  return(open_flags | extra);
X}
END_OF_FILE
if test 567 -ne `wc -c <'parse-op.c'`; then
    echo shar: \"'parse-op.c'\" unpacked with wrong size!
fi
# end of 'parse-op.c'
fi
if test -f 'perror.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'perror.c'\"
else
echo shar: Extracting \"'perror.c'\" \(299 characters\)
sed "s/^X//" >'perror.c' <<'END_OF_FILE'
X/* more guesswork and kludgery... */
X
X#include <errno.h>
X#include <stdio.h>
X
Xvoid perror(msg)
Xchar * msg;
X{
X  if (msg) fprintf(stderr, "%s: ", msg);
X  if ((errno > sys_nerr) || (errno < 0))
X	fprintf(stderr, "Unknown error");
X    else
X	fprintf(stderr, sys_errlist[errno]);
X  fprintf(stderr, "\n");
X}
END_OF_FILE
if test 299 -ne `wc -c <'perror.c'`; then
    echo shar: \"'perror.c'\" unpacked with wrong size!
fi
# end of 'perror.c'
fi
if test -f 'rand.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rand.c'\"
else
echo shar: Extracting \"'rand.c'\" \(139 characters\)
sed "s/^X//" >'rand.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <osbind.h>
X
X#define RAND_MAX	0x7FFF
X
Xrand()
X{
X	return((Random() >> 3) & RAND_MAX);
X}
X
Xsrand()
X{
X	/* empty */
X}
END_OF_FILE
if test 139 -ne `wc -c <'rand.c'`; then
    echo shar: \"'rand.c'\" unpacked with wrong size!
fi
# end of 'rand.c'
fi
if test -f 'random.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'random.c'\"
else
echo shar: Extracting \"'random.c'\" \(204 characters\)
sed "s/^X//" >'random.c' <<'END_OF_FILE'
Xstatic unsigned long _seed = 1;
X
Xint random()
X	{
X	_seed = (_seed * 1103515245) + 12345;
X	return((unsigned int) ((_seed / 65536) % 32768));
X	}
X
Xvoid srandom(seed)
X	unsigned int seed;
X	{
X	_seed = seed;
X	}
X
END_OF_FILE
if test 204 -ne `wc -c <'random.c'`; then
    echo shar: \"'random.c'\" unpacked with wrong size!
fi
# end of 'random.c'
fi
if test -f 'readdir.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'readdir.c.cdiff'\"
else
echo shar: Extracting \"'readdir.c.cdiff'\" \(461 characters\)
sed "s/^X//" >'readdir.c.cdiff' <<'END_OF_FILE'
X*** terminator/readdir.c	Fri Aug 11 18:52:51 1989
X--- new-lib/readdir.c	Fri Jan 20 10:01:52 1989
X***************
X*** 25,26 ****
X--- 25,28 ----
X  
X+ static ino_t	inode;
X+ 
X  struct direct	*
X***************
X*** 35,37 ****
X  		strlen(strcpy(dp.d_name, dirp->dd_cp->_d_entry));
X! 	dp.d_ino = 0;
X  	dirp->dd_cp = dirp->dd_cp->_d_next;
X--- 37,39 ----
X  		strlen(strcpy(dp.d_name, dirp->dd_cp->_d_entry));
X! 	dp.d_ino = ++inode;
X  	dirp->dd_cp = dirp->dd_cp->_d_next;
END_OF_FILE
if test 461 -ne `wc -c <'readdir.c.cdiff'`; then
    echo shar: \"'readdir.c.cdiff'\" unpacked with wrong size!
fi
# end of 'readdir.c.cdiff'
fi
if test -f 'rename.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rename.c'\"
else
echo shar: Extracting \"'rename.c'\" \(606 characters\)
sed "s/^X//" >'rename.c' <<'END_OF_FILE'
X#include "file.h"
X#include "osbind.h"
X
X#define alloca	__builtin_alloca
X
X#ifdef DEBUG
Xextern int stderr;
X#endif
X
Xint rename(old, new)
Xchar * old, * new;
X{
X  int result;
X  char	name1[strlen(old)+1], *name2;
X
X  name2 = alloca(strlen(new)+1);
X  strcpy(name1, old);
X  strcpy(name2, new);
X  unix_to_tos(name1);
X  unix_to_tos(name2);
X#ifdef DEBUG
X  fprintf(stderr, "  rename('%s', '%s')", name1, name2);
X#endif
X  Fdelete(name2);			/* necessary? */
X  result = Frename(name1, name2);
X#ifdef DEBUG
X  fprintf(stderr, " -> %d\n");
X#endif
X  if (result > 0) result = 0;	/* what does this mean??? */
X  return (result);
X}
END_OF_FILE
if test 606 -ne `wc -c <'rename.c'`; then
    echo shar: \"'rename.c'\" unpacked with wrong size!
fi
# end of 'rename.c'
fi
if test -f 'scanf.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'scanf.c.cdiff'\"
else
echo shar: Extracting \"'scanf.c.cdiff'\" \(205 characters\)
sed "s/^X//" >'scanf.c.cdiff' <<'END_OF_FILE'
X*** terminator/scanf.c	Fri Aug 11 18:52:55 1989
X--- new-lib/scanf.c	Wed Aug 16 19:06:35 1989
X***************
X*** 3,4 ****
X--- 3,7 ----
X  
X+ #define TRUE	(1)
X+ #define FALSE	(0)
X+ 
X  extern	char	_numstr[];
END_OF_FILE
if test 205 -ne `wc -c <'scanf.c.cdiff'`; then
    echo shar: \"'scanf.c.cdiff'\" unpacked with wrong size!
fi
# end of 'scanf.c.cdiff'
fi
if test -f 'signame.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'signame.c'\"
else
echo shar: Extracting \"'signame.c'\" \(21 characters\)
sed "s/^X//" >'signame.c' <<'END_OF_FILE'
X#include <siglist.h>
END_OF_FILE
if test 21 -ne `wc -c <'signame.c'`; then
    echo shar: \"'signame.c'\" unpacked with wrong size!
fi
# end of 'signame.c'
fi
if test -f 'strcpy.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'strcpy.c.cdiff'\"
else
echo shar: Extracting \"'strcpy.c.cdiff'\" \(406 characters\)
sed "s/^X//" >'strcpy.c.cdiff' <<'END_OF_FILE'
X*** terminator/strcpy.c	Fri Aug 11 18:53:10 1989
X--- new-lib/strcpy.c	Mon Jan  2 16:00:20 1989
X***************
X*** 10,12 ****
X--- 10,18 ----
X   * 
X+  * Revision 1.2  88/12/16  20:05:00  	stefan brueck
X+  *	if (!s1 || !s2)
X+  *		return NULL;
X+  *
X   */
X+ #define NULL 0L;
X+ 
X  char *
X***************
X*** 17,18 ****
X--- 23,27 ----
X  	char	*saves1 = s1;
X+ 
X+ 	if (!s1 || !s2)			/* ..sb */
X+ 		return NULL;
X  
END_OF_FILE
if test 406 -ne `wc -c <'strcpy.c.cdiff'`; then
    echo shar: \"'strcpy.c.cdiff'\" unpacked with wrong size!
fi
# end of 'strcpy.c.cdiff'
fi
if test -f 'strlen.c.cdiff' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'strlen.c.cdiff'\"
else
echo shar: Extracting \"'strlen.c.cdiff'\" \(169 characters\)
sed "s/^X//" >'strlen.c.cdiff' <<'END_OF_FILE'
X*** terminator/strlen.c	Fri Aug 11 18:53:11 1989
X--- new-lib/strlen.c	Fri Mar  3 16:13:58 1989
X***************
X*** 17,18 ****
X--- 17,19 ----
X  
X+ 	if(s)
X  	while (*s++)
END_OF_FILE
if test 169 -ne `wc -c <'strlen.c.cdiff'`; then
    echo shar: \"'strlen.c.cdiff'\" unpacked with wrong size!
fi
# end of 'strlen.c.cdiff'
fi
if test -f 'times.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'times.c'\"
else
echo shar: Extracting \"'times.c'\" \(472 characters\)
sed "s/^X//" >'times.c' <<'END_OF_FILE'
X#include <sys/times.h>
X#include <time.h>
X#define HZ	60
X
Xextern clock_t	_sys_runtime;	/* defined in system.c */
Xextern clock_t	_child_runtime;	/* defined in pexecv.c */
X
Xtimes(struct tms *buffer)
X{
X	if (!buffer) return;
X	buffer->tms_cutime = (time_t) (_child_runtime * HZ / CLK_TCK);
X	buffer->tms_cstime = (time_t) 0;
X	buffer->tms_stime = (time_t) (_sys_runtime * HZ / CLK_TCK);
X	buffer->tms_utime = (time_t)
X		((clock() - _sys_runtime - _child_runtime) * HZ / CLK_TCK);
X}
END_OF_FILE
if test 472 -ne `wc -c <'times.c'`; then
    echo shar: \"'times.c'\" unpacked with wrong size!
fi
# end of 'times.c'
fi
if test -f 'uid.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'uid.c'\"
else
echo shar: Extracting \"'uid.c'\" \(35 characters\)
sed "s/^X//" >'uid.c' <<'END_OF_FILE'
Xsetuid() {}
Xgetuid() { return 0; }
END_OF_FILE
if test 35 -ne `wc -c <'uid.c'`; then
    echo shar: \"'uid.c'\" unpacked with wrong size!
fi
# end of 'uid.c'
fi
if test -f 'unlink.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'unlink.c'\"
else
echo shar: Extracting \"'unlink.c'\" \(170 characters\)
sed "s/^X//" >'unlink.c' <<'END_OF_FILE'
X#include <osbind.h>
X
Xint unlink(filename)
Xchar * filename;
X{
X  char	name[strlen(filename) +1];
X
X  strcpy(name, filename);
X  unix_to_tos(name);
X  return(Fdelete(name));
X}
END_OF_FILE
if test 170 -ne `wc -c <'unlink.c'`; then
    echo shar: \"'unlink.c'\" unpacked with wrong size!
fi
# end of 'unlink.c'
fi
if test -f 'utime.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'utime.c'\"
else
echo shar: Extracting \"'utime.c'\" \(643 characters\)
sed "s/^X//" >'utime.c' <<'END_OF_FILE'
X#include <time.h>
X#include <osbind.h>
X#include <errno.h>
X
Xlong
X_tos_time(struct tm *buf)
X{
X	long	res;
X
X	/* first the time */
X	res = (buf->tm_hour << 11)|(buf->tm_min << 5)|(buf->tm_sec >> 1);
X	res <<= 16;
X	/* and then the date */
X	res |= ((buf->tm_year - 80) << 9)|((buf->tm_mon + 1) << 5)|(buf->tm_mday);
X	return(res);
X}
X
Xint
Xutime(char *name, time_t toset[2])
X{
X	struct	tm	*tm_buf;
X	long	tos_time;
X	int	fd;
X
X	tm_buf = localtime(&toset[1]);	/* modification time */
X	/* convert to TOS format */
X	tos_time = _tos_time(tm_buf);
X	if((fd = Fopen(name,1)) < 0) {
X		errno = -fd;
X		return(-1);
X	}
X	Fdatime(&tos_time,fd,1);
X	Fclose(fd);
X	return(0);
X}
END_OF_FILE
if test 643 -ne `wc -c <'utime.c'`; then
    echo shar: \"'utime.c'\" unpacked with wrong size!
fi
# end of 'utime.c'
fi
if test -f 'vsprintf.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'vsprintf.c'\"
else
echo shar: Extracting \"'vsprintf.c'\" \(194 characters\)
sed "s/^X//" >'vsprintf.c' <<'END_OF_FILE'
X#include <stdarg.h>
X
Xextern void	__sprintf_pushc(char c, char **str_p);
X
Xvoid
Xvsprintf(char *s, const char *format, va_list arg)
X{
X	_printf_guts(format, arg, __sprintf_pushc, &s);
X	*s = '\0';
X}
END_OF_FILE
if test 194 -ne `wc -c <'vsprintf.c'`; then
    echo shar: \"'vsprintf.c'\" unpacked with wrong size!
fi
# end of 'vsprintf.c'
fi
echo shar: End of archive 1 \(of 7\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 7 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0