home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume29 / pdksh / patch02b < prev    next >
Encoding:
Text File  |  1992-04-25  |  27.8 KB  |  1,265 lines

  1. Newsgroups: comp.sources.misc
  2. From: sjg@zen.void.oz.au (Simon J. Gerraty)
  3. Subject:  v29i082:  pdksh - Public Domain Korn Shell, v4, Patch02b/2
  4. Message-ID: <1992Apr26.041007.21772@sparky.imd.sterling.com>
  5. X-Md4-Signature: 23dce6deb06e684bc1fa1d629e650abc
  6. Date: Sun, 26 Apr 1992 04:10:07 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: sjg@zen.void.oz.au (Simon J. Gerraty)
  10. Posting-number: Volume 29, Issue 82
  11. Archive-name: pdksh/patch02b
  12. Environment: UNIX
  13. Patch-To: pdksh: Volume 25, Issue 47-55
  14.  
  15. *** std/stdc/ChangeLog.old    Sat Apr 25 17:44:46 1992
  16. --- std/stdc/ChangeLog    Sat Apr 25 14:52:16 1992
  17. ***************
  18. *** 1,3 ****
  19. --- 1,7 ----
  20. + Sat Apr 25 14:52:01 1992  Simon J. Gerraty  (sjg@zen)
  21. +     * Added RCS keys to sources.
  22.   Mon Nov 25 13:19:01 1991  Simon J. Gerraty  (sjg at zen)
  23.   
  24.       * Added all source modules to Makefile, but most remain commented
  25. *** std/stdc/Makefile.old    Sat Apr 25 17:44:46 1992
  26. --- std/stdc/Makefile    Sat Apr 25 18:19:42 1992
  27. ***************
  28. *** 1,5 ****
  29.   # Standard C (ANSI) compatabilaty
  30. ! # @(#)Makefile 1.3 91/11/25 13:24:27
  31.   
  32.   # edit this makefile such that only the functions that
  33.   # your systems doesn't have are provided.
  34. --- 1,5 ----
  35.   # Standard C (ANSI) compatabilaty
  36. ! # $Id: Makefile,v 1.2 1992/04/25 08:19:26 sjg Exp $
  37.   
  38.   # edit this makefile such that only the functions that
  39.   # your systems doesn't have are provided.
  40. ***************
  41. *** 19,26 ****
  42.   
  43.   CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
  44.   
  45. ! MISC =    Makefile stdio.h_std
  46. ! HDRS =    limits.h stddef.h stdlib.h string.h time.h stdarg.h 
  47.   SYSHDRS = types.h
  48.   
  49.   SRCS =    strstr.c memmove.c stdio.c clock.c fprintf.c memchr.c \
  50. --- 19,26 ----
  51.   
  52.   CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
  53.   
  54. ! MISC =    Makefile #stdio.h_std
  55. ! HDRS =    limits.h stddef.h stdlib.h string.h time.h #stdarg.h 
  56.   SYSHDRS = types.h
  57.   
  58.   SRCS =    strstr.c memmove.c stdio.c clock.c fprintf.c memchr.c \
  59. ***************
  60. *** 33,42 ****
  61.   # some of these are untested!
  62.   OBJS =    $(LIB)(strstr.o) \
  63.       $(LIB)(memmove.o) \
  64. -     $(LIB)(stdio.o) \
  65.       $(LIB)(clock.o) \
  66. - #    $(LIB)(fprintf.o) \
  67.   #    $(LIB)(vprintf.o) \
  68.   #    $(LIB)(strtok.o) \
  69.   #    $(LIB)(memchr.o) \
  70.   #    $(LIB)(memcmp.o) \
  71. --- 33,42 ----
  72.   # some of these are untested!
  73.   OBJS =    $(LIB)(strstr.o) \
  74.       $(LIB)(memmove.o) \
  75.       $(LIB)(clock.o) \
  76.   #    $(LIB)(vprintf.o) \
  77. + #    $(LIB)(fprintf.o) \
  78. + #    $(LIB)(sprintf.o) \
  79.   #    $(LIB)(strtok.o) \
  80.   #    $(LIB)(memchr.o) \
  81.   #    $(LIB)(memcmp.o) \
  82. ***************
  83. *** 43,50 ****
  84.   #    $(LIB)(memcpy.o) \
  85.   #    $(LIB)(memset.o) \
  86.   #    $(LIB)(setvbuf.o) \
  87. - #    $(LIB)(sprintf.o) \
  88. - #    $(LIB)(stdio.o) \
  89.   #    $(LIB)(strcat.o) \
  90.   #    $(LIB)(strchr.o) \
  91.   #    $(LIB)(strcmp.o) \
  92. --- 43,48 ----
  93. ***************
  94. *** 58,63 ****
  95. --- 56,62 ----
  96.   #    $(LIB)(strpbrk.o) \
  97.   #    $(LIB)(strrchr.o) \
  98.   #    $(LIB)(strspn.o) \
  99. + #    $(LIB)(stdio.o) \
  100.   
  101.   
  102.   
  103. ***************
  104. *** 64,74 ****
  105.   
  106.   all:    $(LIB)
  107.   
  108. ! link:    $(HDRS) stdio.h 
  109.       [ -d $(INCL) ] || mkdir $(INCL)
  110.       [ -d $(INCL)/sys ] || mkdir $(INCL)/sys
  111. !     ($(SHELL) ../mklinks $(INCL) stdio.h $(HDRS))
  112.       ($(SHELL) ../mklinks $(INCL)/sys $(SYSHDRS))
  113.   
  114.   $(LIB):    $(OBJS)
  115.   # if you make doesn't know how to put objects in libraries
  116. --- 63,74 ----
  117.   
  118.   all:    $(LIB)
  119.   
  120. ! link:    $(HDRS) #stdio.h 
  121.       [ -d $(INCL) ] || mkdir $(INCL)
  122.       [ -d $(INCL)/sys ] || mkdir $(INCL)/sys
  123. !     ($(SHELL) ../mklinks $(INCL) $(HDRS))
  124.       ($(SHELL) ../mklinks $(INCL)/sys $(SYSHDRS))
  125. + #    ($(SHELL) ../mklinks $(INCL) stdio.h)
  126.   
  127.   $(LIB):    $(OBJS)
  128.   # if you make doesn't know how to put objects in libraries
  129. *** std/stdc/fprintf.c.old    Sat Apr 25 17:42:03 1992
  130. --- std/stdc/fprintf.c    Sat Apr 25 18:19:51 1992
  131. ***************
  132. *** 2,8 ****
  133.    * printf and fprintf
  134.    */
  135.   
  136. ! /* $Header */
  137.   
  138.   #if __STDC__
  139.   #include <stdarg.h>
  140. --- 2,8 ----
  141.    * printf and fprintf
  142.    */
  143.   
  144. ! /* $Id: fprintf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  145.   
  146.   #if __STDC__
  147.   #include <stdarg.h>
  148. ***************
  149. *** 16,22 ****
  150.   /* printf to stdout */
  151.   int
  152.   #if __STDC__
  153. ! printf(Const char *fmt, ...) {
  154.   #else
  155.   printf(va_alist) va_dcl
  156.   {
  157. --- 16,22 ----
  158.   /* printf to stdout */
  159.   int
  160.   #if __STDC__
  161. ! printf(const char *fmt, ...) {
  162.   #else
  163.   printf(va_alist) va_dcl
  164.   {
  165. ***************
  166. *** 37,43 ****
  167.   
  168.   int
  169.   #if __STDC__
  170. ! fprintf(FILE *f, Const char *fmt, ...) {
  171.   #else
  172.   fprintf(va_alist) va_dcl
  173.   {
  174. --- 37,43 ----
  175.   
  176.   int
  177.   #if __STDC__
  178. ! fprintf(FILE *f, const char *fmt, ...) {
  179.   #else
  180.   fprintf(va_alist) va_dcl
  181.   {
  182. *** std/stdc/memchr.c.old    Sat Apr 25 17:42:29 1992
  183. --- std/stdc/memchr.c    Sat Apr 25 18:20:01 1992
  184. ***************
  185. *** 1,10 ****
  186. ! /* $Header$ */
  187.   
  188.   #include <string.h>
  189.   
  190. ! Void *
  191.   memchr(ap, c, n)
  192. !     Const Void *ap;
  193.       register int c;
  194.       register size_t n;
  195.   {
  196. --- 1,10 ----
  197. ! /* $Id: memchr.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  198.   
  199.   #include <string.h>
  200.   
  201. ! void *
  202.   memchr(ap, c, n)
  203. !     const void *ap;
  204.       register int c;
  205.       register size_t n;
  206.   {
  207. *** std/stdc/memcmp.c.old    Sat Apr 25 17:42:05 1992
  208. --- std/stdc/memcmp.c    Sat Apr 25 18:20:04 1992
  209. ***************
  210. *** 1,15 ****
  211. ! /* $Header$ */
  212.   
  213.   #include <string.h>
  214.   
  215.   int
  216.   memcmp(dap, sap, n)
  217. !     Const Void *dap;
  218. !     Const Void *sap;
  219.       register size_t n;
  220.   {
  221. !     register Const unsigned char *dp = (unsigned char Const *) dap;
  222. !     register Const unsigned char *sp = (unsigned char Const *) sap;
  223.   
  224.       if (n++ > 0)
  225.           while (--n > 0)
  226. --- 1,15 ----
  227. ! /* $Id: memcmp.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  228.   
  229.   #include <string.h>
  230.   
  231.   int
  232.   memcmp(dap, sap, n)
  233. !     const void *dap;
  234. !     const void *sap;
  235.       register size_t n;
  236.   {
  237. !     register const unsigned char *dp = (unsigned char const *) dap;
  238. !     register const unsigned char *sp = (unsigned char const *) sap;
  239.   
  240.       if (n++ > 0)
  241.           while (--n > 0)
  242. *** std/stdc/memcpy.c.old    Sat Apr 25 17:42:30 1992
  243. --- std/stdc/memcpy.c    Sat Apr 25 18:20:07 1992
  244. ***************
  245. *** 1,14 ****
  246. ! /* $Header$ */
  247.   
  248.   #include <string.h>
  249.   
  250. ! Void *
  251.   memcpy(dap, sap, n)
  252. !     Void *dap;
  253. !     Const Void *sap;
  254.       register size_t n;
  255.   {
  256. !     register char *dp = dap, *sp = (Void*) sap;
  257.   
  258.       if (n++ > 0)
  259.           while (--n > 0)
  260. --- 1,14 ----
  261. ! /* $Id: memcpy.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  262.   
  263.   #include <string.h>
  264.   
  265. ! void *
  266.   memcpy(dap, sap, n)
  267. !     void *dap;
  268. !     const void *sap;
  269.       register size_t n;
  270.   {
  271. !     register char *dp = dap, *sp = (void*) sap;
  272.   
  273.       if (n++ > 0)
  274.           while (--n > 0)
  275. *** std/stdc/memmove.c.old    Sat Apr 25 17:44:47 1992
  276. --- std/stdc/memmove.c    Sat Apr 25 18:20:10 1992
  277. ***************
  278. *** 1,17 ****
  279. ! /* $Header$ */
  280. ! #ifndef lint
  281. ! static char *sccs_id = "@(#)memmove.c    1.2 91/11/22 22:49:36 (sjg)";
  282. ! #endif
  283.   
  284.   #include "stdh.h"
  285.   
  286. ! Void *
  287.   memmove(dap, sap, n)
  288. !     Void *dap;
  289. !     Const Void *sap;
  290.       register size_t n;
  291.   {
  292. !     register char *dp = dap, *sp = (Void*) sap;
  293.   
  294.       if (n <= 0)
  295.           ;
  296. --- 1,14 ----
  297. ! /* $Id: memmove.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  298.   
  299.   #include "stdh.h"
  300.   
  301. ! void *
  302.   memmove(dap, sap, n)
  303. !     void *dap;
  304. !     const void *sap;
  305.       register size_t n;
  306.   {
  307. !     register char *dp = dap, *sp = (void*) sap;
  308.   
  309.       if (n <= 0)
  310.           ;
  311. *** std/stdc/memset.c.old    Sat Apr 25 17:42:31 1992
  312. --- std/stdc/memset.c    Sat Apr 25 18:20:12 1992
  313. ***************
  314. *** 1,10 ****
  315. ! /* $Header$ */
  316.   
  317.   #include <string.h>
  318.   
  319. ! Void *
  320.   memset(ap, c, n)
  321. !     Void *ap;
  322.       register int c;
  323.       register size_t n;
  324.   {
  325. --- 1,10 ----
  326. ! /* $Id: memset.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  327.   
  328.   #include <string.h>
  329.   
  330. ! void *
  331.   memset(ap, c, n)
  332. !     void *ap;
  333.       register int c;
  334.       register size_t n;
  335.   {
  336. *** std/stdc/setvbuf.c.old    Sat Apr 25 17:42:07 1992
  337. --- std/stdc/setvbuf.c    Sat Apr 25 18:20:15 1992
  338. ***************
  339. *** 6,12 ****
  340.    * in the shell is to avoid 4/8K buffers on BSD like systems.
  341.    */
  342.   
  343. ! /* $Header */
  344.   
  345.   #include <stdlib.h>
  346.   #include <stdio.h>
  347. --- 6,12 ----
  348.    * in the shell is to avoid 4/8K buffers on BSD like systems.
  349.    */
  350.   
  351. ! /* $Id: setvbuf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  352.   
  353.   #include <stdlib.h>
  354.   #include <stdio.h>
  355. *** std/stdc/sprintf.c.old    Sat Apr 25 17:42:08 1992
  356. --- std/stdc/sprintf.c    Sat Apr 25 18:20:23 1992
  357. ***************
  358. *** 2,8 ****
  359.    * sprintf and vsprintf
  360.    */
  361.   
  362. ! /* $Header */
  363.   
  364.   #if __STDC__
  365.   #include <stdarg.h>
  366. --- 2,8 ----
  367.    * sprintf and vsprintf
  368.    */
  369.   
  370. ! /* $Id: sprintf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  371.   
  372.   #if __STDC__
  373.   #include <stdarg.h>
  374. ***************
  375. *** 15,21 ****
  376.   
  377.   int
  378.   #if __STDC__
  379. ! sprintf(char *s, Const char *fmt, ...) {
  380.   #else
  381.   sprintf(va_alist) va_dcl
  382.   {
  383. --- 15,21 ----
  384.   
  385.   int
  386.   #if __STDC__
  387. ! sprintf(char *s, const char *fmt, ...) {
  388.   #else
  389.   sprintf(va_alist) va_dcl
  390.   {
  391. *** std/stdc/stdarg.h.old    Sat Apr 25 17:42:09 1992
  392. --- std/stdc/stdarg.h    Sat Apr 25 18:20:26 1992
  393. ***************
  394. *** 1,3 ****
  395. --- 1,6 ----
  396. + /* $Id: stdarg.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  397. + /* DON'T USE THIS IF YOUR COMPILER HAS ITS OWN!!! */
  398.   #ifndef _STDARG_H
  399.   #define _STDARG_H
  400.   
  401. *** std/stdc/stddef.h.old    Sat Apr 25 17:42:10 1992
  402. --- std/stdc/stddef.h    Sat Apr 25 18:20:30 1992
  403. ***************
  404. *** 1,6 ****
  405.   /* ANSI common definitions */
  406.   
  407. ! /* $Header$ */
  408.   
  409.   #ifndef NULL
  410.   #if __STDC__
  411. --- 1,6 ----
  412.   /* ANSI common definitions */
  413.   
  414. ! /* $Id: stddef.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  415.   
  416.   #ifndef NULL
  417.   #if __STDC__
  418. ***************
  419. *** 10,35 ****
  420.   #endif
  421.   #endif
  422.   
  423. ! #if ! _STDDEF_H
  424. ! #define    _STDDEF_H 1
  425.   
  426.   /* doesn't really belong here, but the library function need it */
  427. ! #if __STDC__
  428. ! #define    ARGS(args)    args
  429. ! #define Void    void
  430. ! #define    Const    const
  431. ! #else
  432. ! #define    ARGS(args)    ()
  433. ! #define    Void    char
  434. ! #define    Const
  435.   #endif
  436.   
  437. ! #ifdef sparc
  438.   # include <sys/stdtypes.h>
  439.   #else
  440.   typedef unsigned size_t;        /* may need long */
  441.   typedef int ptrdiff_t;
  442. ! #endif /* sparc */
  443.   #define    offsetof(type,id) ((size_t)&((type*)NULL)->id)
  444.   
  445.   extern    int errno;        /* really belongs in <errno.h> */
  446. --- 10,38 ----
  447.   #endif
  448.   #endif
  449.   
  450. ! #ifndef _STDDEF_H
  451. ! #define    _STDDEF_H
  452.   
  453.   /* doesn't really belong here, but the library function need it */
  454. ! #ifndef ARGS
  455. ! # ifdef  __STDC__
  456. ! #   define ARGS(args) args
  457. ! # else
  458. ! #   define ARGS(args) ()
  459. ! #   ifdef VOID
  460. ! #     define void VOID
  461. ! #   endif
  462. ! #   define const
  463. ! #   define volatile
  464. ! # endif
  465.   #endif
  466.   
  467. ! #ifdef HAVE_SYS_STDTYPES
  468.   # include <sys/stdtypes.h>
  469.   #else
  470.   typedef unsigned size_t;        /* may need long */
  471.   typedef int ptrdiff_t;
  472. ! #endif /* HAVE_SYS_STDTYPES */
  473.   #define    offsetof(type,id) ((size_t)&((type*)NULL)->id)
  474.   
  475.   extern    int errno;        /* really belongs in <errno.h> */
  476. *** std/stdc/stdio.c.old    Sat Apr 25 17:41:07 1992
  477. --- std/stdc/stdio.c    Sat Apr 25 18:20:32 1992
  478. ***************
  479. *** 2,15 ****
  480.    * Emulation of misc. ANSI C stdio functions
  481.    */
  482.   
  483. ! /* $Header */
  484.   
  485.   #include <stdio.h>
  486.   
  487.   #if 1
  488.   int
  489.   remove(name)
  490. !     Const char *name;
  491.   {
  492.       return unlink(name);
  493.   }
  494. --- 2,20 ----
  495.    * Emulation of misc. ANSI C stdio functions
  496.    */
  497.   
  498. ! /* $Id: stdio.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  499.   
  500.   #include <stdio.h>
  501.   
  502. + #ifndef __STDC__
  503. + #define const
  504. + #define volatile
  505. + #endif
  506.   #if 1
  507.   int
  508.   remove(name)
  509. !     const char *name;
  510.   {
  511.       return unlink(name);
  512.   }
  513. ***************
  514. *** 18,24 ****
  515.   #if _V7
  516.   int
  517.   rename(oname, nname)
  518. !     Const char *oname, *nname;
  519.   {
  520.       return link(oname, nname) == 0 && unlink(oname) == 0 ? 0 : -1;
  521.   }
  522. --- 23,29 ----
  523.   #if _V7
  524.   int
  525.   rename(oname, nname)
  526. !     const char *oname, *nname;
  527.   {
  528.       return link(oname, nname) == 0 && unlink(oname) == 0 ? 0 : -1;
  529.   }
  530. *** std/stdc/stdio.h_std.old    Sat Apr 25 17:41:42 1992
  531. --- std/stdc/stdio.h_std    Sat Apr 25 14:42:26 1992
  532. ***************
  533. *** 5,11 ****
  534.    * todo: needs L_* constants.
  535.    */
  536.   
  537. ! /* $Header: stdio.h,v 1.2 88/06/23 18:32:35 egisin Locked $ */
  538.   
  539.   #if ! _STDIO_H
  540.   #define    _STDIO_H 1
  541. --- 5,11 ----
  542.    * todo: needs L_* constants.
  543.    */
  544.   
  545. ! /* $Id$ */
  546.   
  547.   #if ! _STDIO_H
  548.   #define    _STDIO_H 1
  549. *** std/stdc/stdlib.h.old    Sat Apr 25 17:42:12 1992
  550. --- std/stdc/stdlib.h    Sat Apr 25 18:20:35 1992
  551. ***************
  552. *** 1,6 ****
  553.   /* ANSI utility functions */
  554.   
  555. ! /* $Header: stdlib.h,v 1.1 88/03/09 21:52:59 egisin Locked $ */
  556.   
  557.   #if ! _STDLIB_H
  558.   #define    _STDLIB_H 1
  559. --- 1,6 ----
  560.   /* ANSI utility functions */
  561.   
  562. ! /* $Id: stdlib.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  563.   
  564.   #if ! _STDLIB_H
  565.   #define    _STDLIB_H 1
  566. ***************
  567. *** 15,23 ****
  568.   unsigned long    strtoul ARGS((const char *s, char **, int base));
  569.   int    rand ARGS((void));
  570.   void    srand ARGS((unsigned int seed));
  571. ! Void   *malloc ARGS((size_t size));
  572. ! Void   *realloc ARGS((void *ptr, size_t size));
  573. ! Void   *calloc ARGS((size_t n, size_t size));
  574.   void    free ARGS((void *ptr));
  575.   void    abort ARGS((void));
  576.   int    atexit ARGS((void (*func)(void)));
  577. --- 15,23 ----
  578.   unsigned long    strtoul ARGS((const char *s, char **, int base));
  579.   int    rand ARGS((void));
  580.   void    srand ARGS((unsigned int seed));
  581. ! void   *malloc ARGS((size_t size));
  582. ! void   *realloc ARGS((void *ptr, size_t size));
  583. ! void   *calloc ARGS((size_t n, size_t size));
  584.   void    free ARGS((void *ptr));
  585.   void    abort ARGS((void));
  586.   int    atexit ARGS((void (*func)(void)));
  587. *** std/stdc/strcat.c.old    Sat Apr 25 17:42:32 1992
  588. --- std/stdc/strcat.c    Sat Apr 25 18:20:38 1992
  589. ***************
  590. *** 1,4 ****
  591. --- 1,5 ----
  592.   #include <string.h>
  593. + /* $Id: strcat.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  594.   
  595.   /*
  596.    * strcat - append string src to dst
  597. ***************
  598. *** 6,15 ****
  599.   char *                /* dst */
  600.   strcat(dst, src)
  601.   char *dst;
  602. ! Const char *src;
  603.   {
  604.       register char *dscan;
  605. !     register Const char *sscan;
  606.   
  607.       for (dscan = dst; *dscan != '\0'; dscan++)
  608.           continue;
  609. --- 7,16 ----
  610.   char *                /* dst */
  611.   strcat(dst, src)
  612.   char *dst;
  613. ! const char *src;
  614.   {
  615.       register char *dscan;
  616. !     register const char *sscan;
  617.   
  618.       for (dscan = dst; *dscan != '\0'; dscan++)
  619.           continue;
  620. *** std/stdc/strchr.c.old    Sat Apr 25 17:42:13 1992
  621. --- std/stdc/strchr.c    Sat Apr 25 18:20:41 1992
  622. ***************
  623. *** 1,4 ****
  624. --- 1,5 ----
  625.   #include <string.h>
  626. + /* $Id: strchr.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  627.   
  628.   /*
  629.    * strchr - find first occurrence of a character in a string
  630. ***************
  631. *** 6,15 ****
  632.   
  633.   char *                /* found char, or NULL if none */
  634.   strchr(s, charwanted)
  635. ! Const char *s;
  636.   register char charwanted;
  637.   {
  638. !     register Const char *scan;
  639.   
  640.       /*
  641.        * The odd placement of the two tests is so NUL is findable.
  642. --- 7,16 ----
  643.   
  644.   char *                /* found char, or NULL if none */
  645.   strchr(s, charwanted)
  646. ! const char *s;
  647.   register char charwanted;
  648.   {
  649. !     register const char *scan;
  650.   
  651.       /*
  652.        * The odd placement of the two tests is so NUL is findable.
  653. *** std/stdc/strcmp.c.old    Sat Apr 25 17:42:14 1992
  654. --- std/stdc/strcmp.c    Sat Apr 25 18:20:43 1992
  655. ***************
  656. *** 1,4 ****
  657. --- 1,5 ----
  658.   #include <string.h>
  659. + /* $Id: strcmp.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  660.   
  661.   /* Modified by Eric Gisin */
  662.   
  663. ***************
  664. *** 8,18 ****
  665.   
  666.   int                /* <0 for <, 0 for ==, >0 for > */
  667.   strcmp(s1, s2)
  668. ! Const char *s1;
  669. ! Const char *s2;
  670.   {
  671. !     register Const char *scan1;
  672. !     register Const char *scan2;
  673.   #if 0                /* some machines prefer int to char */
  674.       register int c1, c2;
  675.   #else
  676. --- 9,19 ----
  677.   
  678.   int                /* <0 for <, 0 for ==, >0 for > */
  679.   strcmp(s1, s2)
  680. ! const char *s1;
  681. ! const char *s2;
  682.   {
  683. !     register const char *scan1;
  684. !     register const char *scan2;
  685.   #if 0                /* some machines prefer int to char */
  686.       register int c1, c2;
  687.   #else
  688. *** std/stdc/strcpy.c.old    Sat Apr 25 17:42:33 1992
  689. --- std/stdc/strcpy.c    Sat Apr 25 18:20:45 1992
  690. ***************
  691. *** 1,4 ****
  692. --- 1,5 ----
  693.   #include <string.h>
  694. + /* $Id: strcpy.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  695.   
  696.   /*
  697.    * strcpy - copy string src to dst
  698. ***************
  699. *** 6,15 ****
  700.   char *                /* dst */
  701.   strcpy(dst, src)
  702.   char *dst;
  703. ! Const char *src;
  704.   {
  705.       register char *dscan;
  706. !     register Const char *sscan;
  707.   
  708.       dscan = dst;
  709.       sscan = src;
  710. --- 7,16 ----
  711.   char *                /* dst */
  712.   strcpy(dst, src)
  713.   char *dst;
  714. ! const char *src;
  715.   {
  716.       register char *dscan;
  717. !     register const char *sscan;
  718.   
  719.       dscan = dst;
  720.       sscan = src;
  721. *** std/stdc/strcspn.c.old    Sat Apr 25 17:42:15 1992
  722. --- std/stdc/strcspn.c    Sat Apr 25 18:20:50 1992
  723. ***************
  724. *** 1,4 ****
  725. --- 1,5 ----
  726.   #include <string.h>
  727. + /* $Id: strcspn.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  728.   
  729.   /*
  730.    * strcspn - find length of initial segment of s consisting entirely
  731. ***************
  732. *** 7,17 ****
  733.   
  734.   size_t
  735.   strcspn(s, reject)
  736. ! Const char *s;
  737. ! Const char *reject;
  738.   {
  739. !     register Const char *scan;
  740. !     register Const char *rscan;
  741.       register size_t count;
  742.   
  743.       count = 0;
  744. --- 8,18 ----
  745.   
  746.   size_t
  747.   strcspn(s, reject)
  748. ! const char *s;
  749. ! const char *reject;
  750.   {
  751. !     register const char *scan;
  752. !     register const char *rscan;
  753.       register size_t count;
  754.   
  755.       count = 0;
  756. *** std/stdc/strerror.c.old    Sat Apr 25 17:42:34 1992
  757. --- std/stdc/strerror.c    Sat Apr 25 18:20:52 1992
  758. ***************
  759. *** 1,4 ****
  760. --- 1,5 ----
  761.   #include <string.h>
  762. + /* $Id: strerror.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  763.   
  764.   /*
  765.    * strerror - map error number to descriptive string
  766. *** std/stdc/string.h.old    Sat Apr 25 17:42:15 1992
  767. --- std/stdc/string.h    Sat Apr 25 18:20:54 1992
  768. ***************
  769. *** 1,4 ****
  770. --- 1,5 ----
  771.   /* ANSI string handling (missing wide char stuff) */
  772. + /* $Id: string.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  773.   
  774.   #if ! _STRING_H
  775.   #define _STRING_H 1
  776. ***************
  777. *** 5,24 ****
  778.   
  779.   #include <stddef.h>        /* define NULL and size_t */
  780.   
  781. ! #if __STDC__
  782. ! #define    ARGS(args)    args
  783. ! #define    Void    void
  784. ! #else
  785. ! #define    ARGS(args)    ()
  786. ! #define    Void    char
  787. ! #endif
  788. ! Void   *memcpy ARGS((Void *s1, const Void *s2, size_t));
  789. ! Void   *memmove ARGS((Void *s1, const Void *s2, size_t));
  790. ! int    memcmp ARGS((const Void *s1, const Void *s2, size_t));
  791. ! Void   *memchr ARGS((const Void *s, int c, size_t));
  792. ! Void   *memset ARGS((Void *s, int c, size_t));
  793.   size_t    strlen ARGS((const char *s));
  794.   char   *strcpy ARGS((char *s1, const char *s2));
  795.   char   *strncpy ARGS((char *s1, const char *s2, size_t));
  796.   char   *strcat ARGS((char *s1, const char *s2));
  797. --- 6,19 ----
  798.   
  799.   #include <stddef.h>        /* define NULL and size_t */
  800.   
  801. ! #ifndef __GNUC__
  802. ! void   *memcpy ARGS((void *s1, const void *s2, size_t));
  803. ! int    memcmp ARGS((const void *s1, const void *s2, size_t));
  804.   size_t    strlen ARGS((const char *s));
  805. + #endif
  806. + void   *memmove ARGS((void *s1, const void *s2, size_t));
  807. + void   *memchr ARGS((const void *s, int c, size_t));
  808. + void   *memset ARGS((void *s, int c, size_t));
  809.   char   *strcpy ARGS((char *s1, const char *s2));
  810.   char   *strncpy ARGS((char *s1, const char *s2, size_t));
  811.   char   *strcat ARGS((char *s1, const char *s2));
  812. *** std/stdc/strlen.c.old    Sat Apr 25 17:42:35 1992
  813. --- std/stdc/strlen.c    Sat Apr 25 18:20:56 1992
  814. ***************
  815. *** 1,4 ****
  816. --- 1,5 ----
  817.   #include <string.h>
  818. + /* $Id: strlen.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  819.   
  820.   /*
  821.    * strlen - length of string (not including NUL)
  822. ***************
  823. *** 5,13 ****
  824.    */
  825.   size_t
  826.   strlen(s)
  827. ! Const char *s;
  828.   {
  829. !     register Const char *scan;
  830.       register size_t count;
  831.   
  832.       count = 0;
  833. --- 6,14 ----
  834.    */
  835.   size_t
  836.   strlen(s)
  837. ! const char *s;
  838.   {
  839. !     register const char *scan;
  840.       register size_t count;
  841.   
  842.       count = 0;
  843. *** std/stdc/strncat.c.old    Sat Apr 25 17:42:16 1992
  844. --- std/stdc/strncat.c    Sat Apr 25 18:21:00 1992
  845. ***************
  846. *** 1,4 ****
  847. --- 1,5 ----
  848.   #include <string.h>
  849. + /* $Id: strncat.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  850.   
  851.   /*
  852.    * strncat - append at most n characters of string src to dst
  853. ***************
  854. *** 6,16 ****
  855.   char *                /* dst */
  856.   strncat(dst, src, n)
  857.   char *dst;
  858. ! Const char *src;
  859.   size_t n;
  860.   {
  861.       register char *dscan;
  862. !     register Const char *sscan;
  863.       register size_t count;
  864.   
  865.       for (dscan = dst; *dscan != '\0'; dscan++)
  866. --- 7,17 ----
  867.   char *                /* dst */
  868.   strncat(dst, src, n)
  869.   char *dst;
  870. ! const char *src;
  871.   size_t n;
  872.   {
  873.       register char *dscan;
  874. !     register const char *sscan;
  875.       register size_t count;
  876.   
  877.       for (dscan = dst; *dscan != '\0'; dscan++)
  878. *** std/stdc/strncmp.c.old    Sat Apr 25 17:42:17 1992
  879. --- std/stdc/strncmp.c    Sat Apr 25 18:21:03 1992
  880. ***************
  881. *** 1,4 ****
  882. --- 1,5 ----
  883.   #include <string.h>
  884. + /* $Id: strncmp.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  885.   
  886.   /*
  887.    * strncmp - compare at most n characters of string s1 to s2
  888. ***************
  889. *** 6,17 ****
  890.   
  891.   int                /* <0 for <, 0 for ==, >0 for > */
  892.   strncmp(s1, s2, n)
  893. ! Const char *s1;
  894. ! Const char *s2;
  895.   size_t n;
  896.   {
  897. !     register Const char *scan1;
  898. !     register Const char *scan2;
  899.       register size_t count;
  900.   
  901.       scan1 = s1;
  902. --- 7,18 ----
  903.   
  904.   int                /* <0 for <, 0 for ==, >0 for > */
  905.   strncmp(s1, s2, n)
  906. ! const char *s1;
  907. ! const char *s2;
  908.   size_t n;
  909.   {
  910. !     register const char *scan1;
  911. !     register const char *scan2;
  912.       register size_t count;
  913.   
  914.       scan1 = s1;
  915. *** std/stdc/strncpy.c.old    Sat Apr 25 17:42:18 1992
  916. --- std/stdc/strncpy.c    Sat Apr 25 18:21:05 1992
  917. ***************
  918. *** 1,4 ****
  919. --- 1,5 ----
  920.   #include <string.h>
  921. + /* $Id: strncpy.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  922.   
  923.   /*
  924.    * strncpy - copy at most n characters of string src to dst
  925. ***************
  926. *** 6,16 ****
  927.   char *                /* dst */
  928.   strncpy(dst, src, n)
  929.   char *dst;
  930. ! Const char *src;
  931.   size_t n;
  932.   {
  933.       register char *dscan;
  934. !     register Const char *sscan;
  935.       register size_t count;
  936.   
  937.       dscan = dst;
  938. --- 7,17 ----
  939.   char *                /* dst */
  940.   strncpy(dst, src, n)
  941.   char *dst;
  942. ! const char *src;
  943.   size_t n;
  944.   {
  945.       register char *dscan;
  946. !     register const char *sscan;
  947.       register size_t count;
  948.   
  949.       dscan = dst;
  950. *** std/stdc/strpbrk.c.old    Sat Apr 25 17:42:19 1992
  951. --- std/stdc/strpbrk.c    Sat Apr 25 18:21:07 1992
  952. ***************
  953. *** 1,4 ****
  954. --- 1,5 ----
  955.   #include <string.h>
  956. + /* $Id: strpbrk.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  957.   
  958.   /*
  959.    * strpbrk - find first occurrence of any char from breakat in s
  960. ***************
  961. *** 6,16 ****
  962.   
  963.   char *                /* found char, or NULL if none */
  964.   strpbrk(s, breakat)
  965. ! Const char *s;
  966. ! Const char *breakat;
  967.   {
  968. !     register Const char *sscan;
  969. !     register Const char *bscan;
  970.   
  971.       for (sscan = s; *sscan != '\0'; sscan++) {
  972.           for (bscan = breakat; *bscan != '\0';)    /* ++ moved down. */
  973. --- 7,17 ----
  974.   
  975.   char *                /* found char, or NULL if none */
  976.   strpbrk(s, breakat)
  977. ! const char *s;
  978. ! const char *breakat;
  979.   {
  980. !     register const char *sscan;
  981. !     register const char *bscan;
  982.   
  983.       for (sscan = s; *sscan != '\0'; sscan++) {
  984.           for (bscan = breakat; *bscan != '\0';)    /* ++ moved down. */
  985. *** std/stdc/strrchr.c.old    Sat Apr 25 17:42:20 1992
  986. --- std/stdc/strrchr.c    Sat Apr 25 18:21:09 1992
  987. ***************
  988. *** 1,4 ****
  989. --- 1,5 ----
  990.   #include <string.h>
  991. + /* $Id: strrchr.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  992.   
  993.   /*
  994.    * strrchr - find last occurrence of a character in a string
  995. ***************
  996. *** 6,16 ****
  997.   
  998.   char *                /* found char, or NULL if none */
  999.   strrchr(s, charwanted)
  1000. ! Const char *s;
  1001.   register char charwanted;
  1002.   {
  1003. !     register Const char *scan;
  1004. !     register Const char *place;
  1005.   
  1006.       place = NULL;
  1007.       for (scan = s; *scan != '\0'; scan++)
  1008. --- 7,17 ----
  1009.   
  1010.   char *                /* found char, or NULL if none */
  1011.   strrchr(s, charwanted)
  1012. ! const char *s;
  1013.   register char charwanted;
  1014.   {
  1015. !     register const char *scan;
  1016. !     register const char *place;
  1017.   
  1018.       place = NULL;
  1019.       for (scan = s; *scan != '\0'; scan++)
  1020. *** std/stdc/strspn.c.old    Sat Apr 25 17:42:21 1992
  1021. --- std/stdc/strspn.c    Sat Apr 25 18:21:11 1992
  1022. ***************
  1023. *** 1,4 ****
  1024. --- 1,5 ----
  1025.   #include <string.h>
  1026. + /* $Id: strspn.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  1027.   
  1028.   /*
  1029.    * strspn - find length of initial segment of s consisting entirely
  1030. ***************
  1031. *** 7,17 ****
  1032.   
  1033.   size_t
  1034.   strspn(s, accept)
  1035. ! Const char *s;
  1036. ! Const char *accept;
  1037.   {
  1038. !     register Const char *sscan;
  1039. !     register Const char *ascan;
  1040.       register size_t count;
  1041.   
  1042.       count = 0;
  1043. --- 8,18 ----
  1044.   
  1045.   size_t
  1046.   strspn(s, accept)
  1047. ! const char *s;
  1048. ! const char *accept;
  1049.   {
  1050. !     register const char *sscan;
  1051. !     register const char *ascan;
  1052.       register size_t count;
  1053.   
  1054.       count = 0;
  1055. *** std/stdc/strstr.c.old    Sat Apr 25 17:44:47 1992
  1056. --- std/stdc/strstr.c    Sat Apr 25 10:59:02 1992
  1057. ***************
  1058. *** 1,5 ****
  1059.   #ifndef lint
  1060. ! static char *sccs_id = "@(#)strstr.c    1.2 91/11/22 22:49:34 (sjg)";
  1061.   #endif
  1062.   
  1063.   #include "stdh.h"
  1064. --- 1,5 ----
  1065.   #ifndef lint
  1066. ! static char *RCSid = "$Id: strstr.c,v 1.2 1992/04/25 00:58:50 sjg Exp $";
  1067.   #endif
  1068.   
  1069.   #include "stdh.h"
  1070. ***************
  1071. *** 10,19 ****
  1072.   
  1073.   char *                /* found string, or NULL if none */
  1074.   strstr(s, wanted)
  1075. ! Const char *s;
  1076. ! Const char *wanted;
  1077.   {
  1078. !     register Const char *scan;
  1079.       register size_t len;
  1080.       register char firstc;
  1081.   
  1082. --- 10,19 ----
  1083.   
  1084.   char *                /* found string, or NULL if none */
  1085.   strstr(s, wanted)
  1086. ! const char *s;
  1087. ! const char *wanted;
  1088.   {
  1089. !     register const char *scan;
  1090.       register size_t len;
  1091.       register char firstc;
  1092.   
  1093. *** std/stdc/strtok.c.old    Sat Apr 25 17:42:23 1992
  1094. --- std/stdc/strtok.c    Sat Apr 25 18:21:14 1992
  1095. ***************
  1096. *** 1,4 ****
  1097. --- 1,5 ----
  1098.   #include <string.h>
  1099. + /* $Id: strtok.c,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  1100.   
  1101.   /*
  1102.    * Get next token from string s (NULL on 2nd, 3rd, etc. calls),
  1103. ***************
  1104. *** 12,22 ****
  1105.   char *                /* NULL if no token left */
  1106.   strtok(s, delim)
  1107.   char *s;
  1108. ! register Const char *delim;
  1109.   {
  1110.       register char *scan;
  1111.       char *tok;
  1112. !     register Const char *dscan;
  1113.   
  1114.       if (s == NULL && scanpoint == NULL)
  1115.           return(NULL);
  1116. --- 13,23 ----
  1117.   char *                /* NULL if no token left */
  1118.   strtok(s, delim)
  1119.   char *s;
  1120. ! register const char *delim;
  1121.   {
  1122.       register char *scan;
  1123.       char *tok;
  1124. !     register const char *dscan;
  1125.   
  1126.       if (s == NULL && scanpoint == NULL)
  1127.           return(NULL);
  1128. *** std/stdc/time.h.old    Sat Apr 25 17:42:23 1992
  1129. --- std/stdc/time.h    Sat Apr 25 18:21:19 1992
  1130. ***************
  1131. *** 1,4 ****
  1132. --- 1,5 ----
  1133.   /* time, time/date conversion */
  1134. + /* $Id: time.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  1135.   
  1136.   #if ! _TIME_H
  1137.   #define    _TIME_H 1
  1138. ***************
  1139. *** 5,12 ****
  1140.   
  1141.   #include <stddef.h>        /* need size_t */
  1142.   
  1143. ! #ifndef sparc
  1144.   typedef long time_t;
  1145.   typedef long clock_t;        /* seconds/CLK_TCK */
  1146.   #endif
  1147.   
  1148. --- 6,15 ----
  1149.   
  1150.   #include <stddef.h>        /* need size_t */
  1151.   
  1152. ! #ifndef HAVE_SYS_STDTYPES
  1153. ! #ifndef _TIME_T
  1154.   typedef long time_t;
  1155. + #endif
  1156.   typedef long clock_t;        /* seconds/CLK_TCK */
  1157.   #endif
  1158.   
  1159. *** std/stdc/types.h.old    Sat Apr 25 17:42:24 1992
  1160. --- std/stdc/types.h    Sat Apr 25 18:21:23 1992
  1161. ***************
  1162. *** 1,4 ****
  1163. --- 1,5 ----
  1164.   /* work around multiple typedefs in stddef.h and sys/types.h */
  1165. + /* $Id: types.h,v 1.2 1992/04/25 08:19:26 sjg Exp $ */
  1166.   
  1167.   #include <stddef.h>        /* defines size_t and ptrdiff_t */
  1168.   #include <time.h>        /* defines time_t and clock_t */
  1169. *** std/stdc/vprintf.c.old    Sat Apr 25 17:41:21 1992
  1170. --- std/stdc/vprintf.c    Sat Apr 25 18:21:26 1992
  1171. ***************
  1172. *** 1,4 ****
  1173. ! #if __STDC__
  1174.   #include <stdarg.h>
  1175.   #else
  1176.   #include <varargs.h>
  1177. --- 1,7 ----
  1178. ! #ifndef lint
  1179. ! static char *RCSid = "$Id: vprintf.c,v 1.2 1992/04/25 08:19:26 sjg Exp $";
  1180. ! #endif
  1181. ! #ifdef __STDC__
  1182.   #include <stdarg.h>
  1183.   #else
  1184.   #include <varargs.h>
  1185. ***************
  1186. *** 8,15 ****
  1187.   #define    BUF    40        /* buffer for int -> string conversion */
  1188.   
  1189.   int
  1190. ! #if __STDC__
  1191. ! vprintf(Const char *fmt, va_list va) {
  1192.   #else
  1193.   vprintf(fmt, va) char *fmt; va_list va; {
  1194.   #endif
  1195. --- 11,18 ----
  1196.   #define    BUF    40        /* buffer for int -> string conversion */
  1197.   
  1198.   int
  1199. ! #ifdef __STDC__
  1200. ! vprintf(const char *fmt, va_list va) {
  1201.   #else
  1202.   vprintf(fmt, va) char *fmt; va_list va; {
  1203.   #endif
  1204. ***************
  1205. *** 17,24 ****
  1206.   }
  1207.   
  1208.   int
  1209. ! #if __STDC__
  1210. ! vfprintf(register FILE *f, register Const char *fmt, register va_list va) {
  1211.   #else
  1212.   vfprintf(f, fmt, va) register FILE *f; register char *fmt; register va_list va; {
  1213.   #endif
  1214. --- 20,27 ----
  1215.   }
  1216.   
  1217.   int
  1218. ! #ifdef __STDC__
  1219. ! vfprintf(register FILE *f, register const char *fmt, register va_list va) {
  1220.   #else
  1221.   vfprintf(f, fmt, va) register FILE *f; register char *fmt; register va_list va; {
  1222.   #endif
  1223. ***************
  1224. *** 114,120 ****
  1225.   
  1226.             case 'p':        /* pointer */
  1227.               *--p = '}';
  1228. !             u = (unsigned long) va_arg(va, Void*);
  1229.               do {
  1230.                   *--p = "0123456789ABCDEF"[u%16];
  1231.                   u /= 16;
  1232. --- 117,123 ----
  1233.   
  1234.             case 'p':        /* pointer */
  1235.               *--p = '}';
  1236. !             u = (unsigned long) va_arg(va, void*);
  1237.               do {
  1238.                   *--p = "0123456789ABCDEF"[u%16];
  1239.                   u /= 16;
  1240. ***************
  1241. *** 136,142 ****
  1242.               break;
  1243.   
  1244.             case 's':        /* string */
  1245. !             p = va_arg(va, char *);
  1246.               if ((flags&FF_PREC) && strlen(p) > prec) {
  1247.                   pos += prec;
  1248.                   while (--prec >= 0)
  1249. --- 139,146 ----
  1250.               break;
  1251.   
  1252.             case 's':        /* string */
  1253. !             if ((p = va_arg(va, char *)) == NULL)
  1254. !               p = "";
  1255.               if ((flags&FF_PREC) && strlen(p) > prec) {
  1256.                   pos += prec;
  1257.                   while (--prec >= 0)
  1258.  
  1259. exit 0 # Just in case...
  1260.