Change things around so that the p.sh script (add #include to *.[ch] to satisfy macro...
authorNick Downing <downing.nick@gmail.com>
Tue, 17 Jan 2017 11:08:21 +0000 (22:08 +1100)
committerNick Downing <downing.nick@gmail.com>
Tue, 17 Jan 2017 11:08:21 +0000 (22:08 +1100)
329 files changed:
lib/libstdc/ar.h
lib/libstdc/arpa/ftp.h
lib/libstdc/arpa/inet.h
lib/libstdc/arpa/telnet.h
lib/libstdc/arpa/tftp.h
lib/libstdc/assert.h
lib/libstdc/compat-4.1.h
lib/libstdc/compat-4.1/pause.c
lib/libstdc/compat-4.1/tell.c
lib/libstdc/compat-sys5.h
lib/libstdc/compat-sys5/getopt.c
lib/libstdc/compat-sys5/strtok.c
lib/libstdc/compat-sys5/tmpnam.c
lib/libstdc/conflicts.txt
lib/libstdc/csu.h
lib/libstdc/csu/crt0.c
lib/libstdc/csu/gmon.c
lib/libstdc/csu/mon.c
lib/libstdc/ctype.h
lib/libstdc/disktab.h
lib/libstdc/fstab.h
lib/libstdc/gen.h
lib/libstdc/gen/_setjmp.c
lib/libstdc/gen/abort.c
lib/libstdc/gen/closedir.c
lib/libstdc/gen/disktab.c
lib/libstdc/gen/execvp.c
lib/libstdc/gen/fakcu.c
lib/libstdc/gen/fstab.c
lib/libstdc/gen/getgrent.c
lib/libstdc/gen/getgrnam.c
lib/libstdc/gen/getlogin.c
lib/libstdc/gen/getpass.c
lib/libstdc/gen/getpwent.c
lib/libstdc/gen/getpwnamuid.c
lib/libstdc/gen/getttyent.c
lib/libstdc/gen/getttynam.c
lib/libstdc/gen/getwd.c
lib/libstdc/gen/initgroups.c
lib/libstdc/gen/malloc.c
lib/libstdc/gen/mkstemp.c
lib/libstdc/gen/mktemp.c
lib/libstdc/gen/ndbm.c
lib/libstdc/gen/nlist.c
lib/libstdc/gen/opendir.c
lib/libstdc/gen/perror.c
lib/libstdc/gen/popen.c
lib/libstdc/gen/psignal.c
lib/libstdc/gen/readdir.c
lib/libstdc/gen/scandir.c
lib/libstdc/gen/seekdir.c
lib/libstdc/gen/setjmp.c
lib/libstdc/gen/setjmperr.c
lib/libstdc/gen/syslog.c
lib/libstdc/gen/system.c
lib/libstdc/gen/telldir.c
lib/libstdc/gen/timezone.c
lib/libstdc/gen/ttyname.c
lib/libstdc/gen/ttyslot.c
lib/libstdc/gen/valloc.c
lib/libstdc/groups.txt
lib/libstdc/grp.h
lib/libstdc/inet/inet_addr.c
lib/libstdc/inet/inet_lnaof.c
lib/libstdc/inet/inet_makeaddr.c
lib/libstdc/inet/inet_netof.c
lib/libstdc/inet/inet_ntoa.c
lib/libstdc/math.h
lib/libstdc/memory.h
lib/libstdc/mtab.h
lib/libstdc/n.sh
lib/libstdc/ndbm.h
lib/libstdc/net.h
lib/libstdc/net/getnetbyname.c
lib/libstdc/net/getnetent.c
lib/libstdc/net/getprotoent.c
lib/libstdc/net/getprotoname.c
lib/libstdc/net/getservbyname.c
lib/libstdc/net/getservbyport.c
lib/libstdc/net/getservent.c
lib/libstdc/net/hosttable/gethostent.c
lib/libstdc/net/hosttable/gethostnamadr.c
lib/libstdc/net/htonl.c
lib/libstdc/net/htons.c
lib/libstdc/net/named/gethostnamadr.c
lib/libstdc/net/ntohl.c
lib/libstdc/net/ntohs.c
lib/libstdc/net/rcmd.c
lib/libstdc/net/res_debug.c
lib/libstdc/net/res_init.c
lib/libstdc/net/res_mkquery.c
lib/libstdc/net/res_send.c
lib/libstdc/net/rexec.c
lib/libstdc/net/ruserpass.c
lib/libstdc/netdb.h
lib/libstdc/netinet/if_ether.h
lib/libstdc/netinet/in.h
lib/libstdc/netns/idp_var.h
lib/libstdc/netns/ns.h
lib/libstdc/netns/ns_pcb.h
lib/libstdc/nlist.h
lib/libstdc/ns/ns_addr.c
lib/libstdc/ns/ns_ntoa.c
lib/libstdc/o.sh
lib/libstdc/p.sh
lib/libstdc/pcc.h
lib/libstdc/protocols/rwhod.h
lib/libstdc/pwd.h
lib/libstdc/r.sh
lib/libstdc/resolv.h
lib/libstdc/s.sh [new file with mode: 0755]
lib/libstdc/setjmp.h
lib/libstdc/sgtty.h
lib/libstdc/stab.h
lib/libstdc/stdio.h
lib/libstdc/stdio/doprnt.c
lib/libstdc/stdio/doscan.c
lib/libstdc/stdio/exit.c
lib/libstdc/stdio/filbuf.c
lib/libstdc/stdio/findiop.c
lib/libstdc/stdio/flsbuf.c
lib/libstdc/stdio/fread.c
lib/libstdc/stdio/fseek.c
lib/libstdc/stdio/ftell.c
lib/libstdc/stdio/fwrite.c
lib/libstdc/stdio/rew.c
lib/libstdc/stdio/setbuf.c
lib/libstdc/stdio/setbuffer.c
lib/libstdc/string.h
lib/libstdc/strings.h
lib/libstdc/struct.h
lib/libstdc/sys.h
lib/libstdc/sys/_exit.c
lib/libstdc/sys/accept.c
lib/libstdc/sys/access.c
lib/libstdc/sys/acct.c
lib/libstdc/sys/adjtime.c
lib/libstdc/sys/bind.c
lib/libstdc/sys/brk.c
lib/libstdc/sys/chdir.c
lib/libstdc/sys/chmod.c
lib/libstdc/sys/chown.c
lib/libstdc/sys/chroot.c
lib/libstdc/sys/close.c
lib/libstdc/sys/connect.c
lib/libstdc/sys/creat.c
lib/libstdc/sys/dk.h
lib/libstdc/sys/domain.h
lib/libstdc/sys/dup.c
lib/libstdc/sys/dup2.c
lib/libstdc/sys/errno.h
lib/libstdc/sys/exec.h
lib/libstdc/sys/execl.c
lib/libstdc/sys/execle.c
lib/libstdc/sys/exect.c
lib/libstdc/sys/execv.c
lib/libstdc/sys/execve.c
lib/libstdc/sys/fchmod.c
lib/libstdc/sys/fchown.c
lib/libstdc/sys/fcntl.c
lib/libstdc/sys/flock.c
lib/libstdc/sys/fork.c
lib/libstdc/sys/fstat.c
lib/libstdc/sys/fsync.c
lib/libstdc/sys/ftruncate.c
lib/libstdc/sys/getdtablesize.c
lib/libstdc/sys/getegid.c
lib/libstdc/sys/geteuid.c
lib/libstdc/sys/getgid.c
lib/libstdc/sys/getgroups.c
lib/libstdc/sys/gethostid.c
lib/libstdc/sys/gethostname.c
lib/libstdc/sys/getitimer.c
lib/libstdc/sys/getpagesize.c
lib/libstdc/sys/getpeername.c
lib/libstdc/sys/getpgrp.c
lib/libstdc/sys/getpid.c
lib/libstdc/sys/getppid.c
lib/libstdc/sys/getpriority.c
lib/libstdc/sys/getrlimit.c
lib/libstdc/sys/getrusage.c
lib/libstdc/sys/getsockname.c
lib/libstdc/sys/getsockopt.c
lib/libstdc/sys/gettimeofday.c
lib/libstdc/sys/getuid.c
lib/libstdc/sys/gprof.h
lib/libstdc/sys/inode.h
lib/libstdc/sys/ioctl.c
lib/libstdc/sys/kill.c
lib/libstdc/sys/killpg.c
lib/libstdc/sys/link.c
lib/libstdc/sys/listen.c
lib/libstdc/sys/lseek.c
lib/libstdc/sys/lstat.c
lib/libstdc/sys/map.h
lib/libstdc/sys/mkdir.c
lib/libstdc/sys/mknod.c
lib/libstdc/sys/mman.h
lib/libstdc/sys/mount.c
lib/libstdc/sys/msgbuf.h
lib/libstdc/sys/open.c
lib/libstdc/sys/pipe.c
lib/libstdc/sys/profil.c
lib/libstdc/sys/protosw.h
lib/libstdc/sys/ptrace.c
lib/libstdc/sys/ptrace.h
lib/libstdc/sys/quota.c
lib/libstdc/sys/read.c
lib/libstdc/sys/readlink.c
lib/libstdc/sys/readv.c
lib/libstdc/sys/reboot.c
lib/libstdc/sys/reboot.h
lib/libstdc/sys/recv.c
lib/libstdc/sys/recvfrom.c
lib/libstdc/sys/recvmsg.c
lib/libstdc/sys/rename.c
lib/libstdc/sys/rmdir.c
lib/libstdc/sys/sbrk.c
lib/libstdc/sys/select.c
lib/libstdc/sys/select.h
lib/libstdc/sys/send.c
lib/libstdc/sys/sendmsg.c
lib/libstdc/sys/sendto.c
lib/libstdc/sys/setgroups.c
lib/libstdc/sys/sethostid.c
lib/libstdc/sys/sethostname.c
lib/libstdc/sys/setitimer.c
lib/libstdc/sys/setpgrp.c
lib/libstdc/sys/setpriority.c
lib/libstdc/sys/setquota.c
lib/libstdc/sys/setregid.c
lib/libstdc/sys/setreuid.c
lib/libstdc/sys/setrlimit.c
lib/libstdc/sys/setsockopt.c
lib/libstdc/sys/settimeofday.c
lib/libstdc/sys/shutdown.c
lib/libstdc/sys/sigblock.c
lib/libstdc/sys/signal.h
lib/libstdc/sys/sigpause.c
lib/libstdc/sys/sigreturn.c
lib/libstdc/sys/sigsetmask.c
lib/libstdc/sys/sigstack.c
lib/libstdc/sys/sigvec.c
lib/libstdc/sys/socket.c
lib/libstdc/sys/socketpair.c
lib/libstdc/sys/socketvar.h
lib/libstdc/sys/stat.c
lib/libstdc/sys/swapon.c
lib/libstdc/sys/symlink.c
lib/libstdc/sys/sync.c
lib/libstdc/sys/syslog.h
lib/libstdc/sys/systm.h
lib/libstdc/sys/time.h
lib/libstdc/sys/trace.h
lib/libstdc/sys/truncate.c
lib/libstdc/sys/ttychars.h
lib/libstdc/sys/ttydev.h
lib/libstdc/sys/types.h
lib/libstdc/sys/umask.c
lib/libstdc/sys/umount.c
lib/libstdc/sys/un.h
lib/libstdc/sys/unlink.c
lib/libstdc/sys/utimes.c
lib/libstdc/sys/vadvise.h
lib/libstdc/sys/vhangup.c
lib/libstdc/sys/vlimit.h
lib/libstdc/sys/vm.h
lib/libstdc/sys/vmmac.h
lib/libstdc/sys/vmmeter.h
lib/libstdc/sys/vmparam.h
lib/libstdc/sys/vmsystm.h
lib/libstdc/sys/vsio.h
lib/libstdc/sys/vtimes.h
lib/libstdc/sys/wait.c
lib/libstdc/sys/wait.h
lib/libstdc/sys/wait3.c
lib/libstdc/sys/write.c
lib/libstdc/sys/writev.c
lib/libstdc/syscall.h
lib/libstdc/sysexits.h
lib/libstdc/t.sh [new file with mode: 0755]
lib/libstdc/time.h
lib/libstdc/ttyent.h
lib/libstdc/u.sh [new file with mode: 0644]
lib/libstdc/utmp.h
lib/libstdc/varargs.h
lib/libstdc/vax/cons.h
lib/libstdc/vax/crl.h
lib/libstdc/vax/flp.h
lib/libstdc/vax/inline/inline.h
lib/libstdc/vax/mscp.h
lib/libstdc/vax/mtpr.h
lib/libstdc/vax/psl.h
lib/libstdc/vax/pte.h
lib/libstdc/vax/reg.h
lib/libstdc/vax/rpb.h
lib/libstdc/vax/rsp.h
lib/libstdc/vax/scb.h
lib/libstdc/vax/tmscp.h
lib/libstdc/vax/trap.h
lib/libstdc/vaxif/if_cssreg.h
lib/libstdc/vaxif/if_ddnreg.h
lib/libstdc/vaxif/if_ddnvar.h
lib/libstdc/vaxif/if_dmc.h
lib/libstdc/vaxif/if_ecreg.h
lib/libstdc/vaxif/if_enreg.h
lib/libstdc/vaxif/if_exreg.h
lib/libstdc/vaxif/if_hdhreg.h
lib/libstdc/vaxif/if_hy.h
lib/libstdc/vaxif/if_hyreg.h
lib/libstdc/vaxif/if_ilreg.h
lib/libstdc/vaxmba/hpreg.h
lib/libstdc/vaxmba/htreg.h
lib/libstdc/vaxmba/mtreg.h
lib/libstdc/vaxuba/dhureg.h
lib/libstdc/vaxuba/dmreg.h
lib/libstdc/vaxuba/dmzreg.h
lib/libstdc/vaxuba/dzreg.h
lib/libstdc/vaxuba/idcreg.h
lib/libstdc/vaxuba/npreg.h
lib/libstdc/vaxuba/pdma.h
lib/libstdc/vaxuba/psreg.h
lib/libstdc/vaxuba/tmscpreg.h
lib/libstdc/vaxuba/tsreg.h
lib/libstdc/vaxuba/ubareg.h
lib/libstdc/vaxuba/udareg.h
lib/libstdc/vaxuba/uureg.h
lib/libstdc/vaxuba/vsreg.h
lib/libstdc/vfont.h

index 19fa478..64dc4b0 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _AR_H_
 #define _AR_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 852fcf9..bf070fc 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _ARPA_FTP_H_
 #define _ARPA_FTP_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 44bed1b..0e3e7a8 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _ARPA_INET_H_
 #define _ARPA_INET_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 01b7a0c..b0240af 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _ARPA_TELNET_H_
 #define _ARPA_TELNET_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 6fed9fc..f75941b 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _ARPA_TFTP_H_
 #define _ARPA_TFTP_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 89072b1..35a6e88 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _ASSERT_H_
 #define _ASSERT_H_
 
+#include <csu.h>
 #include <stdio.h>
 
 /*     assert.h        4.2     85/01/21        */
index e719a4e..cec222f 100644 (file)
@@ -17,7 +17,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* compat-4.1/getpw.c */
 int getpw __P((int uid, char buf[]));
 
@@ -30,6 +29,5 @@ int rand __P((void));
 
 /* compat-4.1/tell.c */
 long tell __P((int f));
-#endif
 
 #endif
index 5d27a6b..80a6428 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/signal.h>
 #include <compat-4.1.h>
 
 /*
index 1d4ad55..67d866c 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <compat-4.1.h>
 
 /*
index fee9b08..b93b09b 100644 (file)
 #endif
 #endif
 
-#ifndef KERNEL
 /* compat-sys5/getopt.c */
 int getopt __P((int nargc, char **nargv, char *ostr));
 
 /* compat-sys5/tmpnam.c */
 char *tmpnam __P((char *s));
-#endif
 
 #endif
index 6523e4b..13f9512 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <compat-sys5.h>
 #include <stdio.h>
 
index ab3f5f5..a4f8a77 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <string.h>
 
 /*
index a6f088a..c276c79 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <sys/proc.h>
 #include <compat-sys5.h>
 
 /*
index 338431f..d3e6bba 100644 (file)
@@ -1,5 +1,6 @@
 arpa/ftp.h arpa/tftp.h
 arpa/telnet.h gen/crypt.c net/ruserpass.c
+compat-4.1.h compat-sys5/getopt.c
 csu/gmon.c csu/mon.c sys/gprof.h
 ctype.h vaxuba/vsreg.h
 gen/insque.c gen/remque.c sys/systm.h
index ca78fb1..fd35a4b 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _CSU_H_
 #define _CSU_H_
 
+
 #ifndef __P
 #ifdef __STDC__
 #define __P(args) args
@@ -9,7 +10,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* csu/crt0.c */
 int start __P((void));
 int exit __P((register int code));
@@ -27,6 +27,5 @@ int monstartup __P((char *lowpc, char *highpc));
 int mcount __P((void));
 int monitor __P((char *lowpc, char *highpc, char *buf, int bufsiz, int cntsiz));
 int moncontrol __P((int mode));
-#endif
 
 #endif
index 3037f2d..3de54d2 100644 (file)
@@ -1,3 +1,6 @@
+#include <gen.h>
+#include <stdio.h>
+#include <sys/file.h>
 #include <csu.h>
 
 /*
index f250fb8..9c0a657 100644 (file)
@@ -1,3 +1,7 @@
+#include <sys.h>
+#include <sys/errno.h>
+#include <sys/file.h>
+#include <sys/proc.h>
 #include <csu.h>
 #include <stdio.h>
 
index 2fa5031..07b6405 100644 (file)
@@ -1,3 +1,6 @@
+#include <sys.h>
+#include <sys/file.h>
+#include <sys/proc.h>
 #include <csu.h>
 
 /*
index 1142fde..fc64a35 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _CTYPE_H_
 #define _CTYPE_H_
 
+
 /*     ctype.h 4.2     85/09/04        */
 
 #define        _U      01
index df098e1..1b08928 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _DISKTAB_H_
 #define _DISKTAB_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -41,9 +42,7 @@ struct        disktab {
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/disktab.c */
 struct disktab *getdiskbyname __P((char *name));
-#endif
 
 #endif
index a41558a..2dc656e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _FSTAB_H_
 #define _FSTAB_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -52,7 +53,6 @@ struct        fstab{
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/fstab.c */
 int setfsent __P((void));
 int endfsent __P((void));
@@ -60,6 +60,5 @@ struct fstab *getfsent __P((void));
 struct fstab *getfsspec __P((char *name));
 struct fstab *getfsfile __P((char *name));
 struct fstab *getfstype __P((char *type));
-#endif
 
 #endif
index 602e2d1..71d1740 100644 (file)
@@ -5,6 +5,7 @@
 #include <setjmp.h>
 #include <sys/proc.h>
 #include <sys/signal.h>
+#include <stdio.h>
 #include <sys/errno.h>
 #include <nlist.h>
 #include <ndbm.h>
@@ -30,7 +31,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/abort.c */
 int abort __P((void));
 
@@ -139,6 +139,5 @@ char *timezone __P((int zone, int dst));
 
 /* gen/valloc.c */
 char *valloc __P((int i));
-#endif
 
 #endif
index a69cf5e..05935e4 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <setjmp.h>
 
 int _setjmp(e) jmp_buf e; {
index c7db74a..c3f8fd0 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/proc.h>
 #include <gen.h>
 #include <sys/signal.h>
 
index 94f1ce0..a6766a0 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <sys/file.h>
 #include <sys/dir.h>
 
 /*
index 581cfa5..93916c5 100644 (file)
@@ -1,3 +1,5 @@
+#include <strings.h>
+#include <sys/file.h>
 #include <ctype.h>
 #include <disktab.h>
 #include <stdio.h>
index a17911d..6505267 100644 (file)
@@ -1,3 +1,6 @@
+#include <gen.h>
+#include <strings.h>
+#include <sys/time.h>
 #include <sys/exec.h>
 #include <sys/errno.h>
 
index b322af6..88012ba 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdio.h>
 #include <gen.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 89dc4df..c590602 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <ctype.h>
 #include <fstab.h>
 #include <stdio.h>
index ab961da..626cf63 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <grp.h>
 #include <stdio.h>
 
index f929d15..b1cc220 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <grp.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 0e1b2f4..2cc87f3 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <utmp.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 04cc8c9..f096bf0 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <gen.h>
 #include <stdio.h>
 #include <sys/ioctl.h>
index 7c33740..d20a474 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <ndbm.h>
 #include <pwd.h>
 #include <stdio.h>
index 3818d8c..733cff6 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <strings.h>
 #include <ndbm.h>
 #include <pwd.h>
 #include <stdio.h>
index 3622350..14ca5df 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <stdio.h>
 #include <ttyent.h>
 
index b1d9b56..2e499d0 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <ttyent.h>
 
 /*
index ab11b6c..3f9ec6a 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <sys/dir.h>
 #include <sys/stat.h>
 
index 9587f12..d1214e4 100644 (file)
@@ -1,3 +1,6 @@
+#include <strings.h>
+#include <sys/errno.h>
+#include <sys/proc.h>
 #include <grp.h>
 #include <stdio.h>
 #include <sys/param.h>
index ca32a47..87ca723 100644 (file)
@@ -1,3 +1,5 @@
+#include <sys.h>
+#include <sys/proc.h>
 #include <gen.h>
 #include <stdio.h>
 #include <sys/types.h>
index 44c81df..e7dc816 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/proc.h>
 #include <gen.h>
 #include <sys/file.h>
 
index 9bfa224..7be3cbd 100644 (file)
@@ -1,3 +1,5 @@
+#include <sys/file.h>
+#include <sys/proc.h>
 #include <gen.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index a6ae69d..32f25e7 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <strings.h>
 #include <ndbm.h>
 #include <stdio.h>
 #include <sys/file.h>
index a54781d..1930a14 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <a.out.h>
 #include <nlist.h>
 #include <stdio.h>
index d2d550f..382b5a8 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <sys/file.h>
 #include <sys/dir.h>
 
 /*
index e3928e6..7a2d1d4 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <sys/errno.h>
 #include <sys/uio.h>
 
index d007ef6..b2e9399 100644 (file)
@@ -1,4 +1,8 @@
+#include <gen.h>
 #include <sys/exec.h>
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/wait.h>
 #include <stdio.h>
 #include <sys/signal.h>
 
index e0d3a7d..8d8573a 100644 (file)
@@ -1,3 +1,5 @@
+#include <strings.h>
+#include <sys/file.h>
 #include <sys/signal.h>
 
 /*
index 160165c..7646d8f 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <sys/dir.h>
 
 /*
index d5b46fe..32087b0 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <strings.h>
 #include <sys/dir.h>
 #include <sys/stat.h>
 
index ce81543..834d244 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <sys/dir.h>
 
 /*
index f1e0411..dc75c5d 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <setjmp.h>
 
 int setjmp(e) jmp_buf e; {
index c7a3664..78fc95f 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <setjmp.h>
 
 /*
index fde0a81..d84afa8 100644 (file)
@@ -1,3 +1,9 @@
+#include <stdio.h>
+#include <strings.h>
+#include <sys/proc.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <time.h>
 #include <sys/file.h>
 #include <sys/signal.h>
 #include <sys/socket.h>
index ec766dd..9785bd6 100644 (file)
@@ -1,3 +1,5 @@
+#include <sys/proc.h>
+#include <sys/wait.h>
 #include <sys/exec.h>
 #include <sys/signal.h>
 
index 7294573..3ccd91c 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <sys/dir.h>
 
 /*
index 8f522c3..55ab489 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <strings.h>
 #include <gen.h>
 
 /*
index 43d1c46..2ede046 100644 (file)
@@ -1,3 +1,5 @@
+#include <strings.h>
+#include <sys/ioctl.h>
 #include <utmp.h>
 #include <sys/dir.h>
 #include <sys/stat.h>
index 66625d1..7e75cab 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <utmp.h>
 #include <ttyent.h>
 
index b356247..5b066cd 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys.h>
 #include <gen.h>
 
 /*
index a89b0d4..2a484ba 100644 (file)
@@ -77,7 +77,7 @@ gen/ndbm.c ndbm.h
 gen/nlist.c nlist.h
 gen/opendir.c sys/dir.h
 gen/perror.c sys/errno.h
-gen/popen.c sys/exec.h
+gen/popen.c stdio.h
 gen/psignal.c sys/signal.h
 gen/qsort.c
 gen/random.c
index ef14e36..25094e3 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _GRP_H_
 #define _GRP_H_
 
+
 /*     grp.h   4.1     83/05/03        */
 
 struct group { /* see getgrent(3) */
@@ -20,7 +21,6 @@ struct        group { /* see getgrent(3) */
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/getgrent.c */
 int setgrent __P((void));
 int endgrent __P((void));
@@ -34,6 +34,5 @@ struct group *getgrnam __P((register char *name));
 
 /* gen/initgroups.c */
 int initgroups __P((char *uname, int agroup));
-#endif
 
 #endif
index 06b3cc4..9c26492 100644 (file)
@@ -1,3 +1,4 @@
+#include <net.h>
 #include <netinet/in.h>
 #include <ctype.h>
 #include <sys/types.h>
index 99b662f..0acef72 100644 (file)
@@ -1,3 +1,4 @@
+#include <net.h>
 #include <netinet/in.h>
 
 /*
index aac630f..b57f1c0 100644 (file)
@@ -1,3 +1,4 @@
+#include <net.h>
 #include <netinet/in.h>
 
 /*
index f8bd6df..95da4e9 100644 (file)
@@ -1,3 +1,4 @@
+#include <net.h>
 #include <netinet/in.h>
 
 /*
index 034efba..f0c6b43 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdio.h>
 #include <netinet/in.h>
 
 /*
index ce9fe6b..1f9c864 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _MATH_H_
 #define _MATH_H_
 
+
 /*     math.h  4.6     9/11/85 */
 
 /*extern double asinh(), acosh(), atanh();*/
index 746d2fd..8f7e7a7 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _MEMORY_H_
 #define _MEMORY_H_
 
+
 /*
  * Copyright (c) 1985 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -27,7 +28,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* compat-sys5/memccpy.c */
 char *memccpy __P((register char *t, register char *f, register c, register n));
 
@@ -42,6 +42,5 @@ char *memcpy __P((register char *t, register char *f, register n));
 
 /* compat-sys5/memset.c */
 char *memset __P((register char *s, register c, register n));
-#endif
 
 #endif
index 18179d7..7025ffa 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _MTAB_H_
 #define _MTAB_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index ab20e7f..ff6be43 100755 (executable)
@@ -59,3 +59,17 @@ do
   fi
 done
 rm -rf vax
+
+find . -name '*.c' -print |\
+sed -e 's:^\./::' |\
+while read i
+do
+  #sed -e '1i' -i $i
+  echo "i=$i"
+  (
+    echo
+    cat $i
+  ) >a
+  mv a $i
+done
+done 
index 121532a..ae1dd7a 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _NDBM_H_
 #define _NDBM_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -72,7 +73,6 @@ typedef struct {
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/ndbm.c */
 DBM *dbm_open __P((char *file, int flags, int mode));
 void dbm_close __P((DBM *db));
@@ -82,6 +82,5 @@ int dbm_delete __P((register DBM *db, datum key));
 int dbm_store __P((register DBM *db, datum key, datum dat, int replace));
 datum dbm_firstkey __P((DBM *db));
 datum dbm_nextkey __P((register DBM *db));
-#endif
 
 #endif
index 6dd4e68..e3a719c 100644 (file)
@@ -12,7 +12,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* net/htonl.c */
 u_long htonl __P((u_long hostlong));
 
@@ -39,6 +38,5 @@ int rexec __P((char **ahost, int rport, char *name, char *pass, char *cmd, int *
 int ruserpass __P((char *host, char **aname, char **apass));
 int mkpwunclear __P((char *spasswd, int mch, char *sencpasswd));
 int mkpwclear __P((char *sencpasswd, int mch, char *spasswd));
-#endif
 
 #endif
index ebdde55..a2a48dd 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <netdb.h>
 
 /*
index 0908822..092cf65 100644 (file)
@@ -1,3 +1,4 @@
+#include <netinet/in.h>
 #include <netdb.h>
 #include <stdio.h>
 #include <sys/socket.h>
index 9bbff8b..4ec4e7a 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <netdb.h>
 #include <stdio.h>
 
index 40d80e1..b0ea83f 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <netdb.h>
 
 /*
index 37b88a4..4209683 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <netdb.h>
 
 /*
index 5cf0af6..9c5e4ed 100644 (file)
@@ -1,3 +1,4 @@
+#include <strings.h>
 #include <netdb.h>
 
 /*
index d777008..8bc3121 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <net.h>
 #include <netdb.h>
 #include <stdio.h>
 #include <sys/types.h>
index e999013..4158bf6 100644 (file)
@@ -1,3 +1,4 @@
+#include <netinet/in.h>
 #include <ndbm.h>
 #include <netdb.h>
 #include <stdio.h>
index f1deedc..ac71172 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <strings.h>
 #include <ctype.h>
 #include <ndbm.h>
 #include <netdb.h>
index 49c8c12..f9c56cd 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <net.h>
 #include <sys/types.h>
 
index 41940a0..723d5b3 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <net.h>
 #include <sys/types.h>
 
index 1ae03e9..1298d4e 100644 (file)
@@ -1,3 +1,7 @@
+#include <gen.h>
+#include <net.h>
+#include <netinet/in.h>
+#include <strings.h>
 #include <ctype.h>
 #include <netdb.h>
 #include <resolv.h>
index fc9b7a6..e37c058 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <net.h>
 #include <sys/types.h>
 
index ce17175..7c4f76f 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <net.h>
 #include <sys/types.h>
 
index b8fa1f6..98c4c69 100644 (file)
@@ -1,3 +1,9 @@
+#include <gen.h>
+#include <strings.h>
+#include <sys.h>
+#include <sys/errno.h>
+#include <sys/proc.h>
+#include <sys/time.h>
 #include <net.h>
 #include <ctype.h>
 #include <netdb.h>
index 823cee2..785ad37 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <net.h>
 #include <resolv.h>
 #include <arpa/nameser.h>
 #include <netinet/in.h>
index be9ecc2..ee80af9 100644 (file)
@@ -1,3 +1,8 @@
+#include <gen.h>
+#include <net.h>
+#include <netinet/in.h>
+#include <strings.h>
+#include <sys.h>
 #include <resolv.h>
 #include <stdio.h>
 #include <sys/socket.h>
index 7f38d55..75ad49d 100644 (file)
@@ -1,3 +1,7 @@
+#include <gen.h>
+#include <net.h>
+#include <stdio.h>
+#include <strings.h>
 #include <resolv.h>
 
 /*
index c4e9d8c..0c59f45 100644 (file)
@@ -1,3 +1,8 @@
+#include <net.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <sys/file.h>
+#include <sys/select.h>
 #include <resolv.h>
 #include <sys/errno.h>
 #include <sys/param.h>
index f2060f1..cf4e823 100644 (file)
@@ -1,3 +1,7 @@
+#include <gen.h>
+#include <strings.h>
+#include <sys/file.h>
+#include <sys/time.h>
 #include <net.h>
 #include <netdb.h>
 #include <netinet/in.h>
index 2a92d94..2235f16 100644 (file)
@@ -1,3 +1,8 @@
+#include <csu.h>
+#include <gen.h>
+#include <strings.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
 #include <net.h>
 #include <ctype.h>
 #include <stdio.h>
index c9dfeea..fb1ffbd 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _NETDB_H_
 #define _NETDB_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -73,7 +74,6 @@ extern  int h_errno;
 #endif
 #endif
 
-#ifndef KERNEL
 /* net/getnetbyaddr.c */
 struct netent *getnetbyaddr __P((register int net, register int type));
 
@@ -130,6 +130,5 @@ struct hostent *_gethtbyaddr __P((char *addr, int len, int type));
 int sethostent __P((int stayopen));
 int endhostent __P((void));
 int sethostfile __P((char *name));
-#endif
 
 #endif
index 5fc4275..d7325f3 100644 (file)
@@ -57,6 +57,7 @@ struct        ether_arp {
 #define        arp_pln ea_hdr.ar_pln
 #define        arp_op  ea_hdr.ar_op
 
+
 /*
  * Structure shared between the ethernet driver modules and
  * the address resolution code.  For example, each ec_softc or il_softc
index d5e52b8..f1eb1ce 100644 (file)
@@ -33,6 +33,7 @@
 #define        IPPROTO_RAW             255             /* raw IP packet */
 #define        IPPROTO_MAX             256
 
+
 /*
  * Ports < IPPORT_RESERVED are reserved for
  * privileged processes (e.g. root).
@@ -128,7 +129,6 @@ extern      struct protosw inetsw[];
 #endif
 #endif
 
-#ifndef KERNEL
 /* inet/inet_addr.c */
 u_long inet_addr __P((register char *cp));
 
@@ -146,6 +146,5 @@ u_long inet_network __P((register char *cp));
 
 /* inet/inet_ntoa.c */
 char *inet_ntoa __P((struct in_addr in));
-#endif
 
 #endif
index 8171a15..97d3cac 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _NETNS_IDP_VAR_H_
 #define _NETNS_IDP_VAR_H_
 
+
 /*
  * Copyright (c) 1984, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 8e8f949..975aff6 100644 (file)
@@ -28,6 +28,7 @@
 #define NSPROTO_RAW    255             /* Placemarker*/
 #define NSPROTO_MAX    256             /* Placemarker*/
 
+
 /*
  * Port/Socket numbers: network standard functions
  */
@@ -60,6 +61,7 @@
 #define        SO_ALL_PACKETS          7
 #define SO_MTU                 8
 
+
 /*
  * NS addressing
  */
@@ -142,12 +144,10 @@ union ns_net ns_broadnet;
 #endif
 #endif
 
-#ifndef KERNEL
 /* ns/ns_addr.c */
 struct ns_addr ns_addr __P((char *name));
 
 /* ns/ns_ntoa.c */
 char *ns_ntoa __P((struct ns_addr addr));
-#endif
 
 #endif
index 0d8f522..ea5322a 100644 (file)
@@ -52,6 +52,7 @@ struct nspcb {
 #define        NSSNDQ          2048
 #define        NSRCVQ          2048
 
+
 #ifdef KERNEL
 struct nspcb nspcb;                    /* head of list */
 /*struct       nspcb *ns_pcblookup();*/
index 0312d27..3f073bf 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _NLIST_H_
 #define _NLIST_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -56,9 +57,7 @@ struct        nlist {
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/nlist.c */
 int nlist __P((char *name, struct nlist *list));
-#endif
 
 #endif
index 7e5ae16..ebc5b1d 100644 (file)
@@ -1,3 +1,6 @@
+#include <net.h>
+#include <stdio.h>
+#include <strings.h>
 #include <netns/ns.h>
 
 /*
index 4bacf2d..aff810f 100644 (file)
@@ -1,3 +1,5 @@
+#include <net.h>
+#include <stdio.h>
 #include <netns/ns.h>
 
 /*
index 90b8cb0..3cf0cb7 100755 (executable)
@@ -82,4 +82,45 @@ do
     mv a $i.protos
     sed -e 's/^[A-Za-z_][0-9A-Za-z_]*[^0-9A-Za-z_][^;]*[A-Za-z_][0-9A-Za-z_]*[  ]*([    ]*)[    ]*\(,[^;]*\)\?;/\/\*&\*\//' -i $i
   fi
+
+  rm -f xx*
+  csplit -b '%05d' -q $i '/^[   ]*{[    ]*$/' '{*}'
+  for j in xx*
+  do
+    :
+  done
+  for k in xx*
+  do
+    if test $k != xx00000
+    then
+      sed -ne '2,$p' -i $k
+    fi
+    if test $k != $j
+    then
+      sed -e '$s/$/ {/' -i $k
+    fi
+  done
+  cat xx* >$i
+done
+
+find . -name '*.h' -print |\
+sed -e 's:^\./::' |\
+while read i
+do
+  name=_`echo $i |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_
+  echo "i=$i name=$name"
+  (
+    cat <<EOF
+#ifndef $name
+#define $name
+
+
+EOF
+    cat $i
+    cat <<EOF
+
+#endif
+EOF
+  ) >a
+  mv a $i
 done
index aa334ff..0794663 100755 (executable)
@@ -6,27 +6,6 @@ find . -name '*.[ch]' -print |\
 sed -e 's:\./::' |\
 while read i
 do
-  rm -f xx*
-  csplit -b '%05d' -q $i '/^[   ]*{[    ]*$/' '{*}'
-  for j in xx*
-  do
-    :
-  done
-  for k in xx*
-  do
-    if test $k != xx00000
-    then
-      sed -ne '2,$p' -i $k
-    fi
-    if test $k != $j
-    then
-      sed -e '$s/$/ {/' -i $k
-    fi
-  done
-  (
-    echo
-    cat xx*
-  ) >$i
   ../../xify/nocomment <$i |../../xify/nostring >$i.nocomm
 done
 
@@ -71,6 +50,20 @@ do
 
   if test -n "$pattern"
   then
+    grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `find . -name '*.c.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a
+    if test -s a
+    then
+      cat a >>$i.usedby
+      for j in `sed -e 's/\.nocomm:.*//' <a |sort |uniq`
+      do
+        echo "j=$j"
+        if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp && ! grep -q "^#include <$i>\$" $j
+        then
+          sed -e "1i#include <$i>" -i $j
+        fi
+      done
+    fi
+
     pattern0=
     prefix0=
 
@@ -114,46 +107,18 @@ do
 
     echo "pattern0=$pattern0"
 
-    (
-      grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `find . -name '*.c.nocomm' -print`
-      grep -H "^\\($pattern0\\)$" `find . -name '*.h.nocomm' -print`
-    ) |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a
+    grep -H "^\\($pattern0\\)$" `find . -name '*.h.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a
     if test -s a
     then
-      mv a $i.usedby
-      for j in `sed -e 's/\.nocomm:.*//' <$i.usedby |sort |uniq`
+      cat a >>$i.usedby
+      for j in `sed -e 's/\.nocomm:.*//' <a |sort |uniq`
       do
         echo "j=$j"
         if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp && ! grep -q "^#include <$i>\$" $j
         then
-          (
-            echo "#include <$i>"
-            cat $j
-          ) >a
-          mv a $j
+          sed -e "4i#include <$i>" -i $j
         fi
       done
     fi
   fi
 done
-
-find . -name '*.h' -print |\
-sed -e 's:^\./::' |\
-while read i
-do
-  name=_`echo $i |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_
-  echo "i=$i name=$name"
-  (
-    cat <<EOF
-#ifndef $name
-#define $name
-
-EOF
-    cat $i
-    cat <<EOF
-
-#endif
-EOF
-  ) |../../xify/newline >a
-  mv a $i
-done
index 904ef39..9a273b5 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _PCC_H_
 #define _PCC_H_
 
+#include <strings.h>
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
 
 # endif
 
+
 /*
  * Types, as encoded in intermediate file cookies.
  */
 # define       PCCTM_BASETYPE  017
 # define       PCCTM_TYPESHIFT 2
 
+
 /*
  * Useful macros.  'PCCOM' macros apply to ops.
  */
index 0bc2dc8..1fa9f7c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _PROTOCOLS_RWHOD_H_
 #define _PROTOCOLS_RWHOD_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 9ed2cf1..5e7dfe8 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _PWD_H_
 #define _PWD_H_
 
+
 /*     pwd.h   4.1     83/05/03        */
 
 struct passwd { /* see getpwent(3) */
@@ -25,7 +26,6 @@ struct        passwd { /* see getpwent(3) */
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/getpwent.c */
 int setpwent __P((void));
 int endpwent __P((void));
@@ -35,6 +35,5 @@ int setpwfile __P((char *file));
 /* gen/getpwnamuid.c */
 struct passwd *getpwnam __P((char *nam));
 struct passwd *getpwuid __P((int uid));
-#endif
 
 #endif
index 700c98c..93a07be 100755 (executable)
@@ -63,7 +63,7 @@ EOF
       pattern="`sed -ne 's/\\*/\\\\*/g;1s/ __P((.*/(/p' a`"
       echo "pattern=$pattern"
       rm -f xx*
-      csplit $i "/^$pattern/"
+      csplit -q $i "/^$pattern/"
       for j in xx*
       do
         :
@@ -85,7 +85,19 @@ sed -e 's:^\./\(.*\)\.append$:\1:' |\
 while read i
 do
   echo "i=$i"
-  sed -e '2i#ifndef KERNEL' -e '$a#endif' -i $i.append
+
+  if test "`dirname $i`" = sys
+  then
+    sed -e '2i#ifndef KERNEL' -e '$a#endif' -i $i.append
+  fi
+
+  if grep -q '[ (]va_list ap[,)]' $i.append && ! grep -q '^#include <stdarg.h>$' $i
+  then
+    sed -e '4i#ifdef __STDC__\
+#include <stdarg.h>\
+#endif' -i $i
+  fi
+
   rm -f xx*
   csplit -b '%05d' -q $i '/^#/' '{*}'
   for j in xx*
@@ -110,6 +122,15 @@ EOF
 #endif
 EOF
     ) >$j
-    cat xx* |../../xify/newline >$i
+    cat xx* >$i
   fi
 done
+
+#find . -name '*.[ch]' -print |\
+#sed -e 's:^\./::' |\
+#while read i
+#do
+#  echo "i=$i"
+#  ../../xify/newline <$i >a
+#  mv a $i
+#done
index a8f111b..9c36771 100644 (file)
@@ -4,6 +4,7 @@
 #include <arpa/nameser.h>
 #include <netinet/in.h>
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
  * Global defines and variables for resolver stub.
  */
 
+
 #define        MAXNS           3               /* max # name servers we'll track */
 
+
 struct state {
        int     retrans;                /* retransmition time interval */
        int     retry;                  /* number of times to retransmit */
@@ -53,7 +56,6 @@ extern struct state _res;
 #endif
 #endif
 
-#ifndef KERNEL
 /* net/res_comp.c */
 int dn_expand __P((char *msg, char *eomorig, char *comp_dn, char *exp_dn, int length));
 int dn_comp __P((char *exp_dn, char *comp_dn, int length, char **dnptrs, char **lastdnptr));
@@ -81,6 +83,5 @@ int res_mkquery __P((int op, char *dname, int class, int type, char *data, int d
 /* net/res_send.c */
 int res_send __P((char *buf, int buflen, char *answer, int anslen));
 int _res_close __P((void));
-#endif
 
 #endif
diff --git a/lib/libstdc/s.sh b/lib/libstdc/s.sh
new file mode 100755 (executable)
index 0000000..ad56ece
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+sed -e 's/^/:/;s/ /::/g;s/$/:/' <conflicts.txt >conflicts.temp
+
+find . -name '*.[ch]' -print |\
+sed -e 's:\./::' |\
+while read i
+do
+  ../../xify/nocomment <$i |../../xify/nostring >$i.nocomm
+done
+
+find . -name '*.h' -print |\
+sed -e 's:^\./::' |\
+LC_ALL=C sort -r |\
+while read i
+do
+  echo "i=$i"
+  protos="`sed -ne 's/^.*[^0-9A-Za-z_]\([A-Za-z_][0-9A-Za-z_]*\) __P((.*));$/\1/p' $i`"
+  echo "protos=$protos"
+
+  pattern=
+  prefix=
+  for j in $protos
+  do
+    pattern="$pattern$prefix$j"
+    prefix='\|'
+  done
+
+  if test -n "$pattern"
+  then
+    grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)[   ]*(" `find . -name '*.c.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a
+    if test -s a
+    then
+      cat a >>$i.usedby
+      for j in `sed -e 's/\.nocomm:.*//' <a |sort |uniq`
+      do
+        echo "j=$j"
+        if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp && ! grep -q "^#include <$i>\$" $j
+        then
+          sed -e "1i#include <$i>" -i $j
+        fi
+      done
+    fi
+
+    grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)[   ]*(" `find . -name '*.h.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a
+    if test -s a
+    then
+      cat a >>$i.usedby
+      for j in `sed -e 's/\.nocomm:.*//' <a |sort |uniq`
+      do
+        echo "j=$j"
+        if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp && ! grep -q "^#include <$i>\$" $j
+        then
+          sed -e "4i#include <$i>" -i $j
+        fi
+      done
+    fi
+  fi
+done
index bcd0dad..ded8ac2 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SETJMP_H_
 #define _SETJMP_H_
 
+
 /*     setjmp.h        4.1     83/05/03        */
 
 typedef int jmp_buf[10];
@@ -13,7 +14,6 @@ typedef int jmp_buf[10];
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/_setjmp.c */
 int _setjmp __P((jmp_buf e));
 void _longjmp __P((jmp_buf e, int v));
@@ -24,6 +24,5 @@ void longjmp __P((jmp_buf e, int v));
 
 /* gen/setjmperr.c */
 int longjmperror __P((void));
-#endif
 
 #endif
index ad61f67..b0afdfe 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SGTTY_H_
 #define _SGTTY_H_
 
+
 /*     sgtty.h 4.2     85/01/03        */
 
 /*#ifndef      _IOCTL_*/
index 8eeac29..5e42b75 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _STAB_H_
 #define _STAB_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 1086a3b..2129806 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _STDIO_H_
 #define _STDIO_H_
 
+#ifdef __STDC__
+#include <stdarg.h>
+#endif
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -75,7 +79,10 @@ extern       struct  _iobuf {
 #endif
 #endif
 
-#ifndef KERNEL
+/* gen/popen.c */
+FILE *popen __P((char *cmd, char *mode));
+int pclose __P((FILE *ptr));
+
 /* stdio/clrerr.c */
 int clearerr __P((register FILE *iop));
 
@@ -192,6 +199,5 @@ int vprintf __P((char *fmt, va_list ap));
 
 /* stdio/vsprintf.c */
 int vsprintf __P((char *str, char *fmt, va_list ap));
-#endif
 
 #endif
index ddd0227..fb89447 100644 (file)
@@ -1,3 +1,6 @@
+#include <gen.h>
+#include <memory.h>
+#include <strings.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <sys/types.h>
index a2a444e..c033ad0 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <ctype.h>
 #include <stdio.h>
 #ifdef __STDC__
index c24b9ce..05d7779 100644 (file)
@@ -1,3 +1,6 @@
+#include <csu.h>
+#include <gen.h>
+#include <sys/proc.h>
 #include <stdio.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index bbb7559..6657d32 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <sys/file.h>
 #include <stdio.h>
 #include <sys/stat.h>
 
index 34a693d..176de2c 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+#include <sys/file.h>
 #include <stdio.h>
 #include <sys/errno.h>
 
index bfb3dd9..dda3f37 100644 (file)
@@ -1,3 +1,6 @@
+#include <gen.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
 #include <stdio.h>
 #include <sys/stat.h>
 
index 05804e9..32034dc 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <stdio.h>
 
 /*
index 1fc77a2..39972c2 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <stdio.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 537bb5d..bd73267 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <stdio.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 20f2d0a..4afd737 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <stdio.h>
 
 /*
index 8a3d35b..1eaf529 100644 (file)
@@ -1,3 +1,4 @@
+#include <sys/file.h>
 #include <stdio.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 0e26625..c51b025 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <stdio.h>
 
 /*
index ae66ae4..4cb3cd0 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <stdio.h>
 
 /*
index ad8d7b1..50be195 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _STRING_H_
 #define _STRING_H_
 
+
 /*
  * Copyright (c) 1985 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -39,7 +40,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* compat-sys5/strcatn.c */
 char *strcatn __P((register char *s1, register char *s2, register n));
 
@@ -66,6 +66,5 @@ int strspn __P((register char *s, register char *set));
 
 /* compat-sys5/strtok.c */
 char *strtok __P((register char *s, register char *sep));
-#endif
 
 #endif
index 348227c..b75576e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _STRINGS_H_
 #define _STRINGS_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -31,7 +32,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/index.c */
 char *index __P((register char *sp, int c));
 
@@ -58,6 +58,5 @@ int strncmp __P((register char *s1, register char *s2, register n));
 
 /* gen/strncpy.c */
 char *strncpy __P((register char *s1, register char *s2, int n));
-#endif
 
 #endif
index 044352d..9e3754f 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _STRUCT_H_
 #define _STRUCT_H_
 
+
 /*     struct.h        4.1     83/05/03        */
 
 /*
index 6802fbf..2d3fce1 100644 (file)
@@ -27,7 +27,6 @@
 #endif
 #endif
 
-#ifndef KERNEL
 /* sys/gethostid.c */
 long gethostid __P((void));
 
@@ -57,6 +56,5 @@ int swapon __P((char *s));
 
 /* sys/vhangup.c */
 void vhangup __P((void));
-#endif
 
 #endif
index 4ad4bfb..f3b57df 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 void _exit(s) int s; {
index b71e1dd..4fad803 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int accept(s, a, l) int s; struct sockaddr *a; int *l; {
index 1840f09..f5bfafa 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int access(p, m) char *p; int m; {
index b88d783..3a1ecc3 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/acct.h>
 
 int acct(f) char *f; {
index dc2366e..66b26f4 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/time.h>
 
 int adjtime(delta, odelta) struct timeval *delta; struct timeval *odelta; {
index a1f6634..7af924c 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int bind(s, n, l) int s; struct sockaddr *n; int l; {
index 45f2a73..e40e738 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 char *brk(a) char *a; {
index 5603b30..727cb39 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int chdir(s) char *s; {
index 57071a9..6c87af8 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int chmod(s, m) char *s; int m; {
index 98e26a5..e2ad367 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int chown(s, u, g) char *s; int u; int g; {
index 70cc152..e6ea5e9 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int chroot(d) char *d; {
index a97f1f9..76c0c76 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int close(f) int f; {
index 74a9919..9160599 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int connect(s, n, l) int s; struct sockaddr *n; int l; {
index a7c676b..cc3066b 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int creat(s, m) char *s; int m; {
index d2f90c5..82fa1f2 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_DK_H_
 #define _SYS_DK_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index ed2d3e5..bd8a9a7 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_DOMAIN_H_
 #define _SYS_DOMAIN_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 012b45b..dd4d321 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int dup(f) int f; {
index 2065982..c7ec418 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int dup2(o, n) int o; int n; {
index 9f8adf1..3ecdaff 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_ERRNO_H_
 #define _SYS_ERRNO_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index b2dd827..8729f4b 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_EXEC_H_
 #define _SYS_EXEC_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -40,10 +41,6 @@ unsigned long        a_drsize;       /* size of data relocation */
 int execlp __P((char *name, char *argv));
 int execvp __P((char *name, char **argv));
 
-/* gen/popen.c */
-FILE *popen __P((char *cmd, char *mode));
-int pclose __P((FILE *ptr));
-
 /* gen/system.c */
 int system __P((char *s));
 
index 8634218..702d82c 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/exec.h>
 
 void execl(f, a) char *f; char *a; {
index f76d118..e4aec0c 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/exec.h>
 
 void execle(f, a) char *f; char *a; {
index 3049835..4c56ee2 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/exec.h>
 
 void exect(s, v, e) char *s; char *v[]; char *e[]; {
index d76ff4f..7f20aff 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/exec.h>
 
 void execv(s, v) char *s; char *v[]; {
index 29f86b5..5e5c873 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/exec.h>
 
 void execve(s, v, e) char *s; char *v[]; char *e[]; {
index b796674..95b8a7a 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int fchmod(f, m) int f; int m; {
index 64742d4..5a58887 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int fchown(f, u, g) int f; int u; int g; {
index c5be504..dc041e8 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int fcntl(f, c, a) int f; int c; int a; {
index 9f2c752..a522d04 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int flock(f, o) int f; int o; {
index 50a2eb5..fe715fd 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int fork() {
index 053af12..0ce2621 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/stat.h>
 
 int fstat(f, b) int f; struct stat *b; {
index 0a12c76..e51763e 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int fsync(f) int f; {
index 365a386..488cdcd 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 #include <sys/types.h>
 
index 38d30e5..14762ff 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int getdtablesize() {
index 3ff3622..a087126 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 #include <sys/types.h>
 
index c3f7d7f..688303a 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 #include <sys/types.h>
 
index 42bedb4..fcad32d 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 #include <sys/types.h>
 
index 606eb1d..66997ea 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int getgroups(n, g) int n; int *g; {
index 62a8cc9..2111a51 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 long gethostid() {
index 5c284b5..3287d80 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 int gethostname(n, l) char *n; int l; {
index d6854ac..e5cd88b 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/time.h>
 
 int getitimer(w, v) int w; struct itimerval *v; {
index d248e6d..cd48754 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 int getpagesize() {
index 4312dbe..b963940 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int getpeername(s, n, l) int s; struct sockaddr *n; int *l; {
index 94d06f4..9a25071 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int getpgrp(p) int p; {
index af26899..521d029 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int getpid() {
index abd899c..8b34a8e 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int getppid() {
index 7c5eefb..4ece97c 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/resource.h>
 
 int getpriority(w, who) int w; int who; {
index bb6146f..ad1cce4 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/resource.h>
 
 int getrlimit(res, rip) int res; struct rlimit *rip; {
index 151ecbf..11b26f9 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/resource.h>
 
 int getrusage(res, rip) int res; struct rusage *rip; {
index 5de15f6..1595fa2 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int getsockname(s, name, namelen) int s; char *name; int *namelen; {
index 1d6c32d..e281a96 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int getsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int *len; {
index 52c16fb..6d82e32 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/time.h>
 
 int gettimeofday(t, z) struct timeval *t; struct timezone *z; {
index 9df695f..dbdd982 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 #include <sys/types.h>
 
index 2444e60..5766934 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_GPROF_H_
 #define _SYS_GPROF_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 086de4b..ea6d2fe 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_INODE_H_
 #define _SYS_INODE_H_
 
+#include <sys/time.h>
 #include <sys/param.h>
 
 /*
index 9a563f6..bbf9cd6 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 
index 143712f..dfaffad 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 int kill(p, s) int p; int s; {
index 5ddb353..71a29d9 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 int killpg(pg, s) int pg; int s; {
index fd46fee..c7e58f9 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int link(a, b) char *a; char *b; {
index 8e4c7d5..094b5a3 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int listen(s, b) int s; int b; {
index 17a7cb1..6469c01 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 #include <sys/types.h>
 
index f638c42..3057146 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/stat.h>
 
 int lstat(s, b) char *s; struct stat *b; {
index 7d1e5c1..a163714 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_MAP_H_
 #define _SYS_MAP_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 31a7a4e..55855c2 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/dir.h>
 
 int mkdir(p, m) char *p; int m; {
index bd16c96..30a7d89 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int mknod(n, m, a) char *n; int m; int a; {
index cd88094..25b48e8 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_MMAN_H_
 #define _SYS_MMAN_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index b09a87b..03b9c16 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/mount.h>
 
 int mount(s, n, f) char *s; char *n; int f; {
index 13e42c7..2892cf3 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_MSGBUF_H_
 #define _SYS_MSGBUF_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 68a2dc7..77c608c 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int open(f, m, stuff) char *f; int m; int stuff; {
index 64eb4fe..9389ceb 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int pipe(f) int f[2]; {
index a849312..9434cfd 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 void profil(b, s, o, i) char *b; int s; int o; int i; {
index bf0265b..d5499c3 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_PROTOSW_H_
 #define _SYS_PROTOSW_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index b4adef4..9b677b6 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/ptrace.h>
 
 int ptrace(r, p, a, d) int r; int p; int *a; int d; {
index 2dff8d7..a87af94 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_PTRACE_H_
 #define _SYS_PTRACE_H_
 
+
 /*
  * Copyright (c) 1980, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index c4a2689..7950492 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/quota.h>
 
 int quota(c, u, a, ad) int c; int u; int a; char *ad; {
index 1809279..aa2c121 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int read(f, b, l) int f; char *b; int l; {
index 289668d..eb2ac71 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int readlink(p, b, s) char *p; char *b; int s; {
index ccf0726..a0d8913 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/uio.h>
 
 int readv(d, v, l) int d; struct iovec *v; int l; {
index 099b016..1f9004f 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 void reboot(h) int h; {
index 1d56f62..1ac1cfc 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_REBOOT_H_
 #define _SYS_REBOOT_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 0c27012..4d175fb 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int recv(s, b, l, f) int s; char *b; int l; int f; {
index 5008a4f..3b1f9a6 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int recvfrom(s, b, l, f, fr, fl) int s; char *b; int l; int f; struct sockaddr *fr; int *fl; {
index ef24a0d..32a1e69 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int recvmsg(s, m, f) int s; struct msghdr m[]; int f; {
index 165f0de..7ae70a9 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int rename(f, t) char *f; char *t; {
index 169995f..b3cf959 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/dir.h>
 
 int rmdir(p) char *p; {
index 7ed16d2..cd6e664 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 char *sbrk(i) int i; {
index 6917f67..b5dfaed 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/select.h>
 #include <sys/time.h>
 #include <sys/types.h>
index f71b6e7..1c5f057 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_SELECT_H_
 #define _SYS_SELECT_H_
 
+
 #ifndef __P
 #ifdef __STDC__
 #define __P(args) args
index 6d645e3..55d552f 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int send(s, m, l, f) int s; char *m; int l; int f; {
index f70b0f1..44215ac 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int sendmsg(s, m, l) int s; struct msghdr m[]; int l; {
index c7d76d6..1f7db99 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int sendto(s, m, l, f, t, tl) int s; char *m; int l; int f; struct sockaddr *t; int tl; {
index 1efb9ea..f97e210 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int setgroups(n, g) int n; int *g; {
index fc46453..27bfb2a 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 int sethostid(h) long h; {
index 700482c..e6468e2 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 int sethostname(n, l) char *n; int l; {
index be5e56f..b6aef57 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/time.h>
 
 int setitimer(w, v, ov) int w; struct itimerval *v; struct itimerval *ov; {
index b8c3797..8228005 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int setpgrp(g, pg) int g; int pg; {
index db93eba..e7bd627 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/resource.h>
 
 int setpriority(w, who, pri) int w; int who; int pri; {
index 77c065a..ede27bb 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/quota.h>
 
 int setquota(s, f) char *s; char *f; {
index a6797c6..161e626 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int setregid(r, e) int r; int e; {
index 4f46098..06367db 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/proc.h>
 
 int setreuid(r, e) int r; int e; {
index fbd3f32..5da3fa0 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/resource.h>
 
 int setrlimit(res, rip) int res; struct rlimit *rip; {
index 85fa7c1..0df0d2e 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int setsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int len; {
index f01fdf9..08059f5 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/time.h>
 
 int settimeofday(t, z) struct timeval *t; struct timezone *z; {
index 06c2fa3..388a978 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 int shutdown(s, h) int s; int h; {
index c88ef21..dc378bf 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 int sigblock(m) int m; {
index 7af6a4b..9b0bd44 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_SIGNAL_H_
 #define _SYS_SIGNAL_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index a9c8bb5..5a555c6 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 void sigpause(m) int m; {
index 2903b33..c50cae7 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 int sigreturn(scp) struct sigcontext *scp; {
index a16cb7e..eb714b5 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 int sigsetmask(m) int m; {
index 8fb5ed2..e9af3c7 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 int sigstack(ss, oss) struct sigstack *ss; struct sigstack *oss; {
index 598fc3a..5e87447 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/signal.h>
 
 int sigvec(c, f, m) int c; struct sigvec *f; struct sigvec *m; {
index 24095a5..ecd4fdc 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int socket(a, t, p) int a; int t; int p; {
index c414c82..8b4eb6e 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/socket.h>
 
 int socketpair(d, t, p, s) int d; int t; int p; int s[2]; {
index 296a3de..ec1c36a 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_SOCKETVAR_H_
 #define _SYS_SOCKETVAR_H_
 
+#include <sys/time.h>
 #include <sys/mbuf.h>
 #include <sys/protosw.h>
 
@@ -83,6 +84,7 @@ struct socket {
 #define        SS_NBIO                 0x100   /* non-blocking ops */
 #define        SS_ASYNC                0x200   /* async i/o notify */
 
+
 /*
  * Macros for sockets and socket buffering.
  */
index 0b9de8e..03196a0 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/stat.h>
 
 int stat(s, b) char *s; struct stat *b; {
index 62e815e..250f920 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 int swapon(s) char *s; {
index e869c56..8d368e3 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int symlink(t, f) char *t; char *f; {
index 24677fd..e7c5992 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 void sync() {
index 4c1b7da..77182f5 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_SYSLOG_H_
 #define _SYS_SYSLOG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index a300d06..10eba59 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_SYSTM_H_
 #define _SYS_SYSTM_H_
 
+#include <gen.h>
 #include <sys/types.h>
 
 /*
index 2107f48..b8e1c0e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_TIME_H_
 #define _SYS_TIME_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 853b44d..94edc15 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_TRACE_H_
 #define _SYS_TRACE_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index eee2615..89a690d 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 #include <sys/types.h>
 
index 551e91c..f7d6f25 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_TTYCHARS_H_
 #define _SYS_TTYCHARS_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index eea7e5c..5bc5b5c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_TTYDEV_H_
 #define _SYS_TTYDEV_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index c28404b..668369d 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _SYS_TYPES_H_
 #define _SYS_TYPES_H_
 
+#include <gen.h>
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index c598614..4c9753b 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int umask(n) int n; {
index 791e1c3..37bab9a 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/mount.h>
 
 int umount(s) char *s; {
index 7d1dce3..dadb71f 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_UN_H_
 #define _SYS_UN_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index d37dfff..4f84696 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int unlink(s) char *s; {
index 5edd053..46c4dcc 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/time.h>
 
 int utimes(f, t) char *f; struct timeval t[2]; {
index ea748b0..0497277 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VADVISE_H_
 #define _SYS_VADVISE_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index fd3cd22..5765c8f 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys.h>
 
 void vhangup() {
index 397b017..2e50d78 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VLIMIT_H_
 #define _SYS_VLIMIT_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index dc6f357..5e45e07 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VM_H_
 #define _SYS_VM_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 51a61d2..d549261 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VMMAC_H_
 #define _SYS_VMMAC_H_
 
+#include <sys/time.h>
 #include <vax/pcb.h>
 #include <vax/vmparam.h>
 
index 29d80fe..743b92d 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VMMETER_H_
 #define _SYS_VMMETER_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index d3c09e1..64e9a4c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VMPARAM_H_
 #define _SYS_VMPARAM_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 2e1b69c..5454f91 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VMSYSTM_H_
 #define _SYS_VMSYSTM_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index b2637b1..19f291a 100644 (file)
@@ -52,6 +52,7 @@
 #define        VSIOUSERWAIT    _IO(V, 15)      /* wait for user I/O completion */
 #define VSIOWAITGO     _IOW(V, 16, caddr_t)    /* wait then go */
 
+
 #define        VSIO_OFF        0               /* option off */
 #define        VSIO_ON         1               /* option on */
 
index cacc70a..25bbc9a 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_VTIMES_H_
 #define _SYS_VTIMES_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 1424284..402d6f8 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/wait.h>
 
 int wait(s) union wait *s; {
index cbf0208..d7f73f5 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYS_WAIT_H_
 #define _SYS_WAIT_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -49,6 +50,7 @@ union wait    {
 #define w_stopval      w_S.w_Stopval
 #define w_stopsig      w_S.w_Stopsig
 
+
 #define        WSTOPPED        0177    /* value of s.stopval if process is stopped */
 
 /*
index 369b6eb..afb5103 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/resource.h>
 #include <sys/wait.h>
 
index 9a0083e..7e63c35 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/file.h>
 
 int write(f, b, l) int f; char *b; int l; {
index 1dc59a7..4ac1f50 100644 (file)
@@ -1,3 +1,4 @@
+#include <gen.h>
 #include <sys/uio.h>
 
 int writev(f, v, l) int f; struct iovec *v; int l; {
index 7e99388..b8ecd28 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYSCALL_H_
 #define _SYSCALL_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 9382f44..75bd95d 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _SYSEXITS_H_
 #define _SYSEXITS_H_
 
+
 /*
 **  SYSEXITS.H -- Exit status codes for system programs.
 **
diff --git a/lib/libstdc/t.sh b/lib/libstdc/t.sh
new file mode 100755 (executable)
index 0000000..72a723b
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+# this step is not essential
+# it makes various checks
+# it then finally removes useless includes and sorts/prettifies includes
+
+# checking header loops
+grep -H '^#include <[^>]*>' `find . -name '*.h' -print` |\
+sed -e 's/^\.\/\(.*\):#include <\(.*\)>/\1 \2/' |\
+tsort >a
+
+# checking headers compile
+cat <<EOF >stdarg.h
+#ifndef _STDARG_H_
+#define _STDARG_H_
+
+typedef __builtin_va_list va_list;
+#define va_start(v, l) __builtin_va_start(v, l)
+#define va_end(v) __builtin_va_end(v)
+#define va_arg(v, l) __builtin_va_arg(v, l)
+
+#endif
+EOF
+find . -name '*.h' -print |\
+sed -e 's:\./::' |\
+while read i
+do
+  echo "i=$i"
+  echo "#include \"$i\"" >temp.c
+  echo "===$i===" >&2
+  gcc -nostdinc -I. -Dvax -DNCMD=1 -DNRSP=1 -c temp.c
+done
+rm -f stdarg.h temp.c
+
+# removing useless extra header inclusions that are pulled in anyway
+rm -f a
+find . -name '*.h' -print |\
+sed -e 's:\./::' |\
+while read i
+do
+  echo "i=$i"
+  pattern=
+  prefix=
+  cp $i temp.c
+  for j in `cpp -nostdinc -I. -Dvax -DNCMD=1 -DNRSP=1 -M temp.c`
+  do
+    case $j in
+    *.h)
+      echo "$i $j" >>a
+      pattern="$pattern$prefix$j"
+      prefix='\|'
+      ;;
+    esac
+  done
+  echo "pattern=$pattern"
+  if test -n "$pattern"
+  then
+    grep -H "^#include <$i>$" `find . -name '*.[ch]' -print` >b
+    if test -s b
+    then
+      for j in `sed -e 's/:.*//' b`
+      do
+        echo "j=$j"
+        grep -v "^#include <\\($pattern\\)>$" $j >c
+        mv c $j
+      done
+    fi
+  fi
+done
+rm -f temp.c
+tsort <a >b
+
+# sorting/prettifying
+find . -name '*.[ch]' -print |\
+sed -e 's:\./::' |\
+while read i
+do
+  echo "i=$i"
+  rm -f xx*
+  csplit -q $i '/^#include <.*>$/' '/^$/'
+  for j in xx*
+  do
+    :
+  done
+  if test -f xx01
+  then
+    LC_ALL=C sort <xx01 >a
+    mv a xx01
+    cat xx* >$i
+  fi
+  ../../xify/newline <$i >a
+  mv a $i
+done
index a835945..f3fc602 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _TIME_H_
 #define _TIME_H_
 
+
 /*     time.h  1.1     85/03/13        */
 
 /*
@@ -29,13 +30,11 @@ struct tm {
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/ctime.c */
 char *ctime __P((time_t *t));
 struct tm *localtime __P((time_t *tim));
 struct tm *gmtime __P((time_t *tim));
 char *asctime __P((struct tm *t));
 int dysize __P((int y));
-#endif
 
 #endif
index 1c6f8e3..41e3de9 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _TTYENT_H_
 #define _TTYENT_H_
 
+
 /*
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -32,7 +33,6 @@ struct        ttyent { /* see getttyent(3) */
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/getttyent.c */
 int setttyent __P((void));
 int endttyent __P((void));
@@ -40,6 +40,5 @@ struct ttyent *getttyent __P((void));
 
 /* gen/getttynam.c */
 struct ttyent *getttynam __P((char *tty));
-#endif
 
 #endif
diff --git a/lib/libstdc/u.sh b/lib/libstdc/u.sh
new file mode 100644 (file)
index 0000000..06d3a60
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+find . -name '*.c' -print |\
+sed -e 's:\./::' |\
+while read i
+do
+  echo "i=$i"
+  echo "===$i===" >&2
+  gcc -nostdinc -I. -Dvax $i
+done
index a0ba337..31edcd0 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _UTMP_H_
 #define _UTMP_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -29,7 +30,6 @@ struct utmp {
 #endif
 #endif
 
-#ifndef KERNEL
 /* gen/getlogin.c */
 char *getlogin __P((void));
 
@@ -38,6 +38,5 @@ char *ttyname __P((int f));
 
 /* gen/ttyslot.c */
 int ttyslot __P((void));
-#endif
 
 #endif
index fe57a5d..caa6616 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VARARGS_H_
 #define _VARARGS_H_
 
+
 /*     varargs.h       4.1     83/05/03        */
 
 typedef char *va_list;
index f674f43..ce8e685 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_CONS_H_
 #define _VAX_CONS_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 53ff4a7..8c7ea0d 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_CRL_H_
 #define _VAX_CRL_H_
 
+
 /* 
  * @(#)crl.h   7.1 (Berkeley) 6/5/86
  */
@@ -72,6 +73,7 @@
 #define        CRL_OPEN        1
 #define        CRL_BUSY        2
 
+
 #define        CRLDS_BITS \
 "\20\20WDE\17CHE\16WL\15SKTO\14SPE\13WGE\12VC\11DSE\
 \10DT\7HS\6CO\5HO\4BH\3STC\2STB\1STA"
index ba14da6..2577524 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_FLP_H_
 #define _VAX_FLP_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 143ce39..0a6fb87 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_INLINE_INLINE_H_
 #define _VAX_INLINE_INLINE_H_
 
+
 /*
  * Copyright (c) 1984, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 9bd3546..1c77cc8 100644 (file)
@@ -15,6 +15,7 @@
  * Definitions for the Mass Storage Control Protocol
  */
 
+
 /*
  * Control message opcodes
  */
@@ -40,6 +41,7 @@
 #define        M_OP_ACPTH      0102    /* Access path attention message */
 #define        M_OP_END        0200    /* End message flag */
 
+
 /*
  * Generic command modifiers
  */
@@ -92,6 +94,7 @@
  */
 #define        M_MD_PRIMR      0000001         /* Primary replacement block */
 
+
 /*
  * End message flags
  */
 #define        M_EF_ERLOG      0040    /* Error log generated */
 #define        M_EF_SEREX      0020    /* Serious exception */
 
+
 /*
  * Controller flags
  */
 #define        M_CF_SHADW      0002    /* Shadowing */
 #define        M_CF_576        0001    /* 576 byte sectors */
 
+
 /*
  * Unit flags
  */
 #define        M_UF_CMPWR      0000002         /* Compare writes */
 #define        M_UF_CMPRD      0000001         /* Compare reads */
 
+
 /*
  * Status codes
  */
@@ -270,6 +276,7 @@ struct mscp {
 #define        mscp_cntcmdl    mscp_usefrac
 #define        mscp_cntid      mscp_unitid
 
+
 /*
  * Error Log message format codes
  */
@@ -316,4 +323,5 @@ struct mslg {
 #define        mslg_busaddr    mslg_unitid.val[0]
 #define        mslg_sdecyl     mslg_group
 
+
 #endif
index 669380c..1298614 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_MTPR_H_
 #define _VAX_MTPR_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 5f19c21..6fd4988 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_PSL_H_
 #define _VAX_PSL_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 40867c8..39e766c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_PTE_H_
 #define _VAX_PTE_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index a6c2420..80486c8 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_REG_H_
 #define _VAX_REG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index f5342a9..3dbd1af 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_RPB_H_
 #define _VAX_RPB_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index eba53ae..f435eb0 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_RSP_H_
 #define _VAX_RSP_H_
 
+#include <stdio.h>
 #include <sys/types.h>
 
 /*
@@ -88,4 +89,5 @@ struct packet {
  */
 #define        TUSW_MRSP       010             /* use Modified RSP */
 
+
 #endif
index e497212..82c00cb 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_SCB_H_
 #define _VAX_SCB_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 87c3f02..c6f152b 100644 (file)
@@ -325,4 +325,5 @@ struct mslg {
 #define        mslg_busaddr    mslg_unitid.val[0]
 #define        mslg_sdecyl     mslg_group
 
+
 #endif
index 23ec8f6..1db5dd8 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAX_TRAP_H_
 #define _VAX_TRAP_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index e013692..b8b0bb3 100644 (file)
@@ -61,6 +61,7 @@ struct cssdevice {
 #define CSS_INBITS \
 "\20\20ERR\17NXM\16ATTN\15MAINT\14EOM\13IMPNR\12RLE\11CYCLE\10RDY\7IE\6XBA17\5XBA16\4WE\3HRDY\2CLR\1GO"
 
+
 /*
  * Output Control Status Register
  */
index 58d38fb..2b55859 100644 (file)
@@ -5,6 +5,7 @@
 
 /*     @(#)if_ddnreg.h 7.1 (Berkeley) 6/5/86 */
 
+
 /************************************************************************\
 
      ________________________________________________________
@@ -31,6 +32,7 @@
        part of this software must include a copy of ACC's
        copyright notice.
 
+
 File:
                if_ddnreg.h
 
index 4e950b5..b586fd2 100644 (file)
@@ -1,8 +1,11 @@
 #ifndef _VAXIF_IF_DDNVAR_H_
 #define _VAXIF_IF_DDNVAR_H_
 
+
 /*     @(#)if_ddnvar.h 7.1 (Berkeley) 6/5/86 */
 
+
+
 /************************************************************************\
 
      ________________________________________________________
@@ -29,6 +32,7 @@
        part of this software must include a copy of ACC's
        copyright notice.
 
+
 File:
                if_ddnvar.h
 
index 497ba58..4c70288 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXIF_IF_DMC_H_
 #define _VAXIF_IF_DMC_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 8347d2e..e7a6e5e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXIF_IF_ECREG_H_
 #define _VAXIF_IF_ECREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 61936ac..370e4c6 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXIF_IF_ENREG_H_
 #define _VAXIF_IF_ENREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 05c3c69..3db9c4e 100644 (file)
@@ -11,6 +11,7 @@
  *     @(#)if_exreg.h  7.1 (Berkeley) 6/5/86
  */
 
+
 struct exdevice {
        char    xd_porta;       /* write on porta resets EXOS */
        char    xd_pad_a;
@@ -252,4 +253,5 @@ struct      confmsg {
 /*80*/
 };
 
+
 #endif
index 8cf0b5c..ba22520 100644 (file)
@@ -5,6 +5,7 @@
 
 /*     @(#)if_hdhreg.h 7.1 (Berkeley) 6/5/86 */
 
+
 /* $Header$ */
 
 /*
index 39c0d7a..07e39aa 100644 (file)
@@ -50,6 +50,7 @@
  *
  */
 
+
 /*
  * Structure of a HYPERchannel adapter header
  */
@@ -64,6 +65,7 @@ struct        hy_hdr {
        short   hyh_type;               /* record type */
 };
 
+
 #define hyh_to         hyh_uto.hyh_addr
 #define hyh_to_port    hyh_uto.hyh_baddr[1]
 #define hyh_to_adapter hyh_uto.hyh_baddr[0]
@@ -307,4 +309,5 @@ char *hy_state_names[] = {
 };
 #endif
 
+
 #endif
index 638c087..26558f9 100644 (file)
@@ -15,6 +15,7 @@
  *
  */
 
+
 /*
  * Network Systems Corporation Hyperchannel interface
  *
index da3e6e2..d1ae9ca 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXIF_IF_ILREG_H_
 #define _VAXIF_IF_ILREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 36e7c00..4e4911f 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXMBA_HPREG_H_
 #define _VAXMBA_HPREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 051b535..05ba096 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXMBA_HTREG_H_
 #define _VAXMBA_HTREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 138326a..5be011b 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXMBA_MTREG_H_
 #define _VAXMBA_MTREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index ca629f6..e6d9f0b 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_DHUREG_H_
 #define _VAXUBA_DHUREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index c431b6f..42e4601 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_DMREG_H_
 #define _VAXUBA_DMREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 79e74be..ba3c2dc 100644 (file)
@@ -132,6 +132,7 @@ struct dmzdevice {
 #define        DMZ_ON          (DMZ_DTR|DMZ_RTS|DMZ_LCE)
 #define        DMZ_OFF         DMZ_LCE
 
+
 /* bits in octet_tcc */
 #define        DMZ_HA          0140000         /* high address bits */
 
index cfb6e7b..9b4e3a1 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_DZREG_H_
 #define _VAXUBA_DZREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 20799d6..ac46635 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_IDCREG_H_
 #define _VAXUBA_IDCREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index 67afa38..8dca577 100644 (file)
@@ -21,6 +21,7 @@
  * Specification.
  */
 
+
 #define NNPCNN         4       /* Number of connections per board */
 #define NPUNIT(a)      ((minor(a) >> 4) & 0x0F)
 #define NPCONN(a)      ((minor(a)) & 0x03)
@@ -137,10 +138,12 @@ typedef unsigned short unsign16;  /* 16 bit unsigned value */
 typedef unsigned unsign32;             /* 32 bit unsigned value */
 typedef long paddr_t;                  /* Physical addresses */
 
+
 /*
  * Tunables
  */
 
+
 #define NUMCQE         40              /* Number of CQE's per board */
 
 /* Host configuration word in Status Block */
index 7517cbb..6213b7a 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_PDMA_H_
 #define _VAXUBA_PDMA_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
index dc916df..7d449c3 100644 (file)
@@ -11,6 +11,7 @@
  *     @(#)psreg.h     7.1 (Berkeley) 6/5/86
  */
 
+
 /*
  *     The Real Nitty Gritty Device Registers
  */
index e7b79b1..f1c155c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_TMSCPREG_H_
 #define _VAXUBA_TMSCPREG_H_
 
+
 /* @(#)tmscpreg.h      7.1 (Berkeley) 6/5/86 */
 
 /*     @(#)tmscpreg.h  1.1     11/2/84 84/09/25        */
index ea0e5c4..20c7802 100644 (file)
@@ -127,6 +127,7 @@ struct      ts_sts {
 #define        TSXS3_BITS      \
 "\10\10LMX\7OPI\6REV\5CRF\4DCK\3NOI\2LXS\1RIB"
 
+
 /* command message */
 struct ts_cmd {
        u_short c_cmd;          /* command */
@@ -162,6 +163,7 @@ struct ts_char {
        u_short char_mode;              /* characteristics */
 };
 
+
 /* characteristics */
 #define        TS_ESS  0200            /* enable skip tape marks stop */
 #define        TS_ENB  0100            /* ??? */
index edc16a2..f67c675 100644 (file)
@@ -143,6 +143,8 @@ struct uba_regs {
 #define        UBAPURGE(uba, bdp)
 #endif
 
+
+
 /* uba_mr[] */
 #define        UBAMR_MRV       0x80000000      /* map register valid */
 #define        UBAMR_BO        0x02000000      /* byte offset bit */
@@ -193,4 +195,5 @@ struct uba_regs {
  */
 #define        ubdevreg(addr)  (0760000|((addr)&017777))
 
+
 #endif
index b659ce3..80890e8 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_UDAREG_H_
 #define _VAXUBA_UDAREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -30,6 +31,7 @@ struct udadevice {
 #define        UDA_PI          0000001 /* host requests adapter purge interrupts */
 #define        UDA_GO          0000001 /* start operation, after init */
 
+
 /*
  * UDA Communications Area
  */
index 29fbb97..46057f6 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VAXUBA_UUREG_H_
 #define _VAXUBA_UUREG_H_
 
+
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -9,6 +10,7 @@
  *     @(#)uureg.h     7.1 (Berkeley) 6/5/86
  */
 
+
 /*
  * DL11-E/DL11-W UNIBUS (for TU58) controller registers
  */
@@ -37,4 +39,5 @@ struct uudevice {
 
 #define        UUDB_DMASK      0x00ff  /* data mask (send and receive data) */
 
+
 #endif
index aaec333..6e41425 100644 (file)
@@ -213,6 +213,7 @@ struct vs_fparm{
 #define        vs_cxr          vs_csr5
 #define        vs_cyr          vs_csr6
 
+
 /* 
  * CSR 7 - Interrupt vector in fiber cable machines
  */
index 62dd57c..85b9e7c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _VFONT_H_
 #define _VFONT_H_
 
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement