home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-25 | 27.8 KB | 1,265 lines |
- Newsgroups: comp.sources.misc
- From: sjg@zen.void.oz.au (Simon J. Gerraty)
- Subject: v29i082: pdksh - Public Domain Korn Shell, v4, Patch02b/2
- Message-ID: <1992Apr26.041007.21772@sparky.imd.sterling.com>
- X-Md4-Signature: 23dce6deb06e684bc1fa1d629e650abc
- Date: Sun, 26 Apr 1992 04:10:07 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: sjg@zen.void.oz.au (Simon J. Gerraty)
- Posting-number: Volume 29, Issue 82
- Archive-name: pdksh/patch02b
- Environment: UNIX
- Patch-To: pdksh: Volume 25, Issue 47-55
-
- *** std/stdc/ChangeLog.old Sat Apr 25 17:44:46 1992
- --- std/stdc/ChangeLog Sat Apr 25 14:52:16 1992
- ***************
- *** 1,3 ****
- --- 1,7 ----
- + Sat Apr 25 14:52:01 1992 Simon J. Gerraty (sjg@zen)
- +
- + * Added RCS keys to sources.
- +
- Mon Nov 25 13:19:01 1991 Simon J. Gerraty (sjg at zen)
-
- * Added all source modules to Makefile, but most remain commented
- *** std/stdc/Makefile.old Sat Apr 25 17:44:46 1992
- --- std/stdc/Makefile Sat Apr 25 18:19:42 1992
- ***************
- *** 1,5 ****
- # Standard C (ANSI) compatabilaty
- ! # @(#)Makefile 1.3 91/11/25 13:24:27
-
- # edit this makefile such that only the functions that
- # your systems doesn't have are provided.
- --- 1,5 ----
- # Standard C (ANSI) compatabilaty
- ! # $Id: Makefile,v 1.2 1992/04/25 08:19:26 sjg Exp $
-
- # edit this makefile such that only the functions that
- # your systems doesn't have are provided.
- ***************
- *** 19,26 ****
-
- CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
-
- ! MISC = Makefile stdio.h_std
- ! HDRS = limits.h stddef.h stdlib.h string.h time.h stdarg.h
- SYSHDRS = types.h
-
- SRCS = strstr.c memmove.c stdio.c clock.c fprintf.c memchr.c \
- --- 19,26 ----
-
- CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
-
- ! MISC = Makefile #stdio.h_std
- ! HDRS = limits.h stddef.h stdlib.h string.h time.h #stdarg.h
- SYSHDRS = types.h
-
- SRCS = strstr.c memmove.c stdio.c clock.c fprintf.c memchr.c \
- ***************
- *** 33,42 ****
- # some of these are untested!
- OBJS = $(LIB)(strstr.o) \
- $(LIB)(memmove.o) \
- - $(LIB)(stdio.o) \
- $(LIB)(clock.o) \
- - # $(LIB)(fprintf.o) \
- # $(LIB)(vprintf.o) \
- # $(LIB)(strtok.o) \
- # $(LIB)(memchr.o) \
- # $(LIB)(memcmp.o) \
- --- 33,42 ----
- # some of these are untested!
- OBJS = $(LIB)(strstr.o) \
- $(LIB)(memmove.o) \
- $(LIB)(clock.o) \
- # $(LIB)(vprintf.o) \
- + # $(LIB)(fprintf.o) \
- + # $(LIB)(sprintf.o) \
- # $(LIB)(strtok.o) \
- # $(LIB)(memchr.o) \
- # $(LIB)(memcmp.o) \
- ***************
- *** 43,50 ****
- # $(LIB)(memcpy.o) \
- # $(LIB)(memset.o) \
- # $(LIB)(setvbuf.o) \
- - # $(LIB)(sprintf.o) \
- - # $(LIB)(stdio.o) \
- # $(LIB)(strcat.o) \
- # $(LIB)(strchr.o) \
- # $(LIB)(strcmp.o) \
- --- 43,48 ----
- ***************
- *** 58,63 ****
- --- 56,62 ----
- # $(LIB)(strpbrk.o) \
- # $(LIB)(strrchr.o) \
- # $(LIB)(strspn.o) \
- + # $(LIB)(stdio.o) \
-
-
-
- ***************
- *** 64,74 ****
-
- all: $(LIB)
-
- ! link: $(HDRS) stdio.h
- [ -d $(INCL) ] || mkdir $(INCL)
- [ -d $(INCL)/sys ] || mkdir $(INCL)/sys
- ! ($(SHELL) ../mklinks $(INCL) stdio.h $(HDRS))
- ($(SHELL) ../mklinks $(INCL)/sys $(SYSHDRS))
-
- $(LIB): $(OBJS)
- # if you make doesn't know how to put objects in libraries
- --- 63,74 ----
-
- all: $(LIB)
-
- ! link: $(HDRS) #stdio.h
- [ -d $(INCL) ] || mkdir $(INCL)
- [ -d $(INCL)/sys ] || mkdir $(INCL)/sys
- ! ($(SHELL) ../mklinks $(INCL) $(HDRS))
- ($(SHELL) ../mklinks $(INCL)/sys $(SYSHDRS))
- + # ($(SHELL) ../mklinks $(INCL) stdio.h)
-
- $(LIB): $(OBJS)
- # if you make doesn't know how to put objects in libraries
- *** std/stdc/fprintf.c.old Sat Apr 25 17:42:03 1992
- --- std/stdc/fprintf.c Sat Apr 25 18:19:51 1992
- ***************
- *** 2,8 ****
- * printf and fprintf
- */
-
- ! /* $Header */
-
- #if __STDC__
- #include <stdarg.h>
- --- 2,8 ----
- * printf and fprintf
- */
-
- ! /* $Id: fprintf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #if __STDC__
- #include <stdarg.h>
- ***************
- *** 16,22 ****
- /* printf to stdout */
- int
- #if __STDC__
- ! printf(Const char *fmt, ...) {
- #else
- printf(va_alist) va_dcl
- {
- --- 16,22 ----
- /* printf to stdout */
- int
- #if __STDC__
- ! printf(const char *fmt, ...) {
- #else
- printf(va_alist) va_dcl
- {
- ***************
- *** 37,43 ****
-
- int
- #if __STDC__
- ! fprintf(FILE *f, Const char *fmt, ...) {
- #else
- fprintf(va_alist) va_dcl
- {
- --- 37,43 ----
-
- int
- #if __STDC__
- ! fprintf(FILE *f, const char *fmt, ...) {
- #else
- fprintf(va_alist) va_dcl
- {
- *** std/stdc/memchr.c.old Sat Apr 25 17:42:29 1992
- --- std/stdc/memchr.c Sat Apr 25 18:20:01 1992
- ***************
- *** 1,10 ****
- ! /* $Header$ */
-
- #include <string.h>
-
- ! Void *
- memchr(ap, c, n)
- ! Const Void *ap;
- register int c;
- register size_t n;
- {
- --- 1,10 ----
- ! /* $Id: memchr.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include <string.h>
-
- ! void *
- memchr(ap, c, n)
- ! const void *ap;
- register int c;
- register size_t n;
- {
- *** std/stdc/memcmp.c.old Sat Apr 25 17:42:05 1992
- --- std/stdc/memcmp.c Sat Apr 25 18:20:04 1992
- ***************
- *** 1,15 ****
- ! /* $Header$ */
-
- #include <string.h>
-
- int
- memcmp(dap, sap, n)
- ! Const Void *dap;
- ! Const Void *sap;
- register size_t n;
- {
- ! register Const unsigned char *dp = (unsigned char Const *) dap;
- ! register Const unsigned char *sp = (unsigned char Const *) sap;
-
- if (n++ > 0)
- while (--n > 0)
- --- 1,15 ----
- ! /* $Id: memcmp.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include <string.h>
-
- int
- memcmp(dap, sap, n)
- ! const void *dap;
- ! const void *sap;
- register size_t n;
- {
- ! register const unsigned char *dp = (unsigned char const *) dap;
- ! register const unsigned char *sp = (unsigned char const *) sap;
-
- if (n++ > 0)
- while (--n > 0)
- *** std/stdc/memcpy.c.old Sat Apr 25 17:42:30 1992
- --- std/stdc/memcpy.c Sat Apr 25 18:20:07 1992
- ***************
- *** 1,14 ****
- ! /* $Header$ */
-
- #include <string.h>
-
- ! Void *
- memcpy(dap, sap, n)
- ! Void *dap;
- ! Const Void *sap;
- register size_t n;
- {
- ! register char *dp = dap, *sp = (Void*) sap;
-
- if (n++ > 0)
- while (--n > 0)
- --- 1,14 ----
- ! /* $Id: memcpy.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include <string.h>
-
- ! void *
- memcpy(dap, sap, n)
- ! void *dap;
- ! const void *sap;
- register size_t n;
- {
- ! register char *dp = dap, *sp = (void*) sap;
-
- if (n++ > 0)
- while (--n > 0)
- *** std/stdc/memmove.c.old Sat Apr 25 17:44:47 1992
- --- std/stdc/memmove.c Sat Apr 25 18:20:10 1992
- ***************
- *** 1,17 ****
- ! /* $Header$ */
- ! #ifndef lint
- ! static char *sccs_id = "@(#)memmove.c 1.2 91/11/22 22:49:36 (sjg)";
- ! #endif
-
- #include "stdh.h"
-
- ! Void *
- memmove(dap, sap, n)
- ! Void *dap;
- ! Const Void *sap;
- register size_t n;
- {
- ! register char *dp = dap, *sp = (Void*) sap;
-
- if (n <= 0)
- ;
- --- 1,14 ----
- ! /* $Id: memmove.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include "stdh.h"
-
- ! void *
- memmove(dap, sap, n)
- ! void *dap;
- ! const void *sap;
- register size_t n;
- {
- ! register char *dp = dap, *sp = (void*) sap;
-
- if (n <= 0)
- ;
- *** std/stdc/memset.c.old Sat Apr 25 17:42:31 1992
- --- std/stdc/memset.c Sat Apr 25 18:20:12 1992
- ***************
- *** 1,10 ****
- ! /* $Header$ */
-
- #include <string.h>
-
- ! Void *
- memset(ap, c, n)
- ! Void *ap;
- register int c;
- register size_t n;
- {
- --- 1,10 ----
- ! /* $Id: memset.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include <string.h>
-
- ! void *
- memset(ap, c, n)
- ! void *ap;
- register int c;
- register size_t n;
- {
- *** std/stdc/setvbuf.c.old Sat Apr 25 17:42:07 1992
- --- std/stdc/setvbuf.c Sat Apr 25 18:20:15 1992
- ***************
- *** 6,12 ****
- * in the shell is to avoid 4/8K buffers on BSD like systems.
- */
-
- ! /* $Header */
-
- #include <stdlib.h>
- #include <stdio.h>
- --- 6,12 ----
- * in the shell is to avoid 4/8K buffers on BSD like systems.
- */
-
- ! /* $Id: setvbuf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include <stdlib.h>
- #include <stdio.h>
- *** std/stdc/sprintf.c.old Sat Apr 25 17:42:08 1992
- --- std/stdc/sprintf.c Sat Apr 25 18:20:23 1992
- ***************
- *** 2,8 ****
- * sprintf and vsprintf
- */
-
- ! /* $Header */
-
- #if __STDC__
- #include <stdarg.h>
- --- 2,8 ----
- * sprintf and vsprintf
- */
-
- ! /* $Id: sprintf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #if __STDC__
- #include <stdarg.h>
- ***************
- *** 15,21 ****
-
- int
- #if __STDC__
- ! sprintf(char *s, Const char *fmt, ...) {
- #else
- sprintf(va_alist) va_dcl
- {
- --- 15,21 ----
-
- int
- #if __STDC__
- ! sprintf(char *s, const char *fmt, ...) {
- #else
- sprintf(va_alist) va_dcl
- {
- *** std/stdc/stdarg.h.old Sat Apr 25 17:42:09 1992
- --- std/stdc/stdarg.h Sat Apr 25 18:20:26 1992
- ***************
- *** 1,3 ****
- --- 1,6 ----
- + /* $Id: stdarg.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
- + /* DON'T USE THIS IF YOUR COMPILER HAS ITS OWN!!! */
- +
- #ifndef _STDARG_H
- #define _STDARG_H
-
- *** std/stdc/stddef.h.old Sat Apr 25 17:42:10 1992
- --- std/stdc/stddef.h Sat Apr 25 18:20:30 1992
- ***************
- *** 1,6 ****
- /* ANSI common definitions */
-
- ! /* $Header$ */
-
- #ifndef NULL
- #if __STDC__
- --- 1,6 ----
- /* ANSI common definitions */
-
- ! /* $Id: stddef.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #ifndef NULL
- #if __STDC__
- ***************
- *** 10,35 ****
- #endif
- #endif
-
- ! #if ! _STDDEF_H
- ! #define _STDDEF_H 1
-
- /* doesn't really belong here, but the library function need it */
- ! #if __STDC__
- ! #define ARGS(args) args
- ! #define Void void
- ! #define Const const
- ! #else
- ! #define ARGS(args) ()
- ! #define Void char
- ! #define Const
- #endif
-
- ! #ifdef sparc
- # include <sys/stdtypes.h>
- #else
- typedef unsigned size_t; /* may need long */
- typedef int ptrdiff_t;
- ! #endif /* sparc */
- #define offsetof(type,id) ((size_t)&((type*)NULL)->id)
-
- extern int errno; /* really belongs in <errno.h> */
- --- 10,38 ----
- #endif
- #endif
-
- ! #ifndef _STDDEF_H
- ! #define _STDDEF_H
-
- /* doesn't really belong here, but the library function need it */
- ! #ifndef ARGS
- ! # ifdef __STDC__
- ! # define ARGS(args) args
- ! # else
- ! # define ARGS(args) ()
- ! # ifdef VOID
- ! # define void VOID
- ! # endif
- ! # define const
- ! # define volatile
- ! # endif
- #endif
-
- ! #ifdef HAVE_SYS_STDTYPES
- # include <sys/stdtypes.h>
- #else
- typedef unsigned size_t; /* may need long */
- typedef int ptrdiff_t;
- ! #endif /* HAVE_SYS_STDTYPES */
- #define offsetof(type,id) ((size_t)&((type*)NULL)->id)
-
- extern int errno; /* really belongs in <errno.h> */
- *** std/stdc/stdio.c.old Sat Apr 25 17:41:07 1992
- --- std/stdc/stdio.c Sat Apr 25 18:20:32 1992
- ***************
- *** 2,15 ****
- * Emulation of misc. ANSI C stdio functions
- */
-
- ! /* $Header */
-
- #include <stdio.h>
-
- #if 1
- int
- remove(name)
- ! Const char *name;
- {
- return unlink(name);
- }
- --- 2,20 ----
- * Emulation of misc. ANSI C stdio functions
- */
-
- ! /* $Id: stdio.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include <stdio.h>
-
- + #ifndef __STDC__
- + #define const
- + #define volatile
- + #endif
- +
- #if 1
- int
- remove(name)
- ! const char *name;
- {
- return unlink(name);
- }
- ***************
- *** 18,24 ****
- #if _V7
- int
- rename(oname, nname)
- ! Const char *oname, *nname;
- {
- return link(oname, nname) == 0 && unlink(oname) == 0 ? 0 : -1;
- }
- --- 23,29 ----
- #if _V7
- int
- rename(oname, nname)
- ! const char *oname, *nname;
- {
- return link(oname, nname) == 0 && unlink(oname) == 0 ? 0 : -1;
- }
- *** std/stdc/stdio.h_std.old Sat Apr 25 17:41:42 1992
- --- std/stdc/stdio.h_std Sat Apr 25 14:42:26 1992
- ***************
- *** 5,11 ****
- * todo: needs L_* constants.
- */
-
- ! /* $Header: stdio.h,v 1.2 88/06/23 18:32:35 egisin Locked $ */
-
- #if ! _STDIO_H
- #define _STDIO_H 1
- --- 5,11 ----
- * todo: needs L_* constants.
- */
-
- ! /* $Id$ */
-
- #if ! _STDIO_H
- #define _STDIO_H 1
- *** std/stdc/stdlib.h.old Sat Apr 25 17:42:12 1992
- --- std/stdc/stdlib.h Sat Apr 25 18:20:35 1992
- ***************
- *** 1,6 ****
- /* ANSI utility functions */
-
- ! /* $Header: stdlib.h,v 1.1 88/03/09 21:52:59 egisin Locked $ */
-
- #if ! _STDLIB_H
- #define _STDLIB_H 1
- --- 1,6 ----
- /* ANSI utility functions */
-
- ! /* $Id: stdlib.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #if ! _STDLIB_H
- #define _STDLIB_H 1
- ***************
- *** 15,23 ****
- unsigned long strtoul ARGS((const char *s, char **, int base));
- int rand ARGS((void));
- void srand ARGS((unsigned int seed));
- ! Void *malloc ARGS((size_t size));
- ! Void *realloc ARGS((void *ptr, size_t size));
- ! Void *calloc ARGS((size_t n, size_t size));
- void free ARGS((void *ptr));
- void abort ARGS((void));
- int atexit ARGS((void (*func)(void)));
- --- 15,23 ----
- unsigned long strtoul ARGS((const char *s, char **, int base));
- int rand ARGS((void));
- void srand ARGS((unsigned int seed));
- ! void *malloc ARGS((size_t size));
- ! void *realloc ARGS((void *ptr, size_t size));
- ! void *calloc ARGS((size_t n, size_t size));
- void free ARGS((void *ptr));
- void abort ARGS((void));
- int atexit ARGS((void (*func)(void)));
- *** std/stdc/strcat.c.old Sat Apr 25 17:42:32 1992
- --- std/stdc/strcat.c Sat Apr 25 18:20:38 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strcat.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strcat - append string src to dst
- ***************
- *** 6,15 ****
- char * /* dst */
- strcat(dst, src)
- char *dst;
- ! Const char *src;
- {
- register char *dscan;
- ! register Const char *sscan;
-
- for (dscan = dst; *dscan != '\0'; dscan++)
- continue;
- --- 7,16 ----
- char * /* dst */
- strcat(dst, src)
- char *dst;
- ! const char *src;
- {
- register char *dscan;
- ! register const char *sscan;
-
- for (dscan = dst; *dscan != '\0'; dscan++)
- continue;
- *** std/stdc/strchr.c.old Sat Apr 25 17:42:13 1992
- --- std/stdc/strchr.c Sat Apr 25 18:20:41 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strchr.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strchr - find first occurrence of a character in a string
- ***************
- *** 6,15 ****
-
- char * /* found char, or NULL if none */
- strchr(s, charwanted)
- ! Const char *s;
- register char charwanted;
- {
- ! register Const char *scan;
-
- /*
- * The odd placement of the two tests is so NUL is findable.
- --- 7,16 ----
-
- char * /* found char, or NULL if none */
- strchr(s, charwanted)
- ! const char *s;
- register char charwanted;
- {
- ! register const char *scan;
-
- /*
- * The odd placement of the two tests is so NUL is findable.
- *** std/stdc/strcmp.c.old Sat Apr 25 17:42:14 1992
- --- std/stdc/strcmp.c Sat Apr 25 18:20:43 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strcmp.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /* Modified by Eric Gisin */
-
- ***************
- *** 8,18 ****
-
- int /* <0 for <, 0 for ==, >0 for > */
- strcmp(s1, s2)
- ! Const char *s1;
- ! Const char *s2;
- {
- ! register Const char *scan1;
- ! register Const char *scan2;
- #if 0 /* some machines prefer int to char */
- register int c1, c2;
- #else
- --- 9,19 ----
-
- int /* <0 for <, 0 for ==, >0 for > */
- strcmp(s1, s2)
- ! const char *s1;
- ! const char *s2;
- {
- ! register const char *scan1;
- ! register const char *scan2;
- #if 0 /* some machines prefer int to char */
- register int c1, c2;
- #else
- *** std/stdc/strcpy.c.old Sat Apr 25 17:42:33 1992
- --- std/stdc/strcpy.c Sat Apr 25 18:20:45 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strcpy.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strcpy - copy string src to dst
- ***************
- *** 6,15 ****
- char * /* dst */
- strcpy(dst, src)
- char *dst;
- ! Const char *src;
- {
- register char *dscan;
- ! register Const char *sscan;
-
- dscan = dst;
- sscan = src;
- --- 7,16 ----
- char * /* dst */
- strcpy(dst, src)
- char *dst;
- ! const char *src;
- {
- register char *dscan;
- ! register const char *sscan;
-
- dscan = dst;
- sscan = src;
- *** std/stdc/strcspn.c.old Sat Apr 25 17:42:15 1992
- --- std/stdc/strcspn.c Sat Apr 25 18:20:50 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strcspn.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strcspn - find length of initial segment of s consisting entirely
- ***************
- *** 7,17 ****
-
- size_t
- strcspn(s, reject)
- ! Const char *s;
- ! Const char *reject;
- {
- ! register Const char *scan;
- ! register Const char *rscan;
- register size_t count;
-
- count = 0;
- --- 8,18 ----
-
- size_t
- strcspn(s, reject)
- ! const char *s;
- ! const char *reject;
- {
- ! register const char *scan;
- ! register const char *rscan;
- register size_t count;
-
- count = 0;
- *** std/stdc/strerror.c.old Sat Apr 25 17:42:34 1992
- --- std/stdc/strerror.c Sat Apr 25 18:20:52 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strerror.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strerror - map error number to descriptive string
- *** std/stdc/string.h.old Sat Apr 25 17:42:15 1992
- --- std/stdc/string.h Sat Apr 25 18:20:54 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- /* ANSI string handling (missing wide char stuff) */
- + /* $Id: string.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #if ! _STRING_H
- #define _STRING_H 1
- ***************
- *** 5,24 ****
-
- #include <stddef.h> /* define NULL and size_t */
-
- ! #if __STDC__
- ! #define ARGS(args) args
- ! #define Void void
- ! #else
- ! #define ARGS(args) ()
- ! #define Void char
- ! #endif
- !
- ! Void *memcpy ARGS((Void *s1, const Void *s2, size_t));
- ! Void *memmove ARGS((Void *s1, const Void *s2, size_t));
- ! int memcmp ARGS((const Void *s1, const Void *s2, size_t));
- ! Void *memchr ARGS((const Void *s, int c, size_t));
- ! Void *memset ARGS((Void *s, int c, size_t));
- size_t strlen ARGS((const char *s));
- char *strcpy ARGS((char *s1, const char *s2));
- char *strncpy ARGS((char *s1, const char *s2, size_t));
- char *strcat ARGS((char *s1, const char *s2));
- --- 6,19 ----
-
- #include <stddef.h> /* define NULL and size_t */
-
- ! #ifndef __GNUC__
- ! void *memcpy ARGS((void *s1, const void *s2, size_t));
- ! int memcmp ARGS((const void *s1, const void *s2, size_t));
- size_t strlen ARGS((const char *s));
- + #endif
- + void *memmove ARGS((void *s1, const void *s2, size_t));
- + void *memchr ARGS((const void *s, int c, size_t));
- + void *memset ARGS((void *s, int c, size_t));
- char *strcpy ARGS((char *s1, const char *s2));
- char *strncpy ARGS((char *s1, const char *s2, size_t));
- char *strcat ARGS((char *s1, const char *s2));
- *** std/stdc/strlen.c.old Sat Apr 25 17:42:35 1992
- --- std/stdc/strlen.c Sat Apr 25 18:20:56 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strlen.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strlen - length of string (not including NUL)
- ***************
- *** 5,13 ****
- */
- size_t
- strlen(s)
- ! Const char *s;
- {
- ! register Const char *scan;
- register size_t count;
-
- count = 0;
- --- 6,14 ----
- */
- size_t
- strlen(s)
- ! const char *s;
- {
- ! register const char *scan;
- register size_t count;
-
- count = 0;
- *** std/stdc/strncat.c.old Sat Apr 25 17:42:16 1992
- --- std/stdc/strncat.c Sat Apr 25 18:21:00 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strncat.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strncat - append at most n characters of string src to dst
- ***************
- *** 6,16 ****
- char * /* dst */
- strncat(dst, src, n)
- char *dst;
- ! Const char *src;
- size_t n;
- {
- register char *dscan;
- ! register Const char *sscan;
- register size_t count;
-
- for (dscan = dst; *dscan != '\0'; dscan++)
- --- 7,17 ----
- char * /* dst */
- strncat(dst, src, n)
- char *dst;
- ! const char *src;
- size_t n;
- {
- register char *dscan;
- ! register const char *sscan;
- register size_t count;
-
- for (dscan = dst; *dscan != '\0'; dscan++)
- *** std/stdc/strncmp.c.old Sat Apr 25 17:42:17 1992
- --- std/stdc/strncmp.c Sat Apr 25 18:21:03 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strncmp.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strncmp - compare at most n characters of string s1 to s2
- ***************
- *** 6,17 ****
-
- int /* <0 for <, 0 for ==, >0 for > */
- strncmp(s1, s2, n)
- ! Const char *s1;
- ! Const char *s2;
- size_t n;
- {
- ! register Const char *scan1;
- ! register Const char *scan2;
- register size_t count;
-
- scan1 = s1;
- --- 7,18 ----
-
- int /* <0 for <, 0 for ==, >0 for > */
- strncmp(s1, s2, n)
- ! const char *s1;
- ! const char *s2;
- size_t n;
- {
- ! register const char *scan1;
- ! register const char *scan2;
- register size_t count;
-
- scan1 = s1;
- *** std/stdc/strncpy.c.old Sat Apr 25 17:42:18 1992
- --- std/stdc/strncpy.c Sat Apr 25 18:21:05 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strncpy.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strncpy - copy at most n characters of string src to dst
- ***************
- *** 6,16 ****
- char * /* dst */
- strncpy(dst, src, n)
- char *dst;
- ! Const char *src;
- size_t n;
- {
- register char *dscan;
- ! register Const char *sscan;
- register size_t count;
-
- dscan = dst;
- --- 7,17 ----
- char * /* dst */
- strncpy(dst, src, n)
- char *dst;
- ! const char *src;
- size_t n;
- {
- register char *dscan;
- ! register const char *sscan;
- register size_t count;
-
- dscan = dst;
- *** std/stdc/strpbrk.c.old Sat Apr 25 17:42:19 1992
- --- std/stdc/strpbrk.c Sat Apr 25 18:21:07 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strpbrk.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strpbrk - find first occurrence of any char from breakat in s
- ***************
- *** 6,16 ****
-
- char * /* found char, or NULL if none */
- strpbrk(s, breakat)
- ! Const char *s;
- ! Const char *breakat;
- {
- ! register Const char *sscan;
- ! register Const char *bscan;
-
- for (sscan = s; *sscan != '\0'; sscan++) {
- for (bscan = breakat; *bscan != '\0';) /* ++ moved down. */
- --- 7,17 ----
-
- char * /* found char, or NULL if none */
- strpbrk(s, breakat)
- ! const char *s;
- ! const char *breakat;
- {
- ! register const char *sscan;
- ! register const char *bscan;
-
- for (sscan = s; *sscan != '\0'; sscan++) {
- for (bscan = breakat; *bscan != '\0';) /* ++ moved down. */
- *** std/stdc/strrchr.c.old Sat Apr 25 17:42:20 1992
- --- std/stdc/strrchr.c Sat Apr 25 18:21:09 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strrchr.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strrchr - find last occurrence of a character in a string
- ***************
- *** 6,16 ****
-
- char * /* found char, or NULL if none */
- strrchr(s, charwanted)
- ! Const char *s;
- register char charwanted;
- {
- ! register Const char *scan;
- ! register Const char *place;
-
- place = NULL;
- for (scan = s; *scan != '\0'; scan++)
- --- 7,17 ----
-
- char * /* found char, or NULL if none */
- strrchr(s, charwanted)
- ! const char *s;
- register char charwanted;
- {
- ! register const char *scan;
- ! register const char *place;
-
- place = NULL;
- for (scan = s; *scan != '\0'; scan++)
- *** std/stdc/strspn.c.old Sat Apr 25 17:42:21 1992
- --- std/stdc/strspn.c Sat Apr 25 18:21:11 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strspn.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * strspn - find length of initial segment of s consisting entirely
- ***************
- *** 7,17 ****
-
- size_t
- strspn(s, accept)
- ! Const char *s;
- ! Const char *accept;
- {
- ! register Const char *sscan;
- ! register Const char *ascan;
- register size_t count;
-
- count = 0;
- --- 8,18 ----
-
- size_t
- strspn(s, accept)
- ! const char *s;
- ! const char *accept;
- {
- ! register const char *sscan;
- ! register const char *ascan;
- register size_t count;
-
- count = 0;
- *** std/stdc/strstr.c.old Sat Apr 25 17:44:47 1992
- --- std/stdc/strstr.c Sat Apr 25 10:59:02 1992
- ***************
- *** 1,5 ****
- #ifndef lint
- ! static char *sccs_id = "@(#)strstr.c 1.2 91/11/22 22:49:34 (sjg)";
- #endif
-
- #include "stdh.h"
- --- 1,5 ----
- #ifndef lint
- ! static char *RCSid = "$Id: strstr.c,v 1.2 1992/04/25 00:58:50 sjg Exp $";
- #endif
-
- #include "stdh.h"
- ***************
- *** 10,19 ****
-
- char * /* found string, or NULL if none */
- strstr(s, wanted)
- ! Const char *s;
- ! Const char *wanted;
- {
- ! register Const char *scan;
- register size_t len;
- register char firstc;
-
- --- 10,19 ----
-
- char * /* found string, or NULL if none */
- strstr(s, wanted)
- ! const char *s;
- ! const char *wanted;
- {
- ! register const char *scan;
- register size_t len;
- register char firstc;
-
- *** std/stdc/strtok.c.old Sat Apr 25 17:42:23 1992
- --- std/stdc/strtok.c Sat Apr 25 18:21:14 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- #include <string.h>
- + /* $Id: strtok.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- /*
- * Get next token from string s (NULL on 2nd, 3rd, etc. calls),
- ***************
- *** 12,22 ****
- char * /* NULL if no token left */
- strtok(s, delim)
- char *s;
- ! register Const char *delim;
- {
- register char *scan;
- char *tok;
- ! register Const char *dscan;
-
- if (s == NULL && scanpoint == NULL)
- return(NULL);
- --- 13,23 ----
- char * /* NULL if no token left */
- strtok(s, delim)
- char *s;
- ! register const char *delim;
- {
- register char *scan;
- char *tok;
- ! register const char *dscan;
-
- if (s == NULL && scanpoint == NULL)
- return(NULL);
- *** std/stdc/time.h.old Sat Apr 25 17:42:23 1992
- --- std/stdc/time.h Sat Apr 25 18:21:19 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- /* time, time/date conversion */
- + /* $Id: time.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #if ! _TIME_H
- #define _TIME_H 1
- ***************
- *** 5,12 ****
-
- #include <stddef.h> /* need size_t */
-
- ! #ifndef sparc
- typedef long time_t;
- typedef long clock_t; /* seconds/CLK_TCK */
- #endif
-
- --- 6,15 ----
-
- #include <stddef.h> /* need size_t */
-
- ! #ifndef HAVE_SYS_STDTYPES
- ! #ifndef _TIME_T
- typedef long time_t;
- + #endif
- typedef long clock_t; /* seconds/CLK_TCK */
- #endif
-
- *** std/stdc/types.h.old Sat Apr 25 17:42:24 1992
- --- std/stdc/types.h Sat Apr 25 18:21:23 1992
- ***************
- *** 1,4 ****
- --- 1,5 ----
- /* work around multiple typedefs in stddef.h and sys/types.h */
- + /* $Id: types.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
-
- #include <stddef.h> /* defines size_t and ptrdiff_t */
- #include <time.h> /* defines time_t and clock_t */
- *** std/stdc/vprintf.c.old Sat Apr 25 17:41:21 1992
- --- std/stdc/vprintf.c Sat Apr 25 18:21:26 1992
- ***************
- *** 1,4 ****
- ! #if __STDC__
- #include <stdarg.h>
- #else
- #include <varargs.h>
- --- 1,7 ----
- ! #ifndef lint
- ! static char *RCSid = "$Id: vprintf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $";
- ! #endif
- ! #ifdef __STDC__
- #include <stdarg.h>
- #else
- #include <varargs.h>
- ***************
- *** 8,15 ****
- #define BUF 40 /* buffer for int -> string conversion */
-
- int
- ! #if __STDC__
- ! vprintf(Const char *fmt, va_list va) {
- #else
- vprintf(fmt, va) char *fmt; va_list va; {
- #endif
- --- 11,18 ----
- #define BUF 40 /* buffer for int -> string conversion */
-
- int
- ! #ifdef __STDC__
- ! vprintf(const char *fmt, va_list va) {
- #else
- vprintf(fmt, va) char *fmt; va_list va; {
- #endif
- ***************
- *** 17,24 ****
- }
-
- int
- ! #if __STDC__
- ! vfprintf(register FILE *f, register Const char *fmt, register va_list va) {
- #else
- vfprintf(f, fmt, va) register FILE *f; register char *fmt; register va_list va; {
- #endif
- --- 20,27 ----
- }
-
- int
- ! #ifdef __STDC__
- ! vfprintf(register FILE *f, register const char *fmt, register va_list va) {
- #else
- vfprintf(f, fmt, va) register FILE *f; register char *fmt; register va_list va; {
- #endif
- ***************
- *** 114,120 ****
-
- case 'p': /* pointer */
- *--p = '}';
- ! u = (unsigned long) va_arg(va, Void*);
- do {
- *--p = "0123456789ABCDEF"[u%16];
- u /= 16;
- --- 117,123 ----
-
- case 'p': /* pointer */
- *--p = '}';
- ! u = (unsigned long) va_arg(va, void*);
- do {
- *--p = "0123456789ABCDEF"[u%16];
- u /= 16;
- ***************
- *** 136,142 ****
- break;
-
- case 's': /* string */
- ! p = va_arg(va, char *);
- if ((flags&FF_PREC) && strlen(p) > prec) {
- pos += prec;
- while (--prec >= 0)
- --- 139,146 ----
- break;
-
- case 's': /* string */
- ! if ((p = va_arg(va, char *)) == NULL)
- ! p = "";
- if ((flags&FF_PREC) && strlen(p) > prec) {
- pos += prec;
- while (--prec >= 0)
-
- exit 0 # Just in case...
-