#ifndef _AR_H_
#define _AR_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#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
#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
#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
#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
#ifndef _ASSERT_H_
#define _ASSERT_H_
+#include <csu.h>
#include <stdio.h>
/* assert.h 4.2 85/01/21 */
#endif
#endif
-#ifndef KERNEL
/* compat-4.1/getpw.c */
int getpw __P((int uid, char buf[]));
/* compat-4.1/tell.c */
long tell __P((int f));
-#endif
#endif
+#include <sys/signal.h>
#include <compat-4.1.h>
/*
+#include <sys/file.h>
#include <compat-4.1.h>
/*
#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
+#include <strings.h>
#include <compat-sys5.h>
#include <stdio.h>
+#include <strings.h>
#include <string.h>
/*
+#include <stdio.h>
+#include <sys/proc.h>
#include <compat-sys5.h>
/*
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
#ifndef _CSU_H_
#define _CSU_H_
+
#ifndef __P
#ifdef __STDC__
#define __P(args) args
#endif
#endif
-#ifndef KERNEL
/* csu/crt0.c */
int start __P((void));
int exit __P((register int code));
int mcount __P((void));
int monitor __P((char *lowpc, char *highpc, char *buf, int bufsiz, int cntsiz));
int moncontrol __P((int mode));
-#endif
#endif
+#include <gen.h>
+#include <stdio.h>
+#include <sys/file.h>
#include <csu.h>
/*
+#include <sys.h>
+#include <sys/errno.h>
+#include <sys/file.h>
+#include <sys/proc.h>
#include <csu.h>
#include <stdio.h>
+#include <sys.h>
+#include <sys/file.h>
+#include <sys/proc.h>
#include <csu.h>
/*
#ifndef _CTYPE_H_
#define _CTYPE_H_
+
/* ctype.h 4.2 85/09/04 */
#define _U 01
#ifndef _DISKTAB_H_
#define _DISKTAB_H_
+
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* gen/disktab.c */
struct disktab *getdiskbyname __P((char *name));
-#endif
#endif
#ifndef _FSTAB_H_
#define _FSTAB_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* gen/fstab.c */
int setfsent __P((void));
int endfsent __P((void));
struct fstab *getfsspec __P((char *name));
struct fstab *getfsfile __P((char *name));
struct fstab *getfstype __P((char *type));
-#endif
#endif
#include <setjmp.h>
#include <sys/proc.h>
#include <sys/signal.h>
+#include <stdio.h>
#include <sys/errno.h>
#include <nlist.h>
#include <ndbm.h>
#endif
#endif
-#ifndef KERNEL
/* gen/abort.c */
int abort __P((void));
/* gen/valloc.c */
char *valloc __P((int i));
-#endif
#endif
+#include <gen.h>
#include <setjmp.h>
int _setjmp(e) jmp_buf e; {
+#include <sys/proc.h>
#include <gen.h>
#include <sys/signal.h>
+#include <gen.h>
+#include <sys/file.h>
#include <sys/dir.h>
/*
+#include <strings.h>
+#include <sys/file.h>
#include <ctype.h>
#include <disktab.h>
#include <stdio.h>
+#include <gen.h>
+#include <strings.h>
+#include <sys/time.h>
#include <sys/exec.h>
#include <sys/errno.h>
+#include <stdio.h>
#include <gen.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <strings.h>
#include <ctype.h>
#include <fstab.h>
#include <stdio.h>
+#include <gen.h>
#include <grp.h>
#include <stdio.h>
+#include <strings.h>
#include <grp.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <sys/file.h>
#include <utmp.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <sys/file.h>
#include <gen.h>
#include <stdio.h>
#include <sys/ioctl.h>
+#include <gen.h>
#include <ndbm.h>
#include <pwd.h>
#include <stdio.h>
+#include <gen.h>
+#include <strings.h>
#include <ndbm.h>
#include <pwd.h>
#include <stdio.h>
+#include <strings.h>
#include <stdio.h>
#include <ttyent.h>
+#include <strings.h>
#include <ttyent.h>
/*
+#include <strings.h>
#include <sys/dir.h>
#include <sys/stat.h>
+#include <strings.h>
+#include <sys/errno.h>
+#include <sys/proc.h>
#include <grp.h>
#include <stdio.h>
#include <sys/param.h>
+#include <sys.h>
+#include <sys/proc.h>
#include <gen.h>
#include <stdio.h>
#include <sys/types.h>
+#include <sys/proc.h>
#include <gen.h>
#include <sys/file.h>
+#include <sys/file.h>
+#include <sys/proc.h>
#include <gen.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <gen.h>
+#include <strings.h>
#include <ndbm.h>
#include <stdio.h>
#include <sys/file.h>
+#include <strings.h>
#include <a.out.h>
#include <nlist.h>
#include <stdio.h>
+#include <gen.h>
+#include <sys/file.h>
#include <sys/dir.h>
/*
+#include <strings.h>
#include <sys/errno.h>
#include <sys/uio.h>
+#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>
+#include <strings.h>
+#include <sys/file.h>
#include <sys/signal.h>
/*
+#include <sys/file.h>
#include <sys/dir.h>
/*
+#include <gen.h>
+#include <strings.h>
#include <sys/dir.h>
#include <sys/stat.h>
+#include <sys/file.h>
#include <sys/dir.h>
/*
+#include <gen.h>
#include <setjmp.h>
int setjmp(e) jmp_buf e; {
+#include <sys/file.h>
#include <setjmp.h>
/*
+#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>
+#include <sys/proc.h>
+#include <sys/wait.h>
#include <sys/exec.h>
#include <sys/signal.h>
+#include <sys/file.h>
#include <sys/dir.h>
/*
+#include <stdio.h>
+#include <strings.h>
#include <gen.h>
/*
+#include <strings.h>
+#include <sys/ioctl.h>
#include <utmp.h>
#include <sys/dir.h>
#include <sys/stat.h>
+#include <strings.h>
#include <utmp.h>
#include <ttyent.h>
+#include <sys.h>
#include <gen.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
#ifndef _GRP_H_
#define _GRP_H_
+
/* grp.h 4.1 83/05/03 */
struct group { /* see getgrent(3) */
#endif
#endif
-#ifndef KERNEL
/* gen/getgrent.c */
int setgrent __P((void));
int endgrent __P((void));
/* gen/initgroups.c */
int initgroups __P((char *uname, int agroup));
-#endif
#endif
+#include <net.h>
#include <netinet/in.h>
#include <ctype.h>
#include <sys/types.h>
+#include <net.h>
#include <netinet/in.h>
/*
+#include <net.h>
#include <netinet/in.h>
/*
+#include <net.h>
#include <netinet/in.h>
/*
+#include <stdio.h>
#include <netinet/in.h>
/*
#ifndef _MATH_H_
#define _MATH_H_
+
/* math.h 4.6 9/11/85 */
/*extern double asinh(), acosh(), atanh();*/
#ifndef _MEMORY_H_
#define _MEMORY_H_
+
/*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* compat-sys5/memccpy.c */
char *memccpy __P((register char *t, register char *f, register c, register n));
/* compat-sys5/memset.c */
char *memset __P((register char *s, register c, register n));
-#endif
#endif
#ifndef _MTAB_H_
#define _MTAB_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
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
#ifndef _NDBM_H_
#define _NDBM_H_
+
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* gen/ndbm.c */
DBM *dbm_open __P((char *file, int flags, int mode));
void dbm_close __P((DBM *db));
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
#endif
#endif
-#ifndef KERNEL
/* net/htonl.c */
u_long htonl __P((u_long hostlong));
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
+#include <strings.h>
#include <netdb.h>
/*
+#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <sys/socket.h>
+#include <gen.h>
#include <netdb.h>
#include <stdio.h>
+#include <strings.h>
#include <netdb.h>
/*
+#include <strings.h>
#include <netdb.h>
/*
+#include <strings.h>
#include <netdb.h>
/*
+#include <gen.h>
+#include <net.h>
#include <netdb.h>
#include <stdio.h>
#include <sys/types.h>
+#include <netinet/in.h>
#include <ndbm.h>
#include <netdb.h>
#include <stdio.h>
+#include <gen.h>
+#include <strings.h>
#include <ctype.h>
#include <ndbm.h>
#include <netdb.h>
+#include <gen.h>
#include <net.h>
#include <sys/types.h>
+#include <gen.h>
#include <net.h>
#include <sys/types.h>
+#include <gen.h>
+#include <net.h>
+#include <netinet/in.h>
+#include <strings.h>
#include <ctype.h>
#include <netdb.h>
#include <resolv.h>
+#include <gen.h>
#include <net.h>
#include <sys/types.h>
+#include <gen.h>
#include <net.h>
#include <sys/types.h>
+#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>
+#include <gen.h>
+#include <net.h>
#include <resolv.h>
#include <arpa/nameser.h>
#include <netinet/in.h>
+#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>
+#include <gen.h>
+#include <net.h>
+#include <stdio.h>
+#include <strings.h>
#include <resolv.h>
/*
+#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>
+#include <gen.h>
+#include <strings.h>
+#include <sys/file.h>
+#include <sys/time.h>
#include <net.h>
#include <netdb.h>
#include <netinet/in.h>
+#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>
#ifndef _NETDB_H_
#define _NETDB_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* net/getnetbyaddr.c */
struct netent *getnetbyaddr __P((register int net, register int type));
int sethostent __P((int stayopen));
int endhostent __P((void));
int sethostfile __P((char *name));
-#endif
#endif
#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
#define IPPROTO_RAW 255 /* raw IP packet */
#define IPPROTO_MAX 256
+
/*
* Ports < IPPORT_RESERVED are reserved for
* privileged processes (e.g. root).
#endif
#endif
-#ifndef KERNEL
/* inet/inet_addr.c */
u_long inet_addr __P((register char *cp));
/* inet/inet_ntoa.c */
char *inet_ntoa __P((struct in_addr in));
-#endif
#endif
#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
#define NSPROTO_RAW 255 /* Placemarker*/
#define NSPROTO_MAX 256 /* Placemarker*/
+
/*
* Port/Socket numbers: network standard functions
*/
#define SO_ALL_PACKETS 7
#define SO_MTU 8
+
/*
* NS addressing
*/
#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
#define NSSNDQ 2048
#define NSRCVQ 2048
+
#ifdef KERNEL
struct nspcb nspcb; /* head of list */
/*struct nspcb *ns_pcblookup();*/
#ifndef _NLIST_H_
#define _NLIST_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* gen/nlist.c */
int nlist __P((char *name, struct nlist *list));
-#endif
#endif
+#include <net.h>
+#include <stdio.h>
+#include <strings.h>
#include <netns/ns.h>
/*
+#include <net.h>
+#include <stdio.h>
#include <netns/ns.h>
/*
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
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
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=
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
#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.
*/
#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
#ifndef _PWD_H_
#define _PWD_H_
+
/* pwd.h 4.1 83/05/03 */
struct passwd { /* see getpwent(3) */
#endif
#endif
-#ifndef KERNEL
/* gen/getpwent.c */
int setpwent __P((void));
int endpwent __P((void));
/* gen/getpwnamuid.c */
struct passwd *getpwnam __P((char *nam));
struct passwd *getpwuid __P((int uid));
-#endif
#endif
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
:
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*
#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
#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 */
#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));
/* net/res_send.c */
int res_send __P((char *buf, int buflen, char *answer, int anslen));
int _res_close __P((void));
-#endif
#endif
--- /dev/null
+#!/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
#ifndef _SETJMP_H_
#define _SETJMP_H_
+
/* setjmp.h 4.1 83/05/03 */
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));
/* gen/setjmperr.c */
int longjmperror __P((void));
-#endif
#endif
#ifndef _SGTTY_H_
#define _SGTTY_H_
+
/* sgtty.h 4.2 85/01/03 */
/*#ifndef _IOCTL_*/
#ifndef _STAB_H_
#define _STAB_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#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
#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));
/* stdio/vsprintf.c */
int vsprintf __P((char *str, char *fmt, va_list ap));
-#endif
#endif
+#include <gen.h>
+#include <memory.h>
+#include <strings.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
+#include <gen.h>
#include <ctype.h>
#include <stdio.h>
#ifdef __STDC__
+#include <csu.h>
+#include <gen.h>
+#include <sys/proc.h>
#include <stdio.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <gen.h>
+#include <sys/file.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <gen.h>
+#include <sys/file.h>
#include <stdio.h>
#include <sys/errno.h>
+#include <gen.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <gen.h>
#include <stdio.h>
/*
+#include <sys/file.h>
#include <stdio.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <sys/file.h>
#include <stdio.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <gen.h>
#include <stdio.h>
/*
+#include <sys/file.h>
#include <stdio.h>
#if defined(LIBC_SCCS) && !defined(lint)
+#include <gen.h>
#include <stdio.h>
/*
+#include <gen.h>
#include <stdio.h>
/*
#ifndef _STRING_H_
#define _STRING_H_
+
/*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* compat-sys5/strcatn.c */
char *strcatn __P((register char *s1, register char *s2, register n));
/* compat-sys5/strtok.c */
char *strtok __P((register char *s, register char *sep));
-#endif
#endif
#ifndef _STRINGS_H_
#define _STRINGS_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* gen/index.c */
char *index __P((register char *sp, int c));
/* gen/strncpy.c */
char *strncpy __P((register char *s1, register char *s2, int n));
-#endif
#endif
#ifndef _STRUCT_H_
#define _STRUCT_H_
+
/* struct.h 4.1 83/05/03 */
/*
#endif
#endif
-#ifndef KERNEL
/* sys/gethostid.c */
long gethostid __P((void));
/* sys/vhangup.c */
void vhangup __P((void));
-#endif
#endif
+#include <gen.h>
#include <sys/proc.h>
void _exit(s) int s; {
+#include <gen.h>
#include <sys/socket.h>
int accept(s, a, l) int s; struct sockaddr *a; int *l; {
+#include <gen.h>
#include <sys/file.h>
int access(p, m) char *p; int m; {
+#include <gen.h>
#include <sys/acct.h>
int acct(f) char *f; {
+#include <gen.h>
#include <sys/time.h>
int adjtime(delta, odelta) struct timeval *delta; struct timeval *odelta; {
+#include <gen.h>
#include <sys/socket.h>
int bind(s, n, l) int s; struct sockaddr *n; int l; {
+#include <gen.h>
#include <sys/proc.h>
char *brk(a) char *a; {
+#include <gen.h>
#include <sys/proc.h>
int chdir(s) char *s; {
+#include <gen.h>
#include <sys/file.h>
int chmod(s, m) char *s; int m; {
+#include <gen.h>
#include <sys/file.h>
int chown(s, u, g) char *s; int u; int g; {
+#include <gen.h>
#include <sys/proc.h>
int chroot(d) char *d; {
+#include <gen.h>
#include <sys/file.h>
int close(f) int f; {
+#include <gen.h>
#include <sys/socket.h>
int connect(s, n, l) int s; struct sockaddr *n; int l; {
+#include <gen.h>
#include <sys/file.h>
int creat(s, m) char *s; int m; {
#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
#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
+#include <gen.h>
#include <sys/file.h>
int dup(f) int f; {
+#include <gen.h>
#include <sys/file.h>
int dup2(o, n) int o; int n; {
#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
#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
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));
+#include <gen.h>
#include <sys/exec.h>
void execl(f, a) char *f; char *a; {
+#include <gen.h>
#include <sys/exec.h>
void execle(f, a) char *f; char *a; {
+#include <gen.h>
#include <sys/exec.h>
void exect(s, v, e) char *s; char *v[]; char *e[]; {
+#include <gen.h>
#include <sys/exec.h>
void execv(s, v) char *s; char *v[]; {
+#include <gen.h>
#include <sys/exec.h>
void execve(s, v, e) char *s; char *v[]; char *e[]; {
+#include <gen.h>
#include <sys/file.h>
int fchmod(f, m) int f; int m; {
+#include <gen.h>
#include <sys/file.h>
int fchown(f, u, g) int f; int u; int g; {
+#include <gen.h>
#include <sys/file.h>
int fcntl(f, c, a) int f; int c; int a; {
+#include <gen.h>
#include <sys/file.h>
int flock(f, o) int f; int o; {
+#include <gen.h>
#include <sys/proc.h>
int fork() {
+#include <gen.h>
#include <sys/stat.h>
int fstat(f, b) int f; struct stat *b; {
+#include <gen.h>
#include <sys/file.h>
int fsync(f) int f; {
+#include <gen.h>
#include <sys/file.h>
#include <sys/types.h>
+#include <gen.h>
#include <sys/file.h>
int getdtablesize() {
+#include <gen.h>
#include <sys/proc.h>
#include <sys/types.h>
+#include <gen.h>
#include <sys/proc.h>
#include <sys/types.h>
+#include <gen.h>
#include <sys/proc.h>
#include <sys/types.h>
+#include <gen.h>
#include <sys/proc.h>
int getgroups(n, g) int n; int *g; {
+#include <gen.h>
#include <sys.h>
long gethostid() {
+#include <gen.h>
#include <sys.h>
int gethostname(n, l) char *n; int l; {
+#include <gen.h>
#include <sys/time.h>
int getitimer(w, v) int w; struct itimerval *v; {
+#include <gen.h>
#include <sys.h>
int getpagesize() {
+#include <gen.h>
#include <sys/socket.h>
int getpeername(s, n, l) int s; struct sockaddr *n; int *l; {
+#include <gen.h>
#include <sys/proc.h>
int getpgrp(p) int p; {
+#include <gen.h>
#include <sys/proc.h>
int getpid() {
+#include <gen.h>
#include <sys/proc.h>
int getppid() {
+#include <gen.h>
#include <sys/resource.h>
int getpriority(w, who) int w; int who; {
+#include <gen.h>
#include <sys/resource.h>
int getrlimit(res, rip) int res; struct rlimit *rip; {
+#include <gen.h>
#include <sys/resource.h>
int getrusage(res, rip) int res; struct rusage *rip; {
+#include <gen.h>
#include <sys/socket.h>
int getsockname(s, name, namelen) int s; char *name; int *namelen; {
+#include <gen.h>
#include <sys/socket.h>
int getsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int *len; {
+#include <gen.h>
#include <sys/time.h>
int gettimeofday(t, z) struct timeval *t; struct timezone *z; {
+#include <gen.h>
#include <sys/proc.h>
#include <sys/types.h>
#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
#ifndef _SYS_INODE_H_
#define _SYS_INODE_H_
+#include <sys/time.h>
#include <sys/param.h>
/*
+#include <gen.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <gen.h>
#include <sys/signal.h>
int kill(p, s) int p; int s; {
+#include <gen.h>
#include <sys/signal.h>
int killpg(pg, s) int pg; int s; {
+#include <gen.h>
#include <sys/file.h>
int link(a, b) char *a; char *b; {
+#include <gen.h>
#include <sys/socket.h>
int listen(s, b) int s; int b; {
+#include <gen.h>
#include <sys/file.h>
#include <sys/types.h>
+#include <gen.h>
#include <sys/stat.h>
int lstat(s, b) char *s; struct stat *b; {
#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
+#include <gen.h>
#include <sys/dir.h>
int mkdir(p, m) char *p; int m; {
+#include <gen.h>
#include <sys/file.h>
int mknod(n, m, a) char *n; int m; int a; {
#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
+#include <gen.h>
#include <sys/mount.h>
int mount(s, n, f) char *s; char *n; int f; {
#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
+#include <gen.h>
#include <sys/file.h>
int open(f, m, stuff) char *f; int m; int stuff; {
+#include <gen.h>
#include <sys/file.h>
int pipe(f) int f[2]; {
+#include <gen.h>
#include <sys.h>
void profil(b, s, o, i) char *b; int s; int o; int i; {
#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
+#include <gen.h>
#include <sys/ptrace.h>
int ptrace(r, p, a, d) int r; int p; int *a; int d; {
#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
+#include <gen.h>
#include <sys/quota.h>
int quota(c, u, a, ad) int c; int u; int a; char *ad; {
+#include <gen.h>
#include <sys/file.h>
int read(f, b, l) int f; char *b; int l; {
+#include <gen.h>
#include <sys/file.h>
int readlink(p, b, s) char *p; char *b; int s; {
+#include <gen.h>
#include <sys/uio.h>
int readv(d, v, l) int d; struct iovec *v; int l; {
+#include <gen.h>
#include <sys.h>
void reboot(h) int h; {
#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
+#include <gen.h>
#include <sys/socket.h>
int recv(s, b, l, f) int s; char *b; int l; int f; {
+#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; {
+#include <gen.h>
#include <sys/socket.h>
int recvmsg(s, m, f) int s; struct msghdr m[]; int f; {
+#include <gen.h>
#include <sys/file.h>
int rename(f, t) char *f; char *t; {
+#include <gen.h>
#include <sys/dir.h>
int rmdir(p) char *p; {
+#include <gen.h>
#include <sys/proc.h>
char *sbrk(i) int i; {
+#include <gen.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#ifndef _SYS_SELECT_H_
#define _SYS_SELECT_H_
+
#ifndef __P
#ifdef __STDC__
#define __P(args) args
+#include <gen.h>
#include <sys/socket.h>
int send(s, m, l, f) int s; char *m; int l; int f; {
+#include <gen.h>
#include <sys/socket.h>
int sendmsg(s, m, l) int s; struct msghdr m[]; int l; {
+#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; {
+#include <gen.h>
#include <sys/proc.h>
int setgroups(n, g) int n; int *g; {
+#include <gen.h>
#include <sys.h>
int sethostid(h) long h; {
+#include <gen.h>
#include <sys.h>
int sethostname(n, l) char *n; int l; {
+#include <gen.h>
#include <sys/time.h>
int setitimer(w, v, ov) int w; struct itimerval *v; struct itimerval *ov; {
+#include <gen.h>
#include <sys/proc.h>
int setpgrp(g, pg) int g; int pg; {
+#include <gen.h>
#include <sys/resource.h>
int setpriority(w, who, pri) int w; int who; int pri; {
+#include <gen.h>
#include <sys/quota.h>
int setquota(s, f) char *s; char *f; {
+#include <gen.h>
#include <sys/proc.h>
int setregid(r, e) int r; int e; {
+#include <gen.h>
#include <sys/proc.h>
int setreuid(r, e) int r; int e; {
+#include <gen.h>
#include <sys/resource.h>
int setrlimit(res, rip) int res; struct rlimit *rip; {
+#include <gen.h>
#include <sys/socket.h>
int setsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int len; {
+#include <gen.h>
#include <sys/time.h>
int settimeofday(t, z) struct timeval *t; struct timezone *z; {
+#include <gen.h>
#include <sys.h>
int shutdown(s, h) int s; int h; {
+#include <gen.h>
#include <sys/signal.h>
int sigblock(m) int m; {
#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
+#include <gen.h>
#include <sys/signal.h>
void sigpause(m) int m; {
+#include <gen.h>
#include <sys/signal.h>
int sigreturn(scp) struct sigcontext *scp; {
+#include <gen.h>
#include <sys/signal.h>
int sigsetmask(m) int m; {
+#include <gen.h>
#include <sys/signal.h>
int sigstack(ss, oss) struct sigstack *ss; struct sigstack *oss; {
+#include <gen.h>
#include <sys/signal.h>
int sigvec(c, f, m) int c; struct sigvec *f; struct sigvec *m; {
+#include <gen.h>
#include <sys/socket.h>
int socket(a, t, p) int a; int t; int p; {
+#include <gen.h>
#include <sys/socket.h>
int socketpair(d, t, p, s) int d; int t; int p; int s[2]; {
#ifndef _SYS_SOCKETVAR_H_
#define _SYS_SOCKETVAR_H_
+#include <sys/time.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
#define SS_NBIO 0x100 /* non-blocking ops */
#define SS_ASYNC 0x200 /* async i/o notify */
+
/*
* Macros for sockets and socket buffering.
*/
+#include <gen.h>
#include <sys/stat.h>
int stat(s, b) char *s; struct stat *b; {
+#include <gen.h>
#include <sys.h>
int swapon(s) char *s; {
+#include <gen.h>
#include <sys/file.h>
int symlink(t, f) char *t; char *f; {
+#include <gen.h>
#include <sys/file.h>
void sync() {
#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
#ifndef _SYS_SYSTM_H_
#define _SYS_SYSTM_H_
+#include <gen.h>
#include <sys/types.h>
/*
#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
#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
+#include <gen.h>
#include <sys/file.h>
#include <sys/types.h>
#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
#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
#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
+#include <gen.h>
#include <sys/file.h>
int umask(n) int n; {
+#include <gen.h>
#include <sys/mount.h>
int umount(s) char *s; {
#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
+#include <gen.h>
#include <sys/file.h>
int unlink(s) char *s; {
+#include <gen.h>
#include <sys/time.h>
int utimes(f, t) char *f; struct timeval t[2]; {
#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
+#include <gen.h>
#include <sys.h>
void vhangup() {
#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
#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
#ifndef _SYS_VMMAC_H_
#define _SYS_VMMAC_H_
+#include <sys/time.h>
#include <vax/pcb.h>
#include <vax/vmparam.h>
#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
#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
#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
#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 */
#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
+#include <gen.h>
#include <sys/wait.h>
int wait(s) union wait *s; {
#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
#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 */
/*
+#include <gen.h>
#include <sys/resource.h>
#include <sys/wait.h>
+#include <gen.h>
#include <sys/file.h>
int write(f, b, l) int f; char *b; int l; {
+#include <gen.h>
#include <sys/uio.h>
int writev(f, v, l) int f; struct iovec *v; int l; {
#ifndef _SYSCALL_H_
#define _SYSCALL_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#ifndef _SYSEXITS_H_
#define _SYSEXITS_H_
+
/*
** SYSEXITS.H -- Exit status codes for system programs.
**
--- /dev/null
+#!/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
#ifndef _TIME_H_
#define _TIME_H_
+
/* time.h 1.1 85/03/13 */
/*
#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
#ifndef _TTYENT_H_
#define _TTYENT_H_
+
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* gen/getttyent.c */
int setttyent __P((void));
int endttyent __P((void));
/* gen/getttynam.c */
struct ttyent *getttynam __P((char *tty));
-#endif
#endif
--- /dev/null
+#!/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
#ifndef _UTMP_H_
#define _UTMP_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
#endif
#endif
-#ifndef KERNEL
/* gen/getlogin.c */
char *getlogin __P((void));
/* gen/ttyslot.c */
int ttyslot __P((void));
-#endif
#endif
#ifndef _VARARGS_H_
#define _VARARGS_H_
+
/* varargs.h 4.1 83/05/03 */
typedef char *va_list;
#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
#ifndef _VAX_CRL_H_
#define _VAX_CRL_H_
+
/*
* @(#)crl.h 7.1 (Berkeley) 6/5/86
*/
#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"
#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
#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
* Definitions for the Mass Storage Control Protocol
*/
+
/*
* Control message opcodes
*/
#define M_OP_ACPTH 0102 /* Access path attention message */
#define M_OP_END 0200 /* End message flag */
+
/*
* Generic command modifiers
*/
*/
#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
*/
#define mscp_cntcmdl mscp_usefrac
#define mscp_cntid mscp_unitid
+
/*
* Error Log message format codes
*/
#define mslg_busaddr mslg_unitid.val[0]
#define mslg_sdecyl mslg_group
+
#endif
#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
#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
#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
#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
#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
#ifndef _VAX_RSP_H_
#define _VAX_RSP_H_
+#include <stdio.h>
#include <sys/types.h>
/*
*/
#define TUSW_MRSP 010 /* use Modified RSP */
+
#endif
#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
#define mslg_busaddr mslg_unitid.val[0]
#define mslg_sdecyl mslg_group
+
#endif
#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
#define CSS_INBITS \
"\20\20ERR\17NXM\16ATTN\15MAINT\14EOM\13IMPNR\12RLE\11CYCLE\10RDY\7IE\6XBA17\5XBA16\4WE\3HRDY\2CLR\1GO"
+
/*
* Output Control Status Register
*/
/* @(#)if_ddnreg.h 7.1 (Berkeley) 6/5/86 */
+
/************************************************************************\
________________________________________________________
part of this software must include a copy of ACC's
copyright notice.
+
File:
if_ddnreg.h
#ifndef _VAXIF_IF_DDNVAR_H_
#define _VAXIF_IF_DDNVAR_H_
+
/* @(#)if_ddnvar.h 7.1 (Berkeley) 6/5/86 */
+
+
/************************************************************************\
________________________________________________________
part of this software must include a copy of ACC's
copyright notice.
+
File:
if_ddnvar.h
#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
#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
#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
* @(#)if_exreg.h 7.1 (Berkeley) 6/5/86
*/
+
struct exdevice {
char xd_porta; /* write on porta resets EXOS */
char xd_pad_a;
/*80*/
};
+
#endif
/* @(#)if_hdhreg.h 7.1 (Berkeley) 6/5/86 */
+
/* $Header$ */
/*
*
*/
+
/*
* Structure of a HYPERchannel adapter header
*/
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]
};
#endif
+
#endif
*
*/
+
/*
* Network Systems Corporation Hyperchannel interface
*
#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
#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
#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
#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
#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
#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
#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 */
#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
#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
* Specification.
*/
+
#define NNPCNN 4 /* Number of connections per board */
#define NPUNIT(a) ((minor(a) >> 4) & 0x0F)
#define NPCONN(a) ((minor(a)) & 0x03)
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 */
#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
* @(#)psreg.h 7.1 (Berkeley) 6/5/86
*/
+
/*
* The Real Nitty Gritty Device Registers
*/
#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 */
#define TSXS3_BITS \
"\10\10LMX\7OPI\6REV\5CRF\4DCK\3NOI\2LXS\1RIB"
+
/* command message */
struct ts_cmd {
u_short c_cmd; /* command */
u_short char_mode; /* characteristics */
};
+
/* characteristics */
#define TS_ESS 0200 /* enable skip tape marks stop */
#define TS_ENB 0100 /* ??? */
#define UBAPURGE(uba, bdp)
#endif
+
+
/* uba_mr[] */
#define UBAMR_MRV 0x80000000 /* map register valid */
#define UBAMR_BO 0x02000000 /* byte offset bit */
*/
#define ubdevreg(addr) (0760000|((addr)&017777))
+
#endif
#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
#define UDA_PI 0000001 /* host requests adapter purge interrupts */
#define UDA_GO 0000001 /* start operation, after init */
+
/*
* UDA Communications Area
*/
#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
* @(#)uureg.h 7.1 (Berkeley) 6/5/86
*/
+
/*
* DL11-E/DL11-W UNIBUS (for TU58) controller registers
*/
#define UUDB_DMASK 0x00ff /* data mask (send and receive data) */
+
#endif
#define vs_cxr vs_csr5
#define vs_cyr vs_csr6
+
/*
* CSR 7 - Interrupt vector in fiber cable machines
*/
#ifndef _VFONT_H_
#define _VFONT_H_
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement