home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: sjg@zen.void.oz.au (Simon J. Gerraty)
- Subject: v25i055: pdksh - Public Domain Korn Shell, v4, Part09/09
- Message-ID: <1991Nov13.031251.16408@sparky.imd.sterling.com>
- X-Md4-Signature: b29fed1a1f5d8137b6f61cb94f217666
- Date: Wed, 13 Nov 1991 03:12:51 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: sjg@zen.void.oz.au (Simon J. Gerraty)
- Posting-number: Volume 25, Issue 55
- Archive-name: pdksh/part09
- Environment: UNIX
-
- #! /bin/sh
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: PATCHDATES std/posix/dirent.h std/posix/dup2.c
- # std/posix/time.h std/stdc/memchr.c std/stdc/memcpy.c
- # std/stdc/memset.c std/stdc/strcat.c std/stdc/strcpy.c
- # std/stdc/strerror.c std/stdc/strlen.c
- # Wrapped by kent@sparky on Tue Nov 12 20:44:35 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 9 (of 9)."'
- if test -f 'PATCHDATES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'PATCHDATES'\"
- else
- echo shar: Extracting \"'PATCHDATES'\" \(37 characters\)
- sed "s/^X//" >'PATCHDATES' <<'END_OF_FILE'
- XPD ksh Version 4
- X09-Nov-91
- X10-Nov-91
- END_OF_FILE
- if test 37 -ne `wc -c <'PATCHDATES'`; then
- echo shar: \"'PATCHDATES'\" unpacked with wrong size!
- fi
- # end of 'PATCHDATES'
- fi
- if test -f 'std/posix/dirent.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/posix/dirent.h'\"
- else
- echo shar: Extracting \"'std/posix/dirent.h'\" \(87 characters\)
- sed "s/^X//" >'std/posix/dirent.h' <<'END_OF_FILE'
- X/* <dirent.h> based on BSD <sys/dir.h> */
- X
- X#include <sys/dir.h>
- X#define dirent direct
- X
- END_OF_FILE
- if test 87 -ne `wc -c <'std/posix/dirent.h'`; then
- echo shar: \"'std/posix/dirent.h'\" unpacked with wrong size!
- fi
- # end of 'std/posix/dirent.h'
- fi
- if test -f 'std/posix/dup2.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/posix/dup2.c'\"
- else
- echo shar: Extracting \"'std/posix/dup2.c'\" \(278 characters\)
- sed "s/^X//" >'std/posix/dup2.c' <<'END_OF_FILE'
- X/*
- X * Cheap imitation of BSD dup2()
- X */
- X
- X#include <fcntl.h>
- X
- X#if _SYSV
- Xint
- Xdup2( oldd, newd )
- Xint oldd, newd;
- X{
- X int fd;
- X
- X if (fcntl( oldd, F_GETFL, 0 ) < 0)
- X return( -1 );
- X
- X (void) close( newd );
- X fd = fcntl( oldd, F_DUPFD, newd );
- X
- X return( (fd > newd) ? -1 : fd );
- X}
- X#endif
- END_OF_FILE
- if test 278 -ne `wc -c <'std/posix/dup2.c'`; then
- echo shar: \"'std/posix/dup2.c'\" unpacked with wrong size!
- fi
- # end of 'std/posix/dup2.c'
- fi
- if test -f 'std/posix/time.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/posix/time.h'\"
- else
- echo shar: Extracting \"'std/posix/time.h'\" \(274 characters\)
- sed "s/^X//" >'std/posix/time.h' <<'END_OF_FILE'
- X/*
- X * Replacement for BSD <sys/time.h>
- X * because Ultrix screws it up.
- X */
- X
- Xstruct timeval {
- X long tv_sec; /* time_t */
- X long tv_usec; /* microsex */
- X};
- X
- Xstruct timezone {
- X int tz_minuteswest; /* of Greenwinch */
- X int tz_dsttime; /* type of dst correction to apply */
- X};
- END_OF_FILE
- if test 274 -ne `wc -c <'std/posix/time.h'`; then
- echo shar: \"'std/posix/time.h'\" unpacked with wrong size!
- fi
- # end of 'std/posix/time.h'
- fi
- if test -f 'std/stdc/memchr.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/stdc/memchr.c'\"
- else
- echo shar: Extracting \"'std/stdc/memchr.c'\" \(225 characters\)
- sed "s/^X//" >'std/stdc/memchr.c' <<'END_OF_FILE'
- X/* $Header$ */
- X
- X#include <string.h>
- X
- XVoid *
- Xmemchr(ap, c, n)
- X Const Void *ap;
- X register int c;
- X register size_t n;
- X{
- X register char *p = ap;
- X
- X if (n++ > 0)
- X while (--n > 0)
- X if (*p++ == c)
- X return --p;
- X return NULL;
- X}
- X
- END_OF_FILE
- if test 225 -ne `wc -c <'std/stdc/memchr.c'`; then
- echo shar: \"'std/stdc/memchr.c'\" unpacked with wrong size!
- fi
- # end of 'std/stdc/memchr.c'
- fi
- if test -f 'std/stdc/memcpy.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/stdc/memcpy.c'\"
- else
- echo shar: Extracting \"'std/stdc/memcpy.c'\" \(228 characters\)
- sed "s/^X//" >'std/stdc/memcpy.c' <<'END_OF_FILE'
- X/* $Header$ */
- X
- X#include <string.h>
- X
- XVoid *
- Xmemcpy(dap, sap, n)
- X Void *dap;
- X Const Void *sap;
- X register size_t n;
- X{
- X register char *dp = dap, *sp = (Void*) sap;
- X
- X if (n++ > 0)
- X while (--n > 0)
- X *dp++ = *sp++;
- X return dap;
- X}
- X
- END_OF_FILE
- if test 228 -ne `wc -c <'std/stdc/memcpy.c'`; then
- echo shar: \"'std/stdc/memcpy.c'\" unpacked with wrong size!
- fi
- # end of 'std/stdc/memcpy.c'
- fi
- if test -f 'std/stdc/memset.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/stdc/memset.c'\"
- else
- echo shar: Extracting \"'std/stdc/memset.c'\" \(196 characters\)
- sed "s/^X//" >'std/stdc/memset.c' <<'END_OF_FILE'
- X/* $Header$ */
- X
- X#include <string.h>
- X
- XVoid *
- Xmemset(ap, c, n)
- X Void *ap;
- X register int c;
- X register size_t n;
- X{
- X register char *p = ap;
- X
- X if (n++ > 0)
- X while (--n > 0)
- X *p++ = c;
- X return ap;
- X}
- X
- END_OF_FILE
- if test 196 -ne `wc -c <'std/stdc/memset.c'`; then
- echo shar: \"'std/stdc/memset.c'\" unpacked with wrong size!
- fi
- # end of 'std/stdc/memset.c'
- fi
- if test -f 'std/stdc/strcat.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/stdc/strcat.c'\"
- else
- echo shar: Extracting \"'std/stdc/strcat.c'\" \(322 characters\)
- sed "s/^X//" >'std/stdc/strcat.c' <<'END_OF_FILE'
- X#include <string.h>
- X
- X/*
- X * strcat - append string src to dst
- X */
- Xchar * /* dst */
- Xstrcat(dst, src)
- Xchar *dst;
- XConst char *src;
- X{
- X register char *dscan;
- X register Const char *sscan;
- X
- X for (dscan = dst; *dscan != '\0'; dscan++)
- X continue;
- X sscan = src;
- X while ((*dscan++ = *sscan++) != '\0')
- X continue;
- X return(dst);
- X}
- END_OF_FILE
- if test 322 -ne `wc -c <'std/stdc/strcat.c'`; then
- echo shar: \"'std/stdc/strcat.c'\" unpacked with wrong size!
- fi
- # end of 'std/stdc/strcat.c'
- fi
- if test -f 'std/stdc/strcpy.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/stdc/strcpy.c'\"
- else
- echo shar: Extracting \"'std/stdc/strcpy.c'\" \(278 characters\)
- sed "s/^X//" >'std/stdc/strcpy.c' <<'END_OF_FILE'
- X#include <string.h>
- X
- X/*
- X * strcpy - copy string src to dst
- X */
- Xchar * /* dst */
- Xstrcpy(dst, src)
- Xchar *dst;
- XConst char *src;
- X{
- X register char *dscan;
- X register Const char *sscan;
- X
- X dscan = dst;
- X sscan = src;
- X while ((*dscan++ = *sscan++) != '\0')
- X continue;
- X return(dst);
- X}
- END_OF_FILE
- if test 278 -ne `wc -c <'std/stdc/strcpy.c'`; then
- echo shar: \"'std/stdc/strcpy.c'\" unpacked with wrong size!
- fi
- # end of 'std/stdc/strcpy.c'
- fi
- if test -f 'std/stdc/strerror.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/stdc/strerror.c'\"
- else
- echo shar: Extracting \"'std/stdc/strerror.c'\" \(326 characters\)
- sed "s/^X//" >'std/stdc/strerror.c' <<'END_OF_FILE'
- X#include <string.h>
- X
- X/*
- X * strerror - map error number to descriptive string
- X *
- X * This version is obviously somewhat Unix-specific.
- X */
- Xchar *
- Xstrerror(errno)
- Xint errno;
- X{
- X extern int sys_nerr;
- X extern char *sys_errlist[];
- X
- X if (errno > 0 && errno < sys_nerr)
- X return(sys_errlist[errno]);
- X else
- X return("unknown error");
- X}
- END_OF_FILE
- if test 326 -ne `wc -c <'std/stdc/strerror.c'`; then
- echo shar: \"'std/stdc/strerror.c'\" unpacked with wrong size!
- fi
- # end of 'std/stdc/strerror.c'
- fi
- if test -f 'std/stdc/strlen.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std/stdc/strlen.c'\"
- else
- echo shar: Extracting \"'std/stdc/strlen.c'\" \(241 characters\)
- sed "s/^X//" >'std/stdc/strlen.c' <<'END_OF_FILE'
- X#include <string.h>
- X
- X/*
- X * strlen - length of string (not including NUL)
- X */
- Xsize_t
- Xstrlen(s)
- XConst char *s;
- X{
- X register Const char *scan;
- X register size_t count;
- X
- X count = 0;
- X scan = s;
- X while (*scan++ != '\0')
- X count++;
- X return(count);
- X}
- END_OF_FILE
- if test 241 -ne `wc -c <'std/stdc/strlen.c'`; then
- echo shar: \"'std/stdc/strlen.c'\" unpacked with wrong size!
- fi
- # end of 'std/stdc/strlen.c'
- fi
- echo shar: End of archive 9 \(of 9\).
- cp /dev/null ark9isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 9 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-