home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-25 | 36.5 KB | 1,583 lines |
- Newsgroups: comp.sources.misc
- From: sjg@zen.void.oz.au (Simon J. Gerraty)
- Subject: v26i072: pdksh - Public Domain Korn Shell, Version 4, Patch01b/2
- Message-ID: <1991Nov26.040159.1946@sparky.imd.sterling.com>
- X-Md4-Signature: 1b38b74626a64e8e7e9c62a17f892e61
- Date: Tue, 26 Nov 1991 04:01:59 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: sjg@zen.void.oz.au (Simon J. Gerraty)
- Posting-number: Volume 26, Issue 72
- Archive-name: pdksh/patch01b
- Environment: UNIX
- Patch-To: pdksh: Volume 25, Issue 47-55
-
- This is the second half of patch01
-
- --------------------8<--------------------
- *** sh/emacs.c.old Mon Nov 25 13:38:09 1991
- --- sh/emacs.c Mon Nov 25 13:33:14 1991
- ***************
- *** 11,25 ****
-
- #ifndef lint
- static char *RCSid = "$Id: emacs.c,v 3.2 89/03/27 15:49:17 egisin Exp $";
- ! static char *sccs_id = "@(#)emacs.c 1.5 91/11/09 15:35:13 (sjg)";
- #endif
-
- ! #include <stddef.h>
- ! #include <stdlib.h>
- ! #include <string.h>
- ! #include <stdio.h>
- #include <signal.h>
- - #include <sys/types.h>
- #include <sys/stat.h>
- #include <dirent.h>
- #include <unistd.h>
- --- 11,21 ----
-
- #ifndef lint
- static char *RCSid = "$Id: emacs.c,v 3.2 89/03/27 15:49:17 egisin Exp $";
- ! static char *sccs_id = "@(#)emacs.c 1.7 91/11/25 13:32:56 (sjg)";
- #endif
-
- ! #include "stdh.h"
- #include <signal.h>
- #include <sys/stat.h>
- #include <dirent.h>
- #include <unistd.h>
- ***************
- *** 74,87 ****
- #define BEL 0x07
- #define CMASK 0x7F /* 7-bit ASCII character mask */
-
- static int x_prefix1 = CTRL('['), x_prefix2 = CTRL('X');
- static char **x_histp; /* history position */
- static char **x_nextcmdp; /* for newline-and-next */
- static char *xmp; /* mark pointer */
- static int (*x_last_command)();
- ! /*static struct x_ftab *x_tab[3][128];*/
- ! static struct x_ftab Const *(*x_tab)[128] = NULL; /* key definition */
- ! static char *(*x_atab)[128] = NULL; /* macro definitions */
- #define KILLSIZE 20
- static char *killstack[KILLSIZE];
- static int killsp, killtp;
- --- 70,84 ----
- #define BEL 0x07
- #define CMASK 0x7F /* 7-bit ASCII character mask */
-
- + #define X_TABSZ 128 /* size of keydef tables etc */
- +
- static int x_prefix1 = CTRL('['), x_prefix2 = CTRL('X');
- static char **x_histp; /* history position */
- static char **x_nextcmdp; /* for newline-and-next */
- static char *xmp; /* mark pointer */
- static int (*x_last_command)();
- ! static struct x_ftab Const *(*x_tab)[X_TABSZ] = NULL; /* key definition */
- ! static char *(*x_atab)[X_TABSZ] = NULL; /* macro definitions */
- #define KILLSIZE 20
- static char *killstack[KILLSIZE];
- static int killsp, killtp;
- ***************
- *** 1150,1156 ****
-
- ainit(AEDIT);
-
- ! x_tab = (struct x_ftab ***) alloc(sizeofN(*x_tab, 3), AEDIT);
- for (j = 0; j < 128; j++)
- x_tab[0][j] = xft_insert;
- for (i = 1; i < 3; i++)
- --- 1147,1153 ----
-
- ainit(AEDIT);
-
- ! x_tab = (struct x_ftab *(*)[X_TABSZ]) alloc(sizeofN(*x_tab, 3), AEDIT);
- for (j = 0; j < 128; j++)
- x_tab[0][j] = xft_insert;
- for (i = 1; i < 3; i++)
- ***************
- *** 1160,1166 ****
- if (fp->xf_db_char || fp->xf_db_tab)
- x_tab[fp->xf_db_tab][fp->xf_db_char] = fp;
-
- ! x_atab = (char ***) alloc(sizeofN(*x_atab, 3), AEDIT);
- for (i = 1; i < 3; i++)
- for (j = 0; j < 128; j++)
- x_atab[i][j] = NULL;
- --- 1157,1163 ----
- if (fp->xf_db_char || fp->xf_db_tab)
- x_tab[fp->xf_db_tab][fp->xf_db_char] = fp;
-
- ! x_atab = (char *(*)[X_TABSZ]) alloc(sizeofN(*x_atab, 3), AEDIT);
- for (i = 1; i < 3; i++)
- for (j = 0; j < 128; j++)
- x_atab[i][j] = NULL;
- *** sh/eval.c.old Mon Nov 25 13:38:33 1991
- --- sh/eval.c Fri Nov 22 22:54:14 1991
- ***************
- *** 2,16 ****
- * Expansion - quoting, separation, substitution, globbing
- */
-
- static char *RCSid = "$Id: eval.c,v 3.4 89/03/27 15:49:55 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <stdio.h>
- ! #include <string.h>
- #include <errno.h>
- #include <setjmp.h>
- #include <unistd.h>
- - #include <sys/types.h>
- #include <dirent.h>
- #include <pwd.h>
- #include "sh.h"
- --- 2,16 ----
- * Expansion - quoting, separation, substitution, globbing
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: eval.c,v 3.4 89/03/27 15:49:55 egisin Exp $";
- + static char *sccs_id = "@(#)eval.c 1.2 91/11/22 22:53:39 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include <unistd.h>
- #include <dirent.h>
- #include <pwd.h>
- #include "sh.h"
- *** sh/exec.c.old Mon Nov 25 13:38:25 1991
- --- sh/exec.c Mon Nov 25 13:33:15 1991
- ***************
- *** 4,21 ****
-
- #ifndef lint
- static char *RCSid = "$Id: exec.c,v 3.4 89/03/27 15:50:10 egisin Exp $";
- ! static char *sccs_id = "@(#)exec.c 1.3 91/11/09 15:35:22 (sjg)";
- #endif
-
- ! #include <stddef.h>
- ! #include <stdio.h>
- ! #include <string.h>
- #include <errno.h>
- #include <signal.h>
- #include <setjmp.h>
- #include <unistd.h>
- #include <fcntl.h>
- - #include <sys/types.h>
- #include <sys/stat.h>
- #include "sh.h"
- #include "lex.h"
- --- 4,18 ----
-
- #ifndef lint
- static char *RCSid = "$Id: exec.c,v 3.4 89/03/27 15:50:10 egisin Exp $";
- ! static char *sccs_id = "@(#)exec.c 1.6 91/11/25 13:33:03 (sjg)";
- #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <signal.h>
- #include <setjmp.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/stat.h>
- #include "sh.h"
- #include "lex.h"
- ***************
- *** 31,36 ****
- --- 28,67 ----
- #endif
-
- /*
- + * handle systems that don't have F_SETFD
- + */
- + #ifndef F_SETFD
- + # ifndef MAXFD
- + # define MAXFD 64
- + # endif
- + /*
- + * a bit field would be smaller, but this
- + * will work
- + */
- + static char clexec_tab[MAXFD+1];
- +
- + /* this is so that main() can clear it */
- + void
- + init_clexec()
- + {
- + (void) memset(clexec_tab, 0, sizeof(clexec_tab)-1);
- + }
- +
- + int
- + fd_clexec(fd)
- + int fd;
- + {
- + if (fd < sizeof(clexec_tab))
- + {
- + clexec_tab[fd] = 1;
- + return 0;
- + }
- + return -1;
- + }
- + #endif
- +
- +
- + /*
- * execute command tree
- */
- int
- ***************
- *** 185,193 ****
- case TEXEC: /* an eval'd TCOM */
- s = t->args[0];
- ap = makenv();
- ! #ifdef _MINIX /* no F_SETFD close-on-exec */
- ! for (i = 10; i < 20; i++)
- ! close(i);
- #endif
- execve(t->str, t->args, ap);
- if (errno == ENOEXEC) {
- --- 216,228 ----
- case TEXEC: /* an eval'd TCOM */
- s = t->args[0];
- ap = makenv();
- ! #ifndef F_SETFD
- ! for (i = 0; i < sizeof(clexec_tab); i++)
- ! if (clexec_tab[i])
- ! {
- ! close(i);
- ! clexec_tab[i] = 0;
- ! }
- #endif
- execve(t->str, t->args, ap);
- if (errno == ENOEXEC) {
- *** sh/expr.c.old Mon Nov 25 13:38:53 1991
- --- sh/expr.c Fri Nov 22 22:54:15 1991
- ***************
- *** 2,10 ****
- * Korn expression evaluation
- */
-
- static char *RCSid = "$Id: expr.c,v 3.2 89/03/27 15:50:20 egisin Exp $";
-
- ! #include <stddef.h>
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- --- 2,13 ----
- * Korn expression evaluation
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: expr.c,v 3.2 89/03/27 15:50:20 egisin Exp $";
- + static char *sccs_id = "@(#)expr.c 1.2 91/11/22 22:53:42 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- *** sh/getopts.c.old Mon Nov 25 13:39:10 1991
- --- sh/getopts.c Fri Nov 22 22:54:15 1991
- ***************
- *** 6,15 ****
- * modified for PD ksh by Eric Gisin
- */
-
- static char *RCSid = "$Id: getopts.c,v 3.3 89/03/27 15:50:27 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <string.h>
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- --- 6,17 ----
- * modified for PD ksh by Eric Gisin
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: getopts.c,v 3.3 89/03/27 15:50:27 egisin Exp $";
- + static char *sccs_id = "@(#)getopts.c 1.2 91/11/22 22:53:43 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- *** sh/history.c.old Mon Nov 25 13:38:43 1991
- --- sh/history.c Fri Nov 22 22:54:16 1991
- ***************
- *** 4,14 ****
- * only implements in-memory history.
- */
-
- static char *RCSid = "$Id: history.c,v 3.3 89/01/27 00:08:27 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <stdio.h>
- ! #include <string.h>
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- --- 4,15 ----
- * only implements in-memory history.
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: history.c,v 3.3 89/01/27 00:08:27 egisin Exp $";
- + static char *sccs_id = "@(#)history.c 1.2 91/11/22 22:53:45 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- *** sh/io.c.old Mon Nov 25 13:39:11 1991
- --- sh/io.c Mon Nov 25 13:33:16 1991
- ***************
- *** 2,12 ****
- * shell buffered IO and formatted output
- */
-
- static char *RCSid = "$Id: io.c,v 3.4 89/03/27 15:50:52 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <stdlib.h>
- ! #include <stdio.h>
- #include <errno.h>
- #include <unistd.h>
- #include <fcntl.h>
- --- 2,13 ----
- * shell buffered IO and formatted output
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: io.c,v 3.4 89/03/27 15:50:52 egisin Exp $";
- + static char *sccs_id = "@(#)io.c 1.4 91/11/25 13:33:08 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <unistd.h>
- #include <fcntl.h>
- ***************
- *** 135,141 ****
- --- 136,146 ----
- return -1;
- else
- errorf("too many files open in shell\n");
- + #ifdef F_SETFD
- (void) fcntl(nfd, F_SETFD, FD_CLEXEC);
- + #else
- + (void) fd_clexec(ttyfd);
- + #endif
- close(fd);
- } else
- nfd = fd;
- *** sh/jobs.c.old Mon Nov 25 13:38:19 1991
- --- sh/jobs.c Fri Nov 22 22:54:10 1991
- ***************
- *** 3,9 ****
- */
- #ifndef lint
- static char *RCSid = "$Id: jobs.c,v 3.5 89/03/27 15:51:01 egisin Exp $";
- ! static char sccs_id[] = "@(#)jobs.c 1.4 91/08/16 17:36:59 (sjg)";
- #endif
-
- /*
- --- 3,9 ----
- */
- #ifndef lint
- static char *RCSid = "$Id: jobs.c,v 3.5 89/03/27 15:51:01 egisin Exp $";
- ! static char sccs_id[] = "@(#)jobs.c 1.5 91/11/22 22:53:20 (sjg)";
- #endif
-
- /*
- ***************
- *** 21,34 ****
- * There is a simple work-around if there is no SA_RESTART.
- */
-
- ! #include <stddef.h>
- ! #include <string.h>
- ! #include <stdio.h>
- #include <errno.h>
- #include <unistd.h>
- #include <signal.h>
- #include <setjmp.h>
- - #include <sys/types.h>
- #include <sys/times.h>
- #include <sys/wait.h>
- #include "sh.h"
- --- 21,31 ----
- * There is a simple work-around if there is no SA_RESTART.
- */
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <unistd.h>
- #include <signal.h>
- #include <setjmp.h>
- #include <sys/times.h>
- #include <sys/wait.h>
- #include "sh.h"
- ***************
- *** 41,48 ****
- #endif
- #endif
-
- ! #ifndef WIFCORED
- ! #define WIFCORED(x) (!!((x)&0x80)) /* non-standard */
- #endif
-
- /* as of P1003.1 Draft 12.3:
- --- 38,78 ----
- #endif
- #endif
-
- ! #ifdef _BSD
- ! /*
- ! * These macros are for the benefit of SunOS 4.0.2 and 4.0.3
- ! * SunOS 4.1.1 already defines most of them.
- ! * Clearly these are aimed at SunOS, they may work for other
- ! * BSD systems but I can't promise.
- ! */
- ! # ifndef WIFSTOPPED
- ! # define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED)
- ! # endif
- ! # ifndef WIFSIGNALED
- ! # define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0)
- ! # endif
- ! # ifndef WIFEXITED
- ! # define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0)
- ! # endif
- ! # ifndef WSTOPSIG
- ! # define WSTOPSIG(x) ((x).w_stopsig)
- ! # endif
- ! # ifndef WTERMSIG
- ! # define WTERMSIG(x) ((x).w_termsig)
- ! # endif
- ! # ifndef WIFCORED
- ! # define WIFCORED(x) ((x).w_coredump)
- ! # endif
- ! # ifndef WEXITSTATUS
- ! # define WEXITSTATUS(x) ((x).w_retcode)
- ! # endif
- ! # ifndef HAVE_WAITPID
- ! # define waitpid(pid, sp, opts) wait3(sp, opts, (Void*)NULL)
- ! # endif
- ! #else /* not _BSD */
- ! # ifndef WIFCORED
- ! # define WIFCORED(x) (!!((x)&0x80)) /* non-standard */
- ! # endif
- #endif
-
- /* as of P1003.1 Draft 12.3:
- ***************
- *** 67,72 ****
- --- 97,109 ----
- #ifndef SIGCHLD
- #define SIGCHLD SIGCLD
- #endif
- + #ifndef WAIT_T
- + #ifdef _BSD
- + #define WAIT_T union wait
- + #else
- + #define WAIT_T int
- + #endif
- + #endif
-
- typedef struct Proc Proc;
- struct Proc {
- ***************
- *** 78,84 ****
- pid_t proc; /* process id */
- pid_t pgrp; /* process group if flag[FMONITOR] */
- short flags; /* execute flags */
- ! int status; /* wait status */
- clock_t utime, stime; /* user/system time when JDONE */
- char com [48]; /* command */
- };
- --- 115,121 ----
- pid_t proc; /* process id */
- pid_t pgrp; /* process group if flag[FMONITOR] */
- short flags; /* execute flags */
- ! WAIT_T status; /* wait status */
- clock_t utime, stime; /* user/system time when JDONE */
- char com [48]; /* command */
- };
- ***************
- *** 454,460 ****
-
- do {
- register Proc *j;
- ! int pid, status;
- #ifdef JOBS
- if (flag[FMONITOR])
- pid = waitpid(-1, &status, (WNOHANG|WUNTRACED));
- --- 491,498 ----
-
- do {
- register Proc *j;
- ! int pid;
- ! WAIT_T status;
- #ifdef JOBS
- if (flag[FMONITOR])
- pid = waitpid(-1, &status, (WNOHANG|WUNTRACED));
- *** sh/lex.c.old Mon Nov 25 13:38:35 1991
- --- sh/lex.c Fri Nov 22 22:54:09 1991
- ***************
- *** 4,15 ****
-
- #ifndef lint
- static char *RCSid = "$Id: lex.c,v 3.6 89/03/27 15:51:20 egisin Exp $";
- ! static char *sccs_id = "@(#)lex.c 1.3 91/11/09 15:35:19 (sjg)";
- #endif
-
- ! #include <stddef.h>
- ! #include <stdio.h>
- ! #include <string.h>
- #include <errno.h>
- #include <setjmp.h>
- #include <unistd.h>
- --- 4,13 ----
-
- #ifndef lint
- static char *RCSid = "$Id: lex.c,v 3.6 89/03/27 15:51:20 egisin Exp $";
- ! static char *sccs_id = "@(#)lex.c 1.4 91/11/22 22:53:17 (sjg)";
- #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include <unistd.h>
- *** sh/mail.c.old Mon Nov 25 13:38:54 1991
- --- sh/mail.c Fri Nov 22 22:54:16 1991
- ***************
- *** 2,15 ****
- * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by
- * John R. MacMillan
- */
-
- ! #include <stddef.h>
- ! #include <stdio.h>
- ! #include <string.h>
- #include <signal.h>
- #include <errno.h>
- #include <setjmp.h>
- - #include <sys/types.h>
- #include <sys/stat.h>
- #include "sh.h"
- #include "table.h"
- --- 2,15 ----
- * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by
- * John R. MacMillan
- */
- + #ifndef lint
- + static char *sccs_id = "@(#)mail.c 1.2 91/11/22 22:53:47 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <signal.h>
- #include <errno.h>
- #include <setjmp.h>
- #include <sys/stat.h>
- #include "sh.h"
- #include "table.h"
- *** sh/main.c.old Mon Nov 25 13:38:45 1991
- --- sh/main.c Mon Nov 25 13:33:16 1991
- ***************
- *** 4,18 ****
-
- #ifndef lint
- static char *RCSid = "$Id: main.c,v 3.3 89/03/27 15:51:39 egisin Exp $";
- ! static char *sccs_id = "@(#)main.c 1.3 91/11/09 15:34:27 (sjg)";
- #endif
-
- #define Extern /* define Externs in sh.h */
-
- ! #include <stddef.h>
- ! #include <stdlib.h>
- ! #include <stdio.h>
- ! #include <string.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <signal.h>
- --- 4,15 ----
-
- #ifndef lint
- static char *RCSid = "$Id: main.c,v 3.3 89/03/27 15:51:39 egisin Exp $";
- ! static char *sccs_id = "@(#)main.c 1.6 91/11/25 13:33:06 (sjg)";
- #endif
-
- #define Extern /* define Externs in sh.h */
-
- ! #include "stdh.h"
- #include <unistd.h>
- #include <fcntl.h>
- #include <signal.h>
- ***************
- *** 24,29 ****
- --- 21,30 ----
- #include "tree.h"
- #include "table.h"
-
- + #ifndef HAVE_REMOVE
- + #define remove(x) unlink(x)
- + #endif
- +
- /*
- * global data
- */
- ***************
- *** 100,105 ****
- --- 101,109 ----
-
- ainit(&aperm); /* initialize permanent Area */
-
- + #ifndef F_SETFD
- + init_clexec();
- + #endif
- /* set up base enviroment */
- e.type = E_NONE;
- ainit(&e.area);
- ***************
- *** 211,217 ****
- --- 215,225 ----
- }
- if (s->type == STTY) {
- ttyfd = fcntl(0, F_DUPFD, FDBASE);
- + #ifdef F_SETFD
- (void) fcntl(ttyfd, F_SETFD, FD_CLEXEC);
- + #else
- + (void) fd_clexec(ttyfd);
- + #endif
- #ifdef EMACS
- x_init_emacs();
- #endif
- *** sh/misc.c.old Mon Nov 25 13:38:56 1991
- --- sh/misc.c Fri Nov 22 22:54:16 1991
- ***************
- *** 2,17 ****
- * Miscellaneous functions
- */
-
- static char *RCSid = "$Id: misc.c,v 3.2 89/03/27 15:51:44 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <limits.h>
- ! #include <string.h>
- #include <signal.h>
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- #include "expand.h"
-
- char ctypes [UCHAR_MAX+1]; /* type bits for unsigned char */
-
- --- 2,23 ----
- * Miscellaneous functions
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: misc.c,v 3.2 89/03/27 15:51:44 egisin Exp $";
- + static char *sccs_id = "@(#)misc.c 1.2 91/11/22 22:53:50 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <signal.h>
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- #include "expand.h"
- + #ifndef NOSTDHDRS
- + # include <limits.h>
- + #else
- + # define UCHAR_MAX 0xFF
- + #endif
-
- char ctypes [UCHAR_MAX+1]; /* type bits for unsigned char */
-
- *** sh/sh.h.old Mon Nov 25 13:38:57 1991
- --- sh/sh.h Fri Nov 22 22:54:11 1991
- ***************
- *** 8,14 ****
-
- /* allow for non-Unix linkers. main.c has a "#define Extern " */
- #ifndef Extern
- ! #define Extern extern
- #endif
-
- #ifndef SHELL
- --- 8,14 ----
-
- /* allow for non-Unix linkers. main.c has a "#define Extern " */
- #ifndef Extern
- ! # define Extern extern
- #endif
-
- #ifndef SHELL
- ***************
- *** 16,21 ****
- --- 16,22 ----
- #endif
-
- /* some people object to this use of __STDC__ */
- + #ifndef Void
- #if __STDC__
- #define ARGS(args) args /* prototype declaration */
- #define Void void /* generic pointer */
- ***************
- *** 27,32 ****
- --- 28,34 ----
- #define Const
- #define Volatile
- #endif
- + #endif
-
- #ifdef _ULTRIX /* Ultrix 2.x gets dup2 wrong */
- int dup2 ARGS ((int, int));
- ***************
- *** 140,145 ****
- --- 142,148 ----
- /*
- * other functions
- */
- + char * substitute ARGS((char Const *, int));
- char *search();
- struct tbl *findcom();
- char *strsave ARGS((char *, Area *));
- ***************
- *** 258,261 ****
- * use my simple debug tracing...
- */
- #include "trace.h"
- -
- --- 261,263 ----
- *** /dev/null Mon Nov 25 11:15:05 1991
- --- sh/stdh.h Mon Nov 25 13:33:17 1991
- ***************
- *** 0 ****
- --- 1,88 ----
- + /* NAME:
- + * stdh.h - standard headers
- + *
- + * SYNOPSIS:
- + * #include "stdh.h"
- + *
- + * DESCRIPTION:
- + * We use this header to encapsulate all the stddef et al
- + * inclusion so that most of the source can ignore the
- + * problems that their lack might cause.
- + *
- + * SEE ALSO:
- + *
- + *
- + * AMENDED:
- + * 91/11/25 13:33:12 (sjg)
- + *
- + * RELEASED:
- + * 91/11/25 13:33:17 v1.3
- + *
- + * SCCSID:
- + * @(#)stdh.h 1.3 91/11/25 13:33:12 (sjg)
- + *
- + */
- +
- + #ifndef Void
- + # if defined(__STDC__) || defined(__GNUC__)
- + # define ARGS(args) args /* prototype declaration */
- + # define Void void /* generic pointer */
- + # define Const const /* constant data */
- + # define Volatile volatile /* you know */
- + # else
- + # define ARGS(args) () /* K&R declaration */
- + # define Void char
- + # define Const
- + # define Volatile
- + # endif
- + #endif
- +
- + #include <stdio.h>
- + /* if we have std headers then include them here
- + * otherwise make allowances
- + */
- + #ifndef NOSTDHDRS
- + # include <stddef.h>
- + # include <stdlib.h>
- + # include <string.h>
- + # include <sys/types.h>
- + #else
- + # ifdef HAVE_SYS_STDTYPES
- + # include <sys/stdtypes.h>
- + # else
- + # include <sys/types.h>
- + /* just in case they have sys/stdtypes and don't know it
- + */
- + # ifndef __sys_stdtypes_h
- + typedef int pid_t;
- + typedef long clock_t;
- + # endif
- + # endif
- + # ifdef _SYSV
- + # include <string.h>
- + # else
- + # include <strings.h>
- + # define strchr index
- + # define strrchr rindex
- + # endif
- + /* just a useful subset of what stdlib.h would have
- + */
- + extern char * getenv ARGS((Const char *));
- + extern Void * malloc ARGS((size_t));
- + extern int free ARGS((Void *));
- + extern int exit ARGS((int));
- + #endif /* NOSTDHDRS */
- +
- + /* these _should_ match ANSI */
- + extern char * strstr ARGS((Const char *, Const char *));
- + extern Void * memmove ARGS((Void *, Const Void *, size_t));
- + extern Void * memcpy ARGS((Void *, Const Void *, size_t));
- +
- +
- + #ifndef offsetof
- + #define offsetof(type,id) ((size_t)&((type*)NULL)->id)
- + #endif
- +
- + #if defined(F_SETFD) && !defined(FD_CLEXEC)
- + # define FD_CLEXEC 1
- + #endif
- *** sh/syn.c.old Mon Nov 25 13:38:36 1991
- --- sh/syn.c Fri Nov 22 22:54:17 1991
- ***************
- *** 2,12 ****
- * shell parser (C version)
- */
-
- static char *RCSid = "$Id: syn.c,v 3.3 89/03/27 15:51:51 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <stdio.h>
- ! #include <string.h>
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- --- 2,13 ----
- * shell parser (C version)
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: syn.c,v 3.3 89/03/27 15:51:51 egisin Exp $";
- + static char *sccs_id = "@(#)syn.c 1.2 91/11/22 22:53:52 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- *** sh/table.c.old Mon Nov 25 13:38:58 1991
- --- sh/table.c Fri Nov 22 22:54:17 1991
- ***************
- *** 1,10 ****
- static char *RCSid = "$Id: table.c,v 3.2 89/03/27 15:51:58 egisin Exp $";
-
- /*
- * dynamic hashed associative table for commands and variables
- */
-
- ! #include <stddef.h>
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- --- 1,13 ----
- + #ifndef lint
- static char *RCSid = "$Id: table.c,v 3.2 89/03/27 15:51:58 egisin Exp $";
- + static char *sccs_id = "@(#)table.c 1.2 91/11/22 22:53:55 (sjg)";
- + #endif
-
- /*
- * dynamic hashed associative table for commands and variables
- */
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include "sh.h"
- *** sh/trace.c.old Mon Nov 25 13:38:20 1991
- --- sh/trace.c Fri Nov 22 22:54:18 1991
- ***************
- *** 30,39 ****
- *
- *
- * AMENDED:
- ! * %E% %U% (%Y%)
- *
- * RELEASED:
- ! * %D% %T% v%I%
- *
- * @(#)Copyright (c) 1990 Simon J. Gerraty.
- */
- --- 30,39 ----
- *
- *
- * AMENDED:
- ! * 91/11/22 22:53:56 (sjg)
- *
- * RELEASED:
- ! * 91/11/22 22:54:17 v1.2
- *
- * @(#)Copyright (c) 1990 Simon J. Gerraty.
- */
- ***************
- *** 40,46 ****
- #ifdef USE_TRACE
-
- #ifndef lint
- ! static char sccs_id[] = "%Z%%M% %I% %E% %U% (%Y%)";
- #endif
-
- /* include files */
- --- 40,46 ----
- #ifdef USE_TRACE
-
- #ifndef lint
- ! static char sccs_id[] = "@(#)trace.c 1.2 91/11/22 22:53:56 (sjg)";
- #endif
-
- /* include files */
- *** sh/trace.h.old Mon Nov 25 13:39:15 1991
- --- sh/trace.h Fri Nov 22 22:54:18 1991
- ***************
- *** 12,24 ****
- *
- *
- * AMENDED:
- ! * %E% %U% (%Y%)
- *
- * RELEASED:
- ! * %D% %T% v%I%
- *
- * SCCSID:
- ! * %Z%%M% %I% %E% %U% (%Y%)
- *
- * @(#)Copyright (c) 1990 Simon J. Gerraty.
- */
- --- 12,24 ----
- *
- *
- * AMENDED:
- ! * 91/11/22 22:53:58 (sjg)
- *
- * RELEASED:
- ! * 91/11/22 22:54:18 v1.2
- *
- * SCCSID:
- ! * @(#)trace.h 1.2 91/11/22 22:53:58 (sjg)
- *
- * @(#)Copyright (c) 1990 Simon J. Gerraty.
- */
- *** sh/trap.c.old Mon Nov 25 13:39:16 1991
- --- sh/trap.c Fri Nov 22 22:54:19 1991
- ***************
- *** 2,11 ****
- * signal handling
- */
-
- static char *RCSid = "$Id: trap.c,v 3.2 89/03/27 15:52:06 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <string.h>
- #include <errno.h>
- #include <signal.h>
- #include <setjmp.h>
- --- 2,13 ----
- * signal handling
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: trap.c,v 3.2 89/03/27 15:52:06 egisin Exp $";
- + static char *sccs_id = "@(#)trap.c 1.2 91/11/22 22:54:00 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <signal.h>
- #include <setjmp.h>
- *** sh/tree.c.old Mon Nov 25 13:38:46 1991
- --- sh/tree.c Fri Nov 22 22:54:19 1991
- ***************
- *** 2,15 ****
- * command tree climbing
- */
-
- static char *RCSid = "$Id: tree.c,v 3.2 89/03/27 15:52:13 egisin Exp $";
-
- ! #include <stddef.h>
- ! #include <string.h>
- ! #include <stdio.h>
- #include <errno.h>
- #include <setjmp.h>
- ! #include <varargs.h>
- #include "sh.h"
- #include "tree.h"
-
- --- 2,16 ----
- * command tree climbing
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: tree.c,v 3.2 89/03/27 15:52:13 egisin Exp $";
- + static char *sccs_id = "@(#)tree.c 1.2 91/11/22 22:54:02 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- ! #include <varargs.h> /* TODO: use stdarg */
- #include "sh.h"
- #include "tree.h"
-
- *** sh/ulimit.c.old Mon Nov 25 13:38:59 1991
- --- sh/ulimit.c Fri Nov 22 22:54:20 1991
- ***************
- *** 12,20 ****
- that was originally under case SYSULIMIT in source file "xec.c".
- */
-
- static char *RCSid = "$Id: ulimit.c,v 3.2 89/03/27 15:52:19 egisin Exp $";
-
- ! #include <stddef.h>
- #include <errno.h>
- #include <signal.h>
- #include <setjmp.h>
- --- 12,23 ----
- that was originally under case SYSULIMIT in source file "xec.c".
- */
-
- + #ifndef lint
- static char *RCSid = "$Id: ulimit.c,v 3.2 89/03/27 15:52:19 egisin Exp $";
- + static char *sccs_id = "@(#)ulimit.c 1.2 91/11/22 22:54:04 (sjg)";
- + #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <signal.h>
- #include <setjmp.h>
- *** sh/var.c.old Mon Nov 25 13:38:11 1991
- --- sh/var.c Fri Nov 22 22:54:09 1991
- ***************
- *** 1,10 ****
- #ifndef lint
- static char *RCSid = "$Id: var.c,v 3.2 89/03/27 15:52:21 egisin Exp $";
- ! static char *sccs_id = "@(#)var.c 1.3 91/11/09 15:35:17 (sjg)";
- #endif
-
- ! #include <stddef.h>
- ! #include <string.h>
- #include <errno.h>
- #include <setjmp.h>
- #include <time.h>
- --- 1,9 ----
- #ifndef lint
- static char *RCSid = "$Id: var.c,v 3.2 89/03/27 15:52:21 egisin Exp $";
- ! static char *sccs_id = "@(#)var.c 1.4 91/11/22 22:53:13 (sjg)";
- #endif
-
- ! #include "stdh.h"
- #include <errno.h>
- #include <setjmp.h>
- #include <time.h>
- ***************
- *** 517,524 ****
- --- 516,525 ----
-
- extern time_t time();
- static time_t seconds; /* time SECONDS last set */
- + #ifdef NOSTDHDRS
- extern int rand();
- extern void srand();
- + #endif
-
- static void
- getspec(vp)
- *** sh/version.c.old Mon Nov 25 13:39:26 1991
- --- sh/version.c Fri Nov 22 22:54:12 1991
- ***************
- *** 4,18 ****
-
- #ifndef lint
- static char *RCSid = "$Id: version.c,v 3.3 89/03/27 15:52:29 egisin Exp $";
- ! static char *sccs_id = "@(#)version.c 4.1 91/11/09 14:55:16 (sjg)";
- #endif
-
- ! #include <stddef.h>
- #include <setjmp.h>
- #include "sh.h"
-
- char ksh_version [] =
- ! "KSH_VERSION=@(#)PD KSH v4.1 91/11/09 14:55:16";
-
- /***
- $Log: version.c,v $
- --- 4,18 ----
-
- #ifndef lint
- static char *RCSid = "$Id: version.c,v 3.3 89/03/27 15:52:29 egisin Exp $";
- ! static char *sccs_id = "@(#)version.c 4.2 91/11/22 22:53:29 (sjg)";
- #endif
-
- ! #include "stdh.h"
- #include <setjmp.h>
- #include "sh.h"
-
- char ksh_version [] =
- ! "KSH_VERSION=@(#)PD KSH v4.2 91/11/22 22:53:29";
-
- /***
- $Log: version.c,v $
- *** sh/vi.c.old Mon Nov 25 13:38:28 1991
- --- sh/vi.c Fri Nov 22 22:54:07 1991
- ***************
- *** 10,22 ****
-
- #ifndef lint
- static char *RCSid = "$Id: vi.c,v 3.1 89/01/28 15:29:20 egisin Exp $";
- ! static char *sccs_id = "@(#)vi.c 1.3 91/11/09 15:35:09 (sjg)";
- #endif
-
- ! #include <stddef.h>
- ! #include <stdlib.h>
- ! #include <string.h>
- ! #include <stdio.h>
- #include <unistd.h>
- #include <signal.h>
- #include <fcntl.h>
- --- 10,19 ----
-
- #ifndef lint
- static char *RCSid = "$Id: vi.c,v 3.1 89/01/28 15:29:20 egisin Exp $";
- ! static char *sccs_id = "@(#)vi.c 1.4 91/11/22 22:53:02 (sjg)";
- #endif
-
- ! #include "stdh.h"
- #include <unistd.h>
- #include <signal.h>
- #include <fcntl.h>
- ***************
- *** 1701,1704 ****
- vecp[1] = NULL;
- return(eval(vecp, DOBLANK|DOGLOB|DOTILDE));
- }
- ! #endif /* ifdef VI */
- --- 1698,1701 ----
- vecp[1] = NULL;
- return(eval(vecp, DOBLANK|DOGLOB|DOTILDE));
- }
- ! #endif /* VI */
- *** std/Makefile.old Mon Nov 25 13:39:26 1991
- --- std/Makefile Fri Nov 22 22:48:58 1991
- ***************
- *** 3,8 ****
- --- 3,9 ----
- #
-
- SHELL = /bin/sh
- + MAKE = make
-
- #CONFIG = -D_SYSV
- CONFIG = -D_BSD
- ***************
- *** 9,28 ****
-
- LN = ln
-
- ! libs: h libstdc.a #libposix.a
-
- h:
- mkdir h
- ! ( cd stdc ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' clobber link )
- ! ( cd posix ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' clobber link )
-
- libstdc.a: FORCED
- ! ( cd stdc ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' $@ )
- ! -$(LN) stdc/$@ $@
-
- libposix.a: FORCED
- ! ( cd posix ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' $@ )
- ! -$(LN) posix/$@ .
-
- clean:
- -rm -f *.out
- --- 10,28 ----
-
- LN = ln
-
- ! libs: h libstdc.a libposix.a
-
- h:
- mkdir h
- ! ( cd stdc ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' 'LN=$(LN)' clobber link )
- ! ( cd posix ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' 'LN=$(LN)' clobber link )
- ! ( cd ../sh ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' 'LN=$(LN)' link )
-
- libstdc.a: FORCED
- ! ( cd stdc ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' all )
-
- libposix.a: FORCED
- ! ( cd posix ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' all )
-
- clean:
- -rm -f *.out
- *** /dev/null Mon Nov 25 11:15:05 1991
- --- std/mklinks Fri Nov 22 21:21:12 1991
- ***************
- *** 0 ****
- --- 1,14 ----
- + :
- + # Make links
- + # we do it this way so that we can support symlinks
- + # easily.
- +
- + src=`pwd`
- + cd $1
- + shift
- + LN="${LN:-ln}"
- +
- + for f in $*
- + do
- + $LN $src/$f .
- + done
- *** /dev/null Mon Nov 25 11:15:05 1991
- --- std/posix/ChangeLog Mon Nov 25 13:18:09 1991
- ***************
- *** 0 ****
- --- 1,4 ----
- + Mon Nov 25 13:17:04 1991 Simon J. Gerraty (sjg at zen)
- +
- + * wait.h: use "/./usr/include/sys/wait.h for sun's
- +
- *** std/posix/Makefile.old Mon Nov 25 13:39:28 1991
- --- std/posix/Makefile Mon Nov 25 13:34:01 1991
- ***************
- *** 1,10 ****
- # POSIX P1003.1 compatability
-
- SHELL = /bin/sh
-
- - # This is for the sun386i your mileage may vary :-)
- - #CC=gcc -ansi -Dsun386 -Dsun -Di386
- -
- #CONFIG = -D_SYSV
- CONFIG = -D_BSD
-
- --- 1,9 ----
- # POSIX P1003.1 compatability
- + # @(#)Makefile 1.3 91/11/25 13:33:57
-
- SHELL = /bin/sh
- + MAKE = make
-
- #CONFIG = -D_SYSV
- CONFIG = -D_BSD
-
- ***************
- *** 12,26 ****
- RANLIB = ranlib # For BSD systems
- #RANLIB = echo Updated
-
- ! LIB = libposix.a
- INCL = ../h
-
- CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
-
- MISC = Makefile
- ! HDRS = io.h wait.h times.h unistd.h fcntl.h dirent.h
- SRCS = unistd.c fcntl.c times.c dup2.c
- ! OBJS = unistd.o fcntl.o times.o dup2.o
-
- all: $(LIB)
-
- --- 11,30 ----
- RANLIB = ranlib # For BSD systems
- #RANLIB = echo Updated
-
- ! LIB = ../libposix.a
- INCL = ../h
-
- CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
-
- MISC = Makefile
- ! HDRS = io.h unistd.h fcntl.h dirent.h
- ! SYSHDRS = wait.h time.h times.h
- !
- SRCS = unistd.c fcntl.c times.c dup2.c
- ! OBJS = $(LIB)(unistd.o) \
- ! $(LIB)(fcntl.o) \
- ! $(LIB)(times.o) \
- ! $(LIB)(dup2.o)
-
- all: $(LIB)
-
- ***************
- *** 27,38 ****
- link: $(HDRS)
- [ -d $(INCL) ] || mkdir $(INCL)
- [ -d $(INCL)/sys ] || mkdir $(INCL)/sys
- ! -$(LN) wait.h time.h times.h $(INCL)/sys
- ! -$(LN) io.h fcntl.h unistd.h $(INCL)
- ! -if [ ! -r /usr/include/unistd.h ]; then $(LN) dirent.h $(INCL); fi
-
- $(LIB): $(OBJS)
- ! ar r $@ $?
- $(RANLIB) $@
-
- clean:
- --- 31,44 ----
- link: $(HDRS)
- [ -d $(INCL) ] || mkdir $(INCL)
- [ -d $(INCL)/sys ] || mkdir $(INCL)/sys
- ! ($(SHELL) ../mklinks $(INCL) $(HDRS))
- ! ($(SHELL) ../mklinks $(INCL)/sys $(SYSHDRS))
- ! -if [ -r /usr/include/unistd.h ]; then $(RM) $(INCL)/unistd.h; fi
-
- $(LIB): $(OBJS)
- ! # if you make doesn't know how to put objects in libraries
- ! # then simply make all the .o's and use the following line
- ! # ar r $@ $?
- $(RANLIB) $@
-
- clean:
- *** std/posix/fcntl.h.old Mon Nov 25 13:39:32 1991
- --- std/posix/fcntl.h Mon Nov 25 13:34:02 1991
- ***************
- *** 1,6 ****
- /* P1003.1 fcntl/open definitions */
- /* Based on a version by Terrence W. Holm */
- !
- /* for fcntl(2) */
-
- #define F_DUPFD 0
- --- 1,6 ----
- /* P1003.1 fcntl/open definitions */
- /* Based on a version by Terrence W. Holm */
- ! /* @(#)fcntl.h 1.3 91/11/25 13:34:00 (sjg) */
- /* for fcntl(2) */
-
- #define F_DUPFD 0
- *** std/posix/wait.h.old Mon Nov 25 13:39:36 1991
- --- std/posix/wait.h Mon Nov 25 13:34:02 1991
- ***************
- *** 7,19 ****
- #define ARGS(args) ()
- #endif
-
- ! #ifndef sparc
- typedef int pid_t; /* belong in sys/types.h */
- #endif
-
- ! #ifdef sparc
- ! # include "/usr/include/sys/wait.h"
- #else
-
- /* waitpid options */
- #define WNOHANG 1 /* don't hang in wait */
- --- 7,23 ----
- #define ARGS(args) ()
- #endif
-
- ! #ifdef HAVE_SYS_STDTYPES
- ! # include <sys/stdtypes.h>
- ! #else
- typedef int pid_t; /* belong in sys/types.h */
- #endif
-
- ! #ifdef sun
- ! # include "/./usr/include/sys/wait.h"
- #else
- +
- + #define WAIT_T int
-
- /* waitpid options */
- #define WNOHANG 1 /* don't hang in wait */
- *** /dev/null Mon Nov 25 11:15:05 1991
- --- std/stdc/ChangeLog Mon Nov 25 13:19:37 1991
- ***************
- *** 0 ****
- --- 1,5 ----
- + Mon Nov 25 13:19:01 1991 Simon J. Gerraty (sjg at zen)
- +
- + * Added all source modules to Makefile, but most remain commented
- + out as they are untested.
- +
- *** std/stdc/Makefile.old Mon Nov 25 13:39:37 1991
- --- std/stdc/Makefile Mon Nov 25 13:24:29 1991
- ***************
- *** 1,10 ****
- # Standard C (ANSI) compatabilaty
-
- SHELL = /bin/sh
-
- - # This is for the sun386i your mileage may vary :-)
- - #CC=gcc -ansi -Dsun386 -Dsun -Di386
- -
- #CONFIG = -D_SYSV
- CONFIG = -D_BSD
-
- --- 1,12 ----
- # 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.
- +
- SHELL = /bin/sh
- + MAKE = make
-
- #CONFIG = -D_SYSV
- CONFIG = -D_BSD
-
- ***************
- *** 12,18 ****
- RANLIB = ranlib # For BSD systems
- #RANLIB = echo Updated
-
- ! LIB = libstdc.a
- INCL = ../h
-
- CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
- --- 14,20 ----
- RANLIB = ranlib # For BSD systems
- #RANLIB = echo Updated
-
- ! LIB = ../libstdc.a
- INCL = ../h
-
- CFLAGS = $(CCOPTS) -I$(INCL) $(CONFIG)
- ***************
- *** 19,37 ****
-
- MISC = Makefile stdio.h_std
- HDRS = limits.h stddef.h stdlib.h string.h time.h stdarg.h
- ! SRCS = strstr.c memmove.c stdio.c #clock.c
- ! OBJS = strstr.o memmove.o stdio.o #clock.o
-
- all: $(LIB)
-
- link: $(HDRS) stdio.h
- [ -d $(INCL) ] || mkdir $(INCL)
- [ -d $(INCL)/sys ] || mkdir $(INCL)/sys
- ! -$(LN) types.h $(INCL)/sys
- ! -$(LN) limits.h stddef.h stdlib.h stdio.h string.h time.h stdarg.h $(INCL)
-
- $(LIB): $(OBJS)
- ! ar r $@ $?
- $(RANLIB) $@
-
- stdio.h: stdio.h_std stdio.sed /usr/include/stdio.h
- --- 21,79 ----
-
- 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 \
- + memcmp.c memcpy.c memset.c setvbuf.c sprintf.c \
- + stdio.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \
- + strerror.c strlen.c strncat.c strncmp.c strncpy.c \
- + strpbrk.c strrchr.c strspn.c strtok.c vprintf.c
- +
- + # only add to this list the modules that you _need_
- + # 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) \
- + # $(LIB)(memcpy.o) \
- + # $(LIB)(memset.o) \
- + # $(LIB)(setvbuf.o) \
- + # $(LIB)(sprintf.o) \
- + # $(LIB)(stdio.o) \
- + # $(LIB)(strcat.o) \
- + # $(LIB)(strchr.o) \
- + # $(LIB)(strcmp.o) \
- + # $(LIB)(strcpy.o) \
- + # $(LIB)(strcspn.o) \
- + # $(LIB)(strerror.o) \
- + # $(LIB)(strlen.o) \
- + # $(LIB)(strncat.o) \
- + # $(LIB)(strncmp.o) \
- + # $(LIB)(strncpy.o) \
- + # $(LIB)(strpbrk.o) \
- + # $(LIB)(strrchr.o) \
- + # $(LIB)(strspn.o) \
- +
- +
- +
- +
- 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
- ! # then simply make all the .o's and use the following line
- ! # ar r $@ $?
- $(RANLIB) $@
-
- stdio.h: stdio.h_std stdio.sed /usr/include/stdio.h
- *** std/stdc/memmove.c.old Mon Nov 25 13:39:41 1991
- --- std/stdc/memmove.c Fri Nov 22 22:49:38 1991
- ***************
- *** 1,6 ****
- /* $Header$ */
-
- ! #include <string.h>
-
- Void *
- memmove(dap, sap, n)
- --- 1,9 ----
- /* $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)
- *** std/stdc/strstr.c.old Mon Nov 25 13:39:55 1991
- --- std/stdc/strstr.c Fri Nov 22 22:49:38 1991
- ***************
- *** 1,4 ****
- ! #include <string.h>
-
- /*
- * strstr - find first occurrence of wanted in s
- --- 1,8 ----
- ! #ifndef lint
- ! static char *sccs_id = "@(#)strstr.c 1.2 91/11/22 22:49:34 (sjg)";
- ! #endif
- !
- ! #include "stdh.h"
-
- /*
- * strstr - find first occurrence of wanted in s
-
- 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.
-