From e090747cc2dcd6ea39eff7eed79fd348c679db91 Mon Sep 17 00:00:00 2001 From: Nick Downing Date: Thu, 19 Jan 2017 01:33:50 +1100 Subject: [PATCH] Now got full dependency check in q.sh which reports results in *.[ch].uses, and separate script in r.sh which rebuilds *.[ch] with all necessary edits at once --- .gitignore | 4 +- lib/libstdc/a.out.h | 9 +- lib/libstdc/ar.h | 5 + lib/libstdc/arpa/ftp.h | 5 + lib/libstdc/arpa/inet.h | 42 ++++- lib/libstdc/arpa/nameser.h | 48 ++++- lib/libstdc/arpa/telnet.h | 5 + lib/libstdc/arpa/tftp.h | 5 + lib/libstdc/assert.h | 12 +- lib/libstdc/compat-4.1.h | 33 ++++ lib/libstdc/compat-4.1/ftime.c | 9 +- lib/libstdc/compat-4.1/getpw.c | 9 +- lib/libstdc/compat-4.1/gtty.c | 7 +- lib/libstdc/compat-4.1/nice.c | 7 +- lib/libstdc/compat-4.1/pause.c | 7 +- lib/libstdc/compat-4.1/rand.c | 9 +- lib/libstdc/compat-4.1/stty.c | 7 +- lib/libstdc/compat-4.1/tell.c | 9 +- lib/libstdc/compat-4.1/times.c | 15 +- lib/libstdc/compat-4.1/utime.c | 8 +- lib/libstdc/compat-4.1/vlimit.c | 10 +- lib/libstdc/compat-4.1/vtimes.c | 21 +-- lib/libstdc/compat-sys5.h | 21 +++ lib/libstdc/compat-sys5/getopt.c | 11 +- lib/libstdc/compat-sys5/memccpy.c | 7 +- lib/libstdc/compat-sys5/memchr.c | 7 +- lib/libstdc/compat-sys5/memcmp.c | 6 +- lib/libstdc/compat-sys5/memcpy.c | 7 +- lib/libstdc/compat-sys5/memset.c | 7 +- lib/libstdc/compat-sys5/strcatn.c | 9 +- lib/libstdc/compat-sys5/strchr.c | 8 +- lib/libstdc/compat-sys5/strcmpn.c | 8 +- lib/libstdc/compat-sys5/strcpyn.c | 8 +- lib/libstdc/compat-sys5/strcspn.c | 5 +- lib/libstdc/compat-sys5/strpbrk.c | 6 +- lib/libstdc/compat-sys5/strrchr.c | 8 +- lib/libstdc/compat-sys5/strspn.c | 5 +- lib/libstdc/compat-sys5/strtok.c | 7 +- lib/libstdc/compat-sys5/tmpnam.c | 9 +- lib/libstdc/csu.h | 30 ++++ lib/libstdc/csu/crt0.c | 27 +-- lib/libstdc/csu/gmon.c | 33 ++-- lib/libstdc/csu/mon.c | 23 ++- lib/libstdc/ctype.h | 5 + lib/libstdc/disktab.h | 18 +- lib/libstdc/errno.h | 106 ++++++++++- lib/libstdc/fcntl.h | 7 + lib/libstdc/fstab.h | 33 +++- lib/libstdc/gen.h | 132 ++++++++++++++ lib/libstdc/gen/_setjmp.c | 5 +- lib/libstdc/gen/abort.c | 9 +- lib/libstdc/gen/abs.c | 2 + lib/libstdc/gen/alarm.c | 7 +- lib/libstdc/gen/atof.c | 3 + lib/libstdc/gen/atoi.c | 7 +- lib/libstdc/gen/atol.c | 8 +- lib/libstdc/gen/bcmp.c | 8 +- lib/libstdc/gen/bcopy.c | 9 +- lib/libstdc/gen/bzero.c | 8 +- lib/libstdc/gen/calloc.c | 13 +- lib/libstdc/gen/closedir.c | 10 +- lib/libstdc/gen/crypt.c | 15 +- lib/libstdc/gen/ctime.c | 48 +++-- lib/libstdc/gen/ctype_.c | 4 +- lib/libstdc/gen/disktab.c | 55 +++--- lib/libstdc/gen/ecvt.c | 24 ++- lib/libstdc/gen/errlst.c | 2 +- lib/libstdc/gen/execvp.c | 24 +-- lib/libstdc/gen/fakcu.c | 7 +- lib/libstdc/gen/ffs.c | 7 +- lib/libstdc/gen/frexp.c | 9 +- lib/libstdc/gen/fstab.c | 43 ++--- lib/libstdc/gen/gcvt.c | 11 +- lib/libstdc/gen/getenv.c | 16 +- lib/libstdc/gen/getgrent.c | 20 ++- lib/libstdc/gen/getgrgid.c | 8 +- lib/libstdc/gen/getgrnam.c | 9 +- lib/libstdc/gen/getlogin.c | 8 +- lib/libstdc/gen/getpass.c | 13 +- lib/libstdc/gen/getpwent.c | 23 +-- lib/libstdc/gen/getpwnamuid.c | 24 +-- lib/libstdc/gen/getttyent.c | 24 +-- lib/libstdc/gen/getttynam.c | 9 +- lib/libstdc/gen/getusershell.c | 22 ++- lib/libstdc/gen/getwd.c | 21 ++- lib/libstdc/gen/index.c | 8 +- lib/libstdc/gen/initgroups.c | 15 +- lib/libstdc/gen/insque.c | 5 +- lib/libstdc/gen/isatty.c | 6 +- lib/libstdc/gen/ldexp.c | 5 +- lib/libstdc/gen/malloc.c | 40 ++--- lib/libstdc/gen/mkstemp.c | 10 +- lib/libstdc/gen/mktemp.c | 10 +- lib/libstdc/gen/modf.c | 5 +- lib/libstdc/gen/ndbm.c | 110 +++++------- lib/libstdc/gen/nlist.c | 13 +- lib/libstdc/gen/opendir.c | 10 +- lib/libstdc/gen/perror.c | 9 +- lib/libstdc/gen/psignal.c | 11 +- lib/libstdc/gen/qsort.c | 16 +- lib/libstdc/gen/random.c | 40 +---- lib/libstdc/gen/readdir.c | 9 +- lib/libstdc/gen/regex.c | 29 ++- lib/libstdc/gen/remque.c | 5 +- lib/libstdc/gen/rindex.c | 8 +- lib/libstdc/gen/scandir.c | 15 +- lib/libstdc/gen/seekdir.c | 10 +- lib/libstdc/gen/setegid.c | 7 +- lib/libstdc/gen/seteuid.c | 7 +- lib/libstdc/gen/setgid.c | 7 +- lib/libstdc/gen/setjmp.c | 5 +- lib/libstdc/gen/setjmperr.c | 7 +- lib/libstdc/gen/setrgid.c | 7 +- lib/libstdc/gen/setruid.c | 7 +- lib/libstdc/gen/setuid.c | 7 +- lib/libstdc/gen/siginterrupt.c | 8 +- lib/libstdc/gen/siglist.c | 5 +- lib/libstdc/gen/signal.c | 9 +- lib/libstdc/gen/sleep.c | 14 +- lib/libstdc/gen/strcat.c | 8 +- lib/libstdc/gen/strcmp.c | 7 +- lib/libstdc/gen/strcpy.c | 8 +- lib/libstdc/gen/strlen.c | 7 +- lib/libstdc/gen/strncat.c | 9 +- lib/libstdc/gen/strncmp.c | 8 +- lib/libstdc/gen/strncpy.c | 8 +- lib/libstdc/gen/swab.c | 8 +- lib/libstdc/gen/syslog.c | 29 +-- lib/libstdc/gen/system.c | 11 +- lib/libstdc/gen/telldir.c | 9 +- lib/libstdc/gen/time.c | 9 +- lib/libstdc/gen/timezone.c | 8 +- lib/libstdc/gen/ttyname.c | 15 +- lib/libstdc/gen/ttyslot.c | 12 +- lib/libstdc/gen/ualarm.c | 9 +- lib/libstdc/gen/usleep.c | 14 +- lib/libstdc/gen/valloc.c | 11 +- lib/libstdc/groups.txt | 32 ++-- lib/libstdc/grp.h | 29 ++- lib/libstdc/inet.h | 6 + lib/libstdc/inet/inet_addr.c | 11 +- lib/libstdc/inet/inet_lnaof.c | 10 +- lib/libstdc/inet/inet_makeaddr.c | 11 +- lib/libstdc/inet/inet_netof.c | 10 +- lib/libstdc/inet/inet_network.c | 10 +- lib/libstdc/inet/inet_ntoa.c | 10 +- lib/libstdc/lastlog.h | 7 + lib/libstdc/libstdc.patch | 183 ++++++++++++------- lib/libstdc/math.h | 53 ++++-- lib/libstdc/memory.h | 38 +++- lib/libstdc/mp.h | 12 +- lib/libstdc/mtab.h | 5 + lib/libstdc/n.sh | 8 +- lib/libstdc/ndbm.h | 39 +++- lib/libstdc/net.h | 36 +++- lib/libstdc/net/af.h | 7 + lib/libstdc/net/getnetbyaddr.c | 8 +- lib/libstdc/net/getnetbyname.c | 9 +- lib/libstdc/net/getnetent.c | 24 +-- lib/libstdc/net/getproto.c | 8 +- lib/libstdc/net/getprotoent.c | 23 +-- lib/libstdc/net/getprotoname.c | 9 +- lib/libstdc/net/getservbyname.c | 9 +- lib/libstdc/net/getservbyport.c | 10 +- lib/libstdc/net/getservent.c | 25 +-- lib/libstdc/net/hosttable/gethostent.c | 29 +-- lib/libstdc/net/hosttable/gethostnamadr.c | 27 +-- lib/libstdc/net/htonl.c | 4 + lib/libstdc/net/htons.c | 4 + lib/libstdc/net/if.h | 17 +- lib/libstdc/net/if_arp.h | 8 + lib/libstdc/net/named/gethostnamadr.c | 60 +++---- lib/libstdc/net/named/sethostent.c | 13 +- lib/libstdc/net/netisr.h | 7 + lib/libstdc/net/ntohl.c | 4 + lib/libstdc/net/ntohs.c | 4 + lib/libstdc/net/raw_cb.h | 9 + lib/libstdc/net/rcmd.c | 50 +++--- lib/libstdc/net/res_comp.c | 39 ++-- lib/libstdc/net/res_debug.c | 45 +++-- lib/libstdc/net/res_init.c | 22 ++- lib/libstdc/net/res_mkquery.c | 24 +-- lib/libstdc/net/res_send.c | 58 +++--- lib/libstdc/net/rexec.c | 25 ++- lib/libstdc/net/route.h | 8 + lib/libstdc/net/ruserpass.c | 122 ++++++------- lib/libstdc/netdb.h | 78 +++++++- lib/libstdc/netimp/if_imp.h | 8 + lib/libstdc/netimp/if_imphost.h | 17 +- lib/libstdc/netinet/icmp_var.h | 7 + lib/libstdc/netinet/if_ether.h | 15 +- lib/libstdc/netinet/in.h | 14 +- lib/libstdc/netinet/in_pcb.h | 11 +- lib/libstdc/netinet/in_systm.h | 9 +- lib/libstdc/netinet/in_var.h | 11 +- lib/libstdc/netinet/ip.h | 9 + lib/libstdc/netinet/ip_icmp.h | 10 ++ lib/libstdc/netinet/ip_var.h | 11 +- lib/libstdc/netinet/tcp.h | 10 ++ lib/libstdc/netinet/tcp_debug.h | 10 ++ lib/libstdc/netinet/tcp_fsm.h | 9 + lib/libstdc/netinet/tcp_seq.h | 7 + lib/libstdc/netinet/tcp_timer.h | 7 + lib/libstdc/netinet/tcp_var.h | 16 +- lib/libstdc/netinet/tcpip.h | 8 + lib/libstdc/netinet/udp.h | 7 + lib/libstdc/netinet/udp_var.h | 9 + lib/libstdc/netns/idp.h | 8 + lib/libstdc/netns/idp_var.h | 5 + lib/libstdc/netns/ns.h | 29 ++- lib/libstdc/netns/ns_error.h | 8 + lib/libstdc/netns/ns_if.h | 11 +- lib/libstdc/netns/ns_pcb.h | 12 +- lib/libstdc/netns/sp.h | 7 + lib/libstdc/netns/spidp.h | 8 + lib/libstdc/netns/spp_debug.h | 9 + lib/libstdc/netns/spp_var.h | 11 ++ lib/libstdc/nlist.h | 16 ++ lib/libstdc/ns.h | 6 + lib/libstdc/ns/ns_addr.c | 29 ++- lib/libstdc/ns/ns_ntoa.c | 17 +- lib/libstdc/o.sh | 2 +- lib/libstdc/oldprotos.txt | 196 ++++++++++++++++++++ lib/libstdc/p.sh | 66 +++++++ lib/libstdc/pcc.h | 13 +- lib/libstdc/protocols/dumprestore.h | 8 + lib/libstdc/protocols/routed.h | 8 + lib/libstdc/protocols/rwhod.h | 5 + lib/libstdc/protocols/talkd.h | 12 +- lib/libstdc/protocols/timed.h | 9 + lib/libstdc/pwd.h | 25 ++- lib/libstdc/q.sh | 209 +++++++++++++++------- lib/libstdc/r.sh | 199 ++++++++++---------- lib/libstdc/ranlib.h | 7 + lib/libstdc/resolv.h | 12 +- lib/libstdc/s.sh | 190 -------------------- lib/libstdc/setjmp.h | 24 +++ lib/libstdc/sgtty.h | 11 +- lib/libstdc/signal.h | 122 ++++++++++++- lib/libstdc/stab.h | 5 + lib/libstdc/stdio.h | 163 +++++++++++++++-- lib/libstdc/stdio/clrerr.c | 7 +- lib/libstdc/stdio/doprnt.c | 47 ++--- lib/libstdc/stdio/doscan.c | 39 ++-- lib/libstdc/stdio/exit.c | 10 +- lib/libstdc/stdio/fdopen.c | 10 +- lib/libstdc/stdio/fgetc.c | 7 +- lib/libstdc/stdio/fgets.c | 9 +- lib/libstdc/stdio/filbuf.c | 12 +- lib/libstdc/stdio/findiop.c | 22 ++- lib/libstdc/stdio/flsbuf.c | 20 ++- lib/libstdc/stdio/fopen.c | 12 +- lib/libstdc/stdio/fprintf.c | 23 ++- lib/libstdc/stdio/fputc.c | 7 +- lib/libstdc/stdio/fputs.c | 8 +- lib/libstdc/stdio/fread.c | 10 +- lib/libstdc/stdio/freopen.c | 13 +- lib/libstdc/stdio/fseek.c | 11 +- lib/libstdc/stdio/ftell.c | 11 +- lib/libstdc/stdio/fwrite.c | 10 +- lib/libstdc/stdio/getchar.c | 6 +- lib/libstdc/stdio/gets.c | 8 +- lib/libstdc/stdio/getw.c | 7 +- lib/libstdc/stdio/popen.c | 21 ++- lib/libstdc/stdio/printf.c | 22 ++- lib/libstdc/stdio/putchar.c | 7 +- lib/libstdc/stdio/puts.c | 7 +- lib/libstdc/stdio/putw.c | 7 +- lib/libstdc/stdio/rew.c | 8 +- lib/libstdc/stdio/scanf.c | 46 +++-- lib/libstdc/stdio/setbuf.c | 9 +- lib/libstdc/stdio/setbuffer.c | 13 +- lib/libstdc/stdio/sibuf.c | 4 +- lib/libstdc/stdio/sobuf.c | 4 +- lib/libstdc/stdio/sprintf.c | 22 ++- lib/libstdc/stdio/strout.c | 10 +- lib/libstdc/stdio/ungetc.c | 7 +- lib/libstdc/stdio/vfprintf.c | 17 +- lib/libstdc/stdio/vprintf.c | 16 +- lib/libstdc/stdio/vsprintf.c | 16 +- lib/libstdc/string.h | 60 +++++-- lib/libstdc/strings.h | 58 +++++- lib/libstdc/struct.h | 5 + lib/libstdc/sys.h | 60 +++++++ lib/libstdc/sys/_exit.c | 5 +- lib/libstdc/sys/accept.c | 5 +- lib/libstdc/sys/access.c | 5 +- lib/libstdc/sys/acct.c | 3 + lib/libstdc/sys/acct.h | 18 ++ lib/libstdc/sys/adjtime.c | 5 +- lib/libstdc/sys/bind.c | 5 +- lib/libstdc/sys/bkmac.h | 8 + lib/libstdc/sys/brk.c | 3 + lib/libstdc/sys/buf.h | 26 ++- lib/libstdc/sys/callout.h | 7 + lib/libstdc/sys/chdir.c | 3 + lib/libstdc/sys/chmod.c | 5 +- lib/libstdc/sys/chown.c | 5 +- lib/libstdc/sys/chroot.c | 3 + lib/libstdc/sys/clist.h | 7 + lib/libstdc/sys/close.c | 5 +- lib/libstdc/sys/cmap.h | 16 +- lib/libstdc/sys/conf.h | 7 + lib/libstdc/sys/connect.c | 5 +- lib/libstdc/sys/creat.c | 5 +- lib/libstdc/sys/dir.h | 54 +++++- lib/libstdc/sys/dk.h | 5 + lib/libstdc/sys/dkbad.h | 7 + lib/libstdc/sys/dmap.h | 7 + lib/libstdc/sys/domain.h | 5 + lib/libstdc/sys/dup.c | 5 +- lib/libstdc/sys/dup2.c | 5 +- lib/libstdc/sys/errno.h | 18 ++ lib/libstdc/sys/exec.h | 35 ++++ lib/libstdc/sys/execl.c | 5 +- lib/libstdc/sys/execle.c | 5 +- lib/libstdc/sys/exect.c | 5 +- lib/libstdc/sys/execv.c | 5 +- lib/libstdc/sys/execve.c | 5 +- lib/libstdc/sys/fchmod.c | 5 +- lib/libstdc/sys/fchown.c | 5 +- lib/libstdc/sys/fcntl.c | 5 +- lib/libstdc/sys/file.h | 107 ++++++++++- lib/libstdc/sys/flock.c | 5 +- lib/libstdc/sys/fork.c | 3 + lib/libstdc/sys/fs.h | 13 +- lib/libstdc/sys/fstat.c | 5 +- lib/libstdc/sys/fsync.c | 5 +- lib/libstdc/sys/ftruncate.c | 6 +- lib/libstdc/sys/getdtablesize.c | 3 + lib/libstdc/sys/getegid.c | 4 + lib/libstdc/sys/geteuid.c | 4 + lib/libstdc/sys/getgid.c | 4 + lib/libstdc/sys/getgroups.c | 5 +- lib/libstdc/sys/gethostid.c | 3 + lib/libstdc/sys/gethostname.c | 3 + lib/libstdc/sys/getitimer.c | 5 +- lib/libstdc/sys/getpagesize.c | 3 + lib/libstdc/sys/getpeername.c | 5 +- lib/libstdc/sys/getpgrp.c | 5 +- lib/libstdc/sys/getpid.c | 3 + lib/libstdc/sys/getppid.c | 3 + lib/libstdc/sys/getpriority.c | 5 +- lib/libstdc/sys/getrlimit.c | 5 +- lib/libstdc/sys/getrusage.c | 5 +- lib/libstdc/sys/getsockname.c | 5 +- lib/libstdc/sys/getsockopt.c | 5 +- lib/libstdc/sys/gettimeofday.c | 3 + lib/libstdc/sys/getuid.c | 4 + lib/libstdc/sys/gprof.h | 5 + lib/libstdc/sys/inode.h | 23 ++- lib/libstdc/sys/ioctl.c | 6 +- lib/libstdc/sys/ioctl.h | 35 +++- lib/libstdc/sys/kernel.h | 13 +- lib/libstdc/sys/kill.c | 5 +- lib/libstdc/sys/killpg.c | 5 +- lib/libstdc/sys/link.c | 5 +- lib/libstdc/sys/listen.c | 5 +- lib/libstdc/sys/lseek.c | 6 +- lib/libstdc/sys/lstat.c | 3 + lib/libstdc/sys/map.h | 5 + lib/libstdc/sys/mbuf.h | 13 +- lib/libstdc/sys/mkdir.c | 5 +- lib/libstdc/sys/mknod.c | 5 +- lib/libstdc/sys/mman.h | 5 + lib/libstdc/sys/mount.c | 5 +- lib/libstdc/sys/mount.h | 22 +++ lib/libstdc/sys/msgbuf.h | 5 + lib/libstdc/sys/mtio.h | 8 + lib/libstdc/sys/namei.h | 13 +- lib/libstdc/sys/open.c | 5 +- lib/libstdc/sys/param.h | 26 ++- lib/libstdc/sys/pipe.c | 3 + lib/libstdc/sys/proc.h | 95 +++++++++- lib/libstdc/sys/profil.c | 5 +- lib/libstdc/sys/protosw.h | 7 +- lib/libstdc/sys/ptrace.c | 5 +- lib/libstdc/sys/ptrace.h | 20 ++- lib/libstdc/sys/quota.c | 5 +- lib/libstdc/sys/quota.h | 26 ++- lib/libstdc/sys/read.c | 5 +- lib/libstdc/sys/readlink.c | 5 +- lib/libstdc/sys/readv.c | 5 +- lib/libstdc/sys/reboot.c | 5 +- lib/libstdc/sys/reboot.h | 5 + lib/libstdc/sys/recv.c | 5 +- lib/libstdc/sys/recvfrom.c | 5 +- lib/libstdc/sys/recvmsg.c | 5 +- lib/libstdc/sys/rename.c | 5 +- lib/libstdc/sys/resource.h | 33 ++++ lib/libstdc/sys/rmdir.c | 3 + lib/libstdc/sys/sbrk.c | 5 +- lib/libstdc/sys/seg.h | 7 + lib/libstdc/sys/select.c | 6 +- lib/libstdc/sys/select.h | 20 +++ lib/libstdc/sys/send.c | 5 +- lib/libstdc/sys/sendmsg.c | 5 +- lib/libstdc/sys/sendto.c | 5 +- lib/libstdc/sys/setgroups.c | 5 +- lib/libstdc/sys/sethostid.c | 3 + lib/libstdc/sys/sethostname.c | 3 + lib/libstdc/sys/setitimer.c | 5 +- lib/libstdc/sys/setpgrp.c | 5 +- lib/libstdc/sys/setpriority.c | 5 +- lib/libstdc/sys/setquota.c | 5 +- lib/libstdc/sys/setregid.c | 5 +- lib/libstdc/sys/setreuid.c | 5 +- lib/libstdc/sys/setrlimit.c | 5 +- lib/libstdc/sys/setsockopt.c | 5 +- lib/libstdc/sys/settimeofday.c | 3 + lib/libstdc/sys/shutdown.c | 5 +- lib/libstdc/sys/sigblock.c | 5 +- lib/libstdc/sys/signal.h | 48 +++++ lib/libstdc/sys/sigpause.c | 5 +- lib/libstdc/sys/sigreturn.c | 4 + lib/libstdc/sys/sigsetmask.c | 5 +- lib/libstdc/sys/sigstack.c | 6 +- lib/libstdc/sys/sigvec.c | 6 +- lib/libstdc/sys/socket.c | 5 +- lib/libstdc/sys/socket.h | 63 +++++++ lib/libstdc/sys/socketpair.c | 5 +- lib/libstdc/sys/socketvar.h | 14 +- lib/libstdc/sys/stat.c | 3 + lib/libstdc/sys/stat.h | 24 +++ lib/libstdc/sys/swapon.c | 3 + lib/libstdc/sys/symlink.c | 5 +- lib/libstdc/sys/sync.c | 5 +- lib/libstdc/sys/syslog.h | 21 +++ lib/libstdc/sys/systm.h | 19 +- lib/libstdc/sys/tablet.h | 9 +- lib/libstdc/sys/text.h | 7 + lib/libstdc/sys/time.h | 51 ++++++ lib/libstdc/sys/timeb.h | 18 ++ lib/libstdc/sys/times.h | 18 ++ lib/libstdc/sys/trace.h | 5 + lib/libstdc/sys/truncate.c | 4 + lib/libstdc/sys/tty.h | 9 + lib/libstdc/sys/ttychars.h | 9 +- lib/libstdc/sys/ttydev.h | 9 +- lib/libstdc/sys/types.h | 9 +- lib/libstdc/sys/uio.h | 25 ++- lib/libstdc/sys/umask.c | 5 +- lib/libstdc/sys/umount.c | 3 + lib/libstdc/sys/un.h | 7 +- lib/libstdc/sys/unlink.c | 3 + lib/libstdc/sys/unpcb.h | 7 + lib/libstdc/sys/user.h | 15 ++ lib/libstdc/sys/utimes.c | 3 + lib/libstdc/sys/vadvise.h | 5 + lib/libstdc/sys/vcmd.h | 7 + lib/libstdc/sys/vhangup.c | 3 + lib/libstdc/sys/vlimit.h | 16 ++ lib/libstdc/sys/vm.h | 5 + lib/libstdc/sys/vmmac.h | 16 +- lib/libstdc/sys/vmmeter.h | 5 + lib/libstdc/sys/vmparam.h | 5 + lib/libstdc/sys/vmsystm.h | 5 + lib/libstdc/sys/vsio.h | 9 +- lib/libstdc/sys/vtimes.h | 16 ++ lib/libstdc/sys/wait.c | 3 + lib/libstdc/sys/wait.h | 22 ++- lib/libstdc/sys/wait3.c | 6 +- lib/libstdc/sys/write.c | 5 +- lib/libstdc/sys/writev.c | 5 +- lib/libstdc/syscall.h | 5 + lib/libstdc/sysexits.h | 5 + lib/libstdc/syslog.h | 72 +++++++- lib/libstdc/time.h | 26 ++- lib/libstdc/ttyent.h | 25 ++- lib/libstdc/utmp.h | 22 +++ lib/libstdc/varargs.h | 5 + lib/libstdc/vax/clock.h | 7 + lib/libstdc/vax/cons.h | 5 + lib/libstdc/vax/cpu.h | 7 + lib/libstdc/vax/crl.h | 6 +- lib/libstdc/vax/dkio.h | 7 + lib/libstdc/vax/flp.h | 5 + lib/libstdc/vax/frame.h | 7 + lib/libstdc/vax/inline/inline.h | 7 +- lib/libstdc/vax/ioa.h | 11 +- lib/libstdc/vax/ka630.h | 7 + lib/libstdc/vax/machparam.h | 11 +- lib/libstdc/vax/mem.h | 9 +- lib/libstdc/vax/mscp.h | 13 +- lib/libstdc/vax/mtpr.h | 5 + lib/libstdc/vax/nexus.h | 9 +- lib/libstdc/vax/pcb.h | 7 + lib/libstdc/vax/psl.h | 5 + lib/libstdc/vax/pte.h | 5 + lib/libstdc/vax/reg.h | 5 + lib/libstdc/vax/rpb.h | 5 + lib/libstdc/vax/rsp.h | 7 + lib/libstdc/vax/scb.h | 5 + lib/libstdc/vax/tmscp.h | 6 + lib/libstdc/vax/trap.h | 5 + lib/libstdc/vax/vmparam.h | 8 + lib/libstdc/vaxif/if_accreg.h | 7 + lib/libstdc/vaxif/if_cssreg.h | 8 +- lib/libstdc/vaxif/if_ddnreg.h | 9 +- lib/libstdc/vaxif/if_ddnvar.h | 8 +- lib/libstdc/vaxif/if_dereg.h | 8 + lib/libstdc/vaxif/if_dmc.h | 5 + lib/libstdc/vaxif/if_ecreg.h | 5 + lib/libstdc/vaxif/if_en.h | 7 + lib/libstdc/vaxif/if_enreg.h | 5 + lib/libstdc/vaxif/if_exreg.h | 7 +- lib/libstdc/vaxif/if_hdhreg.h | 8 +- lib/libstdc/vaxif/if_hy.h | 10 +- lib/libstdc/vaxif/if_hyreg.h | 8 +- lib/libstdc/vaxif/if_il.h | 7 + lib/libstdc/vaxif/if_ilreg.h | 5 + lib/libstdc/vaxif/if_ix.h | 7 + lib/libstdc/vaxif/if_pclreg.h | 7 + lib/libstdc/vaxif/if_qereg.h | 7 + lib/libstdc/vaxif/if_uba.h | 10 +- lib/libstdc/vaxif/if_vv.h | 7 + lib/libstdc/vaxmba/hpreg.h | 5 + lib/libstdc/vaxmba/htreg.h | 5 + lib/libstdc/vaxmba/mbareg.h | 7 + lib/libstdc/vaxmba/mbavar.h | 9 +- lib/libstdc/vaxmba/mtreg.h | 5 + lib/libstdc/vaxuba/adreg.h | 7 + lib/libstdc/vaxuba/dhreg.h | 7 + lib/libstdc/vaxuba/dhureg.h | 5 + lib/libstdc/vaxuba/dmfreg.h | 7 + lib/libstdc/vaxuba/dmreg.h | 5 + lib/libstdc/vaxuba/dmzreg.h | 8 +- lib/libstdc/vaxuba/dzreg.h | 5 + lib/libstdc/vaxuba/idcreg.h | 5 + lib/libstdc/vaxuba/ikreg.h | 8 + lib/libstdc/vaxuba/npreg.h | 11 +- lib/libstdc/vaxuba/pdma.h | 5 + lib/libstdc/vaxuba/psreg.h | 8 +- lib/libstdc/vaxuba/rkreg.h | 7 + lib/libstdc/vaxuba/rlreg.h | 7 + lib/libstdc/vaxuba/rxreg.h | 7 + lib/libstdc/vaxuba/tmreg.h | 9 +- lib/libstdc/vaxuba/tmscpreg.h | 5 + lib/libstdc/vaxuba/tsreg.h | 9 +- lib/libstdc/vaxuba/ubareg.h | 11 +- lib/libstdc/vaxuba/ubavar.h | 18 +- lib/libstdc/vaxuba/udareg.h | 6 +- lib/libstdc/vaxuba/upreg.h | 7 + lib/libstdc/vaxuba/utreg.h | 8 + lib/libstdc/vaxuba/uureg.h | 5 +- lib/libstdc/vaxuba/vpreg.h | 8 + lib/libstdc/vaxuba/vsreg.h | 8 +- lib/libstdc/vfont.h | 5 + 548 files changed, 6130 insertions(+), 2058 deletions(-) create mode 100644 lib/libstdc/compat-4.1.h create mode 100644 lib/libstdc/compat-sys5.h create mode 100644 lib/libstdc/csu.h mode change 120000 => 100644 lib/libstdc/errno.h create mode 100644 lib/libstdc/inet.h create mode 100644 lib/libstdc/ns.h create mode 100644 lib/libstdc/oldprotos.txt create mode 100755 lib/libstdc/p.sh delete mode 100755 lib/libstdc/s.sh mode change 120000 => 100644 lib/libstdc/signal.h create mode 100644 lib/libstdc/sys.h mode change 120000 => 100644 lib/libstdc/syslog.h diff --git a/.gitignore b/.gitignore index 7016c8d..bdac0b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ *.a -*.append *.nocomm *.o +*.oldprotos *.protos +*.protos.nocomm *.usedby +*.uses cproto-4.6/Makefile cproto-4.6/config.cache cproto-4.6/config.h diff --git a/lib/libstdc/a.out.h b/lib/libstdc/a.out.h index ee338c8..f083632 100644 --- a/lib/libstdc/a.out.h +++ b/lib/libstdc/a.out.h @@ -1,3 +1,8 @@ +#ifndef _A_OUT_H_ +#define _A_OUT_H_ + +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,7 +16,7 @@ * and magic numbers are shared with * the kernel. */ -#include +/*#include */ /* * Macros which take exec structures as arguments and tell whether @@ -40,3 +45,5 @@ unsigned int r_symbolnum:24, /* local symbol ordinal */ }; #include + +#endif diff --git a/lib/libstdc/ar.h b/lib/libstdc/ar.h index 8780c1f..19fa478 100644 --- a/lib/libstdc/ar.h +++ b/lib/libstdc/ar.h @@ -1,3 +1,6 @@ +#ifndef _AR_H_ +#define _AR_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -20,3 +23,5 @@ struct ar_hdr { char ar_size[10]; char ar_fmag[2]; }; + +#endif diff --git a/lib/libstdc/arpa/ftp.h b/lib/libstdc/arpa/ftp.h index 187a875..852fcf9 100644 --- a/lib/libstdc/arpa/ftp.h +++ b/lib/libstdc/arpa/ftp.h @@ -1,3 +1,6 @@ +#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 @@ -65,3 +68,5 @@ #define BLK_RESTART 0x10 /* Block is Restart Marker */ #define BLK_BYTECOUNT 2 /* Bytes in this block */ + +#endif diff --git a/lib/libstdc/arpa/inet.h b/lib/libstdc/arpa/inet.h index af957ca..2465e3c 100644 --- a/lib/libstdc/arpa/inet.h +++ b/lib/libstdc/arpa/inet.h @@ -1,3 +1,9 @@ +#ifndef _ARPA_INET_H_ +#define _ARPA_INET_H_ + +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +16,35 @@ * External definitions for * functions in inet(3N) */ -unsigned long inet_addr(); -char *inet_ntoa(); -struct in_addr inet_makeaddr(); -unsigned long inet_network(); +/*unsigned long inet_addr();*/ +/*char *inet_ntoa();*/ +/*struct in_addr inet_makeaddr();*/ +/*unsigned long inet_network();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* inet/inet_addr.c */ +u_long inet_addr __P((register char *cp)); + +/* inet/inet_lnaof.c */ +int inet_lnaof __P((struct in_addr in)); + +/* inet/inet_makeaddr.c */ +struct in_addr inet_makeaddr __P((int net, int host)); + +/* inet/inet_netof.c */ +int inet_netof __P((struct in_addr in)); + +/* inet/inet_network.c */ +u_long inet_network __P((register char *cp)); + +/* inet/inet_ntoa.c */ +char *inet_ntoa __P((struct in_addr in)); + +#endif diff --git a/lib/libstdc/arpa/nameser.h b/lib/libstdc/arpa/nameser.h index 2b85ac3..f085c01 100644 --- a/lib/libstdc/arpa/nameser.h +++ b/lib/libstdc/arpa/nameser.h @@ -1,3 +1,9 @@ +#ifndef _ARPA_NAMESER_H_ +#define _ARPA_NAMESER_H_ + +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -152,5 +158,43 @@ struct rrec { char *r_data; /* pointer to data */ }; -extern u_short getshort(); -extern u_long getlong(); +/*extern u_short getshort();*/ +/*extern u_long getlong();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* 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)); +int dn_skip __P((char *comp_dn)); +int dn_find __P((char *exp_dn, char *msg, char **dnptrs, char **lastdnptr)); +u_short getshort __P((char *msgp)); +u_long getlong __P((char *msgp)); +int putshort __P((int s, register char *msgp)); +int putlong __P((register u_long l, register char *msgp)); + +/* net/res_debug.c */ +int p_query __P((char *msg)); +int fp_query __P((char *msg, FILE *file)); +char *p_cdname __P((char *cp, char *msg, FILE *file)); +char *p_rr __P((char *cp, char *msg, FILE *file)); +char *p_type __P((int type)); +char *p_class __P((int class)); + +/* net/res_init.c */ +int res_init __P((void)); + +/* net/res_mkquery.c */ +int res_mkquery __P((int op, char *dname, int class, int type, char *data, int datalen, struct rrec *newrr, char *buf, int buflen)); + +/* net/res_send.c */ +int res_send __P((char *buf, int buflen, char *answer, int anslen)); +int _res_close __P((void)); + +#endif diff --git a/lib/libstdc/arpa/telnet.h b/lib/libstdc/arpa/telnet.h index 1c5b435..01b7a0c 100644 --- a/lib/libstdc/arpa/telnet.h +++ b/lib/libstdc/arpa/telnet.h @@ -1,3 +1,6 @@ +#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 @@ -80,3 +83,5 @@ char *telopts[NTELOPTS] = { /* sub-option qualifiers */ #define TELQUAL_IS 0 /* option is... */ #define TELQUAL_SEND 1 /* send option */ + +#endif diff --git a/lib/libstdc/arpa/tftp.h b/lib/libstdc/arpa/tftp.h index 73c536c..6fed9fc 100644 --- a/lib/libstdc/arpa/tftp.h +++ b/lib/libstdc/arpa/tftp.h @@ -1,3 +1,6 @@ +#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 @@ -46,3 +49,5 @@ struct tftphdr { #define EBADID 5 /* unknown transfer ID */ #define EEXISTS 6 /* file already exists */ #define ENOUSER 7 /* no such user */ + +#endif diff --git a/lib/libstdc/assert.h b/lib/libstdc/assert.h index 1529b79..35a6e88 100644 --- a/lib/libstdc/assert.h +++ b/lib/libstdc/assert.h @@ -1,9 +1,17 @@ +#ifndef _ASSERT_H_ +#define _ASSERT_H_ + +#include +#include + /* assert.h 4.2 85/01/21 */ -# ifndef NDEBUG +/*# ifndef NDEBUG*/ # define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}} # define assert(ex) _assert(ex) # else # define _assert(ex) # define assert(ex) -# endif +/*# endif*/ + +#endif diff --git a/lib/libstdc/compat-4.1.h b/lib/libstdc/compat-4.1.h new file mode 100644 index 0000000..cdfe77f --- /dev/null +++ b/lib/libstdc/compat-4.1.h @@ -0,0 +1,33 @@ +#ifndef _COMPAT_4_1_H_ +#define _COMPAT_4_1_H_ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/getpw.c */ +int getpw __P((int uid, char buf[])); + +/* compat-4.1/pause.c */ +int pause __P((void)); + +/* compat-4.1/rand.c */ +int srand __P((unsigned x)); +int rand __P((void)); + +/* compat-4.1/tell.c */ +long tell __P((int f)); + +#endif diff --git a/lib/libstdc/compat-4.1/ftime.c b/lib/libstdc/compat-4.1/ftime.c index 5237976..3d48a09 100644 --- a/lib/libstdc/compat-4.1/ftime.c +++ b/lib/libstdc/compat-4.1/ftime.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ftime.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -23,8 +27,7 @@ struct timeb { short dstflag; }; -ftime(tp) - register struct timeb *tp; { +int ftime(tp) register struct timeb *tp; { struct timeval t; struct timezone tz; diff --git a/lib/libstdc/compat-4.1/getpw.c b/lib/libstdc/compat-4.1/getpw.c index 27f0028..a8e8191 100644 --- a/lib/libstdc/compat-4.1/getpw.c +++ b/lib/libstdc/compat-4.1/getpw.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +9,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpw.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -getpw(uid, buf) -int uid; -char buf[]; { +int getpw(uid, buf) int uid; char buf[]; { static FILE *pwf; register n, c; register char *bp; diff --git a/lib/libstdc/compat-4.1/gtty.c b/lib/libstdc/compat-4.1/gtty.c index 9de9bff..4819cc5 100644 --- a/lib/libstdc/compat-4.1/gtty.c +++ b/lib/libstdc/compat-4.1/gtty.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +8,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gtty.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Writearound to old gtty system call. @@ -14,8 +16,7 @@ static char sccsid[] = "@(#)gtty.c 5.2 (Berkeley) 3/9/86"; #include -gtty(fd, ap) - struct sgttyb *ap; { +int gtty(fd, ap) int fd; struct sgttyb *ap; { return(ioctl(fd, TIOCGETP, ap)); } diff --git a/lib/libstdc/compat-4.1/nice.c b/lib/libstdc/compat-4.1/nice.c index b681f4b..bc2978b 100644 --- a/lib/libstdc/compat-4.1/nice.c +++ b/lib/libstdc/compat-4.1/nice.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +8,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)nice.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -14,8 +16,7 @@ static char sccsid[] = "@(#)nice.c 5.2 (Berkeley) 3/9/86"; /* * Backwards compatible nice. */ -nice(incr) - int incr; { +int nice(incr) int incr; { int prio; extern int errno; diff --git a/lib/libstdc/compat-4.1/pause.c b/lib/libstdc/compat-4.1/pause.c index 1260fb9..6143b01 100644 --- a/lib/libstdc/compat-4.1/pause.c +++ b/lib/libstdc/compat-4.1/pause.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,12 +9,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)pause.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Backwards compatible pause. */ -pause() { +int pause() { sigpause(sigblock(0)); } diff --git a/lib/libstdc/compat-4.1/rand.c b/lib/libstdc/compat-4.1/rand.c index 3614e2d..c4494e5 100644 --- a/lib/libstdc/compat-4.1/rand.c +++ b/lib/libstdc/compat-4.1/rand.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +8,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rand.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif static long randx = 1; -srand(x) -unsigned x; { +int srand(x) unsigned x; { randx = x; } -rand() { +int rand() { return((randx = randx * 1103515245 + 12345) & 0x7fffffff); } diff --git a/lib/libstdc/compat-4.1/stty.c b/lib/libstdc/compat-4.1/stty.c index d14e44e..a4951e0 100644 --- a/lib/libstdc/compat-4.1/stty.c +++ b/lib/libstdc/compat-4.1/stty.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +8,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)stty.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Writearound to old stty system call. @@ -14,8 +16,7 @@ static char sccsid[] = "@(#)stty.c 5.2 (Berkeley) 3/9/86"; #include -stty(fd, ap) - struct sgttyb *ap; { +int stty(fd, ap) int fd; struct sgttyb *ap; { return(ioctl(fd, TIOCSETP, ap)); } diff --git a/lib/libstdc/compat-4.1/tell.c b/lib/libstdc/compat-4.1/tell.c index 72f5270..b1d95b2 100644 --- a/lib/libstdc/compat-4.1/tell.c +++ b/lib/libstdc/compat-4.1/tell.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,14 +9,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)tell.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * return offset in file. */ -long lseek(); +/*long lseek();*/ -long tell(f) { +long tell(f) int f; { return(lseek(f, 0L, 1)); } diff --git a/lib/libstdc/compat-4.1/times.c b/lib/libstdc/compat-4.1/times.c index c398d00..fb363b0 100644 --- a/lib/libstdc/compat-4.1/times.c +++ b/lib/libstdc/compat-4.1/times.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)times.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -21,8 +25,9 @@ struct tms { int tms_cstime; /* system time, children */ }; -times(tmsp) - register struct tms *tmsp; { +static scale60 __P((register struct timeval *tvp)); + +int times(tmsp) register struct tms *tmsp; { struct rusage ru; if (getrusage(RUSAGE_SELF, &ru) < 0) @@ -36,9 +41,7 @@ times(tmsp) return (0); } -static -scale60(tvp) - register struct timeval *tvp; { +static scale60(tvp) register struct timeval *tvp; { return (tvp->tv_sec * 60 + tvp->tv_usec / 16667); } diff --git a/lib/libstdc/compat-4.1/utime.c b/lib/libstdc/compat-4.1/utime.c index 931ea3e..1e2c122 100644 --- a/lib/libstdc/compat-4.1/utime.c +++ b/lib/libstdc/compat-4.1/utime.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,16 +8,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)utime.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include /* * Backwards compatible utime. */ -utime(name, otv) - char *name; - int otv[]; { +int utime(name, otv) char *name; int otv[]; { struct timeval tv[2]; tv[0].tv_sec = otv[0]; tv[0].tv_usec = 0; diff --git a/lib/libstdc/compat-4.1/vlimit.c b/lib/libstdc/compat-4.1/vlimit.c index 163ddc4..1ec88db 100644 --- a/lib/libstdc/compat-4.1/vlimit.c +++ b/lib/libstdc/compat-4.1/vlimit.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vlimit.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * (Almost) backwards compatible vlimit. @@ -26,8 +31,7 @@ static char sccsid[] = "@(#)vlimit.c 5.2 (Berkeley) 3/9/86"; #define NLIMITS 6 -vlimit(limit, value) - int limit, value; { +int vlimit(limit, value) int limit; int value; { struct rlimit rlim; if (limit <= 0 || limit > NLIMITS) diff --git a/lib/libstdc/compat-4.1/vtimes.c b/lib/libstdc/compat-4.1/vtimes.c index 3f32416..37c5113 100644 --- a/lib/libstdc/compat-4.1/vtimes.c +++ b/lib/libstdc/compat-4.1/vtimes.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vtimes.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -28,8 +32,10 @@ struct vtimes { int vm_oublk; /* block writes */ }; -vtimes(par, chi) - register struct vtimes *par, *chi; { +static getvtimes __P((register struct rusage *aru, register struct vtimes *avt)); +static scale60 __P((register struct timeval *tvp)); + +int vtimes(par, chi) register struct vtimes *par; register struct vtimes *chi; { struct rusage ru; if (par) { @@ -45,10 +51,7 @@ vtimes(par, chi) return (0); } -static -getvtimes(aru, avt) - register struct rusage *aru; - register struct vtimes *avt; { +static getvtimes(aru, avt) register struct rusage *aru; register struct vtimes *avt; { avt->vm_utime = scale60(&aru->ru_utime); avt->vm_stime = scale60(&aru->ru_stime); @@ -62,9 +65,7 @@ getvtimes(aru, avt) avt->vm_oublk = aru->ru_oublock; } -static -scale60(tvp) - register struct timeval *tvp; { +static scale60(tvp) register struct timeval *tvp; { return (tvp->tv_sec * 60 + tvp->tv_usec / 16667); } diff --git a/lib/libstdc/compat-sys5.h b/lib/libstdc/compat-sys5.h new file mode 100644 index 0000000..3824fdf --- /dev/null +++ b/lib/libstdc/compat-sys5.h @@ -0,0 +1,21 @@ +#ifndef _COMPAT_SYS5_H_ +#define _COMPAT_SYS5_H_ + +#include +#include + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-sys5/getopt.c */ +int getopt __P((int nargc, char **nargv, char *ostr)); + +/* compat-sys5/tmpnam.c */ +char *tmpnam __P((char *s)); + +#endif diff --git a/lib/libstdc/compat-sys5/getopt.c b/lib/libstdc/compat-sys5/getopt.c index e0049f5..3f4949e 100644 --- a/lib/libstdc/compat-sys5/getopt.c +++ b/lib/libstdc/compat-sys5/getopt.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getopt.c 4.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include @@ -23,10 +27,7 @@ char *optarg; /* argument associated with option */ #define tell(s) if (opterr) {fputs(*nargv,stderr);fputs(s,stderr); \ fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);} -getopt(nargc,nargv,ostr) -int nargc; -char **nargv, - *ostr; { +int getopt(nargc, nargv, ostr) int nargc; char **nargv; char *ostr; { static char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ char *index(); diff --git a/lib/libstdc/compat-sys5/memccpy.c b/lib/libstdc/compat-sys5/memccpy.c index de22b87..58b0918 100644 --- a/lib/libstdc/compat-sys5/memccpy.c +++ b/lib/libstdc/compat-sys5/memccpy.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,10 +14,7 @@ static char sccsid[] = "@(#)memccpy.c 5.2 (Berkeley) 86/03/09"; #endif -char * -memccpy(t, f, c, n) - register char *t, *f; - register c, n; { +char *memccpy(t, f, c, n) register char *t; register char *f; register c; register n; { while (--n >= 0) if ((*t++ = *f++) == c) return (t); diff --git a/lib/libstdc/compat-sys5/memchr.c b/lib/libstdc/compat-sys5/memchr.c index e40c2ff..cfdc891 100644 --- a/lib/libstdc/compat-sys5/memchr.c +++ b/lib/libstdc/compat-sys5/memchr.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,10 +14,7 @@ static char sccsid[] = "@(#)memchr.c 5.2 (Berkeley) 86/03/09"; #endif -char * -memchr(s, c, n) - register char *s; - register c, n; { +char *memchr(s, c, n) register char *s; register c; register n; { while (--n >= 0) if (*s++ == c) return (--s); diff --git a/lib/libstdc/compat-sys5/memcmp.c b/lib/libstdc/compat-sys5/memcmp.c index 66b364c..337e270 100644 --- a/lib/libstdc/compat-sys5/memcmp.c +++ b/lib/libstdc/compat-sys5/memcmp.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,9 +14,7 @@ static char sccsid[] = "@(#)memcmp.c 5.2 (Berkeley) 86/03/09"; #endif -memcmp(s1, s2, n) - register char *s1, *s2; - register n; { +int memcmp(s1, s2, n) register char *s1; register char *s2; register n; { while (--n >= 0) if (*s1++ != *s2++) return (*--s1 - *--s2); diff --git a/lib/libstdc/compat-sys5/memcpy.c b/lib/libstdc/compat-sys5/memcpy.c index 94cab58..5c196c4 100644 --- a/lib/libstdc/compat-sys5/memcpy.c +++ b/lib/libstdc/compat-sys5/memcpy.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,10 +14,7 @@ static char sccsid[] = "@(#)memcpy.c 5.2 (Berkeley) 86/03/09"; #endif -char * -memcpy(t, f, n) - register char *t, *f; - register n; { +char *memcpy(t, f, n) register char *t; register char *f; register n; { register char *p = t; while (--n >= 0) diff --git a/lib/libstdc/compat-sys5/memset.c b/lib/libstdc/compat-sys5/memset.c index b8e8eae..2726efe 100644 --- a/lib/libstdc/compat-sys5/memset.c +++ b/lib/libstdc/compat-sys5/memset.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,10 +14,7 @@ static char sccsid[] = "@(#)memset.c 5.2 (Berkeley) 86/03/09"; #endif -char * -memset(s, c, n) - register char *s; - register c, n; { +char *memset(s, c, n) register char *s; register c; register n; { register char *p = s; while (--n >= 0) diff --git a/lib/libstdc/compat-sys5/strcatn.c b/lib/libstdc/compat-sys5/strcatn.c index 7023789..56120c1 100644 --- a/lib/libstdc/compat-sys5/strcatn.c +++ b/lib/libstdc/compat-sys5/strcatn.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +8,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcatn.c 4.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Concatenate s2 on the end of s1. S1's space must be large enough. @@ -14,10 +16,7 @@ static char sccsid[] = "@(#)strcatn.c 4.3 (Berkeley) 3/9/86"; * Return s1. */ -char * -strcatn(s1, s2, n) -register char *s1, *s2; -register n; { +char *strcatn(s1, s2, n) register char *s1; register char *s2; register n; { register char *os1; os1 = s1; diff --git a/lib/libstdc/compat-sys5/strchr.c b/lib/libstdc/compat-sys5/strchr.c index 8db9dbc..5fc2672 100644 --- a/lib/libstdc/compat-sys5/strchr.c +++ b/lib/libstdc/compat-sys5/strchr.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strchr.c 5.2 (Berkeley) 86/03/09"; -#endif LIBC_SCCS and not lint +#endif /* * Return the ptr in sp at which the character c appears; @@ -11,9 +13,7 @@ static char sccsid[] = "@(#)strchr.c 5.2 (Berkeley) 86/03/09"; #define NULL 0 -char * -strchr(sp, c) -register char *sp, c; { +char *strchr(sp, c) register char *sp; int c; { do { if (*sp == c) return(sp); diff --git a/lib/libstdc/compat-sys5/strcmpn.c b/lib/libstdc/compat-sys5/strcmpn.c index 92c43b9..182ad22 100644 --- a/lib/libstdc/compat-sys5/strcmpn.c +++ b/lib/libstdc/compat-sys5/strcmpn.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +8,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcmpn.c 4.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) if (*s1++ == '\0') diff --git a/lib/libstdc/compat-sys5/strcpyn.c b/lib/libstdc/compat-sys5/strcpyn.c index 87f1fbd..83134b8 100644 --- a/lib/libstdc/compat-sys5/strcpyn.c +++ b/lib/libstdc/compat-sys5/strcpyn.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,16 +8,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcpyn.c 4.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ -char * -strcpyn(s1, s2, n) -register char *s1, *s2; { +char *strcpyn(s1, s2, n) register char *s1; register char *s2; int n; { register i; register char *os1; diff --git a/lib/libstdc/compat-sys5/strcspn.c b/lib/libstdc/compat-sys5/strcspn.c index 9aa21a7..60867ff 100644 --- a/lib/libstdc/compat-sys5/strcspn.c +++ b/lib/libstdc/compat-sys5/strcspn.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,8 +14,7 @@ static char sccsid[] = "@(#)strcspn.c 5.2 (Berkeley) 86/03/09"; #endif -strcspn(s, set) - register char *s, *set; { +int strcspn(s, set) register char *s; register char *set; { register n = 0; register char *p; register c; diff --git a/lib/libstdc/compat-sys5/strpbrk.c b/lib/libstdc/compat-sys5/strpbrk.c index 118e4b2..5d2462f 100644 --- a/lib/libstdc/compat-sys5/strpbrk.c +++ b/lib/libstdc/compat-sys5/strpbrk.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,9 +14,7 @@ static char sccsid[] = "@(#)strpbrk.c 5.2 (Berkeley) 86/03/09"; #endif -char * -strpbrk(s, brk) - register char *s, *brk; { +char *strpbrk(s, brk) register char *s; register char *brk; { register char *p; register c; diff --git a/lib/libstdc/compat-sys5/strrchr.c b/lib/libstdc/compat-sys5/strrchr.c index 190429e..07e8f05 100644 --- a/lib/libstdc/compat-sys5/strrchr.c +++ b/lib/libstdc/compat-sys5/strrchr.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strrchr.c 5.2 (berkeley) 86/03/09"; -#endif LIBC_SCCS and not lint +#endif /* * Return the ptr in sp at which the character c last @@ -11,9 +13,7 @@ static char sccsid[] = "@(#)strrchr.c 5.2 (berkeley) 86/03/09"; #define NULL 0 -char * -strrchr(sp, c) -register char *sp, c; { +char *strrchr(sp, c) register char *sp; int c; { register char *r; r = NULL; diff --git a/lib/libstdc/compat-sys5/strspn.c b/lib/libstdc/compat-sys5/strspn.c index 32d6dba..af60b4a 100644 --- a/lib/libstdc/compat-sys5/strspn.c +++ b/lib/libstdc/compat-sys5/strspn.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,8 +14,7 @@ static char sccsid[] = "@(#)strspn.c 5.2 (Berkeley) 86/03/09"; #endif -strspn(s, set) - register char *s, *set; { +int strspn(s, set) register char *s; register char *set; { register n = 0; register char *p; register c; diff --git a/lib/libstdc/compat-sys5/strtok.c b/lib/libstdc/compat-sys5/strtok.c index 7255435..444e9d2 100644 --- a/lib/libstdc/compat-sys5/strtok.c +++ b/lib/libstdc/compat-sys5/strtok.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,9 +15,7 @@ static char sccsid[] = "@(#)strtok.c 5.2 (Berkeley) 86/03/09"; #endif -char * -strtok(s, sep) - register char *s, *sep; { +char *strtok(s, sep) register char *s; register char *sep; { register char *p; register c; static char *lasts; diff --git a/lib/libstdc/compat-sys5/tmpnam.c b/lib/libstdc/compat-sys5/tmpnam.c index 7e67016..5b26914 100644 --- a/lib/libstdc/compat-sys5/tmpnam.c +++ b/lib/libstdc/compat-sys5/tmpnam.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,10 +10,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)tmpnam.c 4.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -char *tmpnam(s) -char *s; { +char *tmpnam(s) char *s; { static seed; sprintf(s, "temp.%d.%d", getpid(), seed++); diff --git a/lib/libstdc/csu.h b/lib/libstdc/csu.h new file mode 100644 index 0000000..65ab73e --- /dev/null +++ b/lib/libstdc/csu.h @@ -0,0 +1,30 @@ +#ifndef _CSU_H_ +#define _CSU_H_ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* csu/crt0.c */ +int start __P((void)); +int exit __P((register int code)); +int moncontrol __P((int val)); + +/* csu/gmon.c */ +int monstartup __P((char *lowpc, char *highpc)); +int _mcleanup __P((void)); +int mcount __P((void)); +int monitor __P((char *lowpc, char *highpc, char *buf, int bufsiz, int nfunc)); +int moncontrol __P((int mode)); + +/* csu/mon.c */ +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 diff --git a/lib/libstdc/csu/crt0.c b/lib/libstdc/csu/crt0.c index 702e33e..6663ce0 100644 --- a/lib/libstdc/csu/crt0.c +++ b/lib/libstdc/csu/crt0.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)crt0.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * C start up routine. @@ -35,7 +40,7 @@ asm("#define _start start"); asm("#define _eprol eprol"); extern unsigned char etext; extern unsigned char eprol; -start() { +int start() { struct kframe { int kargc; char *kargv[1]; /* size depends on kargc */ @@ -54,9 +59,9 @@ start() { #ifdef lint kfp = 0; initcode = initcode = 0; -#else not lint +#else asm(" movl sp,r10"); /* catch it quick */ -#endif not lint +#endif for (argv = targv = &kfp->kargv[0]; *targv++; /* void */) /* void */ ; if (targv >= (char **)(*argv)) @@ -77,11 +82,11 @@ asm("eprol:"); fd = open("/dev/null", 2); } while (fd >= 0 && fd < 3); close(fd); -#endif paranoid +#endif #ifdef MCRT0 monstartup(&eprol, &etext); -#endif MCRT0 +#endif errno = 0; exit(main(kfp->kargc, argv, environ)); } @@ -90,24 +95,22 @@ asm("#undef _eprol"); #ifdef MCRT0 /*ARGSUSED*/ -exit(code) - register int code; /* r11 */ { +int exit(code) register int code; /* r11 */ { monitor(0); _cleanup(); asm(" movl r11,r0"); asm(" chmk $1"); } -#endif MCRT0 +#endif #ifdef CRT0 /* * null mcount and moncontrol, * just in case some routine is compiled for profiling */ -moncontrol(val) - int val; { +int moncontrol(val) int val; { } asm(" .globl mcount"); asm("mcount: rsb"); -#endif CRT0 +#endif diff --git a/lib/libstdc/csu/gmon.c b/lib/libstdc/csu/gmon.c index 0082169..b076d0a 100644 --- a/lib/libstdc/csu/gmon.c +++ b/lib/libstdc/csu/gmon.c @@ -1,3 +1,10 @@ +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,11 +13,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #ifdef DEBUG #include -#endif DEBUG +#endif #include "gmon.h" @@ -33,9 +40,7 @@ static int s_scale; #define MSG "No space for monitor buffer(s)\n" -monstartup(lowpc, highpc) - char *lowpc; - char *highpc; { +int monstartup(lowpc, highpc) char *lowpc; char *highpc; { int monsize; char *buffer; char *sbrk(); @@ -82,7 +87,7 @@ monstartup(lowpc, highpc) monitor( lowpc , highpc , buffer , monsize , tolimit ); } -_mcleanup() { +int _mcleanup() { int fd; int fromindex; int endfrom; @@ -97,7 +102,7 @@ _mcleanup() { } # ifdef DEBUG fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz ); -# endif DEBUG +# endif write( fd , sbuf , ssiz ); endfrom = s_textsize / (HASHFRACTION * sizeof(*froms)); for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) { @@ -110,7 +115,7 @@ _mcleanup() { fprintf( stderr , "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" , frompc , tos[toindex].selfpc , tos[toindex].count ); -# endif DEBUG +# endif rawarc.raw_frompc = (unsigned long) frompc; rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc; rawarc.raw_count = tos[toindex].count; @@ -124,7 +129,7 @@ asm(".text"); asm(".align 2"); asm("#the beginning of mcount()"); asm(".data"); -mcount() { +int mcount() { register char *selfpc; /* r11 => r5 */ register unsigned short *frompcindex; /* r10 => r4 */ register struct tostruct *top; /* r9 => r3 */ @@ -243,12 +248,7 @@ asm("#the end of mcount()"); asm(".data"); /*VARARGS1*/ -monitor( lowpc , highpc , buf , bufsiz , nfunc ) - char *lowpc; - char *highpc; - char *buf; /* declared ``short buffer[]'' in monitor(3) */ - int bufsiz; - int nfunc; /* not used, available for compatability only */ { +int monitor(lowpc, highpc, buf, bufsiz, nfunc) char *lowpc; char *highpc; char *buf; /* declared ``short buffer[]'' in monitor(3) */ int bufsiz; int nfunc; /* not used, available for compatability only */ { register o; if ( lowpc == 0 ) { @@ -277,8 +277,7 @@ monitor( lowpc , highpc , buf , bufsiz , nfunc ) * profiling is what mcount checks to see if * all the data structures are ready. */ -moncontrol(mode) - int mode; { +int moncontrol(mode) int mode; { if (mode) { /* start */ profil(sbuf + sizeof(struct phdr), ssiz - sizeof(struct phdr), diff --git a/lib/libstdc/csu/mon.c b/lib/libstdc/csu/mon.c index 289ad3a..1b8263f 100644 --- a/lib/libstdc/csu/mon.c +++ b/lib/libstdc/csu/mon.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +11,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mon.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #define ARCDENSITY 5 /* density of routines */ #define MINARCS 50 /* minimum number of counters */ #define HISTFRACTION 2 /* fraction of text space for histograms */ - struct phdr { int *lpc; int *hpc; @@ -35,16 +39,13 @@ int numctrs; #define MSG "No space for monitor buffer(s)\n" -monstartup(lowpc, highpc) - char *lowpc; - char *highpc; { +int monstartup(lowpc, highpc) char *lowpc; char *highpc; { int monsize; char *buffer; int cntsiz; extern char *sbrk(); extern char *minbrk; - cntsiz = (highpc - lowpc) * ARCDENSITY / 100; if (cntsiz < MINARCS) cntsiz = MINARCS; @@ -66,7 +67,7 @@ monstartup(lowpc, highpc) asm(".text"); asm("#the beginning of mcount()"); asm(".data"); -mcount() { +int mcount() { register int *selfpc; /* r11 */ register long **cntp; /* r10 */ @@ -109,10 +110,7 @@ asm(".text"); asm("#the end of mcount()"); asm(".data"); -monitor(lowpc, highpc, buf, bufsiz, cntsiz) - char *lowpc, *highpc; - char *buf; - int bufsiz, cntsiz; { +int monitor(lowpc, highpc, buf, bufsiz, cntsiz) char *lowpc; char *highpc; char *buf; int bufsiz; int cntsiz; { register int o; struct phdr *php; static int ssiz; @@ -155,8 +153,7 @@ monitor(lowpc, highpc, buf, bufsiz, cntsiz) * profiling is what mcount checks to see if * all the data structures are ready. */ -moncontrol(mode) - int mode; { +int moncontrol(mode) int mode; { if (mode) { /* start */ profil(s_sbuf, s_bufsiz, s_lowpc, s_scale); diff --git a/lib/libstdc/ctype.h b/lib/libstdc/ctype.h index 83d853b..1142fde 100644 --- a/lib/libstdc/ctype.h +++ b/lib/libstdc/ctype.h @@ -1,3 +1,6 @@ +#ifndef _CTYPE_H_ +#define _CTYPE_H_ + /* ctype.h 4.2 85/09/04 */ #define _U 01 @@ -26,3 +29,5 @@ extern char _ctype_[]; #define toupper(c) ((c)-'a'+'A') #define tolower(c) ((c)-'A'+'a') #define toascii(c) ((c)&0177) + +#endif diff --git a/lib/libstdc/disktab.h b/lib/libstdc/disktab.h index 060d15f..45ebe82 100644 --- a/lib/libstdc/disktab.h +++ b/lib/libstdc/disktab.h @@ -1,3 +1,6 @@ +#ifndef _DISKTAB_H_ +#define _DISKTAB_H_ + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -28,4 +31,17 @@ struct disktab { } d_partitions[8]; }; -struct disktab *getdiskbyname(); +/*struct disktab *getdiskbyname();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/disktab.c */ +struct disktab *getdiskbyname __P((char *name)); + +#endif diff --git a/lib/libstdc/errno.h b/lib/libstdc/errno.h deleted file mode 120000 index 7280063..0000000 --- a/lib/libstdc/errno.h +++ /dev/null @@ -1 +0,0 @@ -sys/errno.h \ No newline at end of file diff --git a/lib/libstdc/errno.h b/lib/libstdc/errno.h new file mode 100644 index 0000000..cfbb01e --- /dev/null +++ b/lib/libstdc/errno.h @@ -0,0 +1,105 @@ +#ifndef _ERRNO_H_ +#define _ERRNO_H_ + +#include + +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)errno.h 7.1 (Berkeley) 6/4/86 + */ + +/* + * Error codes + */ + +#define EPERM 1 /* Not owner */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted system call */ +#define EIO 5 /* I/O error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file number */ +#define ECHILD 10 /* No children */ +#define EAGAIN 11 /* No more processes */ +#define ENOMEM 12 /* Not enough core */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#define ENOTBLK 15 /* Block device required */ +#define EBUSY 16 /* Mount device busy */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Cross-device link */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory*/ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* File table overflow */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Not a typewriter */ +#define ETXTBSY 26 /* Text file busy */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Illegal seek */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ + +/* math software */ +#define EDOM 33 /* Argument too large */ +#define ERANGE 34 /* Result too large */ + +/* non-blocking and interrupt i/o */ +#define EWOULDBLOCK 35 /* Operation would block */ +#define EDEADLK EWOULDBLOCK /* ditto */ +#define EINPROGRESS 36 /* Operation now in progress */ +#define EALREADY 37 /* Operation already in progress */ + +/* ipc/network software */ + + /* argument errors */ +#define ENOTSOCK 38 /* Socket operation on non-socket */ +#define EDESTADDRREQ 39 /* Destination address required */ +#define EMSGSIZE 40 /* Message too long */ +#define EPROTOTYPE 41 /* Protocol wrong type for socket */ +#define ENOPROTOOPT 42 /* Protocol not available */ +#define EPROTONOSUPPORT 43 /* Protocol not supported */ +#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ +#define EOPNOTSUPP 45 /* Operation not supported on socket */ +#define EPFNOSUPPORT 46 /* Protocol family not supported */ +#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ +#define EADDRINUSE 48 /* Address already in use */ +#define EADDRNOTAVAIL 49 /* Can't assign requested address */ + + /* operational errors */ +#define ENETDOWN 50 /* Network is down */ +#define ENETUNREACH 51 /* Network is unreachable */ +#define ENETRESET 52 /* Network dropped connection on reset */ +#define ECONNABORTED 53 /* Software caused connection abort */ +#define ECONNRESET 54 /* Connection reset by peer */ +#define ENOBUFS 55 /* No buffer space available */ +#define EISCONN 56 /* Socket is already connected */ +#define ENOTCONN 57 /* Socket is not connected */ +#define ESHUTDOWN 58 /* Can't send after socket shutdown */ +#define ETOOMANYREFS 59 /* Too many references: can't splice */ +#define ETIMEDOUT 60 /* Connection timed out */ +#define ECONNREFUSED 61 /* Connection refused */ + + /* */ +#define ELOOP 62 /* Too many levels of symbolic links */ +#define ENAMETOOLONG 63 /* File name too long */ + +/* should be rearranged */ +#define EHOSTDOWN 64 /* Host is down */ +#define EHOSTUNREACH 65 /* No route to host */ +#define ENOTEMPTY 66 /* Directory not empty */ + +/* quotas & mush */ +#define EPROCLIM 67 /* Too many processes */ +#define EUSERS 68 /* Too many users */ +#define EDQUOT 69 /* Disc quota exceeded */ + +#endif diff --git a/lib/libstdc/fcntl.h b/lib/libstdc/fcntl.h index 5fd458f..67d7c11 100644 --- a/lib/libstdc/fcntl.h +++ b/lib/libstdc/fcntl.h @@ -1,3 +1,8 @@ +#ifndef _FCNTL_H_ +#define _FCNTL_H_ + +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,3 +43,5 @@ #define FTRUNC 02000 /* truncate to zero length */ #define FEXCL 04000 /* error if already created */ #endif + +#endif diff --git a/lib/libstdc/fstab.h b/lib/libstdc/fstab.h index c595c82..c1ac13a 100644 --- a/lib/libstdc/fstab.h +++ b/lib/libstdc/fstab.h @@ -1,3 +1,6 @@ +#ifndef _FSTAB_H_ +#define _FSTAB_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -34,9 +37,27 @@ struct fstab{ int fs_passno; /* pass number on parallel dump */ }; -struct fstab *getfsent(); -struct fstab *getfsspec(); -struct fstab *getfsfile(); -struct fstab *getfstype(); -int setfsent(); -int endfsent(); +/*struct fstab *getfsent();*/ +/*struct fstab *getfsspec();*/ +/*struct fstab *getfsfile();*/ +/*struct fstab *getfstype();*/ +/*int setfsent();*/ +/*int endfsent();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/fstab.c */ +int setfsent __P((void)); +int endfsent __P((void)); +struct fstab *getfsent __P((void)); +struct fstab *getfsspec __P((char *name)); +struct fstab *getfsfile __P((char *name)); +struct fstab *getfstype __P((char *type)); + +#endif diff --git a/lib/libstdc/gen.h b/lib/libstdc/gen.h index c0a77d9..58ab5d6 100644 --- a/lib/libstdc/gen.h +++ b/lib/libstdc/gen.h @@ -1,5 +1,137 @@ +#ifndef _GEN_H_ +#define _GEN_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* formerly duplicated in gen/insque.c and gen/remque.c */ struct vaxque { /* queue format expected by VAX queue instructions */ struct vaxque *vq_next; struct vaxque *vq_prev; }; + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/abort.c */ +int abort __P((void)); + +/* gen/abs.c */ +int abs __P((int i)); + +/* gen/atoi.c */ +int atoi __P((register char *p)); + +/* gen/atol.c */ +long atol __P((register char *p)); + +/* gen/bcmp.c */ +int bcmp __P((register char *b1, register char *b2, register int length)); + +/* gen/bcopy.c */ +int bcopy __P((register char *src, register char *dst, register int length)); + +/* gen/bzero.c */ +int bzero __P((register char *b, register int length)); + +/* gen/calloc.c */ +char *calloc __P((register unsigned num, register unsigned size)); +int cfree __P((char *p, unsigned num, unsigned size)); + +/* gen/crypt.c */ +int setkey __P((char *key)); +int encrypt __P((char *block, int edflag)); +char *crypt __P((char *pw, char *salt)); + +/* gen/ecvt.c */ +char *ecvt __P((double arg, int ndigits, int *decpt, int *sign)); +char *fcvt __P((double arg, int ndigits, int *decpt, int *sign)); + +/* gen/fakcu.c */ +int _cleanup __P((void)); + +/* gen/ffs.c */ +int ffs __P((register long mask)); + +/* gen/gcvt.c */ +char *gcvt __P((double number, int ndigit, char *buf)); + +/* gen/getenv.c */ +char *getenv __P((register char *name)); + +/* gen/getpass.c */ +char *getpass __P((char *prompt)); + +/* gen/getusershell.c */ +char *getusershell __P((void)); +int endusershell __P((void)); +int setusershell __P((void)); + +/* gen/insque.c */ +int insque __P((register struct vaxque *e, register struct vaxque *prev)); + +/* gen/malloc.c */ +char *malloc __P((unsigned nbytes)); +int morecore __P((int bucket)); +int free __P((char *cp)); +char *realloc __P((char *cp, unsigned nbytes)); +int mstats __P((char *s)); + +/* gen/mkstemp.c */ +int mkstemp __P((char *as)); + +/* gen/mktemp.c */ +char *mktemp __P((char *as)); + +/* gen/qsort.c */ +int qsort __P((char *base, int n, int size, int (*compar)(void))); + +/* gen/random.c */ +int srandom __P((unsigned x)); +char *initstate __P((unsigned seed, char *arg_state, int n)); +char *setstate __P((char *arg_state)); +long random __P((void)); + +/* gen/regex.c */ +char *re_comp __P((register char *sp)); +int re_exec __P((register char *p1)); +int backref __P((register int i, register char *lp)); +int cclass __P((register char *set, int c, int af)); + +/* gen/remque.c */ +int remque __P((register struct vaxque *e)); + +/* gen/swab.c */ +int swab __P((register char *from, register char *to, register int n)); + +/* gen/timezone.c */ +char *timezone __P((int zone, int dst)); + +/* gen/valloc.c */ +char *valloc __P((int i)); + +#endif diff --git a/lib/libstdc/gen/_setjmp.c b/lib/libstdc/gen/_setjmp.c index 77a2a34..f2ee7fe 100644 --- a/lib/libstdc/gen/_setjmp.c +++ b/lib/libstdc/gen/_setjmp.c @@ -1,7 +1,10 @@ +#include #include + +/*#include */ int _setjmp(e) jmp_buf e; { abort(); } -void _longjmp(e, v) jmp_buf e; { +void _longjmp(e, v) jmp_buf e; int v; { abort(); } diff --git a/lib/libstdc/gen/abort.c b/lib/libstdc/gen/abort.c index 7aaab9c..5babb51 100644 --- a/lib/libstdc/gen/abort.c +++ b/lib/libstdc/gen/abort.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +11,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)abort.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* C library -- abort */ #include "signal.h" -abort() { +int abort() { sigblock(~0); signal(SIGILL, SIG_DFL); sigsetmask(~sigmask(SIGILL)); diff --git a/lib/libstdc/gen/abs.c b/lib/libstdc/gen/abs.c index d2130ca..8cb6610 100644 --- a/lib/libstdc/gen/abs.c +++ b/lib/libstdc/gen/abs.c @@ -1,3 +1,5 @@ +#include + int abs(i) int i; { abort(); } diff --git a/lib/libstdc/gen/alarm.c b/lib/libstdc/gen/alarm.c index 87c439c..ae3e2c9 100644 --- a/lib/libstdc/gen/alarm.c +++ b/lib/libstdc/gen/alarm.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +8,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)alarm.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Backwards compatible alarm. */ #include -alarm(secs) - int secs; { +int alarm(secs) int secs; { struct itimerval it, oitv; register struct itimerval *itp = ⁢ diff --git a/lib/libstdc/gen/atof.c b/lib/libstdc/gen/atof.c index 429843a..2cf16ac 100644 --- a/lib/libstdc/gen/atof.c +++ b/lib/libstdc/gen/atof.c @@ -1,3 +1,6 @@ +#include +#include + double atof(s) char *s; { abort(); } diff --git a/lib/libstdc/gen/atoi.c b/lib/libstdc/gen/atoi.c index d21f781..e4f968f 100644 --- a/lib/libstdc/gen/atoi.c +++ b/lib/libstdc/gen/atoi.c @@ -1,9 +1,10 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)atoi.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -atoi(p) -register char *p; { +int atoi(p) register char *p; { register int n; register int f; diff --git a/lib/libstdc/gen/atol.c b/lib/libstdc/gen/atol.c index b298ad3..8259ae1 100644 --- a/lib/libstdc/gen/atol.c +++ b/lib/libstdc/gen/atol.c @@ -1,10 +1,10 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)atol.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -long -atol(p) -register char *p; { +long atol(p) register char *p; { long n; register int f; diff --git a/lib/libstdc/gen/bcmp.c b/lib/libstdc/gen/bcmp.c index 2423ce8..a70579b 100644 --- a/lib/libstdc/gen/bcmp.c +++ b/lib/libstdc/gen/bcmp.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,14 +8,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bcmp.c 5.1 (Berkeley) 1/27/87"; -#endif LIBC_SCCS and not lint +#endif /* * bcmp -- vax cmpc3 instruction */ -bcmp(b1, b2, length) - register char *b1, *b2; - register int length; { +int bcmp(b1, b2, length) register char *b1; register char *b2; register int length; { if (length == 0) return (0); diff --git a/lib/libstdc/gen/bcopy.c b/lib/libstdc/gen/bcopy.c index 41a0a62..58d290f 100644 --- a/lib/libstdc/gen/bcopy.c +++ b/lib/libstdc/gen/bcopy.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,14 +9,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bcopy.c 5.1 (Berkeley) 1/27/87"; -#endif LIBC_SCCS and not lint +#endif /* * bcopy -- vax movc3 instruction */ -bcopy(src, dst, length) - register char *src, *dst; - register int length; { +int bcopy(src, dst, length) register char *src; register char *dst; register int length; { if (length && src != dst) if ((u_int)dst < (u_int)src) if (((int)src | (int)dst | length) & 3) diff --git a/lib/libstdc/gen/bzero.c b/lib/libstdc/gen/bzero.c index b533fee..01dc1dd 100644 --- a/lib/libstdc/gen/bzero.c +++ b/lib/libstdc/gen/bzero.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,14 +8,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bzero.c 5.1 (Berkeley) 1/27/87"; -#endif LIBC_SCCS and not lint +#endif /* * bzero -- vax movc5 instruction */ -bzero(b, length) - register char *b; - register int length; { +int bzero(b, length) register char *b; register int length; { if (length) do diff --git a/lib/libstdc/gen/calloc.c b/lib/libstdc/gen/calloc.c index 06f8a6a..2b5b2b7 100644 --- a/lib/libstdc/gen/calloc.c +++ b/lib/libstdc/gen/calloc.c @@ -1,13 +1,13 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)calloc.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Calloc - allocate and clear memory block */ -char * -calloc(num, size) - register unsigned num, size; { +char *calloc(num, size) register unsigned num; register unsigned size; { extern char *malloc(); register char *p; @@ -17,9 +17,6 @@ calloc(num, size) return (p); } -cfree(p, num, size) - char *p; - unsigned num; - unsigned size; { +int cfree(p, num, size) char *p; unsigned num; unsigned size; { free(p); } diff --git a/lib/libstdc/gen/closedir.c b/lib/libstdc/gen/closedir.c index 19a600f..907e9c1 100644 --- a/lib/libstdc/gen/closedir.c +++ b/lib/libstdc/gen/closedir.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)closedir.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -14,9 +18,7 @@ static char sccsid[] = "@(#)closedir.c 5.2 (Berkeley) 3/9/86"; /* * close a directory. */ -void -closedir(dirp) - register DIR *dirp; { +void closedir(dirp) register DIR *dirp; { close(dirp->dd_fd); dirp->dd_fd = -1; dirp->dd_loc = 0; diff --git a/lib/libstdc/gen/crypt.c b/lib/libstdc/gen/crypt.c index 5975b68..3ea5f87 100644 --- a/lib/libstdc/gen/crypt.c +++ b/lib/libstdc/gen/crypt.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)crypt.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * This program implements the @@ -113,8 +115,7 @@ static char e[] = { * Set up the key schedule from the key. */ -setkey(key) -char *key; { +int setkey(key) char *key; { register i, j, k; int t; @@ -238,8 +239,7 @@ static char preS[48]; * The payoff: encrypt a block. */ -encrypt(block, edflag) -char *block; { +int encrypt(block, edflag) char *block; int edflag; { int i, ii; register t, j, k; @@ -325,10 +325,7 @@ char *block; { block[j] = L[FP[j]-1]; } -char * -crypt(pw,salt) -char *pw; -char *salt; { +char *crypt(pw, salt) char *pw; char *salt; { register i, j, c; int temp; static char block[66], iobuf[16]; diff --git a/lib/libstdc/gen/ctime.c b/lib/libstdc/gen/ctime.c index 1759c3a..fd01034 100644 --- a/lib/libstdc/gen/ctime.c +++ b/lib/libstdc/gen/ctime.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ctime.c 5.5 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * This routine converts time as follows. @@ -132,22 +136,21 @@ static struct dayrules { -1, }; -struct tm *gmtime(); -char *ct_numb(); -struct tm *localtime(); -char *ctime(); -char *ct_num(); -char *asctime(); +/*struct tm *gmtime();*/ +/*char *ct_numb();*/ +/*struct tm *localtime();*/ +/*char *ctime();*/ +/*char *ct_num();*/ +/*char *asctime();*/ + +static sunday __P((register struct tm *t, register int d)); +static char *ct_numb __P((register char *cp, int n)); -char * -ctime(t) -time_t *t; { +char *ctime(t) time_t *t; { return(asctime(localtime(t))); } -struct tm * -localtime(tim) -time_t *tim; { +struct tm *localtime(tim) time_t *tim; { register int dayno; register struct tm *ct; register dalybeg, daylend; @@ -208,18 +211,13 @@ time_t *tim; { * The value is the day number of the last * Sunday on or before the day. */ -static -sunday(t, d) -register struct tm *t; -register int d; { +static sunday(t, d) register struct tm *t; register int d; { if (d >= 58) d += dysize(t->tm_year) - 365; return(d - (d - t->tm_yday + t->tm_wday + 700) % 7); } -struct tm * -gmtime(tim) -time_t *tim; { +struct tm *gmtime(tim) time_t *tim; { register int d0, d1; long hms, day; register int *tp; @@ -278,9 +276,7 @@ time_t *tim; { return(&xtime); } -char * -asctime(t) -struct tm *t; { +char *asctime(t) struct tm *t; { register char *cp, *ncp; register int *tp; @@ -310,15 +306,13 @@ struct tm *t; { return(cbuf); } -dysize(y) { +int dysize(y) int y; { if((y%4) == 0) return(366); return(365); } -static char * -ct_numb(cp, n) -register char *cp; { +static char *ct_numb(cp, n) register char *cp; int n; { cp++; if (n>=10) *cp++ = (n/10)%10 + '0'; diff --git a/lib/libstdc/gen/ctype_.c b/lib/libstdc/gen/ctype_.c index c64d586..dfa548c 100644 --- a/lib/libstdc/gen/ctype_.c +++ b/lib/libstdc/gen/ctype_.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ctype_.c 5.4 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include diff --git a/lib/libstdc/gen/disktab.c b/lib/libstdc/gen/disktab.c index 188c9f8..3489afb 100644 --- a/lib/libstdc/gen/disktab.c +++ b/lib/libstdc/gen/disktab.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,16 +12,22 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)disktab.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include -static char *dgetstr(); +/*static char *dgetstr();*/ + +static dgetent __P((char *bp, char *name)); +static dnamatch __P((char *np)); +static char *dskip __P((register char *bp)); +static dgetnum __P((char *id)); +static dgetflag __P((char *id)); +static char *dgetstr __P((char *id, char **area)); +static char *ddecode __P((register char *str, char **area)); -struct disktab * -getdiskbyname(name) - char *name; { +struct disktab *getdiskbyname(name) char *name; { static struct disktab disk; static char localbuf[100], *cp = localbuf; register struct disktab *dp = &disk; @@ -56,17 +68,15 @@ getdiskbyname(name) #include static char *tbuf; -static char *dskip(); -static char *ddecode(); +/*static char *dskip();*/ +/*static char *ddecode();*/ /* * Get an entry for disk name in buffer bp, * from the diskcap file. Parse is very rudimentary; * we just notice escaped newlines. */ -static -dgetent(bp, name) - char *bp, *name; { +static dgetent(bp, name) char *bp; char *name; { register char *cp; register int c; register int i = 0, cnt = 0; @@ -120,9 +130,7 @@ dgetent(bp, name) * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -static -dnamatch(np) - char *np; { +static dnamatch(np) char *np; { register char *Np, *Bp; Bp = tbuf; @@ -146,9 +154,7 @@ dnamatch(np) * knowing about \: escapes or any such. If necessary, :'s can be put * into the diskcap file in octal. */ -static char * -dskip(bp) - register char *bp; { +static char *dskip(bp) register char *bp; { while (*bp && *bp != ':') bp++; @@ -165,9 +171,7 @@ dskip(bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -static -dgetnum(id) - char *id; { +static dgetnum(id) char *id; { register int i, base; register char *bp = tbuf; @@ -198,9 +202,7 @@ dgetnum(id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -static -dgetflag(id) - char *id; { +static dgetflag(id) char *id; { register char *bp = tbuf; for (;;) { @@ -224,9 +226,7 @@ dgetflag(id) * placed in area, which is a ref parameter which is updated. * No checking on area overflow. */ -static char * -dgetstr(id, area) - char *id, **area; { +static char *dgetstr(id, area) char *id; char **area; { register char *bp = tbuf; for (;;) { @@ -248,10 +248,7 @@ dgetstr(id, area) * Tdecode does the grung work to decode the * string capability escapes. */ -static char * -ddecode(str, area) - register char *str; - char **area; { +static char *ddecode(str, area) register char *str; char **area; { register char *cp; register int c; register char *dp; diff --git a/lib/libstdc/gen/ecvt.c b/lib/libstdc/gen/ecvt.c index be8bd88..ed930f1 100644 --- a/lib/libstdc/gen/ecvt.c +++ b/lib/libstdc/gen/ecvt.c @@ -1,6 +1,9 @@ +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ecvt.c 5.1 (Berkeley) 3/15/86"; -#endif LIBC_SCCS and not lint +#endif /* * ecvt converts to decimal @@ -9,27 +12,20 @@ static char sccsid[] = "@(#)ecvt.c 5.1 (Berkeley) 3/15/86"; * sign is set to 0 for positive, 1 for negative */ -char *cvt(); +/*char *cvt();*/ #define NDIG 80 -char* -ecvt(arg, ndigits, decpt, sign) -double arg; -int ndigits, *decpt, *sign; { +static char *cvt __P((double arg, int ndigits, int *decpt, int *sign, int eflag)); + +char *ecvt(arg, ndigits, decpt, sign) double arg; int ndigits; int *decpt; int *sign; { return(cvt(arg, ndigits, decpt, sign, 1)); } -char* -fcvt(arg, ndigits, decpt, sign) -double arg; -int ndigits, *decpt, *sign; { +char *fcvt(arg, ndigits, decpt, sign) double arg; int ndigits; int *decpt; int *sign; { return(cvt(arg, ndigits, decpt, sign, 0)); } -static char* -cvt(arg, ndigits, decpt, sign, eflag) -double arg; -int ndigits, *decpt, *sign; { +static char *cvt(arg, ndigits, decpt, sign, eflag) double arg; int ndigits; int *decpt; int *sign; int eflag; { register int r2; double fi, fj; register char *p, *p1; diff --git a/lib/libstdc/gen/errlst.c b/lib/libstdc/gen/errlst.c index 405d2c0..0e8a39f 100644 --- a/lib/libstdc/gen/errlst.c +++ b/lib/libstdc/gen/errlst.c @@ -6,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)errlst.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif char *sys_errlist[] = { "Error 0", diff --git a/lib/libstdc/gen/execvp.c b/lib/libstdc/gen/execvp.c index 1553520..f720b61 100644 --- a/lib/libstdc/gen/execvp.c +++ b/lib/libstdc/gen/execvp.c @@ -1,6 +1,13 @@ +#include +#include +#include +#include +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)execvp.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * execlp(name, arg,...,0) (like execl, but does path search) @@ -10,16 +17,16 @@ static char sccsid[] = "@(#)execvp.c 5.2 (Berkeley) 3/9/86"; #define NULL 0 static char shell[] = "/bin/sh"; -char *execat(), *getenv(); +/*char *execat(), *getenv();*/ extern errno; -execlp(name, argv) -char *name, *argv; { +static char *execat __P((register char *s1, register char *s2, char *si)); + +int execlp(name, argv) char *name; char *argv; { return(execvp(name, &argv)); } -execvp(name, argv) -char *name, **argv; { +int execvp(name, argv) char *name; char **argv; { char *pathstr; register char *cp; char fname[128]; @@ -66,10 +73,7 @@ char *name, **argv; { return(-1); } -static char * -execat(s1, s2, si) -register char *s1, *s2; -char *si; { +static char *execat(s1, s2, si) register char *s1; register char *s2; char *si; { register char *s; s = si; diff --git a/lib/libstdc/gen/fakcu.c b/lib/libstdc/gen/fakcu.c index 8b2ba24..f91ff0b 100644 --- a/lib/libstdc/gen/fakcu.c +++ b/lib/libstdc/gen/fakcu.c @@ -1,10 +1,13 @@ +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fakcu.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Null cleanup routine to resolve reference in exit() * if not using stdio. */ -_cleanup() { +int _cleanup() { } diff --git a/lib/libstdc/gen/ffs.c b/lib/libstdc/gen/ffs.c index 63db817..e18dca5 100644 --- a/lib/libstdc/gen/ffs.c +++ b/lib/libstdc/gen/ffs.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -17,13 +19,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ffs.c 5.2 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif /* * ffs -- vax ffs instruction */ -ffs(mask) - register long mask; { +int ffs(mask) register long mask; { register int cnt; if (mask == 0) diff --git a/lib/libstdc/gen/frexp.c b/lib/libstdc/gen/frexp.c index 4b16b76..dd9a21a 100644 --- a/lib/libstdc/gen/frexp.c +++ b/lib/libstdc/gen/frexp.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)frexp.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * the call @@ -12,10 +14,7 @@ static char sccsid[] = "@(#)frexp.c 5.2 (Berkeley) 3/9/86"; * if the argument is 0.0, return 0.0 mantissa and 0 exponent. */ -double -frexp(x,i) -double x; -int *i; { +double frexp(x, i) double x; int *i; { int neg; int j; j = 0; diff --git a/lib/libstdc/gen/fstab.c b/lib/libstdc/gen/fstab.c index b44ed37..3f2df3a 100644 --- a/lib/libstdc/gen/fstab.c +++ b/lib/libstdc/gen/fstab.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fstab.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -16,9 +21,11 @@ static struct fstab fs; static char line[BUFSIZ+1]; static FILE *fs_file = 0; -static char * -fsskip(p) - register char *p; { +static char *fsskip __P((register char *p)); +static char *fsdigit __P((int *backp, char *string, int end)); +static fstabscan __P((struct fstab *fs)); + +static char *fsskip(p) register char *p; { while (*p && *p != ':') ++p; @@ -27,10 +34,7 @@ fsskip(p) return (p); } -static char * -fsdigit(backp, string, end) - int *backp; - char *string, end; { +static char *fsdigit(backp, string, end) int *backp; char *string; int end; { register int value = 0; register char *cp; @@ -48,9 +52,7 @@ fsdigit(backp, string, end) return (cp+1); } -static -fstabscan(fs) - struct fstab *fs; { +static fstabscan(fs) struct fstab *fs; { register char *cp; cp = fgets(line, 256, fs_file); @@ -71,7 +73,7 @@ fstabscan(fs) return (5); } -setfsent() { +int setfsent() { if (fs_file) endfsent(); @@ -82,7 +84,7 @@ setfsent() { return (1); } -endfsent() { +int endfsent() { if (fs_file) { fclose(fs_file); @@ -91,8 +93,7 @@ endfsent() { return (1); } -struct fstab * -getfsent() { +struct fstab *getfsent() { int nfields; if ((fs_file == 0) && (setfsent() == 0)) @@ -103,9 +104,7 @@ getfsent() { return (&fs); } -struct fstab * -getfsspec(name) - char *name; { +struct fstab *getfsspec(name) char *name; { register struct fstab *fsp; if (setfsent() == 0) /* start from the beginning */ @@ -116,9 +115,7 @@ getfsspec(name) return ((struct fstab *)0); } -struct fstab * -getfsfile(name) - char *name; { +struct fstab *getfsfile(name) char *name; { register struct fstab *fsp; if (setfsent() == 0) /* start from the beginning */ @@ -129,9 +126,7 @@ getfsfile(name) return ((struct fstab *)0); } -struct fstab * -getfstype(type) - char *type; { +struct fstab *getfstype(type) char *type; { register struct fstab *fs; if (setfsent() == 0) diff --git a/lib/libstdc/gen/gcvt.c b/lib/libstdc/gen/gcvt.c index 98c62c2..a2693be 100644 --- a/lib/libstdc/gen/gcvt.c +++ b/lib/libstdc/gen/gcvt.c @@ -1,18 +1,17 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gcvt.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * gcvt - Floating output conversion to * minimal length string */ -char *ecvt(); +/*char *ecvt();*/ -char * -gcvt(number, ndigit, buf) -double number; -char *buf; { +char *gcvt(number, ndigit, buf) double number; int ndigit; char *buf; { int sign, decpt; register char *p1, *p2; register i; diff --git a/lib/libstdc/gen/getenv.c b/lib/libstdc/gen/getenv.c index 4ca9947..f92d294 100644 --- a/lib/libstdc/gen/getenv.c +++ b/lib/libstdc/gen/getenv.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getenv.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * getenv(name) @@ -8,11 +10,11 @@ static char sccsid[] = "@(#)getenv.c 5.2 (Berkeley) 3/9/86"; */ #define NULL 0 extern char **environ; -char *nvmatch(); +/*char *nvmatch();*/ + +static char *nvmatch __P((register char *s1, register char *s2)); -char * -getenv(name) -register char *name; { +char *getenv(name) register char *name; { register char **p = environ; register char *v; @@ -29,9 +31,7 @@ register char *name; { * used for environment searching: see getenv */ -static char * -nvmatch(s1, s2) -register char *s1, *s2; { +static char *nvmatch(s1, s2) register char *s1; register char *s2; { while (*s1 == *s2++) if (*s1++ == '=') diff --git a/lib/libstdc/gen/getgrent.c b/lib/libstdc/gen/getgrent.c index 4f93172..a826d56 100644 --- a/lib/libstdc/gen/getgrent.c +++ b/lib/libstdc/gen/getgrent.c @@ -1,6 +1,10 @@ +#include +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getgrent.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -13,31 +17,29 @@ static char line[BUFSIZ+1]; static struct group group; static char *gr_mem[MAXGRP]; -setgrent() { +static char *grskip __P((register char *p, register c)); + +int setgrent() { if( !grf ) grf = fopen( GROUP, "r" ); else rewind( grf ); } -endgrent() { +int endgrent() { if( grf ){ fclose( grf ); grf = NULL; } } -static char * -grskip(p,c) -register char *p; -register c; { +static char *grskip(p, c) register char *p; register c; { while( *p && *p != c ) ++p; if( *p ) *p++ = 0; return( p ); } -struct group * -getgrent() { +struct group *getgrent() { register char *p, **q; if( !grf && !(grf = fopen( GROUP, "r" )) ) diff --git a/lib/libstdc/gen/getgrgid.c b/lib/libstdc/gen/getgrgid.c index 8a3509d..e64682f 100644 --- a/lib/libstdc/gen/getgrgid.c +++ b/lib/libstdc/gen/getgrgid.c @@ -1,12 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getgrgid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -struct group * -getgrgid(gid) -register gid; { +struct group *getgrgid(gid) register gid; { register struct group *p; struct group *getgrent(); diff --git a/lib/libstdc/gen/getgrnam.c b/lib/libstdc/gen/getgrnam.c index 0c1c0a5..c964681 100644 --- a/lib/libstdc/gen/getgrnam.c +++ b/lib/libstdc/gen/getgrnam.c @@ -1,12 +1,13 @@ +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getgrnam.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -struct group * -getgrnam(name) -register char *name; { +struct group *getgrnam(name) register char *name; { register struct group *p; struct group *getgrent(); diff --git a/lib/libstdc/gen/getlogin.c b/lib/libstdc/gen/getlogin.c index f5b03aa..bbb8822 100644 --- a/lib/libstdc/gen/getlogin.c +++ b/lib/libstdc/gen/getlogin.c @@ -1,14 +1,16 @@ +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getlogin.c 5.3 (Berkeley) 5/9/86"; -#endif LIBC_SCCS and not lint +#endif #include static char UTMP[] = "/etc/utmp"; static struct utmp ubuf; -char * -getlogin() { +char *getlogin() { register int me, uf; register char *cp; diff --git a/lib/libstdc/gen/getpass.c b/lib/libstdc/gen/getpass.c index d1ae6dd..b0d7717 100644 --- a/lib/libstdc/gen/getpass.c +++ b/lib/libstdc/gen/getpass.c @@ -1,14 +1,19 @@ +#include +#include +#include +#include +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpass.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include #include -char * -getpass(prompt) -char *prompt; { +char *getpass(prompt) char *prompt; { struct sgttyb ttyb; int flags; register char *p; diff --git a/lib/libstdc/gen/getpwent.c b/lib/libstdc/gen/getpwent.c index 5ccbaa5..b3d20fa 100644 --- a/lib/libstdc/gen/getpwent.c +++ b/lib/libstdc/gen/getpwent.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1984 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpwent.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -24,14 +29,16 @@ char *_pw_file = "/etc/passwd"; DBM *_pw_db; int _pw_stayopen; -setpwent() { +static char *pwskip __P((register char *p)); + +int setpwent() { if (pwf == NULL) pwf = fopen(_pw_file, "r"); else rewind(pwf); } -endpwent() { +int endpwent() { if (pwf != NULL) { fclose(pwf); pwf = NULL; @@ -43,9 +50,7 @@ endpwent() { } } -static char * -pwskip(p) -register char *p; { +static char *pwskip(p) register char *p; { while (*p && *p != ':' && *p != '\n') ++p; if (*p) @@ -53,8 +58,7 @@ register char *p; { return(p); } -struct passwd * -getpwent() { +struct passwd *getpwent() { register char *p; if (pwf == NULL) { @@ -85,7 +89,6 @@ getpwent() { return(&passwd); } -setpwfile(file) - char *file; { +int setpwfile(file) char *file; { _pw_file = file; } diff --git a/lib/libstdc/gen/getpwnamuid.c b/lib/libstdc/gen/getpwnamuid.c index 2091278..95468cc 100644 --- a/lib/libstdc/gen/getpwnamuid.c +++ b/lib/libstdc/gen/getpwnamuid.c @@ -1,3 +1,11 @@ +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +14,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpwnamuid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -24,9 +32,9 @@ extern char *_pw_file; DBM *_pw_db; int _pw_stayopen; -static struct passwd * -fetchpw(key) - datum key; { +static struct passwd *fetchpw __P((datum key)); + +static struct passwd *fetchpw(key) datum key; { register char *cp, *tp; if (key.dptr == 0) @@ -53,9 +61,7 @@ fetchpw(key) return (&passwd); } -struct passwd * -getpwnam(nam) - char *nam; { +struct passwd *getpwnam(nam) char *nam; { datum key; register struct passwd *pw; @@ -85,9 +91,7 @@ getpwnam(nam) return (pw); } -struct passwd * -getpwuid(uid) - int uid; { +struct passwd *getpwuid(uid) int uid; { datum key; register struct passwd *pw; diff --git a/lib/libstdc/gen/getttyent.c b/lib/libstdc/gen/getttyent.c index 6de3228..232a1fa 100644 --- a/lib/libstdc/gen/getttyent.c +++ b/lib/libstdc/gen/getttyent.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getttyent.c 5.4 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -19,14 +23,17 @@ static FILE *tf = NULL; static char line[LINE]; static struct ttyent tty; -setttyent() { +static char *skip __P((register char *p)); +static char *value __P((register char *p)); + +int setttyent() { if (tf == NULL) tf = fopen(TTYFILE, "r"); else rewind(tf); } -endttyent() { +int endttyent() { if (tf != NULL) { (void) fclose(tf); tf = NULL; @@ -39,9 +46,7 @@ endttyent() { * Skip over the current field, removing quotes, * and return a pointer to the next field. */ -static char * -skip(p) - register char *p; { +static char *skip(p) register char *p; { register char *t = p; register int c; register int q = 0; @@ -73,17 +78,14 @@ skip(p) return (p); } -static char * -value(p) - register char *p; { +static char *value(p) register char *p; { if ((p = index(p,'=')) == 0) return(NULL); p++; /* get past the = sign */ return(p); } -struct ttyent * -getttyent() { +struct ttyent *getttyent() { register char *p; register int c; diff --git a/lib/libstdc/gen/getttynam.c b/lib/libstdc/gen/getttynam.c index ce58f38..93d707e 100644 --- a/lib/libstdc/gen/getttynam.c +++ b/lib/libstdc/gen/getttynam.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +9,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getttynam.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -struct ttyent * -getttynam(tty) - char *tty; { +struct ttyent *getttynam(tty) char *tty; { register struct ttyent *t; setttyent(); diff --git a/lib/libstdc/gen/getusershell.c b/lib/libstdc/gen/getusershell.c index 52f0e22..dcc5adb 100644 --- a/lib/libstdc/gen/getusershell.c +++ b/lib/libstdc/gen/getusershell.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +12,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getusershell.c 5.4 (Berkeley) 7/25/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -24,13 +30,14 @@ static char *okshells[] = static char **shells, *strings; static char **curshell = NULL; -extern char **initshells(); +/*extern char **initshells();*/ /* * Get a list of shells from SHELLS, if it exists. */ -char * -getusershell() { +static char **initshells __P((void)); + +char *getusershell() { char *ret; if (curshell == NULL) @@ -41,7 +48,7 @@ getusershell() { return (ret); } -endusershell() { +int endusershell() { if (shells != NULL) free((char *)shells); @@ -52,13 +59,12 @@ endusershell() { curshell = NULL; } -setusershell() { +int setusershell() { curshell = initshells(); } -static char ** -initshells() { +static char **initshells() { register char **sp, *cp; register FILE *fp; struct stat statb; diff --git a/lib/libstdc/gen/getwd.c b/lib/libstdc/gen/getwd.c index ba1f95f..4b574b6 100644 --- a/lib/libstdc/gen/getwd.c +++ b/lib/libstdc/gen/getwd.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +12,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getwd.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * getwd() returns the pathname of the current working directory. On error @@ -18,12 +24,12 @@ static char sccsid[] = "@(#)getwd.c 5.2 (Berkeley) 3/9/86"; #define GETWDERR(s) strcpy(pathname, (s)); -char *strcpy(); +/*char *strcpy();*/ static int pathsize; /* pathname length */ -char * -getwd(pathname) - char *pathname; { +static char *prepend __P((register char *dirname, register char *pathname)); + +char *getwd(pathname) char *pathname; { char pathbuf[MAXPATHLEN]; /* temporary pathname buffer */ char *pnptr = &pathbuf[(sizeof pathbuf)-1]; /* pathname pointer */ char curdir[MAXPATHLEN]; /* current directory buffer */ @@ -97,10 +103,7 @@ getwd(pathname) /* * prepend() tacks a directory name onto the front of a pathname. */ -static char * -prepend(dirname, pathname) - register char *dirname; - register char *pathname; { +static char *prepend(dirname, pathname) register char *dirname; register char *pathname; { register int i; /* directory name size counter */ for (i = 0; *dirname != '\0'; i++, dirname++) diff --git a/lib/libstdc/gen/index.c b/lib/libstdc/gen/index.c index 66ecef2..0720e4f 100644 --- a/lib/libstdc/gen/index.c +++ b/lib/libstdc/gen/index.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)index.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Return the ptr in sp at which the character c appears; @@ -9,9 +11,7 @@ static char sccsid[] = "@(#)index.c 5.2 (Berkeley) 3/9/86"; #define NULL 0 -char * -index(sp, c) -register char *sp, c; { +char *index(sp, c) register char *sp; int c; { do { if (*sp == c) return(sp); diff --git a/lib/libstdc/gen/initgroups.c b/lib/libstdc/gen/initgroups.c index 62d5b84..623c095 100644 --- a/lib/libstdc/gen/initgroups.c +++ b/lib/libstdc/gen/initgroups.c @@ -1,3 +1,10 @@ +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +13,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)initgroups.c 5.3 (Berkeley) 4/27/86"; -#endif LIBC_SCCS and not lint +#endif /* * initgroups @@ -15,11 +22,9 @@ static char sccsid[] = "@(#)initgroups.c 5.3 (Berkeley) 4/27/86"; #include #include -struct group *getgrent(); +/*struct group *getgrent();*/ -initgroups(uname, agroup) - char *uname; - int agroup; { +int initgroups(uname, agroup) char *uname; int agroup; { int groups[NGROUPS], ngroups = 0; register struct group *grp; register int i; diff --git a/lib/libstdc/gen/insque.c b/lib/libstdc/gen/insque.c index 74c70c4..204aada 100644 --- a/lib/libstdc/gen/insque.c +++ b/lib/libstdc/gen/insque.c @@ -6,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; -#endif LIBC_SCCS and not lint +#endif #include @@ -22,8 +22,7 @@ static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; /* struct vaxque *vq_prev;*/ /*};*/ -insque(e, prev) - register struct vaxque *e, *prev; { +int insque(e, prev) register struct vaxque *e; register struct vaxque *prev; { e->vq_prev = prev; e->vq_next = prev->vq_next; prev->vq_next->vq_prev = e; diff --git a/lib/libstdc/gen/isatty.c b/lib/libstdc/gen/isatty.c index d293062..cd41d93 100644 --- a/lib/libstdc/gen/isatty.c +++ b/lib/libstdc/gen/isatty.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Returns 1 iff file is a tty @@ -8,7 +10,7 @@ static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; #include -isatty(f) { +int isatty(f) int f; { struct sgttyb ttyb; if (ioctl(f, TIOCGETP, &ttyb) < 0) diff --git a/lib/libstdc/gen/ldexp.c b/lib/libstdc/gen/ldexp.c index 89f638b..38edbd4 100644 --- a/lib/libstdc/gen/ldexp.c +++ b/lib/libstdc/gen/ldexp.c @@ -1,3 +1,6 @@ -double ldexp(v, e) double v; { +#include +#include + +double ldexp(v, e) double v; int e; { abort(); } diff --git a/lib/libstdc/gen/malloc.c b/lib/libstdc/gen/malloc.c index c63d8cb..3b827b7 100644 --- a/lib/libstdc/gen/malloc.c +++ b/lib/libstdc/gen/malloc.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +12,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)malloc.c 5.6 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * malloc.c (Caltech) 2/21/82 @@ -65,7 +71,7 @@ union overhead { */ #define NBUCKETS 30 static union overhead *nextf[NBUCKETS]; -extern char *sbrk(); +/*extern char *sbrk();*/ static int pagesz; /* page size */ static int pagebucket; /* page size bucket */ @@ -82,9 +88,10 @@ static u_int nmalloc[NBUCKETS]; #if defined(DEBUG) || defined(RCHECK) #define ASSERT(p) if (!(p)) botch("p") #include -static -botch(s) - char *s; { +static botch __P((char *s)); +static findbucket __P((union overhead *freep, int srchlen)); + +static botch(s) char *s; { fprintf(stderr, "\r\nassertion botched: %s\r\n", s); (void) fflush(stderr); /* just in case user buffered it */ abort(); @@ -93,9 +100,7 @@ botch(s) #define ASSERT(p) #endif -char * -malloc(nbytes) - unsigned nbytes; { +char *malloc(nbytes) unsigned nbytes; { register union overhead *op; register int bucket; register unsigned amt, n; @@ -177,8 +182,7 @@ malloc(nbytes) /* * Allocate more memory to the indicated bucket. */ -morecore(bucket) - int bucket; { +int morecore(bucket) int bucket; { register union overhead *op; register int sz; /* size of desired block */ int amt; /* amount to allocate */ @@ -217,8 +221,7 @@ morecore(bucket) } } -free(cp) - char *cp; { +int free(cp) char *cp; { register int size; register union overhead *op; @@ -257,10 +260,7 @@ free(cp) */ int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ -char * -realloc(cp, nbytes) - char *cp; - unsigned nbytes; { +char *realloc(cp, nbytes) char *cp; unsigned nbytes; { register u_int onb, i; union overhead *op; char *res; @@ -326,10 +326,7 @@ realloc(cp, nbytes) * header starts at ``freep''. If srchlen is -1 search the whole list. * Return bucket number, or -1 if not found. */ -static -findbucket(freep, srchlen) - union overhead *freep; - int srchlen; { +static findbucket(freep, srchlen) union overhead *freep; int srchlen; { register union overhead *p; register int i, j; @@ -352,8 +349,7 @@ findbucket(freep, srchlen) * for each size category, the second showing the number of mallocs - * frees for each size category. */ -mstats(s) - char *s; { +int mstats(s) char *s; { register int i, j; register union overhead *p; int totfree = 0, diff --git a/lib/libstdc/gen/mkstemp.c b/lib/libstdc/gen/mkstemp.c index f0fa5bd..5ec9fff 100644 --- a/lib/libstdc/gen/mkstemp.c +++ b/lib/libstdc/gen/mkstemp.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,12 +11,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mkstemp.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -mkstemp(as) - char *as; { +int mkstemp(as) char *as; { register char *s; register unsigned int pid; register int fd, i; diff --git a/lib/libstdc/gen/mktemp.c b/lib/libstdc/gen/mktemp.c index 47fbe2e..71e0612 100644 --- a/lib/libstdc/gen/mktemp.c +++ b/lib/libstdc/gen/mktemp.c @@ -1,10 +1,12 @@ +#include +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mktemp.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -char * -mktemp(as) -char *as; { +char *mktemp(as) char *as; { register char *s; register unsigned pid; register i; diff --git a/lib/libstdc/gen/modf.c b/lib/libstdc/gen/modf.c index aa81ceb..c917140 100644 --- a/lib/libstdc/gen/modf.c +++ b/lib/libstdc/gen/modf.c @@ -1,3 +1,6 @@ -double modf(v, p) double v, *p; { +#include +#include + +double modf(v, p) double v; double *p; { abort(); } diff --git a/lib/libstdc/gen/ndbm.c b/lib/libstdc/gen/ndbm.c index f51a60a..a022b2d 100644 --- a/lib/libstdc/gen/ndbm.c +++ b/lib/libstdc/gen/ndbm.c @@ -1,3 +1,14 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +17,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ndbm.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -18,15 +29,23 @@ static char sccsid[] = "@(#)ndbm.c 5.3 (Berkeley) 3/9/86"; #define BYTESIZ 8 #undef setbit -static datum makdatum(); -static long hashinc(); -static long dcalchash(); +/*static datum makdatum();*/ +/*static long hashinc();*/ +/*static long dcalchash();*/ extern int errno; -DBM * -dbm_open(file, flags, mode) - char *file; - int flags, mode; { +static dbm_access __P((register DBM *db, long hash)); +static getbit __P((register DBM *db)); +static setbit __P((register DBM *db)); +static datum makdatum __P((char buf[PBLKSIZ], int n)); +static finddatum __P((char buf[PBLKSIZ], datum item)); +static long hashinc __P((register DBM *db, long hash)); +static long dcalchash __P((datum item)); +static delitem __P((char buf[PBLKSIZ], int n)); +static additem __P((char buf[PBLKSIZ], datum item, datum item1)); +static chkblk __P((char buf[PBLKSIZ])); + +DBM *dbm_open(file, flags, mode) char *file; int flags; int mode; { struct stat statb; register DBM *db; @@ -58,19 +77,14 @@ bad: return ((DBM *)0); } -void -dbm_close(db) - DBM *db; { +void dbm_close(db) DBM *db; { (void) close(db->dbm_dirf); (void) close(db->dbm_pagf); free((char *)db); } -long -dbm_forder(db, key) - register DBM *db; - datum key; { +long dbm_forder(db, key) register DBM *db; datum key; { long hash; hash = dcalchash(key); @@ -83,10 +97,7 @@ dbm_forder(db, key) return (db->dbm_blkno); } -datum -dbm_fetch(db, key) - register DBM *db; - datum key; { +datum dbm_fetch(db, key) register DBM *db; datum key; { register i; datum item; @@ -104,9 +115,7 @@ err: return (item); } -dbm_delete(db, key) - register DBM *db; - datum key; { +int dbm_delete(db, key) register DBM *db; datum key; { register i; datum item; @@ -131,10 +140,7 @@ dbm_delete(db, key) return (0); } -dbm_store(db, key, dat, replace) - register DBM *db; - datum key, dat; - int replace; { +int dbm_store(db, key, dat, replace) register DBM *db; datum key; datum dat; int replace; { register i; datum item, item1; char ovfbuf[PBLKSIZ]; @@ -207,18 +213,14 @@ split: goto loop; } -datum -dbm_firstkey(db) - DBM *db; { +datum dbm_firstkey(db) DBM *db; { db->dbm_blkptr = 0L; db->dbm_keyptr = 0; return (dbm_nextkey(db)); } -datum -dbm_nextkey(db) - register DBM *db; { +datum dbm_nextkey(db) register DBM *db; { struct stat statb; datum item; @@ -253,10 +255,7 @@ err: return (item); } -static -dbm_access(db, hash) - register DBM *db; - long hash; { +static dbm_access(db, hash) register DBM *db; long hash; { for (db->dbm_hmask=0;; db->dbm_hmask=(db->dbm_hmask<<1)+1) { db->dbm_blkno = hash & db->dbm_hmask; @@ -276,9 +275,7 @@ dbm_access(db, hash) } } -static -getbit(db) - register DBM *db; { +static getbit(db) register DBM *db; { long bn; register b, i, n; @@ -298,9 +295,7 @@ getbit(db) return (db->dbm_dirbuf[i] & (1<dbm_flags |= _DBM_IOERR; } -static datum -makdatum(buf, n) - char buf[PBLKSIZ]; { +static datum makdatum(buf, n) char buf[PBLKSIZ]; int n; { register short *sp; register t; datum item; @@ -344,10 +337,7 @@ makdatum(buf, n) return (item); } -static -finddatum(buf, item) - char buf[PBLKSIZ]; - datum item; { +static finddatum(buf, item) char buf[PBLKSIZ]; datum item; { register short *sp; register int i, n, j; @@ -392,10 +382,7 @@ static long hltab[64] 04723077174L,03642763134L,05750130273L,03655541561L, }; -static long -hashinc(db, hash) - register DBM *db; - long hash; { +static long hashinc(db, hash) register DBM *db; long hash; { long bit; hash &= db->dbm_hmask; @@ -410,9 +397,7 @@ hashinc(db, hash) } } -static long -dcalchash(item) - datum item; { +static long dcalchash(item) datum item; { register int s, c, j; register char *cp; register long hashl; @@ -434,9 +419,7 @@ dcalchash(item) /* * Delete pairs of items (n & n+1). */ -static -delitem(buf, n) - char buf[PBLKSIZ]; { +static delitem(buf, n) char buf[PBLKSIZ]; int n; { register short *sp, *sp1; register i1, i2; @@ -465,10 +448,7 @@ delitem(buf, n) /* * Add pairs of items (item & item1). */ -static -additem(buf, item, item1) - char buf[PBLKSIZ]; - datum item, item1; { +static additem(buf, item, item1) char buf[PBLKSIZ]; datum item; datum item1; { register short *sp; register i1, i2; @@ -489,9 +469,7 @@ additem(buf, item, item1) } #ifdef DEBUG -static -chkblk(buf) - char buf[PBLKSIZ]; { +static chkblk(buf) char buf[PBLKSIZ]; { register short *sp; register t, i; diff --git a/lib/libstdc/gen/nlist.c b/lib/libstdc/gen/nlist.c index f253b01..3244730 100644 --- a/lib/libstdc/gen/nlist.c +++ b/lib/libstdc/gen/nlist.c @@ -1,3 +1,10 @@ +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +13,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)nlist.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -15,9 +22,7 @@ static char sccsid[] = "@(#)nlist.c 5.2 (Berkeley) 3/9/86"; /* * nlist - retreive attributes from name list (string table version) */ -nlist(name, list) - char *name; - struct nlist *list; { +int nlist(name, list) char *name; struct nlist *list; { register struct nlist *p, *q; register char *s1, *s2; register n, m; diff --git a/lib/libstdc/gen/opendir.c b/lib/libstdc/gen/opendir.c index 164f5eb..03df69f 100644 --- a/lib/libstdc/gen/opendir.c +++ b/lib/libstdc/gen/opendir.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)opendir.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -14,9 +18,7 @@ static char sccsid[] = "@(#)opendir.c 5.2 (Berkeley) 3/9/86"; /* * open a directory. */ -DIR * -opendir(name) - char *name; { +DIR *opendir(name) char *name; { register DIR *dirp; register int fd; diff --git a/lib/libstdc/gen/perror.c b/lib/libstdc/gen/perror.c index 957f2d5..f4fb948 100644 --- a/lib/libstdc/gen/perror.c +++ b/lib/libstdc/gen/perror.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)perror.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Print the error indicated @@ -18,8 +22,7 @@ static char sccsid[] = "@(#)perror.c 5.2 (Berkeley) 3/9/86"; int errno; int sys_nerr; char *sys_errlist[]; -perror(s) - char *s; { +int perror(s) char *s; { struct iovec iov[4]; register struct iovec *v = iov; diff --git a/lib/libstdc/gen/psignal.c b/lib/libstdc/gen/psignal.c index 5221cdf..72eca66 100644 --- a/lib/libstdc/gen/psignal.c +++ b/lib/libstdc/gen/psignal.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)psignal.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Print the name of the signal indicated @@ -16,9 +21,7 @@ static char sccsid[] = "@(#)psignal.c 5.2 (Berkeley) 3/9/86"; extern char *sys_siglist[]; -psignal(sig, s) - unsigned sig; - char *s; { +int psignal(sig, s) unsigned sig; char *s; { register char *c; register n; diff --git a/lib/libstdc/gen/qsort.c b/lib/libstdc/gen/qsort.c index 5904068..e9b38c8 100644 --- a/lib/libstdc/gen/qsort.c +++ b/lib/libstdc/gen/qsort.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +8,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)qsort.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * qsort.c: @@ -32,11 +34,9 @@ static int mthresh; /* MTHRESHold in chars */ * It's not... */ -qsort(base, n, size, compar) - char *base; - int n; - int size; - int (*compar)(); { +static qst __P((char *base, char *max)); + +int qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); { register char c, *i, *j, *lo, *hi; char *min, *max; @@ -106,9 +106,7 @@ qsort(base, n, size, compar) * (And there are only three places where this is done). */ -static -qst(base, max) - char *base, *max; { +static qst(base, max) char *base; char *max; { register char c, *i, *j, *jj; register int ii; char *mid, *tmp; diff --git a/lib/libstdc/gen/random.c b/lib/libstdc/gen/random.c index cc68148..f6da76b 100644 --- a/lib/libstdc/gen/random.c +++ b/lib/libstdc/gen/random.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)random.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include @@ -47,8 +50,6 @@ static char sccsid[] = "@(#)random.c 5.2 (Berkeley) 3/9/86"; * predicted by this formula. */ - - /* * For each of the currently supported random number generators, we have a * break value on the amount of state information (you need at least this @@ -82,7 +83,6 @@ static char sccsid[] = "@(#)random.c 5.2 (Berkeley) 3/9/86"; #define DEG_4 63 #define SEP_4 1 - /* * Array versions of the above information to make code run faster -- relies * on fact that TYPE_i == i. @@ -96,8 +96,6 @@ static int degrees[ MAX_TYPES ] = { DEG_0, DEG_1, DEG_2, static int seps[ MAX_TYPES ] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; - - /* * Initially, everything is set up as if from : * initstate( 1, &randtbl, 128 ); @@ -134,8 +132,6 @@ static long randtbl[ DEG_3 + 1 ] = { TYPE_3, static long *fptr = &randtbl[ SEP_3 + 1 ]; static long *rptr = &randtbl[ 1 ]; - - /* * The following things are the pointer to the state information table, * the type of the current generator, the degree of the current polynomial @@ -156,8 +152,6 @@ static int rand_sep = SEP_3; static long *end_ptr = &randtbl[ DEG_3 + 1 ]; - - /* * srandom: * Initialize the random number generator based on the given seed. If the @@ -171,9 +165,7 @@ static long *end_ptr = &randtbl[ DEG_3 + 1 ]; * values produced by this routine. */ -srandom( x ) - - unsigned x; { +int srandom(x) unsigned x; { register int i, j; if( rand_type == TYPE_0 ) { @@ -191,8 +183,6 @@ srandom( x ) } } - - /* * initstate: * Initialize the state information in the given array of n bytes for @@ -209,12 +199,7 @@ srandom( x ) * Returns a pointer to the old state. */ -char * -initstate( seed, arg_state, n ) - - unsigned seed; /* seed for R. N. G. */ - char *arg_state; /* pointer to state array */ - int n; /* # bytes of state info */ { +char *initstate(seed, arg_state, n) unsigned seed; /* seed for R. N. G. */ char *arg_state; /* pointer to state array */ int n; /* # bytes of state info */ { register char *ostate = (char *)( &state[ -1 ] ); if( rand_type == TYPE_0 ) state[ -1 ] = rand_type; @@ -262,8 +247,6 @@ initstate( seed, arg_state, n ) return( ostate ); } - - /* * setstate: * Restore the state from the given state array. @@ -276,10 +259,7 @@ initstate( seed, arg_state, n ) * Returns a pointer to the old state information. */ -char * -setstate( arg_state ) - - char *arg_state; { +char *setstate(arg_state) char *arg_state; { register long *new_state = (long *)arg_state; register int type = new_state[0]%MAX_TYPES; register int rear = new_state[0]/MAX_TYPES; @@ -310,8 +290,6 @@ setstate( arg_state ) return( ostate ); } - - /* * random: * If we are using the trivial TYPE_0 R.N.G., just do the old linear @@ -327,8 +305,7 @@ setstate( arg_state ) * Returns a 31-bit random number. */ -long -random() { +long random() { long i; if( rand_type == TYPE_0 ) { @@ -347,4 +324,3 @@ random() { } return( i ); } - diff --git a/lib/libstdc/gen/readdir.c b/lib/libstdc/gen/readdir.c index 558d743..807ecbb 100644 --- a/lib/libstdc/gen/readdir.c +++ b/lib/libstdc/gen/readdir.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)readdir.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -14,9 +17,7 @@ static char sccsid[] = "@(#)readdir.c 5.2 (Berkeley) 3/9/86"; /* * get next entry in a directory. */ -struct direct * -readdir(dirp) - register DIR *dirp; { +struct direct *readdir(dirp) register DIR *dirp; { register struct direct *dp; for (;;) { diff --git a/lib/libstdc/gen/regex.c b/lib/libstdc/gen/regex.c index b506edf..0e15415 100644 --- a/lib/libstdc/gen/regex.c +++ b/lib/libstdc/gen/regex.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,9 +8,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)regex.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint - -# +#endif /* * routines to do regular expression matching @@ -99,9 +99,9 @@ static char circf; /* * compile the regular expression argument into a dfa */ -char * -re_comp(sp) - register char *sp; { +static int advance __P((register char *lp, register char *ep)); + +char *re_comp(sp) register char *sp; { register int c; register char *ep = expbuf; int cclcnt, numbra = 0; @@ -222,9 +222,7 @@ re_comp(sp) /* * match the argument string against the compiled re */ -int -re_exec(p1) - register char *p1; { +int re_exec(p1) register char *p1; { register char *p2 = expbuf; register int c; int rv; @@ -261,9 +259,7 @@ re_exec(p1) /* * try to match the next thing in the dfa */ -static int -advance(lp, ep) - register char *lp, *ep; { +static int advance(lp, ep) register char *lp; register char *ep; { register char *curlp; int ct, i; int rv; @@ -368,9 +364,7 @@ advance(lp, ep) } } -backref(i, lp) - register int i; - register char *lp; { +int backref(i, lp) register int i; register char *lp; { register char *bp; bp = braslist[i]; @@ -380,10 +374,7 @@ backref(i, lp) return(0); } -int -cclass(set, c, af) - register char *set, c; - int af; { +int cclass(set, c, af) register char *set; int c; int af; { register int n; if (c == 0) diff --git a/lib/libstdc/gen/remque.c b/lib/libstdc/gen/remque.c index 7217469..ef34b19 100644 --- a/lib/libstdc/gen/remque.c +++ b/lib/libstdc/gen/remque.c @@ -6,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; -#endif LIBC_SCCS and not lint +#endif #include @@ -22,8 +22,7 @@ static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; /* struct vaxque *vq_prev;*/ /*};*/ -remque(e) - register struct vaxque *e; { +int remque(e) register struct vaxque *e; { e->vq_prev->vq_next = e->vq_next; e->vq_next->vq_prev = e->vq_prev; } diff --git a/lib/libstdc/gen/rindex.c b/lib/libstdc/gen/rindex.c index ee23c69..7ac2bf9 100644 --- a/lib/libstdc/gen/rindex.c +++ b/lib/libstdc/gen/rindex.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rindex.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Return the ptr in sp at which the character c last @@ -9,9 +11,7 @@ static char sccsid[] = "@(#)rindex.c 5.2 (Berkeley) 3/9/86"; #define NULL 0 -char * -rindex(sp, c) -register char *sp, c; { +char *rindex(sp, c) register char *sp; int c; { register char *r; r = NULL; diff --git a/lib/libstdc/gen/scandir.c b/lib/libstdc/gen/scandir.c index fb76d34..073e767 100644 --- a/lib/libstdc/gen/scandir.c +++ b/lib/libstdc/gen/scandir.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)scandir.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Scan the directory dirname calling select to make a list of selected @@ -19,10 +24,7 @@ static char sccsid[] = "@(#)scandir.c 5.2 (Berkeley) 3/9/86"; #include #include -scandir(dirname, namelist, select, dcomp) - char *dirname; - struct direct *(*namelist[]); - int (*select)(), (*dcomp)(); { +int scandir(dirname, namelist, select, dcomp) char *dirname; struct direct *(*namelist[]); int (*select)(); int (*dcomp)(); { register struct direct *d, *p, **names; register int nitems; register char *cp1, *cp2; @@ -83,7 +85,6 @@ scandir(dirname, namelist, select, dcomp) /* * Alphabetic order comparison routine for those who want it. */ -alphasort(d1, d2) - struct direct **d1, **d2; { +int alphasort(d1, d2) struct direct **d1; struct direct **d2; { return(strcmp((*d1)->d_name, (*d2)->d_name)); } diff --git a/lib/libstdc/gen/seekdir.c b/lib/libstdc/gen/seekdir.c index 3d85802..6f698ed 100644 --- a/lib/libstdc/gen/seekdir.c +++ b/lib/libstdc/gen/seekdir.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)seekdir.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -15,10 +18,7 @@ static char sccsid[] = "@(#)seekdir.c 5.2 (Berkeley) 3/9/86"; * seek to an entry in a directory. * Only values returned by "telldir" should be passed to seekdir. */ -void -seekdir(dirp, loc) - register DIR *dirp; - long loc; { +void seekdir(dirp, loc) register DIR *dirp; long loc; { long curloc, base, offset; struct direct *dp; extern long lseek(); diff --git a/lib/libstdc/gen/setegid.c b/lib/libstdc/gen/setegid.c index d616b47..0329fc8 100644 --- a/lib/libstdc/gen/setegid.c +++ b/lib/libstdc/gen/setegid.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,10 +8,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setegid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -setegid(egid) - int egid; { +int setegid(egid) int egid; { return (setregid(-1, egid)); } diff --git a/lib/libstdc/gen/seteuid.c b/lib/libstdc/gen/seteuid.c index 0971619..d2e8164 100644 --- a/lib/libstdc/gen/seteuid.c +++ b/lib/libstdc/gen/seteuid.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,10 +8,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)seteuid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -seteuid(euid) - int euid; { +int seteuid(euid) int euid; { return (setreuid(-1, euid)); } diff --git a/lib/libstdc/gen/setgid.c b/lib/libstdc/gen/setgid.c index 2d8105a..29ed6f6 100644 --- a/lib/libstdc/gen/setgid.c +++ b/lib/libstdc/gen/setgid.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +8,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setgid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Backwards compatible setgid. */ -setgid(gid) - int gid; { +int setgid(gid) int gid; { return (setregid(gid, gid)); } diff --git a/lib/libstdc/gen/setjmp.c b/lib/libstdc/gen/setjmp.c index 70c96d0..4514ba1 100644 --- a/lib/libstdc/gen/setjmp.c +++ b/lib/libstdc/gen/setjmp.c @@ -1,7 +1,10 @@ +#include #include + +/*#include */ int setjmp(e) jmp_buf e; { abort(); } -void longjmp(e, v) jmp_buf e; { +void longjmp(e, v) jmp_buf e; int v; { abort(); } diff --git a/lib/libstdc/gen/setjmperr.c b/lib/libstdc/gen/setjmperr.c index 17226fe..14a2d5d 100644 --- a/lib/libstdc/gen/setjmperr.c +++ b/lib/libstdc/gen/setjmperr.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setjmperr.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #define ERRMSG "longjmp botch\n" @@ -16,7 +19,7 @@ static char sccsid[] = "@(#)setjmperr.c 5.2 (Berkeley) 3/9/86"; * write their own versions. * If this routine returns, the program is aborted. */ -longjmperror() { +int longjmperror() { write(2, ERRMSG, sizeof(ERRMSG)); } diff --git a/lib/libstdc/gen/setrgid.c b/lib/libstdc/gen/setrgid.c index baadb80..0bb3d1c 100644 --- a/lib/libstdc/gen/setrgid.c +++ b/lib/libstdc/gen/setrgid.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,10 +8,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setrgid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -setrgid(rgid) - int rgid; { +int setrgid(rgid) int rgid; { return (setregid(rgid, -1)); } diff --git a/lib/libstdc/gen/setruid.c b/lib/libstdc/gen/setruid.c index 9ec97bd..53c1dba 100644 --- a/lib/libstdc/gen/setruid.c +++ b/lib/libstdc/gen/setruid.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,10 +8,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setruid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -setruid(ruid) - int ruid; { +int setruid(ruid) int ruid; { return (setreuid(ruid, -1)); } diff --git a/lib/libstdc/gen/setuid.c b/lib/libstdc/gen/setuid.c index f9ab372..880b813 100644 --- a/lib/libstdc/gen/setuid.c +++ b/lib/libstdc/gen/setuid.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +8,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setuid.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Backwards compatible setuid. */ -setuid(uid) - int uid; { +int setuid(uid) int uid; { return (setreuid(uid, uid)); } diff --git a/lib/libstdc/gen/siginterrupt.c b/lib/libstdc/gen/siginterrupt.c index 2616252..2e53205 100644 --- a/lib/libstdc/gen/siginterrupt.c +++ b/lib/libstdc/gen/siginterrupt.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)siginterrupt.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include @@ -14,8 +17,7 @@ static char sccsid[] = "@(#)siginterrupt.c 5.2 (Berkeley) 3/9/86"; * Set signal state to prevent restart of system calls * after an instance of the indicated signal. */ -siginterrupt(sig, flag) - int sig, flag; { +int siginterrupt(sig, flag) int sig; int flag; { struct sigvec sv; int ret; diff --git a/lib/libstdc/gen/siglist.c b/lib/libstdc/gen/siglist.c index 276e5fc..0b912f7 100644 --- a/lib/libstdc/gen/siglist.c +++ b/lib/libstdc/gen/siglist.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)siglist.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include diff --git a/lib/libstdc/gen/signal.c b/lib/libstdc/gen/signal.c index 727f9c0..86dbb39 100644 --- a/lib/libstdc/gen/signal.c +++ b/lib/libstdc/gen/signal.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,16 +9,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)signal.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Almost backwards compatible signal. */ #include -int (* -signal(s, a))() - int s, (*a)(); { +int (*signal(s, a))() int s; int (*a)(); { struct sigvec osv, sv; static int mask[NSIG]; static int flags[NSIG]; diff --git a/lib/libstdc/gen/sleep.c b/lib/libstdc/gen/sleep.c index 38933e8..3d6eca3 100644 --- a/lib/libstdc/gen/sleep.c +++ b/lib/libstdc/gen/sleep.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sleep.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -16,8 +20,9 @@ static char sccsid[] = "@(#)sleep.c 5.2 (Berkeley) 3/9/86"; static int ringring; -sleep(n) - unsigned n; { +static sleepx __P((void)); + +int sleep(n) unsigned n; { int sleepx(), omask; struct itimerval itv, oitv; register struct itimerval *itp = &itv; @@ -57,8 +62,7 @@ sleep(n) (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); } -static -sleepx() { +static sleepx() { ringring = 1; } diff --git a/lib/libstdc/gen/strcat.c b/lib/libstdc/gen/strcat.c index 0450b8b..aed1f8d 100644 --- a/lib/libstdc/gen/strcat.c +++ b/lib/libstdc/gen/strcat.c @@ -1,15 +1,15 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcat.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Concatenate s2 on the end of s1. S1's space must be large enough. * Return s1. */ -char * -strcat(s1, s2) -register char *s1, *s2; { +char *strcat(s1, s2) register char *s1; register char *s2; { register char *os1; os1 = s1; diff --git a/lib/libstdc/gen/strcmp.c b/lib/libstdc/gen/strcmp.c index 4502d8c..921f505 100644 --- a/lib/libstdc/gen/strcmp.c +++ b/lib/libstdc/gen/strcmp.c @@ -1,13 +1,14 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcmp.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Compare strings: s1>s2: >0 s1==s2: 0 s1 + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcpy.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Copy string s2 to s1. s1 must be large enough. * return s1 */ -char * -strcpy(s1, s2) -register char *s1, *s2; { +char *strcpy(s1, s2) register char *s1; register char *s2; { register char *os1; os1 = s1; diff --git a/lib/libstdc/gen/strlen.c b/lib/libstdc/gen/strlen.c index 38e1e89..d613ea7 100644 --- a/lib/libstdc/gen/strlen.c +++ b/lib/libstdc/gen/strlen.c @@ -1,14 +1,15 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strlen.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Returns the number of * non-NULL bytes in string argument. */ -strlen(s) -register char *s; { +int strlen(s) register char *s; { register n; n = 0; diff --git a/lib/libstdc/gen/strncat.c b/lib/libstdc/gen/strncat.c index ffe3c04..b8e4605 100644 --- a/lib/libstdc/gen/strncat.c +++ b/lib/libstdc/gen/strncat.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strncat.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Concatenate s2 on the end of s1. S1's space must be large enough. @@ -8,10 +10,7 @@ static char sccsid[] = "@(#)strncat.c 5.2 (Berkeley) 3/9/86"; * Return s1. */ -char * -strncat(s1, s2, n) -register char *s1, *s2; -register n; { +char *strncat(s1, s2, n) register char *s1; register char *s2; register n; { register char *os1; os1 = s1; diff --git a/lib/libstdc/gen/strncmp.c b/lib/libstdc/gen/strncmp.c index 82c1f6e..5fd5beb 100644 --- a/lib/libstdc/gen/strncmp.c +++ b/lib/libstdc/gen/strncmp.c @@ -1,14 +1,14 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strncmp.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) if (*s1++ == '\0') diff --git a/lib/libstdc/gen/strncpy.c b/lib/libstdc/gen/strncpy.c index 6993c69..2f46479 100644 --- a/lib/libstdc/gen/strncpy.c +++ b/lib/libstdc/gen/strncpy.c @@ -1,15 +1,15 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strncpy.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ -char * -strncpy(s1, s2, n) -register char *s1, *s2; { +char *strncpy(s1, s2, n) register char *s1; register char *s2; int n; { register i; register char *os1; diff --git a/lib/libstdc/gen/swab.c b/lib/libstdc/gen/swab.c index 458a0fc..289f39d 100644 --- a/lib/libstdc/gen/swab.c +++ b/lib/libstdc/gen/swab.c @@ -1,15 +1,15 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)swab.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Swab bytes * Jeffrey Mogul, Stanford */ -swab(from, to, n) - register char *from, *to; - register int n; { +int swab(from, to, n) register char *from; register char *to; register int n; { register unsigned long temp; n >>= 1; n++; diff --git a/lib/libstdc/gen/syslog.c b/lib/libstdc/gen/syslog.c index 5559d36..d410beb 100644 --- a/lib/libstdc/gen/syslog.c +++ b/lib/libstdc/gen/syslog.c @@ -1,3 +1,17 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +20,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)syslog.c 5.9 (Berkeley) 5/7/86"; -#endif LIBC_SCCS and not lint +#endif /* * SYSLOG -- print message on log file @@ -54,9 +68,7 @@ static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */ extern int errno, sys_nerr; extern char *sys_errlist[]; -syslog(pri, fmt, p0, p1, p2, p3, p4) - int pri; - char *fmt; { +int syslog(pri, fmt, p0, p1, p2, p3, p4) int pri; char *fmt; int p0; int p1; int p2; int p3; int p4; { char buf[MAXLINE + 1], outline[MAXLINE + 1]; register char *b, *f, *o; register int c; @@ -151,9 +163,7 @@ syslog(pri, fmt, p0, p1, p2, p3, p4) * OPENLOG -- open system log */ -openlog(ident, logstat, logfac) - char *ident; - int logstat, logfac; { +int openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; { if (ident != NULL) LogTag = ident; LogStat = logstat; @@ -173,7 +183,7 @@ openlog(ident, logstat, logfac) * CLOSELOG -- close the system log */ -closelog() { +int closelog() { (void) close(LogFile); LogFile = -1; @@ -182,8 +192,7 @@ closelog() { /* * SETLOGMASK -- set the log mask level */ -setlogmask(pmask) - int pmask; { +int setlogmask(pmask) int pmask; { int omask; omask = LogMask; diff --git a/lib/libstdc/gen/system.c b/lib/libstdc/gen/system.c index 3222c83..faf5940 100644 --- a/lib/libstdc/gen/system.c +++ b/lib/libstdc/gen/system.c @@ -1,11 +1,16 @@ +#include +#include +#include +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)system.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -system(s) -char *s; { +int system(s) char *s; { int status, pid, w; register int (*istat)(), (*qstat)(); diff --git a/lib/libstdc/gen/telldir.c b/lib/libstdc/gen/telldir.c index 71ac953..841a348 100644 --- a/lib/libstdc/gen/telldir.c +++ b/lib/libstdc/gen/telldir.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)telldir.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -14,9 +17,7 @@ static char sccsid[] = "@(#)telldir.c 5.2 (Berkeley) 3/9/86"; /* * return a pointer into a directory */ -long -telldir(dirp) - DIR *dirp; { +long telldir(dirp) DIR *dirp; { extern long lseek(); return (lseek(dirp->dd_fd, 0L, 1) - dirp->dd_size + dirp->dd_loc); diff --git a/lib/libstdc/gen/time.c b/lib/libstdc/gen/time.c index 181493d..107777b 100644 --- a/lib/libstdc/gen/time.c +++ b/lib/libstdc/gen/time.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)time.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Backwards compatible time call. @@ -14,9 +17,7 @@ static char sccsid[] = "@(#)time.c 5.3 (Berkeley) 3/9/86"; #include #include -long -time(t) - time_t *t; { +long time(t) time_t *t; { struct timeval tt; if (gettimeofday(&tt, (struct timezone *)0) < 0) diff --git a/lib/libstdc/gen/timezone.c b/lib/libstdc/gen/timezone.c index f0ef2bb..8c35881 100644 --- a/lib/libstdc/gen/timezone.c +++ b/lib/libstdc/gen/timezone.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)timezone.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * The arguments are the number of minutes of time @@ -40,7 +44,7 @@ static struct zone { -1 }; -char *timezone(zone, dst) { +char *timezone(zone, dst) int zone; int dst; { register struct zone *zp; static char czone[10]; char *sign; diff --git a/lib/libstdc/gen/ttyname.c b/lib/libstdc/gen/ttyname.c index 6b876dd..7c1ac4b 100644 --- a/lib/libstdc/gen/ttyname.c +++ b/lib/libstdc/gen/ttyname.c @@ -1,6 +1,12 @@ +#include +#include +#include +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ttyname.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * ttyname(f): return "/dev/ttyXX" which the the name of the @@ -14,11 +20,10 @@ static char sccsid[] = "@(#)ttyname.c 5.2 (Berkeley) 3/9/86"; #include static char dev[] = "/dev/"; -char *strcpy(); -char *strcat(); +/*char *strcpy();*/ +/*char *strcat();*/ -char * -ttyname(f) { +char *ttyname(f) int f; { struct stat fsb; struct stat tsb; register struct direct *db; diff --git a/lib/libstdc/gen/ttyslot.c b/lib/libstdc/gen/ttyslot.c index 2f74321..f885177 100644 --- a/lib/libstdc/gen/ttyslot.c +++ b/lib/libstdc/gen/ttyslot.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1984 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ttyslot.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Return the number of the slot in the utmp file @@ -15,12 +19,12 @@ static char sccsid[] = "@(#)ttyslot.c 5.2 (Berkeley) 3/9/86"; */ #include -char *ttyname(); -char *rindex(); +/*char *ttyname();*/ +/*char *rindex();*/ #define NULL 0 -ttyslot() { +int ttyslot() { register struct ttyent *ty; register char *tp, *p; register s; diff --git a/lib/libstdc/gen/ualarm.c b/lib/libstdc/gen/ualarm.c index a975719..847cf51 100644 --- a/lib/libstdc/gen/ualarm.c +++ b/lib/libstdc/gen/ualarm.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +8,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ualarm.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include @@ -17,10 +19,7 @@ static char sccsid[] = "@(#)ualarm.c 5.2 (Berkeley) 3/9/86"; * If ``reload'' is non-zero, keep generating SIGALRM * every ``reload'' microseconds after the first signal. */ -unsigned -ualarm(usecs, reload) - register unsigned usecs; - register unsigned reload; { +unsigned ualarm(usecs, reload) register unsigned usecs; register unsigned reload; { struct itimerval new, old; new.it_interval.tv_usec = reload % USPS; diff --git a/lib/libstdc/gen/usleep.c b/lib/libstdc/gen/usleep.c index 8d05954..5001b7b 100644 --- a/lib/libstdc/gen/usleep.c +++ b/lib/libstdc/gen/usleep.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)usleep.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -19,8 +23,9 @@ static char sccsid[] = "@(#)usleep.c 5.2 (Berkeley) 3/9/86"; static int ringring; -usleep(n) - unsigned n; { +static sleepx __P((void)); + +int usleep(n) unsigned n; { int sleepx(), omask; struct itimerval itv, oitv; register struct itimerval *itp = &itv; @@ -60,8 +65,7 @@ usleep(n) (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); } -static -sleepx() { +static sleepx() { ringring = 1; } diff --git a/lib/libstdc/gen/valloc.c b/lib/libstdc/gen/valloc.c index 795ef45..3d71ca5 100644 --- a/lib/libstdc/gen/valloc.c +++ b/lib/libstdc/gen/valloc.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +9,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)valloc.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -char *malloc(); +/*char *malloc();*/ -char * -valloc(i) - int i; { +char *valloc(i) int i; { int valsiz = getpagesize(), j; char *cp = malloc(i + (valsiz-1)); diff --git a/lib/libstdc/groups.txt b/lib/libstdc/groups.txt index 2a484ba..96ba185 100644 --- a/lib/libstdc/groups.txt +++ b/lib/libstdc/groups.txt @@ -32,7 +32,7 @@ csu/mon.c gen/abort.c gen/abs.c gen/alarm.c sys/time.h -gen/atof.c +gen/atof.c math.h gen/atoi.c gen/atol.c gen/bcmp.c @@ -49,7 +49,7 @@ gen/errlst.c gen/execvp.c sys/exec.h gen/fakcu.c gen/ffs.c -gen/frexp.c +gen/frexp.c math.h gen/fstab.c fstab.h gen/gcvt.c gen/getenv.c @@ -68,16 +68,15 @@ gen/index.c strings.h gen/initgroups.c grp.h gen/insque.c gen/isatty.c sys/ioctl.h -gen/ldexp.c +gen/ldexp.c math.h gen/malloc.c gen/mkstemp.c gen/mktemp.c -gen/modf.c +gen/modf.c math.h 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 stdio.h gen/psignal.c sys/signal.h gen/qsort.c gen/random.c @@ -118,12 +117,12 @@ gen/ttyslot.c utmp.h gen/ualarm.c sys/time.h gen/usleep.c sys/time.h gen/valloc.c -inet/inet_addr.c netinet/in.h -inet/inet_lnaof.c netinet/in.h -inet/inet_makeaddr.c netinet/in.h -inet/inet_netof.c netinet/in.h -inet/inet_network.c netinet/in.h -inet/inet_ntoa.c netinet/in.h +inet/inet_addr.c arpa/inet.h +inet/inet_lnaof.c arpa/inet.h +inet/inet_makeaddr.c arpa/inet.h +inet/inet_netof.c arpa/inet.h +inet/inet_network.c arpa/inet.h +inet/inet_ntoa.c arpa/inet.h net/getnetbyaddr.c netdb.h net/getnetbyname.c netdb.h net/getnetent.c netdb.h @@ -142,11 +141,11 @@ net/named/sethostent.c netdb.h net/ntohl.c net/ntohs.c net/rcmd.c -net/res_comp.c resolv.h -net/res_debug.c resolv.h -net/res_init.c resolv.h -net/res_mkquery.c resolv.h -net/res_send.c resolv.h +net/res_comp.c arpa/nameser.h +net/res_debug.c arpa/nameser.h +net/res_init.c arpa/nameser.h +net/res_mkquery.c arpa/nameser.h +net/res_send.c arpa/nameser.h net/rexec.c net/ruserpass.c ns/ns_addr.c netns/ns.h @@ -173,6 +172,7 @@ stdio/fwrite.c stdio/getchar.c stdio/gets.c stdio/getw.c +stdio/popen.c stdio/printf.c stdio/putchar.c stdio/puts.c diff --git a/lib/libstdc/grp.h b/lib/libstdc/grp.h index f053f22..3e85061 100644 --- a/lib/libstdc/grp.h +++ b/lib/libstdc/grp.h @@ -1,3 +1,6 @@ +#ifndef _GRP_H_ +#define _GRP_H_ + /* grp.h 4.1 83/05/03 */ struct group { /* see getgrent(3) */ @@ -7,4 +10,28 @@ struct group { /* see getgrent(3) */ char **gr_mem; }; -struct group *getgrent(), *getgrgid(), *getgrnam(); +/*struct group *getgrent(), *getgrgid(), *getgrnam();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/getgrent.c */ +int setgrent __P((void)); +int endgrent __P((void)); +struct group *getgrent __P((void)); + +/* gen/getgrgid.c */ +struct group *getgrgid __P((register gid)); + +/* gen/getgrnam.c */ +struct group *getgrnam __P((register char *name)); + +/* gen/initgroups.c */ +int initgroups __P((char *uname, int agroup)); + +#endif diff --git a/lib/libstdc/inet.h b/lib/libstdc/inet.h new file mode 100644 index 0000000..be7a8b0 --- /dev/null +++ b/lib/libstdc/inet.h @@ -0,0 +1,6 @@ +#ifndef _INET_H_ +#define _INET_H_ + +#include + +#endif diff --git a/lib/libstdc/inet/inet_addr.c b/lib/libstdc/inet/inet_addr.c index 52949aa..c13b71e 100644 --- a/lib/libstdc/inet/inet_addr.c +++ b/lib/libstdc/inet/inet_addr.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_addr.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -19,9 +24,7 @@ static char sccsid[] = "@(#)inet_addr.c 5.2 (Berkeley) 3/9/86"; * which are expected to be an address. * The value returned is in network order. */ -u_long -inet_addr(cp) - register char *cp; { +u_long inet_addr(cp) register char *cp; { register u_long val, base, n; register char c; u_long parts[4], *pp = parts; diff --git a/lib/libstdc/inet/inet_lnaof.c b/lib/libstdc/inet/inet_lnaof.c index 2c76b68..f68477d 100644 --- a/lib/libstdc/inet/inet_lnaof.c +++ b/lib/libstdc/inet/inet_lnaof.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_lnaof.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -16,8 +21,7 @@ static char sccsid[] = "@(#)inet_lnaof.c 5.2 (Berkeley) 3/9/86"; * internet address; handles class a/b/c network * number formats. */ -inet_lnaof(in) - struct in_addr in; { +int inet_lnaof(in) struct in_addr in; { register u_long i = ntohl(in.s_addr); if (IN_CLASSA(i)) diff --git a/lib/libstdc/inet/inet_makeaddr.c b/lib/libstdc/inet/inet_makeaddr.c index 70801ae..ffd9ec6 100644 --- a/lib/libstdc/inet/inet_makeaddr.c +++ b/lib/libstdc/inet/inet_makeaddr.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_makeaddr.c 5.1 (Berkeley) 3/11/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -15,9 +20,7 @@ static char sccsid[] = "@(#)inet_makeaddr.c 5.1 (Berkeley) 3/11/86"; * Formulate an Internet address from network + host. Used in * building addresses stored in the ifnet structure. */ -struct in_addr -inet_makeaddr(net, host) - int net, host; { +struct in_addr inet_makeaddr(net, host) int net; int host; { u_long addr; if (net < 128) diff --git a/lib/libstdc/inet/inet_netof.c b/lib/libstdc/inet/inet_netof.c index a56e690..5d0ea7f 100644 --- a/lib/libstdc/inet/inet_netof.c +++ b/lib/libstdc/inet/inet_netof.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_netof.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -15,8 +20,7 @@ static char sccsid[] = "@(#)inet_netof.c 5.2 (Berkeley) 3/9/86"; * Return the network number from an internet * address; handles class a/b/c network #'s. */ -inet_netof(in) - struct in_addr in; { +int inet_netof(in) struct in_addr in; { register u_long i = ntohl(in.s_addr); if (IN_CLASSA(i)) diff --git a/lib/libstdc/inet/inet_network.c b/lib/libstdc/inet/inet_network.c index 8440d3c..7a696c2 100644 --- a/lib/libstdc/inet/inet_network.c +++ b/lib/libstdc/inet/inet_network.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_network.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -16,9 +20,7 @@ static char sccsid[] = "@(#)inet_network.c 5.2 (Berkeley) 3/9/86"; * The library routines call this routine to interpret * network numbers. */ -u_long -inet_network(cp) - register char *cp; { +u_long inet_network(cp) register char *cp; { register u_long val, base, n; register char c; u_long parts[4], *pp = parts; diff --git a/lib/libstdc/inet/inet_ntoa.c b/lib/libstdc/inet/inet_ntoa.c index 73ddab9..2b03d99 100644 --- a/lib/libstdc/inet/inet_ntoa.c +++ b/lib/libstdc/inet/inet_ntoa.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_ntoa.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Convert network-format internet address @@ -15,9 +19,7 @@ static char sccsid[] = "@(#)inet_ntoa.c 5.2 (Berkeley) 3/9/86"; #include #include -char * -inet_ntoa(in) - struct in_addr in; { +char *inet_ntoa(in) struct in_addr in; { static char b[18]; register char *p; diff --git a/lib/libstdc/lastlog.h b/lib/libstdc/lastlog.h index 3686a91..65c514f 100644 --- a/lib/libstdc/lastlog.h +++ b/lib/libstdc/lastlog.h @@ -1,3 +1,8 @@ +#ifndef _LASTLOG_H_ +#define _LASTLOG_H_ + +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,3 +16,5 @@ struct lastlog { char ll_line[8]; char ll_host[16]; /* same as in utmp */ }; + +#endif diff --git a/lib/libstdc/libstdc.patch b/lib/libstdc/libstdc.patch index 94182bb..5f8ec43 100644 --- a/lib/libstdc/libstdc.patch +++ b/lib/libstdc/libstdc.patch @@ -1,6 +1,6 @@ diff --unified --recursive --new-file libstdc.orig/a.out.h libstdc/a.out.h ---- libstdc.orig/a.out.h 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/a.out.h 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/a.out.h 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/a.out.h 2017-01-19 01:18:23.145552491 +1100 @@ -39,44 +39,4 @@ :4; /* nothing, yet */ }; @@ -48,8 +48,8 @@ diff --unified --recursive --new-file libstdc.orig/a.out.h libstdc/a.out.h -#define N_FORMAT "%08x" +#include diff --unified --recursive --new-file libstdc.orig/compat-4.1/gtty.c libstdc/compat-4.1/gtty.c ---- libstdc.orig/compat-4.1/gtty.c 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/compat-4.1/gtty.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/compat-4.1/gtty.c 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/compat-4.1/gtty.c 2017-01-19 01:18:23.145552491 +1100 @@ -15,7 +15,7 @@ #include @@ -60,8 +60,8 @@ diff --unified --recursive --new-file libstdc.orig/compat-4.1/gtty.c libstdc/com return(ioctl(fd, TIOCGETP, ap)); } diff --unified --recursive --new-file libstdc.orig/compat-4.1/stty.c libstdc/compat-4.1/stty.c ---- libstdc.orig/compat-4.1/stty.c 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/compat-4.1/stty.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/compat-4.1/stty.c 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/compat-4.1/stty.c 2017-01-19 01:18:23.145552491 +1100 @@ -15,7 +15,7 @@ #include @@ -72,11 +72,11 @@ diff --unified --recursive --new-file libstdc.orig/compat-4.1/stty.c libstdc/com return(ioctl(fd, TIOCSETP, ap)); } diff --unified --recursive --new-file libstdc.orig/gen/insque.c libstdc/gen/insque.c ---- libstdc.orig/gen/insque.c 2017-01-18 15:24:06.381633588 +1100 -+++ libstdc/gen/insque.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/gen/insque.c 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/gen/insque.c 2017-01-19 01:18:23.145552491 +1100 @@ -8,16 +8,19 @@ static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; - #endif LIBC_SCCS and not lint + #endif +#include + @@ -99,7 +99,7 @@ diff --unified --recursive --new-file libstdc.orig/gen/insque.c libstdc/gen/insq insque(e, prev) register struct vaxque *e, *prev; { diff --unified --recursive --new-file libstdc.orig/gen/popen.c libstdc/gen/popen.c ---- libstdc.orig/gen/popen.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/gen/popen.c 2017-01-19 01:18:23.145552491 +1100 +++ libstdc/gen/popen.c 1970-01-01 10:00:00.000000000 +1000 @@ -1,77 +0,0 @@ -/* @@ -110,7 +110,7 @@ diff --unified --recursive --new-file libstdc.orig/gen/popen.c libstdc/gen/popen - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; --#endif LIBC_SCCS and not lint +-#endif - -#include -#include @@ -179,12 +179,24 @@ diff --unified --recursive --new-file libstdc.orig/gen/popen.c libstdc/gen/popen - (void) sigsetmask(omask); - return (pid == -1 ? -1 : status); -} +diff --unified --recursive --new-file libstdc.orig/gen/regex.c libstdc/gen/regex.c +--- libstdc.orig/gen/regex.c 2017-01-19 01:18:23.145552491 +1100 ++++ libstdc/gen/regex.c 2017-01-19 01:18:23.145552491 +1100 +@@ -8,8 +8,6 @@ + static char sccsid[] = "@(#)regex.c 5.2 (Berkeley) 3/9/86"; + #endif + +-# +- + /* + * routines to do regular expression matching + * diff --unified --recursive --new-file libstdc.orig/gen/remque.c libstdc/gen/remque.c ---- libstdc.orig/gen/remque.c 2017-01-18 15:24:06.381633588 +1100 -+++ libstdc/gen/remque.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/gen/remque.c 2017-01-19 01:18:23.145552491 +1100 ++++ libstdc/gen/remque.c 2017-01-19 01:18:23.145552491 +1100 @@ -8,16 +8,19 @@ static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; - #endif LIBC_SCCS and not lint + #endif +#include + @@ -208,7 +220,7 @@ diff --unified --recursive --new-file libstdc.orig/gen/remque.c libstdc/gen/remq register struct vaxque *e; { diff --unified --recursive --new-file libstdc.orig/gen.h libstdc/gen.h --- libstdc.orig/gen.h 1970-01-01 10:00:00.000000000 +1000 -+++ libstdc/gen.h 2017-01-18 15:24:06.381633588 +1100 ++++ libstdc/gen.h 2017-01-19 01:18:23.149552495 +1100 @@ -0,0 +1,5 @@ +/* formerly duplicated in gen/insque.c and gen/remque.c */ +struct vaxque { /* queue format expected by VAX queue instructions */ @@ -217,7 +229,7 @@ diff --unified --recursive --new-file libstdc.orig/gen.h libstdc/gen.h +}; diff --unified --recursive --new-file libstdc.orig/net.h libstdc/net.h --- libstdc.orig/net.h 1970-01-01 10:00:00.000000000 +1000 -+++ libstdc/net.h 2017-01-18 15:24:06.381633588 +1100 ++++ libstdc/net.h 2017-01-19 01:18:23.149552495 +1100 @@ -0,0 +1,15 @@ +/* formerly duplicated in netinet/in.h and netns/ns.h */ +#if !defined(vax) && !defined(ntohl) && !defined(lint) @@ -235,8 +247,8 @@ diff --unified --recursive --new-file libstdc.orig/net.h libstdc/net.h +u_long ntohl(), htonl(); +#endif diff --unified --recursive --new-file libstdc.orig/netinet/in.h libstdc/netinet/in.h ---- libstdc.orig/netinet/in.h 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/netinet/in.h 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/netinet/in.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/netinet/in.h 2017-01-19 01:18:23.149552495 +1100 @@ -90,20 +90,21 @@ */ #define IP_OPTIONS 1 /* set/get IP per-packet options */ @@ -270,8 +282,8 @@ diff --unified --recursive --new-file libstdc.orig/netinet/in.h libstdc/netinet/ #ifdef KERNEL extern struct domain inetdomain; diff --unified --recursive --new-file libstdc.orig/netinet/ip.h libstdc/netinet/ip.h ---- libstdc.orig/netinet/ip.h 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/netinet/ip.h 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/netinet/ip.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/netinet/ip.h 2017-01-19 01:18:23.149552495 +1100 @@ -81,7 +81,7 @@ struct in_addr ipt_addr; n_long ipt_time; @@ -282,8 +294,8 @@ diff --unified --recursive --new-file libstdc.orig/netinet/ip.h libstdc/netinet/ /* flag bits for ipt_flg */ diff --unified --recursive --new-file libstdc.orig/netinet/tcp.h libstdc/netinet/tcp.h ---- libstdc.orig/netinet/tcp.h 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/netinet/tcp.h 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/netinet/tcp.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/netinet/tcp.h 2017-01-19 01:18:23.149552495 +1100 @@ -44,7 +44,9 @@ #ifdef lint #define TCP_MSS 536 @@ -296,14 +308,14 @@ diff --unified --recursive --new-file libstdc.orig/netinet/tcp.h libstdc/netinet /* diff --unified --recursive --new-file libstdc.orig/netns/ns.h libstdc/netns/ns.h ---- libstdc.orig/netns/ns.h 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/netns/ns.h 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/netns/ns.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/netns/ns.h 2017-01-19 01:18:23.149552495 +1100 @@ -103,20 +103,21 @@ #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \ ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0)) -#if !defined(vax) && !defined(ntohl) && !defined(lint) -+/* moved this to net.h as it's shared by netns/ns.h */ ++/* moved this to net.h as it's shared by netinet/in.h */ +/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ /* * Macros for number representation conversion. @@ -331,10 +343,10 @@ diff --unified --recursive --new-file libstdc.orig/netns/ns.h libstdc/netns/ns.h #ifdef KERNEL extern struct domain nsdomain; diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/doscan.c ---- libstdc.orig/stdio/doscan.c 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/stdio/doscan.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/stdio/doscan.c 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/stdio/doscan.c 2017-01-19 01:18:23.149552495 +1100 @@ -3,7 +3,8 @@ - #endif LIBC_SCCS and not lint + #endif #include -#include @@ -417,8 +429,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/ } return(1); diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio/fprintf.c ---- libstdc.orig/stdio/fprintf.c 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/stdio/fprintf.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/stdio/fprintf.c 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/stdio/fprintf.c 2017-01-19 01:18:23.149552495 +1100 @@ -1,31 +1,48 @@ /* * Copyright (c) 1980 Regents of the University of California. @@ -441,9 +453,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fprintf.c 5.2 (Berkeley) 3/9/86"; --#endif LIBC_SCCS and not lint +static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88"; -+#endif /* LIBC_SCCS and not lint */ + #endif -#include +#include @@ -481,7 +492,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio } diff --unified --recursive --new-file libstdc.orig/stdio/popen.c libstdc/stdio/popen.c --- libstdc.orig/stdio/popen.c 1970-01-01 10:00:00.000000000 +1000 -+++ libstdc/stdio/popen.c 2017-01-18 15:24:06.381633588 +1100 ++++ libstdc/stdio/popen.c 2017-01-19 01:18:23.149552495 +1100 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1980 Regents of the University of California. @@ -491,7 +502,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/popen.c libstdc/stdio/p + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; -+#endif LIBC_SCCS and not lint ++#endif + +#include +#include @@ -561,8 +572,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio/popen.c libstdc/stdio/p + return (pid == -1 ? -1 : status); +} diff --unified --recursive --new-file libstdc.orig/stdio/printf.c libstdc/stdio/printf.c ---- libstdc.orig/stdio/printf.c 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/stdio/printf.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/stdio/printf.c 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/stdio/printf.c 2017-01-19 01:18:23.149552495 +1100 @@ -1,11 +1,35 @@ +/* + * Copyright (c) 1987 Regents of the University of California. @@ -583,14 +594,13 @@ diff --unified --recursive --new-file libstdc.orig/stdio/printf.c libstdc/stdio/ + #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)printf.c 5.2 (Berkeley) 3/9/86"; --#endif LIBC_SCCS and not lint +static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88"; -+#endif /* LIBC_SCCS and not lint */ -+ -+#include -+#include + #endif -#include ++#include ++#include ++ +printf(fmt, va_alist) + char *fmt; + va_dcl { @@ -607,11 +617,11 @@ diff --unified --recursive --new-file libstdc.orig/stdio/printf.c libstdc/stdio/ + return(ferror(stdout) ? EOF : len); } diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/scanf.c ---- libstdc.orig/stdio/scanf.c 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/stdio/scanf.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/stdio/scanf.c 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/stdio/scanf.c 2017-01-19 01:18:23.149552495 +1100 @@ -2,29 +2,50 @@ static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86"; - #endif LIBC_SCCS and not lint + #endif -#include +#include @@ -671,8 +681,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/s + return len; } diff --unified --recursive --new-file libstdc.orig/stdio/sprintf.c libstdc/stdio/sprintf.c ---- libstdc.orig/stdio/sprintf.c 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/stdio/sprintf.c 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/stdio/sprintf.c 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/stdio/sprintf.c 2017-01-19 01:18:23.149552495 +1100 @@ -1,17 +1,40 @@ +/* + * Copyright (c) 1987 Regents of the University of California. @@ -693,9 +703,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio/sprintf.c libstdc/stdio + #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sprintf.c 5.2 (Berkeley) 3/9/86"; --#endif LIBC_SCCS and not lint +static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88"; -+#endif /* LIBC_SCCS and not lint */ + #endif -#include +#include @@ -724,7 +733,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/sprintf.c libstdc/stdio } diff --unified --recursive --new-file libstdc.orig/stdio/vfprintf.c libstdc/stdio/vfprintf.c --- libstdc.orig/stdio/vfprintf.c 1970-01-01 10:00:00.000000000 +1000 -+++ libstdc/stdio/vfprintf.c 2017-01-18 15:24:06.381633588 +1100 ++++ libstdc/stdio/vfprintf.c 2017-01-19 01:18:23.149552495 +1100 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1988 Regents of the University of California. @@ -745,7 +754,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vfprintf.c libstdc/stdi + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; -+#endif /* LIBC_SCCS and not lint */ ++#endif + +#include +#include @@ -774,7 +783,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vfprintf.c libstdc/stdi +} diff --unified --recursive --new-file libstdc.orig/stdio/vprintf.c libstdc/stdio/vprintf.c --- libstdc.orig/stdio/vprintf.c 1970-01-01 10:00:00.000000000 +1000 -+++ libstdc/stdio/vprintf.c 2017-01-18 15:24:06.381633588 +1100 ++++ libstdc/stdio/vprintf.c 2017-01-19 01:18:23.149552495 +1100 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1988 Regents of the University of California. @@ -795,7 +804,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vprintf.c libstdc/stdio + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; -+#endif /* LIBC_SCCS and not lint */ ++#endif + +#include +#include @@ -811,7 +820,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vprintf.c libstdc/stdio +} diff --unified --recursive --new-file libstdc.orig/stdio/vsprintf.c libstdc/stdio/vsprintf.c --- libstdc.orig/stdio/vsprintf.c 1970-01-01 10:00:00.000000000 +1000 -+++ libstdc/stdio/vsprintf.c 2017-01-18 15:24:06.381633588 +1100 ++++ libstdc/stdio/vsprintf.c 2017-01-19 01:18:23.149552495 +1100 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1988 Regents of the University of California. @@ -832,7 +841,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vsprintf.c libstdc/stdi + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; -+#endif /* LIBC_SCCS and not lint */ ++#endif + +#include +#include @@ -852,8 +861,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vsprintf.c libstdc/stdi + return (len); +} diff --unified --recursive --new-file libstdc.orig/stdio.h libstdc/stdio.h ---- libstdc.orig/stdio.h 2017-01-18 15:24:06.373633566 +1100 -+++ libstdc/stdio.h 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/stdio.h 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/stdio.h 2017-01-19 01:18:23.149552495 +1100 @@ -59,7 +59,7 @@ long ftell(); char *fgets(); @@ -864,8 +873,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio.h libstdc/stdio.h #endif # endif diff --unified --recursive --new-file libstdc.orig/sys/dir.h libstdc/sys/dir.h ---- libstdc.orig/sys/dir.h 2017-01-18 15:24:06.377633578 +1100 -+++ libstdc/sys/dir.h 2017-01-18 15:24:06.381633588 +1100 +--- libstdc.orig/sys/dir.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/sys/dir.h 2017-01-19 01:18:23.149552495 +1100 @@ -32,9 +32,9 @@ * dp->d_ino set to 0. */ @@ -880,9 +889,35 @@ diff --unified --recursive --new-file libstdc.orig/sys/dir.h libstdc/sys/dir.h #define MAXNAMLEN 255 diff --unified --recursive --new-file libstdc.orig/sys/param.h libstdc/sys/param.h ---- libstdc.orig/sys/param.h 2017-01-18 15:24:06.377633578 +1100 -+++ libstdc/sys/param.h 2017-01-18 15:24:06.381633588 +1100 -@@ -174,12 +174,16 @@ +--- libstdc.orig/sys/param.h 2017-01-19 01:18:23.137552484 +1100 ++++ libstdc/sys/param.h 2017-01-19 01:26:32.138169531 +1100 +@@ -53,15 +53,16 @@ + /* + * Signals + */ +-#ifdef KERNEL +-#include "signal.h" +-#else +-#include +-#endif +- +-#define ISSIG(p) \ +- ((p)->p_sig && ((p)->p_flag&STRC || \ +- ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) ++/*#ifdef KERNEL*/ ++/*#include "signal.h"*/ ++/*#else*/ ++/*#include */ ++/*#endif*/ ++ ++/* moved this to sys/proc.h to avoid a circular dependency */ ++/*#define ISSIG(p) \*/ ++/* ((p)->p_sig && ((p)->p_flag&STRC || \*/ ++/* ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig())*/ + + #define NBPW sizeof(int) /* number of bytes in an integer */ + +@@ -174,12 +175,16 @@ /* * Macros for counting and rounding. */ @@ -901,9 +936,21 @@ diff --unified --recursive --new-file libstdc.orig/sys/param.h libstdc/sys/param + +/* moved this from sys/types.h */ +#define NBBY 8 /* number of bits in a byte */ +diff --unified --recursive --new-file libstdc.orig/sys/proc.h libstdc/sys/proc.h +--- libstdc.orig/sys/proc.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/sys/proc.h 2017-01-19 01:25:34.050092685 +1100 +@@ -117,3 +117,8 @@ + #define SSEL 0x0400000 /* selecting; wakeup/waiting danger */ + #define SLOGIN 0x0800000 /* a login process (legit child of init) */ + #define SPTECHG 0x1000000 /* pte's for process have changed */ ++ ++/* moved this from sys/param.h to avoid a circular dependency */ ++#define ISSIG(p) \ ++ ((p)->p_sig && ((p)->p_flag&STRC || \ ++ ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) diff --unified --recursive --new-file libstdc.orig/sys/select.h libstdc/sys/select.h --- libstdc.orig/sys/select.h 1970-01-01 10:00:00.000000000 +1000 -+++ libstdc/sys/select.h 2017-01-18 15:24:06.385633600 +1100 ++++ libstdc/sys/select.h 2017-01-19 01:18:23.149552495 +1100 @@ -0,0 +1,28 @@ +#include + @@ -934,8 +981,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/select.h libstdc/sys/sele +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) diff --unified --recursive --new-file libstdc.orig/sys/types.h libstdc/sys/types.h ---- libstdc.orig/sys/types.h 2017-01-18 15:24:06.377633578 +1100 -+++ libstdc/sys/types.h 2017-01-18 15:24:06.385633600 +1100 +--- libstdc.orig/sys/types.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/sys/types.h 2017-01-19 01:18:23.149552495 +1100 @@ -45,30 +45,32 @@ typedef u_short uid_t; typedef u_short gid_t; @@ -986,8 +1033,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/types.h libstdc/sys/types #endif diff --unified --recursive --new-file libstdc.orig/sys/vmmac.h libstdc/sys/vmmac.h ---- libstdc.orig/sys/vmmac.h 2017-01-18 15:24:06.377633578 +1100 -+++ libstdc/sys/vmmac.h 2017-01-18 15:24:06.385633600 +1100 +--- libstdc.orig/sys/vmmac.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/sys/vmmac.h 2017-01-19 01:18:23.149552495 +1100 @@ -157,3 +157,10 @@ } \ c->c_lock = 0; \ @@ -1000,8 +1047,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/vmmac.h libstdc/sys/vmmac +#define mapin(pte, v, pfnum, count, prot) \ + (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) diff --unified --recursive --new-file libstdc.orig/vax/vmparam.h libstdc/vax/vmparam.h ---- libstdc.orig/vax/vmparam.h 2017-01-18 15:24:06.377633578 +1100 -+++ libstdc/vax/vmparam.h 2017-01-18 15:24:06.385633600 +1100 +--- libstdc.orig/vax/vmparam.h 2017-01-19 01:18:23.141552487 +1100 ++++ libstdc/vax/vmparam.h 2017-01-19 01:18:23.149552495 +1100 @@ -156,5 +156,6 @@ /* * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 diff --git a/lib/libstdc/math.h b/lib/libstdc/math.h index 6b874d6..65b0a83 100644 --- a/lib/libstdc/math.h +++ b/lib/libstdc/math.h @@ -1,20 +1,45 @@ +#ifndef _MATH_H_ +#define _MATH_H_ + /* math.h 4.6 9/11/85 */ -extern double asinh(), acosh(), atanh(); -extern double erf(), erfc(); -extern double exp(), expm1(), log(), log10(), log1p(), pow(); -extern double fabs(), floor(), ceil(), rint(); -extern double lgamma(); -extern double hypot(), cabs(); -extern double copysign(), drem(), logb(), scalb(); -extern int finite(); +/*extern double asinh(), acosh(), atanh();*/ +/*extern double erf(), erfc();*/ +/*extern double exp(), expm1(), log(), log10(), log1p(), pow();*/ +/*extern double fabs(), floor(), ceil(), rint();*/ +/*extern double lgamma();*/ +/*extern double hypot(), cabs();*/ +/*extern double copysign(), drem(), logb(), scalb();*/ +/*extern int finite();*/ #ifdef vax -extern double infnan(); +/*extern double infnan();*/ #endif -extern double j0(), j1(), jn(), y0(), y1(), yn(); -extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2(); -extern double sinh(), cosh(), tanh(); -extern double cbrt(), sqrt(); -extern double modf(), ldexp(), frexp(), atof(); +/*extern double j0(), j1(), jn(), y0(), y1(), yn();*/ +/*extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2();*/ +/*extern double sinh(), cosh(), tanh();*/ +/*extern double cbrt(), sqrt();*/ +/*extern double modf(), ldexp(), frexp(), atof();*/ #define HUGE 1.701411733192644270e38 + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/atof.c */ +double atof __P((char *s)); + +/* gen/frexp.c */ +double frexp __P((double x, int *i)); + +/* gen/ldexp.c */ +double ldexp __P((double v, int e)); + +/* gen/modf.c */ +double modf __P((double v, double *p)); + +#endif diff --git a/lib/libstdc/memory.h b/lib/libstdc/memory.h index 532c8df..34969d9 100644 --- a/lib/libstdc/memory.h +++ b/lib/libstdc/memory.h @@ -1,3 +1,6 @@ +#ifndef _MEMORY_H_ +#define _MEMORY_H_ + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,8 +13,33 @@ * Definitions of the Sys5 compat memory manipulation routines */ -extern char *memccpy(); -extern char *memchr(); -extern int memcmp(); -extern char *memcpy(); -extern char *memset(); +/*extern char *memccpy();*/ +/*extern char *memchr();*/ +/*extern int memcmp();*/ +/*extern char *memcpy();*/ +/*extern char *memset();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-sys5/memccpy.c */ +char *memccpy __P((register char *t, register char *f, register c, register n)); + +/* compat-sys5/memchr.c */ +char *memchr __P((register char *s, register c, register n)); + +/* compat-sys5/memcmp.c */ +int memcmp __P((register char *s1, register char *s2, register n)); + +/* compat-sys5/memcpy.c */ +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 diff --git a/lib/libstdc/mp.h b/lib/libstdc/mp.h index 05a1d39..a1539d1 100644 --- a/lib/libstdc/mp.h +++ b/lib/libstdc/mp.h @@ -1,3 +1,9 @@ +#ifndef _MP_H_ +#define _MP_H_ + +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -30,8 +36,8 @@ struct half short high; }; #endif -extern MINT *itom(); -extern short *xalloc(); +/*extern MINT *itom();*/ +/*extern short *xalloc();*/ #ifdef lint extern xv_oid; @@ -39,3 +45,5 @@ extern xv_oid; #else #define VOID #endif + +#endif diff --git a/lib/libstdc/mtab.h b/lib/libstdc/mtab.h index bfe07ce..18179d7 100644 --- a/lib/libstdc/mtab.h +++ b/lib/libstdc/mtab.h @@ -1,3 +1,6 @@ +#ifndef _MTAB_H_ +#define _MTAB_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,3 +17,5 @@ struct mtab { char m_dname[32]; /* block device pathname */ char m_type[4]; /* read-only, quotas */ }; + +#endif diff --git a/lib/libstdc/n.sh b/lib/libstdc/n.sh index 677e1b6..a4a0410 100755 --- a/lib/libstdc/n.sh +++ b/lib/libstdc/n.sh @@ -1,6 +1,6 @@ -#!/bin/sh -v +#!/bin/sh -rm -rf *.c *.h *.o *.orig *.[ch].append *.[ch].append.nocomm *.[ch].nocomm *.[ch].protos *.[ch].usedby arpa compat-4.1 compat-sys5 csu gen inet machine net netimp netinet netns ns pascal protocols stdio sys temp.c vax vaxif vaxmba vaxuba xx* +rm -rf *.c *.h *.o *.orig *.[ch].nocomm *.[ch].protos *.[ch].protos.nocomm *.[ch].usedby *.[ch].uses arpa compat-4.1 compat-sys5 csu gen inet machine net netimp netinet netns ns pascal protocols stdio sys temp.c vax vaxif vaxmba vaxuba xx* find ../libc \( -name '*.[cs]' -o -name Makefile \) -print |\ sed -e 's:^\.\./libc/::' |\ @@ -110,6 +110,10 @@ find . -name '*.[ch]' -print |\ sed -e 's:^\./::' |\ while read i do + echo "i=$i" + + sed -e 's/^\(#[ ]*\(else\|endif\)\)\([^0-9A-Za-z_].*\)\?/\1/' -i $i + rm -f xx* csplit -b '%05d' -q $i '/^[ ]*{[ ]*$/' '{*}' for j in xx* diff --git a/lib/libstdc/ndbm.h b/lib/libstdc/ndbm.h index 57a8bf1..923b66c 100644 --- a/lib/libstdc/ndbm.h +++ b/lib/libstdc/ndbm.h @@ -1,3 +1,6 @@ +#ifndef _NDBM_H_ +#define _NDBM_H_ + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -52,11 +55,31 @@ typedef struct { #define DBM_INSERT 0 #define DBM_REPLACE 1 -DBM *dbm_open(); -void dbm_close(); -datum dbm_fetch(); -datum dbm_firstkey(); -datum dbm_nextkey(); -long dbm_forder(); -int dbm_delete(); -int dbm_store(); +/*DBM *dbm_open();*/ +/*void dbm_close();*/ +/*datum dbm_fetch();*/ +/*datum dbm_firstkey();*/ +/*datum dbm_nextkey();*/ +/*long dbm_forder();*/ +/*int dbm_delete();*/ +/*int dbm_store();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/ndbm.c */ +DBM *dbm_open __P((char *file, int flags, int mode)); +void dbm_close __P((DBM *db)); +long dbm_forder __P((register DBM *db, datum key)); +datum dbm_fetch __P((register DBM *db, datum key)); +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 diff --git a/lib/libstdc/net.h b/lib/libstdc/net.h index b590021..6d1a47c 100644 --- a/lib/libstdc/net.h +++ b/lib/libstdc/net.h @@ -1,3 +1,10 @@ +#ifndef _NET_H_ +#define _NET_H_ + +#include +#include +#include + /* formerly duplicated in netinet/in.h and netns/ns.h */ #if !defined(vax) && !defined(ntohl) && !defined(lint) /* @@ -10,6 +17,31 @@ #endif #if !defined(ntohl) && (defined(vax) || defined(lint)) -u_short ntohs(), htons(); -u_long ntohl(), htonl(); +/*u_short ntohs(), htons();*/ +/*u_long ntohl(), htonl();*/ +#endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* net/rcmd.c */ +int rcmd __P((char **ahost, int rport, char *locuser, char *remuser, char *cmd, int *fd2p)); +int rresvport __P((int *alport)); +int ruserok __P((char *rhost, int superuser, char *ruser, char *luser)); +int _validuser __P((FILE *hostf, char *rhost, char *luser, char *ruser, int baselen)); +int _checkhost __P((char *rhost, char *lhost, int len)); + +/* net/rexec.c */ +int rexec __P((char **ahost, int rport, char *name, char *pass, char *cmd, int *fd2p)); + +/* net/ruserpass.c */ +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 diff --git a/lib/libstdc/net/af.h b/lib/libstdc/net/af.h index 676507b..7a00375 100644 --- a/lib/libstdc/net/af.h +++ b/lib/libstdc/net/af.h @@ -1,3 +1,8 @@ +#ifndef _NET_AF_H_ +#define _NET_AF_H_ + +#include + /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -33,3 +38,5 @@ struct afhash { #ifdef KERNEL struct afswitch afswitch[]; #endif + +#endif diff --git a/lib/libstdc/net/getnetbyaddr.c b/lib/libstdc/net/getnetbyaddr.c index d5cef5b..8233575 100644 --- a/lib/libstdc/net/getnetbyaddr.c +++ b/lib/libstdc/net/getnetbyaddr.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +8,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getnetbyaddr.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include extern int _net_stayopen; -struct netent * -getnetbyaddr(net, type) - register int net, type; { +struct netent *getnetbyaddr(net, type) register int net; register int type; { register struct netent *p; setnetent(_net_stayopen); diff --git a/lib/libstdc/net/getnetbyname.c b/lib/libstdc/net/getnetbyname.c index e4869f4..e09de4b 100644 --- a/lib/libstdc/net/getnetbyname.c +++ b/lib/libstdc/net/getnetbyname.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +9,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getnetbyname.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include extern int _net_stayopen; -struct netent * -getnetbyname(name) - register char *name; { +struct netent *getnetbyname(name) register char *name; { register struct netent *p; register char **cp; diff --git a/lib/libstdc/net/getnetent.c b/lib/libstdc/net/getnetent.c index 138e978..3a8bd49 100644 --- a/lib/libstdc/net/getnetent.c +++ b/lib/libstdc/net/getnetent.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getnetent.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -22,10 +27,11 @@ static char line[BUFSIZ+1]; static struct netent net; static char *net_aliases[MAXALIASES]; int _net_stayopen; -static char *any(); +/*static char *any();*/ + +static char *any __P((register char *cp, char *match)); -setnetent(f) - int f; { +int setnetent(f) int f; { if (netf == NULL) netf = fopen(NETDB, "r" ); else @@ -33,7 +39,7 @@ setnetent(f) _net_stayopen |= f; } -endnetent() { +int endnetent() { if (netf) { fclose(netf); netf = NULL; @@ -41,8 +47,7 @@ endnetent() { _net_stayopen = 0; } -struct netent * -getnetent() { +struct netent *getnetent() { char *p; register char *cp, **q; @@ -88,10 +93,7 @@ again: return (&net); } -static char * -any(cp, match) - register char *cp; - char *match; { +static char *any(cp, match) register char *cp; char *match; { register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/getproto.c b/lib/libstdc/net/getproto.c index 7bb4896..be04feb 100644 --- a/lib/libstdc/net/getproto.c +++ b/lib/libstdc/net/getproto.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +8,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getproto.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include extern int _proto_stayopen; -struct protoent * -getprotobynumber(proto) - register int proto; { +struct protoent *getprotobynumber(proto) register int proto; { register struct protoent *p; setprotoent(_proto_stayopen); diff --git a/lib/libstdc/net/getprotoent.c b/lib/libstdc/net/getprotoent.c index 244c8f9..166e65e 100644 --- a/lib/libstdc/net/getprotoent.c +++ b/lib/libstdc/net/getprotoent.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getprotoent.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -21,11 +25,12 @@ static FILE *protof = NULL; static char line[BUFSIZ+1]; static struct protoent proto; static char *proto_aliases[MAXALIASES]; -static char *any(); +/*static char *any();*/ int _proto_stayopen; -setprotoent(f) - int f; { +static char *any __P((register char *cp, char *match)); + +int setprotoent(f) int f; { if (protof == NULL) protof = fopen(PROTODB, "r" ); else @@ -33,7 +38,7 @@ setprotoent(f) _proto_stayopen |= f; } -endprotoent() { +int endprotoent() { if (protof) { fclose(protof); protof = NULL; @@ -41,8 +46,7 @@ endprotoent() { _proto_stayopen = 0; } -struct protoent * -getprotoent() { +struct protoent *getprotoent() { char *p; register char *cp, **q; @@ -87,10 +91,7 @@ again: return (&proto); } -static char * -any(cp, match) - register char *cp; - char *match; { +static char *any(cp, match) register char *cp; char *match; { register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/getprotoname.c b/lib/libstdc/net/getprotoname.c index dc0910c..01cc11c 100644 --- a/lib/libstdc/net/getprotoname.c +++ b/lib/libstdc/net/getprotoname.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +9,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getprotoname.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include extern int _proto_stayopen; -struct protoent * -getprotobyname(name) - register char *name; { +struct protoent *getprotobyname(name) register char *name; { register struct protoent *p; register char **cp; diff --git a/lib/libstdc/net/getservbyname.c b/lib/libstdc/net/getservbyname.c index d6c84ee..733d9fb 100644 --- a/lib/libstdc/net/getservbyname.c +++ b/lib/libstdc/net/getservbyname.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +9,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getservbyname.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include extern int _serv_stayopen; -struct servent * -getservbyname(name, proto) - char *name, *proto; { +struct servent *getservbyname(name, proto) char *name; char *proto; { register struct servent *p; register char **cp; diff --git a/lib/libstdc/net/getservbyport.c b/lib/libstdc/net/getservbyport.c index c84c10e..2529922 100644 --- a/lib/libstdc/net/getservbyport.c +++ b/lib/libstdc/net/getservbyport.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,16 +9,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getservbyport.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include extern int _serv_stayopen; -struct servent * -getservbyport(port, proto) - int port; - char *proto; { +struct servent *getservbyport(port, proto) int port; char *proto; { register struct servent *p; setservent(_serv_stayopen); diff --git a/lib/libstdc/net/getservent.c b/lib/libstdc/net/getservent.c index 09784ab..a227c4e 100644 --- a/lib/libstdc/net/getservent.c +++ b/lib/libstdc/net/getservent.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +12,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getservent.c 5.3 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -21,11 +27,12 @@ static FILE *servf = NULL; static char line[BUFSIZ+1]; static struct servent serv; static char *serv_aliases[MAXALIASES]; -static char *any(); +/*static char *any();*/ int _serv_stayopen; -setservent(f) - int f; { +static char *any __P((register char *cp, char *match)); + +int setservent(f) int f; { if (servf == NULL) servf = fopen(SERVDB, "r" ); else @@ -33,7 +40,7 @@ setservent(f) _serv_stayopen |= f; } -endservent() { +int endservent() { if (servf) { fclose(servf); servf = NULL; @@ -41,8 +48,7 @@ endservent() { _serv_stayopen = 0; } -struct servent * -getservent() { +struct servent *getservent() { char *p; register char *cp, **q; @@ -89,10 +95,7 @@ again: return (&serv); } -static char * -any(cp, match) - register char *cp; - char *match; { +static char *any(cp, match) register char *cp; char *match; { register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/hosttable/gethostent.c b/lib/libstdc/net/hosttable/gethostent.c index 857b6ef..1578a41 100644 --- a/lib/libstdc/net/hosttable/gethostent.c +++ b/lib/libstdc/net/hosttable/gethostent.c @@ -1,3 +1,10 @@ +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +13,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostent.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -38,16 +45,17 @@ char *_host_file = "/etc/hosts"; int _host_stayopen; DBM *_host_db; /* set by gethostbyname(), gethostbyaddr() */ -static char *any(); +/*static char *any();*/ + +static char *any __P((register char *cp, char *match)); -sethostent(f) - int f; { +int sethostent(f) int f; { if (hostf != NULL) rewind(hostf); _host_stayopen |= f; } -endhostent() { +int endhostent() { if (hostf) { fclose(hostf); hostf = NULL; @@ -59,8 +67,7 @@ endhostent() { _host_stayopen = 0; } -struct hostent * -gethostent() { +struct hostent *gethostent() { char *p; register char *cp, **q; @@ -106,15 +113,11 @@ again: return (&host); } -sethostfile(file) - char *file; { +int sethostfile(file) char *file; { _host_file = file; } -static char * -any(cp, match) - register char *cp; - char *match; { +static char *any(cp, match) register char *cp; char *match; { register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/hosttable/gethostnamadr.c b/lib/libstdc/net/hosttable/gethostnamadr.c index 981d067..aaaf50e 100644 --- a/lib/libstdc/net/hosttable/gethostnamadr.c +++ b/lib/libstdc/net/hosttable/gethostnamadr.c @@ -1,3 +1,12 @@ +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +15,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 5.5 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -30,9 +39,9 @@ extern char *_host_file; DBM *_host_db = (DBM *)NULL; int _host_stayopen; /* set by sethostent(), cleared by endhostent() */ -static struct hostent * -fetchhost(key) - datum key; { +static struct hostent *fetchhost __P((datum key)); + +static struct hostent *fetchhost(key) datum key; { register char *cp, *tp, **ap; int naliases; @@ -64,9 +73,7 @@ fetchhost(key) return (&host); } -struct hostent * -gethostbyname(nam) - register char *nam; { +struct hostent *gethostbyname(nam) register char *nam; { register struct hostent *hp; register char **cp; datum key; @@ -107,11 +114,7 @@ gethostbyname(nam) return (hp); } -struct hostent * -gethostbyaddr(addr, length, type) - char *addr; - register int length; - register int type; { +struct hostent *gethostbyaddr(addr, length, type) char *addr; register int length; register int type; { register struct hostent *hp; datum key; diff --git a/lib/libstdc/net/htonl.c b/lib/libstdc/net/htonl.c index 944e195..25d3560 100644 --- a/lib/libstdc/net/htonl.c +++ b/lib/libstdc/net/htonl.c @@ -1,5 +1,9 @@ +#include #include #include + +/*#include */ +/*#include */ u_long htonl(hostlong) u_long hostlong; { abort(); } diff --git a/lib/libstdc/net/htons.c b/lib/libstdc/net/htons.c index df43047..f56e85f 100644 --- a/lib/libstdc/net/htons.c +++ b/lib/libstdc/net/htons.c @@ -1,5 +1,9 @@ +#include #include #include + +/*#include */ +/*#include */ u_short htons(hostshort) u_short hostshort; { abort(); } diff --git a/lib/libstdc/net/if.h b/lib/libstdc/net/if.h index 5a0cc23..957908f 100644 --- a/lib/libstdc/net/if.h +++ b/lib/libstdc/net/if.h @@ -1,3 +1,10 @@ +#ifndef _NET_IF_H_ +#define _NET_IF_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -207,8 +214,10 @@ struct ifconf { #include "../net/if_arp.h" struct ifqueue rawintrq; /* raw packet input queue */ struct ifnet *ifnet; -struct ifaddr *ifa_ifwithaddr(), *ifa_ifwithnet(); -struct ifaddr *ifa_ifwithdstaddr(); -#else KERNEL +/*struct ifaddr *ifa_ifwithaddr(), *ifa_ifwithnet();*/ +/*struct ifaddr *ifa_ifwithdstaddr();*/ +#else #include -#endif KERNEL +#endif + +#endif diff --git a/lib/libstdc/net/if_arp.h b/lib/libstdc/net/if_arp.h index 4701f41..547c3f9 100644 --- a/lib/libstdc/net/if_arp.h +++ b/lib/libstdc/net/if_arp.h @@ -1,3 +1,9 @@ +#ifndef _NET_IF_ARP_H_ +#define _NET_IF_ARP_H_ + +#include +#include + /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -49,3 +55,5 @@ struct arpreq { #define ATF_PERM 0x04 /* permanent entry */ #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ #define ATF_USETRAILERS 0x10 /* has requested trailers */ + +#endif diff --git a/lib/libstdc/net/named/gethostnamadr.c b/lib/libstdc/net/named/gethostnamadr.c index b5f63f0..72e2bdb 100644 --- a/lib/libstdc/net/named/gethostnamadr.c +++ b/lib/libstdc/net/named/gethostnamadr.c @@ -1,3 +1,18 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +21,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 6.12 (Berkeley) 5/19/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -34,7 +49,7 @@ static char line[BUFSIZ+1]; static char hostaddr[MAXADDRS]; static char *host_addrs[2]; static int stayopen = 0; -static char *any(); +/*static char *any();*/ typedef union { HEADER qb1; @@ -46,14 +61,13 @@ static union { char ac; } align; - int h_errno; extern errno; -static struct hostent * -getanswer(msg, msglen, iquery) - char *msg; - int msglen, iquery; { +static struct hostent *getanswer __P((char *msg, int msglen, int iquery)); +static char *any __P((register char *cp, char *match)); + +static struct hostent *getanswer(msg, msglen, iquery) char *msg; int msglen; int iquery; { register HEADER *hp; register char *cp; register int n; @@ -221,9 +235,7 @@ getanswer(msg, msglen, iquery) } } -struct hostent * -gethostbyname(name) - char *name; { +struct hostent *gethostbyname(name) char *name; { int n; querybuf buf; register struct hostent *hp; @@ -244,10 +256,7 @@ gethostbyname(name) return(hp); } -struct hostent * -gethostbyaddr(addr, len, type) - char *addr; - int len, type; { +struct hostent *gethostbyaddr(addr, len, type) char *addr; int len; int type; { int n; querybuf buf; register struct hostent *hp; @@ -283,9 +292,7 @@ gethostbyaddr(addr, len, type) return(hp); } - -_sethtent(f) - int f; { +int _sethtent(f) int f; { if (hostf == NULL) hostf = fopen(HOSTDB, "r" ); else @@ -293,15 +300,14 @@ _sethtent(f) stayopen |= f; } -_endhtent() { +int _endhtent() { if (hostf && !stayopen) { (void) fclose(hostf); hostf = NULL; } } -struct hostent * -_gethtent() { +struct hostent *_gethtent() { char *p; register char *cp, **q; @@ -348,10 +354,7 @@ again: return (&host); } -static char * -any(cp, match) - register char *cp; - char *match; { +static char *any(cp, match) register char *cp; char *match; { register char *mp, c; while (c = *cp) { @@ -363,9 +366,7 @@ any(cp, match) return ((char *)0); } -struct hostent * -_gethtbyname(name) - char *name; { +struct hostent *_gethtbyname(name) char *name; { register struct hostent *p; register char **cp; char lowname[128]; @@ -391,10 +392,7 @@ found: return (p); } -struct hostent * -_gethtbyaddr(addr, len, type) - char *addr; - int len, type; { +struct hostent *_gethtbyaddr(addr, len, type) char *addr; int len; int type; { register struct hostent *p; _sethtent(0); diff --git a/lib/libstdc/net/named/sethostent.c b/lib/libstdc/net/named/sethostent.c index 2cdf459..9244907 100644 --- a/lib/libstdc/net/named/sethostent.c +++ b/lib/libstdc/net/named/sethostent.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,25 +10,24 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sethostent.c 6.3 (Berkeley) 4/10/86"; -#endif LIBC_SCCS and not lint +#endif #include #include #include #include -sethostent(stayopen) { +int sethostent(stayopen) int stayopen; { if (stayopen) _res.options |= RES_STAYOPEN | RES_USEVC; } -endhostent() { +int endhostent() { _res.options &= ~(RES_STAYOPEN | RES_USEVC); _res_close(); } -sethostfile(name) -char *name; { +int sethostfile(name) char *name; { #ifdef lint name = name; #endif diff --git a/lib/libstdc/net/netisr.h b/lib/libstdc/net/netisr.h index 6691e5f..77d190d 100644 --- a/lib/libstdc/net/netisr.h +++ b/lib/libstdc/net/netisr.h @@ -1,3 +1,8 @@ +#ifndef _NET_NETISR_H_ +#define _NET_NETISR_H_ + +#include + /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -36,3 +41,5 @@ int netisr; /* scheduling bits for network */ #endif #endif + +#endif diff --git a/lib/libstdc/net/ntohl.c b/lib/libstdc/net/ntohl.c index 9e05142..ba34706 100644 --- a/lib/libstdc/net/ntohl.c +++ b/lib/libstdc/net/ntohl.c @@ -1,5 +1,9 @@ +#include #include #include + +/*#include */ +/*#include */ u_long ntohl(netlong) u_long netlong; { abort(); } diff --git a/lib/libstdc/net/ntohs.c b/lib/libstdc/net/ntohs.c index 0a9632b..6471fe8 100644 --- a/lib/libstdc/net/ntohs.c +++ b/lib/libstdc/net/ntohs.c @@ -1,5 +1,9 @@ +#include #include #include + +/*#include */ +/*#include */ u_short ntohs(netshort) u_short netshort; { abort(); } diff --git a/lib/libstdc/net/raw_cb.h b/lib/libstdc/net/raw_cb.h index 3b8912a..cc6383a 100644 --- a/lib/libstdc/net/raw_cb.h +++ b/lib/libstdc/net/raw_cb.h @@ -1,3 +1,10 @@ +#ifndef _NET_RAW_CB_H_ +#define _NET_RAW_CB_H_ + +#include +#include +#include + /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -53,3 +60,5 @@ struct raw_header { #ifdef KERNEL struct rawcb rawcb; /* head of list */ #endif + +#endif diff --git a/lib/libstdc/net/rcmd.c b/lib/libstdc/net/rcmd.c index cdfcea2..f48ac64 100644 --- a/lib/libstdc/net/rcmd.c +++ b/lib/libstdc/net/rcmd.c @@ -1,3 +1,26 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +29,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rcmd.c 5.11 (Berkeley) 5/6/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -23,13 +46,9 @@ static char sccsid[] = "@(#)rcmd.c 5.11 (Berkeley) 5/6/86"; #include extern errno; -char *index(), *sprintf(); +/*char *index(), *sprintf();*/ -rcmd(ahost, rport, locuser, remuser, cmd, fd2p) - char **ahost; - u_short rport; - char *locuser, *remuser, *cmd; - int *fd2p; { +int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) char **ahost; int rport; char *locuser; char *remuser; char *cmd; int *fd2p; { int s, timo = 1, pid, oldmask; struct sockaddr_in sin, sin2, from; char c; @@ -148,8 +167,7 @@ bad: return (-1); } -rresvport(alport) - int *alport; { +int rresvport(alport) int *alport; { struct sockaddr_in sin; int s; @@ -175,10 +193,7 @@ rresvport(alport) } } -ruserok(rhost, superuser, ruser, luser) - char *rhost; - int superuser; - char *ruser, *luser; { +int ruserok(rhost, superuser, ruser, luser) char *rhost; int superuser; char *ruser; char *luser; { FILE *hostf; char fhost[MAXHOSTNAMELEN]; int first = 1; @@ -228,10 +243,7 @@ again: return (-1); } -_validuser(hostf, rhost, luser, ruser, baselen) -char *rhost, *luser, *ruser; -FILE *hostf; -int baselen; { +int _validuser(hostf, rhost, luser, ruser, baselen) FILE *hostf; char *rhost; char *luser; char *ruser; int baselen; { char *user; char ahost[MAXHOSTNAMELEN]; register char *p; @@ -260,9 +272,7 @@ int baselen; { return (-1); } -_checkhost(rhost, lhost, len) -char *rhost, *lhost; -int len; { +int _checkhost(rhost, lhost, len) char *rhost; char *lhost; int len; { static char ldomain[MAXHOSTNAMELEN + 1]; static char *domainp = NULL; register char *cp; diff --git a/lib/libstdc/net/res_comp.c b/lib/libstdc/net/res_comp.c index 1c19c31..21641b6 100644 --- a/lib/libstdc/net/res_comp.c +++ b/lib/libstdc/net/res_comp.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +9,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_comp.c 6.7 (Berkeley) 3/11/86"; -#endif LIBC_SCCS and not lint +#endif #include #include #include - /* * Expand compressed domain name 'comp_dn' to full domain name. * 'msg' is a pointer to the begining of the message, @@ -20,9 +22,7 @@ static char sccsid[] = "@(#)res_comp.c 6.7 (Berkeley) 3/11/86"; * 'exp_dn' is a pointer to a buffer of size 'length' for the result. * Return size of compressed name or -1 if there was an error. */ -dn_expand(msg, eomorig, comp_dn, exp_dn, length) - char *msg, *eomorig, *comp_dn, *exp_dn; - int length; { +int dn_expand(msg, eomorig, comp_dn, exp_dn, length) char *msg; char *eomorig; char *comp_dn; char *exp_dn; int length; { register char *cp, *dn; register int n, c; char *eom; @@ -89,10 +89,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length) * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr' * is NULL, we don't update the list. */ -dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) - char *exp_dn, *comp_dn; - int length; - char **dnptrs, **lastdnptr; { +int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) char *exp_dn; char *comp_dn; int length; char **dnptrs; char **lastdnptr; { register char *cp, *dn; register int c, l; char **cpp, **lpp, *sp, *eob; @@ -157,8 +154,7 @@ dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) /* * Skip over a compressed domain name. Return the size or -1. */ -dn_skip(comp_dn) - char *comp_dn; { +int dn_skip(comp_dn) char *comp_dn; { register char *cp; register int n; @@ -185,9 +181,7 @@ dn_skip(comp_dn) * Search for expanded name from a list of previously compressed names. * Return the offset from msg if found or -1. */ -dn_find(exp_dn, msg, dnptrs, lastdnptr) - char *exp_dn, *msg; - char **dnptrs, **lastdnptr; { +int dn_find(exp_dn, msg, dnptrs, lastdnptr) char *exp_dn; char *msg; char **dnptrs; char **lastdnptr; { register char *dn, *cp, **cpp; register int n; char *sp; @@ -233,9 +227,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr) * advantage of being portable. */ -u_short -getshort(msgp) - char *msgp; { +u_short getshort(msgp) char *msgp; { register u_char *p = (u_char *) msgp; #ifdef vax /* @@ -250,9 +242,7 @@ getshort(msgp) return ((u_short)(u | *p)); } -u_long -getlong(msgp) - char *msgp; { +u_long getlong(msgp) char *msgp; { register u_char *p = (u_char *) msgp; register u_long u; @@ -262,18 +252,13 @@ getlong(msgp) return (u | *p); } - -putshort(s, msgp) - register u_short s; - register char *msgp; { +int putshort(s, msgp) int s; register char *msgp; { msgp[1] = s; msgp[0] = s >> 8; } -putlong(l, msgp) - register u_long l; - register char *msgp; { +int putlong(l, msgp) register u_long l; register char *msgp; { msgp[3] = l; msgp[2] = (l >>= 8); diff --git a/lib/libstdc/net/res_debug.c b/lib/libstdc/net/res_debug.c index 0c5b4c0..0228cdc 100644 --- a/lib/libstdc/net/res_debug.c +++ b/lib/libstdc/net/res_debug.c @@ -1,3 +1,11 @@ +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +14,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_debug.c 5.13 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #if defined(lint) && !defined(DEBUG) #define DEBUG @@ -17,8 +25,8 @@ static char sccsid[] = "@(#)res_debug.c 5.13 (Berkeley) 3/9/86"; #include #include -extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); -extern char *inet_ntoa(); +/*extern char *p_cdname(), *p_rr(), *p_type(), *p_class();*/ +/*extern char *inet_ntoa();*/ char *opcodes[] = { "QUERY", @@ -58,8 +66,7 @@ char *rcodes[] = { "NOCHANGE", }; -p_query(msg) - char *msg; { +int p_query(msg) char *msg; { #ifdef DEBUG fp_query(msg,stdout); #endif @@ -69,9 +76,7 @@ p_query(msg) * Print the contents of a query. * This is intended to be primarily a debugging routine. */ -fp_query(msg,file) - char *msg; - FILE *file; { +int fp_query(msg, file) char *msg; FILE *file; { #ifdef DEBUG register char *cp; register HEADER *hp; @@ -158,10 +163,7 @@ fp_query(msg,file) #endif } -char * -p_cdname(cp, msg, file) - char *cp, *msg; - FILE *file; { +char *p_cdname(cp, msg, file) char *cp; char *msg; FILE *file; { #ifdef DEBUG char name[MAXDNAME]; int n; @@ -180,10 +182,7 @@ p_cdname(cp, msg, file) /* * Print resource record fields in human readable form. */ -char * -p_rr(cp, msg, file) - char *cp, *msg; - FILE *file; { +char *p_rr(cp, msg, file) char *cp; char *msg; FILE *file; { #ifdef DEBUG int type, class, dlen, n, c; struct in_addr inaddr; @@ -228,7 +227,7 @@ p_rr(cp, msg, file) #ifdef OLDRR case T_MD: case T_MF: -#endif /* OLDRR */ +#endif case T_MG: case T_MR: case T_NS: @@ -324,14 +323,12 @@ p_rr(cp, msg, file) } static char nbuf[20]; -extern char *sprintf(); +/*extern char *sprintf();*/ /* * Return a string for the type */ -char * -p_type(type) - int type; { +char *p_type(type) int type; { switch (type) { case T_A: return("A"); @@ -342,7 +339,7 @@ p_type(type) return("MD"); case T_MF: /* mail forwarder */ return("MF"); -#endif /* OLDRR */ +#endif case T_CNAME: /* connonical name */ return("CNAME"); case T_SOA: /* start of authority zone */ @@ -387,9 +384,7 @@ p_type(type) /* * Return a mnemonic for class */ -char * -p_class(class) - int class; { +char *p_class(class) int class; { switch (class) { case C_IN: /* internet class */ diff --git a/lib/libstdc/net/res_init.c b/lib/libstdc/net/res_init.c index b7daf9e..957f20e 100644 --- a/lib/libstdc/net/res_init.c +++ b/lib/libstdc/net/res_init.c @@ -1,3 +1,15 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +18,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_init.c 6.5 (Berkeley) 4/11/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -52,7 +64,7 @@ struct state _res = { * * Return 0 if completes successfully, -1 on error */ -res_init() { +int res_init() { register FILE *fp; char buf[BUFSIZ], *cp; extern u_long inet_addr(); @@ -60,7 +72,7 @@ res_init() { extern char *strcpy(), *strncpy(); #ifdef DEBUG extern char *getenv(); -#endif DEBUG +#endif int n = 0; /* number of nameserver records read from file */ _res.nsaddr.sin_addr.s_addr = INADDR_ANY; @@ -103,7 +115,7 @@ res_init() { #ifdef DEBUG if ( _res.options & RES_DEBUG ) printf("MAXNS reached, reading resolv.conf\n"); -#endif DEBUG +#endif } continue; } @@ -122,7 +134,7 @@ res_init() { /* Allow user to override the local domain definition */ if ((cp = getenv("LOCALDOMAIN")) != NULL) (void)strncpy(_res.defdname, cp, sizeof(_res.defdname)); -#endif DEBUG +#endif _res.options |= RES_INIT; return(0); } diff --git a/lib/libstdc/net/res_mkquery.c b/lib/libstdc/net/res_mkquery.c index ab4b475..0f4e2ac 100644 --- a/lib/libstdc/net/res_mkquery.c +++ b/lib/libstdc/net/res_mkquery.c @@ -1,3 +1,11 @@ +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +14,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_mkquery.c 6.3 (Berkeley) 3/17/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -14,21 +22,13 @@ static char sccsid[] = "@(#)res_mkquery.c 6.3 (Berkeley) 3/17/86"; #include #include -extern char *sprintf(); +/*extern char *sprintf();*/ /* * Form all types of queries. * Returns the size of the result or -1. */ -res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) - int op; /* opcode of query */ - char *dname; /* domain name */ - int class, type; /* class and type of query */ - char *data; /* resource record data */ - int datalen; /* length of data */ - struct rrec *newrr; /* new rr for modify or append */ - char *buf; /* buffer to put query */ - int buflen; /* size of buffer */ { +int res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) int op; /* opcode of query */ char *dname; /* domain name */ int class; int type; /* class and type of query */ char *data; /* resource record data */ int datalen; /* length of data */ struct rrec *newrr; /* new rr for modify or append */ char *buf; /* buffer to put query */ int buflen; /* size of buffer */ { register HEADER *hp; register char *cp; register int n; @@ -39,7 +39,7 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) #ifdef DEBUG if (_res.options & RES_DEBUG) printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type); -#endif DEBUG +#endif /* * Initialize header fields. */ diff --git a/lib/libstdc/net/res_send.c b/lib/libstdc/net/res_send.c index 6dec4d2..7ee04f8 100644 --- a/lib/libstdc/net/res_send.c +++ b/lib/libstdc/net/res_send.c @@ -1,3 +1,17 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * Copyright (c) 1985 Regents of the University of California. @@ -7,7 +21,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_send.c 6.14 (Berkeley) 7/2/86"; -#endif LIBC_SCCS and not lint +#endif /* * Send query to name server and wait for reply. @@ -29,11 +43,7 @@ static int s = -1; /* socket used for communications */ #define KEEPOPEN (RES_USEVC|RES_STAYOPEN) -res_send(buf, buflen, answer, anslen) - char *buf; - int buflen; - char *answer; - int anslen; { +int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; int anslen; { register int n; int retry, v_circuit, resplen, ns; int gotsomewhere = 0; @@ -51,7 +61,7 @@ res_send(buf, buflen, answer, anslen) printf("res_send()\n"); p_query(buf); } -#endif DEBUG +#endif if (!(_res.options & RES_INIT)) if (res_init() == -1) { return(-1); @@ -67,7 +77,7 @@ res_send(buf, buflen, answer, anslen) if (_res.options & RES_DEBUG) printf("Querying server (# %d) address = %s\n", ns+1, inet_ntoa(_res.nsaddr_list[ns].sin_addr.s_addr)); -#endif DEBUG +#endif if (v_circuit) { /* * Use virtual circuit. @@ -79,7 +89,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("socket failed"); -#endif DEBUG +#endif continue; } if (connect(s, &(_res.nsaddr_list[ns]), @@ -88,7 +98,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("connect failed"); -#endif DEBUG +#endif (void) close(s); s = -1; continue; @@ -107,7 +117,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("write failed"); -#endif DEBUG +#endif (void) close(s); s = -1; continue; @@ -127,7 +137,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("read failed"); -#endif DEBUG +#endif (void) close(s); s = -1; continue; @@ -144,7 +154,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("read failed"); -#endif DEBUG +#endif (void) close(s); s = -1; continue; @@ -162,19 +172,19 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("connect"); -#endif DEBUG +#endif continue; } -#else BSD +#else if (sendto(s, buf, buflen, 0, &_res.nsaddr_list[ns], sizeof(struct sockaddr)) != buflen) { #ifdef DEBUG if (_res.options & RES_DEBUG) perror("sendto"); -#endif DEBUG +#endif continue; } -#endif BSD +#endif /* * Wait for reply */ @@ -192,7 +202,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) perror("select"); -#endif DEBUG +#endif continue; } if (n == 0) { @@ -202,7 +212,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) printf("timeout\n"); -#endif DEBUG +#endif gotsomewhere = 1; continue; } @@ -210,7 +220,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) perror("recvfrom"); -#endif DEBUG +#endif continue; } gotsomewhere = 1; @@ -223,7 +233,7 @@ wait: printf("old answer:\n"); p_query(answer); } -#endif DEBUG +#endif goto wait; } if (!(_res.options & RES_IGNTC) && anhp->tc) { @@ -233,7 +243,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) printf("truncated answer\n"); -#endif DEBUG +#endif (void) close(s); s = -1; /* @@ -250,7 +260,7 @@ wait: printf("got answer:\n"); p_query(answer); } -#endif DEBUG +#endif /* * We are going to assume that the first server is preferred * over the rest (i.e. it is on the local machine) and only @@ -286,7 +296,7 @@ wait: * * This routine is not expected to be user visible. */ -_res_close() { +int _res_close() { if (s != -1) { (void) close(s); s = -1; diff --git a/lib/libstdc/net/rexec.c b/lib/libstdc/net/rexec.c index 750645e..9306585 100644 --- a/lib/libstdc/net/rexec.c +++ b/lib/libstdc/net/rexec.c @@ -1,3 +1,16 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +19,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rexec.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -18,15 +31,11 @@ static char sccsid[] = "@(#)rexec.c 5.2 (Berkeley) 3/9/86"; #include extern errno; -char *index(), *sprintf(); +/*char *index(), *sprintf();*/ int rexecoptions; -char *getpass(), *getlogin(); +/*char *getpass(), *getlogin();*/ -rexec(ahost, rport, name, pass, cmd, fd2p) - char **ahost; - int rport; - char *name, *pass, *cmd; - int *fd2p; { +int rexec(ahost, rport, name, pass, cmd, fd2p) char **ahost; int rport; char *name; char *pass; char *cmd; int *fd2p; { int s, timo = 1, s3; struct sockaddr_in sin, sin2, from; char c; diff --git a/lib/libstdc/net/route.h b/lib/libstdc/net/route.h index 0fc82da..9285430 100644 --- a/lib/libstdc/net/route.h +++ b/lib/libstdc/net/route.h @@ -1,3 +1,9 @@ +#ifndef _NET_ROUTE_H_ +#define _NET_ROUTE_H_ + +#include +#include + /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -78,3 +84,5 @@ struct mbuf *rthost[RTHASHSIZ]; struct mbuf *rtnet[RTHASHSIZ]; struct rtstat rtstat; #endif + +#endif diff --git a/lib/libstdc/net/ruserpass.c b/lib/libstdc/net/ruserpass.c index 971a62c..dc7726d 100644 --- a/lib/libstdc/net/ruserpass.c +++ b/lib/libstdc/net/ruserpass.c @@ -1,3 +1,16 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +19,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ruserpass.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -15,12 +28,29 @@ static char sccsid[] = "@(#)ruserpass.c 5.2 (Berkeley) 3/9/86"; #include #include -char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin(); -struct utmp *getutmp(); +/*char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin();*/ +/*struct utmp *getutmp();*/ static FILE *cfile; -ruserpass(host, aname, apass) - char *host, **aname, **apass; { +static renv __P((char *host, char **aname, char **apass)); +static char *renvlook __P((char *host)); +static rnetrc __P((char *host, char **aname, char **apass)); +static token __P((void)); +static char *nbsencrypt __P((char *str, char *key, char *result)); +static char *nbsdecrypt __P((char *cpt, char *key, char *result)); +static char *nbs8encrypt __P((char *str, char *key)); +static char *nbs8decrypt __P((char *crp, char *key)); +static enblkclr __P((char *blk, char *str)); +static char *deblkclr __P((char *blk)); +static enblknot __P((char *blk, char *crp)); +static char *deblknot __P((char *blk)); +static nbssetkey __P((char *key)); +static blkencrypt __P((char *block, int edflag)); +static struct utmp *getutmp __P((char *sttyname)); +static sreverse __P((register char *sto, register char *sfrom)); +static char *mkenvkey __P((int mch)); + +int ruserpass(host, aname, apass) char *host; char **aname; char **apass; { renv(host, aname, apass); if (*aname == 0 || *apass == 0) @@ -45,9 +75,7 @@ ruserpass(host, aname, apass) } } -static -renv(host, aname, apass) - char *host, **aname, **apass; { +static renv(host, aname, apass) char *host; char **aname; char **apass; { register char *cp; char *stemp, fgetlogin, *comma; @@ -72,10 +100,7 @@ renv(host, aname, apass) mkpwclear(cp, host[0], *apass); } -static -char * -renvlook(host) - char *host; { +static char *renvlook(host) char *host; { register char *cp, **env; extern char **environ; @@ -125,9 +150,7 @@ static struct toktab { 0, 0 }; -static -rnetrc(host, aname, apass) - char *host, **aname, **apass; { +static rnetrc(host, aname, apass) char *host; char **aname; char **apass; { char *hdir, buf[BUFSIZ]; int t; struct stat stb; @@ -193,8 +216,7 @@ done: fclose(cfile); } -static -token() { +static token() { char *cp; int c; struct toktab *t; @@ -232,8 +254,8 @@ token() { } /* rest is nbs.c stolen from berknet */ -char *deblknot(), *deblkclr(); -char *nbs8decrypt(), *nbs8encrypt(); +/*char *deblknot(), *deblkclr();*/ +/*char *nbs8decrypt(), *nbs8encrypt();*/ static char E[48]; /* @@ -249,10 +271,7 @@ static char e[] = { 24,25,26,27,28,29, 28,29,30,31,32, 1, }; -static -char *nbsencrypt(str,key,result) - char *result; - char *str, *key; { +static char *nbsencrypt(str, key, result) char *str; char *key; char *result; { static char buf[20],oldbuf[20]; register int j; result[0] = 0; @@ -266,10 +285,7 @@ char *nbsencrypt(str,key,result) } return(result); } -static -char *nbsdecrypt(cpt,key,result) - char *result; - char *cpt,*key; { +static char *nbsdecrypt(cpt, key, result) char *cpt; char *key; char *result; { char *s; char c,oldbuf[20]; result[0] = 0; @@ -286,9 +302,7 @@ char *nbsdecrypt(cpt,key,result) return(result); } -static -char *nbs8encrypt(str,key) -char *str, *key; { +static char *nbs8encrypt(str, key) char *str; char *key; { static char keyblk[100], blk[100]; register int i; @@ -302,9 +316,7 @@ char *str, *key; { return(deblknot(blk)); } -static -char *nbs8decrypt(crp,key) -char *crp, *key; { +static char *nbs8decrypt(crp, key) char *crp; char *key; { static char keyblk[100], blk[100]; register int i; @@ -318,9 +330,7 @@ char *crp, *key; { return(deblkclr(blk)); } -static -enblkclr(blk,str) /* ignores top bit of chars in string str */ -char *blk,*str; { +static enblkclr(blk, str) /* ignores top bit of chars in string str */ char *blk; char *str; { register int i,j; char c; for(i=0;i<70;i++)blk[i] = 0; @@ -331,9 +341,7 @@ char *blk,*str; { } } -static -char *deblkclr(blk) -char *blk; { +static char *deblkclr(blk) char *blk; { register int i,j; char c; static char iobuf[30]; @@ -349,10 +357,7 @@ char *blk; { return(iobuf); } -static -enblknot(blk,crp) -char *blk; -char *crp; { +static enblknot(blk, crp) char *blk; char *crp; { register int i,j; char c; for(i=0;i<70;i++)blk[i] = 0; @@ -365,9 +370,7 @@ char *crp; { } } -static -char *deblknot(blk) -char *blk; { +static char *deblknot(blk) char *blk; { register int i,j; char c; static char iobuf[30]; @@ -482,9 +485,7 @@ static char KS[16][48]; * Set up the key schedule from the key. */ -static -nbssetkey(key) -char *key; { +static nbssetkey(key) char *key; { register i, j, k; int t; @@ -527,7 +528,6 @@ char *key; { } } - /* * The 8 selection functions. * For some reason, they give a 0-origin @@ -606,9 +606,7 @@ static char preS[48]; * The payoff: encrypt a block. */ -static -blkencrypt(block, edflag) -char *block; { +static blkencrypt(block, edflag) char *block; int edflag; { int i, ii; register t, j, k; @@ -700,9 +698,7 @@ char *block; { Is version independent-- will work on v6 systems return NULL if error */ -static -struct utmp *getutmp(sttyname) -char *sttyname; { +static struct utmp *getutmp(sttyname) char *sttyname; { static struct utmp utmpstr; FILE *fdutmp; @@ -720,9 +716,7 @@ char *sttyname; { return(NULL); } -static -sreverse(sto, sfrom) - register char *sto, *sfrom; { +static sreverse(sto, sfrom) register char *sto; register char *sfrom; { register int i; i = strlen(sfrom); @@ -730,9 +724,7 @@ sreverse(sto, sfrom) *sto++ = sfrom[i--]; } -static -char *mkenvkey(mch) - char mch; { +static char *mkenvkey(mch) int mch; { static char skey[40]; register struct utmp *putmp; char stemp[40], stemp1[40], sttyname[30]; @@ -763,8 +755,7 @@ char *mkenvkey(mch) return (skey); } -mkpwunclear(spasswd,mch,sencpasswd) - char mch, *spasswd, *sencpasswd; { +int mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpasswd; { register char *skey; if (spasswd[0] == 0) { @@ -779,8 +770,7 @@ mkpwunclear(spasswd,mch,sencpasswd) nbsencrypt(spasswd, skey, sencpasswd); } -mkpwclear(sencpasswd,mch,spasswd) - char mch, *spasswd, *sencpasswd; { +int mkpwclear(sencpasswd, mch, spasswd) char *sencpasswd; int mch; char *spasswd; { register char *skey; if (sencpasswd[0] == 0) { diff --git a/lib/libstdc/netdb.h b/lib/libstdc/netdb.h index 762e4a5..81bb027 100644 --- a/lib/libstdc/netdb.h +++ b/lib/libstdc/netdb.h @@ -1,3 +1,6 @@ +#ifndef _NETDB_H_ +#define _NETDB_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -46,10 +49,10 @@ struct protoent { int p_proto; /* protocol # */ }; -struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent(); -struct netent *getnetbyname(), *getnetbyaddr(), *getnetent(); -struct servent *getservbyname(), *getservbyport(), *getservent(); -struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent(); +/*struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent();*/ +/*struct netent *getnetbyname(), *getnetbyaddr(), *getnetent();*/ +/*struct servent *getservbyname(), *getservbyport(), *getservent();*/ +/*struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent();*/ /* * Error return codes from gethostbyname() and gethostbyaddr() @@ -61,3 +64,70 @@ extern int h_errno; #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */ #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ #define NO_ADDRESS 4 /* Valid host name, no address, look for MX record */ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* net/getnetbyaddr.c */ +struct netent *getnetbyaddr __P((register int net, register int type)); + +/* net/getnetbyname.c */ +struct netent *getnetbyname __P((register char *name)); + +/* net/getnetent.c */ +int setnetent __P((int f)); +int endnetent __P((void)); +struct netent *getnetent __P((void)); + +/* net/getproto.c */ +struct protoent *getprotobynumber __P((register int proto)); + +/* net/getprotoent.c */ +int setprotoent __P((int f)); +int endprotoent __P((void)); +struct protoent *getprotoent __P((void)); + +/* net/getprotoname.c */ +struct protoent *getprotobyname __P((register char *name)); + +/* net/getservbyname.c */ +struct servent *getservbyname __P((char *name, char *proto)); + +/* net/getservbyport.c */ +struct servent *getservbyport __P((int port, char *proto)); + +/* net/getservent.c */ +int setservent __P((int f)); +int endservent __P((void)); +struct servent *getservent __P((void)); + +/* net/hosttable/gethostent.c */ +int sethostent __P((int f)); +int endhostent __P((void)); +struct hostent *gethostent __P((void)); +int sethostfile __P((char *file)); + +/* net/hosttable/gethostnamadr.c */ +struct hostent *gethostbyname __P((register char *nam)); +struct hostent *gethostbyaddr __P((char *addr, register int length, register int type)); + +/* net/named/gethostnamadr.c */ +struct hostent *gethostbyname __P((char *name)); +struct hostent *gethostbyaddr __P((char *addr, int len, int type)); +int _sethtent __P((int f)); +int _endhtent __P((void)); +struct hostent *_gethtent __P((void)); +struct hostent *_gethtbyname __P((char *name)); +struct hostent *_gethtbyaddr __P((char *addr, int len, int type)); + +/* net/named/sethostent.c */ +int sethostent __P((int stayopen)); +int endhostent __P((void)); +int sethostfile __P((char *name)); + +#endif diff --git a/lib/libstdc/netimp/if_imp.h b/lib/libstdc/netimp/if_imp.h index 32535ac..75e9835 100644 --- a/lib/libstdc/netimp/if_imp.h +++ b/lib/libstdc/netimp/if_imp.h @@ -1,3 +1,9 @@ +#ifndef _NETIMP_IF_IMP_H_ +#define _NETIMP_IF_IMP_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -158,3 +164,5 @@ char *impleaders[IMPTYPE_READY+1] = { "NOTIFY", "TRYING", "READY" }; #endif + +#endif diff --git a/lib/libstdc/netimp/if_imphost.h b/lib/libstdc/netimp/if_imphost.h index 3b7bf4b..7b5460e 100644 --- a/lib/libstdc/netimp/if_imphost.h +++ b/lib/libstdc/netimp/if_imphost.h @@ -1,3 +1,12 @@ +#ifndef _NETIMP_IF_IMPHOST_H_ +#define _NETIMP_IF_IMPHOST_H_ + +#include +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -85,7 +94,9 @@ struct hmbuf { }; #ifdef KERNEL -struct host *hostlookup(); -struct host *hostenter(); -struct mbuf *hostdeque(); +/*struct host *hostlookup();*/ +/*struct host *hostenter();*/ +/*struct mbuf *hostdeque();*/ +#endif + #endif diff --git a/lib/libstdc/netinet/icmp_var.h b/lib/libstdc/netinet/icmp_var.h index 482615a..2c50dc5 100644 --- a/lib/libstdc/netinet/icmp_var.h +++ b/lib/libstdc/netinet/icmp_var.h @@ -1,3 +1,8 @@ +#ifndef _NETINET_ICMP_VAR_H_ +#define _NETINET_ICMP_VAR_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -28,3 +33,5 @@ struct icmpstat { #ifdef KERNEL struct icmpstat icmpstat; #endif + +#endif diff --git a/lib/libstdc/netinet/if_ether.h b/lib/libstdc/netinet/if_ether.h index 20167e8..fb3d97a 100644 --- a/lib/libstdc/netinet/if_ether.h +++ b/lib/libstdc/netinet/if_ether.h @@ -1,3 +1,11 @@ +#ifndef _NETINET_IF_ETHER_H_ +#define _NETINET_IF_ETHER_H_ + +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -50,7 +58,6 @@ 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 @@ -75,6 +82,8 @@ struct arptab { #ifdef KERNEL u_char etherbroadcastaddr[6]; -struct arptab *arptnew(); -char *ether_sprintf(); +/*struct arptab *arptnew();*/ +/*char *ether_sprintf();*/ +#endif + #endif diff --git a/lib/libstdc/netinet/in.h b/lib/libstdc/netinet/in.h index 3a59f1d..9c2d9f8 100644 --- a/lib/libstdc/netinet/in.h +++ b/lib/libstdc/netinet/in.h @@ -1,3 +1,10 @@ +#ifndef _NETINET_IN_H_ +#define _NETINET_IN_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -26,7 +33,6 @@ #define IPPROTO_RAW 255 /* raw IP packet */ #define IPPROTO_MAX 256 - /* * Ports < IPPORT_RESERVED are reserved for * privileged processes (e.g. root). @@ -109,6 +115,8 @@ struct sockaddr_in { #ifdef KERNEL extern struct domain inetdomain; extern struct protosw inetsw[]; -struct in_addr in_makeaddr(); -u_long in_netof(), in_lnaof(); +/*struct in_addr in_makeaddr();*/ +/*u_long in_netof(), in_lnaof();*/ +#endif + #endif diff --git a/lib/libstdc/netinet/in_pcb.h b/lib/libstdc/netinet/in_pcb.h index bba0e0f..693202e 100644 --- a/lib/libstdc/netinet/in_pcb.h +++ b/lib/libstdc/netinet/in_pcb.h @@ -1,3 +1,10 @@ +#ifndef _NETINET_IN_PCB_H_ +#define _NETINET_IN_PCB_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -34,5 +41,7 @@ struct inpcb { #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) #ifdef KERNEL -struct inpcb *in_pcblookup(); +/*struct inpcb *in_pcblookup();*/ +#endif + #endif diff --git a/lib/libstdc/netinet/in_systm.h b/lib/libstdc/netinet/in_systm.h index 1825d88..60d7a12 100644 --- a/lib/libstdc/netinet/in_systm.h +++ b/lib/libstdc/netinet/in_systm.h @@ -1,3 +1,8 @@ +#ifndef _NETINET_IN_SYSTM_H_ +#define _NETINET_IN_SYSTM_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -25,5 +30,7 @@ typedef u_long n_long; /* long as received from the net */ typedef u_long n_time; /* ms since 00:00 GMT, byte rev */ #ifdef KERNEL -n_time iptime(); +/*n_time iptime();*/ +#endif + #endif diff --git a/lib/libstdc/netinet/in_var.h b/lib/libstdc/netinet/in_var.h index 9225938..5871183 100644 --- a/lib/libstdc/netinet/in_var.h +++ b/lib/libstdc/netinet/in_var.h @@ -1,3 +1,10 @@ +#ifndef _NETINET_IN_VAR_H_ +#define _NETINET_IN_VAR_H_ + +#include +#include +#include + /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,6 +45,8 @@ struct in_ifaddr { #ifdef KERNEL struct in_ifaddr *in_ifaddr; -struct in_ifaddr *in_iaonnetof(); +/*struct in_ifaddr *in_iaonnetof();*/ struct ifqueue ipintrq; /* ip packet input queue */ #endif + +#endif diff --git a/lib/libstdc/netinet/ip.h b/lib/libstdc/netinet/ip.h index 809778c..99a52a2 100644 --- a/lib/libstdc/netinet/ip.h +++ b/lib/libstdc/netinet/ip.h @@ -1,3 +1,10 @@ +#ifndef _NETINET_IP_H_ +#define _NETINET_IP_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -106,3 +113,5 @@ struct ip_timestamp { #define IPTTLDEC 1 /* subtracted when forwarding */ #define IP_MSS 576 /* default maximum segment size */ + +#endif diff --git a/lib/libstdc/netinet/ip_icmp.h b/lib/libstdc/netinet/ip_icmp.h index a342e31..6910786 100644 --- a/lib/libstdc/netinet/ip_icmp.h +++ b/lib/libstdc/netinet/ip_icmp.h @@ -1,3 +1,11 @@ +#ifndef _NETINET_IP_ICMP_H_ +#define _NETINET_IP_ICMP_H_ + +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -98,3 +106,5 @@ struct icmp { #define ICMP_MASKREPLY 18 /* address mask reply */ #define ICMP_MAXTYPE 18 + +#endif diff --git a/lib/libstdc/netinet/ip_var.h b/lib/libstdc/netinet/ip_var.h index d28c3f8..5c0f0cc 100644 --- a/lib/libstdc/netinet/ip_var.h +++ b/lib/libstdc/netinet/ip_var.h @@ -1,3 +1,10 @@ +#ifndef _NETINET_IP_VAR_H_ +#define _NETINET_IP_VAR_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -93,5 +100,7 @@ struct ipstat ipstat; struct ipq ipq; /* ip reass. queue */ u_short ip_id; /* ip packet ctr, for ids */ -struct mbuf *ip_srcroute(); +/*struct mbuf *ip_srcroute();*/ +#endif + #endif diff --git a/lib/libstdc/netinet/tcp.h b/lib/libstdc/netinet/tcp.h index 8409c43..1658f85 100644 --- a/lib/libstdc/netinet/tcp.h +++ b/lib/libstdc/netinet/tcp.h @@ -1,3 +1,11 @@ +#ifndef _NETINET_TCP_H_ +#define _NETINET_TCP_H_ + +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -54,3 +62,5 @@ struct tcphdr { */ #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ #define TCP_MAXSEG 0x02 /* set maximum segment size */ + +#endif diff --git a/lib/libstdc/netinet/tcp_debug.h b/lib/libstdc/netinet/tcp_debug.h index 3dd6279..732fc08 100644 --- a/lib/libstdc/netinet/tcp_debug.h +++ b/lib/libstdc/netinet/tcp_debug.h @@ -1,3 +1,11 @@ +#ifndef _NETINET_TCP_DEBUG_H_ +#define _NETINET_TCP_DEBUG_H_ + +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -30,3 +38,5 @@ char *tanames[] = #define TCP_NDEBUG 100 struct tcp_debug tcp_debug[TCP_NDEBUG]; int tcp_debx; + +#endif diff --git a/lib/libstdc/netinet/tcp_fsm.h b/lib/libstdc/netinet/tcp_fsm.h index 3ef9026..78d4a07 100644 --- a/lib/libstdc/netinet/tcp_fsm.h +++ b/lib/libstdc/netinet/tcp_fsm.h @@ -1,3 +1,10 @@ +#ifndef _NETINET_TCP_FSM_H_ +#define _NETINET_TCP_FSM_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -56,3 +63,5 @@ char *tcpstates[] = { "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT", }; #endif + +#endif diff --git a/lib/libstdc/netinet/tcp_seq.h b/lib/libstdc/netinet/tcp_seq.h index 14c2865..deddd92 100644 --- a/lib/libstdc/netinet/tcp_seq.h +++ b/lib/libstdc/netinet/tcp_seq.h @@ -1,3 +1,8 @@ +#ifndef _NETINET_TCP_SEQ_H_ +#define _NETINET_TCP_SEQ_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -33,3 +38,5 @@ #ifdef KERNEL tcp_seq tcp_iss; /* tcp initial send seq # */ #endif + +#endif diff --git a/lib/libstdc/netinet/tcp_timer.h b/lib/libstdc/netinet/tcp_timer.h index d6071fd..8aef842 100644 --- a/lib/libstdc/netinet/tcp_timer.h +++ b/lib/libstdc/netinet/tcp_timer.h @@ -1,3 +1,8 @@ +#ifndef _NETINET_TCP_TIMER_H_ +#define _NETINET_TCP_TIMER_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -108,3 +113,5 @@ float tcp_alpha, tcp_beta; if ((tv) > (tvmax)) \ (tv) = (tvmax); \ } + +#endif diff --git a/lib/libstdc/netinet/tcp_var.h b/lib/libstdc/netinet/tcp_var.h index f1745ea..4519727 100644 --- a/lib/libstdc/netinet/tcp_var.h +++ b/lib/libstdc/netinet/tcp_var.h @@ -1,3 +1,11 @@ +#ifndef _NETINET_TCP_VAR_H_ +#define _NETINET_TCP_VAR_H_ + +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -86,7 +94,9 @@ struct tcpstat { #ifdef KERNEL struct inpcb tcb; /* head of queue of active tcpcb's */ struct tcpstat tcpstat; /* tcp statistics */ -struct tcpiphdr *tcp_template(); -struct tcpcb *tcp_close(), *tcp_drop(); -struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed(); +/*struct tcpiphdr *tcp_template();*/ +/*struct tcpcb *tcp_close(), *tcp_drop();*/ +/*struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed();*/ +#endif + #endif diff --git a/lib/libstdc/netinet/tcpip.h b/lib/libstdc/netinet/tcpip.h index 8356c39..126a886 100644 --- a/lib/libstdc/netinet/tcpip.h +++ b/lib/libstdc/netinet/tcpip.h @@ -1,3 +1,9 @@ +#ifndef _NETINET_TCPIP_H_ +#define _NETINET_TCPIP_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -30,3 +36,5 @@ struct tcpiphdr { #define ti_win ti_t.th_win #define ti_sum ti_t.th_sum #define ti_urp ti_t.th_urp + +#endif diff --git a/lib/libstdc/netinet/udp.h b/lib/libstdc/netinet/udp.h index 6a7f020..6c25e77 100644 --- a/lib/libstdc/netinet/udp.h +++ b/lib/libstdc/netinet/udp.h @@ -1,3 +1,8 @@ +#ifndef _NETINET_UDP_H_ +#define _NETINET_UDP_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -16,3 +21,5 @@ struct udphdr { short uh_ulen; /* udp length */ u_short uh_sum; /* udp checksum */ }; + +#endif diff --git a/lib/libstdc/netinet/udp_var.h b/lib/libstdc/netinet/udp_var.h index cfca943..b6022fe 100644 --- a/lib/libstdc/netinet/udp_var.h +++ b/lib/libstdc/netinet/udp_var.h @@ -1,3 +1,10 @@ +#ifndef _NETINET_UDP_VAR_H_ +#define _NETINET_UDP_VAR_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -37,3 +44,5 @@ struct udpstat { struct inpcb udb; struct udpstat udpstat; #endif + +#endif diff --git a/lib/libstdc/netns/idp.h b/lib/libstdc/netns/idp.h index ba6eef8..19536c0 100644 --- a/lib/libstdc/netns/idp.h +++ b/lib/libstdc/netns/idp.h @@ -1,3 +1,9 @@ +#ifndef _NETNS_IDP_H_ +#define _NETNS_IDP_H_ + +#include +#include + /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,3 +23,5 @@ struct idp { struct ns_addr idp_dna; /* Destination Network Address */ struct ns_addr idp_sna; /* Source Network Address */ }; + +#endif diff --git a/lib/libstdc/netns/idp_var.h b/lib/libstdc/netns/idp_var.h index 0c86598..8171a15 100644 --- a/lib/libstdc/netns/idp_var.h +++ b/lib/libstdc/netns/idp_var.h @@ -1,3 +1,6 @@ +#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 @@ -20,3 +23,5 @@ struct idpstat { #ifdef KERNEL struct idpstat idpstat; #endif + +#endif diff --git a/lib/libstdc/netns/ns.h b/lib/libstdc/netns/ns.h index c111a2c..59b380f 100644 --- a/lib/libstdc/netns/ns.h +++ b/lib/libstdc/netns/ns.h @@ -1,3 +1,10 @@ +#ifndef _NETNS_NS_H_ +#define _NETNS_NS_H_ + +#include +#include +#include + /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -22,7 +29,6 @@ #define NSPROTO_RAW 255 /* Placemarker*/ #define NSPROTO_MAX 256 /* Placemarker*/ - /* * Port/Socket numbers: network standard functions */ @@ -55,7 +61,6 @@ #define SO_ALL_PACKETS 7 #define SO_MTU 8 - /* * NS addressing */ @@ -103,7 +108,7 @@ struct sockaddr_ns { #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \ ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0)) -/* moved this to net.h as it's shared by netns/ns.h */ +/* moved this to net.h as it's shared by netinet/in.h */ /*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ /* * Macros for number representation conversion. @@ -126,5 +131,21 @@ union ns_host ns_zerohost; union ns_host ns_broadhost; union ns_net ns_zeronet; union ns_net ns_broadnet; -u_short ns_cksum(); +/*u_short ns_cksum();*/ +#endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* 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 diff --git a/lib/libstdc/netns/ns_error.h b/lib/libstdc/netns/ns_error.h index c98119f..3d8760f 100644 --- a/lib/libstdc/netns/ns_error.h +++ b/lib/libstdc/netns/ns_error.h @@ -1,3 +1,9 @@ +#ifndef _NETNS_NS_ERROR_H_ +#define _NETNS_NS_ERROR_H_ + +#include +#include + /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -62,3 +68,5 @@ struct ns_errstat { #ifdef KERNEL struct ns_errstat ns_errstat; #endif + +#endif diff --git a/lib/libstdc/netns/ns_if.h b/lib/libstdc/netns/ns_if.h index a349ab4..1c254ad 100644 --- a/lib/libstdc/netns/ns_if.h +++ b/lib/libstdc/netns/ns_if.h @@ -1,3 +1,10 @@ +#ifndef _NETNS_NS_IF_H_ +#define _NETNS_NS_IF_H_ + +#include +#include +#include + /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -48,6 +55,8 @@ struct nsip_req { #ifdef KERNEL struct ns_ifaddr *ns_ifaddr; -struct ns_ifaddr *ns_iaonnetof(); +/*struct ns_ifaddr *ns_iaonnetof();*/ struct ifqueue nsintrq; /* XNS input packet queue */ #endif + +#endif diff --git a/lib/libstdc/netns/ns_pcb.h b/lib/libstdc/netns/ns_pcb.h index 06a8487..2343846 100644 --- a/lib/libstdc/netns/ns_pcb.h +++ b/lib/libstdc/netns/ns_pcb.h @@ -1,3 +1,10 @@ +#ifndef _NETNS_NS_PCB_H_ +#define _NETNS_NS_PCB_H_ + +#include +#include +#include + /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -46,8 +53,9 @@ struct nspcb { #define NSSNDQ 2048 #define NSRCVQ 2048 - #ifdef KERNEL struct nspcb nspcb; /* head of list */ -struct nspcb *ns_pcblookup(); +/*struct nspcb *ns_pcblookup();*/ +#endif + #endif diff --git a/lib/libstdc/netns/sp.h b/lib/libstdc/netns/sp.h index bf13709..53ee606 100644 --- a/lib/libstdc/netns/sp.h +++ b/lib/libstdc/netns/sp.h @@ -1,3 +1,8 @@ +#ifndef _NETNS_SP_H_ +#define _NETNS_SP_H_ + +#include + /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -23,3 +28,5 @@ struct sphdr { u_short sp_ack; /* acknowledge number */ u_short sp_alo; /* allocation number */ }; + +#endif diff --git a/lib/libstdc/netns/spidp.h b/lib/libstdc/netns/spidp.h index 10715ad..6d960e1 100644 --- a/lib/libstdc/netns/spidp.h +++ b/lib/libstdc/netns/spidp.h @@ -1,3 +1,9 @@ +#ifndef _NETNS_SPIDP_H_ +#define _NETNS_SPIDP_H_ + +#include +#include + /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -33,3 +39,5 @@ struct spidp_q { #define si_seq si_s.sp_seq #define si_ack si_s.sp_ack #define si_alo si_s.sp_alo + +#endif diff --git a/lib/libstdc/netns/spp_debug.h b/lib/libstdc/netns/spp_debug.h index 1f06c96..6431d9e 100644 --- a/lib/libstdc/netns/spp_debug.h +++ b/lib/libstdc/netns/spp_debug.h @@ -1,3 +1,10 @@ +#ifndef _NETNS_SPP_DEBUG_H_ +#define _NETNS_SPP_DEBUG_H_ + +#include +#include +#include + /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -30,3 +37,5 @@ char *sanames[] = #define SPP_NDEBUG 100 struct spp_debug spp_debug[SPP_NDEBUG]; int spp_debx; + +#endif diff --git a/lib/libstdc/netns/spp_var.h b/lib/libstdc/netns/spp_var.h index de0bb31..38bd523 100644 --- a/lib/libstdc/netns/spp_var.h +++ b/lib/libstdc/netns/spp_var.h @@ -1,3 +1,12 @@ +#ifndef _NETNS_SPP_VAR_H_ +#define _NETNS_SPP_VAR_H_ + +#include +#include +#include +#include +#include + /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -90,3 +99,5 @@ extern struct sppcb *spp_close(), *spp_disconnect(), #define SSEQ_LEQ(a,b) (((short)((a)-(b))) <= 0) #define SSEQ_GT(a,b) (((short)((a)-(b))) > 0) #define SSEQ_GEQ(a,b) (((short)((a)-(b))) >= 0) + +#endif diff --git a/lib/libstdc/nlist.h b/lib/libstdc/nlist.h index 6b5b8ba..82a9b4b 100644 --- a/lib/libstdc/nlist.h +++ b/lib/libstdc/nlist.h @@ -1,3 +1,6 @@ +#ifndef _NLIST_H_ +#define _NLIST_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -44,3 +47,16 @@ struct nlist { * Format for namelist values. */ #define N_FORMAT "%08x" + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/nlist.c */ +int nlist __P((char *name, struct nlist *list)); + +#endif diff --git a/lib/libstdc/ns.h b/lib/libstdc/ns.h new file mode 100644 index 0000000..953afdf --- /dev/null +++ b/lib/libstdc/ns.h @@ -0,0 +1,6 @@ +#ifndef _NS_H_ +#define _NS_H_ + +#include + +#endif diff --git a/lib/libstdc/ns/ns_addr.c b/lib/libstdc/ns/ns_addr.c index 007d57c..8fabb1c 100644 --- a/lib/libstdc/ns/ns_addr.c +++ b/lib/libstdc/ns/ns_addr.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,16 +15,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ns_addr.c 6.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include static struct ns_addr addr, zero_addr; -struct ns_addr -ns_addr(name) - char *name; { +static Field __P((char *buf, u_char *out, int len)); +static cvtbase __P((int oldbase, int newbase, int input[], int inlen, unsigned char result[], int reslen)); + +struct ns_addr ns_addr(name) char *name; { u_long net; u_short socket; char separator = '.'; @@ -62,11 +69,7 @@ ns_addr(name) return (addr); } -static -Field(buf, out, len) -char *buf; -u_char *out; -int len; { +static Field(buf, out, len) char *buf; u_char *out; int len; { register char *bp = buf; int i, ibase, base16 = 0, base10 = 0, clen = 0; int hb[6], *hp; @@ -165,13 +168,7 @@ int len; { cvtbase(ibase, 256, hb, i, out, len); } -static -cvtbase(oldbase,newbase,input,inlen,result,reslen) - int oldbase, newbase; - int input[]; - int inlen; - unsigned char result[]; - int reslen; { +static cvtbase(oldbase, newbase, input, inlen, result, reslen) int oldbase; int newbase; int input[]; int inlen; unsigned char result[]; int reslen; { int d, e; long sum; diff --git a/lib/libstdc/ns/ns_ntoa.c b/lib/libstdc/ns/ns_ntoa.c index 64a1d15..41ca351 100644 --- a/lib/libstdc/ns/ns_ntoa.c +++ b/lib/libstdc/ns/ns_ntoa.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -7,14 +12,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ns_ntoa.c 6.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include -char * -ns_ntoa(addr) -struct ns_addr addr; { +static char *spectHex __P((char *p0)); + +char *ns_ntoa(addr) struct ns_addr addr; { static char obuf[40]; char *spectHex(); union { union ns_net net_e; u_long long_e; } net; @@ -49,9 +54,7 @@ struct ns_addr addr; { return (obuf); } -static char * -spectHex(p0) -char *p0; { +static char *spectHex(p0) char *p0; { int ok = 0; int nonzero = 0; register char *p = p0; diff --git a/lib/libstdc/o.sh b/lib/libstdc/o.sh index 8412c64..ec96cfe 100755 --- a/lib/libstdc/o.sh +++ b/lib/libstdc/o.sh @@ -52,7 +52,7 @@ do if test -n "$pattern" then - grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `cat generated.txt |sed -e 's/$/\.nocomm/'` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a + grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `cat generated.txt |sed -e 's/$/\.nocomm/'` >a if test -s a then cat a >>$i.usedby diff --git a/lib/libstdc/oldprotos.txt b/lib/libstdc/oldprotos.txt new file mode 100644 index 0000000..5fb37bc --- /dev/null +++ b/lib/libstdc/oldprotos.txt @@ -0,0 +1,196 @@ +arpa/inet.h:unsigned long inet_addr(); +arpa/inet.h:char *inet_ntoa(); +arpa/inet.h:struct in_addr inet_makeaddr(); +arpa/inet.h:unsigned long inet_network(); +arpa/nameser.h:extern u_short getshort(); +arpa/nameser.h:extern u_long getlong(); +netdb.h:struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent(); +netdb.h:struct netent *getnetbyname(), *getnetbyaddr(), *getnetent(); +netdb.h:struct servent *getservbyname(), *getservbyport(), *getservent(); +netdb.h:struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent(); +math.h:extern double asinh(), acosh(), atanh(); +math.h:extern double erf(), erfc(); +math.h:extern double exp(), expm1(), log(), log10(), log1p(), pow(); +math.h:extern double fabs(), floor(), ceil(), rint(); +math.h:extern double lgamma(); +math.h:extern double hypot(), cabs(); +math.h:extern double copysign(), drem(), logb(), scalb(); +math.h:extern int finite(); +math.h:extern double infnan(); +math.h:extern double j0(), j1(), jn(), y0(), y1(), yn(); +math.h:extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2(); +math.h:extern double sinh(), cosh(), tanh(); +math.h:extern double cbrt(), sqrt(); +math.h:extern double modf(), ldexp(), frexp(), atof(); +stdio/flsbuf.c:char *malloc(); +stdio/fseek.c:long lseek(); +stdio/doscan.c:static char *_getccl(); +stdio/ftell.c:long lseek(); +stdio/findiop.c:extern char *calloc(); +stdio/popen.c:extern char *malloc(); +stdio/filbuf.c:char *malloc(); +compat-4.1/tell.c:long lseek(); +netimp/if_imphost.h:struct host *hostlookup(); +netimp/if_imphost.h:struct host *hostenter(); +netimp/if_imphost.h:struct mbuf *hostdeque(); +vaxuba/ubavar.h:extern Xua0int(), Xua1int(), Xua2int(), Xua3int(); +grp.h:struct group *getgrent(), *getgrgid(), *getgrnam(); +memory.h:extern char *memccpy(); +memory.h:extern char *memchr(); +memory.h:extern int memcmp(); +memory.h:extern char *memcpy(); +memory.h:extern char *memset(); +net/res_debug.c:extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); +net/res_debug.c:extern char *inet_ntoa(); +net/res_debug.c:extern char *sprintf(); +net/getnetent.c:static char *any(); +net/rexec.c:char *index(), *sprintf(); +net/rexec.c:char *getpass(), *getlogin(); +net/if.h:struct ifaddr *ifa_ifwithaddr(), *ifa_ifwithnet(); +net/if.h:struct ifaddr *ifa_ifwithdstaddr(); +net/rcmd.c:char *index(), *sprintf(); +net/ruserpass.c:char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin(); +net/ruserpass.c:struct utmp *getutmp(); +net/ruserpass.c:char *deblknot(), *deblkclr(); +net/ruserpass.c:char *nbs8decrypt(), *nbs8encrypt(); +net/getprotoent.c:static char *any(); +net/hosttable/gethostent.c:static char *any(); +net/named/gethostnamadr.c:static char *any(); +net/res_mkquery.c:extern char *sprintf(); +net/getservent.c:static char *any(); +vaxmba/mbavar.h:extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int(); +vax/inline/inline.h:char *newline(), *copyline(), *doreplaceon(); +pwd.h:struct passwd *getpwent(), *getpwuid(), *getpwnam(); +string.h:extern char *strcpyn(); +string.h:extern char *strcatn(); +string.h:extern int strcmpn(); +string.h:extern char *strchr(); +string.h:extern char *strrchr(); +string.h:extern char *strpbrk(); +string.h:extern int strspn(); +string.h:extern int strcspn(); +string.h:extern char *strtok(); +ttyent.h:extern struct ttyent *getttyent(); +ttyent.h:extern struct ttyent *getttynam(); +stdio.h:FILE *fopen(); +stdio.h:FILE *fdopen(); +stdio.h:FILE *freopen(); +stdio.h:FILE *popen(); +stdio.h:long ftell(); +stdio.h:char *fgets(); +stdio.h:char *gets(); +stdio.h:char *sprintf(); /* too painful to do right */ +resolv.h:extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); +netinet/ip_var.h:struct mbuf *ip_srcroute(); +netinet/if_ether.h:struct arptab *arptnew(); +netinet/if_ether.h:char *ether_sprintf(); +netinet/in_pcb.h:struct inpcb *in_pcblookup(); +netinet/in.h:struct in_addr in_makeaddr(); +netinet/in.h:u_long in_netof(), in_lnaof(); +netinet/in_systm.h:n_time iptime(); +netinet/in_var.h:struct in_ifaddr *in_iaonnetof(); +netinet/tcp_var.h:struct tcpiphdr *tcp_template(); +netinet/tcp_var.h:struct tcpcb *tcp_close(), *tcp_drop(); +netinet/tcp_var.h:struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed(); +vaxif/if_uba.h:struct mbuf *if_ubaget(); +ndbm.h:DBM *dbm_open(); +ndbm.h:void dbm_close(); +ndbm.h:datum dbm_fetch(); +ndbm.h:datum dbm_firstkey(); +ndbm.h:datum dbm_nextkey(); +ndbm.h:long dbm_forder(); +ndbm.h:int dbm_delete(); +ndbm.h:int dbm_store(); +sys/proc.h:struct proc *pfind(); +sys/buf.h:struct buf *alloc(); +sys/buf.h:struct buf *realloccg(); +sys/buf.h:struct buf *baddr(); +sys/buf.h:struct buf *getblk(); +sys/buf.h:struct buf *geteblk(); +sys/buf.h:struct buf *getnewbuf(); +sys/buf.h:struct buf *bread(); +sys/buf.h:struct buf *breada(); +sys/buf.h:unsigned minphys(); +sys/quota.h:struct quota *getquota(), *qfind(); +sys/quota.h:struct dquot *discquota(), *inoquota(), *dqalloc(), *dqp(); +sys/socketvar.h:struct socket *sonewconn(); +sys/systm.h:daddr_t bmap(); +sys/systm.h:caddr_t calloc(); +sys/systm.h:int memall(); +sys/systm.h:int vmemall(); +sys/systm.h:caddr_t wmemall(); +sys/systm.h:swblk_t vtod(); +sys/protosw.h:extern struct protosw *pffindproto(), *pffindtype(); +sys/un.h:int unp_discard(); +sys/cmap.h:struct cmap *mfind(); +sys/fs.h:struct fs *getfs(); +sys/fs.h:struct fs *mountfs(); +sys/file.h:struct file *getf(); +sys/file.h:struct file *falloc(); +sys/kernel.h:long rmalloc(); +sys/kernel.h:int realitexpire(); +sys/vmmac.h:struct pte *vtopte(); +sys/dir.h:extern DIR *opendir(); +sys/dir.h:extern struct direct *readdir(); +sys/dir.h:extern long telldir(); +sys/dir.h:extern void seekdir(); +sys/dir.h:extern void closedir(); +sys/inode.h:struct inode *ialloc(); +sys/inode.h:struct inode *iget(); +sys/inode.h:struct inode *ifind(); +sys/inode.h:struct inode *owner(); +sys/inode.h:struct inode *maknode(); +sys/inode.h:struct inode *namei(); +sys/inode.h:ino_t dirpref(); +sys/mbuf.h:struct mbuf *m_get(),*m_getclr(),*m_free(),*m_more(),*m_copy(),*m_pullup(); +sys/mbuf.h:caddr_t m_clalloc(); +gen/getenv.c:char *nvmatch(); +gen/ttyslot.c:char *ttyname(); +gen/ttyslot.c:char *rindex(); +gen/ndbm.c:static datum makdatum(); +gen/ndbm.c:static long hashinc(); +gen/ndbm.c:static long dcalchash(); +gen/valloc.c:char *malloc(); +gen/ecvt.c:char *cvt(); +gen/disktab.c:static char *dgetstr(); +gen/disktab.c:static char *dskip(); +gen/disktab.c:static char *ddecode(); +gen/getwd.c:char *strcpy(); +gen/ctime.c:struct tm *gmtime(); +gen/ctime.c:char *ct_numb(); +gen/ctime.c:struct tm *localtime(); +gen/ctime.c:char *ctime(); +gen/ctime.c:char *ct_num(); +gen/ctime.c:char *asctime(); +gen/initgroups.c:struct group *getgrent(); +gen/gcvt.c:char *ecvt(); +gen/ttyname.c:char *strcpy(); +gen/ttyname.c:char *strcat(); +gen/getusershell.c:extern char **initshells(); +gen/malloc.c:extern char *sbrk(); +gen/execvp.c:char *execat(), *getenv(); +fstab.h:struct fstab *getfsent(); +fstab.h:struct fstab *getfsspec(); +fstab.h:struct fstab *getfsfile(); +fstab.h:struct fstab *getfstype(); +fstab.h:int setfsent(); +fstab.h:int endfsent(); +net.h:u_short ntohs(), htons(); +net.h:u_long ntohl(), htonl(); +mp.h:extern MINT *itom(); +mp.h:extern short *xalloc(); +disktab.h:struct disktab *getdiskbyname(); +strings.h:char *strcat(); +strings.h:char *strncat(); +strings.h:int strcmp(); +strings.h:int strncmp(); +strings.h:char *strcpy(); +strings.h:char *strncpy(); +strings.h:int strlen(); +strings.h:char *index(); +strings.h:char *rindex(); +netns/ns.h:u_short ns_cksum(); +netns/ns_if.h:struct ns_ifaddr *ns_iaonnetof(); +netns/ns_pcb.h:struct nspcb *ns_pcblookup(); +time.h:extern struct tm *gmtime(), *localtime(); +time.h:extern char *asctime(), *ctime(); diff --git a/lib/libstdc/p.sh b/lib/libstdc/p.sh new file mode 100755 index 0000000..1473071 --- /dev/null +++ b/lib/libstdc/p.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +rm -f oldprotos.txt + +find . -name '*.[ch]' -print |\ +sed -e 's:^\./::' |\ +while read i +do + echo "i=$i" + grep -H '^[A-Za-z_][0-9A-Za-z_]*[^0-9A-Za-z_][^;]*[A-Za-z_][0-9A-Za-z_]*[ ]*([ ]*)[ ]*\(,[^;]*\)\?;' $i >>oldprotos.txt + sed -e 's/^[A-Za-z_][0-9A-Za-z_]*[^0-9A-Za-z_][^;]*[A-Za-z_][0-9A-Za-z_]*[ ]*([ ]*)[ ]*\(,[^;]*\)\?;/\/\*&\*\//' -i $i +done + +grep '\.h:' oldprotos.txt >oldprotos.temp + +rm -f machine +ln -s vax machine +rm -f frame.h +ln -s machine/frame.h frame.h + +while read i +do + set $i + i=$1 + echo "i=$i" + group=`echo $i |sed -ne 's/\/.*/\.h/p'` + echo "group=$group" + touch $group + if test $# -gt 1 + then + echo "$2" >>$group.uses + group=$2 + echo "group=$group" + touch $group + fi + ../../cproto-4.6/cproto -i. -Dvax -t -H -s $i |sed -ne '2,$p' >$i.protos + grep -v "^static " <$i.protos >a + if test -s a + then + ( + cat <>$group.protos + + protos="`sed -ne 's/^.*[^0-9A-Za-z_]\([A-Za-z_][0-9A-Za-z_]*\) __P((.*));$/\1/p' a`" + echo "protos=$protos" + + pattern= + prefix= + for j in $protos + do + pattern="$pattern$prefix$j" + prefix='\|' + done + echo "pattern=$pattern" + + grep "[^0-9A-Za-z_]\\($pattern\\)[ ]*(" oldprotos.temp >$i.oldprotos + grep -v "^$group:" $i.oldprotos + fi +done + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -113,7 +118,7 @@ # define PCC_INLINE 61 /* inline function */ /* no ASG */ # define PCC_UINLINE 63 /* inline with no arguments */ -# endif INLINE +# endif /* * Referencing and dereferencing. @@ -179,8 +184,7 @@ # define PCCF_FARIF 156 /* not implemented */ # define PCCF_FLABEL 157 /* an f77 label */ -# endif PCC_TOKENS - +# endif /* * Types, as encoded in intermediate file cookies. @@ -211,7 +215,6 @@ # define PCCTM_BASETYPE 017 # define PCCTM_TYPESHIFT 2 - /* * Useful macros. 'PCCOM' macros apply to ops. */ @@ -227,3 +230,5 @@ # define PCCM_ADDTYPE(t, m) \ ((((t) &~ PCCTM_BASETYPE) << PCCTM_TYPESHIFT) | \ (m) | ((t) & PCCTM_BASETYPE)) + +#endif diff --git a/lib/libstdc/protocols/dumprestore.h b/lib/libstdc/protocols/dumprestore.h index fc576ec..9cb8503 100644 --- a/lib/libstdc/protocols/dumprestore.h +++ b/lib/libstdc/protocols/dumprestore.h @@ -1,3 +1,9 @@ +#ifndef _PROTOCOLS_DUMPRESTORE_H_ +#define _PROTOCOLS_DUMPRESTORE_H_ + +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -55,3 +61,5 @@ union u_spcl { #define DUMPOUTFMT "%-16s %c %s" /* for printf */ /* name, incno, ctime(date) */ #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ + +#endif diff --git a/lib/libstdc/protocols/routed.h b/lib/libstdc/protocols/routed.h index ad7a61c..079ac1a 100644 --- a/lib/libstdc/protocols/routed.h +++ b/lib/libstdc/protocols/routed.h @@ -1,3 +1,9 @@ +#ifndef _PROTOCOLS_ROUTED_H_ +#define _PROTOCOLS_ROUTED_H_ + +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -62,3 +68,5 @@ char *ripcmds[RIPCMD_MAX] = #define EXPIRE_TIME 180 /* time to mark entry invalid */ #define GARBAGE_TIME 240 /* time to garbage collect */ + +#endif diff --git a/lib/libstdc/protocols/rwhod.h b/lib/libstdc/protocols/rwhod.h index 745c4b1..0bc2dc8 100644 --- a/lib/libstdc/protocols/rwhod.h +++ b/lib/libstdc/protocols/rwhod.h @@ -1,3 +1,6 @@ +#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 @@ -32,3 +35,5 @@ struct whod { #define WHODVERSION 1 #define WHODTYPE_STATUS 1 /* host status */ + +#endif diff --git a/lib/libstdc/protocols/talkd.h b/lib/libstdc/protocols/talkd.h index b932862..727d602 100644 --- a/lib/libstdc/protocols/talkd.h +++ b/lib/libstdc/protocols/talkd.h @@ -1,3 +1,9 @@ +#ifndef _PROTOCOLS_TALKD_H_ +#define _PROTOCOLS_TALKD_H_ + +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,8 +12,8 @@ * @(#)talkd.h 5.2 (Berkeley) 3/13/86 */ -#include -#include +/*#include */ +/*#include */ /* * This describes the protocol used by the talk server and clients. * @@ -82,3 +88,5 @@ typedef struct { #define MAX_LIFE 60 /* max time daemon saves invitations */ /* RING_WAIT should be 10's of seconds less than MAX_LIFE */ #define RING_WAIT 30 /* time to wait before resending invitation */ + +#endif diff --git a/lib/libstdc/protocols/timed.h b/lib/libstdc/protocols/timed.h index 786d9d8..d8a0b8f 100644 --- a/lib/libstdc/protocols/timed.h +++ b/lib/libstdc/protocols/timed.h @@ -1,3 +1,10 @@ +#ifndef _PROTOCOLS_TIMED_H_ +#define _PROTOCOLS_TIMED_H_ + +#include +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -65,3 +72,5 @@ char *tsptype[TSPTYPENUMBER] = "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ", "TEST", "SETDATE", "SETDATEREQ", "LOOP" }; #endif + +#endif diff --git a/lib/libstdc/pwd.h b/lib/libstdc/pwd.h index 6954fd7..6e132c5 100644 --- a/lib/libstdc/pwd.h +++ b/lib/libstdc/pwd.h @@ -1,3 +1,6 @@ +#ifndef _PWD_H_ +#define _PWD_H_ + /* pwd.h 4.1 83/05/03 */ struct passwd { /* see getpwent(3) */ @@ -12,4 +15,24 @@ struct passwd { /* see getpwent(3) */ char *pw_shell; }; -struct passwd *getpwent(), *getpwuid(), *getpwnam(); +/*struct passwd *getpwent(), *getpwuid(), *getpwnam();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/getpwent.c */ +int setpwent __P((void)); +int endpwent __P((void)); +struct passwd *getpwent __P((void)); +int setpwfile __P((char *file)); + +/* gen/getpwnamuid.c */ +struct passwd *getpwnam __P((char *nam)); +struct passwd *getpwuid __P((int uid)); + +#endif diff --git a/lib/libstdc/q.sh b/lib/libstdc/q.sh index 8a77585..741d0ef 100755 --- a/lib/libstdc/q.sh +++ b/lib/libstdc/q.sh @@ -1,86 +1,173 @@ #!/bin/sh -# this step is not essential -# it makes various checks -# it then generates groups.temp which is manually edited to groups.txt +sed -e 's/^/:/;s/ /::/g;s/$/:/' conflicts.temp -# checking header loops -grep -H '^#include <[^>]*>' `find . -name '*.h' -print` |\ -sed -e 's/^\.\/\(.*\):#include <\(.*\)>/\1 \2/' |\ -tsort >a - -# checking headers compile -find . -name '*.h' -print |\ +find . \( -name '*.[ch]' -o -name '*.[ch].protos' \) -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 + ../../xify/nocomment <$i |../../xify/nostring >$i.nocomm done -rm -f temp.c -# removing useless extra header inclusions that are pulled in anyway -rm -f a find . -name '*.h' -print |\ -sed -e 's:\./::' |\ +sed -e 's:^\./::' |\ +LC_ALL=C sort -r |\ 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` + macros="`sed -ne 's/^#[ ]*define[ ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' $i.nocomm |grep -v '^\(NULL\)$'`" + echo "macros=$macros" + typedefs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?typedef[^0-9A-Za-z_]\(.*[^0-9A-Za-z_]\)\?\([A-Za-z_][0-9A-Za-z_]*\)[ ]*\(\[[ 0-9]*\][ ]*\)\?;.*/\3/p' $i.nocomm; sed -ne 's/^}[ ]*\([A-Za-z_][0-9A-Za-z_]*\)[ ]*;.*/\1/p' $i.nocomm`" + echo "typedefs=$typedefs" + structs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?struct[ ]\+\([A-Za-z_][0-9A-Za-z_]*\)[ ]*{.*/\2/p' $i.nocomm`" + echo "structs=$structs" + unions="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?union[ ]\+\([A-Za-z_][0-9A-Za-z_]*\)[ ]*{.*/\2/p' $i.nocomm`" + echo "unions=$unions" + protos= + if test -f $i.protos.nocomm + then + protos="`sed -ne 's/^.*[^0-9A-Za-z_]\([A-Za-z_][0-9A-Za-z_]*\) __P((.*));$/\1/p' $i.protos`" + fi + echo "protos=$protos" + + rm -f $i.usedby + + prefix0= + pattern0= + + pattern1= + prefix1= + for j in $macros + do + pattern1="$pattern1$prefix1$j" + prefix1='\|' + done + for j in $typedefs + do + pattern1="$pattern1$prefix1$j" + prefix1='\|' + done + for j in $structs + do + pattern1="$pattern1${prefix1}struct[ ]\\+$j" + prefix1='\|' + done + for j in $unions do - case $j in - *.h) - echo "$i $j" >>a - pattern="$pattern$prefix$j" - prefix='\|' - ;; - esac + pattern1="$pattern1${prefix1}union[ ]\\+$j" + prefix1='\|' done - echo "pattern=$pattern" - if test -n "$pattern" + echo "pattern1=$pattern1" + if test -n "$pattern1" + then + pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^0-9A-Za-z_].*\\)\\?" + prefix0='\|' + fi + + pattern1= + prefix1= + for j in $protos + do + pattern1="$pattern1$prefix1$j" + prefix1='\|' + done + echo "pattern1=$pattern1" + if test -n "$pattern1" + then + pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)[ ]*(.*" + prefix0='\|' + fi + + echo "pattern0=$pattern0" + + if test -n "$pattern0" then - grep -H "^#include <$i>$" `find . -name '*.[ch]' -print` >b - if test -s b + grep -H "^\\($pattern0\\)$" `find . \( -name '*.c.nocomm' -o -name '*.protos.nocomm' \) -print |sed -e 's:^\./::'` |grep -v "^$i\.protos.nocomm:" >a + if test -s a then - for j in `sed -e 's/:.*//' b` + cat a >>$i.usedby + for j in `sed -e 's/\.protos\.nocomm:.*//; s/\.nocomm:.*//' $" $j >c - mv c $j + if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp + then + echo $i >>$j.uses + fi done fi fi -done -rm -f temp.c -tsort b -# show headers each c file includes, to suggest where its prototype should go -rm groups.temp -find . -name '*.c' -print |\ -sed -e 's:\./::' |\ -LC=ALL sort |\ -while read i -do - echo "i=$i" - headers=$i - for j in `sed -ne 's/^#include <\([^>]*\)>$/\1/p' $i |grep -v '^\(ctype\.h\|sys\/errno\.h\|sys\/param\.h\|sys\/types\.h\|varargs\.h\)$'` + pattern0= + prefix0= + + pattern1= + prefix1= + for j in $macros do - headers="$headers $j" + pattern1="$pattern1$prefix1$j" + prefix1='\|' done - echo "headers=$headers" - echo "$headers" >>groups.temp -done + for j in $typedefs + do + pattern1="$pattern1$prefix1$j" + prefix1='\|' + done + echo "pattern1=$pattern1" + if test -n "$pattern1" + then + pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^0-9A-Za-z_].*\\)\\?" + prefix0='\|' + fi + + pattern1= + prefix1= + for j in $structs + do + pattern1="$pattern1${prefix1}struct[ ]\\+$j" + prefix1='\|' + done + for j in $unions + do + pattern1="$pattern1${prefix1}union[ ]\\+$j" + prefix1='\|' + done + echo "pattern1=$pattern1" + if test -n "$pattern1" + then + pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^ *0-9A-Za-z_].*\\|[ ]\\+\\([^*].*\\)\\?\\)\\?" + prefix0='\|' + fi -#find . -name '*.c' -print |\ -#sed -e 's:\./::' |\ -#while read i -#do -# echo "i=$i" -# ../../cproto-4.6/cproto -i. -Dvax -DNCMD=1 -DNRSP=1 -t -H $i >$i.protos -# sed -e 's/va_start(ap)/_va_start(ap, fmt)/;s/^#include $/#ifdef __STDC__\n#include \n#define _va_start(ap, arg) va_start(ap, arg)\n#else\n#include \n#define _va_start(ap, arg) va_start(ap)\n#endif/' -i $i -#done + pattern1= + prefix1= + for j in $protos + do + pattern1="$pattern1$prefix1$j" + prefix1='\|' + done + echo "pattern1=$pattern1" + if test -n "$pattern1" + then + pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)[ ]*(.*" + prefix0='\|' + fi + + echo "pattern0=$pattern0" + + if test -n "$pattern0" + then + grep -H "^\\($pattern0\\)$" `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:.*//' >$j.uses + fi + done + fi + fi +done diff --git a/lib/libstdc/r.sh b/lib/libstdc/r.sh index 93a07be..4b91403 100755 --- a/lib/libstdc/r.sh +++ b/lib/libstdc/r.sh @@ -1,113 +1,86 @@ #!/bin/sh +find . -name '*.h' -print |\ +sed -e 's:^\./::' |\ while read i do - set $i - i=$1 echo "i=$i" - group=`echo $i |sed -ne 's/\/.*/\.h/p'` - echo "group=$group" - if ! test -f $group - then - name=_`echo $group |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_ - echo "name=$name" - cat <$group -#ifndef $name -#define $name - - -#endif -EOF - fi - if test $# -gt 1 - then - if ! grep -q "^#include <$2>$" $group - then - sed -e "4i#include <$2>" -i $group - fi - group=$2 - echo "group=$group" - if ! test -f $group - then - name=_`echo $group |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_ - echo "name=$name" - cat <$group -#ifndef $name -#define $name - - -#endif -EOF - fi - fi - if ! grep -q "^#include <$group>$" $i - then - sed -e "1i#include <$group>" -i $i - fi - #../../cproto-4.6/cproto -E "/lib/cpp -nostdinc" -I. -Dvax -DNCMD=1 -DNRSP=1 $i | sed -ne '2,$p' >a - #../../cproto-4.6/cproto -E "/lib/cpp -nostdinc" -I. -Dvax -DNCMD=1 -DNRSP=1 -S $i |sed -ne '2,$p' >b - #../../cproto-4.6/cproto -i. -Dvax -DNCMD=1 -DNRSP=1 -t -H $i - ../../cproto-4.6/cproto -i. -Dvax -DNCMD=1 -DNRSP=1 -t -H -s $i |sed -ne '2,$p' >a; grep "^static " a >b; grep -v "^static " a >c; mv c a - sed -e 's/va_start(ap)/_va_start(ap, fmt)/;s/^#include $/#ifdef __STDC__\n#include \n#define _va_start(ap, arg) va_start(ap, arg)\n#else\n#include \n#define _va_start(ap, arg) va_start(ap)\n#endif/' -i $i - if test -s a + rm -f xx* + csplit -b '%05d' -q $i '/^#/' '{*}' + if test -f xx00001 && ! ../../xify/nocomment >$group.append - if test -s b + for j in xx* + do + : + done + echo "j=$j" + define="`sed -ne 's/^#[ ]*ifndef[ ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' xx00001`" + echo "define=$define" + if test -n "$define" && grep -q '^#[ ]*endif$' $j && ! grep -v "^#" $j |../../xify/nocomment |grep -q '[^ ]' then - pattern="`sed -ne 's/\\*/\\\\*/g;1s/ __P((.*/(/p' a`" - echo "pattern=$pattern" - rm -f xx* - csplit -q $i "/^$pattern/" - for j in xx* + sed -e "s/^#[ ]*ifndef[ ]\\+$define/\\/\\*&\\*\\//" -i xx00001 + sed -e "s/^\\(#[ ]*define[ ]\\+$define\\)[ ]*$/\\/\\*\1\\*\\//" -i xx00002 + sed -e 's/^#[ ]*endif$/\/\*&\*\//' -i $j + cat xx* >a + iflevel=0 + for j in `sed -ne 's/^#[ ]*\(if\|ifdef\|ifndef\)[^0-9A-Za-z_].*/1/p; s/^#[ ]*endif$/-1/p' a` do - : + iflevel=`expr $iflevel + $j` + if test $iflevel -lt 0 + then + break + fi done - if test $j = xx01 + echo "iflevel=$iflevel" + if test $iflevel -eq 0 then - ( - cat xx00 b - echo - cat xx01 - ) >$i + mv a $i fi fi fi -done $' $i - then - sed -e '4i#ifdef __STDC__\ -#include \ -#endif' -i $i - fi - rm -f xx* - csplit -b '%05d' -q $i '/^#/' '{*}' + csplit -b '%05d' -q $i '/^#[ ]*include[^0-9A-Za-z_]/' '{*}' for j in xx* do - : - done - if test `wc -l <$j` -eq 1 && grep -q "^#endif$" $j - then - ( + sed -e 's/^#[ ]*include[ ]*\(<[^>]*>\|"[^"]*"\)/\/\*&\*\//' -i $j + if grep -v "^#[ ]*include[^0-9A-Za-z_]" $j |../../xify/nocomment |grep -q '[^ ]' + then + break + fi + done + cat xx* >$i +done + +find . -name '*.h' -print |\ +sed -e 's:^\./::' |\ +while read i +do + echo "i=$i" + name=_`echo $i |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_ + echo "name=$name" + ( + cat </; s/^#include $/#ifdef __STDC__\n#include \n#endif/' + echo + fi + cat $i + if test -s $i.protos + then cat <$j - cat xx* >$i - fi + ) |../../xify/newline >a + mv a $i done -#find . -name '*.[ch]' -print |\ -#sed -e 's:^\./::' |\ -#while read i -#do -# echo "i=$i" -# ../../xify/newline <$i >a -# mv a $i -#done +find . -name '*.c' -print |\ +sed -e 's:^\./::' |\ +while read i +do + echo "i=$i" + if test -s $i.protos && grep '^static ' $i.protos >a + then + pattern="`sed -ne '1{s/\*/\\\*/g; s/ __P((.*));/(/p}' $i.protos`" + echo "pattern=$pattern" + rm -f xx* + csplit -q $i "/^$pattern/" + if test -f xx01 + then + ( + echo + cat xx01 + ) >>a + fi + cat xx00 a >$i + fi + ( + if test -s $i.uses + then + sort <$i.uses |uniq |sed -e 's/.*/#include <&>/; s/^#include $/#ifdef __STDC__\n#include \n#define _va_start(ap, arg) va_start(ap, arg)\n#else\n#include \n#define _va_start(ap, arg) va_start(ap)\n#endif/' + echo + fi + sed -e 's/\([^0-9A-Za-z_]\)va_start(ap);/\1_va_start(ap, fmt);/' $i + ) |../../xify/newline >a + mv a $i +done diff --git a/lib/libstdc/ranlib.h b/lib/libstdc/ranlib.h index 936ba34..7ea58a1 100644 --- a/lib/libstdc/ranlib.h +++ b/lib/libstdc/ranlib.h @@ -1,3 +1,8 @@ +#ifndef _RANLIB_H_ +#define _RANLIB_H_ + +#include + /* ranlib.h 4.1 83/05/03 */ /* @@ -15,3 +20,5 @@ struct ranlib { } ran_un; off_t ran_off; /* library member at this offset */ }; + +#endif diff --git a/lib/libstdc/resolv.h b/lib/libstdc/resolv.h index ec5ff75..4221471 100644 --- a/lib/libstdc/resolv.h +++ b/lib/libstdc/resolv.h @@ -1,3 +1,9 @@ +#ifndef _RESOLV_H_ +#define _RESOLV_H_ + +#include +#include +#include /* * Copyright (c) 1983 Regents of the University of California. @@ -11,10 +17,8 @@ * 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 */ @@ -40,4 +44,6 @@ struct state { #define RES_STAYOPEN 0x0100 /* Keep TCP socket open */ extern struct state _res; -extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); +/*extern char *p_cdname(), *p_rr(), *p_type(), *p_class();*/ + +#endif diff --git a/lib/libstdc/s.sh b/lib/libstdc/s.sh deleted file mode 100755 index f4edf54..0000000 --- a/lib/libstdc/s.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/bin/sh - -sed -e 's/^/:/;s/ /::/g;s/$/:/' conflicts.temp - -find . -name '*.[ch]' -print |\ -sed -e 's:\./::' |\ -while read i -do - ../../xify/nocomment <$i |../../xify/nostring >$i.nocomm -done - -find . -name '*.h.append' -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" - macros="`sed -ne 's/^#[ ]*define[ ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' $i |grep -v '^\(NULL\|__P\)$'`" - echo "macros=$macros" - typedefs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?typedef[^0-9A-Za-z_]\(.*[^0-9A-Za-z_]\)\?\([A-Za-z_][0-9A-Za-z_]*\)[ ]*\(\[[ 0-9]*\][ ]*\)\?;.*/\3/p' $i; sed -ne 's/^}[ ]*\([A-Za-z_][0-9A-Za-z_]*\)[ ]*;.*/\1/p' $i`" - echo "typedefs=$typedefs" - structs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?struct[ ]\+\([A-Za-z_][0-9A-Za-z_]*\)[ ]*{.*/\2/p' $i`" - echo "structs=$structs" - unions="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?union[ ]\+\([A-Za-z_][0-9A-Za-z_]*\)[ ]*{.*/\2/p' $i`" - echo "unions=$unions" - protos="`sed -ne 's/^.*[^0-9A-Za-z_]\([A-Za-z_][0-9A-Za-z_]*\) __P((.*));$/\1/p' $i`" - echo "protos=$protos" - - rm -f $i.usedby - - prefix0= - pattern0= - - pattern1= - prefix1= - for j in $macros - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - for j in $typedefs - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - for j in $structs - do - pattern1="$pattern1${prefix1}struct[ ]\\+$j" - prefix1='\|' - done - for j in $unions - do - pattern1="$pattern1${prefix1}union[ ]\\+$j" - prefix1='\|' - done - echo "pattern1=$pattern1" - if test -n "$pattern1" - then - pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^0-9A-Za-z_].*\\)\\?" - prefix0='\|' - fi - - pattern1= - prefix1= - for j in $protos - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - echo "pattern1=$pattern1" - if test -n "$pattern1" - then - pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)[ ]*(.*" - prefix0='\|' - fi - - echo "pattern0=$pattern0" - - if test -n "$pattern0" - then - grep -H "^\\($pattern0\\)$" `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:.*//' \$" $j - then - sed -e "1i#include <$i>" -i $j - fi - done - fi - - grep -H "^\\($pattern0\\)$" `find . -name '*.h.append.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.append.nocomm:" >a - if test -s a - then - cat a >>$i.usedby - for j in `sed -e 's/\.append.nocomm:.*//' \$" $j - then - sed -e "4i#include <$i>" -i $j - fi - done - fi - fi - - pattern0= - prefix0= - - pattern1= - prefix1= - for j in $macros - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - for j in $typedefs - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - echo "pattern1=$pattern1" - if test -n "$pattern1" - then - pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^0-9A-Za-z_].*\\)\\?" - prefix0='\|' - fi - - pattern1= - prefix1= - for j in $structs - do - pattern1="$pattern1${prefix1}struct[ ]\\+$j" - prefix1='\|' - done - for j in $unions - do - pattern1="$pattern1${prefix1}union[ ]\\+$j" - prefix1='\|' - done - echo "pattern1=$pattern1" - if test -n "$pattern1" - then - pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^ *0-9A-Za-z_].*\\|[ ]\\+\\([^*].*\\)\\?\\)\\?" - prefix0='\|' - fi - - pattern1= - prefix1= - for j in $protos - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - echo "pattern1=$pattern1" - if test -n "$pattern1" - then - pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)[ ]*(.*" - prefix0='\|' - fi - - echo "pattern0=$pattern0" - - if test -n "$pattern0" - then - grep -H "^\\($pattern0\\)$" `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:.*//' \$" $j - then - sed -e "4i#include <$i>" -i $j - fi - done - fi - fi -done diff --git a/lib/libstdc/setjmp.h b/lib/libstdc/setjmp.h index a8c173c..2123c17 100644 --- a/lib/libstdc/setjmp.h +++ b/lib/libstdc/setjmp.h @@ -1,3 +1,27 @@ +#ifndef _SETJMP_H_ +#define _SETJMP_H_ + /* setjmp.h 4.1 83/05/03 */ typedef int jmp_buf[10]; + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/_setjmp.c */ +int _setjmp __P((jmp_buf e)); +void _longjmp __P((jmp_buf e, int v)); + +/* 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 diff --git a/lib/libstdc/sgtty.h b/lib/libstdc/sgtty.h index e1186ca..cc1d2da 100644 --- a/lib/libstdc/sgtty.h +++ b/lib/libstdc/sgtty.h @@ -1,5 +1,12 @@ -/* sgtty.h 4.2 85/01/03 */ +#ifndef _SGTTY_H_ +#define _SGTTY_H_ -#ifndef _IOCTL_ #include + +/* sgtty.h 4.2 85/01/03 */ + +/*#ifndef _IOCTL_*/ +/*#include */ +/*#endif*/ + #endif diff --git a/lib/libstdc/signal.h b/lib/libstdc/signal.h deleted file mode 120000 index df1896d..0000000 --- a/lib/libstdc/signal.h +++ /dev/null @@ -1 +0,0 @@ -sys/signal.h \ No newline at end of file diff --git a/lib/libstdc/signal.h b/lib/libstdc/signal.h new file mode 100644 index 0000000..2a50070 --- /dev/null +++ b/lib/libstdc/signal.h @@ -0,0 +1,121 @@ +#ifndef _SIGNAL_H_ +#define _SIGNAL_H_ + +#include + +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)signal.h 7.1 (Berkeley) 6/4/86 + */ + +#ifndef NSIG +#define NSIG 32 + +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 /* illegal instruction (not reset when caught) */ +#define ILL_RESAD_FAULT 0x0 /* reserved addressing fault */ +#define ILL_PRIVIN_FAULT 0x1 /* privileged instruction fault */ +#define ILL_RESOP_FAULT 0x2 /* reserved operand fault */ +/* CHME, CHMS, CHMU are not yet given back to users reasonably */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGIOT 6 /* IOT instruction */ +#define SIGABRT SIGIOT /* compatibility */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 /* floating point exception */ +#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ +#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ +#define FPE_FLTOVF_TRAP 0x3 /* floating overflow */ +#define FPE_FLTDIV_TRAP 0x4 /* floating/decimal divide by zero */ +#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ +#define FPE_DECOVF_TRAP 0x6 /* decimal overflow */ +#define FPE_SUBRNG_TRAP 0x7 /* subscript out of range */ +#define FPE_FLTOVF_FAULT 0x8 /* floating overflow fault */ +#define FPE_FLTDIV_FAULT 0x9 /* divide by zero floating fault */ +#define FPE_FLTUND_FAULT 0xa /* floating underflow fault */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ +#define SIGURG 16 /* urgent condition on IO channel */ +#define SIGSTOP 17 /* sendable stop signal not from tty */ +#define SIGTSTP 18 /* stop signal from tty */ +#define SIGCONT 19 /* continue a stopped process */ +#define SIGCHLD 20 /* to parent on child stop or exit */ +#define SIGCLD SIGCHLD /* compatibility */ +#define SIGTTIN 21 /* to readers pgrp upon background tty read */ +#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ +#define SIGIO 23 /* input/output possible signal */ +#define SIGXCPU 24 /* exceeded CPU time limit */ +#define SIGXFSZ 25 /* exceeded file size limit */ +#define SIGVTALRM 26 /* virtual time alarm */ +#define SIGPROF 27 /* profiling time alarm */ +#define SIGWINCH 28 /* window size changes */ +#define SIGUSR1 30 /* user defined signal 1 */ +#define SIGUSR2 31 /* user defined signal 2 */ + +#ifndef KERNEL +int (*signal())(); +#endif + +/* + * Signal vector "template" used in sigvec call. + */ +struct sigvec { + int (*sv_handler)(); /* signal handler */ + int sv_mask; /* signal mask to apply */ + int sv_flags; /* see signal options below */ +}; +#define SV_ONSTACK 0x0001 /* take signal on signal stack */ +#define SV_INTERRUPT 0x0002 /* do not restart system on signal return */ +#define sv_onstack sv_flags /* isn't compatibility wonderful! */ + +/* + * Structure used in sigstack call. + */ +struct sigstack { + char *ss_sp; /* signal stack pointer */ + int ss_onstack; /* current status */ +}; + +/* + * Information pushed on stack when a signal is delivered. + * This is used by the kernel to restore state following + * execution of the signal handler. It is also made available + * to the handler to allow it to properly restore state if + * a non-standard exit is performed. + */ +struct sigcontext { + int sc_onstack; /* sigstack state to restore */ + int sc_mask; /* signal mask to restore */ + int sc_sp; /* sp to restore */ + int sc_fp; /* fp to restore */ + int sc_ap; /* ap to restore */ + int sc_pc; /* pc to restore */ + int sc_ps; /* psl to restore */ +}; + +#define BADSIG (int (*)())-1 +#define SIG_DFL (int (*)())0 +#define SIG_IGN (int (*)())1 + +#ifdef KERNEL +#define SIG_CATCH (int (*)())2 +#define SIG_HOLD (int (*)())3 +#endif +#endif + +/* + * Macro for converting signal number to a mask suitable for + * sigblock(). + */ +#define sigmask(m) (1 << ((m)-1)) + +#endif diff --git a/lib/libstdc/stab.h b/lib/libstdc/stab.h index d7547d4..8eeac29 100644 --- a/lib/libstdc/stab.h +++ b/lib/libstdc/stab.h @@ -1,3 +1,6 @@ +#ifndef _STAB_H_ +#define _STAB_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -40,3 +43,5 @@ * for the berkeley pascal compiler, pc(1): */ #define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */ + +#endif diff --git a/lib/libstdc/stdio.h b/lib/libstdc/stdio.h index ca9648c..89fe1b9 100644 --- a/lib/libstdc/stdio.h +++ b/lib/libstdc/stdio.h @@ -1,3 +1,11 @@ +#ifndef _STDIO_H_ +#define _STDIO_H_ + +#include +#ifdef __STDC__ +#include +#endif + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +14,7 @@ * @(#)stdio.h 5.3 (Berkeley) 3/15/86 */ -# ifndef FILE +/*# ifndef FILE*/ #define BUFSIZ 1024 extern struct _iobuf { int _cnt; @@ -35,7 +43,7 @@ extern struct _iobuf { #define stderr (&_iob[2]) #ifndef lint #define getc(p) (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p)) -#endif not lint +#endif #define getchar() getc(stdin) #ifndef lint #define putc(x, p) (--(p)->_cnt >= 0 ?\ @@ -45,21 +53,152 @@ extern struct _iobuf { (int)(*(unsigned char *)(p)->_ptr++) :\ _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\ _flsbuf((unsigned char)(x), p))) -#endif not lint +#endif #define putchar(x) putc(x,stdout) #define feof(p) (((p)->_flag&_IOEOF)!=0) #define ferror(p) (((p)->_flag&_IOERR)!=0) #define fileno(p) ((p)->_file) #define clearerr(p) ((p)->_flag &= ~(_IOERR|_IOEOF)) -FILE *fopen(); -FILE *fdopen(); -FILE *freopen(); -FILE *popen(); -long ftell(); -char *fgets(); -char *gets(); +/*FILE *fopen();*/ +/*FILE *fdopen();*/ +/*FILE *freopen();*/ +/*FILE *popen();*/ +/*long ftell();*/ +/*char *fgets();*/ +/*char *gets();*/ #if 0 /*def vax*/ -char *sprintf(); /* too painful to do right */ +/*char *sprintf();*/ /* too painful to do right */ +#endif +/*# endif*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* stdio/clrerr.c */ +int clearerr __P((register FILE *iop)); + +/* stdio/doprnt.c */ +int _doprnt __P((u_char *fmt0, va_list argp, register FILE *fp)); + +/* stdio/doscan.c */ +int _doscan __P((FILE *iop, register char *fmt, register va_list ap)); + +/* stdio/exit.c */ +int exit __P((int code)); + +/* stdio/fdopen.c */ +FILE *fdopen __P((int fd, register char *mode)); + +/* stdio/fgetc.c */ +int fgetc __P((FILE *fp)); + +/* stdio/fgets.c */ +char *fgets __P((char *s, int n, register FILE *iop)); + +/* stdio/filbuf.c */ +int _filbuf __P((register FILE *iop)); + +/* stdio/findiop.c */ +FILE *_findiop __P((void)); +int _f_morefiles __P((void)); +int f_prealloc __P((void)); +int _fwalk __P((register int (*function)(void))); +int _cleanup __P((void)); + +/* stdio/flsbuf.c */ +int _flsbuf __P((int c, register FILE *iop)); +int fflush __P((register FILE *iop)); +int fclose __P((register FILE *iop)); + +/* stdio/fopen.c */ +FILE *fopen __P((char *file, register char *mode)); + +/* stdio/fprintf.c */ +int fprintf __P((register FILE *iop, char *fmt, ...)); + +/* stdio/fputc.c */ +int fputc __P((int c, register FILE *fp)); + +/* stdio/fputs.c */ +int fputs __P((register char *s, register FILE *iop)); + +/* stdio/fread.c */ +int fread __P((register char *ptr, unsigned size, unsigned count, register FILE *iop)); + +/* stdio/freopen.c */ +FILE *freopen __P((char *file, register char *mode, register FILE *iop)); + +/* stdio/fseek.c */ +int fseek __P((register FILE *iop, long offset, int ptrname)); + +/* stdio/ftell.c */ +long ftell __P((register FILE *iop)); + +/* stdio/fwrite.c */ +int fwrite __P((register char *ptr, unsigned size, unsigned count, register FILE *iop)); + +/* stdio/getchar.c */ +int getchar __P((void)); + +/* stdio/gets.c */ +char *gets __P((char *s)); + +/* stdio/getw.c */ +int getw __P((register FILE *iop)); + +/* stdio/popen.c */ +FILE *popen __P((char *cmd, char *mode)); +int pclose __P((FILE *ptr)); + +/* stdio/printf.c */ +int printf __P((char *fmt, ...)); + +/* stdio/putchar.c */ +int putchar __P((register c)); + +/* stdio/puts.c */ +int puts __P((register char *s)); + +/* stdio/putw.c */ +int putw __P((int w, register FILE *iop)); + +/* stdio/rew.c */ +int rewind __P((register FILE *iop)); + +/* stdio/scanf.c */ +int scanf __P((char *fmt, ...)); +int fscanf __P((FILE *iop, char *fmt, ...)); +int sscanf __P((register char *str, char *fmt, ...)); + +/* stdio/setbuf.c */ +int setbuf __P((register FILE *iop, char *buf)); + +/* stdio/setbuffer.c */ +int setbuffer __P((register FILE *iop, char *buf, int size)); +int setlinebuf __P((register FILE *iop)); + +/* stdio/sprintf.c */ +int sprintf __P((char *str, char *fmt, ...)); + +/* stdio/strout.c */ +int _strout __P((register count, register char *string, int adjust, register FILE *file, int fillch)); + +/* stdio/ungetc.c */ +int ungetc __P((int c, register FILE *iop)); + +/* stdio/vfprintf.c */ +int vfprintf __P((FILE *iop, char *fmt, va_list ap)); + +/* stdio/vprintf.c */ +int vprintf __P((char *fmt, va_list ap)); + +/* stdio/vsprintf.c */ +int vsprintf __P((char *str, char *fmt, va_list ap)); + #endif -# endif diff --git a/lib/libstdc/stdio/clrerr.c b/lib/libstdc/stdio/clrerr.c index d16b2f7..dc11e4e 100644 --- a/lib/libstdc/stdio/clrerr.c +++ b/lib/libstdc/stdio/clrerr.c @@ -1,11 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)clrerr.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #undef clearerr -clearerr(iop) - register FILE *iop; { +int clearerr(iop) register FILE *iop; { iop->_flag &= ~(_IOERR|_IOEOF); } diff --git a/lib/libstdc/stdio/doprnt.c b/lib/libstdc/stdio/doprnt.c index ce12bc6..67384db 100644 --- a/lib/libstdc/stdio/doprnt.c +++ b/lib/libstdc/stdio/doprnt.c @@ -1,3 +1,18 @@ +#include +#include +#include +#include +#include +#include +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -17,7 +32,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif #include #include @@ -53,10 +68,11 @@ static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; #define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ #define HEXPREFIX 0x40 /* add 0x or 0X prefix */ -_doprnt(fmt0, argp, fp) - u_char *fmt0; - va_list argp; - register FILE *fp; { +static cvt __P((double number, register int prec, int flags, char *signp, int fmtch, char *startp, char *endp)); +static char *round __P((double fract, int *exp, register char *start, register char *end, int ch, char *signp)); +static char *exponent __P((register char *p, register int exp, int fmtch)); + +int _doprnt(fmt0, argp, fp) u_char *fmt0; va_list argp; register FILE *fp; { register u_char *fmt; /* format string */ register int ch; /* character from fmt */ register int cnt; /* return value accumulator */ @@ -401,13 +417,7 @@ pforw: /* NOTREACHED */ } -static -cvt(number, prec, flags, signp, fmtch, startp, endp) - double number; - register int prec; - int flags; - u_char fmtch; - char *signp, *startp, *endp; { +static cvt(number, prec, flags, signp, fmtch, startp, endp) double number; register int prec; int flags; char *signp; int fmtch; char *startp; char *endp; { register char *p, *t; register double fract; int dotrim, expcnt, gformat; @@ -586,12 +596,7 @@ eformat: if (expcnt) { return(t - startp); } -static char * -round(fract, exp, start, end, ch, signp) - double fract; - int *exp; - register char *start, *end; - char ch, *signp; { +static char *round(fract, exp, start, end, ch, signp) double fract; int *exp; register char *start; register char *end; int ch; char *signp; { double tmp; if (fract) @@ -630,11 +635,7 @@ round(fract, exp, start, end, ch, signp) return(start); } -static char * -exponent(p, exp, fmtch) - register char *p; - register int exp; - u_char fmtch; { +static char *exponent(p, exp, fmtch) register char *p; register int exp; int fmtch; { register char *t; char expbuf[MAXEXP]; diff --git a/lib/libstdc/stdio/doscan.c b/lib/libstdc/stdio/doscan.c index 4da42b6..a1ffe88 100644 --- a/lib/libstdc/stdio/doscan.c +++ b/lib/libstdc/stdio/doscan.c @@ -1,6 +1,17 @@ +#include +#include +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)doscan.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -15,7 +26,7 @@ static char sccsid[] = "@(#)doscan.c 5.2 (Berkeley) 3/9/86"; #define INT 0 #define FLOAT 1 -static char *_getccl(); +/*static char *_getccl();*/ static char _sctab[256] = { 0,0,0,0,0,0,0,0, @@ -28,10 +39,11 @@ static char _sctab[256] = { 0,0,0,0,0,0,0,0, }; -_doscan(iop, fmt, ap) -FILE *iop; -register char *fmt; -register va_list ap; { +static _innum __P((int *ptr, int type, int len, int size, FILE *iop, int *eofptr)); +static _instr __P((register char *ptr, int type, int len, register FILE *iop, int *eofptr)); +static char *_getccl __P((register unsigned char *s)); + +int _doscan(iop, fmt, ap) FILE *iop; register char *fmt; register va_list ap; { register int ch; int nmatch, len, ch1; int *ptr, fileended, size; @@ -98,10 +110,7 @@ register va_list ap; { } } -static -_innum(ptr, type, len, size, iop, eofptr) -int *ptr, *eofptr; -FILE *iop; { +static _innum(ptr, type, len, size, iop, eofptr) int *ptr; int type; int len; int size; FILE *iop; int *eofptr; { extern double atof(); register char *np; char numbuf[64]; @@ -206,11 +215,7 @@ FILE *iop; { return(1); } -static -_instr(ptr, type, len, iop, eofptr) -register char *ptr; -register FILE *iop; -int *eofptr; { +static _instr(ptr, type, len, iop, eofptr) register char *ptr; int type; int len; register FILE *iop; int *eofptr; { register ch; register char *optr; int ignstp; @@ -250,9 +255,7 @@ int *eofptr; { return(0); } -static char * -_getccl(s) -register unsigned char *s; { +static char *_getccl(s) register unsigned char *s; { register c, t; t = 0; diff --git a/lib/libstdc/stdio/exit.c b/lib/libstdc/stdio/exit.c index faf4229..f9ee999 100644 --- a/lib/libstdc/stdio/exit.c +++ b/lib/libstdc/stdio/exit.c @@ -1,9 +1,13 @@ +#include +#include +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)exit.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif -exit(code) - int code; { +int exit(code) int code; { _cleanup(); _exit(code); diff --git a/lib/libstdc/stdio/fdopen.c b/lib/libstdc/stdio/fdopen.c index f2a9706..3079a52 100644 --- a/lib/libstdc/stdio/fdopen.c +++ b/lib/libstdc/stdio/fdopen.c @@ -1,3 +1,7 @@ +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +10,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fdopen.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Unix routine to do an "fopen" on file descriptor @@ -18,9 +22,7 @@ static char sccsid[] = "@(#)fdopen.c 5.2 (Berkeley) 3/9/86"; #include #include -FILE * -fdopen(fd, mode) - register char *mode; { +FILE *fdopen(fd, mode) int fd; register char *mode; { extern FILE *_findiop(); static int nofile = -1; register FILE *iop; diff --git a/lib/libstdc/stdio/fgetc.c b/lib/libstdc/stdio/fgetc.c index 20ea7c4..7a33d9a 100644 --- a/lib/libstdc/stdio/fgetc.c +++ b/lib/libstdc/stdio/fgetc.c @@ -1,10 +1,11 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fgetc.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -fgetc(fp) -FILE *fp; { +int fgetc(fp) FILE *fp; { return(getc(fp)); } diff --git a/lib/libstdc/stdio/fgets.c b/lib/libstdc/stdio/fgets.c index 3d714d5..542c92d 100644 --- a/lib/libstdc/stdio/fgets.c +++ b/lib/libstdc/stdio/fgets.c @@ -1,13 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fgets.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -char * -fgets(s, n, iop) -char *s; -register FILE *iop; { +char *fgets(s, n, iop) char *s; int n; register FILE *iop; { register c; register char *cs; diff --git a/lib/libstdc/stdio/filbuf.c b/lib/libstdc/stdio/filbuf.c index 67b4a8c..d9f683c 100644 --- a/lib/libstdc/stdio/filbuf.c +++ b/lib/libstdc/stdio/filbuf.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,15 +11,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)filbuf.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include #include -char *malloc(); +/*char *malloc();*/ -_filbuf(iop) -register FILE *iop; { +int _filbuf(iop) register FILE *iop; { int size; struct stat stbuf; extern char *_smallbuf; diff --git a/lib/libstdc/stdio/findiop.c b/lib/libstdc/stdio/findiop.c index 2451132..738dea7 100644 --- a/lib/libstdc/stdio/findiop.c +++ b/lib/libstdc/stdio/findiop.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1983, 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +12,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)findiop.c 5.6 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -23,7 +29,7 @@ FILE _iob[NSTATIC] = { { 0, NULL, NULL, 0, _IOWRT|_IONBF, 2 }, /* stderr */ }; -extern char *calloc(); +/*extern char *calloc();*/ static char sbuf[NSTATIC]; char *_smallbuf = sbuf; @@ -39,8 +45,7 @@ static FILE **endglue; * If none are available, then we allocate a structure to glue together * the old and new FILE entries, which are then no longer contiguous. */ -FILE * -_findiop() { +FILE *_findiop() { register FILE **iov, *iop; register FILE *fp; @@ -68,7 +73,7 @@ _findiop() { return (*iov); } -_f_morefiles() { +int _f_morefiles() { register FILE **iov; register FILE *fp; register char *cp; @@ -89,7 +94,7 @@ _f_morefiles() { return (1); } -f_prealloc() { +int f_prealloc() { register FILE **iov; register FILE *fp; @@ -101,8 +106,7 @@ f_prealloc() { *iov = (FILE *)calloc(1, sizeof **iov); } -_fwalk(function) - register int (*function)(); { +int _fwalk(function) register int (*function)(); { register FILE **iov; register FILE *fp; @@ -117,7 +121,7 @@ _fwalk(function) } } -_cleanup() { +int _cleanup() { extern int fclose(); _fwalk(fclose); diff --git a/lib/libstdc/stdio/flsbuf.c b/lib/libstdc/stdio/flsbuf.c index 5619b1e..940467a 100644 --- a/lib/libstdc/stdio/flsbuf.c +++ b/lib/libstdc/stdio/flsbuf.c @@ -1,3 +1,9 @@ +#include +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,17 +12,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)flsbuf.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include #include -char *malloc(); +/*char *malloc();*/ -_flsbuf(c, iop) -unsigned char c; -register FILE *iop; { +int _flsbuf(c, iop) int c; register FILE *iop; { register char *base; register n, rn; char c1; @@ -79,8 +83,7 @@ tryagain: return(c); } -fflush(iop) -register FILE *iop; { +int fflush(iop) register FILE *iop; { register char *base; register n; @@ -96,8 +99,7 @@ register FILE *iop; { return(0); } -fclose(iop) - register FILE *iop; { +int fclose(iop) register FILE *iop; { register int r; r = EOF; diff --git a/lib/libstdc/stdio/fopen.c b/lib/libstdc/stdio/fopen.c index c6b1c75..96cf8e0 100644 --- a/lib/libstdc/stdio/fopen.c +++ b/lib/libstdc/stdio/fopen.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,16 +11,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fopen.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include #include -FILE * -fopen(file, mode) - char *file; - register char *mode; { +FILE *fopen(file, mode) char *file; register char *mode; { register FILE *iop; register f, rw, oflags; extern FILE *_findiop(); diff --git a/lib/libstdc/stdio/fprintf.c b/lib/libstdc/stdio/fprintf.c index ac32b5f..3c9c84d 100644 --- a/lib/libstdc/stdio/fprintf.c +++ b/lib/libstdc/stdio/fprintf.c @@ -1,3 +1,12 @@ +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. @@ -17,20 +26,22 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif #include #include -fprintf(iop, fmt, va_alist) - register FILE *iop; - char *fmt; - va_dcl { +#ifdef __STDC__ +int fprintf(register FILE *iop, char *fmt, ...) +#else +int fprintf(iop, fmt, va_alist) register FILE *iop; char *fmt; va_dcl +#endif +{ va_list ap; int len; char localbuf[BUFSIZ]; - va_start(ap); + _va_start(ap, fmt); if (iop->_flag & _IONBF) { iop->_flag &= ~_IONBF; iop->_ptr = iop->_base = localbuf; diff --git a/lib/libstdc/stdio/fputc.c b/lib/libstdc/stdio/fputc.c index 9935612..035533d 100644 --- a/lib/libstdc/stdio/fputc.c +++ b/lib/libstdc/stdio/fputc.c @@ -1,10 +1,11 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fputc.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -fputc(c, fp) -register FILE *fp; { +int fputc(c, fp) int c; register FILE *fp; { return(putc(c, fp)); } diff --git a/lib/libstdc/stdio/fputs.c b/lib/libstdc/stdio/fputs.c index 2789ca3..9df1184 100644 --- a/lib/libstdc/stdio/fputs.c +++ b/lib/libstdc/stdio/fputs.c @@ -1,3 +1,5 @@ +#include + /* * Copyright (c) 1984 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +8,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fputs.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -fputs(s, iop) -register char *s; -register FILE *iop; { +int fputs(s, iop) register char *s; register FILE *iop; { register r = 0; register c; int unbuffered; diff --git a/lib/libstdc/stdio/fread.c b/lib/libstdc/stdio/fread.c index 0b827f4..ed7c25f 100644 --- a/lib/libstdc/stdio/fread.c +++ b/lib/libstdc/stdio/fread.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,14 +9,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fread.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -fread(ptr, size, count, iop) - register char *ptr; - unsigned size, count; - register FILE *iop; { +int fread(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; { register int s; int c; diff --git a/lib/libstdc/stdio/freopen.c b/lib/libstdc/stdio/freopen.c index 3eba83f..cfb15e3 100644 --- a/lib/libstdc/stdio/freopen.c +++ b/lib/libstdc/stdio/freopen.c @@ -1,3 +1,8 @@ +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,17 +11,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)freopen.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include #include -FILE * -freopen(file, mode, iop) - char *file; - register char *mode; - register FILE *iop; { +FILE *freopen(file, mode, iop) char *file; register char *mode; register FILE *iop; { register f, rw, oflags; rw = (mode[1] == '+'); diff --git a/lib/libstdc/stdio/fseek.c b/lib/libstdc/stdio/fseek.c index 717a57a..c5e27cc 100644 --- a/lib/libstdc/stdio/fseek.c +++ b/lib/libstdc/stdio/fseek.c @@ -1,6 +1,9 @@ +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fseek.c 5.3 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Seek for standard library. Coordinates with buffering. @@ -8,11 +11,9 @@ static char sccsid[] = "@(#)fseek.c 5.3 (Berkeley) 3/9/86"; #include -long lseek(); +/*long lseek();*/ -fseek(iop, offset, ptrname) - register FILE *iop; - long offset; { +int fseek(iop, offset, ptrname) register FILE *iop; long offset; int ptrname; { register resync, c; long p = -1; /* can't happen? */ diff --git a/lib/libstdc/stdio/ftell.c b/lib/libstdc/stdio/ftell.c index 60a4111..94e5ee5 100644 --- a/lib/libstdc/stdio/ftell.c +++ b/lib/libstdc/stdio/ftell.c @@ -1,6 +1,9 @@ +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ftell.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Return file offset. @@ -8,11 +11,9 @@ static char sccsid[] = "@(#)ftell.c 5.2 (Berkeley) 3/9/86"; */ #include -long lseek(); - +/*long lseek();*/ -long ftell(iop) -register FILE *iop; { +long ftell(iop) register FILE *iop; { register long tres; register adjust; diff --git a/lib/libstdc/stdio/fwrite.c b/lib/libstdc/stdio/fwrite.c index 234bbf3..ec53e37 100644 --- a/lib/libstdc/stdio/fwrite.c +++ b/lib/libstdc/stdio/fwrite.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,14 +9,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fwrite.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -fwrite(ptr, size, count, iop) - register char *ptr; - unsigned size, count; - register FILE *iop; { +int fwrite(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; { register int s; s = size * count; diff --git a/lib/libstdc/stdio/getchar.c b/lib/libstdc/stdio/getchar.c index 843efaa..5cf7f71 100644 --- a/lib/libstdc/stdio/getchar.c +++ b/lib/libstdc/stdio/getchar.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getchar.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * A subroutine version of the macro getchar. @@ -9,6 +11,6 @@ static char sccsid[] = "@(#)getchar.c 5.2 (Berkeley) 3/9/86"; #undef getchar -getchar() { +int getchar() { return(getc(stdin)); } diff --git a/lib/libstdc/stdio/gets.c b/lib/libstdc/stdio/gets.c index 82e99a6..bdfbc9b 100644 --- a/lib/libstdc/stdio/gets.c +++ b/lib/libstdc/stdio/gets.c @@ -1,12 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gets.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -char * -gets(s) -char *s; { +char *gets(s) char *s; { register c; register char *cs; diff --git a/lib/libstdc/stdio/getw.c b/lib/libstdc/stdio/getw.c index f6b62df..fcfe6e8 100644 --- a/lib/libstdc/stdio/getw.c +++ b/lib/libstdc/stdio/getw.c @@ -1,11 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getw.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -getw(iop) -register FILE *iop; { +int getw(iop) register FILE *iop; { register i; register char *p; int w; diff --git a/lib/libstdc/stdio/popen.c b/lib/libstdc/stdio/popen.c index 632460e..3fe1d24 100644 --- a/lib/libstdc/stdio/popen.c +++ b/lib/libstdc/stdio/popen.c @@ -1,3 +1,12 @@ +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +15,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -15,15 +24,12 @@ static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; #define RDR 0 #define WTR 1 -extern char *malloc(); +/*extern char *malloc();*/ static int *popen_pid; static int nfiles; -FILE * -popen(cmd,mode) - char *cmd; - char *mode; { +FILE *popen(cmd, mode) char *cmd; char *mode; { int p[2]; int myside, hisside, pid; @@ -60,8 +66,7 @@ popen(cmd,mode) return (fdopen(myside, mode)); } -pclose(ptr) - FILE *ptr; { +int pclose(ptr) FILE *ptr; { int child, pid, status, omask; child = popen_pid[fileno(ptr)]; diff --git a/lib/libstdc/stdio/printf.c b/lib/libstdc/stdio/printf.c index a9c2a4f..c173835 100644 --- a/lib/libstdc/stdio/printf.c +++ b/lib/libstdc/stdio/printf.c @@ -1,3 +1,12 @@ +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -17,18 +26,21 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif #include #include -printf(fmt, va_alist) - char *fmt; - va_dcl { +#ifdef __STDC__ +int printf(char *fmt, ...) +#else +int printf(fmt, va_alist) char *fmt; va_dcl +#endif +{ va_list ap; int len; - va_start(ap); + _va_start(ap, fmt); len = _doprnt(fmt, ap, stdout); va_end(ap); return(ferror(stdout) ? EOF : len); diff --git a/lib/libstdc/stdio/putchar.c b/lib/libstdc/stdio/putchar.c index cf27222..7c65b4a 100644 --- a/lib/libstdc/stdio/putchar.c +++ b/lib/libstdc/stdio/putchar.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)putchar.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * A subroutine version of the macro putchar @@ -9,7 +11,6 @@ static char sccsid[] = "@(#)putchar.c 5.2 (Berkeley) 3/9/86"; #undef putchar -putchar(c) -register c; { +int putchar(c) register c; { putc(c, stdout); } diff --git a/lib/libstdc/stdio/puts.c b/lib/libstdc/stdio/puts.c index 0289c91..9664963 100644 --- a/lib/libstdc/stdio/puts.c +++ b/lib/libstdc/stdio/puts.c @@ -1,11 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)puts.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -puts(s) -register char *s; { +int puts(s) register char *s; { register c; while (c = *s++) diff --git a/lib/libstdc/stdio/putw.c b/lib/libstdc/stdio/putw.c index 0a132c9..839fdef 100644 --- a/lib/libstdc/stdio/putw.c +++ b/lib/libstdc/stdio/putw.c @@ -1,11 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)putw.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -putw(w, iop) -register FILE *iop; { +int putw(w, iop) int w; register FILE *iop; { register char *p; register i; diff --git a/lib/libstdc/stdio/rew.c b/lib/libstdc/stdio/rew.c index 33af77d..2f54eaf 100644 --- a/lib/libstdc/stdio/rew.c +++ b/lib/libstdc/stdio/rew.c @@ -1,11 +1,13 @@ +#include +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rew.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -rewind(iop) -register FILE *iop; { +int rewind(iop) register FILE *iop; { fflush(iop); lseek(fileno(iop), 0L, 0); iop->_cnt = 0; diff --git a/lib/libstdc/stdio/scanf.c b/lib/libstdc/stdio/scanf.c index c7ded44..0f060cf 100644 --- a/lib/libstdc/stdio/scanf.c +++ b/lib/libstdc/stdio/scanf.c @@ -1,44 +1,60 @@ +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include #include -scanf(fmt, va_alist) -char *fmt; -va_dcl { +#ifdef __STDC__ +int scanf(char *fmt, ...) +#else +int scanf(fmt, va_alist) char *fmt; va_dcl +#endif +{ va_list ap; int len; - va_start(ap); + _va_start(ap, fmt); len = _doscan(stdin, fmt, &args); va_end(ap); return len; } -fscanf(iop, fmt, va_alist) -FILE *iop; -char *fmt; -va_dcl { +#ifdef __STDC__ +int fscanf(FILE *iop, char *fmt, ...) +#else +int fscanf(iop, fmt, va_alist) FILE *iop; char *fmt; va_dcl +#endif +{ va_list ap; int len; - va_start(ap); + _va_start(ap, fmt); len = _doscan(iop, fmt, &args); va_end(ap); return len; } -sscanf(str, fmt, va_alist) -register char *str; -char *fmt; -va_dcl { +#ifdef __STDC__ +int sscanf(register char *str, char *fmt, ...) +#else +int sscanf(str, fmt, va_alist) register char *str; char *fmt; va_dcl +#endif +{ FILE _strbuf; va_list ap; int len; - va_start(ap); + _va_start(ap, fmt); _strbuf._flag = _IOREAD|_IOSTRG; _strbuf._ptr = _strbuf._base = str; _strbuf._cnt = 0; diff --git a/lib/libstdc/stdio/setbuf.c b/lib/libstdc/stdio/setbuf.c index 1ace50a..1b895bb 100644 --- a/lib/libstdc/stdio/setbuf.c +++ b/lib/libstdc/stdio/setbuf.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,13 +9,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setbuf.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -setbuf(iop, buf) -register FILE *iop; -char *buf; { +int setbuf(iop, buf) register FILE *iop; char *buf; { if (iop->_base != NULL && iop->_flag&_IOMYBUF) free(iop->_base); iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); diff --git a/lib/libstdc/stdio/setbuffer.c b/lib/libstdc/stdio/setbuffer.c index 5250c95..f759878 100644 --- a/lib/libstdc/stdio/setbuffer.c +++ b/lib/libstdc/stdio/setbuffer.c @@ -1,3 +1,6 @@ +#include +#include + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,14 +9,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setbuffer.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -setbuffer(iop, buf, size) - register FILE *iop; - char *buf; - int size; { +int setbuffer(iop, buf, size) register FILE *iop; char *buf; int size; { if (iop->_base != NULL && iop->_flag&_IOMYBUF) free(iop->_base); iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); @@ -30,8 +30,7 @@ setbuffer(iop, buf, size) /* * set line buffering for either stdout or stderr */ -setlinebuf(iop) - register FILE *iop; { +int setlinebuf(iop) register FILE *iop; { char *buf; extern char *malloc(); diff --git a/lib/libstdc/stdio/sibuf.c b/lib/libstdc/stdio/sibuf.c index 691f250..6b93835 100644 --- a/lib/libstdc/stdio/sibuf.c +++ b/lib/libstdc/stdio/sibuf.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sibuf.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include diff --git a/lib/libstdc/stdio/sobuf.c b/lib/libstdc/stdio/sobuf.c index e0b63f2..db58746 100644 --- a/lib/libstdc/stdio/sobuf.c +++ b/lib/libstdc/stdio/sobuf.c @@ -1,6 +1,8 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sobuf.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include diff --git a/lib/libstdc/stdio/sprintf.c b/lib/libstdc/stdio/sprintf.c index 47fe97c..029bebd 100644 --- a/lib/libstdc/stdio/sprintf.c +++ b/lib/libstdc/stdio/sprintf.c @@ -1,3 +1,12 @@ +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -17,19 +26,22 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif #include #include -sprintf(str, fmt, va_alist) - char *str, *fmt; - va_dcl { +#ifdef __STDC__ +int sprintf(char *str, char *fmt, ...) +#else +int sprintf(str, fmt, va_alist) char *str; char *fmt; va_dcl +#endif +{ va_list ap; FILE _strbuf; int len; - va_start(ap); + _va_start(ap, fmt); _strbuf._flag = _IOWRT+_IOSTRG; _strbuf._ptr = str; _strbuf._cnt = 32767; diff --git a/lib/libstdc/stdio/strout.c b/lib/libstdc/stdio/strout.c index c239f27..c7579b7 100644 --- a/lib/libstdc/stdio/strout.c +++ b/lib/libstdc/stdio/strout.c @@ -1,14 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strout.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif #include -_strout(count, string, adjust, file, fillch) -register char *string; -register count; -int adjust; -register FILE *file; { +int _strout(count, string, adjust, file, fillch) register count; register char *string; int adjust; register FILE *file; int fillch; { while (adjust < 0) { if (*string=='-' && fillch=='0') { putc(*string++, file); diff --git a/lib/libstdc/stdio/ungetc.c b/lib/libstdc/stdio/ungetc.c index c4cf59b..f021a4f 100644 --- a/lib/libstdc/stdio/ungetc.c +++ b/lib/libstdc/stdio/ungetc.c @@ -1,11 +1,12 @@ +#include + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ungetc.c 5.3 (Berkeley) 3/26/86"; -#endif LIBC_SCCS and not lint +#endif #include -ungetc(c, iop) - register FILE *iop; { +int ungetc(c, iop) int c; register FILE *iop; { if (c == EOF || (iop->_flag & (_IOREAD|_IORW)) == 0 || iop->_ptr == NULL || iop->_base == NULL) return (EOF); diff --git a/lib/libstdc/stdio/vfprintf.c b/lib/libstdc/stdio/vfprintf.c index e930f0a..79adc6a 100644 --- a/lib/libstdc/stdio/vfprintf.c +++ b/lib/libstdc/stdio/vfprintf.c @@ -1,3 +1,12 @@ +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -17,16 +26,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif #include #include -int -vfprintf(iop, fmt, ap) - FILE *iop; - char *fmt; - va_list ap; { +int vfprintf(iop, fmt, ap) FILE *iop; char *fmt; va_list ap; { int len; char localbuf[BUFSIZ]; diff --git a/lib/libstdc/stdio/vprintf.c b/lib/libstdc/stdio/vprintf.c index f34655b..eb1a154 100644 --- a/lib/libstdc/stdio/vprintf.c +++ b/lib/libstdc/stdio/vprintf.c @@ -1,3 +1,12 @@ +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -17,15 +26,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif #include #include -int -vprintf(fmt, ap) - char *fmt; - va_list ap; { +int vprintf(fmt, ap) char *fmt; va_list ap; { int len; len = _doprnt(fmt, ap, stdout); diff --git a/lib/libstdc/stdio/vsprintf.c b/lib/libstdc/stdio/vsprintf.c index 0bc3e30..c42ab59 100644 --- a/lib/libstdc/stdio/vsprintf.c +++ b/lib/libstdc/stdio/vsprintf.c @@ -1,3 +1,12 @@ +#include +#ifdef __STDC__ +#include +#define _va_start(ap, arg) va_start(ap, arg) +#else +#include +#define _va_start(ap, arg) va_start(ap) +#endif + /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -17,15 +26,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; -#endif /* LIBC_SCCS and not lint */ +#endif #include #include -int -vsprintf(str, fmt, ap) - char *str, *fmt; - va_list ap; { +int vsprintf(str, fmt, ap) char *str; char *fmt; va_list ap; { FILE f; int len; diff --git a/lib/libstdc/string.h b/lib/libstdc/string.h index b9e5c45..564cf9f 100644 --- a/lib/libstdc/string.h +++ b/lib/libstdc/string.h @@ -1,3 +1,6 @@ +#ifndef _STRING_H_ +#define _STRING_H_ + /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,24 +9,61 @@ * @(#)string.h 5.1 (Berkeley) 85/08/05 */ -#include +/*#include */ /* * these next few are obsolete trash */ -extern char *strcpyn(); -extern char *strcatn(); -extern int strcmpn(); +/*extern char *strcpyn();*/ +/*extern char *strcatn();*/ +/*extern int strcmpn();*/ /* * and the rest are Sys5 functions supported just so * Sys5 progs will compile easily. */ -extern char *strchr(); -extern char *strrchr(); -extern char *strpbrk(); -extern int strspn(); -extern int strcspn(); -extern char *strtok(); +/*extern char *strchr();*/ +/*extern char *strrchr();*/ +/*extern char *strpbrk();*/ +/*extern int strspn();*/ +/*extern int strcspn();*/ +/*extern char *strtok();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-sys5/strcatn.c */ +char *strcatn __P((register char *s1, register char *s2, register n)); + +/* compat-sys5/strchr.c */ +char *strchr __P((register char *sp, int c)); + +/* compat-sys5/strcmpn.c */ +int strcmpn __P((register char *s1, register char *s2, register n)); + +/* compat-sys5/strcpyn.c */ +char *strcpyn __P((register char *s1, register char *s2, int n)); + +/* compat-sys5/strcspn.c */ +int strcspn __P((register char *s, register char *set)); + +/* compat-sys5/strpbrk.c */ +char *strpbrk __P((register char *s, register char *brk)); + +/* compat-sys5/strrchr.c */ +char *strrchr __P((register char *sp, int c)); + +/* compat-sys5/strspn.c */ +int strspn __P((register char *s, register char *set)); + +/* compat-sys5/strtok.c */ +char *strtok __P((register char *s, register char *sep)); + +#endif diff --git a/lib/libstdc/strings.h b/lib/libstdc/strings.h index 2b69a31..d387e0a 100644 --- a/lib/libstdc/strings.h +++ b/lib/libstdc/strings.h @@ -1,3 +1,6 @@ +#ifndef _STRINGS_H_ +#define _STRINGS_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,12 +13,49 @@ * External function definitions * for routines described in string(3). */ -char *strcat(); -char *strncat(); -int strcmp(); -int strncmp(); -char *strcpy(); -char *strncpy(); -int strlen(); -char *index(); -char *rindex(); +/*char *strcat();*/ +/*char *strncat();*/ +/*int strcmp();*/ +/*int strncmp();*/ +/*char *strcpy();*/ +/*char *strncpy();*/ +/*int strlen();*/ +/*char *index();*/ +/*char *rindex();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/index.c */ +char *index __P((register char *sp, int c)); + +/* gen/rindex.c */ +char *rindex __P((register char *sp, int c)); + +/* gen/strcat.c */ +char *strcat __P((register char *s1, register char *s2)); + +/* gen/strcmp.c */ +int strcmp __P((register char *s1, register char *s2)); + +/* gen/strcpy.c */ +char *strcpy __P((register char *s1, register char *s2)); + +/* gen/strlen.c */ +int strlen __P((register char *s)); + +/* gen/strncat.c */ +char *strncat __P((register char *s1, register char *s2, register n)); + +/* gen/strncmp.c */ +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 diff --git a/lib/libstdc/struct.h b/lib/libstdc/struct.h index 2486388..044352d 100644 --- a/lib/libstdc/struct.h +++ b/lib/libstdc/struct.h @@ -1,3 +1,6 @@ +#ifndef _STRUCT_H_ +#define _STRUCT_H_ + /* struct.h 4.1 83/05/03 */ /* @@ -7,3 +10,5 @@ #define fldoff(str, fld) ((int)&(((struct str *)0)->fld)) #define fldsiz(str, fld) (sizeof(((struct str *)0)->fld)) #define strbase(str, ptr, fld) ((struct str *)((char *)(ptr)-fldoff(str, fld))) + +#endif diff --git a/lib/libstdc/sys.h b/lib/libstdc/sys.h new file mode 100644 index 0000000..3eb6427 --- /dev/null +++ b/lib/libstdc/sys.h @@ -0,0 +1,60 @@ +#ifndef _SYS_H_ +#define _SYS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/gethostid.c */ +long gethostid __P((void)); + +/* sys/gethostname.c */ +int gethostname __P((char *n, int l)); + +/* sys/getpagesize.c */ +int getpagesize __P((void)); + +/* sys/profil.c */ +void profil __P((char *b, int s, int o, int i)); + +/* sys/reboot.c */ +void reboot __P((int h)); + +/* sys/sethostid.c */ +int sethostid __P((long h)); + +/* sys/sethostname.c */ +int sethostname __P((char *n, int l)); + +/* sys/shutdown.c */ +int shutdown __P((int s, int h)); + +/* sys/swapon.c */ +int swapon __P((char *s)); + +/* sys/vhangup.c */ +void vhangup __P((void)); + +#endif diff --git a/lib/libstdc/sys/_exit.c b/lib/libstdc/sys/_exit.c index 026d457..f3b57df 100644 --- a/lib/libstdc/sys/_exit.c +++ b/lib/libstdc/sys/_exit.c @@ -1,3 +1,6 @@ -void _exit(s) { +#include +#include + +void _exit(s) int s; { abort(); } diff --git a/lib/libstdc/sys/accept.c b/lib/libstdc/sys/accept.c index ab65645..988cf31 100644 --- a/lib/libstdc/sys/accept.c +++ b/lib/libstdc/sys/accept.c @@ -1,4 +1,7 @@ +#include #include -int accept(s, a, l) struct sockaddr *a; int *l; { + +/*#include */ +int accept(s, a, l) int s; struct sockaddr *a; int *l; { abort(); } diff --git a/lib/libstdc/sys/access.c b/lib/libstdc/sys/access.c index 8fca604..f5bfafa 100644 --- a/lib/libstdc/sys/access.c +++ b/lib/libstdc/sys/access.c @@ -1,3 +1,6 @@ -int access(p, m) char *p; { +#include +#include + +int access(p, m) char *p; int m; { abort(); } diff --git a/lib/libstdc/sys/acct.c b/lib/libstdc/sys/acct.c index 7b4823a..3a1ecc3 100644 --- a/lib/libstdc/sys/acct.c +++ b/lib/libstdc/sys/acct.c @@ -1,3 +1,6 @@ +#include +#include + int acct(f) char *f; { abort(); } diff --git a/lib/libstdc/sys/acct.h b/lib/libstdc/sys/acct.h index a796ece..012105e 100644 --- a/lib/libstdc/sys/acct.h +++ b/lib/libstdc/sys/acct.h @@ -1,3 +1,8 @@ +#ifndef _SYS_ACCT_H_ +#define _SYS_ACCT_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -44,3 +49,16 @@ struct acct { struct acct acctbuf; struct inode *acctp; #endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/acct.c */ +int acct __P((char *f)); + +#endif diff --git a/lib/libstdc/sys/adjtime.c b/lib/libstdc/sys/adjtime.c index 9098979..2f4451b 100644 --- a/lib/libstdc/sys/adjtime.c +++ b/lib/libstdc/sys/adjtime.c @@ -1,4 +1,7 @@ +#include #include -int adjtime(delta, odelta) struct timeval *delta, *odelta; { + +/*#include */ +int adjtime(delta, odelta) struct timeval *delta; struct timeval *odelta; { abort(); } diff --git a/lib/libstdc/sys/bind.c b/lib/libstdc/sys/bind.c index ac662db..04f3808 100644 --- a/lib/libstdc/sys/bind.c +++ b/lib/libstdc/sys/bind.c @@ -1,4 +1,7 @@ +#include #include -int bind(s, n, l) struct sockaddr *n; { + +/*#include */ +int bind(s, n, l) int s; struct sockaddr *n; int l; { abort(); } diff --git a/lib/libstdc/sys/bkmac.h b/lib/libstdc/sys/bkmac.h index 6bd020d..766d1c9 100644 --- a/lib/libstdc/sys/bkmac.h +++ b/lib/libstdc/sys/bkmac.h @@ -1,3 +1,9 @@ +#ifndef _SYS_BKMAC_H_ +#define _SYS_BKMAC_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -26,3 +32,5 @@ } \ } \ } + +#endif diff --git a/lib/libstdc/sys/brk.c b/lib/libstdc/sys/brk.c index 202296c..e40e738 100644 --- a/lib/libstdc/sys/brk.c +++ b/lib/libstdc/sys/brk.c @@ -1,3 +1,6 @@ +#include +#include + char *brk(a) char *a; { abort(); } diff --git a/lib/libstdc/sys/buf.h b/lib/libstdc/sys/buf.h index 5001fd6..a6623da 100644 --- a/lib/libstdc/sys/buf.h +++ b/lib/libstdc/sys/buf.h @@ -1,3 +1,9 @@ +#ifndef _SYS_BUF_H_ +#define _SYS_BUF_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -93,16 +99,16 @@ struct buf bfreelist[BQUEUES]; /* heads of available lists */ struct buf bswlist; /* head of free swap header list */ struct buf *bclnlist; /* head of cleaned page list */ -struct buf *alloc(); -struct buf *realloccg(); -struct buf *baddr(); -struct buf *getblk(); -struct buf *geteblk(); -struct buf *getnewbuf(); -struct buf *bread(); -struct buf *breada(); +/*struct buf *alloc();*/ +/*struct buf *realloccg();*/ +/*struct buf *baddr();*/ +/*struct buf *getblk();*/ +/*struct buf *geteblk();*/ +/*struct buf *getnewbuf();*/ +/*struct buf *bread();*/ +/*struct buf *breada();*/ -unsigned minphys(); +/*unsigned minphys();*/ #endif /* @@ -186,3 +192,5 @@ unsigned minphys(); blkclr((bp)->b_un.b_addr, (unsigned)(bp)->b_bcount); \ (bp)->b_resid = 0; \ } + +#endif diff --git a/lib/libstdc/sys/callout.h b/lib/libstdc/sys/callout.h index 1f3831e..378e70d 100644 --- a/lib/libstdc/sys/callout.h +++ b/lib/libstdc/sys/callout.h @@ -1,3 +1,8 @@ +#ifndef _SYS_CALLOUT_H_ +#define _SYS_CALLOUT_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -26,3 +31,5 @@ struct callout { struct callout *callfree, *callout, calltodo; int ncallout; #endif + +#endif diff --git a/lib/libstdc/sys/chdir.c b/lib/libstdc/sys/chdir.c index 28482cc..727cb39 100644 --- a/lib/libstdc/sys/chdir.c +++ b/lib/libstdc/sys/chdir.c @@ -1,3 +1,6 @@ +#include +#include + int chdir(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/chmod.c b/lib/libstdc/sys/chmod.c index 2b70bbe..6c87af8 100644 --- a/lib/libstdc/sys/chmod.c +++ b/lib/libstdc/sys/chmod.c @@ -1,3 +1,6 @@ -int chmod(s, m) char *s; { +#include +#include + +int chmod(s, m) char *s; int m; { abort(); } diff --git a/lib/libstdc/sys/chown.c b/lib/libstdc/sys/chown.c index 6e005e5..e2ad367 100644 --- a/lib/libstdc/sys/chown.c +++ b/lib/libstdc/sys/chown.c @@ -1,3 +1,6 @@ -int chown(s, u, g) char *s; { +#include +#include + +int chown(s, u, g) char *s; int u; int g; { abort(); } diff --git a/lib/libstdc/sys/chroot.c b/lib/libstdc/sys/chroot.c index f8fc744..e6ea5e9 100644 --- a/lib/libstdc/sys/chroot.c +++ b/lib/libstdc/sys/chroot.c @@ -1,3 +1,6 @@ +#include +#include + int chroot(d) char *d; { abort(); } diff --git a/lib/libstdc/sys/clist.h b/lib/libstdc/sys/clist.h index d33094c..b2ada32 100644 --- a/lib/libstdc/sys/clist.h +++ b/lib/libstdc/sys/clist.h @@ -1,3 +1,8 @@ +#ifndef _SYS_CLIST_H_ +#define _SYS_CLIST_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -19,3 +24,5 @@ int nclist; struct cblock *cfreelist; int cfreecount; #endif + +#endif diff --git a/lib/libstdc/sys/close.c b/lib/libstdc/sys/close.c index 1d14931..76c0c76 100644 --- a/lib/libstdc/sys/close.c +++ b/lib/libstdc/sys/close.c @@ -1,3 +1,6 @@ -int close(f) { +#include +#include + +int close(f) int f; { abort(); } diff --git a/lib/libstdc/sys/cmap.h b/lib/libstdc/sys/cmap.h index 77a3fd9..215766f 100644 --- a/lib/libstdc/sys/cmap.h +++ b/lib/libstdc/sys/cmap.h @@ -1,3 +1,9 @@ +#ifndef _SYS_CMAP_H_ +#define _SYS_CMAP_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -40,7 +46,7 @@ unsigned int c_page:21, /* virtual page number in segment */ c_blkno:24, /* disk block this is a copy of */ c_mdev:8; /* which mounted dev this is from */ }; -#else LOCORE +#else /* * bit offsets of elements in cmap */ @@ -49,7 +55,7 @@ unsigned int c_page:21, /* virtual page number in segment */ #define SZ_CMAP 16 /* sizeof(struct cmap) */ #define MAXMEM 64*1024 /* maximum memory, in Kbytes */ -#endif LOCORE +#endif #define CMHEAD 0 @@ -67,7 +73,7 @@ unsigned int c_page:21, /* virtual page number in segment */ struct cmap *cmap; struct cmap *ecmap; int ncmap; -struct cmap *mfind(); +/*struct cmap *mfind();*/ int firstfree, maxfree; int ecmx; /* cmap index of ecmap */ u_short cmhash[CMHSIZ]; @@ -82,4 +88,6 @@ u_short cmhash[CMHSIZ]; #define pgtocm(x) (((int) ((x)-firstfree) / CLSIZE) + 1) #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree) -#endif LOCORE +#endif + +#endif diff --git a/lib/libstdc/sys/conf.h b/lib/libstdc/sys/conf.h index 3d120ee..7e7da19 100644 --- a/lib/libstdc/sys/conf.h +++ b/lib/libstdc/sys/conf.h @@ -1,3 +1,8 @@ +#ifndef _SYS_CONF_H_ +#define _SYS_CONF_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -76,3 +81,5 @@ struct swdevt { #ifdef KERNEL struct swdevt swdevt[]; #endif + +#endif diff --git a/lib/libstdc/sys/connect.c b/lib/libstdc/sys/connect.c index 57a4a35..36e6738 100644 --- a/lib/libstdc/sys/connect.c +++ b/lib/libstdc/sys/connect.c @@ -1,4 +1,7 @@ +#include #include -int connect(s, n, l) struct sockaddr *n; { + +/*#include */ +int connect(s, n, l) int s; struct sockaddr *n; int l; { abort(); } diff --git a/lib/libstdc/sys/creat.c b/lib/libstdc/sys/creat.c index ac19a9d..cc3066b 100644 --- a/lib/libstdc/sys/creat.c +++ b/lib/libstdc/sys/creat.c @@ -1,3 +1,6 @@ -int creat(s, m) char *s; { +#include +#include + +int creat(s, m) char *s; int m; { abort(); } diff --git a/lib/libstdc/sys/dir.h b/lib/libstdc/sys/dir.h index 913a549..c1495ac 100644 --- a/lib/libstdc/sys/dir.h +++ b/lib/libstdc/sys/dir.h @@ -1,3 +1,9 @@ +#ifndef _SYS_DIR_H_ +#define _SYS_DIR_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -68,12 +74,12 @@ typedef struct _dirdesc { #ifndef NULL #define NULL 0 #endif -extern DIR *opendir(); -extern struct direct *readdir(); -extern long telldir(); -extern void seekdir(); +/*extern DIR *opendir();*/ +/*extern struct direct *readdir();*/ +/*extern long telldir();*/ +/*extern void seekdir();*/ #define rewinddir(dirp) seekdir((dirp), (long)0) -extern void closedir(); +/*extern void closedir();*/ #endif #ifdef KERNEL @@ -93,3 +99,41 @@ struct dirtemplate { char dotdot_name[4]; /* ditto */ }; #endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/closedir.c */ +void closedir __P((register DIR *dirp)); + +/* gen/getwd.c */ +char *getwd __P((char *pathname)); + +/* gen/opendir.c */ +DIR *opendir __P((char *name)); + +/* gen/readdir.c */ +struct direct *readdir __P((register DIR *dirp)); + +/* gen/scandir.c */ +int scandir __P((char *dirname, struct direct *(*namelist[]), int (*select)(void), int (*dcomp)(void))); +int alphasort __P((struct direct **d1, struct direct **d2)); + +/* gen/seekdir.c */ +void seekdir __P((register DIR *dirp, long loc)); + +/* gen/telldir.c */ +long telldir __P((DIR *dirp)); + +/* sys/mkdir.c */ +int mkdir __P((char *p, int m)); + +/* sys/rmdir.c */ +int rmdir __P((char *p)); + +#endif diff --git a/lib/libstdc/sys/dk.h b/lib/libstdc/sys/dk.h index 0ba837a..d2f90c5 100644 --- a/lib/libstdc/sys/dk.h +++ b/lib/libstdc/sys/dk.h @@ -1,3 +1,6 @@ +#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 @@ -31,3 +34,5 @@ float dk_mspw[DK_NDRIVE]; long tk_nin; long tk_nout; #endif + +#endif diff --git a/lib/libstdc/sys/dkbad.h b/lib/libstdc/sys/dkbad.h index 4c72788..8e9bc0c 100644 --- a/lib/libstdc/sys/dkbad.h +++ b/lib/libstdc/sys/dkbad.h @@ -1,3 +1,8 @@ +#ifndef _SYS_DKBAD_H_ +#define _SYS_DKBAD_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -45,3 +50,5 @@ struct dkbad { #define SSE 1 #define BSE 2 #define CONT 3 + +#endif diff --git a/lib/libstdc/sys/dmap.h b/lib/libstdc/sys/dmap.h index e5228cc..5916ae3 100644 --- a/lib/libstdc/sys/dmap.h +++ b/lib/libstdc/sys/dmap.h @@ -1,3 +1,8 @@ +#ifndef _SYS_DMAP_H_ +#define _SYS_DMAP_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -31,3 +36,5 @@ struct dblock { swblk_t db_base; /* base of physical contig drum block */ swblk_t db_size; /* size of block */ }; + +#endif diff --git a/lib/libstdc/sys/domain.h b/lib/libstdc/sys/domain.h index 3c75cc3..ed2d3e5 100644 --- a/lib/libstdc/sys/domain.h +++ b/lib/libstdc/sys/domain.h @@ -1,3 +1,6 @@ +#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 @@ -22,3 +25,5 @@ struct domain { #ifdef KERNEL struct domain *domains; #endif + +#endif diff --git a/lib/libstdc/sys/dup.c b/lib/libstdc/sys/dup.c index 92de68f..dd4d321 100644 --- a/lib/libstdc/sys/dup.c +++ b/lib/libstdc/sys/dup.c @@ -1,3 +1,6 @@ -int dup(f) { +#include +#include + +int dup(f) int f; { abort(); } diff --git a/lib/libstdc/sys/dup2.c b/lib/libstdc/sys/dup2.c index 0ffca47..c7ec418 100644 --- a/lib/libstdc/sys/dup2.c +++ b/lib/libstdc/sys/dup2.c @@ -1,3 +1,6 @@ -int dup2(o, n) { +#include +#include + +int dup2(o, n) int o; int n; { abort(); } diff --git a/lib/libstdc/sys/errno.h b/lib/libstdc/sys/errno.h index cf0fd68..609f594 100644 --- a/lib/libstdc/sys/errno.h +++ b/lib/libstdc/sys/errno.h @@ -1,3 +1,8 @@ +#ifndef _SYS_ERRNO_H_ +#define _SYS_ERRNO_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -96,3 +101,16 @@ #define EPROCLIM 67 /* Too many processes */ #define EUSERS 68 /* Too many users */ #define EDQUOT 69 /* Disc quota exceeded */ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/perror.c */ +int perror __P((char *s)); + +#endif diff --git a/lib/libstdc/sys/exec.h b/lib/libstdc/sys/exec.h index 97ccf68..79e7ddb 100644 --- a/lib/libstdc/sys/exec.h +++ b/lib/libstdc/sys/exec.h @@ -1,3 +1,6 @@ +#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 @@ -23,3 +26,35 @@ unsigned long a_drsize; /* size of data relocation */ #define OMAGIC 0407 /* old impure format */ #define NMAGIC 0410 /* read-only text */ #define ZMAGIC 0413 /* demand load format */ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/execvp.c */ +int execlp __P((char *name, char *argv)); +int execvp __P((char *name, char **argv)); + +/* gen/system.c */ +int system __P((char *s)); + +/* sys/execl.c */ +void execl __P((char *f, char *a)); + +/* sys/execle.c */ +void execle __P((char *f, char *a)); + +/* sys/exect.c */ +void exect __P((char *s, char *v[], char *e[])); + +/* sys/execv.c */ +void execv __P((char *s, char *v[])); + +/* sys/execve.c */ +void execve __P((char *s, char *v[], char *e[])); + +#endif diff --git a/lib/libstdc/sys/execl.c b/lib/libstdc/sys/execl.c index 56895f9..702d82c 100644 --- a/lib/libstdc/sys/execl.c +++ b/lib/libstdc/sys/execl.c @@ -1,3 +1,6 @@ -void execl(f, a) char *f, *a; { +#include +#include + +void execl(f, a) char *f; char *a; { abort(); } diff --git a/lib/libstdc/sys/execle.c b/lib/libstdc/sys/execle.c index 0a46fb2..e4aec0c 100644 --- a/lib/libstdc/sys/execle.c +++ b/lib/libstdc/sys/execle.c @@ -1,3 +1,6 @@ -void execle(f, a) char *f, *a; { +#include +#include + +void execle(f, a) char *f; char *a; { abort(); } diff --git a/lib/libstdc/sys/exect.c b/lib/libstdc/sys/exect.c index d37b357..4c56ee2 100644 --- a/lib/libstdc/sys/exect.c +++ b/lib/libstdc/sys/exect.c @@ -1,3 +1,6 @@ -void exect(s, v, e) char *s, *v[], *e[]; { +#include +#include + +void exect(s, v, e) char *s; char *v[]; char *e[]; { abort(); } diff --git a/lib/libstdc/sys/execv.c b/lib/libstdc/sys/execv.c index f93b0f1..7f20aff 100644 --- a/lib/libstdc/sys/execv.c +++ b/lib/libstdc/sys/execv.c @@ -1,3 +1,6 @@ -void execv(s, v) char *s, *v[]; { +#include +#include + +void execv(s, v) char *s; char *v[]; { abort(); } diff --git a/lib/libstdc/sys/execve.c b/lib/libstdc/sys/execve.c index 3b17210..5e5c873 100644 --- a/lib/libstdc/sys/execve.c +++ b/lib/libstdc/sys/execve.c @@ -1,3 +1,6 @@ -void execve(s, v, e) char *s, *v[], *e[]; { +#include +#include + +void execve(s, v, e) char *s; char *v[]; char *e[]; { abort(); } diff --git a/lib/libstdc/sys/fchmod.c b/lib/libstdc/sys/fchmod.c index 0c725ba..95b8a7a 100644 --- a/lib/libstdc/sys/fchmod.c +++ b/lib/libstdc/sys/fchmod.c @@ -1,3 +1,6 @@ -int fchmod(f, m) { +#include +#include + +int fchmod(f, m) int f; int m; { abort(); } diff --git a/lib/libstdc/sys/fchown.c b/lib/libstdc/sys/fchown.c index 836e042..5a58887 100644 --- a/lib/libstdc/sys/fchown.c +++ b/lib/libstdc/sys/fchown.c @@ -1,3 +1,6 @@ -int fchown(f, u, g) { +#include +#include + +int fchown(f, u, g) int f; int u; int g; { abort(); } diff --git a/lib/libstdc/sys/fcntl.c b/lib/libstdc/sys/fcntl.c index 0be0092..dc041e8 100644 --- a/lib/libstdc/sys/fcntl.c +++ b/lib/libstdc/sys/fcntl.c @@ -1,3 +1,6 @@ -int fcntl(f, c, a) { +#include +#include + +int fcntl(f, c, a) int f; int c; int a; { abort(); } diff --git a/lib/libstdc/sys/file.h b/lib/libstdc/sys/file.h index 26a8d89..6baa843 100644 --- a/lib/libstdc/sys/file.h +++ b/lib/libstdc/sys/file.h @@ -1,3 +1,12 @@ +#ifndef _SYS_FILE_H_ +#define _SYS_FILE_H_ + +#include +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -28,8 +37,8 @@ struct file { struct file *file, *fileNFILE; int nfile; -struct file *getf(); -struct file *falloc(); +/*struct file *getf();*/ +/*struct file *falloc();*/ #endif /* @@ -119,3 +128,97 @@ struct file *falloc(); #define DTYPE_INODE 1 /* file */ #define DTYPE_SOCKET 2 /* communications endpoint */ #endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/access.c */ +int access __P((char *p, int m)); + +/* sys/chmod.c */ +int chmod __P((char *s, int m)); + +/* sys/chown.c */ +int chown __P((char *s, int u, int g)); + +/* sys/close.c */ +int close __P((int f)); + +/* sys/creat.c */ +int creat __P((char *s, int m)); + +/* sys/dup2.c */ +int dup2 __P((int o, int n)); + +/* sys/dup.c */ +int dup __P((int f)); + +/* sys/fchmod.c */ +int fchmod __P((int f, int m)); + +/* sys/fchown.c */ +int fchown __P((int f, int u, int g)); + +/* sys/fcntl.c */ +int fcntl __P((int f, int c, int a)); + +/* sys/flock.c */ +int flock __P((int f, int o)); + +/* sys/fsync.c */ +int fsync __P((int f)); + +/* sys/ftruncate.c */ +int ftruncate __P((int d, off_t l)); + +/* sys/getdtablesize.c */ +int getdtablesize __P((void)); + +/* sys/link.c */ +int link __P((char *a, char *b)); + +/* sys/lseek.c */ +off_t lseek __P((int f, off_t o, int d)); + +/* sys/mknod.c */ +int mknod __P((char *n, int m, int a)); + +/* sys/open.c */ +int open __P((char *f, int m, int stuff)); + +/* sys/pipe.c */ +int pipe __P((int f[2])); + +/* sys/read.c */ +int read __P((int f, char *b, int l)); + +/* sys/readlink.c */ +int readlink __P((char *p, char *b, int s)); + +/* sys/rename.c */ +int rename __P((char *f, char *t)); + +/* sys/symlink.c */ +int symlink __P((char *t, char *f)); + +/* sys/sync.c */ +void sync __P((void)); + +/* sys/truncate.c */ +int truncate __P((char *p, off_t l)); + +/* sys/umask.c */ +int umask __P((int n)); + +/* sys/unlink.c */ +int unlink __P((char *s)); + +/* sys/write.c */ +int write __P((int f, char *b, int l)); + +#endif diff --git a/lib/libstdc/sys/flock.c b/lib/libstdc/sys/flock.c index c0593fe..a522d04 100644 --- a/lib/libstdc/sys/flock.c +++ b/lib/libstdc/sys/flock.c @@ -1,3 +1,6 @@ -int flock(f, o) { +#include +#include + +int flock(f, o) int f; int o; { abort(); } diff --git a/lib/libstdc/sys/fork.c b/lib/libstdc/sys/fork.c index aaa0987..fe715fd 100644 --- a/lib/libstdc/sys/fork.c +++ b/lib/libstdc/sys/fork.c @@ -1,3 +1,6 @@ +#include +#include + int fork() { abort(); } diff --git a/lib/libstdc/sys/fs.h b/lib/libstdc/sys/fs.h index f64fe35..59f6376 100644 --- a/lib/libstdc/sys/fs.h +++ b/lib/libstdc/sys/fs.h @@ -1,3 +1,10 @@ +#ifndef _SYS_FS_H_ +#define _SYS_FS_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -372,6 +379,8 @@ struct cg { #define NINDIR(fs) ((fs)->fs_nindir) #ifdef KERNEL -struct fs *getfs(); -struct fs *mountfs(); +/*struct fs *getfs();*/ +/*struct fs *mountfs();*/ +#endif + #endif diff --git a/lib/libstdc/sys/fstat.c b/lib/libstdc/sys/fstat.c index f5a2e1b..f8cf913 100644 --- a/lib/libstdc/sys/fstat.c +++ b/lib/libstdc/sys/fstat.c @@ -1,4 +1,7 @@ +#include #include -int fstat(f, b) struct stat *b; { + +/*#include */ +int fstat(f, b) int f; struct stat *b; { abort(); } diff --git a/lib/libstdc/sys/fsync.c b/lib/libstdc/sys/fsync.c index 80c1ebd..e51763e 100644 --- a/lib/libstdc/sys/fsync.c +++ b/lib/libstdc/sys/fsync.c @@ -1,3 +1,6 @@ -int fsync(f) { +#include +#include + +int fsync(f) int f; { abort(); } diff --git a/lib/libstdc/sys/ftruncate.c b/lib/libstdc/sys/ftruncate.c index 2d9da12..afe1f79 100644 --- a/lib/libstdc/sys/ftruncate.c +++ b/lib/libstdc/sys/ftruncate.c @@ -1,4 +1,8 @@ +#include +#include #include -int ftruncate(d, l) off_t l; { + +/*#include */ +int ftruncate(d, l) int d; off_t l; { abort(); } diff --git a/lib/libstdc/sys/getdtablesize.c b/lib/libstdc/sys/getdtablesize.c index 0b58c5a..14762ff 100644 --- a/lib/libstdc/sys/getdtablesize.c +++ b/lib/libstdc/sys/getdtablesize.c @@ -1,3 +1,6 @@ +#include +#include + int getdtablesize() { abort(); } diff --git a/lib/libstdc/sys/getegid.c b/lib/libstdc/sys/getegid.c index 50cb56c..8d29d6c 100644 --- a/lib/libstdc/sys/getegid.c +++ b/lib/libstdc/sys/getegid.c @@ -1,4 +1,8 @@ +#include +#include #include + +/*#include */ gid_t getegid() { abort(); } diff --git a/lib/libstdc/sys/geteuid.c b/lib/libstdc/sys/geteuid.c index cf06b7c..401fbb8 100644 --- a/lib/libstdc/sys/geteuid.c +++ b/lib/libstdc/sys/geteuid.c @@ -1,4 +1,8 @@ +#include +#include #include + +/*#include */ uid_t geteuid() { abort(); } diff --git a/lib/libstdc/sys/getgid.c b/lib/libstdc/sys/getgid.c index ad28f31..6077008 100644 --- a/lib/libstdc/sys/getgid.c +++ b/lib/libstdc/sys/getgid.c @@ -1,4 +1,8 @@ +#include +#include #include + +/*#include */ gid_t getgid() { abort(); } diff --git a/lib/libstdc/sys/getgroups.c b/lib/libstdc/sys/getgroups.c index 8dcbde7..66997ea 100644 --- a/lib/libstdc/sys/getgroups.c +++ b/lib/libstdc/sys/getgroups.c @@ -1,3 +1,6 @@ -int getgroups(n, g) int n, *g; { +#include +#include + +int getgroups(n, g) int n; int *g; { abort(); } diff --git a/lib/libstdc/sys/gethostid.c b/lib/libstdc/sys/gethostid.c index c10a3b9..2111a51 100644 --- a/lib/libstdc/sys/gethostid.c +++ b/lib/libstdc/sys/gethostid.c @@ -1,3 +1,6 @@ +#include +#include + long gethostid() { abort(); } diff --git a/lib/libstdc/sys/gethostname.c b/lib/libstdc/sys/gethostname.c index 453c085..3287d80 100644 --- a/lib/libstdc/sys/gethostname.c +++ b/lib/libstdc/sys/gethostname.c @@ -1,3 +1,6 @@ +#include +#include + int gethostname(n, l) char *n; int l; { abort(); } diff --git a/lib/libstdc/sys/getitimer.c b/lib/libstdc/sys/getitimer.c index c6e104c..52ed6bb 100644 --- a/lib/libstdc/sys/getitimer.c +++ b/lib/libstdc/sys/getitimer.c @@ -1,4 +1,7 @@ +#include #include -int getitimer(w, v) struct itimerval *v; { + +/*#include */ +int getitimer(w, v) int w; struct itimerval *v; { abort(); } diff --git a/lib/libstdc/sys/getpagesize.c b/lib/libstdc/sys/getpagesize.c index f6682c8..cd48754 100644 --- a/lib/libstdc/sys/getpagesize.c +++ b/lib/libstdc/sys/getpagesize.c @@ -1,3 +1,6 @@ +#include +#include + int getpagesize() { abort(); } diff --git a/lib/libstdc/sys/getpeername.c b/lib/libstdc/sys/getpeername.c index 855f1f9..7b9da47 100644 --- a/lib/libstdc/sys/getpeername.c +++ b/lib/libstdc/sys/getpeername.c @@ -1,4 +1,7 @@ +#include #include -int getpeername(s, n, l) struct sockaddr *n; int *l; { + +/*#include */ +int getpeername(s, n, l) int s; struct sockaddr *n; int *l; { abort(); } diff --git a/lib/libstdc/sys/getpgrp.c b/lib/libstdc/sys/getpgrp.c index 6dbf7eb..9a25071 100644 --- a/lib/libstdc/sys/getpgrp.c +++ b/lib/libstdc/sys/getpgrp.c @@ -1,3 +1,6 @@ -int getpgrp(p) { +#include +#include + +int getpgrp(p) int p; { abort(); } diff --git a/lib/libstdc/sys/getpid.c b/lib/libstdc/sys/getpid.c index fc1c4fa..521d029 100644 --- a/lib/libstdc/sys/getpid.c +++ b/lib/libstdc/sys/getpid.c @@ -1,3 +1,6 @@ +#include +#include + int getpid() { abort(); } diff --git a/lib/libstdc/sys/getppid.c b/lib/libstdc/sys/getppid.c index d0a1303..8b34a8e 100644 --- a/lib/libstdc/sys/getppid.c +++ b/lib/libstdc/sys/getppid.c @@ -1,3 +1,6 @@ +#include +#include + int getppid() { abort(); } diff --git a/lib/libstdc/sys/getpriority.c b/lib/libstdc/sys/getpriority.c index 5f548cb..4ece97c 100644 --- a/lib/libstdc/sys/getpriority.c +++ b/lib/libstdc/sys/getpriority.c @@ -1,3 +1,6 @@ -int getpriority(w, who) { +#include +#include + +int getpriority(w, who) int w; int who; { abort(); } diff --git a/lib/libstdc/sys/getrlimit.c b/lib/libstdc/sys/getrlimit.c index bd2abaa..d8de514 100644 --- a/lib/libstdc/sys/getrlimit.c +++ b/lib/libstdc/sys/getrlimit.c @@ -1,4 +1,7 @@ +#include #include -int getrlimit(res, rip) struct rlimit *rip; { + +/*#include */ +int getrlimit(res, rip) int res; struct rlimit *rip; { abort(); } diff --git a/lib/libstdc/sys/getrusage.c b/lib/libstdc/sys/getrusage.c index 2bacd99..516940d 100644 --- a/lib/libstdc/sys/getrusage.c +++ b/lib/libstdc/sys/getrusage.c @@ -1,4 +1,7 @@ +#include #include -int getrusage(res, rip) struct rusage *rip; { + +/*#include */ +int getrusage(res, rip) int res; struct rusage *rip; { abort(); } diff --git a/lib/libstdc/sys/getsockname.c b/lib/libstdc/sys/getsockname.c index 828a5ea..1595fa2 100644 --- a/lib/libstdc/sys/getsockname.c +++ b/lib/libstdc/sys/getsockname.c @@ -1,3 +1,6 @@ -int getsockname(s, name, namelen) char *name; int *namelen; { +#include +#include + +int getsockname(s, name, namelen) int s; char *name; int *namelen; { abort(); } diff --git a/lib/libstdc/sys/getsockopt.c b/lib/libstdc/sys/getsockopt.c index 23db576..e281a96 100644 --- a/lib/libstdc/sys/getsockopt.c +++ b/lib/libstdc/sys/getsockopt.c @@ -1,3 +1,6 @@ -int getsockopt(s, level, opt, buf, len) char *buf; int *len; { +#include +#include + +int getsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int *len; { abort(); } diff --git a/lib/libstdc/sys/gettimeofday.c b/lib/libstdc/sys/gettimeofday.c index c5e4e42..5fa6072 100644 --- a/lib/libstdc/sys/gettimeofday.c +++ b/lib/libstdc/sys/gettimeofday.c @@ -1,4 +1,7 @@ +#include #include + +/*#include */ int gettimeofday(t, z) struct timeval *t; struct timezone *z; { abort(); } diff --git a/lib/libstdc/sys/getuid.c b/lib/libstdc/sys/getuid.c index a6fccf8..addc64e 100644 --- a/lib/libstdc/sys/getuid.c +++ b/lib/libstdc/sys/getuid.c @@ -1,4 +1,8 @@ +#include +#include #include + +/*#include */ uid_t getuid() { abort(); } diff --git a/lib/libstdc/sys/gprof.h b/lib/libstdc/sys/gprof.h index a332381..2444e60 100644 --- a/lib/libstdc/sys/gprof.h +++ b/lib/libstdc/sys/gprof.h @@ -1,3 +1,6 @@ +#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 @@ -85,3 +88,5 @@ struct rawarc { */ #define ROUNDDOWN(x,y) (((x)/(y))*(y)) #define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) + +#endif diff --git a/lib/libstdc/sys/inode.h b/lib/libstdc/sys/inode.h index 8d5b4fe..f804933 100644 --- a/lib/libstdc/sys/inode.h +++ b/lib/libstdc/sys/inode.h @@ -1,3 +1,10 @@ +#ifndef _SYS_INODE_H_ +#define _SYS_INODE_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -120,16 +127,16 @@ long nextinodeid; /* unique id generator */ struct inode *rootdir; /* pointer to inode of root directory */ -struct inode *ialloc(); -struct inode *iget(); +/*struct inode *ialloc();*/ +/*struct inode *iget();*/ #ifdef notdef -struct inode *ifind(); +/*struct inode *ifind();*/ #endif -struct inode *owner(); -struct inode *maknode(); -struct inode *namei(); +/*struct inode *owner();*/ +/*struct inode *maknode();*/ +/*struct inode *namei();*/ -ino_t dirpref(); +/*ino_t dirpref();*/ #endif /* flags */ @@ -195,3 +202,5 @@ ino_t dirpref(); (ip)->i_flag &= ~(IACC|IUPD|ICHG); \ } \ } + +#endif diff --git a/lib/libstdc/sys/ioctl.c b/lib/libstdc/sys/ioctl.c index 1a52843..2122da9 100644 --- a/lib/libstdc/sys/ioctl.c +++ b/lib/libstdc/sys/ioctl.c @@ -1,4 +1,8 @@ +#include +#include #include -int ioctl(d, r, p) u_long r; char *p; { + +/*#include */ +int ioctl(d, r, p) int d; u_long r; char *p; { abort(); } diff --git a/lib/libstdc/sys/ioctl.h b/lib/libstdc/sys/ioctl.h index 366a268..571dbe8 100644 --- a/lib/libstdc/sys/ioctl.h +++ b/lib/libstdc/sys/ioctl.h @@ -1,3 +1,12 @@ +#ifndef _SYS_IOCTL_H_ +#define _SYS_IOCTL_H_ + +#include +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,8 +18,8 @@ /* * Ioctl definitions */ -#ifndef _IOCTL_ -#define _IOCTL_ +/*#ifndef _IOCTL_*/ +/*#define _IOCTL_*/ #ifdef KERNEL #include "ttychars.h" #include "ttydev.h" @@ -269,4 +278,26 @@ struct ttysize { #define SIOCGARP _IOWR(i,31, struct arpreq) /* get arp entry */ #define SIOCDARP _IOW(i, 32, struct arpreq) /* delete arp entry */ +/*#endif*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/gtty.c */ +int gtty __P((int fd, struct sgttyb *ap)); + +/* compat-4.1/stty.c */ +int stty __P((int fd, struct sgttyb *ap)); + +/* gen/isatty.c */ +int isatty __P((int f)); + +/* sys/ioctl.c */ +int ioctl __P((int d, u_long r, char *p)); + #endif diff --git a/lib/libstdc/sys/kernel.h b/lib/libstdc/sys/kernel.h index c8bab76..dfbe435 100644 --- a/lib/libstdc/sys/kernel.h +++ b/lib/libstdc/sys/kernel.h @@ -1,3 +1,10 @@ +#ifndef _SYS_KERNEL_H_ +#define _SYS_KERNEL_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +17,7 @@ * Global variables for the kernel */ -long rmalloc(); +/*long rmalloc();*/ /* 1.1 */ long hostid; @@ -25,7 +32,7 @@ int hz; int phz; /* alternate clock's frequency */ int tick; int lbolt; /* awoken once a second */ -int realitexpire(); +/*int realitexpire();*/ double avenrun[3]; @@ -35,3 +42,5 @@ extern char *s_lowpc; extern u_long s_textsize; extern u_short *kcount; #endif + +#endif diff --git a/lib/libstdc/sys/kill.c b/lib/libstdc/sys/kill.c index 0c87e6e..dfaffad 100644 --- a/lib/libstdc/sys/kill.c +++ b/lib/libstdc/sys/kill.c @@ -1,3 +1,6 @@ -int kill(p, s) { +#include +#include + +int kill(p, s) int p; int s; { abort(); } diff --git a/lib/libstdc/sys/killpg.c b/lib/libstdc/sys/killpg.c index dd05bb0..71a29d9 100644 --- a/lib/libstdc/sys/killpg.c +++ b/lib/libstdc/sys/killpg.c @@ -1,3 +1,6 @@ -int killpg(pg, s) { +#include +#include + +int killpg(pg, s) int pg; int s; { abort(); } diff --git a/lib/libstdc/sys/link.c b/lib/libstdc/sys/link.c index dd87a4d..c7e58f9 100644 --- a/lib/libstdc/sys/link.c +++ b/lib/libstdc/sys/link.c @@ -1,3 +1,6 @@ -int link(a, b) char *a, *b; { +#include +#include + +int link(a, b) char *a; char *b; { abort(); } diff --git a/lib/libstdc/sys/listen.c b/lib/libstdc/sys/listen.c index e43d4ad..094b5a3 100644 --- a/lib/libstdc/sys/listen.c +++ b/lib/libstdc/sys/listen.c @@ -1,3 +1,6 @@ -int listen(s, b){ +#include +#include + +int listen(s, b) int s; int b; { abort(); } diff --git a/lib/libstdc/sys/lseek.c b/lib/libstdc/sys/lseek.c index ccadf77..ea07e75 100644 --- a/lib/libstdc/sys/lseek.c +++ b/lib/libstdc/sys/lseek.c @@ -1,4 +1,8 @@ +#include +#include #include -off_t lseek(f, o, d) off_t o; { + +/*#include */ +off_t lseek(f, o, d) int f; off_t o; int d; { abort(); } diff --git a/lib/libstdc/sys/lstat.c b/lib/libstdc/sys/lstat.c index 9db8eab..5586e31 100644 --- a/lib/libstdc/sys/lstat.c +++ b/lib/libstdc/sys/lstat.c @@ -1,4 +1,7 @@ +#include #include + +/*#include */ int lstat(s, b) char *s; struct stat *b; { abort(); } diff --git a/lib/libstdc/sys/map.h b/lib/libstdc/sys/map.h index 4d8922e..7d1e5c1 100644 --- a/lib/libstdc/sys/map.h +++ b/lib/libstdc/sys/map.h @@ -1,3 +1,6 @@ +#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 @@ -47,3 +50,5 @@ struct map *argmap; struct map *kernelmap; struct map *mbmap; #endif + +#endif diff --git a/lib/libstdc/sys/mbuf.h b/lib/libstdc/sys/mbuf.h index 6b6ffab..05b0c09 100644 --- a/lib/libstdc/sys/mbuf.h +++ b/lib/libstdc/sys/mbuf.h @@ -1,3 +1,10 @@ +#ifndef _SYS_MBUF_H_ +#define _SYS_MBUF_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -152,6 +159,8 @@ int nmbclusters; struct mbuf *mfree, *mclfree; char mclrefcnt[NMBCLUSTERS + 1]; int m_want; -struct mbuf *m_get(),*m_getclr(),*m_free(),*m_more(),*m_copy(),*m_pullup(); -caddr_t m_clalloc(); +/*struct mbuf *m_get(),*m_getclr(),*m_free(),*m_more(),*m_copy(),*m_pullup();*/ +/*caddr_t m_clalloc();*/ +#endif + #endif diff --git a/lib/libstdc/sys/mkdir.c b/lib/libstdc/sys/mkdir.c index 6c393d2..55855c2 100644 --- a/lib/libstdc/sys/mkdir.c +++ b/lib/libstdc/sys/mkdir.c @@ -1,3 +1,6 @@ -int mkdir(p, m) char *p; { +#include +#include + +int mkdir(p, m) char *p; int m; { abort(); } diff --git a/lib/libstdc/sys/mknod.c b/lib/libstdc/sys/mknod.c index c313e7b..30a7d89 100644 --- a/lib/libstdc/sys/mknod.c +++ b/lib/libstdc/sys/mknod.c @@ -1,3 +1,6 @@ -int mknod(n, m, a) char *n; { +#include +#include + +int mknod(n, m, a) char *n; int m; int a; { abort(); } diff --git a/lib/libstdc/sys/mman.h b/lib/libstdc/sys/mman.h index 4c1c14d..cd88094 100644 --- a/lib/libstdc/sys/mman.h +++ b/lib/libstdc/sys/mman.h @@ -1,3 +1,6 @@ +#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 @@ -21,3 +24,5 @@ #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* dont need these pages */ + +#endif diff --git a/lib/libstdc/sys/mount.c b/lib/libstdc/sys/mount.c index 15e1720..03b9c16 100644 --- a/lib/libstdc/sys/mount.c +++ b/lib/libstdc/sys/mount.c @@ -1,3 +1,6 @@ -int mount(s, n, f) char *s, *n; { +#include +#include + +int mount(s, n, f) char *s; char *n; int f; { abort(); } diff --git a/lib/libstdc/sys/mount.h b/lib/libstdc/sys/mount.h index 89284a4..9db492f 100644 --- a/lib/libstdc/sys/mount.h +++ b/lib/libstdc/sys/mount.h @@ -1,3 +1,9 @@ +#ifndef _SYS_MOUNT_H_ +#define _SYS_MOUNT_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -20,3 +26,19 @@ struct mount { #ifdef KERNEL struct mount mount[NMOUNT]; #endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/mount.c */ +int mount __P((char *s, char *n, int f)); + +/* sys/umount.c */ +int umount __P((char *s)); + +#endif diff --git a/lib/libstdc/sys/msgbuf.h b/lib/libstdc/sys/msgbuf.h index 4efb8a7..13e42c7 100644 --- a/lib/libstdc/sys/msgbuf.h +++ b/lib/libstdc/sys/msgbuf.h @@ -1,3 +1,6 @@ +#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 @@ -17,3 +20,5 @@ struct msgbuf { #ifdef KERNEL struct msgbuf msgbuf; #endif + +#endif diff --git a/lib/libstdc/sys/mtio.h b/lib/libstdc/sys/mtio.h index 6647b33..6258c66 100644 --- a/lib/libstdc/sys/mtio.h +++ b/lib/libstdc/sys/mtio.h @@ -1,3 +1,9 @@ +#ifndef _SYS_MTIO_H_ +#define _SYS_MTIO_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -65,3 +71,5 @@ struct mtget { #ifndef KERNEL #define DEFTAPE "/dev/rmt12" #endif + +#endif diff --git a/lib/libstdc/sys/namei.h b/lib/libstdc/sys/namei.h index 89fba9d..21cc439 100644 --- a/lib/libstdc/sys/namei.h +++ b/lib/libstdc/sys/namei.h @@ -1,3 +1,10 @@ +#ifndef _SYS_NAMEI_H_ +#define _SYS_NAMEI_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,8 +13,8 @@ * @(#)namei.h 7.1 (Berkeley) 6/4/86 */ -#ifndef _NAMEI_ -#define _NAMEI_ +/*#ifndef _NAMEI_*/ +/*#define _NAMEI_*/ #ifdef KERNEL #include "uio.h" @@ -85,4 +92,6 @@ struct nchstats { long ncs_pass2; /* names found with passes == 2 */ long ncs_2passes; /* number of times we attempt it */ }; +/*#endif*/ + #endif diff --git a/lib/libstdc/sys/open.c b/lib/libstdc/sys/open.c index 763a459..77c608c 100644 --- a/lib/libstdc/sys/open.c +++ b/lib/libstdc/sys/open.c @@ -1,3 +1,6 @@ -int open(f, m, stuff) char *f; { +#include +#include + +int open(f, m, stuff) char *f; int m; int stuff; { abort(); } diff --git a/lib/libstdc/sys/param.h b/lib/libstdc/sys/param.h index 16b06b1..22490ac 100644 --- a/lib/libstdc/sys/param.h +++ b/lib/libstdc/sys/param.h @@ -1,3 +1,10 @@ +#ifndef _SYS_PARAM_H_ +#define _SYS_PARAM_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -53,15 +60,16 @@ /* * Signals */ -#ifdef KERNEL -#include "signal.h" -#else -#include -#endif +/*#ifdef KERNEL*/ +/*#include "signal.h"*/ +/*#else*/ +/*#include */ +/*#endif*/ -#define ISSIG(p) \ - ((p)->p_sig && ((p)->p_flag&STRC || \ - ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) +/* moved this to sys/proc.h to avoid a circular dependency */ +/*#define ISSIG(p) \*/ +/* ((p)->p_sig && ((p)->p_flag&STRC || \*/ +/* ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig())*/ #define NBPW sizeof(int) /* number of bytes in an integer */ @@ -187,3 +195,5 @@ /* moved this from sys/types.h */ #define NBBY 8 /* number of bits in a byte */ + +#endif diff --git a/lib/libstdc/sys/pipe.c b/lib/libstdc/sys/pipe.c index 0504def..9389ceb 100644 --- a/lib/libstdc/sys/pipe.c +++ b/lib/libstdc/sys/pipe.c @@ -1,3 +1,6 @@ +#include +#include + int pipe(f) int f[2]; { abort(); } diff --git a/lib/libstdc/sys/proc.h b/lib/libstdc/sys/proc.h index b81c5cb..6c80310 100644 --- a/lib/libstdc/sys/proc.h +++ b/lib/libstdc/sys/proc.h @@ -1,3 +1,9 @@ +#ifndef _SYS_PROC_H_ +#define _SYS_PROC_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -69,7 +75,7 @@ struct proc { #ifdef KERNEL short pidhash[PIDHSZ]; -struct proc *pfind(); +/*struct proc *pfind();*/ struct proc *proc, *procNPROC; /* the proc table itself */ struct proc *freeproc, *zombproc, *allproc; /* lists of procs in various states */ @@ -117,3 +123,90 @@ int whichqs; /* bit mask summarizing non-empty qs's */ #define SSEL 0x0400000 /* selecting; wakeup/waiting danger */ #define SLOGIN 0x0800000 /* a login process (legit child of init) */ #define SPTECHG 0x1000000 /* pte's for process have changed */ + +/* moved this from sys/param.h to avoid a circular dependency */ +#define ISSIG(p) \ + ((p)->p_sig && ((p)->p_flag&STRC || \ + ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/setegid.c */ +int setegid __P((int egid)); + +/* gen/seteuid.c */ +int seteuid __P((int euid)); + +/* gen/setgid.c */ +int setgid __P((int gid)); + +/* gen/setrgid.c */ +int setrgid __P((int rgid)); + +/* gen/setruid.c */ +int setruid __P((int ruid)); + +/* gen/setuid.c */ +int setuid __P((int uid)); + +/* sys/brk.c */ +char *brk __P((char *a)); + +/* sys/chdir.c */ +int chdir __P((char *s)); + +/* sys/chroot.c */ +int chroot __P((char *d)); + +/* sys/_exit.c */ +void _exit __P((int s)); + +/* sys/fork.c */ +int fork __P((void)); + +/* sys/getegid.c */ +gid_t getegid __P((void)); + +/* sys/geteuid.c */ +uid_t geteuid __P((void)); + +/* sys/getgid.c */ +gid_t getgid __P((void)); + +/* sys/getgroups.c */ +int getgroups __P((int n, int *g)); + +/* sys/getpgrp.c */ +int getpgrp __P((int p)); + +/* sys/getpid.c */ +int getpid __P((void)); + +/* sys/getppid.c */ +int getppid __P((void)); + +/* sys/getuid.c */ +uid_t getuid __P((void)); + +/* sys/sbrk.c */ +char *sbrk __P((int i)); + +/* sys/setgroups.c */ +int setgroups __P((int n, int *g)); + +/* sys/setpgrp.c */ +int setpgrp __P((int g, int pg)); + +/* sys/setregid.c */ +int setregid __P((int r, int e)); + +/* sys/setreuid.c */ +int setreuid __P((int r, int e)); + +#endif diff --git a/lib/libstdc/sys/profil.c b/lib/libstdc/sys/profil.c index 53fb81f..9434cfd 100644 --- a/lib/libstdc/sys/profil.c +++ b/lib/libstdc/sys/profil.c @@ -1,3 +1,6 @@ -void profil(b, s, o, i) char *b; { +#include +#include + +void profil(b, s, o, i) char *b; int s; int o; int i; { abort(); } diff --git a/lib/libstdc/sys/protosw.h b/lib/libstdc/sys/protosw.h index 968fa28..bf0265b 100644 --- a/lib/libstdc/sys/protosw.h +++ b/lib/libstdc/sys/protosw.h @@ -1,3 +1,6 @@ +#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 @@ -179,5 +182,7 @@ char *prcorequests[] = { #endif #ifdef KERNEL -extern struct protosw *pffindproto(), *pffindtype(); +/*extern struct protosw *pffindproto(), *pffindtype();*/ +#endif + #endif diff --git a/lib/libstdc/sys/ptrace.c b/lib/libstdc/sys/ptrace.c index 87312fc..9b677b6 100644 --- a/lib/libstdc/sys/ptrace.c +++ b/lib/libstdc/sys/ptrace.c @@ -1,3 +1,6 @@ -int ptrace(r, p, a, d) int *a; { +#include +#include + +int ptrace(r, p, a, d) int r; int p; int *a; int d; { abort(); } diff --git a/lib/libstdc/sys/ptrace.h b/lib/libstdc/sys/ptrace.h index 88a8f75..66473ae 100644 --- a/lib/libstdc/sys/ptrace.h +++ b/lib/libstdc/sys/ptrace.h @@ -1,3 +1,6 @@ +#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 @@ -6,8 +9,8 @@ * @(#)ptrace.h 7.1 (Berkeley) 6/4/86 */ -#ifndef _PTRACE_ -#define _PTRACE_ +/*#ifndef _PTRACE_*/ +/*#define _PTRACE_*/ #define PT_TRACE_ME 0 /* child declares it's being traced */ #define PT_READ_I 1 /* read word in child's I space */ @@ -20,4 +23,17 @@ #define PT_KILL 8 /* kill the child process */ #define PT_STEP 9 /* single step the child */ +/*#endif*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/ptrace.c */ +int ptrace __P((int r, int p, int *a, int d)); + #endif diff --git a/lib/libstdc/sys/quota.c b/lib/libstdc/sys/quota.c index fe06ce4..7950492 100644 --- a/lib/libstdc/sys/quota.c +++ b/lib/libstdc/sys/quota.c @@ -1,3 +1,6 @@ -int quota(c, u, a, ad) char *ad; { +#include +#include + +int quota(c, u, a, ad) int c; int u; int a; char *ad; { abort(); } diff --git a/lib/libstdc/sys/quota.h b/lib/libstdc/sys/quota.h index 429790c..5a71975 100644 --- a/lib/libstdc/sys/quota.h +++ b/lib/libstdc/sys/quota.h @@ -1,3 +1,9 @@ +#ifndef _SYS_QUOTA_H_ +#define _SYS_QUOTA_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -37,7 +43,7 @@ struct quota { #if defined(KERNEL) && defined(QUOTA) struct quota *quota, *quotaNQUOTA; int nquota; -struct quota *getquota(), *qfind(); +/*struct quota *getquota(), *qfind();*/ #endif /* @@ -113,7 +119,7 @@ struct dquot { #if defined(KERNEL) && defined(QUOTA) struct dquot *dquot, *dquotNDQUOT; int ndquot; -struct dquot *discquota(), *inoquota(), *dqalloc(), *dqp(); +/*struct dquot *discquota(), *inoquota(), *dqalloc(), *dqp();*/ #endif /* @@ -142,3 +148,19 @@ struct dqwarn { u_char dw_bwarn; u_char dw_iwarn; }; + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/quota.c */ +int quota __P((int c, int u, int a, char *ad)); + +/* sys/setquota.c */ +int setquota __P((char *s, char *f)); + +#endif diff --git a/lib/libstdc/sys/read.c b/lib/libstdc/sys/read.c index 53fb7e4..aa2c121 100644 --- a/lib/libstdc/sys/read.c +++ b/lib/libstdc/sys/read.c @@ -1,3 +1,6 @@ -int read(f, b, l) char *b; { +#include +#include + +int read(f, b, l) int f; char *b; int l; { abort(); } diff --git a/lib/libstdc/sys/readlink.c b/lib/libstdc/sys/readlink.c index fe3c749..eb2ac71 100644 --- a/lib/libstdc/sys/readlink.c +++ b/lib/libstdc/sys/readlink.c @@ -1,3 +1,6 @@ -int readlink(p, b, s) char *p, *b; { +#include +#include + +int readlink(p, b, s) char *p; char *b; int s; { abort(); } diff --git a/lib/libstdc/sys/readv.c b/lib/libstdc/sys/readv.c index ad24217..932b8cb 100644 --- a/lib/libstdc/sys/readv.c +++ b/lib/libstdc/sys/readv.c @@ -1,4 +1,7 @@ +#include #include -int readv(d, v, l) struct iovec *v; { + +/*#include */ +int readv(d, v, l) int d; struct iovec *v; int l; { abort(); } diff --git a/lib/libstdc/sys/reboot.c b/lib/libstdc/sys/reboot.c index 1ff5b2d..1f9004f 100644 --- a/lib/libstdc/sys/reboot.c +++ b/lib/libstdc/sys/reboot.c @@ -1,3 +1,6 @@ -void reboot(h) { +#include +#include + +void reboot(h) int h; { abort(); } diff --git a/lib/libstdc/sys/reboot.h b/lib/libstdc/sys/reboot.h index 1776012..1d56f62 100644 --- a/lib/libstdc/sys/reboot.h +++ b/lib/libstdc/sys/reboot.h @@ -1,3 +1,6 @@ +#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 @@ -40,3 +43,5 @@ #define B_TYPEMASK 0xff #define B_MAGICMASK 0xf0000000 #define B_DEVMAGIC 0xa0000000 + +#endif diff --git a/lib/libstdc/sys/recv.c b/lib/libstdc/sys/recv.c index db28262..4d175fb 100644 --- a/lib/libstdc/sys/recv.c +++ b/lib/libstdc/sys/recv.c @@ -1,3 +1,6 @@ -int recv(s, b, l, f) char *b; { +#include +#include + +int recv(s, b, l, f) int s; char *b; int l; int f; { abort(); } diff --git a/lib/libstdc/sys/recvfrom.c b/lib/libstdc/sys/recvfrom.c index c333ed2..e76144c 100644 --- a/lib/libstdc/sys/recvfrom.c +++ b/lib/libstdc/sys/recvfrom.c @@ -1,4 +1,7 @@ +#include #include -int recvfrom(s, b, l, f, fr, fl) char *b; struct sockaddr *fr; int *fl; { + +/*#include */ +int recvfrom(s, b, l, f, fr, fl) int s; char *b; int l; int f; struct sockaddr *fr; int *fl; { abort(); } diff --git a/lib/libstdc/sys/recvmsg.c b/lib/libstdc/sys/recvmsg.c index 4acedcd..ffafe3e 100644 --- a/lib/libstdc/sys/recvmsg.c +++ b/lib/libstdc/sys/recvmsg.c @@ -1,4 +1,7 @@ +#include #include -int recvmsg(s, m, f) struct msghdr m[]; { + +/*#include */ +int recvmsg(s, m, f) int s; struct msghdr m[]; int f; { abort(); } diff --git a/lib/libstdc/sys/rename.c b/lib/libstdc/sys/rename.c index c685463..7ae70a9 100644 --- a/lib/libstdc/sys/rename.c +++ b/lib/libstdc/sys/rename.c @@ -1,3 +1,6 @@ -int rename(f, t) char *f, *t; { +#include +#include + +int rename(f, t) char *f; char *t; { abort(); } diff --git a/lib/libstdc/sys/resource.h b/lib/libstdc/sys/resource.h index 16d50d7..5946f45 100644 --- a/lib/libstdc/sys/resource.h +++ b/lib/libstdc/sys/resource.h @@ -1,3 +1,8 @@ +#ifndef _SYS_RESOURCE_H_ +#define _SYS_RESOURCE_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -62,3 +67,31 @@ struct rlimit { int rlim_cur; /* current (soft) limit */ int rlim_max; /* maximum value for rlim_cur */ }; + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/nice.c */ +int nice __P((int incr)); + +/* sys/getpriority.c */ +int getpriority __P((int w, int who)); + +/* sys/getrlimit.c */ +int getrlimit __P((int res, struct rlimit *rip)); + +/* sys/getrusage.c */ +int getrusage __P((int res, struct rusage *rip)); + +/* sys/setpriority.c */ +int setpriority __P((int w, int who, int pri)); + +/* sys/setrlimit.c */ +int setrlimit __P((int res, struct rlimit *rip)); + +#endif diff --git a/lib/libstdc/sys/rmdir.c b/lib/libstdc/sys/rmdir.c index 0501658..b3cf959 100644 --- a/lib/libstdc/sys/rmdir.c +++ b/lib/libstdc/sys/rmdir.c @@ -1,3 +1,6 @@ +#include +#include + int rmdir(p) char *p; { abort(); } diff --git a/lib/libstdc/sys/sbrk.c b/lib/libstdc/sys/sbrk.c index bd673e5..cd6e664 100644 --- a/lib/libstdc/sys/sbrk.c +++ b/lib/libstdc/sys/sbrk.c @@ -1,3 +1,6 @@ -char *sbrk(i) { +#include +#include + +char *sbrk(i) int i; { abort(); } diff --git a/lib/libstdc/sys/seg.h b/lib/libstdc/sys/seg.h index 6810735..2d97aa8 100644 --- a/lib/libstdc/sys/seg.h +++ b/lib/libstdc/sys/seg.h @@ -1,3 +1,8 @@ +#ifndef _SYS_SEG_H_ +#define _SYS_SEG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,3 +17,5 @@ #define RO PG_URKR /* access abilities */ #define RW PG_UW + +#endif diff --git a/lib/libstdc/sys/select.c b/lib/libstdc/sys/select.c index 0a2a53a..97e5138 100644 --- a/lib/libstdc/sys/select.c +++ b/lib/libstdc/sys/select.c @@ -1,5 +1,9 @@ +#include #include #include -int select(n, r, w, e, t) fd_set *r, *w, *e; struct timeval *t; { + +/*#include */ +/*#include */ +int select(n, r, w, e, t) int n; fd_set *r; fd_set *w; fd_set *e; struct timeval *t; { abort(); } diff --git a/lib/libstdc/sys/select.h b/lib/libstdc/sys/select.h index c861a51..206fe40 100644 --- a/lib/libstdc/sys/select.h +++ b/lib/libstdc/sys/select.h @@ -1,4 +1,11 @@ +#ifndef _SYS_SELECT_H_ +#define _SYS_SELECT_H_ + +#include #include +#include + +/*#include */ /* moved this from sys/types.h */ /* @@ -26,3 +33,16 @@ typedef struct fd_set { #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/select.c */ +int select __P((int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t)); + +#endif diff --git a/lib/libstdc/sys/send.c b/lib/libstdc/sys/send.c index d2b14d1..55d552f 100644 --- a/lib/libstdc/sys/send.c +++ b/lib/libstdc/sys/send.c @@ -1,3 +1,6 @@ -int send(s, m, l, f) char *m; { +#include +#include + +int send(s, m, l, f) int s; char *m; int l; int f; { abort(); } diff --git a/lib/libstdc/sys/sendmsg.c b/lib/libstdc/sys/sendmsg.c index 4875f59..b83ebb3 100644 --- a/lib/libstdc/sys/sendmsg.c +++ b/lib/libstdc/sys/sendmsg.c @@ -1,4 +1,7 @@ +#include #include -int sendmsg(s, m, l) struct msghdr m[]; { + +/*#include */ +int sendmsg(s, m, l) int s; struct msghdr m[]; int l; { abort(); } diff --git a/lib/libstdc/sys/sendto.c b/lib/libstdc/sys/sendto.c index 8cc5ab9..c126719 100644 --- a/lib/libstdc/sys/sendto.c +++ b/lib/libstdc/sys/sendto.c @@ -1,4 +1,7 @@ +#include #include -int sendto(s, m, l, f, t, tl) char *m; struct sockaddr *t; { + +/*#include */ +int sendto(s, m, l, f, t, tl) int s; char *m; int l; int f; struct sockaddr *t; int tl; { abort(); } diff --git a/lib/libstdc/sys/setgroups.c b/lib/libstdc/sys/setgroups.c index 192e28c..f97e210 100644 --- a/lib/libstdc/sys/setgroups.c +++ b/lib/libstdc/sys/setgroups.c @@ -1,3 +1,6 @@ -int setgroups(n, g) int *g; { +#include +#include + +int setgroups(n, g) int n; int *g; { abort(); } diff --git a/lib/libstdc/sys/sethostid.c b/lib/libstdc/sys/sethostid.c index 2100941..27bfb2a 100644 --- a/lib/libstdc/sys/sethostid.c +++ b/lib/libstdc/sys/sethostid.c @@ -1,3 +1,6 @@ +#include +#include + int sethostid(h) long h; { abort(); } diff --git a/lib/libstdc/sys/sethostname.c b/lib/libstdc/sys/sethostname.c index 5b883ad..e6468e2 100644 --- a/lib/libstdc/sys/sethostname.c +++ b/lib/libstdc/sys/sethostname.c @@ -1,3 +1,6 @@ +#include +#include + int sethostname(n, l) char *n; int l; { abort(); } diff --git a/lib/libstdc/sys/setitimer.c b/lib/libstdc/sys/setitimer.c index d65e30f..72273f4 100644 --- a/lib/libstdc/sys/setitimer.c +++ b/lib/libstdc/sys/setitimer.c @@ -1,4 +1,7 @@ +#include #include -int setitimer(w, v, ov) struct itimerval *v, *ov; { + +/*#include */ +int setitimer(w, v, ov) int w; struct itimerval *v; struct itimerval *ov; { abort(); } diff --git a/lib/libstdc/sys/setpgrp.c b/lib/libstdc/sys/setpgrp.c index ef20300..8228005 100644 --- a/lib/libstdc/sys/setpgrp.c +++ b/lib/libstdc/sys/setpgrp.c @@ -1,3 +1,6 @@ -int setpgrp(g, pg) { +#include +#include + +int setpgrp(g, pg) int g; int pg; { abort(); } diff --git a/lib/libstdc/sys/setpriority.c b/lib/libstdc/sys/setpriority.c index 0451299..e7bd627 100644 --- a/lib/libstdc/sys/setpriority.c +++ b/lib/libstdc/sys/setpriority.c @@ -1,3 +1,6 @@ -int setpriority(w, who, pri) { +#include +#include + +int setpriority(w, who, pri) int w; int who; int pri; { abort(); } diff --git a/lib/libstdc/sys/setquota.c b/lib/libstdc/sys/setquota.c index dba93ec..ede27bb 100644 --- a/lib/libstdc/sys/setquota.c +++ b/lib/libstdc/sys/setquota.c @@ -1,3 +1,6 @@ -int setquota(s, f) char *s, *f; { +#include +#include + +int setquota(s, f) char *s; char *f; { abort(); } diff --git a/lib/libstdc/sys/setregid.c b/lib/libstdc/sys/setregid.c index 54a7330..161e626 100644 --- a/lib/libstdc/sys/setregid.c +++ b/lib/libstdc/sys/setregid.c @@ -1,3 +1,6 @@ -int setregid(r, e) int r, e; { +#include +#include + +int setregid(r, e) int r; int e; { abort(); } diff --git a/lib/libstdc/sys/setreuid.c b/lib/libstdc/sys/setreuid.c index 824352d..06367db 100644 --- a/lib/libstdc/sys/setreuid.c +++ b/lib/libstdc/sys/setreuid.c @@ -1,3 +1,6 @@ -int setreuid(r, e) int r, e; { +#include +#include + +int setreuid(r, e) int r; int e; { abort(); } diff --git a/lib/libstdc/sys/setrlimit.c b/lib/libstdc/sys/setrlimit.c index 6d0ae4e..d472975 100644 --- a/lib/libstdc/sys/setrlimit.c +++ b/lib/libstdc/sys/setrlimit.c @@ -1,4 +1,7 @@ +#include #include -int setrlimit(res, rip) struct rlimit *rip; { + +/*#include */ +int setrlimit(res, rip) int res; struct rlimit *rip; { abort(); } diff --git a/lib/libstdc/sys/setsockopt.c b/lib/libstdc/sys/setsockopt.c index d5770e7..0df0d2e 100644 --- a/lib/libstdc/sys/setsockopt.c +++ b/lib/libstdc/sys/setsockopt.c @@ -1,3 +1,6 @@ -int setsockopt(s, level, opt, buf, len) char *buf; { +#include +#include + +int setsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int len; { abort(); } diff --git a/lib/libstdc/sys/settimeofday.c b/lib/libstdc/sys/settimeofday.c index 3191240..6a78f4a 100644 --- a/lib/libstdc/sys/settimeofday.c +++ b/lib/libstdc/sys/settimeofday.c @@ -1,4 +1,7 @@ +#include #include + +/*#include */ int settimeofday(t, z) struct timeval *t; struct timezone *z; { abort(); } diff --git a/lib/libstdc/sys/shutdown.c b/lib/libstdc/sys/shutdown.c index eed6b1a..388a978 100644 --- a/lib/libstdc/sys/shutdown.c +++ b/lib/libstdc/sys/shutdown.c @@ -1,3 +1,6 @@ -int shutdown(s, h){ +#include +#include + +int shutdown(s, h) int s; int h; { abort(); } diff --git a/lib/libstdc/sys/sigblock.c b/lib/libstdc/sys/sigblock.c index 18bf69b..dc378bf 100644 --- a/lib/libstdc/sys/sigblock.c +++ b/lib/libstdc/sys/sigblock.c @@ -1,3 +1,6 @@ -int sigblock(m) { +#include +#include + +int sigblock(m) int m; { abort(); } diff --git a/lib/libstdc/sys/signal.h b/lib/libstdc/sys/signal.h index e08cebc..73d2cf4 100644 --- a/lib/libstdc/sys/signal.h +++ b/lib/libstdc/sys/signal.h @@ -1,3 +1,8 @@ +#ifndef _SYS_SIGNAL_H_ +#define _SYS_SIGNAL_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -112,3 +117,46 @@ struct sigcontext { * sigblock(). */ #define sigmask(m) (1 << ((m)-1)) + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/psignal.c */ +int psignal __P((unsigned sig, char *s)); + +/* gen/siginterrupt.c */ +int siginterrupt __P((int sig, int flag)); + +/* gen/signal.c */ +int (*signal __P((int s, int (*a)(void)))) __P((void)); + +/* sys/kill.c */ +int kill __P((int p, int s)); + +/* sys/killpg.c */ +int killpg __P((int pg, int s)); + +/* sys/sigblock.c */ +int sigblock __P((int m)); + +/* sys/sigpause.c */ +void sigpause __P((int m)); + +/* sys/sigreturn.c */ +int sigreturn __P((struct sigcontext *scp)); + +/* sys/sigsetmask.c */ +int sigsetmask __P((int m)); + +/* sys/sigstack.c */ +int sigstack __P((struct sigstack *ss, struct sigstack *oss)); + +/* sys/sigvec.c */ +int sigvec __P((int c, struct sigvec *f, struct sigvec *m)); + +#endif diff --git a/lib/libstdc/sys/sigpause.c b/lib/libstdc/sys/sigpause.c index fc6fcff..5a555c6 100644 --- a/lib/libstdc/sys/sigpause.c +++ b/lib/libstdc/sys/sigpause.c @@ -1,3 +1,6 @@ -void sigpause(m) { +#include +#include + +void sigpause(m) int m; { abort(); } diff --git a/lib/libstdc/sys/sigreturn.c b/lib/libstdc/sys/sigreturn.c index 218fd59..4b9524b 100644 --- a/lib/libstdc/sys/sigreturn.c +++ b/lib/libstdc/sys/sigreturn.c @@ -1,5 +1,9 @@ +#include #include #include + +/*#include */ +/*#include */ int sigreturn(scp) struct sigcontext *scp; { abort(); } diff --git a/lib/libstdc/sys/sigsetmask.c b/lib/libstdc/sys/sigsetmask.c index ef23897..eb714b5 100644 --- a/lib/libstdc/sys/sigsetmask.c +++ b/lib/libstdc/sys/sigsetmask.c @@ -1,3 +1,6 @@ -int sigsetmask(m) { +#include +#include + +int sigsetmask(m) int m; { abort(); } diff --git a/lib/libstdc/sys/sigstack.c b/lib/libstdc/sys/sigstack.c index bb31e1e..30fccde 100644 --- a/lib/libstdc/sys/sigstack.c +++ b/lib/libstdc/sys/sigstack.c @@ -1,5 +1,9 @@ +#include #include #include -int sigstack(ss, oss) struct sigstack *ss, *oss; { + +/*#include */ +/*#include */ +int sigstack(ss, oss) struct sigstack *ss; struct sigstack *oss; { abort(); } diff --git a/lib/libstdc/sys/sigvec.c b/lib/libstdc/sys/sigvec.c index 8177434..6c134eb 100644 --- a/lib/libstdc/sys/sigvec.c +++ b/lib/libstdc/sys/sigvec.c @@ -1,5 +1,9 @@ +#include #include #include -int sigvec(c, f, m) struct sigvec *f, *m; { + +/*#include */ +/*#include */ +int sigvec(c, f, m) int c; struct sigvec *f; struct sigvec *m; { abort(); } diff --git a/lib/libstdc/sys/socket.c b/lib/libstdc/sys/socket.c index dee5c5b..ecd4fdc 100644 --- a/lib/libstdc/sys/socket.c +++ b/lib/libstdc/sys/socket.c @@ -1,3 +1,6 @@ -int socket(a, t, p) { +#include +#include + +int socket(a, t, p) int a; int t; int p; { abort(); } diff --git a/lib/libstdc/sys/socket.h b/lib/libstdc/sys/socket.h index 6883e8c..e66e93e 100644 --- a/lib/libstdc/sys/socket.h +++ b/lib/libstdc/sys/socket.h @@ -1,3 +1,8 @@ +#ifndef _SYS_SOCKET_H_ +#define _SYS_SOCKET_H_ + +#include + /* * Copyright (c) 1982,1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -143,3 +148,61 @@ struct msghdr { #define MSG_DONTROUTE 0x4 /* send without using routing tables */ #define MSG_MAXIOVLEN 16 + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/accept.c */ +int accept __P((int s, struct sockaddr *a, int *l)); + +/* sys/bind.c */ +int bind __P((int s, struct sockaddr *n, int l)); + +/* sys/connect.c */ +int connect __P((int s, struct sockaddr *n, int l)); + +/* sys/getpeername.c */ +int getpeername __P((int s, struct sockaddr *n, int *l)); + +/* sys/getsockname.c */ +int getsockname __P((int s, char *name, int *namelen)); + +/* sys/getsockopt.c */ +int getsockopt __P((int s, int level, int opt, char *buf, int *len)); + +/* sys/listen.c */ +int listen __P((int s, int b)); + +/* sys/recv.c */ +int recv __P((int s, char *b, int l, int f)); + +/* sys/recvfrom.c */ +int recvfrom __P((int s, char *b, int l, int f, struct sockaddr *fr, int *fl)); + +/* sys/recvmsg.c */ +int recvmsg __P((int s, struct msghdr m[], int f)); + +/* sys/send.c */ +int send __P((int s, char *m, int l, int f)); + +/* sys/sendmsg.c */ +int sendmsg __P((int s, struct msghdr m[], int l)); + +/* sys/sendto.c */ +int sendto __P((int s, char *m, int l, int f, struct sockaddr *t, int tl)); + +/* sys/setsockopt.c */ +int setsockopt __P((int s, int level, int opt, char *buf, int len)); + +/* sys/socket.c */ +int socket __P((int a, int t, int p)); + +/* sys/socketpair.c */ +int socketpair __P((int d, int t, int p, int s[2])); + +#endif diff --git a/lib/libstdc/sys/socketpair.c b/lib/libstdc/sys/socketpair.c index 8bc92c8..8b4eb6e 100644 --- a/lib/libstdc/sys/socketpair.c +++ b/lib/libstdc/sys/socketpair.c @@ -1,3 +1,6 @@ -int socketpair(d, t, p, s) int s[2]; { +#include +#include + +int socketpair(d, t, p, s) int d; int t; int p; int s[2]; { abort(); } diff --git a/lib/libstdc/sys/socketvar.h b/lib/libstdc/sys/socketvar.h index 90779c2..47ce25b 100644 --- a/lib/libstdc/sys/socketvar.h +++ b/lib/libstdc/sys/socketvar.h @@ -1,3 +1,12 @@ +#ifndef _SYS_SOCKETVAR_H_ +#define _SYS_SOCKETVAR_H_ + +#include +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -77,7 +86,6 @@ struct socket { #define SS_NBIO 0x100 /* non-blocking ops */ #define SS_ASYNC 0x200 /* async i/o notify */ - /* * Macros for sockets and socket buffering. */ @@ -142,5 +150,7 @@ struct socket { #define sowwakeup(so) sowakeup((so), &(so)->so_snd) #ifdef KERNEL -struct socket *sonewconn(); +/*struct socket *sonewconn();*/ +#endif + #endif diff --git a/lib/libstdc/sys/stat.c b/lib/libstdc/sys/stat.c index 40cf959..36b6d20 100644 --- a/lib/libstdc/sys/stat.c +++ b/lib/libstdc/sys/stat.c @@ -1,4 +1,7 @@ +#include #include + +/*#include */ int stat(s, b) char *s; struct stat *b; { abort(); } diff --git a/lib/libstdc/sys/stat.h b/lib/libstdc/sys/stat.h index 190f69c..49068be 100644 --- a/lib/libstdc/sys/stat.h +++ b/lib/libstdc/sys/stat.h @@ -1,3 +1,8 @@ +#ifndef _SYS_STAT_H_ +#define _SYS_STAT_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -39,3 +44,22 @@ struct stat { #define S_IREAD 0000400 /* read permission, owner */ #define S_IWRITE 0000200 /* write permission, owner */ #define S_IEXEC 0000100 /* execute/search permission, owner */ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/fstat.c */ +int fstat __P((int f, struct stat *b)); + +/* sys/lstat.c */ +int lstat __P((char *s, struct stat *b)); + +/* sys/stat.c */ +int stat __P((char *s, struct stat *b)); + +#endif diff --git a/lib/libstdc/sys/swapon.c b/lib/libstdc/sys/swapon.c index 9c890f9..250f920 100644 --- a/lib/libstdc/sys/swapon.c +++ b/lib/libstdc/sys/swapon.c @@ -1,3 +1,6 @@ +#include +#include + int swapon(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/symlink.c b/lib/libstdc/sys/symlink.c index 458a4d9..8d368e3 100644 --- a/lib/libstdc/sys/symlink.c +++ b/lib/libstdc/sys/symlink.c @@ -1,3 +1,6 @@ -int symlink(t, f) char *t, *f; { +#include +#include + +int symlink(t, f) char *t; char *f; { abort(); } diff --git a/lib/libstdc/sys/sync.c b/lib/libstdc/sys/sync.c index c565415..e7c5992 100644 --- a/lib/libstdc/sys/sync.c +++ b/lib/libstdc/sys/sync.c @@ -1,3 +1,6 @@ -void sync(){ +#include +#include + +void sync() { abort(); } diff --git a/lib/libstdc/sys/syslog.h b/lib/libstdc/sys/syslog.h index 5d2c0b9..788e4f7 100644 --- a/lib/libstdc/sys/syslog.h +++ b/lib/libstdc/sys/syslog.h @@ -1,3 +1,8 @@ +#ifndef _SYS_SYSLOG_H_ +#define _SYS_SYSLOG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -62,3 +67,19 @@ #define LOG_ODELAY 0x04 /* delay open until syslog() is called */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/syslog.c */ +int syslog __P((int pri, char *fmt, int p0, int p1, int p2, int p3, int p4)); +int openlog __P((char *ident, int logstat, int logfac)); +int closelog __P((void)); +int setlogmask __P((int pmask)); + +#endif diff --git a/lib/libstdc/sys/systm.h b/lib/libstdc/sys/systm.h index 503c88f..a300d06 100644 --- a/lib/libstdc/sys/systm.h +++ b/lib/libstdc/sys/systm.h @@ -1,3 +1,8 @@ +#ifndef _SYS_SYSTM_H_ +#define _SYS_SYSTM_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -56,12 +61,12 @@ extern int icode[]; /* user init code */ extern int szicode; /* its size */ #endif -daddr_t bmap(); -caddr_t calloc(); -int memall(); -int vmemall(); -caddr_t wmemall(); -swblk_t vtod(); +/*daddr_t bmap();*/ +/*caddr_t calloc();*/ +/*int memall();*/ +/*int vmemall();*/ +/*caddr_t wmemall();*/ +/*swblk_t vtod();*/ /* * Structure of the system-entry table @@ -82,3 +87,5 @@ extern char vmmap[]; /* poor name! */ /* casts to keep lint happy */ #define insque(q,p) _insque((caddr_t)q,(caddr_t)p) #define remque(q) _remque((caddr_t)q) + +#endif diff --git a/lib/libstdc/sys/tablet.h b/lib/libstdc/sys/tablet.h index 211678d..b333556 100644 --- a/lib/libstdc/sys/tablet.h +++ b/lib/libstdc/sys/tablet.h @@ -1,3 +1,8 @@ +#ifndef _SYS_TABLET_H_ +#define _SYS_TABLET_H_ + +#include + /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,7 @@ * @(#)tablet.h 7.1 (Berkeley) 6/4/86 */ -#ifndef _TABLET_ +/*#ifndef _TABLET_*/ /* * Tablet line discipline. */ @@ -64,4 +69,6 @@ struct polpos { #define TBHDGHIRES 0x0006 /* hdg-1111b, high res */ #define BIOSTYPE _IOW(b, 3, int) /* set tablet type */ #define BIOGTYPE _IOR(b, 4, int) /* get tablet type*/ +/*#endif*/ + #endif diff --git a/lib/libstdc/sys/text.h b/lib/libstdc/sys/text.h index e1088c2..da09ed7 100644 --- a/lib/libstdc/sys/text.h +++ b/lib/libstdc/sys/text.h @@ -1,3 +1,8 @@ +#ifndef _SYS_TEXT_H_ +#define _SYS_TEXT_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -58,3 +63,5 @@ struct xstats { u_long free_cache; /* placed in cache */ u_long free_cacheswap; /* swapped out to place in cache */ }; + +#endif diff --git a/lib/libstdc/sys/time.h b/lib/libstdc/sys/time.h index f81d40b..070da40 100644 --- a/lib/libstdc/sys/time.h +++ b/lib/libstdc/sys/time.h @@ -1,3 +1,8 @@ +#ifndef _SYS_TIME_H_ +#define _SYS_TIME_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -54,3 +59,49 @@ struct itimerval { #ifndef KERNEL #include #endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/utime.c */ +int utime __P((char *name, int otv[])); + +/* gen/alarm.c */ +int alarm __P((int secs)); + +/* gen/sleep.c */ +int sleep __P((unsigned n)); + +/* gen/time.c */ +long time __P((time_t *t)); + +/* gen/ualarm.c */ +unsigned ualarm __P((register unsigned usecs, register unsigned reload)); + +/* gen/usleep.c */ +int usleep __P((unsigned n)); + +/* sys/adjtime.c */ +int adjtime __P((struct timeval *delta, struct timeval *odelta)); + +/* sys/getitimer.c */ +int getitimer __P((int w, struct itimerval *v)); + +/* sys/gettimeofday.c */ +int gettimeofday __P((struct timeval *t, struct timezone *z)); + +/* sys/setitimer.c */ +int setitimer __P((int w, struct itimerval *v, struct itimerval *ov)); + +/* sys/settimeofday.c */ +int settimeofday __P((struct timeval *t, struct timezone *z)); + +/* sys/utimes.c */ +int utimes __P((char *f, struct timeval t[2])); + +#endif diff --git a/lib/libstdc/sys/timeb.h b/lib/libstdc/sys/timeb.h index b133a0c..4aa28dd 100644 --- a/lib/libstdc/sys/timeb.h +++ b/lib/libstdc/sys/timeb.h @@ -1,3 +1,8 @@ +#ifndef _SYS_TIMEB_H_ +#define _SYS_TIMEB_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,3 +20,16 @@ struct timeb { short timezone; short dstflag; }; + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/ftime.c */ +int ftime __P((register struct timeb *tp)); + +#endif diff --git a/lib/libstdc/sys/times.h b/lib/libstdc/sys/times.h index 546e7d1..d1d5b4d 100644 --- a/lib/libstdc/sys/times.h +++ b/lib/libstdc/sys/times.h @@ -1,3 +1,8 @@ +#ifndef _SYS_TIMES_H_ +#define _SYS_TIMES_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,3 +20,16 @@ struct tms { time_t tms_cutime; /* user time, children */ time_t tms_cstime; /* system time, children */ }; + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/times.c */ +int times __P((register struct tms *tmsp)); + +#endif diff --git a/lib/libstdc/sys/trace.h b/lib/libstdc/sys/trace.h index 2e3e47f..853b44d 100644 --- a/lib/libstdc/sys/trace.h +++ b/lib/libstdc/sys/trace.h @@ -1,3 +1,6 @@ +#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 @@ -84,3 +87,5 @@ int tracewhich; #define trace(a,b,b) ; #endif #endif + +#endif diff --git a/lib/libstdc/sys/truncate.c b/lib/libstdc/sys/truncate.c index 9450545..fb7fd77 100644 --- a/lib/libstdc/sys/truncate.c +++ b/lib/libstdc/sys/truncate.c @@ -1,4 +1,8 @@ +#include +#include #include + +/*#include */ int truncate(p, l) char *p; off_t l; { abort(); } diff --git a/lib/libstdc/sys/tty.h b/lib/libstdc/sys/tty.h index 44e1d80..ec3d866 100644 --- a/lib/libstdc/sys/tty.h +++ b/lib/libstdc/sys/tty.h @@ -1,3 +1,10 @@ +#ifndef _SYS_TTY_H_ +#define _SYS_TTY_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -135,3 +142,5 @@ extern struct ttychars ttydefaults; #define TAB 4 #define VTAB 5 #define RETURN 6 + +#endif diff --git a/lib/libstdc/sys/ttychars.h b/lib/libstdc/sys/ttychars.h index feb26a1..551e91c 100644 --- a/lib/libstdc/sys/ttychars.h +++ b/lib/libstdc/sys/ttychars.h @@ -1,3 +1,6 @@ +#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 @@ -10,8 +13,8 @@ * User visible structures and constants * related to terminal handling. */ -#ifndef _TTYCHARS_ -#define _TTYCHARS_ +/*#ifndef _TTYCHARS_*/ +/*#define _TTYCHARS_*/ struct ttychars { char tc_erase; /* erase last character */ char tc_kill; /* erase entire line */ @@ -47,4 +50,6 @@ struct ttychars { #define CFLUSH CTRL(o) #define CWERASE CTRL(w) #define CLNEXT CTRL(v) +/*#endif*/ + #endif diff --git a/lib/libstdc/sys/ttydev.h b/lib/libstdc/sys/ttydev.h index 0ccd9a3..eea7e5c 100644 --- a/lib/libstdc/sys/ttydev.h +++ b/lib/libstdc/sys/ttydev.h @@ -1,3 +1,6 @@ +#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 @@ -9,8 +12,8 @@ /* * Terminal definitions related to underlying hardware. */ -#ifndef _TTYDEV_ -#define _TTYDEV_ +/*#ifndef _TTYDEV_*/ +/*#define _TTYDEV_*/ /* * Speeds @@ -48,4 +51,6 @@ #define DMBIC 2 #define DMGET 3 #endif +/*#endif*/ + #endif diff --git a/lib/libstdc/sys/types.h b/lib/libstdc/sys/types.h index 75ce112..1b54291 100644 --- a/lib/libstdc/sys/types.h +++ b/lib/libstdc/sys/types.h @@ -1,3 +1,6 @@ +#ifndef _SYS_TYPES_H_ +#define _SYS_TYPES_H_ + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,8 +9,8 @@ * @(#)types.h 7.1 (Berkeley) 6/4/86 */ -#ifndef _TYPES_ -#define _TYPES_ +/*#ifndef _TYPES_*/ +/*#define _TYPES_*/ /* * Basic system types and major/minor device constructing/busting macros. */ @@ -73,4 +76,6 @@ typedef u_short gid_t; /*#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))*/ /*#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))*/ +/*#endif*/ + #endif diff --git a/lib/libstdc/sys/uio.h b/lib/libstdc/sys/uio.h index 5efd22b..becbafd 100644 --- a/lib/libstdc/sys/uio.h +++ b/lib/libstdc/sys/uio.h @@ -1,3 +1,8 @@ +#ifndef _SYS_UIO_H_ +#define _SYS_UIO_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,8 +11,8 @@ * @(#)uio.h 7.1 (Berkeley) 6/4/86 */ -#ifndef _UIO_ -#define _UIO_ +/*#ifndef _UIO_*/ +/*#define _UIO_*/ struct iovec { caddr_t iov_base; @@ -30,4 +35,20 @@ enum uio_rw { UIO_READ, UIO_WRITE }; #define UIO_USERSPACE 0 /* from user data space */ #define UIO_SYSSPACE 1 /* from system space */ #define UIO_USERISPACE 2 /* from user I space */ +/*#endif*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/readv.c */ +int readv __P((int d, struct iovec *v, int l)); + +/* sys/writev.c */ +int writev __P((int f, struct iovec *v, int l)); + #endif diff --git a/lib/libstdc/sys/umask.c b/lib/libstdc/sys/umask.c index 55a6d9f..4c9753b 100644 --- a/lib/libstdc/sys/umask.c +++ b/lib/libstdc/sys/umask.c @@ -1,3 +1,6 @@ -int umask(n) { +#include +#include + +int umask(n) int n; { abort(); } diff --git a/lib/libstdc/sys/umount.c b/lib/libstdc/sys/umount.c index ec31be9..37bab9a 100644 --- a/lib/libstdc/sys/umount.c +++ b/lib/libstdc/sys/umount.c @@ -1,3 +1,6 @@ +#include +#include + int umount(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/un.h b/lib/libstdc/sys/un.h index 9b7b6ee..7d1dce3 100644 --- a/lib/libstdc/sys/un.h +++ b/lib/libstdc/sys/un.h @@ -1,3 +1,6 @@ +#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 @@ -15,5 +18,7 @@ struct sockaddr_un { }; #ifdef KERNEL -int unp_discard(); +/*int unp_discard();*/ +#endif + #endif diff --git a/lib/libstdc/sys/unlink.c b/lib/libstdc/sys/unlink.c index c97c874..4f84696 100644 --- a/lib/libstdc/sys/unlink.c +++ b/lib/libstdc/sys/unlink.c @@ -1,3 +1,6 @@ +#include +#include + int unlink(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/unpcb.h b/lib/libstdc/sys/unpcb.h index 504b48d..39954a3 100644 --- a/lib/libstdc/sys/unpcb.h +++ b/lib/libstdc/sys/unpcb.h @@ -1,3 +1,8 @@ +#ifndef _SYS_UNPCB_H_ +#define _SYS_UNPCB_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -44,3 +49,5 @@ struct unpcb { }; #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) + +#endif diff --git a/lib/libstdc/sys/user.h b/lib/libstdc/sys/user.h index e7cc971..63e3e94 100644 --- a/lib/libstdc/sys/user.h +++ b/lib/libstdc/sys/user.h @@ -1,3 +1,16 @@ +#ifndef _SYS_USER_H_ +#define _SYS_USER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -145,3 +158,5 @@ extern struct user xswap2utl; extern struct user pushutl; extern struct user vfutl; #endif + +#endif diff --git a/lib/libstdc/sys/utimes.c b/lib/libstdc/sys/utimes.c index 429b58e..12ed9f8 100644 --- a/lib/libstdc/sys/utimes.c +++ b/lib/libstdc/sys/utimes.c @@ -1,4 +1,7 @@ +#include #include + +/*#include */ int utimes(f, t) char *f; struct timeval t[2]; { abort(); } diff --git a/lib/libstdc/sys/vadvise.h b/lib/libstdc/sys/vadvise.h index 81650cf..ea748b0 100644 --- a/lib/libstdc/sys/vadvise.h +++ b/lib/libstdc/sys/vadvise.h @@ -1,3 +1,6 @@ +#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 @@ -20,3 +23,5 @@ #define VA_ANOM 1 #define VA_SEQL 2 #define VA_FLUSH 3 + +#endif diff --git a/lib/libstdc/sys/vcmd.h b/lib/libstdc/sys/vcmd.h index 58d0255..ede48f9 100644 --- a/lib/libstdc/sys/vcmd.h +++ b/lib/libstdc/sys/vcmd.h @@ -1,3 +1,8 @@ +#ifndef _SYS_VCMD_H_ +#define _SYS_VCMD_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -20,3 +25,5 @@ #define VGETSTATE _IOR(v, 0, int) #define VSETSTATE _IOW(v, 1, int) + +#endif diff --git a/lib/libstdc/sys/vhangup.c b/lib/libstdc/sys/vhangup.c index b1f66d6..5765c8f 100644 --- a/lib/libstdc/sys/vhangup.c +++ b/lib/libstdc/sys/vhangup.c @@ -1,3 +1,6 @@ +#include +#include + void vhangup() { abort(); } diff --git a/lib/libstdc/sys/vlimit.h b/lib/libstdc/sys/vlimit.h index 25b829a..7abcb64 100644 --- a/lib/libstdc/sys/vlimit.h +++ b/lib/libstdc/sys/vlimit.h @@ -1,3 +1,6 @@ +#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 @@ -20,3 +23,16 @@ #define NLIMITS 6 #define INFINITY 0x7fffffff + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/vlimit.c */ +int vlimit __P((int limit, int value)); + +#endif diff --git a/lib/libstdc/sys/vm.h b/lib/libstdc/sys/vm.h index 441e4d1..76c7d8d 100644 --- a/lib/libstdc/sys/vm.h +++ b/lib/libstdc/sys/vm.h @@ -1,3 +1,6 @@ +#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 @@ -22,3 +25,5 @@ #include #include #endif + +#endif diff --git a/lib/libstdc/sys/vmmac.h b/lib/libstdc/sys/vmmac.h index 6581ea6..15e2d79 100644 --- a/lib/libstdc/sys/vmmac.h +++ b/lib/libstdc/sys/vmmac.h @@ -1,3 +1,15 @@ +#ifndef _SYS_VMMAC_H_ +#define _SYS_VMMAC_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -62,7 +74,7 @@ (((v) < (p)->p_tsize + (p)->p_dsize) ? ((p)->p_p0br + (v)) : \ ((p)->p_addr - (BTOPUSRSTACK - (v)))) #ifdef notdef -struct pte *vtopte(); +/*struct pte *vtopte();*/ #endif /* Bytes to pages without rounding, and back */ @@ -164,3 +176,5 @@ struct pte *vtopte(); /* moved this from sys/vmmac.h to avoid a circular dependency */ #define mapin(pte, v, pfnum, count, prot) \ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) + +#endif diff --git a/lib/libstdc/sys/vmmeter.h b/lib/libstdc/sys/vmmeter.h index e29a349..29d80fe 100644 --- a/lib/libstdc/sys/vmmeter.h +++ b/lib/libstdc/sys/vmmeter.h @@ -1,3 +1,6 @@ +#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 @@ -106,3 +109,5 @@ int rres; unsigned rectime; /* accumulator for reclaim times */ unsigned pgintime; /* accumulator for page in times */ #endif + +#endif diff --git a/lib/libstdc/sys/vmparam.h b/lib/libstdc/sys/vmparam.h index deecc6a..ed851b2 100644 --- a/lib/libstdc/sys/vmparam.h +++ b/lib/libstdc/sys/vmparam.h @@ -1,3 +1,6 @@ +#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 @@ -22,3 +25,5 @@ int klin; int kltxt; int klout; #endif + +#endif diff --git a/lib/libstdc/sys/vmsystm.h b/lib/libstdc/sys/vmsystm.h index 00d07bb..2e1b69c 100644 --- a/lib/libstdc/sys/vmsystm.h +++ b/lib/libstdc/sys/vmsystm.h @@ -1,3 +1,6 @@ +#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 @@ -55,3 +58,5 @@ struct swptstat { #ifdef KERNEL struct swptstat swptstat; #endif + +#endif diff --git a/lib/libstdc/sys/vsio.h b/lib/libstdc/sys/vsio.h index 7a6fd1d..27aefc4 100644 --- a/lib/libstdc/sys/vsio.h +++ b/lib/libstdc/sys/vsio.h @@ -1,3 +1,9 @@ +#ifndef _SYS_VSIO_H_ +#define _SYS_VSIO_H_ + +#include +#include + /* @(#)vsio.h 7.1 (MIT) 6/4/86 */ /**************************************************************************** * * @@ -47,7 +53,6 @@ #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 */ @@ -117,3 +122,5 @@ typedef struct _vsIoAddr { vsBox mbox; /* atomic read/write */ } vsIoAddr; typedef vsIoAddr *vsIoAddrAddr; + +#endif diff --git a/lib/libstdc/sys/vtimes.h b/lib/libstdc/sys/vtimes.h index f970bd3..0bcc5a0 100644 --- a/lib/libstdc/sys/vtimes.h +++ b/lib/libstdc/sys/vtimes.h @@ -1,3 +1,6 @@ +#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 @@ -28,3 +31,16 @@ struct vtimes { #ifdef KERNEL #endif + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* compat-4.1/vtimes.c */ +int vtimes __P((register struct vtimes *par, register struct vtimes *chi)); + +#endif diff --git a/lib/libstdc/sys/wait.c b/lib/libstdc/sys/wait.c index 8aa4e9c..830706b 100644 --- a/lib/libstdc/sys/wait.c +++ b/lib/libstdc/sys/wait.c @@ -1,4 +1,7 @@ +#include #include + +/*#include */ int wait(s) union wait *s; { abort(); } diff --git a/lib/libstdc/sys/wait.h b/lib/libstdc/sys/wait.h index ff44983..f91b485 100644 --- a/lib/libstdc/sys/wait.h +++ b/lib/libstdc/sys/wait.h @@ -1,3 +1,8 @@ +#ifndef _SYS_WAIT_H_ +#define _SYS_WAIT_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -46,7 +51,6 @@ 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 */ /* @@ -64,3 +68,19 @@ union wait { #define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) #define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0) #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* sys/wait3.c */ +int wait3 __P((union wait *s, int o, struct rusage *r)); + +/* sys/wait.c */ +int wait __P((union wait *s)); + +#endif diff --git a/lib/libstdc/sys/wait3.c b/lib/libstdc/sys/wait3.c index 9f1f624..8588eed 100644 --- a/lib/libstdc/sys/wait3.c +++ b/lib/libstdc/sys/wait3.c @@ -1,5 +1,9 @@ +#include #include #include -int wait3(s, o, r) union wait *s; struct rusage *r; { + +/*#include */ +/*#include */ +int wait3(s, o, r) union wait *s; int o; struct rusage *r; { abort(); } diff --git a/lib/libstdc/sys/write.c b/lib/libstdc/sys/write.c index 057bd5c..7e63c35 100644 --- a/lib/libstdc/sys/write.c +++ b/lib/libstdc/sys/write.c @@ -1,3 +1,6 @@ -int write(f, b, l) char *b; { +#include +#include + +int write(f, b, l) int f; char *b; int l; { abort(); } diff --git a/lib/libstdc/sys/writev.c b/lib/libstdc/sys/writev.c index 4a6e26c..9a4bbf4 100644 --- a/lib/libstdc/sys/writev.c +++ b/lib/libstdc/sys/writev.c @@ -1,4 +1,7 @@ +#include #include -int writev(f, v, l) struct iovec *v; { + +/*#include */ +int writev(f, v, l) int f; struct iovec *v; int l; { abort(); } diff --git a/lib/libstdc/syscall.h b/lib/libstdc/syscall.h index 89ceabe..7e99388 100644 --- a/lib/libstdc/syscall.h +++ b/lib/libstdc/syscall.h @@ -1,3 +1,6 @@ +#ifndef _SYSCALL_H_ +#define _SYSCALL_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -156,3 +159,5 @@ #define SYS_setquota 148 #define SYS_quota 149 #define SYS_getsockname 150 + +#endif diff --git a/lib/libstdc/sysexits.h b/lib/libstdc/sysexits.h index dc4a9ff..9382f44 100644 --- a/lib/libstdc/sysexits.h +++ b/lib/libstdc/sysexits.h @@ -1,3 +1,6 @@ +#ifndef _SYSEXITS_H_ +#define _SYSEXITS_H_ + /* ** SYSEXITS.H -- Exit status codes for system programs. ** @@ -80,3 +83,5 @@ # define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ # define EX_PROTOCOL 76 /* remote error in protocol */ # define EX_NOPERM 77 /* permission denied */ + +#endif diff --git a/lib/libstdc/syslog.h b/lib/libstdc/syslog.h deleted file mode 120000 index 11b106a..0000000 --- a/lib/libstdc/syslog.h +++ /dev/null @@ -1 +0,0 @@ -sys/syslog.h \ No newline at end of file diff --git a/lib/libstdc/syslog.h b/lib/libstdc/syslog.h new file mode 100644 index 0000000..7975cce --- /dev/null +++ b/lib/libstdc/syslog.h @@ -0,0 +1,71 @@ +#ifndef _SYSLOG_H_ +#define _SYSLOG_H_ + +#include + +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)syslog.h 7.1 (Berkeley) 6/4/86 + */ + +/* + * Facility codes + */ + +#define LOG_KERN (0<<3) /* kernel messages */ +#define LOG_USER (1<<3) /* random user-level messages */ +#define LOG_MAIL (2<<3) /* mail system */ +#define LOG_DAEMON (3<<3) /* system daemons */ +#define LOG_AUTH (4<<3) /* security/authorization messages */ +#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ +#define LOG_LPR (6<<3) /* line printer subsystem */ + /* other codes through 15 reserved for system use */ +#define LOG_LOCAL0 (16<<3) /* reserved for local use */ +#define LOG_LOCAL1 (17<<3) /* reserved for local use */ +#define LOG_LOCAL2 (18<<3) /* reserved for local use */ +#define LOG_LOCAL3 (19<<3) /* reserved for local use */ +#define LOG_LOCAL4 (20<<3) /* reserved for local use */ +#define LOG_LOCAL5 (21<<3) /* reserved for local use */ +#define LOG_LOCAL6 (22<<3) /* reserved for local use */ +#define LOG_LOCAL7 (23<<3) /* reserved for local use */ + +#define LOG_NFACILITIES 24 /* maximum number of facilities */ +#define LOG_FACMASK 0x03f8 /* mask to extract facility part */ + +/* + * Priorities (these are ordered) + */ + +#define LOG_EMERG 0 /* system is unusable */ +#define LOG_ALERT 1 /* action must be taken immediately */ +#define LOG_CRIT 2 /* critical conditions */ +#define LOG_ERR 3 /* error conditions */ +#define LOG_WARNING 4 /* warning conditions */ +#define LOG_NOTICE 5 /* normal but signification condition */ +#define LOG_INFO 6 /* informational */ +#define LOG_DEBUG 7 /* debug-level messages */ + +#define LOG_PRIMASK 0x0007 /* mask to extract priority part (internal) */ + +/* + * arguments to setlogmask. + */ +#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ +#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ + +/* + * Option flags for openlog. + * + * LOG_ODELAY no longer does anything; LOG_NDELAY is the + * inverse of what it used to be. + */ +#define LOG_PID 0x01 /* log the pid with each message */ +#define LOG_CONS 0x02 /* log on the console if errors in sending */ +#define LOG_ODELAY 0x04 /* delay open until syslog() is called */ +#define LOG_NDELAY 0x08 /* don't delay open */ +#define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ + +#endif diff --git a/lib/libstdc/time.h b/lib/libstdc/time.h index 8eb62c0..542aa81 100644 --- a/lib/libstdc/time.h +++ b/lib/libstdc/time.h @@ -1,3 +1,8 @@ +#ifndef _TIME_H_ +#define _TIME_H_ + +#include + /* time.h 1.1 85/03/13 */ /* @@ -15,5 +20,22 @@ struct tm { int tm_isdst; }; -extern struct tm *gmtime(), *localtime(); -extern char *asctime(), *ctime(); +/*extern struct tm *gmtime(), *localtime();*/ +/*extern char *asctime(), *ctime();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* 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 diff --git a/lib/libstdc/ttyent.h b/lib/libstdc/ttyent.h index f7e0835..2ac6f82 100644 --- a/lib/libstdc/ttyent.h +++ b/lib/libstdc/ttyent.h @@ -1,3 +1,6 @@ +#ifndef _TTYENT_H_ +#define _TTYENT_H_ + /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -18,5 +21,23 @@ struct ttyent { /* see getttyent(3) */ #define TTY_ON 0x1 /* enable logins (startup getty) */ #define TTY_SECURE 0x2 /* allow root to login */ -extern struct ttyent *getttyent(); -extern struct ttyent *getttynam(); +/*extern struct ttyent *getttyent();*/ +/*extern struct ttyent *getttynam();*/ + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/getttyent.c */ +int setttyent __P((void)); +int endttyent __P((void)); +struct ttyent *getttyent __P((void)); + +/* gen/getttynam.c */ +struct ttyent *getttynam __P((char *tty)); + +#endif diff --git a/lib/libstdc/utmp.h b/lib/libstdc/utmp.h index c45b1f2..d9455b7 100644 --- a/lib/libstdc/utmp.h +++ b/lib/libstdc/utmp.h @@ -1,3 +1,6 @@ +#ifndef _UTMP_H_ +#define _UTMP_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,3 +20,22 @@ struct utmp { char ut_host[16]; /* host name, if remote */ long ut_time; /* time on */ }; + +#ifndef __P +#ifdef __STDC__ +#define __P(args) args +#else +#define __P(args) () +#endif +#endif + +/* gen/getlogin.c */ +char *getlogin __P((void)); + +/* gen/ttyname.c */ +char *ttyname __P((int f)); + +/* gen/ttyslot.c */ +int ttyslot __P((void)); + +#endif diff --git a/lib/libstdc/varargs.h b/lib/libstdc/varargs.h index 3a081f5..fe57a5d 100644 --- a/lib/libstdc/varargs.h +++ b/lib/libstdc/varargs.h @@ -1,3 +1,6 @@ +#ifndef _VARARGS_H_ +#define _VARARGS_H_ + /* varargs.h 4.1 83/05/03 */ typedef char *va_list; @@ -5,3 +8,5 @@ typedef char *va_list; # define va_start(list) list = (char *) &va_alist # define va_end(list) # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] + +#endif diff --git a/lib/libstdc/vax/clock.h b/lib/libstdc/vax/clock.h index 67a3f95..e70f12f 100644 --- a/lib/libstdc/vax/clock.h +++ b/lib/libstdc/vax/clock.h @@ -1,3 +1,8 @@ +#ifndef _VAX_CLOCK_H_ +#define _VAX_CLOCK_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -37,3 +42,5 @@ * Software clock is software interrupt level 8, * implemented as mtpr(SIRR, 0x8) in asm.sed. */ + +#endif diff --git a/lib/libstdc/vax/cons.h b/lib/libstdc/vax/cons.h index f947eb4..f674f43 100644 --- a/lib/libstdc/vax/cons.h +++ b/lib/libstdc/vax/cons.h @@ -1,3 +1,6 @@ +#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 @@ -37,3 +40,5 @@ #define TXDB_BOOT 0x02 /* reboot */ #define TXDB_CWSI 0x03 /* clear warm start inhibit */ #define TXDB_CCSI 0x04 /* clear cold-start inhibit */ + +#endif diff --git a/lib/libstdc/vax/cpu.h b/lib/libstdc/vax/cpu.h index 3acf3fc..5567254 100644 --- a/lib/libstdc/vax/cpu.h +++ b/lib/libstdc/vax/cpu.h @@ -1,3 +1,8 @@ +#ifndef _VAX_CPU_H_ +#define _VAX_CPU_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -109,3 +114,5 @@ int cpu; struct percpu percpu[]; #endif #endif + +#endif diff --git a/lib/libstdc/vax/crl.h b/lib/libstdc/vax/crl.h index 8759364..53ff4a7 100644 --- a/lib/libstdc/vax/crl.h +++ b/lib/libstdc/vax/crl.h @@ -1,3 +1,6 @@ +#ifndef _VAX_CRL_H_ +#define _VAX_CRL_H_ + /* * @(#)crl.h 7.1 (Berkeley) 6/5/86 */ @@ -69,7 +72,6 @@ #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" @@ -77,3 +79,5 @@ #define CRLCS_BITS \ "\20\20CE\17DE\16NXM\15DLT\14DCRC\13OPI\1DRDY" #endif + +#endif diff --git a/lib/libstdc/vax/dkio.h b/lib/libstdc/vax/dkio.h index acd4a58..23fb2ed 100644 --- a/lib/libstdc/vax/dkio.h +++ b/lib/libstdc/vax/dkio.h @@ -1,3 +1,8 @@ +#ifndef _VAX_DKIO_H_ +#define _VAX_DKIO_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -16,3 +21,5 @@ /* disk io control commands */ #define DKIOCHDR _IO(d, 1) /* next I/O will read/write header */ + +#endif diff --git a/lib/libstdc/vax/flp.h b/lib/libstdc/vax/flp.h index faceb76..ba14da6 100644 --- a/lib/libstdc/vax/flp.h +++ b/lib/libstdc/vax/flp.h @@ -1,3 +1,6 @@ +#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 @@ -49,3 +52,5 @@ #define FL_OPEN 1 #define FL_BUSY 2 #endif + +#endif diff --git a/lib/libstdc/vax/frame.h b/lib/libstdc/vax/frame.h index 347e6a9..750c2b3 100644 --- a/lib/libstdc/vax/frame.h +++ b/lib/libstdc/vax/frame.h @@ -1,3 +1,8 @@ +#ifndef _VAX_FRAME_H_ +#define _VAX_FRAME_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -20,3 +25,5 @@ struct frame { int fr_savfp; /* saved frame pointer */ int fr_savpc; /* saved program counter */ }; + +#endif diff --git a/lib/libstdc/vax/inline/inline.h b/lib/libstdc/vax/inline/inline.h index 909e73a..143ce39 100644 --- a/lib/libstdc/vax/inline/inline.h +++ b/lib/libstdc/vax/inline/inline.h @@ -1,3 +1,6 @@ +#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 @@ -78,4 +81,6 @@ extern struct inststoptbl inststoptable[]; /* * Miscellaneous functions. */ -char *newline(), *copyline(), *doreplaceon(); +/*char *newline(), *copyline(), *doreplaceon();*/ + +#endif diff --git a/lib/libstdc/vax/ioa.h b/lib/libstdc/vax/ioa.h index c4c0c71..6e41553 100644 --- a/lib/libstdc/vax/ioa.h +++ b/lib/libstdc/vax/ioa.h @@ -1,3 +1,8 @@ +#ifndef _VAX_IOA_H_ +#define _VAX_IOA_H_ + +#include + /* * @(#)ioa.h 7.1 (Berkeley) 6/5/86 */ @@ -80,8 +85,10 @@ struct ioa { }; #ifdef KERNEL struct ioa ioa[MAXNIOA]; -#endif KERNEL -#endif LOCORE +#endif +#endif #define IOA_TYPMSK 0xf0 #define IOA_SBIA 0x10 + +#endif diff --git a/lib/libstdc/vax/ka630.h b/lib/libstdc/vax/ka630.h index 8d1a331..871ee32 100644 --- a/lib/libstdc/vax/ka630.h +++ b/lib/libstdc/vax/ka630.h @@ -1,3 +1,8 @@ +#ifndef _VAX_KA630_H_ +#define _VAX_KA630_H_ + +#include + /* * @(#)ka630.h 7.1 (Berkeley) 6/5/86 * @@ -76,3 +81,5 @@ struct ka630cpu { }; #endif #endif + +#endif diff --git a/lib/libstdc/vax/machparam.h b/lib/libstdc/vax/machparam.h index 04cec5d..2e6dac2 100644 --- a/lib/libstdc/vax/machparam.h +++ b/lib/libstdc/vax/machparam.h @@ -1,3 +1,8 @@ +#ifndef _VAX_MACHPARAM_H_ +#define _VAX_MACHPARAM_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -51,6 +56,8 @@ int cpuspeed; #endif #define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); } -#else KERNEL +#else #define DELAY(n) { register int N = (n); while (--N > 0); } -#endif KERNEL +#endif + +#endif diff --git a/lib/libstdc/vax/mem.h b/lib/libstdc/vax/mem.h index e89add7..c8e3ad7 100644 --- a/lib/libstdc/vax/mem.h +++ b/lib/libstdc/vax/mem.h @@ -1,3 +1,8 @@ +#ifndef _VAX_MEM_H_ +#define _VAX_MEM_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -83,7 +88,7 @@ struct mcr { \5WR_DT_PE_B0\4CHE_RD_DT_PE\3CHE_SEL\2ANY_REFL\1CP_BW_CHE_DT_PE" #define M8600_MSTAT2_BITS "\20\20CP_BYT_WR\17ABUS_BD_DT_CODE\10MULT_ERR\ \7CHE_TAG_PE\6CHE_TAG_W_PE\5CHE_WRTN_BIT\4NXM\3CP-IO_BUF_ERR\2MBOX_LOCK" -#endif VAX8600 +#endif #if VAX780 #define M780_ICRD 0x40000000 /* inhibit crd interrupts, in [2] */ @@ -168,3 +173,5 @@ int nmcr; struct mcr *mcraddr[MAXNMCR]; int mcrtype[MAXNMCR]; #endif + +#endif diff --git a/lib/libstdc/vax/mscp.h b/lib/libstdc/vax/mscp.h index e821159..9bd3546 100644 --- a/lib/libstdc/vax/mscp.h +++ b/lib/libstdc/vax/mscp.h @@ -1,3 +1,8 @@ +#ifndef _VAX_MSCP_H_ +#define _VAX_MSCP_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +15,6 @@ * Definitions for the Mass Storage Control Protocol */ - /* * Control message opcodes */ @@ -36,7 +40,6 @@ #define M_OP_ACPTH 0102 /* Access path attention message */ #define M_OP_END 0200 /* End message flag */ - /* * Generic command modifiers */ @@ -89,7 +92,6 @@ */ #define M_MD_PRIMR 0000001 /* Primary replacement block */ - /* * End message flags */ @@ -98,7 +100,6 @@ #define M_EF_ERLOG 0040 /* Error log generated */ #define M_EF_SEREX 0020 /* Serious exception */ - /* * Controller flags */ @@ -110,7 +111,6 @@ #define M_CF_SHADW 0002 /* Shadowing */ #define M_CF_576 0001 /* 576 byte sectors */ - /* * Unit flags */ @@ -126,7 +126,6 @@ #define M_UF_CMPWR 0000002 /* Compare writes */ #define M_UF_CMPRD 0000001 /* Compare reads */ - /* * Status codes */ @@ -271,7 +270,6 @@ struct mscp { #define mscp_cntcmdl mscp_usefrac #define mscp_cntid mscp_unitid - /* * Error Log message format codes */ @@ -318,3 +316,4 @@ struct mslg { #define mslg_busaddr mslg_unitid.val[0] #define mslg_sdecyl mslg_group +#endif diff --git a/lib/libstdc/vax/mtpr.h b/lib/libstdc/vax/mtpr.h index eeb0ca1..669380c 100644 --- a/lib/libstdc/vax/mtpr.h +++ b/lib/libstdc/vax/mtpr.h @@ -1,3 +1,6 @@ +#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 @@ -91,3 +94,5 @@ #define IUR 0x37 /* init unibus register */ #define TB 0x3b /* translation buffer */ #endif + +#endif diff --git a/lib/libstdc/vax/nexus.h b/lib/libstdc/vax/nexus.h index 7bb6217..e2ff63e 100644 --- a/lib/libstdc/vax/nexus.h +++ b/lib/libstdc/vax/nexus.h @@ -1,3 +1,8 @@ +#ifndef _VAX_NEXUS_H_ +#define _VAX_NEXUS_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -41,7 +46,7 @@ #if VAX8600 #define MAXNNEXUS (2 * NNEXSBI) -#else +#else #define MAXNNEXUS NNEXSBI #endif @@ -115,3 +120,5 @@ struct nexus nexus[MAXNNEXUS]; #define NEX_MEM256U 0x72 /* 256K chips, non-interleaved, upper */ #define NEX_MEM256UI 0x73 /* 256K chips, ext-interleaved, upper */ #define NEX_MEM256I 0x74 /* 256K chips, interleaved */ + +#endif diff --git a/lib/libstdc/vax/pcb.h b/lib/libstdc/vax/pcb.h index 26d772b..b280893 100644 --- a/lib/libstdc/vax/pcb.h +++ b/lib/libstdc/vax/pcb.h @@ -1,3 +1,8 @@ +#ifndef _VAX_PCB_H_ +#define _VAX_PCB_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -64,3 +69,5 @@ struct pcb { { \ mtpr(ASTLVL, ASTLVL_NONE); \ } + +#endif diff --git a/lib/libstdc/vax/psl.h b/lib/libstdc/vax/psl.h index 40917ee..5f19c21 100644 --- a/lib/libstdc/vax/psl.h +++ b/lib/libstdc/vax/psl.h @@ -1,3 +1,6 @@ +#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 @@ -31,3 +34,5 @@ #define PSL_USERSET (PSL_PRVMOD|PSL_CURMOD) #define PSL_USERCLR (PSL_IS|PSL_IPL|PSL_MBZ) + +#endif diff --git a/lib/libstdc/vax/pte.h b/lib/libstdc/vax/pte.h index b72ade9..0c29781 100644 --- a/lib/libstdc/vax/pte.h +++ b/lib/libstdc/vax/pte.h @@ -1,3 +1,6 @@ +#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 @@ -90,3 +93,5 @@ extern struct pte Ka630map[]; #endif #endif #endif + +#endif diff --git a/lib/libstdc/vax/reg.h b/lib/libstdc/vax/reg.h index 6847fd2..a6c2420 100644 --- a/lib/libstdc/vax/reg.h +++ b/lib/libstdc/vax/reg.h @@ -1,3 +1,6 @@ +#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 @@ -31,3 +34,5 @@ #define SP (-5) #define PS (-1) #define PC (-2) + +#endif diff --git a/lib/libstdc/vax/rpb.h b/lib/libstdc/vax/rpb.h index 0ec2eb3..f5342a9 100644 --- a/lib/libstdc/vax/rpb.h +++ b/lib/libstdc/vax/rpb.h @@ -1,3 +1,6 @@ +#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 @@ -21,3 +24,5 @@ struct rpb { #ifdef KERNEL extern struct rpb rpb; #endif + +#endif diff --git a/lib/libstdc/vax/rsp.h b/lib/libstdc/vax/rsp.h index 3b5279c..213e3c3 100644 --- a/lib/libstdc/vax/rsp.h +++ b/lib/libstdc/vax/rsp.h @@ -1,3 +1,9 @@ +#ifndef _VAX_RSP_H_ +#define _VAX_RSP_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -83,3 +89,4 @@ struct packet { */ #define TUSW_MRSP 010 /* use Modified RSP */ +#endif diff --git a/lib/libstdc/vax/scb.h b/lib/libstdc/vax/scb.h index fa438c5..e497212 100644 --- a/lib/libstdc/vax/scb.h +++ b/lib/libstdc/vax/scb.h @@ -1,3 +1,6 @@ +#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 @@ -64,3 +67,5 @@ extern struct scb scb; #define SCB_ISTACK 1 #define SCB_WCS 2 #define SCB_HALT 3 + +#endif diff --git a/lib/libstdc/vax/tmscp.h b/lib/libstdc/vax/tmscp.h index 91de976..87c3f02 100644 --- a/lib/libstdc/vax/tmscp.h +++ b/lib/libstdc/vax/tmscp.h @@ -1,3 +1,8 @@ +#ifndef _VAX_TMSCP_H_ +#define _VAX_TMSCP_H_ + +#include + /* @(#)tmscp.h 7.1 (Berkeley) 6/5/86 */ /* @@ -320,3 +325,4 @@ struct mslg { #define mslg_busaddr mslg_unitid.val[0] #define mslg_sdecyl mslg_group +#endif diff --git a/lib/libstdc/vax/trap.h b/lib/libstdc/vax/trap.h index b46d1c5..23ec8f6 100644 --- a/lib/libstdc/vax/trap.h +++ b/lib/libstdc/vax/trap.h @@ -1,3 +1,6 @@ +#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 @@ -26,3 +29,5 @@ #define T_COMPATFLT 11 /* compatibility mode fault */ #define T_PAGEFLT 12 /* page fault */ #define T_TABLEFLT 13 /* page table fault */ + +#endif diff --git a/lib/libstdc/vax/vmparam.h b/lib/libstdc/vax/vmparam.h index a17cf61..e9e09c2 100644 --- a/lib/libstdc/vax/vmparam.h +++ b/lib/libstdc/vax/vmparam.h @@ -1,3 +1,9 @@ +#ifndef _VAX_VMPARAM_H_ +#define _VAX_VMPARAM_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -159,3 +165,5 @@ /* moved this to sys/vmmac.h to avoid a circular dependency */ /*#define mapin(pte, v, pfnum, count, prot) \ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))*/ + +#endif diff --git a/lib/libstdc/vaxif/if_accreg.h b/lib/libstdc/vaxif/if_accreg.h index 4b501ff..5842ad8 100644 --- a/lib/libstdc/vaxif/if_accreg.h +++ b/lib/libstdc/vaxif/if_accreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_ACCREG_H_ +#define _VAXIF_IF_ACCREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -63,3 +68,5 @@ struct accdevice { #define ACC_OUTBITS \ "\20\20ERR\17NXM\12TMR\10RDY\7IE\4BBACK\3ENLB\2RESET\1GO" + +#endif diff --git a/lib/libstdc/vaxif/if_cssreg.h b/lib/libstdc/vaxif/if_cssreg.h index 1934eac..e013692 100644 --- a/lib/libstdc/vaxif/if_cssreg.h +++ b/lib/libstdc/vaxif/if_cssreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_CSSREG_H_ +#define _VAXIF_IF_CSSREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -56,7 +61,6 @@ 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 */ @@ -65,3 +69,5 @@ struct cssdevice { #define CSS_OUTBITS \ "\20\20ERR\17NXM\16ATTN\15MAINT\11CYCLE\10RDY\7IE\6XBA17\5XBA16\4TXEC\3ENLB\2CLR\1GO" + +#endif diff --git a/lib/libstdc/vaxif/if_ddnreg.h b/lib/libstdc/vaxif/if_ddnreg.h index c541842..58d38fb 100644 --- a/lib/libstdc/vaxif/if_ddnreg.h +++ b/lib/libstdc/vaxif/if_ddnreg.h @@ -1,5 +1,9 @@ -/* @(#)if_ddnreg.h 7.1 (Berkeley) 6/5/86 */ +#ifndef _VAXIF_IF_DDNREG_H_ +#define _VAXIF_IF_DDNREG_H_ + +#include +/* @(#)if_ddnreg.h 7.1 (Berkeley) 6/5/86 */ /************************************************************************\ @@ -27,7 +31,6 @@ part of this software must include a copy of ACC's copyright notice. - File: if_ddnreg.h @@ -126,3 +129,5 @@ struct ddnregs { /* device registers */ #define DDNXODD 2 /* start with odd address */ #define DDNNUMR 4 /* non-UMR transfer */ #define DDNXABT 8 /* abort transfer */ + +#endif diff --git a/lib/libstdc/vaxif/if_ddnvar.h b/lib/libstdc/vaxif/if_ddnvar.h index 4e63eb8..4e950b5 100644 --- a/lib/libstdc/vaxif/if_ddnvar.h +++ b/lib/libstdc/vaxif/if_ddnvar.h @@ -1,6 +1,7 @@ -/* @(#)if_ddnvar.h 7.1 (Berkeley) 6/5/86 */ - +#ifndef _VAXIF_IF_DDNVAR_H_ +#define _VAXIF_IF_DDNVAR_H_ +/* @(#)if_ddnvar.h 7.1 (Berkeley) 6/5/86 */ /************************************************************************\ @@ -28,7 +29,6 @@ part of this software must include a copy of ACC's copyright notice. - File: if_ddnvar.h @@ -118,3 +118,5 @@ typedef int boolean; /* X25 protocols */ #define X25_PROTO_IP 0xcc /* X25 IP protocol type code */ + +#endif diff --git a/lib/libstdc/vaxif/if_dereg.h b/lib/libstdc/vaxif/if_dereg.h index 7c9dd9c..869cb85 100644 --- a/lib/libstdc/vaxif/if_dereg.h +++ b/lib/libstdc/vaxif/if_dereg.h @@ -1,3 +1,9 @@ +#ifndef _VAXIF_IF_DEREG_H_ +#define _VAXIF_IF_DEREG_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -189,3 +195,5 @@ struct de_buf { char db_data[ETHERMTU]; /* packet data */ int db_crc; /* CRC - on receive only */ }; + +#endif diff --git a/lib/libstdc/vaxif/if_dmc.h b/lib/libstdc/vaxif/if_dmc.h index b391532..497ba58 100644 --- a/lib/libstdc/vaxif/if_dmc.h +++ b/lib/libstdc/vaxif/if_dmc.h @@ -1,3 +1,6 @@ +#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 @@ -98,3 +101,5 @@ struct dmc_header { #define DMC_FATAL (DMC_ERROR|DMC_NEXMEM|DMC_START|DMC_LOSTDATA|DMC_MAINTREC) #define CNTLO_BITS \ "\10\12ERROR\11NEXMEM\10START\7DISC\5LSTDATA\4MAINT\3NOBUF\2TIMEO\1DATACK" + +#endif diff --git a/lib/libstdc/vaxif/if_ecreg.h b/lib/libstdc/vaxif/if_ecreg.h index 28b76b5..8347d2e 100644 --- a/lib/libstdc/vaxif/if_ecreg.h +++ b/lib/libstdc/vaxif/if_ecreg.h @@ -1,3 +1,6 @@ +#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 @@ -63,3 +66,5 @@ struct ecdevice { #define ECRHBF 15 /* Last buffer for receive */ #define ECRDOFF 528 /* Packet offset in read buffer */ + +#endif diff --git a/lib/libstdc/vaxif/if_en.h b/lib/libstdc/vaxif/if_en.h index d82b785..2f34b1f 100644 --- a/lib/libstdc/vaxif/if_en.h +++ b/lib/libstdc/vaxif/if_en.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_EN_H_ +#define _VAXIF_IF_EN_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -28,3 +33,5 @@ struct en_header { #define ENTYPE_NTRAILER 16 #define EN_BROADCAST 0 /* Hardware broadcast address */ + +#endif diff --git a/lib/libstdc/vaxif/if_enreg.h b/lib/libstdc/vaxif/if_enreg.h index 623ad80..61936ac 100644 --- a/lib/libstdc/vaxif/if_enreg.h +++ b/lib/libstdc/vaxif/if_enreg.h @@ -1,3 +1,6 @@ +#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 @@ -36,3 +39,5 @@ struct endevice { #define EN_BITS "\10\20ERR\10OPDONE\7IEN\2PROM\1GO" #define spl_enet() spl5() + +#endif diff --git a/lib/libstdc/vaxif/if_exreg.h b/lib/libstdc/vaxif/if_exreg.h index 68a0968..05c3c69 100644 --- a/lib/libstdc/vaxif/if_exreg.h +++ b/lib/libstdc/vaxif/if_exreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_EXREG_H_ +#define _VAXIF_IF_EXREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,6 @@ * @(#)if_exreg.h 7.1 (Berkeley) 6/5/86 */ - struct exdevice { char xd_porta; /* write on porta resets EXOS */ char xd_pad_a; @@ -248,3 +252,4 @@ struct confmsg { /*80*/ }; +#endif diff --git a/lib/libstdc/vaxif/if_hdhreg.h b/lib/libstdc/vaxif/if_hdhreg.h index 2f8f625..8cf0b5c 100644 --- a/lib/libstdc/vaxif/if_hdhreg.h +++ b/lib/libstdc/vaxif/if_hdhreg.h @@ -1,5 +1,9 @@ -/* @(#)if_hdhreg.h 7.1 (Berkeley) 6/5/86 */ +#ifndef _VAXIF_IF_HDHREG_H_ +#define _VAXIF_IF_HDHREG_H_ + +#include +/* @(#)if_hdhreg.h 7.1 (Berkeley) 6/5/86 */ /* $Header$ */ @@ -99,3 +103,5 @@ struct hdhregs { /* device registers */ #define HDHDTERR (HDHSUP+0x0600) /* host data error detected */ #define HDHSQRCV (HDHSUP+0x0700) /* HDLC sequence error detected by IMP */ #define HDHSQERR (HDHSUP+0x0800) /* HDLC sequence error detected by if-11 */ + +#endif diff --git a/lib/libstdc/vaxif/if_hy.h b/lib/libstdc/vaxif/if_hy.h index af50b7f..3123b1b 100644 --- a/lib/libstdc/vaxif/if_hy.h +++ b/lib/libstdc/vaxif/if_hy.h @@ -1,3 +1,10 @@ +#ifndef _VAXIF_IF_HY_H_ +#define _VAXIF_IF_HY_H_ + +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -45,7 +52,6 @@ * */ - /* * Structure of a HYPERchannel adapter header */ @@ -60,7 +66,6 @@ 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] @@ -304,3 +309,4 @@ char *hy_state_names[] = { }; #endif +#endif diff --git a/lib/libstdc/vaxif/if_hyreg.h b/lib/libstdc/vaxif/if_hyreg.h index ca7dec3..638c087 100644 --- a/lib/libstdc/vaxif/if_hyreg.h +++ b/lib/libstdc/vaxif/if_hyreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_HYREG_H_ +#define _VAXIF_IF_HYREG_H_ + +#include + /* * @(#)if_hyreg.h 7.1 (Berkeley) 6/5/86 * @@ -10,7 +15,6 @@ * */ - /* * Network Systems Corporation Hyperchannel interface * @@ -183,3 +187,5 @@ struct hydevice { #define HYF_END_OP 0xE4 /* end operation */ #define HYF_CLRWFMSG 0xE6 /* clear wait for mwssage */ #define HYF_WAITFORMSG 0xE8 /* wait for message */ + +#endif diff --git a/lib/libstdc/vaxif/if_il.h b/lib/libstdc/vaxif/if_il.h index 75ba5dc..5a6cf0a 100644 --- a/lib/libstdc/vaxif/if_il.h +++ b/lib/libstdc/vaxif/if_il.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_IL_H_ +#define _VAXIF_IF_IL_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -50,3 +55,5 @@ struct il_collis { u_short ilc_length; /* Length (should be 0-32) */ u_short ilc_delay[16]; /* Delay Times */ }; + +#endif diff --git a/lib/libstdc/vaxif/if_ilreg.h b/lib/libstdc/vaxif/if_ilreg.h index 0cad2f1..da3e6e2 100644 --- a/lib/libstdc/vaxif/if_ilreg.h +++ b/lib/libstdc/vaxif/if_ilreg.h @@ -1,3 +1,6 @@ +#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 @@ -120,3 +123,5 @@ char *ildiag[NILDIAGS] = { #define ILFSTAT_C 0x1 /* CRC error */ #define ILFSTAT_A 0x2 /* alignment error */ #define ILFSTAT_L 0x4 /* 1+ frames lost just before */ + +#endif diff --git a/lib/libstdc/vaxif/if_ix.h b/lib/libstdc/vaxif/if_ix.h index c708c1a..179a4b0 100644 --- a/lib/libstdc/vaxif/if_ix.h +++ b/lib/libstdc/vaxif/if_ix.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_IX_H_ +#define _VAXIF_IF_IX_H_ + +#include + /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -54,3 +59,5 @@ union ix_stats { #define IXC_CSCLR IXC_MAP(10) /* Clear Channel Statistics */ #define IXC_RESET IXC_MAP(11) /* Reset DLA module */ #define IXC_LDPA IXC_MAP(12) /* Load Physical Address */ + +#endif diff --git a/lib/libstdc/vaxif/if_pclreg.h b/lib/libstdc/vaxif/if_pclreg.h index 8841025..b88660a 100644 --- a/lib/libstdc/vaxif/if_pclreg.h +++ b/lib/libstdc/vaxif/if_pclreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_PCLREG_H_ +#define _VAXIF_IF_PCLREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -57,3 +62,5 @@ struct pcldevice { #define PCL_RERRBITS "\20\20ERR\17NXL\16MEM_OFL\15TXM_ERR\14PARITY\13TIM_OUT\12BC_OFL\11DTO_RDY\10SUC_TXF\07BUSY\06REJ_COMP\05CHN_OPN" #define PCL_RCSRBITS "\20\20REJ\17RC_NPR\16RCV_WD\10LD_SILO\07IE\04DTI_RDY\03INH_ADI\02RC_INIT\01RCV_DAT" + +#endif diff --git a/lib/libstdc/vaxif/if_qereg.h b/lib/libstdc/vaxif/if_qereg.h index 7293f70..e57ebb1 100644 --- a/lib/libstdc/vaxif/if_qereg.h +++ b/lib/libstdc/vaxif/if_qereg.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_QEREG_H_ +#define _VAXIF_IF_QEREG_H_ + +#include + /* @(#)if_qereg.h 7.1 (Berkeley) 6/5/86 */ /* @(#)if_qereg.h 1.2 (ULTRIX) 1/3/85 */ @@ -133,3 +138,5 @@ struct qe_ring { #define QE_NOTYET 0x8000 /* Descriptor not in use yet */ #define QE_INUSE 0x4000 /* Descriptor being used by QNA */ #define QE_MASK 0xc000 /* Lastnot/error/used mask */ + +#endif diff --git a/lib/libstdc/vaxif/if_uba.h b/lib/libstdc/vaxif/if_uba.h index f9d3805..90de07f 100644 --- a/lib/libstdc/vaxif/if_uba.h +++ b/lib/libstdc/vaxif/if_uba.h @@ -1,3 +1,9 @@ +#ifndef _VAXIF_IF_UBA_H_ +#define _VAXIF_IF_UBA_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -101,5 +107,7 @@ struct ifuba { if_ubaget(&(ifu)->ifu_info, &(ifu)->ifu_r, totlen, off0, ifp) #define if_wubaput(ifu, m) \ if_ubaput(&(ifu)->ifu_info, &(ifu)->ifu_xmt, m) -struct mbuf *if_ubaget(); +/*struct mbuf *if_ubaget();*/ +#endif + #endif diff --git a/lib/libstdc/vaxif/if_vv.h b/lib/libstdc/vaxif/if_vv.h index 0bc18d6..3994e1b 100644 --- a/lib/libstdc/vaxif/if_vv.h +++ b/lib/libstdc/vaxif/if_vv.h @@ -1,3 +1,8 @@ +#ifndef _VAXIF_IF_VV_H_ +#define _VAXIF_IF_VV_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -110,3 +115,5 @@ struct vvreg { #define VVIDENTSUCC 5 /* number of successes required in self-test */ #define VVIDENTRETRY 10 /* identify loop attempt limit */ #define VVTIMEOUT 60 /* seconds before a transmit timeout */ + +#endif diff --git a/lib/libstdc/vaxmba/hpreg.h b/lib/libstdc/vaxmba/hpreg.h index 9d44a5e..36e7c00 100644 --- a/lib/libstdc/vaxmba/hpreg.h +++ b/lib/libstdc/vaxmba/hpreg.h @@ -1,3 +1,6 @@ +#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 @@ -163,3 +166,5 @@ struct hpdevice { #define SIRM03 0x8000 /* RM03 indication */ #define SIRM05 0x0000 /* RM05 pseudo-indication */ + +#endif diff --git a/lib/libstdc/vaxmba/htreg.h b/lib/libstdc/vaxmba/htreg.h index 97c1c57..051b535 100644 --- a/lib/libstdc/vaxmba/htreg.h +++ b/lib/libstdc/vaxmba/htreg.h @@ -1,3 +1,6 @@ +#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 @@ -109,3 +112,5 @@ struct htdevice { #define b_repcnt b_bcount #define b_command b_resid + +#endif diff --git a/lib/libstdc/vaxmba/mbareg.h b/lib/libstdc/vaxmba/mbareg.h index 80e08b9..9b652f0 100644 --- a/lib/libstdc/vaxmba/mbareg.h +++ b/lib/libstdc/vaxmba/mbareg.h @@ -1,3 +1,8 @@ +#ifndef _VAXMBA_MBAREG_H_ +#define _VAXMBA_MBAREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -132,3 +137,5 @@ extern char mbsr_bits[]; #define MBDT_TU45 052 #define MBDT_TU77 054 #define MBDT_TU78 0101 + +#endif diff --git a/lib/libstdc/vaxmba/mbavar.h b/lib/libstdc/vaxmba/mbavar.h index 04c7c78..4103ed7 100644 --- a/lib/libstdc/vaxmba/mbavar.h +++ b/lib/libstdc/vaxmba/mbavar.h @@ -1,3 +1,8 @@ +#ifndef _VAXMBA_MBAVAR_H_ +#define _VAXMBA_MBAVAR_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -137,9 +142,11 @@ struct mba_driver { int nummba; #if NMBA > 0 struct mba_hd mba_hd[NMBA]; -extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int(); +/*extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int();*/ extern struct mba_device mbdinit[]; extern struct mba_slave mbsinit[]; #endif #endif + +#endif diff --git a/lib/libstdc/vaxmba/mtreg.h b/lib/libstdc/vaxmba/mtreg.h index 05f6b6e..138326a 100644 --- a/lib/libstdc/vaxmba/mtreg.h +++ b/lib/libstdc/vaxmba/mtreg.h @@ -1,3 +1,6 @@ +#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 @@ -129,3 +132,5 @@ struct mtdevice { #define b_repcnt b_bcount #define b_command b_resid + +#endif diff --git a/lib/libstdc/vaxuba/adreg.h b/lib/libstdc/vaxuba/adreg.h index 9455b65..fd3a631 100644 --- a/lib/libstdc/vaxuba/adreg.h +++ b/lib/libstdc/vaxuba/adreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_ADREG_H_ +#define _VAXUBA_ADREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -27,3 +32,5 @@ struct addevice { #define AD_DONE 0200 #define AD_INCENABLE 040000 #define AD_ERROR 0100000 + +#endif diff --git a/lib/libstdc/vaxuba/dhreg.h b/lib/libstdc/vaxuba/dhreg.h index f672234..00c3a4b 100644 --- a/lib/libstdc/vaxuba/dhreg.h +++ b/lib/libstdc/vaxuba/dhreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_DHREG_H_ +#define _VAXUBA_DHREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -51,3 +56,5 @@ struct dhdevice { #define DH_PE 0010000 /* parity error */ #define DH_FE 0020000 /* framing error */ #define DH_DO 0040000 /* data overrun */ + +#endif diff --git a/lib/libstdc/vaxuba/dhureg.h b/lib/libstdc/vaxuba/dhureg.h index cacb946..ca629f6 100644 --- a/lib/libstdc/vaxuba/dhureg.h +++ b/lib/libstdc/vaxuba/dhureg.h @@ -1,3 +1,6 @@ +#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 @@ -139,3 +142,5 @@ struct dhudevice { #define DML_RTS 0000004 /* request to send */ #define DML_DTR 0000002 /* data terminal ready */ #define DML_LE 0000001 /* line enable */ + +#endif diff --git a/lib/libstdc/vaxuba/dmfreg.h b/lib/libstdc/vaxuba/dmfreg.h index 333b00e..a756ba7 100644 --- a/lib/libstdc/vaxuba/dmfreg.h +++ b/lib/libstdc/vaxuba/dmfreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_DMFREG_H_ +#define _VAXUBA_DMFREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -145,3 +150,5 @@ struct dmfdevice { #define DMFC_LP 0x2000 /* LP dma parallel lineprinter i'face */ #define DMFC_SYNC 0x4000 /* Synchronous serial interface */ #define DMFC_ASYNC 0x8000 /* 8 Serial ports */ + +#endif diff --git a/lib/libstdc/vaxuba/dmreg.h b/lib/libstdc/vaxuba/dmreg.h index 49aefc4..c431b6f 100644 --- a/lib/libstdc/vaxuba/dmreg.h +++ b/lib/libstdc/vaxuba/dmreg.h @@ -1,3 +1,6 @@ +#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 @@ -41,3 +44,5 @@ struct dmdevice { #define DML_ON (DML_DTR|DML_RTS|DML_LE) #define DML_OFF (DML_LE) + +#endif diff --git a/lib/libstdc/vaxuba/dmzreg.h b/lib/libstdc/vaxuba/dmzreg.h index efe6cec..79e74be 100644 --- a/lib/libstdc/vaxuba/dmzreg.h +++ b/lib/libstdc/vaxuba/dmzreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_DMZREG_H_ +#define _VAXUBA_DMZREG_H_ + +#include + /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -127,7 +132,6 @@ 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 */ @@ -143,3 +147,5 @@ struct dmzdevice { #define DMZ_NOC_MASK 03 #define DMZ_INTERFACE 000 + +#endif diff --git a/lib/libstdc/vaxuba/dzreg.h b/lib/libstdc/vaxuba/dzreg.h index 872a402..cfb6e7b 100644 --- a/lib/libstdc/vaxuba/dzreg.h +++ b/lib/libstdc/vaxuba/dzreg.h @@ -1,3 +1,6 @@ +#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 @@ -87,3 +90,5 @@ struct dzdevice { #define DML_RTS 0000004 /* request to send */ #define DML_DTR 0000002 /* data terminal ready */ #define DML_LE 0000001 /* line enable */ + +#endif diff --git a/lib/libstdc/vaxuba/idcreg.h b/lib/libstdc/vaxuba/idcreg.h index b1cacad..20799d6 100644 --- a/lib/libstdc/vaxuba/idcreg.h +++ b/lib/libstdc/vaxuba/idcreg.h @@ -1,3 +1,6 @@ +#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 @@ -102,3 +105,5 @@ struct idcdevice { #define IDCRB80DS_BITS \ "\10\16WTP\15DRDY\14ONCY\13SKE\12PLGV\11FLT\5SEC4\4SEC3\3SEC2\2SEC1\1SEC0" + +#endif diff --git a/lib/libstdc/vaxuba/ikreg.h b/lib/libstdc/vaxuba/ikreg.h index 5d11725..b3de694 100644 --- a/lib/libstdc/vaxuba/ikreg.h +++ b/lib/libstdc/vaxuba/ikreg.h @@ -1,3 +1,9 @@ +#ifndef _VAXUBA_IKREG_H_ +#define _VAXUBA_IKREG_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -112,3 +118,5 @@ struct ikdevice { */ #define FMG0 060200000 + +#endif diff --git a/lib/libstdc/vaxuba/npreg.h b/lib/libstdc/vaxuba/npreg.h index bb62761..d927722 100644 --- a/lib/libstdc/vaxuba/npreg.h +++ b/lib/libstdc/vaxuba/npreg.h @@ -1,3 +1,9 @@ +#ifndef _VAXUBA_NPREG_H_ +#define _VAXUBA_NPREG_H_ + +#include +#include + /* * Copyright (c) 1986 MICOM-Interlan, Inc., Boxborough Mass * All rights reserved. The Berkeley software License Agreement @@ -16,7 +22,6 @@ * Specification. */ - #define NNPCNN 4 /* Number of connections per board */ #define NPUNIT(a) ((minor(a) >> 4) & 0x0F) #define NPCONN(a) ((minor(a)) & 0x03) @@ -133,12 +138,10 @@ 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 */ @@ -467,3 +470,5 @@ struct npbase { #define DEBCSR 0x1000 /* debug CSR commands */ #define DEBLOCK 0x2000 /* debug lock / unlock calls */ #define NOBOARD 0x4000 /* debug user/host interface */ + +#endif diff --git a/lib/libstdc/vaxuba/pdma.h b/lib/libstdc/vaxuba/pdma.h index b19e03d..7517cbb 100644 --- a/lib/libstdc/vaxuba/pdma.h +++ b/lib/libstdc/vaxuba/pdma.h @@ -1,3 +1,6 @@ +#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 @@ -13,3 +16,5 @@ struct pdma { int p_arg; int (*p_fcn)(); }; + +#endif diff --git a/lib/libstdc/vaxuba/psreg.h b/lib/libstdc/vaxuba/psreg.h index efa46f5..dc916df 100644 --- a/lib/libstdc/vaxuba/psreg.h +++ b/lib/libstdc/vaxuba/psreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_PSREG_H_ +#define _VAXUBA_PSREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -6,7 +11,6 @@ * @(#)psreg.h 7.1 (Berkeley) 6/5/86 */ - /* * The Real Nitty Gritty Device Registers */ @@ -205,3 +209,5 @@ struct psdevice { #define FSWR 0177626 #define FSLR 0177627 + +#endif diff --git a/lib/libstdc/vaxuba/rkreg.h b/lib/libstdc/vaxuba/rkreg.h index 6c9162b..08e3cba 100644 --- a/lib/libstdc/vaxuba/rkreg.h +++ b/lib/libstdc/vaxuba/rkreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_RKREG_H_ +#define _VAXUBA_RKREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -133,3 +138,5 @@ struct rkdevice { #define RKAS_M800 0240 /* -800 RK06, -400 RK07 */ #define RKAS_P1200 0060 /* +800 RK06, +400 RK07 */ #define RKAS_M1200 0260 /* -1200 RK06, -1200 RK07 */ + +#endif diff --git a/lib/libstdc/vaxuba/rlreg.h b/lib/libstdc/vaxuba/rlreg.h index e7d6304..5155067 100644 --- a/lib/libstdc/vaxuba/rlreg.h +++ b/lib/libstdc/vaxuba/rlreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_RLREG_H_ +#define _VAXUBA_RLREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -111,3 +116,5 @@ struct rldevice { #define RLER_BITS \ "\10\20WDE\17CHE\16WL\15SKTO\14SPE\13WGE\12VC\11DSE\ \10DT\7HS\6CO\5HO\4BH\3STC\2STB\1STA" + +#endif diff --git a/lib/libstdc/vaxuba/rxreg.h b/lib/libstdc/vaxuba/rxreg.h index e1c80e9..4f65e44 100644 --- a/lib/libstdc/vaxuba/rxreg.h +++ b/lib/libstdc/vaxuba/rxreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_RXREG_H_ +#define _VAXUBA_RXREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -103,3 +108,5 @@ struct rxdeferr { { 0, "Undefined error code" } }; #endif + +#endif diff --git a/lib/libstdc/vaxuba/tmreg.h b/lib/libstdc/vaxuba/tmreg.h index bf77bd3..e3be2e9 100644 --- a/lib/libstdc/vaxuba/tmreg.h +++ b/lib/libstdc/vaxuba/tmreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_TMREG_H_ +#define _VAXUBA_TMREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -95,4 +100,6 @@ struct tmdevice { #define FSR_BITS \ "\10\20REJ\17TMS\16OVRN\15DATACHK\14SSC\13EOTS\12WRTS\11ROMPS\10CRERR\ \7ONLS\6BOTS\5HDENS\4BUPER\3FPTS\2REWS\1RDYS" -#endif AVIV +#endif + +#endif diff --git a/lib/libstdc/vaxuba/tmscpreg.h b/lib/libstdc/vaxuba/tmscpreg.h index 19ea140..e7b79b1 100644 --- a/lib/libstdc/vaxuba/tmscpreg.h +++ b/lib/libstdc/vaxuba/tmscpreg.h @@ -1,3 +1,6 @@ +#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 */ @@ -80,3 +83,5 @@ struct mscp_header { char tmscp_credits; /* low 4 bits: credits, high 4 bits: msgtype */ char tmscp_vcid; /* virtual circuit id (connection id) */ }; + +#endif diff --git a/lib/libstdc/vaxuba/tsreg.h b/lib/libstdc/vaxuba/tsreg.h index b7aaf4d..ea0e5c4 100644 --- a/lib/libstdc/vaxuba/tsreg.h +++ b/lib/libstdc/vaxuba/tsreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_TSREG_H_ +#define _VAXUBA_TSREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -122,7 +127,6 @@ 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 */ @@ -158,9 +162,10 @@ struct ts_char { u_short char_mode; /* characteristics */ }; - /* characteristics */ #define TS_ESS 0200 /* enable skip tape marks stop */ #define TS_ENB 0100 /* ??? */ #define TS_EAI 0040 /* enable attention interrupts */ #define TS_ERI 0020 /* enable message buffer release interrupts */ + +#endif diff --git a/lib/libstdc/vaxuba/ubareg.h b/lib/libstdc/vaxuba/ubareg.h index 807b486..5665f94 100644 --- a/lib/libstdc/vaxuba/ubareg.h +++ b/lib/libstdc/vaxuba/ubareg.h @@ -1,3 +1,11 @@ +#ifndef _VAXUBA_UBAREG_H_ +#define _VAXUBA_UBAREG_H_ + +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -136,8 +144,6 @@ struct uba_regs { #define UBAPURGE(uba, bdp) #endif - - /* uba_mr[] */ #define UBAMR_MRV 0x80000000 /* map register valid */ #define UBAMR_BO 0x02000000 /* byte offset bit */ @@ -188,3 +194,4 @@ struct uba_regs { */ #define ubdevreg(addr) (0760000|((addr)&017777)) +#endif diff --git a/lib/libstdc/vaxuba/ubavar.h b/lib/libstdc/vaxuba/ubavar.h index c9e71ad..e1b90f7 100644 --- a/lib/libstdc/vaxuba/ubavar.h +++ b/lib/libstdc/vaxuba/ubavar.h @@ -1,3 +1,11 @@ +#ifndef _VAXUBA_UBAVAR_H_ +#define _VAXUBA_UBAVAR_H_ + +#include +#include +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -200,7 +208,9 @@ extern int (*UNI1vec[])(); /* unibus vec for uba1 */ * UNIbus adaptors to vector to locore unibus adaptor interrupt dispatchers * which make 780's look like the other VAXen. */ -extern Xua0int(), Xua1int(), Xua2int(), Xua3int(); -#endif VAX780 -#endif KERNEL -#endif !LOCORE +/*extern Xua0int(), Xua1int(), Xua2int(), Xua3int();*/ +#endif +#endif +#endif + +#endif diff --git a/lib/libstdc/vaxuba/udareg.h b/lib/libstdc/vaxuba/udareg.h index 6f8adfd..b659ce3 100644 --- a/lib/libstdc/vaxuba/udareg.h +++ b/lib/libstdc/vaxuba/udareg.h @@ -1,3 +1,6 @@ +#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 @@ -27,7 +30,6 @@ struct udadevice { #define UDA_PI 0000001 /* host requests adapter purge interrupts */ #define UDA_GO 0000001 /* start operation, after init */ - /* * UDA Communications Area */ @@ -55,3 +57,5 @@ struct mscp_header { char uda_credits; /* low 4 bits: credits, high 4 bits: msgtype */ char uda_vcid; /* virtual circuit id */ }; + +#endif diff --git a/lib/libstdc/vaxuba/upreg.h b/lib/libstdc/vaxuba/upreg.h index 98142af..6820d7f 100644 --- a/lib/libstdc/vaxuba/upreg.h +++ b/lib/libstdc/vaxuba/upreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_UPREG_H_ +#define _VAXUBA_UPREG_H_ + +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -163,3 +168,5 @@ struct updevice { #define UPOF_M800 0240 /* -800 uinches */ #define UPOF_P1200 0060 /* +1200 uinches */ #define UPOF_M1200 0260 /* -1200 uinches */ + +#endif diff --git a/lib/libstdc/vaxuba/utreg.h b/lib/libstdc/vaxuba/utreg.h index 7a0442d..3efaf02 100644 --- a/lib/libstdc/vaxuba/utreg.h +++ b/lib/libstdc/vaxuba/utreg.h @@ -1,3 +1,9 @@ +#ifndef _VAXUBA_UTREG_H_ +#define _VAXUBA_UTREG_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -173,3 +179,5 @@ struct utdevice { #define b_repcnt b_bcount #define b_command b_resid #define b_state b_active + +#endif diff --git a/lib/libstdc/vaxuba/uureg.h b/lib/libstdc/vaxuba/uureg.h index de64ab7..29fbb97 100644 --- a/lib/libstdc/vaxuba/uureg.h +++ b/lib/libstdc/vaxuba/uureg.h @@ -1,3 +1,6 @@ +#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 @@ -6,7 +9,6 @@ * @(#)uureg.h 7.1 (Berkeley) 6/5/86 */ - /* * DL11-E/DL11-W UNIBUS (for TU58) controller registers */ @@ -35,3 +37,4 @@ struct uudevice { #define UUDB_DMASK 0x00ff /* data mask (send and receive data) */ +#endif diff --git a/lib/libstdc/vaxuba/vpreg.h b/lib/libstdc/vaxuba/vpreg.h index 13860bb..25e71bf 100644 --- a/lib/libstdc/vaxuba/vpreg.h +++ b/lib/libstdc/vaxuba/vpreg.h @@ -1,3 +1,9 @@ +#ifndef _VAXUBA_VPREG_H_ +#define _VAXUBA_VPREG_H_ + +#include +#include + /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -30,3 +36,5 @@ struct vpdevice { #define VP_CLRCOM 0000004 #define VP_RESET 0000002 #define VP_SPP 0000001 + +#endif diff --git a/lib/libstdc/vaxuba/vsreg.h b/lib/libstdc/vaxuba/vsreg.h index b799d52..aaec333 100644 --- a/lib/libstdc/vaxuba/vsreg.h +++ b/lib/libstdc/vaxuba/vsreg.h @@ -1,3 +1,8 @@ +#ifndef _VAXUBA_VSREG_H_ +#define _VAXUBA_VSREG_H_ + +#include + /* @(#)vsreg.h 7.1 (MIT) 6/5/86 */ /**************************************************************************** * * @@ -208,7 +213,6 @@ struct vs_fparm{ #define vs_cxr vs_csr5 #define vs_cyr vs_csr6 - /* * CSR 7 - Interrupt vector in fiber cable machines */ @@ -232,3 +236,5 @@ struct vs_fparm{ */ #define vs_ivr2 vs_csrf + +#endif diff --git a/lib/libstdc/vfont.h b/lib/libstdc/vfont.h index b2104df..62dd57c 100644 --- a/lib/libstdc/vfont.h +++ b/lib/libstdc/vfont.h @@ -1,3 +1,6 @@ +#ifndef _VFONT_H_ +#define _VFONT_H_ + /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -25,3 +28,5 @@ struct dispatch { char up,down,left,right; short width; }; + +#endif -- 2.34.1