*/
if (strcmp($1->text, $1->name) != 0)
flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
+ /*fprintf(stderr, "typedef: %s\n", $1->name);*/
new_symbol(typedef_names, $1->name, NULL, flags);
free_declarator($1);
}
if (strcmp($3->text, $3->name) != 0)
flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
+ /*fprintf(stderr, "typedef: %s\n", $3->name);*/
new_symbol(typedef_names, $3->name, NULL, flags);
free_declarator($3);
}
file[n] = '\0';
/*fprintf(stderr, "request %s\n", file);*/
+#if 0 /* Nick */
/* Do nothing if the file was already included. */
sprintf(path, stdinc ? "<%s>" : "\"%s\"", file);
if (find_symbol(included_files, path) != NULL)
return;
new_symbol(included_files, path, NULL, DS_NONE);
+#endif
#if 1 /* Nick */
+ /*fprintf(stderr, "entry cur_file: %s\n", cur_file->file_name);*/
int j = strlen(cur_file->file_name);
while (j >= 0 && cur_file->file_name[j--] != '/')
;
} else {
sprintf(path, "%s/%s", inc_dir[i], file);
}
+#if 1 /* Nick */
+ /*fprintf(stderr, "path before: %s\n", path);*/
+ char *stack[MAX_TEXT_SIZE/2];
+ int level = 0;
+ char *p = path, *q = path;
+ stack[level++] = q;
+ while ((*q++ = *p++) != 0)
+ if (q[-1] == '/') {
+ if (stack[level - 1] == q - 1 || (stack[level - 1] == q - 2 && q[-2] == '.'))
+ q = stack[level - 1];
+ else if (level >= 2 && stack[level - 1] == q - 3 && q[-3] == '.' && q[-2] == '.')
+ q = stack[--level - 1];
+ else
+ stack[level++] = q;
+ }
+ /*fprintf(stderr, "path after: %s\n", path);*/
+ if (find_symbol(included_files, path) != NULL) {
+ /*fprintf(stderr, "already included %s\n", path);*/
+ cur_file->file_name[j] = c;
+ inc_dir[0] = "";
+ /*fprintf(stderr, "exit cur_file: %s\n", cur_file->file_name);*/
+ return;
+ }
+#endif
/*fprintf(stderr, "trying %s\n", path);*/
if ((fp = fopen(path, "r")) != NULL) {
/*fprintf(stderr, "success!\n");*/
#if 1 /* Nick */
cur_file->file_name[j] = c;
inc_dir[0] = "";
+#endif
+#if 1 /* Nick */
+ /*fprintf(stderr, "including %s\n", path);*/
+ new_symbol(included_files, path, NULL, DS_NONE);
#endif
yyin = fp;
include_file(path, func_style != FUNC_NONE && !stdinc);
put_error();
fprintf(stderr, "cannot read file %s\n", file_spec);
}
+ /*fprintf(stderr, "exit cur_file: %s\n", cur_file->file_name);*/
}
/* When the end of the current input file is reached, pop a
#ifndef _ASSERT_H_
#define _ASSERT_H_
-#include <csu.h>
#include <stdio.h>
/* assert.h 4.2 85/01/21 */
#include <sys/ioctl.h>
#include <sys/resource.h>
-#include <sys/timeb.h>
#include <sys/time.h>
+#include <sys/timeb.h>
#include <sys/times.h>
#include <sys/vlimit.h>
#include <sys/vtimes.h>
-#include <sys/timeb.h>
#include <sys/time.h>
-#include <sys/types.h>
+#include <sys/timeb.h>
/*
* Copyright (c) 1980 Regents of the University of California.
static char sccsid[] = "@(#)ftime.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <sys/time.h>
+/*#include <sys/types.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/timeb.h>*/
/*
* Backwards compatible ftime.
*/
+/* we now get this from sys/timeb.h to avoid duplication */
/* from old timeb.h */
-struct timeb {
- time_t time;
- u_short millitm;
- short timezone;
- short dstflag;
-};
+/*struct timeb {*/
+/* time_t time;*/
+/* u_short millitm;*/
+/* short timezone;*/
+/* short dstflag;*/
+/*};*/
int ftime(tp) register struct timeb *tp; {
struct timeval t;
static char sccsid[] = "@(#)getpw.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int getpw(uid, buf) int uid; char buf[]; {
static FILE *pwf;
* Writearound to old gtty system call.
*/
-#include <sgtty.h>
+/*#include <sgtty.h>*/
int gtty(fd, ap) int fd; struct sgttyb *ap; {
static char sccsid[] = "@(#)nice.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
/*
* Backwards compatible nice.
* Writearound to old stty system call.
*/
-#include <sgtty.h>
+/*#include <sgtty.h>*/
int stty(fd, ap) int fd; struct sgttyb *ap; {
static char sccsid[] = "@(#)times.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
/*
* Backwards compatible times.
static char sccsid[] = "@(#)utime.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/time.h>
+/*#include <sys/time.h>*/
/*
* Backwards compatible utime.
*/
/*
* (Almost) backwards compatible vlimit.
*/
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <errno.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <errno.h>*/
/* LIM_NORAISE is not emulated */
#define LIM_NORAISE 0 /* if <> 0, can't raise limits */
static char sccsid[] = "@(#)vtimes.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <sys/vtimes.h>*/
/*
* Backwards compatible vtimes.
*/
-struct vtimes {
- int vm_utime; /* user time (60'ths) */
- int vm_stime; /* system time (60'ths) */
+/* we now get this from sys/vtimes.h to avoid duplication */
+/*struct vtimes {*/
+/* int vm_utime;*/ /* user time (60'ths) */
+/* int vm_stime;*/ /* system time (60'ths) */
/* divide next two by utime+stime to get averages */
- unsigned vm_idsrss; /* integral of d+s rss */
- unsigned vm_ixrss; /* integral of text rss */
- int vm_maxrss; /* maximum rss */
- int vm_majflt; /* major page faults */
- int vm_minflt; /* minor page faults */
- int vm_nswap; /* number of swaps */
- int vm_inblk; /* block reads */
- int vm_oublk; /* block writes */
-};
+/* unsigned vm_idsrss;*/ /* integral of d+s rss */
+/* unsigned vm_ixrss;*/ /* integral of text rss */
+/* int vm_maxrss;*/ /* maximum rss */
+/* int vm_majflt;*/ /* major page faults */
+/* int vm_minflt;*/ /* minor page faults */
+/* int vm_nswap;*/ /* number of swaps */
+/* int vm_inblk;*/ /* block reads */
+/* int vm_oublk;*/ /* block writes */
+/*};*/
static getvtimes __P((register struct rusage *aru, register struct vtimes *avt));
static scale60 __P((register struct timeval *tvp));
static char sccsid[] = "@(#)getopt.c 4.3 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
/*
* get option letter from argument vector
compat-4.1.h compat-sys5/getopt.c
csu/gmon.c csu/mon.c sys/gprof.h
ctype.h vaxuba/vsreg.h
-gen.h gen/insque.c gen/remque.c sys/systm.h
+gen.h sys/systm.h
+gen/insque.c sys/systm.h
+gen/remque.c sys/systm.h
gen/regex.c sys/ttychars.h
netinet/in.h netns/ns.h
netinet/in_var.h netns/ns_if.h
+++ /dev/null
-#ifndef _CSU_H_
-#define _CSU_H_
-
-#ifndef KERNEL
-#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
-
-#endif
+++ /dev/null
-#include <csu.h>
-#include <gen.h>
-#include <stdio.h>
-#include <sys/file.h>
-
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)crt0.c 5.3 (Berkeley) 3/9/86";
-#endif
-
-/*
- * C start up routine.
- * Robert Henry, UCB, 20 Oct 81
- *
- * We make the following (true) assumptions:
- * 1) when the kernel calls start, it does a jump to location 2,
- * and thus avoids the register save mask. We are NOT called
- * with a calls! see sys1.c:setregs().
- * 2) The only register variable that we can trust is sp,
- * which points to the base of the kernel calling frame.
- * Do NOT believe the documentation in exec(2) regarding the
- * values of fp and ap.
- * 3) We can allocate as many register variables as we want,
- * and don't have to save them for anybody.
- * 4) Because of the ways that asm's work, we can't have
- * any automatic variables allocated on the stack, because
- * we must catch the value of sp before any automatics are
- * allocated.
- */
-
-char **environ = (char **)0;
-static int fd;
-
-asm("#define _start start");
-asm("#define _eprol eprol");
-extern unsigned char etext;
-extern unsigned char eprol;
-int start() {
- struct kframe {
- int kargc;
- char *kargv[1]; /* size depends on kargc */
- char kargstr[1]; /* size varies */
- char kenvstr[1]; /* size varies */
- };
- /*
- * ALL REGISTER VARIABLES!!!
- */
- register int r11; /* needed for init */
- register struct kframe *kfp; /* r10 */
- register char **targv;
- register char **argv;
- extern int errno;
-
-#ifdef lint
- kfp = 0;
- initcode = initcode = 0;
-#else
- asm(" movl sp,r10"); /* catch it quick */
-#endif
- for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
- /* void */ ;
- if (targv >= (char **)(*argv))
- --targv;
- environ = targv;
-asm("eprol:");
-
-#ifdef paranoid
- /*
- * The standard I/O library assumes that file descriptors 0, 1, and 2
- * are open. If one of these descriptors is closed prior to the start
- * of the process, I/O gets very confused. To avoid this problem, we
- * insure that the first three file descriptors are open before calling
- * main(). Normally this is undefined, as it adds two unnecessary
- * system calls.
- */
- do {
- fd = open("/dev/null", 2);
- } while (fd >= 0 && fd < 3);
- close(fd);
-#endif
-
-#ifdef MCRT0
- monstartup(&eprol, &etext);
-#endif
- errno = 0;
- exit(main(kfp->kargc, argv, environ));
-}
-asm("#undef _start");
-asm("#undef _eprol");
-
-#ifdef MCRT0
-/*ARGSUSED*/
-int exit(code) register int code; /* r11 */ {
- monitor(0);
- _cleanup();
- asm(" movl r11,r0");
- asm(" chmk $1");
-}
-#endif
-
-#ifdef CRT0
-/*
- * null mcount and moncontrol,
- * just in case some routine is compiled for profiling
- */
-int moncontrol(val) int val; {
-
-}
-asm(" .globl mcount");
-asm("mcount: rsb");
-#endif
+++ /dev/null
-#include <csu.h>
-#include <stdio.h>
-#include <sys/errno.h>
-#include <sys/file.h>
-#include <sys.h>
-#include <sys/proc.h>
-
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 3/9/86";
-#endif
-
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
-#include "gmon.h"
-
- /*
- * froms is actually a bunch of unsigned shorts indexing tos
- */
-static int profiling = 3;
-static unsigned short *froms;
-static struct tostruct *tos = 0;
-static long tolimit = 0;
-static char *s_lowpc = 0;
-static char *s_highpc = 0;
-static unsigned long s_textsize = 0;
-
-static int ssiz;
-static char *sbuf;
-static int s_scale;
- /* see profil(2) where this is describe (incorrectly) */
-#define SCALE_1_TO_1 0x10000L
-
-#define MSG "No space for monitor buffer(s)\n"
-
-int monstartup(lowpc, highpc) char *lowpc; char *highpc; {
- int monsize;
- char *buffer;
- char *sbrk();
- extern char *minbrk;
-
- /*
- * round lowpc and highpc to multiples of the density we're using
- * so the rest of the scaling (here and in gprof) stays in ints.
- */
- lowpc = (char *)
- ROUNDDOWN((unsigned)lowpc, HISTFRACTION*sizeof(HISTCOUNTER));
- s_lowpc = lowpc;
- highpc = (char *)
- ROUNDUP((unsigned)highpc, HISTFRACTION*sizeof(HISTCOUNTER));
- s_highpc = highpc;
- s_textsize = highpc - lowpc;
- monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr);
- buffer = sbrk( monsize );
- if ( buffer == (char *) -1 ) {
- write( 2 , MSG , sizeof(MSG) );
- return;
- }
- froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION );
- if ( froms == (unsigned short *) -1 ) {
- write( 2 , MSG , sizeof(MSG) );
- froms = 0;
- return;
- }
- tolimit = s_textsize * ARCDENSITY / 100;
- if ( tolimit < MINARCS ) {
- tolimit = MINARCS;
- } else if ( tolimit > 65534 ) {
- tolimit = 65534;
- }
- tos = (struct tostruct *) sbrk( tolimit * sizeof( struct tostruct ) );
- if ( tos == (struct tostruct *) -1 ) {
- write( 2 , MSG , sizeof(MSG) );
- froms = 0;
- tos = 0;
- return;
- }
- minbrk = sbrk(0);
- tos[0].link = 0;
- monitor( lowpc , highpc , buffer , monsize , tolimit );
-}
-
-int _mcleanup() {
- int fd;
- int fromindex;
- int endfrom;
- char *frompc;
- int toindex;
- struct rawarc rawarc;
-
- fd = creat( "gmon.out" , 0666 );
- if ( fd < 0 ) {
- perror( "mcount: gmon.out" );
- return;
- }
-# ifdef DEBUG
- fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz );
-# endif
- write( fd , sbuf , ssiz );
- endfrom = s_textsize / (HASHFRACTION * sizeof(*froms));
- for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) {
- if ( froms[fromindex] == 0 ) {
- continue;
- }
- frompc = s_lowpc + (fromindex * HASHFRACTION * sizeof(*froms));
- for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) {
-# ifdef DEBUG
- fprintf( stderr ,
- "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" ,
- frompc , tos[toindex].selfpc , tos[toindex].count );
-# endif
- rawarc.raw_frompc = (unsigned long) frompc;
- rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc;
- rawarc.raw_count = tos[toindex].count;
- write( fd , &rawarc , sizeof rawarc );
- }
- }
- close( fd );
-}
-
-asm(".text");
-asm(".align 2");
-asm("#the beginning of mcount()");
-asm(".data");
-int mcount() {
- register char *selfpc; /* r11 => r5 */
- register unsigned short *frompcindex; /* r10 => r4 */
- register struct tostruct *top; /* r9 => r3 */
- register struct tostruct *prevtop; /* r8 => r2 */
- register long toindex; /* r7 => r1 */
-
- /*
- * find the return address for mcount,
- * and the return address for mcount's caller.
- */
- asm(" .text"); /* make sure we're in text space */
- asm(" movl (sp), r11"); /* selfpc = ... (jsb frame) */
- asm(" movl 16(fp), r10"); /* frompcindex = (calls frame) */
- /*
- * check that we are profiling
- * and that we aren't recursively invoked.
- */
- if (profiling) {
- goto out;
- }
- profiling++;
- /*
- * check that frompcindex is a reasonable pc value.
- * for example: signal catchers get called from the stack,
- * not from text space. too bad.
- */
- frompcindex = (unsigned short *)((long)frompcindex - (long)s_lowpc);
- if ((unsigned long)frompcindex > s_textsize) {
- goto done;
- }
- frompcindex =
- &froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))];
- toindex = *frompcindex;
- if (toindex == 0) {
- /*
- * first time traversing this arc
- */
- toindex = ++tos[0].link;
- if (toindex >= tolimit) {
- goto overflow;
- }
- *frompcindex = toindex;
- top = &tos[toindex];
- top->selfpc = selfpc;
- top->count = 1;
- top->link = 0;
- goto done;
- }
- top = &tos[toindex];
- if (top->selfpc == selfpc) {
- /*
- * arc at front of chain; usual case.
- */
- top->count++;
- goto done;
- }
- /*
- * have to go looking down chain for it.
- * top points to what we are looking at,
- * prevtop points to previous top.
- * we know it is not at the head of the chain.
- */
- for (; /* goto done */; ) {
- if (top->link == 0) {
- /*
- * top is end of the chain and none of the chain
- * had top->selfpc == selfpc.
- * so we allocate a new tostruct
- * and link it to the head of the chain.
- */
- toindex = ++tos[0].link;
- if (toindex >= tolimit) {
- goto overflow;
- }
- top = &tos[toindex];
- top->selfpc = selfpc;
- top->count = 1;
- top->link = *frompcindex;
- *frompcindex = toindex;
- goto done;
- }
- /*
- * otherwise, check the next arc on the chain.
- */
- prevtop = top;
- top = &tos[top->link];
- if (top->selfpc == selfpc) {
- /*
- * there it is.
- * increment its count
- * move it to the head of the chain.
- */
- top->count++;
- toindex = prevtop->link;
- prevtop->link = top->link;
- top->link = *frompcindex;
- *frompcindex = toindex;
- goto done;
- }
-
- }
-done:
- profiling--;
- /* and fall through */
-out:
- asm(" rsb");
-
-overflow:
- profiling++; /* halt further profiling */
-# define TOLIMIT "mcount: tos overflow\n"
- write(2, TOLIMIT, sizeof(TOLIMIT));
- goto out;
-}
-asm(".text");
-asm("#the end of mcount()");
-asm(".data");
-
-/*VARARGS1*/
-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 ) {
- moncontrol(0);
- _mcleanup();
- return;
- }
- sbuf = buf;
- ssiz = bufsiz;
- ( (struct phdr *) buf ) -> lpc = lowpc;
- ( (struct phdr *) buf ) -> hpc = highpc;
- ( (struct phdr *) buf ) -> ncnt = ssiz;
- bufsiz -= sizeof(struct phdr);
- if ( bufsiz <= 0 )
- return;
- o = highpc - lowpc;
- if( bufsiz < o )
- s_scale = ( (float) bufsiz / o ) * SCALE_1_TO_1;
- else
- s_scale = SCALE_1_TO_1;
- moncontrol(1);
-}
-
-/*
- * Control profiling
- * profiling is what mcount checks to see if
- * all the data structures are ready.
- */
-int moncontrol(mode) int mode; {
- if (mode) {
- /* start */
- profil(sbuf + sizeof(struct phdr), ssiz - sizeof(struct phdr),
- s_lowpc, s_scale);
- profiling = 0;
- } else {
- /* stop */
- profil((char *)0, 0, 0, 0);
- profiling = 3;
- }
-}
+++ /dev/null
-#include <csu.h>
-#include <sys/file.h>
-#include <sys.h>
-#include <sys/proc.h>
-
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)mon.c 5.3 (Berkeley) 3/9/86";
-#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;
- int ncnt;
-};
-
-struct cnt {
- int *pc;
- long ncall;
-} *countbase;
-
-static int cntrs = 0;
-static int profiling = 3;
-static char *s_sbuf;
-static int s_bufsiz;
-static int s_scale;
-static char *s_lowpc;
-
-int numctrs;
-
-#define MSG "No space for monitor buffer(s)\n"
-
-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;
- monsize = (highpc - lowpc + HISTFRACTION - 1) / HISTFRACTION
- + sizeof(struct phdr) + cntsiz * sizeof(struct cnt);
- monsize = (monsize + 1) & ~1;
- buffer = sbrk(monsize);
- if (buffer == (char *)-1) {
- write(2, MSG, sizeof(MSG));
- return;
- }
- minbrk = sbrk(0);
- monitor(lowpc, highpc, buffer, monsize, cntsiz);
-}
-
-/*
- * This routine is massaged so that it may be jsb'ed to
- */
-asm(".text");
-asm("#the beginning of mcount()");
-asm(".data");
-int mcount() {
- register int *selfpc; /* r11 */
- register long **cntp; /* r10 */
-
- /*
- * find the return address for mcount,
- * and address of counter pointer
- */
- asm(" movl (sp),r11"); /* selfpc = ... (jsb frame) */
- asm(" movl r0,r10"); /* address of count local */
- /*
- * check that we aren't recursively invoked.
- */
- if (profiling)
- goto out;
- profiling++;
- /*
- * check that counter is allocated
- */
- if (*cntp == 0) {
- /*
- * check that a counter is available
- */
- if (cntrs++ == numctrs)
- goto overflow;
- countbase->pc = selfpc;
- *cntp = &countbase->ncall;
- countbase++;
- }
- (**cntp)++;
- profiling--;
-out:
- asm( " rsb" );
-
-overflow:
-# define TOLIMIT "mcount: counter overflow\n"
- write( 2 , TOLIMIT , sizeof( TOLIMIT ) );
- goto out;
-}
-asm(".text");
-asm("#the end of mcount()");
-asm(".data");
-
-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;
- static char *sbuf;
-
- if (lowpc == 0) {
- moncontrol(0);
- o = creat("mon.out", 0666);
- write(o, sbuf, ssiz);
- close(o);
- return;
- }
- sbuf = buf;
- ssiz = bufsiz;
- php = (struct phdr *)&buf[0];
- php->lpc = (int *)lowpc;
- php->hpc = (int *)highpc;
- php->ncnt = cntsiz;
- numctrs = cntsiz;
- countbase = (struct cnt *)(buf + sizeof(struct phdr));
- o = sizeof(struct phdr) + cntsiz * sizeof(struct cnt);
- buf += o;
- bufsiz -= o;
- if (bufsiz <= 0)
- return;
- o = (highpc - lowpc);
- if(bufsiz < o)
- o = ((float) bufsiz / o) * 65536;
- else
- o = 65536;
- s_scale = o;
- s_sbuf = buf;
- s_bufsiz = bufsiz;
- s_lowpc = lowpc;
- moncontrol(1);
-}
-
-/*
- * Control profiling
- * profiling is what mcount checks to see if
- * all the data structures are ready.
- */
-int moncontrol(mode) int mode; {
- if (mode) {
- /* start */
- profil(s_sbuf, s_bufsiz, s_lowpc, s_scale);
- profiling = 0;
- } else {
- /* stop */
- profil((char *)0, 0, 0, 0);
- profiling = 3;
- }
-}
--- /dev/null
+#!/bin/sh
+prefix=
+while read i
+do
+ func=`echo $i |sed -ne 's/.*: In function ‘\(.*\)’:$/\1/p'`
+ if test -n "$func"
+ then
+ prefix="$func: "
+ else
+ echo "$prefix$i"
+ fi
+done
#include <sys/dir.h>
#include <sys/errno.h>
#include <sys/exec.h>
-#include <sys/ioctl.h>
#include <sys/proc.h>
#include <sys/signal.h>
#include <sys/syslog.h>
char *fcvt __P((double arg, int ndigits, int *decpt, int *sign));
/* gen/fakcu.c */
-int _cleanup __P((void));
+void _cleanup __P((void));
/* gen/ffs.c */
int ffs __P((register long mask));
/* gen/malloc.c */
char *malloc __P((unsigned nbytes));
-int morecore __P((int bucket));
-int free __P((char *cp));
+void morecore __P((int bucket));
+void free __P((char *cp));
char *realloc __P((char *cp, unsigned nbytes));
-int mstats __P((char *s));
+void mstats __P((char *s));
/* gen/mkstemp.c */
int mkstemp __P((char *as));
char *mktemp __P((char *as));
/* gen/qsort.c */
-int qsort __P((char *base, int n, int size, int (*compar)(void)));
+void qsort __P((char *base, int n, int size, int (*compar)(void)));
/* gen/random.c */
int srandom __P((unsigned x));
/*
* Backwards compatible alarm.
*/
-#include <sys/time.h>
+/*#include <sys/time.h>*/
int alarm(secs) int secs; {
struct itimerval it, oitv;
static char sccsid[] = "@(#)closedir.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
/*
* close a directory.
* ctime(t) just calls localtime, then asctime.
*/
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/timeb.h>
+/*#include <sys/time.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/timeb.h>*/
static char cbuf[26];
static int dmsize[12] = {
static char sccsid[] = "@(#)ctype_.c 5.4 (Berkeley) 3/9/86";
#endif
-#include <ctype.h>
+/*#include <ctype.h>*/
char _ctype_[1 + 256] = {
0,
static char sccsid[] = "@(#)disktab.c 5.3 (Berkeley) 3/9/86";
#endif
-#include <disktab.h>
-#include <stdio.h>
+/*#include <disktab.h>*/
+/*#include <stdio.h>*/
/*static char *dgetstr();*/
return (dp);
}
-#include <ctype.h>
+/*#include <ctype.h>*/
static char *tbuf;
/*static char *dskip();*/
* execlp(name, arg,...,0) (like execl, but does path search)
* execvp(name, argv) (like execv, but does path search)
*/
-#include <errno.h>
+/*#include <errno.h>*/
#define NULL 0
static char shell[] = "/bin/sh";
* Null cleanup routine to resolve reference in exit()
* if not using stdio.
*/
-int _cleanup() {
+void _cleanup() {
}
static char sccsid[] = "@(#)fstab.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <fstab.h>
-#include <stdio.h>
-#include <ctype.h>
+/*#include <fstab.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
static struct fstab fs;
static char line[BUFSIZ+1];
static char sccsid[] = "@(#)getgrent.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <grp.h>
+/*#include <stdio.h>*/
+/*#include <grp.h>*/
#define MAXGRP 200
static char sccsid[] = "@(#)getgrgid.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <grp.h>
+/*#include <grp.h>*/
struct group *getgrgid(gid) register gid; {
register struct group *p;
static char sccsid[] = "@(#)getgrnam.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <grp.h>
+/*#include <grp.h>*/
struct group *getgrnam(name) register char *name; {
register struct group *p;
static char sccsid[] = "@(#)getlogin.c 5.3 (Berkeley) 5/9/86";
#endif
-#include <utmp.h>
+/*#include <utmp.h>*/
static char UTMP[] = "/etc/utmp";
static struct utmp ubuf;
static char sccsid[] = "@(#)getpass.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <signal.h>
-#include <sgtty.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
+/*#include <sgtty.h>*/
char *getpass(prompt) char *prompt; {
struct sgttyb ttyb;
static char sccsid[] = "@(#)getpwent.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <pwd.h>
-#include <ndbm.h>
+/*#include <stdio.h>*/
+/*#include <pwd.h>*/
+/*#include <ndbm.h>*/
static char EMPTY[] = "";
static FILE *pwf = NULL;
static char sccsid[] = "@(#)getpwnamuid.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <pwd.h>
-#include <ndbm.h>
+/*#include <stdio.h>*/
+/*#include <pwd.h>*/
+/*#include <ndbm.h>*/
-#include <sys/file.h>
+/*#include <sys/file.h>*/
static char line[BUFSIZ+1];
static struct passwd passwd;
static char sccsid[] = "@(#)getttyent.c 5.4 (Berkeley) 5/19/86";
#endif
-#include <stdio.h>
-#include <strings.h>
-#include <ttyent.h>
+/*#include <stdio.h>*/
+/*#include <strings.h>*/
+/*#include <ttyent.h>*/
static char TTYFILE[] = "/etc/ttys";
static char zapchar;
static char sccsid[] = "@(#)getttynam.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <ttyent.h>
+/*#include <ttyent.h>*/
struct ttyent *getttynam(tty) char *tty; {
register struct ttyent *t;
static char sccsid[] = "@(#)getusershell.c 5.4 (Berkeley) 7/25/86";
#endif
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <stdio.h>
+/*#include <sys/param.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/stat.h>*/
+/*#include <ctype.h>*/
+/*#include <stdio.h>*/
#define SHELLS "/etc/shells"
* getwd() returns the pathname of the current working directory. On error
* an error message is copied to pathname and null pointer is returned.
*/
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
#define GETWDERR(s) strcpy(pathname, (s));
/*
* initgroups
*/
-#include <stdio.h>
-#include <sys/param.h>
-#include <grp.h>
+/*#include <stdio.h>*/
+/*#include <sys/param.h>*/
+/*#include <grp.h>*/
/*struct group *getgrent();*/
+#include <gen.h>
+
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87";
#endif
-#include <gen.h>
+/*#include <gen.h>*/
/*
* insque -- vax insque instruction
* This is designed for use in a virtual memory environment.
*/
-#include <sys/types.h>
+/*#include <sys/types.h>*/
#define NULL 0
* for a given block size.
*/
static u_int nmalloc[NBUCKETS];
-#include <stdio.h>
+/*#include <stdio.h>*/
#endif
#if defined(DEBUG) || defined(RCHECK)
#define ASSERT(p) if (!(p)) botch("p")
-#include <stdio.h>
-static botch __P((char *s));
+/*#include <stdio.h>*/
+static void botch __P((char *s));
static findbucket __P((union overhead *freep, int srchlen));
-static botch(s) char *s; {
+static void botch(s) char *s; {
fprintf(stderr, "\r\nassertion botched: %s\r\n", s);
(void) fflush(stderr); /* just in case user buffered it */
abort();
/*
* Allocate more memory to the indicated bucket.
*/
-int morecore(bucket) int bucket; {
+void morecore(bucket) int bucket; {
register union overhead *op;
register int sz; /* size of desired block */
int amt; /* amount to allocate */
}
}
-int free(cp) char *cp; {
+void free(cp) char *cp; {
register int size;
register union overhead *op;
* for each size category, the second showing the number of mallocs -
* frees for each size category.
*/
-int mstats(s) char *s; {
+void mstats(s) char *s; {
register int i, j;
register union overhead *p;
int totfree = 0,
static char sccsid[] = "@(#)mkstemp.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/file.h>
+/*#include <sys/file.h>*/
int mkstemp(as) char *as; {
register char *s;
static char sccsid[] = "@(#)ndbm.c 5.3 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <stdio.h>
-#include <errno.h>
-#include <ndbm.h>
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
+/*#include <ndbm.h>*/
#define BYTESIZ 8
#undef setbit
static char sccsid[] = "@(#)nlist.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <a.out.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <a.out.h>*/
+/*#include <stdio.h>*/
/*
* nlist - retreive attributes from name list (string table version)
static char sccsid[] = "@(#)opendir.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
/*
* open a directory.
* Print the error indicated
* in the cerror cell.
*/
-#include <sys/types.h>
-#include <sys/uio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/uio.h>*/
int errno;
int sys_nerr;
* Print the name of the signal indicated
* along with the supplied message.
*/
-#include <signal.h>
+/*#include <signal.h>*/
extern char *sys_siglist[];
* It's not...
*/
-static qst __P((char *base, char *max));
+static void qst __P((char *base, char *max));
-int qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); {
+void qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); {
register char c, *i, *j, *lo, *hi;
char *min, *max;
* (And there are only three places where this is done).
*/
-static qst(base, max) char *base; char *max; {
+static void qst(base, max) char *base; char *max; {
register char c, *i, *j, *jj;
register int ii;
char *mid, *tmp;
static char sccsid[] = "@(#)random.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
/*
* random.c:
if( n < BREAK_1 ) {
if( n < BREAK_0 ) {
fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n" );
- return;
+ return( ostate );
}
rand_type = TYPE_0;
rand_deg = DEG_0;
static char sccsid[] = "@(#)readdir.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
/*
* get next entry in a directory.
+#include <gen.h>
+
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87";
#endif
-#include <gen.h>
+/*#include <gen.h>*/
/*
* remque -- vax remque instruction
* struct direct (through namelist). Returns -1 if there were any errors.
*/
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
int scandir(dirname, namelist, select, dcomp) char *dirname; struct direct *(*namelist[]); int (*select)(); int (*dcomp)(); {
register struct direct *d, *p, **names;
static char sccsid[] = "@(#)seekdir.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
/*
* seek to an entry in a directory.
static char sccsid[] = "@(#)siginterrupt.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <signal.h>
+/*#include <signal.h>*/
/*
* Set signal state to prevent restart of system calls
static char sccsid[] = "@(#)siglist.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <signal.h>
+/*#include <signal.h>*/
char *sys_siglist[NSIG] = {
"Signal 0",
/*
* Almost backwards compatible signal.
*/
-#include <signal.h>
+/*#include <signal.h>*/
int (*signal(s, a))() int s; int (*a)(); {
struct sigvec osv, sv;
static char sccsid[] = "@(#)sleep.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/time.h>
-#include <signal.h>
+/*#include <sys/time.h>*/
+/*#include <signal.h>*/
#define setvec(vec, a) \
vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0
static int ringring;
-static sleepx __P((void));
+static void sleepx __P((void));
-int sleep(n) unsigned n; {
+void sleep(n) unsigned n; {
int sleepx(), omask;
struct itimerval itv, oitv;
register struct itimerval *itp = &itv;
(void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
}
-static sleepx() {
-
+static void sleepx() {
ringring = 1;
}
* Modified to use UNIX domain IPC by Ralph Campbell
*/
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/file.h>
-#include <sys/signal.h>
-#include <sys/syslog.h>
-#include <netdb.h>
-#include <strings.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/signal.h>*/
+/*#include <sys/syslog.h>*/
+/*#include <netdb.h>*/
+/*#include <strings.h>*/
#define MAXLINE 1024 /* max message size */
#define NULL 0 /* manifest */
extern int errno, sys_nerr;
extern char *sys_errlist[];
-int syslog(pri, fmt, p0, p1, p2, p3, p4) int pri; char *fmt; int p0; int p1; int p2; int p3; int p4; {
+void 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;
* OPENLOG -- open system log
*/
-int openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; {
+void openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; {
if (ident != NULL)
LogTag = ident;
LogStat = logstat;
* CLOSELOG -- close the system log
*/
-int closelog() {
-
+void closelog() {
(void) close(LogFile);
LogFile = -1;
}
static char sccsid[] = "@(#)system.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <signal.h>
+/*#include <signal.h>*/
int system(s) char *s; {
int status, pid, w;
static char sccsid[] = "@(#)telldir.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
/*
* return a pointer into a directory
/*
* Backwards compatible time call.
*/
-#include <sys/types.h>
-#include <sys/time.h>
+/*#include <sys/types.h>*/
+/*#include <sys/time.h>*/
long time(t) time_t *t; {
struct timeval tt;
#define NULL 0
#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/stat.h>
+/*#include <sys/dir.h>*/
+/*#include <sys/stat.h>*/
static char dev[] = "/dev/";
/*char *strcpy();*/
* corresponding to the current user: try for file 0, 1, 2.
* Definition is the line number in the /etc/ttys file.
*/
-#include <ttyent.h>
+/*#include <ttyent.h>*/
/*char *ttyname();*/
/*char *rindex();*/
static char sccsid[] = "@(#)ualarm.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/time.h>
+/*#include <sys/time.h>*/
#define USPS 1000000 /* # of microseconds in a second */
static char sccsid[] = "@(#)usleep.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/time.h>
-#include <signal.h>
+/*#include <sys/time.h>*/
+/*#include <signal.h>*/
#define USPS 1000000 /* number of microseconds in a second */
#define TICK 10000 /* system clock resolution in microseconds */
static int ringring;
-static sleepx __P((void));
+static void sleepx __P((void));
-int usleep(n) unsigned n; {
+void usleep(n) unsigned n; {
int sleepx(), omask;
struct itimerval itv, oitv;
register struct itimerval *itp = &itv;
(void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
}
-static sleepx() {
-
+static void sleepx() {
ringring = 1;
}
compat-sys5/strspn.c string.h
compat-sys5/strtok.c string.h
compat-sys5/tmpnam.c
-csu/crt0.c
-csu/gmon.c
-csu/mon.c
gen/abort.c
gen/abs.c
gen/alarm.c sys/time.h
gen/index.c strings.h
gen/initgroups.c grp.h
gen/insque.c
-gen/isatty.c sys/ioctl.h
gen/ldexp.c math.h
gen/malloc.c
gen/mkstemp.c
sys/gettimeofday.c sys/time.h
sys/getuid.c sys/proc.h
sys/ioctl.c sys/ioctl.h
+sys/isatty.c sys/ioctl.h
sys/kill.c sys/signal.h
sys/killpg.c sys/signal.h
sys/link.c sys/file.h
sys/umount.c sys/mount.h
sys/unlink.c sys/file.h
sys/utimes.c sys/time.h
+sys/vfork.c sys/proc.h
sys/vhangup.c
sys/wait3.c sys/wait.h
sys/wait.c sys/wait.h
static char sccsid[] = "@(#)inet_addr.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <ctype.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <ctype.h>*/
+/*#include <netinet/in.h>*/
/*
* Internet address interpretation routine.
static char sccsid[] = "@(#)inet_lnaof.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
/*
* Return the local network address portion of an
static char sccsid[] = "@(#)inet_makeaddr.c 5.1 (Berkeley) 3/11/86";
#endif
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
/*
* Formulate an Internet address from network + host. Used in
static char sccsid[] = "@(#)inet_netof.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
/*
* Return the network number from an internet
static char sccsid[] = "@(#)inet_network.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <ctype.h>
+/*#include <sys/types.h>*/
+/*#include <ctype.h>*/
/*
* Internet network address interpretation routine.
* Convert network-format internet address
* to base 256 d.d.d.d representation.
*/
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
char *inet_ntoa(in) struct in_addr in; {
static char b[18];
diff --unified --recursive --new-file libstdc.orig/a.out.h libstdc/a.out.h
---- libstdc.orig/a.out.h 2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/a.out.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/a.out.h 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/a.out.h 2017-01-19 15:17:46.198529987 +1100
@@ -39,44 +39,4 @@
:4; /* nothing, yet */
};
- */
-#define N_FORMAT "%08x"
+#include <nlist.h>
+diff --unified --recursive --new-file libstdc.orig/compat-4.1/ftime.c libstdc/compat-4.1/ftime.c
+--- libstdc.orig/compat-4.1/ftime.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/ftime.c 2017-01-19 15:19:31.050463867 +1100
+@@ -10,18 +10,20 @@
+
+ #include <sys/types.h>
+ #include <sys/time.h>
++#include <sys/timeb.h>
+
+ /*
+ * Backwards compatible ftime.
+ */
+
++/* we now get this from sys/timeb.h to avoid duplication */
+ /* from old timeb.h */
+-struct timeb {
+- time_t time;
+- u_short millitm;
+- short timezone;
+- short dstflag;
+-};
++/*struct timeb {*/
++/* time_t time;*/
++/* u_short millitm;*/
++/* short timezone;*/
++/* short dstflag;*/
++/*};*/
+
+ ftime(tp)
+ register struct timeb *tp; {
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-19 02:19:04.339168949 +1100
-+++ libstdc/compat-4.1/gtty.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/compat-4.1/gtty.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/gtty.c 2017-01-19 15:17:46.198529987 +1100
@@ -15,7 +15,7 @@
#include <sgtty.h>
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-19 02:19:04.339168949 +1100
-+++ libstdc/compat-4.1/stty.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/compat-4.1/stty.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/stty.c 2017-01-19 15:17:46.198529987 +1100
@@ -15,7 +15,7 @@
#include <sgtty.h>
return(ioctl(fd, TIOCSETP, ap));
}
+diff --unified --recursive --new-file libstdc.orig/compat-4.1/vtimes.c libstdc/compat-4.1/vtimes.c
+--- libstdc.orig/compat-4.1/vtimes.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/vtimes.c 2017-01-19 15:17:46.198529987 +1100
+@@ -10,23 +10,25 @@
+
+ #include <sys/time.h>
+ #include <sys/resource.h>
++#include <sys/vtimes.h>
+
+ /*
+ * Backwards compatible vtimes.
+ */
+-struct vtimes {
+- int vm_utime; /* user time (60'ths) */
+- int vm_stime; /* system time (60'ths) */
++/* we now get this from sys/vtimes.h to avoid duplication */
++/*struct vtimes {*/
++/* int vm_utime;*/ /* user time (60'ths) */
++/* int vm_stime;*/ /* system time (60'ths) */
+ /* divide next two by utime+stime to get averages */
+- unsigned vm_idsrss; /* integral of d+s rss */
+- unsigned vm_ixrss; /* integral of text rss */
+- int vm_maxrss; /* maximum rss */
+- int vm_majflt; /* major page faults */
+- int vm_minflt; /* minor page faults */
+- int vm_nswap; /* number of swaps */
+- int vm_inblk; /* block reads */
+- int vm_oublk; /* block writes */
+-};
++/* unsigned vm_idsrss;*/ /* integral of d+s rss */
++/* unsigned vm_ixrss;*/ /* integral of text rss */
++/* int vm_maxrss;*/ /* maximum rss */
++/* int vm_majflt;*/ /* major page faults */
++/* int vm_minflt;*/ /* minor page faults */
++/* int vm_nswap;*/ /* number of swaps */
++/* int vm_inblk;*/ /* block reads */
++/* int vm_oublk;*/ /* block writes */
++/*};*/
+
+ vtimes(par, chi)
+ register struct vtimes *par, *chi; {
diff --unified --recursive --new-file libstdc.orig/fcntl.h libstdc/fcntl.h
---- libstdc.orig/fcntl.h 2017-01-19 02:19:04.343169028 +1100
+--- libstdc.orig/fcntl.h 2017-01-19 15:17:46.190529992 +1100
+++ libstdc/fcntl.h 1970-01-01 10:00:00.000000000 +1000
@@ -1,40 +0,0 @@
-/*
-#define FTRUNC 02000 /* truncate to zero length */
-#define FEXCL 04000 /* error if already created */
-#endif
+diff --unified --recursive --new-file libstdc.orig/gen/fakcu.c libstdc/gen/fakcu.c
+--- libstdc.orig/gen/fakcu.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/fakcu.c 2017-01-19 15:21:02.578410269 +1100
+@@ -6,5 +6,6 @@
+ * Null cleanup routine to resolve reference in exit()
+ * if not using stdio.
+ */
++void
+ _cleanup() {
+ }
diff --unified --recursive --new-file libstdc.orig/gen/insque.c libstdc/gen/insque.c
---- libstdc.orig/gen/insque.c 2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/gen/insque.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/gen/insque.c 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/gen/insque.c 2017-01-19 15:17:46.198529987 +1100
@@ -8,16 +8,19 @@
static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87";
#endif
insque(e, prev)
register struct vaxque *e, *prev; {
+diff --unified --recursive --new-file libstdc.orig/gen/isatty.c libstdc/gen/isatty.c
+--- libstdc.orig/gen/isatty.c 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/gen/isatty.c 1970-01-01 10:00:00.000000000 +1000
+@@ -1,17 +0,0 @@
+-#if defined(LIBC_SCCS) && !defined(lint)
+-static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86";
+-#endif
+-
+-/*
+- * Returns 1 iff file is a tty
+- */
+-
+-#include <sgtty.h>
+-
+-isatty(f) {
+- struct sgttyb ttyb;
+-
+- if (ioctl(f, TIOCGETP, &ttyb) < 0)
+- return(0);
+- return(1);
+-}
+diff --unified --recursive --new-file libstdc.orig/gen/malloc.c libstdc/gen/malloc.c
+--- libstdc.orig/gen/malloc.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/malloc.c 2017-01-19 15:19:41.562457507 +1100
+@@ -82,7 +82,7 @@
+ #if defined(DEBUG) || defined(RCHECK)
+ #define ASSERT(p) if (!(p)) botch("p")
+ #include <stdio.h>
+-static
++static void
+ botch(s)
+ char *s; {
+ fprintf(stderr, "\r\nassertion botched: %s\r\n", s);
+@@ -177,6 +177,7 @@
+ /*
+ * Allocate more memory to the indicated bucket.
+ */
++void
+ morecore(bucket)
+ int bucket; {
+ register union overhead *op;
+@@ -217,6 +218,7 @@
+ }
+ }
+
++void
+ free(cp)
+ char *cp; {
+ register int size;
+@@ -352,6 +354,7 @@
+ * for each size category, the second showing the number of mallocs -
+ * frees for each size category.
+ */
++void
+ mstats(s)
+ char *s; {
+ register int i, j;
diff --unified --recursive --new-file libstdc.orig/gen/popen.c libstdc/gen/popen.c
---- libstdc.orig/gen/popen.c 2017-01-19 02:19:04.347169107 +1100
+--- libstdc.orig/gen/popen.c 2017-01-19 15:17:46.198529987 +1100
+++ libstdc/gen/popen.c 1970-01-01 10:00:00.000000000 +1000
@@ -1,77 +0,0 @@
-/*
- (void) sigsetmask(omask);
- return (pid == -1 ? -1 : status);
-}
+diff --unified --recursive --new-file libstdc.orig/gen/qsort.c libstdc/gen/qsort.c
+--- libstdc.orig/gen/qsort.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/qsort.c 2017-01-19 15:17:46.198529987 +1100
+@@ -32,6 +32,7 @@
+ * It's not...
+ */
+
++void
+ qsort(base, n, size, compar)
+ char *base;
+ int n;
+@@ -106,7 +107,7 @@
+ * (And there are only three places where this is done).
+ */
+
+-static
++static void
+ qst(base, max)
+ char *base, *max; {
+ register char c, *i, *j, *jj;
+diff --unified --recursive --new-file libstdc.orig/gen/random.c libstdc/gen/random.c
+--- libstdc.orig/gen/random.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/random.c 2017-01-19 15:17:46.198529987 +1100
+@@ -222,7 +222,7 @@
+ if( n < BREAK_1 ) {
+ if( n < BREAK_0 ) {
+ fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n" );
+- return;
++ return( ostate );
+ }
+ rand_type = TYPE_0;
+ rand_deg = DEG_0;
diff --unified --recursive --new-file libstdc.orig/gen/regex.c libstdc/gen/regex.c
---- libstdc.orig/gen/regex.c 2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/gen/regex.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/gen/regex.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/regex.c 2017-01-19 15:17:46.198529987 +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-19 02:19:04.347169107 +1100
-+++ libstdc/gen/remque.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/gen/remque.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/remque.c 2017-01-19 15:17:46.202529984 +1100
@@ -8,16 +8,19 @@
static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87";
#endif
remque(e)
register struct vaxque *e; {
+diff --unified --recursive --new-file libstdc.orig/gen/sleep.c libstdc/gen/sleep.c
+--- libstdc.orig/gen/sleep.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/sleep.c 2017-01-19 15:17:46.202529984 +1100
+@@ -16,6 +16,7 @@
+
+ static int ringring;
+
++void
+ sleep(n)
+ unsigned n; {
+ int sleepx(), omask;
+@@ -57,8 +58,7 @@
+ (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
+ }
+
+-static
++static void
+ sleepx() {
+-
+ ringring = 1;
+ }
+diff --unified --recursive --new-file libstdc.orig/gen/syslog.c libstdc/gen/syslog.c
+--- libstdc.orig/gen/syslog.c 2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/syslog.c 2017-01-19 15:17:46.202529984 +1100
+@@ -54,6 +54,7 @@
+ extern int errno, sys_nerr;
+ extern char *sys_errlist[];
+
++void
+ syslog(pri, fmt, p0, p1, p2, p3, p4)
+ int pri;
+ char *fmt; {
+@@ -151,6 +152,7 @@
+ * OPENLOG -- open system log
+ */
+
++void
+ openlog(ident, logstat, logfac)
+ char *ident;
+ int logstat, logfac; {
+@@ -173,8 +175,8 @@
+ * CLOSELOG -- close the system log
+ */
+
++void
+ closelog() {
+-
+ (void) close(LogFile);
+ LogFile = -1;
+ }
+diff --unified --recursive --new-file libstdc.orig/gen/usleep.c libstdc/gen/usleep.c
+--- libstdc.orig/gen/usleep.c 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/gen/usleep.c 2017-01-19 15:17:46.202529984 +1100
+@@ -19,6 +19,7 @@
+
+ static int ringring;
+
++void
+ usleep(n)
+ unsigned n; {
+ int sleepx(), omask;
+@@ -60,8 +61,7 @@
+ (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
+ }
+
+-static
++static void
+ sleepx() {
+-
+ ringring = 1;
+ }
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-19 02:19:04.351169187 +1100
++++ libstdc/gen.h 2017-01-19 15:17:46.202529984 +1100
@@ -0,0 +1,5 @@
+/* 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;
+};
+diff --unified --recursive --new-file libstdc.orig/net/ruserpass.c libstdc/net/ruserpass.c
+--- libstdc.orig/net/ruserpass.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/net/ruserpass.c 2017-01-19 15:17:46.202529984 +1100
+@@ -19,6 +19,7 @@
+ struct utmp *getutmp();
+ static FILE *cfile;
+
++void
+ ruserpass(host, aname, apass)
+ char *host, **aname, **apass; {
+
+@@ -45,7 +46,7 @@
+ }
+ }
+
+-static
++static void
+ renv(host, aname, apass)
+ char *host, **aname, **apass; {
+ register char *cp;
+@@ -72,8 +73,7 @@
+ mkpwclear(cp, host[0], *apass);
+ }
+
+-static
+-char *
++static char *
+ renvlook(host)
+ char *host; {
+ register char *cp, **env;
+@@ -125,7 +125,7 @@
+ 0, 0
+ };
+
+-static
++static void
+ rnetrc(host, aname, apass)
+ char *host, **aname, **apass; {
+ char *hdir, buf[BUFSIZ];
+@@ -482,7 +482,7 @@
+ * Set up the key schedule from the key.
+ */
+
+-static
++static void
+ nbssetkey(key)
+ char *key; {
+ register i, j, k;
+@@ -606,7 +606,7 @@
+ * The payoff: encrypt a block.
+ */
+
+-static
++static void
+ blkencrypt(block, edflag)
+ char *block; {
+ int i, ii;
+@@ -720,7 +720,7 @@
+ return(NULL);
+ }
+
+-static
++static void
+ sreverse(sto, sfrom)
+ register char *sto, *sfrom; {
+ register int i;
+@@ -763,6 +763,7 @@
+ return (skey);
+ }
+
++void
+ mkpwunclear(spasswd,mch,sencpasswd)
+ char mch, *spasswd, *sencpasswd; {
+ register char *skey;
+@@ -779,6 +780,7 @@
+ nbsencrypt(spasswd, skey, sencpasswd);
+ }
+
++void
+ mkpwclear(sencpasswd,mch,spasswd)
+ char mch, *spasswd, *sencpasswd; {
+ register char *skey;
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-19 02:19:04.351169187 +1100
-@@ -0,0 +1,15 @@
++++ libstdc/net.h 2017-01-19 15:17:46.202529984 +1100
+@@ -0,0 +1,16 @@
+/* formerly duplicated in netinet/in.h and netns/ns.h */
-+#if !defined(vax) && !defined(ntohl) && !defined(lint)
++/* confuses cproto which thinks #define names are types or type modifiers */
++/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/
+/*
+ * Macros for number representation conversion.
+ */
-+#define ntohl(x) (x)
-+#define ntohs(x) (x)
-+#define htonl(x) (x)
-+#define htons(x) (x)
-+#endif
++/*#define ntohl(x) (x)*/
++/*#define ntohs(x) (x)*/
++/*#define htonl(x) (x)*/
++/*#define htons(x) (x)*/
++/*#endif*/
+
-+#if !defined(ntohl) && (defined(vax) || defined(lint))
++/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/
+u_short ntohs(), htons();
+u_long ntohl(), htonl();
-+#endif
++/*#endif*/
diff --unified --recursive --new-file libstdc.orig/netinet/in.h libstdc/netinet/in.h
---- libstdc.orig/netinet/in.h 2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/netinet/in.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netinet/in.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netinet/in.h 2017-01-19 15:17:46.202529984 +1100
@@ -90,20 +90,21 @@
*/
#define IP_OPTIONS 1 /* set/get IP per-packet options */
#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-19 02:19:04.347169107 +1100
-+++ libstdc/netinet/ip.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netinet/ip.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netinet/ip.h 2017-01-19 15:17:46.202529984 +1100
@@ -81,7 +81,7 @@
struct in_addr ipt_addr;
n_long ipt_time;
/* 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-19 02:19:04.347169107 +1100
-+++ libstdc/netinet/tcp.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netinet/tcp.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netinet/tcp.h 2017-01-19 15:17:46.202529984 +1100
@@ -44,7 +44,9 @@
#ifdef lint
#define TCP_MSS 536
/*
diff --unified --recursive --new-file libstdc.orig/netns/ns.h libstdc/netns/ns.h
---- libstdc.orig/netns/ns.h 2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/netns/ns.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netns/ns.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netns/ns.h 2017-01-19 15:17:46.202529984 +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))
#ifdef KERNEL
extern struct domain nsdomain;
+diff --unified --recursive --new-file libstdc.orig/ns/ns_addr.c libstdc/ns/ns_addr.c
+--- libstdc.orig/ns/ns_addr.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/ns/ns_addr.c 2017-01-19 15:17:46.202529984 +1100
+@@ -62,7 +62,7 @@
+ return (addr);
+ }
+
+-static
++static void
+ Field(buf, out, len)
+ char *buf;
+ u_char *out;
diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/doscan.c
---- libstdc.orig/stdio/doscan.c 2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/doscan.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/doscan.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/doscan.c 2017-01-19 15:17:46.202529984 +1100
@@ -3,7 +3,8 @@
#endif
#define SPC 01
#define STP 02
-@@ -27,13 +28,13 @@
- 0,0,0,0,0,0,0,0,
- };
-
--_doscan(iop, fmt, argp)
-+_doscan(iop, fmt, ap)
+@@ -30,10 +31,10 @@
+ _doscan(iop, fmt, argp)
FILE *iop;
register char *fmt;
-register int **argp; {
-+register va_list ap; {
++register va_list argp; {
register int ch;
int nmatch, len, ch1;
- int **ptr, fileended, size;
ptr = 0;
if (ch != '*')
- ptr = argp++;
-+ ptr = va_arg(ap, int *);
++ ptr = va_arg(argp, int *);
else
ch = *fmt++;
len = 0;
break;
}
return(1);
+diff --unified --recursive --new-file libstdc.orig/stdio/findiop.c libstdc/stdio/findiop.c
+--- libstdc.orig/stdio/findiop.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/findiop.c 2017-01-19 15:17:46.202529984 +1100
+@@ -89,6 +89,7 @@
+ return (1);
+ }
+
++void
+ f_prealloc() {
+ register FILE **iov;
+ register FILE *fp;
+@@ -101,6 +102,7 @@
+ *iov = (FILE *)calloc(1, sizeof **iov);
+ }
+
++void
+ _fwalk(function)
+ register int (*function)(); {
+ register FILE **iov;
+@@ -117,6 +119,7 @@
+ }
+ }
+
++void
+ _cleanup() {
+ extern int fclose();
+
diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio/fprintf.c
---- libstdc.orig/stdio/fprintf.c 2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/fprintf.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/fprintf.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/fprintf.c 2017-01-19 15:17:46.202529984 +1100
@@ -1,31 +1,48 @@
/*
* Copyright (c) 1980 Regents of the University of California.
+ register FILE *iop;
+ char *fmt;
+ va_dcl {
-+ va_list ap;
++ va_list argp;
+ int len;
char localbuf[BUFSIZ];
-+ va_start(ap);
++ va_start(argp);
if (iop->_flag & _IONBF) {
iop->_flag &= ~_IONBF;
iop->_ptr = iop->_base = localbuf;
iop->_bufsiz = BUFSIZ;
- _doprnt(fmt, &args, iop);
-+ len = _doprnt(fmt, ap, iop);
++ len = _doprnt(fmt, argp, iop);
fflush(iop);
iop->_flag |= _IONBF;
iop->_base = NULL;
} else
- _doprnt(fmt, &args, iop);
- return(ferror(iop)? EOF: 0);
-+ len = _doprnt(fmt, ap, iop);
-+ va_end(ap);
++ len = _doprnt(fmt, argp, iop);
++ va_end(argp);
+ return(ferror(iop) ? EOF : len);
}
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-19 02:19:04.351169187 +1100
++++ libstdc/stdio/popen.c 2017-01-19 15:17:46.202529984 +1100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ 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-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/printf.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/printf.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/printf.c 2017-01-19 15:17:46.202529984 +1100
@@ -1,11 +1,35 @@
+/*
+ * Copyright (c) 1987 Regents of the University of California.
+printf(fmt, va_alist)
+ char *fmt;
+ va_dcl {
-+ va_list ap;
++ va_list argp;
+ int len;
-printf(fmt, args)
-char *fmt; {
- _doprnt(fmt, &args, stdout);
- return(ferror(stdout)? EOF: 0);
-+ va_start(ap);
-+ len = _doprnt(fmt, ap, stdout);
-+ va_end(ap);
++ va_start(argp);
++ len = _doprnt(fmt, argp, stdout);
++ va_end(argp);
+ 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-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/scanf.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/scanf.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/scanf.c 2017-01-19 15:17:46.202529984 +1100
@@ -2,29 +2,50 @@
static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86";
#endif
+scanf(fmt, va_alist)
+char *fmt;
+va_dcl {
-+ va_list ap;
++ va_list argp;
+ int len;
+
-+ va_start(ap);
-+ len = _doscan(stdin, fmt, &args);
-+ va_end(ap);
++ va_start(argp);
++ len = _doscan(stdin, fmt, argp);
++ va_end(argp);
+ return len;
}
- return(_doscan(iop, fmt, &args));
+char *fmt;
+va_dcl {
-+ va_list ap;
++ va_list argp;
+ int len;
+
-+ va_start(ap);
-+ len = _doscan(iop, fmt, &args);
-+ va_end(ap);
++ va_start(argp);
++ len = _doscan(iop, fmt, argp);
++ va_end(argp);
+ return len;
}
+char *fmt;
+va_dcl {
FILE _strbuf;
-+ va_list ap;
++ va_list argp;
+ int len;
-+ va_start(ap);
++ va_start(argp);
_strbuf._flag = _IOREAD|_IOSTRG;
_strbuf._ptr = _strbuf._base = str;
_strbuf._cnt = 0;
_strbuf._cnt++;
_strbuf._bufsiz = _strbuf._cnt;
- return(_doscan(&_strbuf, fmt, &args));
-+ len = _doscan(&_strbuf, fmt, &args);
-+ va_end(ap);
++ len = _doscan(&_strbuf, fmt, argp);
++ va_end(argp);
+ return len;
}
diff --unified --recursive --new-file libstdc.orig/stdio/sprintf.c libstdc/stdio/sprintf.c
---- libstdc.orig/stdio/sprintf.c 2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/sprintf.c 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/sprintf.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/sprintf.c 2017-01-19 15:17:46.202529984 +1100
@@ -1,17 +1,40 @@
+/*
+ * Copyright (c) 1987 Regents of the University of California.
+sprintf(str, fmt, va_alist)
+ char *str, *fmt;
+ va_dcl {
-+ va_list ap;
++ va_list argp;
FILE _strbuf;
+ int len;
-+ va_start(ap);
++ va_start(argp);
_strbuf._flag = _IOWRT+_IOSTRG;
_strbuf._ptr = str;
_strbuf._cnt = 32767;
- _doprnt(fmt, &args, &_strbuf);
- putc('\0', &_strbuf);
- return(str);
-+ len = _doprnt(fmt, ap, &_strbuf);
++ len = _doprnt(fmt, argp, &_strbuf);
+ *_strbuf._ptr = 0;
-+ va_end(ap);
++ va_end(argp);
+ return(len);
}
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-19 02:19:04.351169187 +1100
++++ libstdc/stdio/vfprintf.c 2017-01-19 15:17:46.202529984 +1100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+#include <varargs.h>
+
+int
-+vfprintf(iop, fmt, ap)
++vfprintf(iop, fmt, argp)
+ FILE *iop;
+ char *fmt;
-+ va_list ap; {
++ va_list argp; {
+ int len;
+ char localbuf[BUFSIZ];
+
+ if (iop->_flag & _IONBF) {
+ iop->_flag &= ~_IONBF;
+ iop->_ptr = iop->_base = localbuf;
-+ len = _doprnt(fmt, ap, iop);
++ len = _doprnt(fmt, argp, iop);
+ (void) fflush(iop);
+ iop->_flag |= _IONBF;
+ iop->_base = NULL;
+ iop->_bufsiz = 0;
+ iop->_cnt = 0;
+ } else
-+ len = _doprnt(fmt, ap, iop);
++ len = _doprnt(fmt, argp, iop);
+
+ return (ferror(iop) ? EOF : len);
+}
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-19 02:19:04.351169187 +1100
++++ libstdc/stdio/vprintf.c 2017-01-19 15:17:46.202529984 +1100
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+#include <varargs.h>
+
+int
-+vprintf(fmt, ap)
++vprintf(fmt, argp)
+ char *fmt;
-+ va_list ap; {
++ va_list argp; {
+ int len;
+
-+ len = _doprnt(fmt, ap, stdout);
++ len = _doprnt(fmt, argp, stdout);
+ return (ferror(stdout) ? EOF : len);
+}
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-19 02:19:04.351169187 +1100
++++ libstdc/stdio/vsprintf.c 2017-01-19 15:17:46.202529984 +1100
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+#include <varargs.h>
+
+int
-+vsprintf(str, fmt, ap)
++vsprintf(str, fmt, argp)
+ char *str, *fmt;
-+ va_list ap; {
++ va_list argp; {
+ FILE f;
+ int len;
+
+ f._flag = _IOWRT+_IOSTRG;
+ f._ptr = str;
+ f._cnt = 32767;
-+ len = _doprnt(fmt, ap, &f);
++ len = _doprnt(fmt, argp, &f);
+ *f._ptr = 0;
+ return (len);
+}
diff --unified --recursive --new-file libstdc.orig/stdio.h libstdc/stdio.h
---- libstdc.orig/stdio.h 2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/stdio.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio.h 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio.h 2017-01-19 15:17:46.202529984 +1100
@@ -59,7 +59,7 @@
long ftell();
char *fgets();
#endif
# endif
diff --unified --recursive --new-file libstdc.orig/sys/dir.h libstdc/sys/dir.h
---- libstdc.orig/sys/dir.h 2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/sys/dir.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/sys/dir.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/dir.h 2017-01-19 15:17:46.202529984 +1100
@@ -32,9 +32,9 @@
* dp->d_ino set to 0.
*/
#define DIRBLKSIZ DEV_BSIZE
#define MAXNAMLEN 255
+diff --unified --recursive --new-file libstdc.orig/sys/isatty.c libstdc/sys/isatty.c
+--- libstdc.orig/sys/isatty.c 1970-01-01 10:00:00.000000000 +1000
++++ libstdc/sys/isatty.c 2017-01-19 15:17:46.202529984 +1100
+@@ -0,0 +1,17 @@
++#if defined(LIBC_SCCS) && !defined(lint)
++static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86";
++#endif
++
++/*
++ * Returns 1 iff file is a tty
++ */
++
++#include <sgtty.h>
++
++isatty(f) {
++ struct sgttyb ttyb;
++
++ if (ioctl(f, TIOCGETP, &ttyb) < 0)
++ return(0);
++ return(1);
++}
diff --unified --recursive --new-file libstdc.orig/sys/param.h libstdc/sys/param.h
---- libstdc.orig/sys/param.h 2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/param.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/sys/param.h 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/sys/param.h 2017-01-19 15:17:46.202529984 +1100
@@ -53,15 +53,16 @@
/*
* Signals
+/* 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 02:19:04.343169028 +1100
-+++ libstdc/sys/proc.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/sys/proc.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/proc.h 2017-01-19 15:17:46.202529984 +1100
@@ -117,3 +117,8 @@
#define SSEL 0x0400000 /* selecting; wakeup/waiting danger */
#define SLOGIN 0x0800000 /* a login process (legit child of init) */
+ ((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-19 02:19:04.351169187 +1100
++++ libstdc/sys/select.h 2017-01-19 15:17:46.202529984 +1100
@@ -0,0 +1,28 @@
+#include <sys/param.h>
+
+#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/tty.h libstdc/sys/tty.h
---- libstdc.orig/sys/tty.h 2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/tty.h 2017-01-19 02:20:23.760656935 +1100
+--- libstdc.orig/sys/tty.h 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/sys/tty.h 2017-01-19 15:17:46.202529984 +1100
@@ -70,20 +70,22 @@
struct ttychars t_chars; /* tty */
struct winsize t_winsize; /* window size */
#define TTIPRI 28
diff --unified --recursive --new-file libstdc.orig/sys/types.h libstdc/sys/types.h
---- libstdc.orig/sys/types.h 2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/types.h 2017-01-19 02:19:04.355169266 +1100
+--- libstdc.orig/sys/types.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/types.h 2017-01-19 15:17:46.202529984 +1100
@@ -45,30 +45,32 @@
typedef u_short uid_t;
typedef u_short gid_t;
#endif
diff --unified --recursive --new-file libstdc.orig/sys/vmmac.h libstdc/sys/vmmac.h
---- libstdc.orig/sys/vmmac.h 2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/vmmac.h 2017-01-19 02:19:04.355169266 +1100
+--- libstdc.orig/sys/vmmac.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/vmmac.h 2017-01-19 15:17:46.202529984 +1100
@@ -157,3 +157,10 @@
} \
c->c_lock = 0; \
+#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-19 02:19:04.347169107 +1100
-+++ libstdc/vax/vmparam.h 2017-01-19 02:19:04.355169266 +1100
+--- libstdc.orig/vax/vmparam.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/vax/vmparam.h 2017-01-19 15:17:46.202529984 +1100
@@ -156,5 +156,6 @@
/*
* BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1
--- /dev/null
+#!/bin/sh
+(cd ..; diff --unified --recursive --new-file libstdc.orig libstdc) >a
+mv libstdc.patch libstdc.patch.bak
+mv a libstdc.patch
+wc -l libstdc.patch libstdc.patch.bak
+++ /dev/null
-#ifndef _MP_H_
-#define _MP_H_
-
-#include <gen.h>
-#include <stdio.h>
-
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- * @(#)mp.h 5.1 (Berkeley) 5/30/85
- */
-
-#define MINT struct mint
-MINT
-{ int len;
- short *val;
-};
-#define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}}
-#ifndef DBG
-#define shfree(u) free((char *)u)
-#else
-#include <stdio.h>
-#define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);}
-extern int dbg;
-#endif
-#ifndef vax
-struct half
-{ short high;
- short low;
-};
-#else
-struct half
-{ short low;
- short high;
-};
-#endif
-/*extern MINT *itom();*/
-/*extern short *xalloc();*/
-
-#ifdef lint
-extern xv_oid;
-#define VOID xv_oid =
-#else
-#define VOID
-#endif
-
-#endif
#!/bin/sh
-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*
+rm -rf *.c *.h *.o *.orig *.[ch].nocomm *.[ch].protos *.[ch].protos.nocomm *.temp.c *.[ch].usedby *.[ch].uses arpa compat-4.1 compat-sys5 csu gen inet machine net netimp netinet netns ns pascal protocols stdio sys vax vaxif vaxmba vaxuba xx*
find ../libc \( -name '*.[cs]' -o -name Makefile \) -print |\
sed -e 's:^\.\./libc/::' |\
fi
fi
done
+sed -e 's/fork/vfork/g' <sys/fork.c >sys/vfork.c
find vax -name Makefile -print |\
while read i
rm $i
done
-find vax -type f -print >unported.txt
-rm -rf vax
+(
+ find csu -type f -print
+ find vax -type f -print
+) >unported.txt
+rm -r csu vax
find ../../include -name '*.h' -print |\
sed -e 's:^\.\./\.\./include/::' |\
cp ../../include/$i $i
done
+echo mp.h >>unported.txt
+rm mp.h
+
find ../../sys/h -name '*.h' -print |\
sed -e 's:^\.\./\.\./sys/h/::' |\
while read i
#include <arpa/nameser.h>
#include <netdb.h>
#include <stdio.h>
+#include <sys/types.h>
/* formerly duplicated in netinet/in.h and netns/ns.h */
-#if !defined(vax) && !defined(ntohl) && !defined(lint)
+/* confuses cproto which thinks #define names are types or type modifiers */
+/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/
/*
* Macros for number representation conversion.
*/
-#define ntohl(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define htons(x) (x)
-#endif
+/*#define ntohl(x) (x)*/
+/*#define ntohs(x) (x)*/
+/*#define htonl(x) (x)*/
+/*#define htons(x) (x)*/
+/*#endif*/
-#if !defined(ntohl) && (defined(vax) || defined(lint))
+/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/
/*u_short ntohs(), htons();*/
/*u_long ntohl(), htonl();*/
-#endif
+/*#endif*/
#ifndef KERNEL
#ifndef __P
#endif
#endif
+/* net/htonl.c */
+u_long htonl __P((u_long hostlong));
+
+/* net/htons.c */
+u_short htons __P((int hostshort));
+
+/* net/ntohl.c */
+u_long ntohl __P((u_long netlong));
+
+/* net/ntohs.c */
+u_short ntohs __P((int netshort));
+
/* net/rcmd.c */
int rcmd __P((char **ahost, int rport, char *locuser, char *remuser, char *cmd, int *fd2p));
int rresvport __P((int *alport));
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));
+void ruserpass __P((char *host, char **aname, char **apass));
+void mkpwunclear __P((char *spasswd, int mch, char *sencpasswd));
+void mkpwclear __P((char *sencpasswd, int mch, char *spasswd));
#endif
#endif
static char sccsid[] = "@(#)getnetbyaddr.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <netdb.h>
+/*#include <netdb.h>*/
extern int _net_stayopen;
static char sccsid[] = "@(#)getnetbyname.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <netdb.h>
+/*#include <netdb.h>*/
extern int _net_stayopen;
static char sccsid[] = "@(#)getnetent.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
#define MAXALIASES 35
static char sccsid[] = "@(#)getproto.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <netdb.h>
+/*#include <netdb.h>*/
extern int _proto_stayopen;
static char sccsid[] = "@(#)getprotoent.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
#define MAXALIASES 35
static char sccsid[] = "@(#)getprotoname.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <netdb.h>
+/*#include <netdb.h>*/
extern int _proto_stayopen;
static char sccsid[] = "@(#)getservbyname.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <netdb.h>
+/*#include <netdb.h>*/
extern int _serv_stayopen;
static char sccsid[] = "@(#)getservbyport.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <netdb.h>
+/*#include <netdb.h>*/
extern int _serv_stayopen;
#include <gen.h>
-#include <netdb.h>
#include <net.h>
+#include <netdb.h>
#include <stdio.h>
#include <sys/types.h>
static char sccsid[] = "@(#)getservent.c 5.3 (Berkeley) 5/19/86";
#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
#define MAXALIASES 35
static char sccsid[] = "@(#)gethostent.c 5.3 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
-#include <ndbm.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
+/*#include <ndbm.h>*/
/*
* Internet version.
static char sccsid[] = "@(#)gethostnamadr.c 5.5 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <netdb.h>
-#include <sys/file.h>
-#include <ndbm.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <netdb.h>*/
+/*#include <sys/file.h>*/
+/*#include <ndbm.h>*/
+/*#include <ctype.h>*/
#define MAXALIASES 35
#include <net.h>
#include <sys/types.h>
-/*#include <net.h>*/
/*#include <sys/types.h>*/
u_long htonl(hostlong) u_long hostlong; {
abort();
#include <net.h>
#include <sys/types.h>
-/*#include <net.h>*/
/*#include <sys/types.h>*/
-u_short htons(hostshort) u_short hostshort; {
+u_short htons(hostshort) int hostshort; {
abort();
}
#include <arpa/nameser.h>
#include <ctype.h>
#include <gen.h>
-#include <netdb.h>
#include <net.h>
+#include <netdb.h>
#include <netinet/in.h>
#include <resolv.h>
#include <stdio.h>
static char sccsid[] = "@(#)gethostnamadr.c 6.12 (Berkeley) 5/19/86";
#endif
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <ctype.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <errno.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netinet/in.h>*/
+/*#include <ctype.h>*/
+/*#include <netdb.h>*/
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
+/*#include <arpa/inet.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
#define MAXALIASES 35
#define MAXADDRS 35
static char sccsid[] = "@(#)sethostent.c 6.3 (Berkeley) 4/10/86";
#endif
-#include <sys/types.h>
-#include <arpa/nameser.h>
-#include <netinet/in.h>
-#include <resolv.h>
+/*#include <sys/types.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <netinet/in.h>*/
+/*#include <resolv.h>*/
int sethostent(stayopen) int stayopen; {
if (stayopen)
#include <net.h>
#include <sys/types.h>
-/*#include <net.h>*/
/*#include <sys/types.h>*/
u_long ntohl(netlong) u_long netlong; {
abort();
#include <net.h>
#include <sys/types.h>
-/*#include <net.h>*/
/*#include <sys/types.h>*/
-u_short ntohs(netshort) u_short netshort; {
+u_short ntohs(netshort) int netshort; {
abort();
}
#include <arpa/inet.h>
#include <ctype.h>
#include <gen.h>
-#include <netdb.h>
#include <net.h>
+#include <netdb.h>
#include <netinet/in.h>
#include <pwd.h>
#include <stdio.h>
#include <strings.h>
+#include <sys.h>
#include <sys/errno.h>
#include <sys/file.h>
-#include <sys.h>
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/signal.h>
static char sccsid[] = "@(#)rcmd.c 5.11 (Berkeley) 5/6/86";
#endif
-#include <stdio.h>
-#include <ctype.h>
-#include <pwd.h>
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/signal.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <pwd.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/signal.h>*/
+/*#include <sys/socket.h>*/
+/*#include <sys/stat.h>*/
-#include <netinet/in.h>
+/*#include <netinet/in.h>*/
-#include <netdb.h>
-#include <errno.h>
+/*#include <netdb.h>*/
+/*#include <errno.h>*/
extern errno;
/*char *index(), *sprintf();*/
static char sccsid[] = "@(#)res_comp.c 6.7 (Berkeley) 3/11/86";
#endif
-#include <sys/types.h>
-#include <stdio.h>
-#include <arpa/nameser.h>
+/*#include <sys/types.h>*/
+/*#include <stdio.h>*/
+/*#include <arpa/nameser.h>*/
/*
* Expand compressed domain name 'comp_dn' to full domain name.
#define DEBUG
#endif
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <arpa/nameser.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
+/*#include <stdio.h>*/
+/*#include <arpa/nameser.h>*/
/*extern char *p_cdname(), *p_rr(), *p_type(), *p_class();*/
/*extern char *inet_ntoa();*/
static char sccsid[] = "@(#)res_init.c 6.5 (Berkeley) 4/11/86";
#endif
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netinet/in.h>*/
+/*#include <stdio.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
/*
* Resolver configuration file. Contains the address of the
static char sccsid[] = "@(#)res_mkquery.c 6.3 (Berkeley) 3/17/86";
#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
/*extern char *sprintf();*/
* Send query to name server and wait for reply.
*/
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <errno.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <sys/param.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/socket.h>*/
+/*#include <sys/uio.h>*/
+/*#include <netinet/in.h>*/
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
extern int errno;
#include <gen.h>
-#include <netdb.h>
#include <net.h>
+#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <strings.h>
static char sccsid[] = "@(#)rexec.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <sys/socket.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
-#include <netinet/in.h>
+/*#include <netinet/in.h>*/
-#include <stdio.h>
-#include <netdb.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <netdb.h>*/
+/*#include <errno.h>*/
extern errno;
/*char *index(), *sprintf();*/
-#include <csu.h>
#include <ctype.h>
#include <gen.h>
#include <net.h>
static char sccsid[] = "@(#)ruserpass.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <utmp.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <utmp.h>*/
+/*#include <ctype.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <errno.h>*/
/*char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin();*/
/*struct utmp *getutmp();*/
static FILE *cfile;
-static renv __P((char *host, char **aname, char **apass));
+static void renv __P((char *host, char **aname, char **apass));
static char *renvlook __P((char *host));
-static rnetrc __P((char *host, char **aname, char **apass));
+static void 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 *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 void nbssetkey __P((char *key));
+static void blkencrypt __P((char *block, int edflag));
static struct utmp *getutmp __P((char *sttyname));
-static sreverse __P((register char *sto, register char *sfrom));
+static void 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; {
+void ruserpass(host, aname, apass) char *host; char **aname; char **apass; {
renv(host, aname, apass);
if (*aname == 0 || *apass == 0)
}
}
-static renv(host, aname, apass) char *host; char **aname; char **apass; {
+static void renv(host, aname, apass) char *host; char **aname; char **apass; {
register char *cp;
char *stemp, fgetlogin, *comma;
0, 0
};
-static rnetrc(host, aname, apass) char *host; char **aname; char **apass; {
+static void rnetrc(host, aname, apass) char *host; char **aname; char **apass; {
char *hdir, buf[BUFSIZ];
int t;
struct stat stb;
* Set up the key schedule from the key.
*/
-static nbssetkey(key) char *key; {
+static void nbssetkey(key) char *key; {
register i, j, k;
int t;
* The payoff: encrypt a block.
*/
-static blkencrypt(block, edflag) char *block; int edflag; {
+static void blkencrypt(block, edflag) char *block; int edflag; {
int i, ii;
register t, j, k;
return(NULL);
}
-static sreverse(sto, sfrom) register char *sto; register char *sfrom; {
+static void sreverse(sto, sfrom) register char *sto; register char *sfrom; {
register int i;
i = strlen(sfrom);
return (skey);
}
-int mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpasswd; {
+void mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpasswd; {
register char *skey;
if (spasswd[0] == 0) {
nbsencrypt(spasswd, skey, sencpasswd);
}
-int mkpwclear(sencpasswd, mch, spasswd) char *sencpasswd; int mch; char *spasswd; {
+void mkpwclear(sencpasswd, mch, spasswd) char *sencpasswd; int mch; char *spasswd; {
register char *skey;
if (sencpasswd[0] == 0) {
#ifndef _NETINET_IF_ETHER_H_
#define _NETINET_IF_ETHER_H_
-#include <net/if_arp.h>
#include <net/if.h>
+#include <net/if_arp.h>
#include <netinet/in.h>
#include <sys/types.h>
#ifndef _NETINET_IN_PCB_H_
#define _NETINET_IN_PCB_H_
-#include <netinet/in.h>
#include <net/route.h>
+#include <netinet/in.h>
#include <sys/types.h>
/*
#define _NETINET_TCP_DEBUG_H_
#include <netinet/in_systm.h>
-#include <netinet/tcpip.h>
#include <netinet/tcp_var.h>
+#include <netinet/tcpip.h>
#include <sys/types.h>
/*
#ifndef _NETNS_NS_PCB_H_
#define _NETNS_NS_PCB_H_
-#include <netns/ns.h>
#include <net/route.h>
+#include <netns/ns.h>
#include <sys/types.h>
/*
static char sccsid[] = "@(#)ns_addr.c 6.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <netns/ns.h>
+/*#include <sys/types.h>*/
+/*#include <netns/ns.h>*/
static struct ns_addr addr, zero_addr;
-static Field __P((char *buf, u_char *out, int len));
+static void 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; {
return (addr);
}
-static Field(buf, out, len) char *buf; u_char *out; int len; {
+static void 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;
static char sccsid[] = "@(#)ns_ntoa.c 6.3 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <netns/ns.h>
+/*#include <sys/types.h>*/
+/*#include <netns/ns.h>*/
static char *spectHex __P((char *p0));
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();
csplit -b '%05d' -q $i '/^#[ ]*include[^0-9A-Za-z_]/' '{*}'
for j in xx*
do
- sed -e 's/^#[ ]*include[ ]*\(<[^>]*>\|"[^"]*"\)/\/\*&\*\//' -i $j
- if grep -v "^#[ ]*include[^0-9A-Za-z_]" $j |../../xify/nocomment |grep -q '[^ ]'
+ #sed -e 's/^#[ ]*include[ ]*\(<[^>]*>\|"[^"]*"\)/\/\*&\*\//' -i $j
+ sed -e 's/^#[ ]*include[ ]*<[^>]*>/\/\*&\*\//' -i $j
+ if grep -v "^#[ ]*include[^0-9A-Za-z_]" $j |sed -e '/^#[ ]*if.*SCCS/,/^#[ ]*endif/s/.*//' |../../xify/nocomment |grep -q '[^ ]'
then
break
fi
while read i
do
echo "i=$i"
+
+ rm -f a
+ if test -s $i.uses
+ then
+ LC_ALL=C sort <$i.uses |uniq >a
+
+ pattern=
+ prefix=
+ for j in `cat a`
+ do
+ pattern="$pattern$prefix$j"
+ prefix='\|'
+ done
+ echo "pattern=$pattern"
+
+ sed -e "s:^#[ ]*include[ ]*\\(<\\($pattern\\)>\\|\"\\($pattern\\)\"\\):\\/\\*&\\*\\/:" -i $i
+ fi
+
name=_`echo $i |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_
echo "name=$name"
(
#define $name
EOF
- if test -s $i.uses
+ if test -s a
then
- sort <$i.uses |uniq |sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#endif/'
+ sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#endif/' a
echo
fi
cat $i
#endif
EOF
- ) |../../xify/newline >a
- mv a $i
+ ) |../../xify/newline >b
+ mv b $i
done
find . -name '*.c' -print |\
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`"
fi
cat xx00 a >$i
fi
+
+ rm -f a
+ if test -s $i.uses
+ then
+ LC_ALL=C sort <$i.uses |uniq >a
+
+ pattern=
+ prefix=
+ for j in `cat a`
+ do
+ pattern="$pattern$prefix$j"
+ prefix='\|'
+ done
+ echo "pattern=$pattern"
+
+ sed -e "s:^#[ ]*include[ ]*\\(<\\($pattern\\)>\\|\"\\($pattern\\)\"\\):\\/\\*&\\*\\/:" -i $i
+ fi
+
(
- if test -s $i.uses
+ if test -s a
then
- sort <$i.uses |uniq |sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#define _va_start(ap, arg) va_start(ap, arg)\n#else\n#include <varargs.h>\n#define _va_start(ap, arg) va_start(ap)\n#endif/'
+ sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#define _va_start(argp, arg) va_start(argp, arg)\n#else\n#include <varargs.h>\n#define _va_start(argp, arg) va_start(argp)\n#endif/' a
echo
fi
- sed -e 's/\([^0-9A-Za-z_]\)va_start(ap);/\1_va_start(ap, fmt);/' $i
- ) |../../xify/newline >a
- mv a $i
+ sed -e 's/\([^0-9A-Za-z_]\)va_start(argp);/\1_va_start(argp, fmt);/' $i
+ ) |../../xify/newline >b
+ mv b $i
done
while read i
do
mkdir -p ../../x_include/`dirname $i`
- ../../xify/xify <$i |sed -e 's/register x_int x_u_long/register x_u_long/g' >../../x_include/`dirname $i`/x_`basename $i`
+ ../../xify/xify.sh <$i >../../x_include/`dirname $i`/x_`basename $i`
done
find . -name '*.h' -print |\
while read i
do
echo "i=$i"
- echo "#include <$i>" |../../xify/xify >temp.c
+ name=`echo $i |tr '.\-/' '___'`
+ echo "name=$name"
+ echo "#include <$i>" |../../xify/xify.sh >$name.temp.c
echo "===$i===" >&2
- gcc -nostdinc -I../../x_include -Dx_vax -Dx_NCMD=1 -Dx_NRSP=1 -c temp.c
+ gcc -nostdinc -I../../x_include -Dx_vax -Dx_NCMD=1 -Dx_NRSP=1 -c $name.temp.c
+ rm $name.temp.c
done
-rm -f temp.c errno.h fcntl.h frame.h machine signal.h syslog.h
+find . -name '*.c' -print |\
+sed -e 's:\./::' |\
+while read i
+do
+ echo "i=$i"
+ name=`echo $i |tr '.\-/' '___'`
+ echo "name=$name"
+ ../../xify/xify.sh <$i >$name.temp.c
+ echo "===$i===" >&2
+ gcc -nostdinc -I../../x_include -Dx_vax -c $name.temp.c
+ rm $name.temp.c
+done
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));
+int _doscan __P((FILE *iop, register char *fmt, register va_list argp));
/* stdio/exit.c */
int exit __P((int code));
/* 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));
+void f_prealloc __P((void));
+void _fwalk __P((register int (*function)(void)));
+void _cleanup __P((void));
/* stdio/flsbuf.c */
int _flsbuf __P((int c, register FILE *iop));
int ungetc __P((int c, register FILE *iop));
/* stdio/vfprintf.c */
-int vfprintf __P((FILE *iop, char *fmt, va_list ap));
+int vfprintf __P((FILE *iop, char *fmt, va_list argp));
/* stdio/vprintf.c */
-int vprintf __P((char *fmt, va_list ap));
+int vprintf __P((char *fmt, va_list argp));
/* stdio/vsprintf.c */
-int vsprintf __P((char *str, char *fmt, va_list ap));
+int vsprintf __P((char *str, char *fmt, va_list argp));
#endif
#endif
static char sccsid[] = "@(#)clrerr.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
#undef clearerr
int clearerr(iop) register FILE *iop; {
#include <sys/types.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
/*
static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88";
#endif
-#include <sys/types.h>
-#include <varargs.h>
-#include <stdio.h>
-#include <ctype.h>
+/*#include <sys/types.h>*/
+/*#include <varargs.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
/* 11-bit exponent (VAX G floating point) is 308 decimal digits */
#define MAXEXP 308
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)doscan.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <ctype.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <varargs.h>*/
#define SPC 01
#define STP 02
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; {
+int _doscan(iop, fmt, argp) FILE *iop; register char *fmt; register va_list argp; {
register int ch;
int nmatch, len, ch1;
int *ptr, fileended, size;
goto def;
ptr = 0;
if (ch != '*')
- ptr = va_arg(ap, int *);
+ ptr = va_arg(argp, int *);
else
ch = *fmt++;
len = 0;
-#include <csu.h>
#include <gen.h>
#include <stdio.h>
#include <sys/proc.h>
* status
*/
-#include <sys/types.h>
-#include <sys/file.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
FILE *fdopen(fd, mode) int fd; register char *mode; {
extern FILE *_findiop();
static char sccsid[] = "@(#)fgetc.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int fgetc(fp) FILE *fp; {
return(getc(fp));
static char sccsid[] = "@(#)fgets.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
char *fgets(s, n, iop) char *s; int n; register FILE *iop; {
register c;
static char sccsid[] = "@(#)filbuf.c 5.3 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
/*char *malloc();*/
int _filbuf(iop) register FILE *iop; {
static char sccsid[] = "@(#)findiop.c 5.6 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
extern int errno;
return (1);
}
-int f_prealloc() {
+void f_prealloc() {
register FILE **iov;
register FILE *fp;
*iov = (FILE *)calloc(1, sizeof **iov);
}
-int _fwalk(function) register int (*function)(); {
+void _fwalk(function) register int (*function)(); {
register FILE **iov;
register FILE *fp;
}
}
-int _cleanup() {
+void _cleanup() {
extern int fclose();
_fwalk(fclose);
static char sccsid[] = "@(#)flsbuf.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
/*char *malloc();*/
static char sccsid[] = "@(#)fopen.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <sys/file.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
FILE *fopen(file, mode) char *file; register char *mode; {
register FILE *iop;
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
/*
static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88";
#endif
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
#ifdef __STDC__
int fprintf(register FILE *iop, char *fmt, ...)
int fprintf(iop, fmt, va_alist) register FILE *iop; char *fmt; va_dcl
#endif
{
- va_list ap;
+ va_list argp;
int len;
char localbuf[BUFSIZ];
- _va_start(ap, fmt);
+ _va_start(argp, fmt);
if (iop->_flag & _IONBF) {
iop->_flag &= ~_IONBF;
iop->_ptr = iop->_base = localbuf;
iop->_bufsiz = BUFSIZ;
- len = _doprnt(fmt, ap, iop);
+ len = _doprnt(fmt, argp, iop);
fflush(iop);
iop->_flag |= _IONBF;
iop->_base = NULL;
iop->_bufsiz = NULL;
iop->_cnt = 0;
} else
- len = _doprnt(fmt, ap, iop);
- va_end(ap);
+ len = _doprnt(fmt, argp, iop);
+ va_end(argp);
return(ferror(iop) ? EOF : len);
}
static char sccsid[] = "@(#)fputc.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int fputc(c, fp) int c; register FILE *fp; {
return(putc(c, fp));
static char sccsid[] = "@(#)fputs.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int fputs(s, iop) register char *s; register FILE *iop; {
register r = 0;
static char sccsid[] = "@(#)fread.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int fread(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; {
register int s;
static char sccsid[] = "@(#)freopen.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <sys/types.h>
-#include <sys/file.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
FILE *freopen(file, mode, iop) char *file; register char *mode; register FILE *iop; {
register f, rw, oflags;
* Seek for standard library. Coordinates with buffering.
*/
-#include <stdio.h>
+/*#include <stdio.h>*/
/*long lseek();*/
* Coordinates with buffering.
*/
-#include <stdio.h>
+/*#include <stdio.h>*/
/*long lseek();*/
long ftell(iop) register FILE *iop; {
static char sccsid[] = "@(#)fwrite.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int fwrite(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; {
register int s;
/*
* A subroutine version of the macro getchar.
*/
-#include <stdio.h>
+/*#include <stdio.h>*/
#undef getchar
static char sccsid[] = "@(#)gets.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
char *gets(s) char *s; {
register c;
static char sccsid[] = "@(#)getw.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int getw(iop) register FILE *iop; {
register i;
static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86";
#endif
-#include <stdio.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
#define tst(a,b) (*mode == 'r'? (b) : (a))
#define RDR 0
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
/*
static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88";
#endif
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
#ifdef __STDC__
int printf(char *fmt, ...)
int printf(fmt, va_alist) char *fmt; va_dcl
#endif
{
- va_list ap;
+ va_list argp;
int len;
- _va_start(ap, fmt);
- len = _doprnt(fmt, ap, stdout);
- va_end(ap);
+ _va_start(argp, fmt);
+ len = _doprnt(fmt, argp, stdout);
+ va_end(argp);
return(ferror(stdout) ? EOF : len);
}
/*
* A subroutine version of the macro putchar
*/
-#include <stdio.h>
+/*#include <stdio.h>*/
#undef putchar
static char sccsid[] = "@(#)puts.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int puts(s) register char *s; {
register c;
static char sccsid[] = "@(#)putw.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int putw(w, iop) int w; register FILE *iop; {
register char *p;
static char sccsid[] = "@(#)rew.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int rewind(iop) register FILE *iop; {
fflush(iop);
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
#ifdef __STDC__
int scanf(char *fmt, ...)
int scanf(fmt, va_alist) char *fmt; va_dcl
#endif
{
- va_list ap;
+ va_list argp;
int len;
- _va_start(ap, fmt);
- len = _doscan(stdin, fmt, &args);
- va_end(ap);
+ _va_start(argp, fmt);
+ len = _doscan(stdin, fmt, argp);
+ va_end(argp);
return len;
}
int fscanf(iop, fmt, va_alist) FILE *iop; char *fmt; va_dcl
#endif
{
- va_list ap;
+ va_list argp;
int len;
- _va_start(ap, fmt);
- len = _doscan(iop, fmt, &args);
- va_end(ap);
+ _va_start(argp, fmt);
+ len = _doscan(iop, fmt, argp);
+ va_end(argp);
return len;
}
#endif
{
FILE _strbuf;
- va_list ap;
+ va_list argp;
int len;
- _va_start(ap, fmt);
+ _va_start(argp, fmt);
_strbuf._flag = _IOREAD|_IOSTRG;
_strbuf._ptr = _strbuf._base = str;
_strbuf._cnt = 0;
while (*str++)
_strbuf._cnt++;
_strbuf._bufsiz = _strbuf._cnt;
- len = _doscan(&_strbuf, fmt, &args);
- va_end(ap);
+ len = _doscan(&_strbuf, fmt, argp);
+ va_end(argp);
return len;
}
static char sccsid[] = "@(#)setbuf.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int setbuf(iop, buf) register FILE *iop; char *buf; {
if (iop->_base != NULL && iop->_flag&_IOMYBUF)
static char sccsid[] = "@(#)setbuffer.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int setbuffer(iop, buf, size) register FILE *iop; char *buf; int size; {
if (iop->_base != NULL && iop->_flag&_IOMYBUF)
static char sccsid[] = "@(#)sibuf.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
char _sibuf[BUFSIZ];
static char sccsid[] = "@(#)sobuf.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
char _sobuf[BUFSIZ];
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
/*
static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88";
#endif
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
#ifdef __STDC__
int sprintf(char *str, char *fmt, ...)
int sprintf(str, fmt, va_alist) char *str; char *fmt; va_dcl
#endif
{
- va_list ap;
+ va_list argp;
FILE _strbuf;
int len;
- _va_start(ap, fmt);
+ _va_start(argp, fmt);
_strbuf._flag = _IOWRT+_IOSTRG;
_strbuf._ptr = str;
_strbuf._cnt = 32767;
- len = _doprnt(fmt, ap, &_strbuf);
+ len = _doprnt(fmt, argp, &_strbuf);
*_strbuf._ptr = 0;
- va_end(ap);
+ va_end(argp);
return(len);
}
static char sccsid[] = "@(#)strout.c 5.2 (Berkeley) 3/9/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int _strout(count, string, adjust, file, fillch) register count; register char *string; int adjust; register FILE *file; int fillch; {
while (adjust < 0) {
static char sccsid[] = "@(#)ungetc.c 5.3 (Berkeley) 3/26/86";
#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
int ungetc(c, iop) int c; register FILE *iop; {
if (c == EOF || (iop->_flag & (_IOREAD|_IORW)) == 0 ||
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
/*
static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88";
#endif
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
-int vfprintf(iop, fmt, ap) FILE *iop; char *fmt; va_list ap; {
+int vfprintf(iop, fmt, argp) FILE *iop; char *fmt; va_list argp; {
int len;
char localbuf[BUFSIZ];
if (iop->_flag & _IONBF) {
iop->_flag &= ~_IONBF;
iop->_ptr = iop->_base = localbuf;
- len = _doprnt(fmt, ap, iop);
+ len = _doprnt(fmt, argp, iop);
(void) fflush(iop);
iop->_flag |= _IONBF;
iop->_base = NULL;
iop->_bufsiz = 0;
iop->_cnt = 0;
} else
- len = _doprnt(fmt, ap, iop);
+ len = _doprnt(fmt, argp, iop);
return (ferror(iop) ? EOF : len);
}
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
/*
static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88";
#endif
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
-int vprintf(fmt, ap) char *fmt; va_list ap; {
+int vprintf(fmt, argp) char *fmt; va_list argp; {
int len;
- len = _doprnt(fmt, ap, stdout);
+ len = _doprnt(fmt, argp, stdout);
return (ferror(stdout) ? EOF : len);
}
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
#else
#include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
#endif
/*
static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88";
#endif
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
-int vsprintf(str, fmt, ap) char *str; char *fmt; va_list ap; {
+int vsprintf(str, fmt, argp) char *str; char *fmt; va_list argp; {
FILE f;
int len;
f._flag = _IOWRT+_IOSTRG;
f._ptr = str;
f._cnt = 32767;
- len = _doprnt(fmt, ap, &f);
+ len = _doprnt(fmt, argp, &f);
*f._ptr = 0;
return (len);
}
#ifndef _SYS_IOCTL_H_
#define _SYS_IOCTL_H_
-#include <net/if_arp.h>
#include <net/if.h>
+#include <net/if_arp.h>
#include <net/route.h>
#include <sys/types.h>
/* 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));
+
+/* sys/isatty.c */
+int isatty __P((int f));
#endif
#endif
* Returns 1 iff file is a tty
*/
-#include <sgtty.h>
+/*#include <sgtty.h>*/
int isatty(f) int f; {
struct sgttyb ttyb;
#ifdef KERNEL
#include "uio.h"
#else
-#include <sys/uio.h>
+/*#include <sys/uio.h>*/
#endif
/*
#define CROUND (CBLOCK - 1) /* clist rounding */
#ifndef KERNEL
-#include <sys/types.h>
+/*#include <sys/types.h>*/
#else
#ifndef LOCORE
#include "types.h"
/* sys/setreuid.c */
int setreuid __P((int r, int e));
+
+/* sys/vfork.c */
+int vfork __P((void));
#endif
#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));
+void syslog __P((int pri, char *fmt, int p0, int p1, int p2, int p3, int p4));
+void openlog __P((char *ident, int logstat, int logfac));
+void closelog __P((void));
int setlogmask __P((int pmask));
#endif
#ifdef KERNEL
#include "../h/ioctl.h"
#else
-#include <sys/ioctl.h>
+/*#include <sys/ioctl.h>*/
#endif
/*
int alarm __P((int secs));
/* gen/sleep.c */
-int sleep __P((unsigned n));
+void sleep __P((unsigned n));
/* gen/time.c */
long time __P((time_t *t));
unsigned ualarm __P((register unsigned usecs, register unsigned reload));
/* gen/usleep.c */
-int usleep __P((unsigned n));
+void usleep __P((unsigned n));
/* sys/adjtime.c */
int adjtime __P((struct timeval *delta, struct timeval *odelta));
#include "ttychars.h"
#include "ttydev.h"
#else
-#include <sys/ttychars.h>
+/*#include <sys/ttychars.h>*/
#include <sys/ttydev.h>
#endif
#include "namei.h"
#else
#include <machine/pcb.h>
-#include <sys/dmap.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/namei.h>
+/*#include <sys/dmap.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <sys/namei.h>*/
#endif
/*
#ifdef KERNEL
#include "ioctl.h"
#else
-#include <sys/ioctl.h>
+/*#include <sys/ioctl.h>*/
#endif
#endif
--- /dev/null
+#include <gen.h>
+#include <sys/proc.h>
+
+int vfork() {
+ abort();
+}
+csu/crt0.c
+csu/gmon.c
+csu/mon.c
vax/compat-4.1/reset.s
vax/sys/Ovfork.s
vax/sys/syscall.s
vax/gen/urem.s
vax/gen/alloca.s
vax/gen/nargs.s
+mp.h
#ifdef KERNEL
#include "ioctl.h"
#else
-#include <sys/ioctl.h>
+/*#include <sys/ioctl.h>*/
#endif
/*
#ifndef x__NETINET_IF_ETHER_H_
#define x__NETINET_IF_ETHER_H_
-#include <net/x_if_arp.h>
#include <net/x_if.h>
+#include <net/x_if_arp.h>
#include <netinet/x_in.h>
#include <sys/x_types.h>
#ifndef x__NETINET_IN_PCB_H_
#define x__NETINET_IN_PCB_H_
-#include <netinet/x_in.h>
#include <net/x_route.h>
+#include <netinet/x_in.h>
#include <sys/x_types.h>
/*
#define x__NETINET_TCP_DEBUG_H_
#include <netinet/x_in_systm.h>
-#include <netinet/x_tcpip.h>
#include <netinet/x_tcp_var.h>
+#include <netinet/x_tcpip.h>
#include <sys/x_types.h>
/*
#ifndef x__NETNS_NS_PCB_H_
#define x__NETNS_NS_PCB_H_
-#include <netns/x_ns.h>
#include <net/x_route.h>
+#include <netns/x_ns.h>
#include <sys/x_types.h>
/*
#ifndef x__SYS_IOCTL_H_
#define x__SYS_IOCTL_H_
-#include <net/x_if_arp.h>
#include <net/x_if.h>
+#include <net/x_if_arp.h>
#include <net/x_route.h>
#include <sys/x_types.h>
/* compat-4.1/stty.c */
x_int x_stty __P((x_int x_fd, struct x_sgttyb *x_ap));
-/* gen/isatty.c */
-x_int x_isatty __P((x_int x_f));
-
/* sys/ioctl.c */
x_int x_ioctl __P((x_int x_d, x_u_long x_r, char *x_p));
+
+/* sys/isatty.c */
+x_int x_isatty __P((x_int x_f));
#endif
#endif
#ifdef x_GPROF
extern x_int x_profiling;
extern char *x_s_lowpc;
-extern x_u_long x_s_textsize;
+extern x_int x_u_long x_s_textsize;
extern x_u_short *x_kcount;
#endif
#ifdef x_KERNEL
#include "x_uio.h"
#else
-#include <sys/x_uio.h>
+/*#include <sys/uio.h>*/
#endif
/*
#define x_CROUND (x_CBLOCK - 1) /* clist rounding */
#ifndef x_KERNEL
-#include <sys/x_types.h>
+/*#include <sys/types.h>*/
#else
#ifndef x_LOCORE
#include "x_types.h"
/* sys/setreuid.c */
x_int x_setreuid __P((x_int x_r, x_int x_e));
+
+/* sys/vfork.c */
+x_int x_vfork __P((void));
#endif
#endif
#endif
/* gen/syslog.c */
-x_int x_syslog __P((x_int x_pri, char *x_fmt, x_int x_p0, x_int x_p1, x_int x_p2, x_int x_p3, x_int x_p4));
-x_int x_openlog __P((char *x_ident, x_int x_logstat, x_int x_logfac));
-x_int x_closelog __P((void));
+void x_syslog __P((x_int x_pri, char *x_fmt, x_int x_p0, x_int x_p1, x_int x_p2, x_int x_p3, x_int x_p4));
+void x_openlog __P((char *x_ident, x_int x_logstat, x_int x_logfac));
+void x_closelog __P((void));
x_int x_setlogmask __P((x_int x_pmask));
#endif
#ifdef x_KERNEL
#include "../h/x_ioctl.h"
#else
-#include <sys/x_ioctl.h>
+/*#include <sys/ioctl.h>*/
#endif
/*
x_int x_alarm __P((x_int x_secs));
/* gen/sleep.c */
-x_int x_sleep __P((x_unsigned_int x_n));
+void x_sleep __P((x_unsigned_int x_n));
/* gen/time.c */
x_long x_time __P((x_time_t *x_t));
x_unsigned_int x_ualarm __P((register x_unsigned_int x_usecs, register x_unsigned_int x_reload));
/* gen/usleep.c */
-x_int x_usleep __P((x_unsigned_int x_n));
+void x_usleep __P((x_unsigned_int x_n));
/* sys/adjtime.c */
x_int x_adjtime __P((struct x_timeval *x_delta, struct x_timeval *x_odelta));
#include "x_ttychars.h"
#include "x_ttydev.h"
#else
-#include <sys/x_ttychars.h>
+/*#include <sys/ttychars.h>*/
#include <sys/x_ttydev.h>
#endif
#include "x_namei.h"
#else
#include <machine/x_pcb.h>
-#include <sys/x_dmap.h>
-#include <sys/x_time.h>
-#include <sys/x_resource.h>
-#include <sys/x_namei.h>
+/*#include <sys/dmap.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <sys/namei.h>*/
#endif
/*
#ifdef x_KERNEL
#include "x_ioctl.h"
#else
-#include <sys/x_ioctl.h>
+/*#include <sys/ioctl.h>*/
#endif
#endif
#ifdef x_KERNEL
#include "x_ioctl.h"
#else
-#include <sys/x_ioctl.h>
+/*#include <sys/ioctl.h>*/
#endif
/*
+#ifndef X_
#define X_
+
+#define _va_arg_short(argp) va_arg(argp, int)
+#define _va_arg_int(argp) va_arg(argp, int)
+#define _va_arg_long(argp) va_arg(argp, int)
+#define _va_arg_unsigned_short(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_int(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_long(argp) va_arg(argp, unsigned int)
+
typedef short x_short;
typedef int x_int;
typedef int x_long;
typedef unsigned short x_unsigned_short;
typedef unsigned int x_unsigned_int;
typedef unsigned int x_unsigned_long;
+
+#endif
#ifndef x__ASSERT_H_
#define x__ASSERT_H_
-#include <x_csu.h>
#include <x_stdio.h>
/* assert.h 4.2 85/01/21 */
#include <sys/x_ioctl.h>
#include <sys/x_resource.h>
-#include <sys/x_timeb.h>
#include <sys/x_time.h>
+#include <sys/x_timeb.h>
#include <sys/x_times.h>
#include <sys/x_vlimit.h>
#include <sys/x_vtimes.h>
+++ /dev/null
-#include "x_.h"
-
-#ifndef x__CSU_H_
-#define x__CSU_H_
-
-#ifndef x_KERNEL
-#ifndef __P
-#ifdef __STDC__
-#define __P(x_args) x_args
-#else
-#define __P(x_args) ()
-#endif
-#endif
-
-/* csu/crt0.c */
-x_int x_start __P((void));
-x_int x_exit __P((register x_int x_code));
-x_int x_moncontrol __P((x_int x_val));
-
-/* csu/gmon.c */
-x_int x_monstartup __P((char *x_lowpc, char *x_highpc));
-x_int x__mcleanup __P((void));
-x_int x_mcount __P((void));
-x_int x_monitor __P((char *x_lowpc, char *x_highpc, char *x_buf, x_int x_bufsiz, x_int x_nfunc));
-x_int x_moncontrol __P((x_int x_mode));
-
-/* csu/mon.c */
-x_int x_monstartup __P((char *x_lowpc, char *x_highpc));
-x_int x_mcount __P((void));
-x_int x_monitor __P((char *x_lowpc, char *x_highpc, char *x_buf, x_int x_bufsiz, x_int x_cntsiz));
-x_int x_moncontrol __P((x_int x_mode));
-#endif
-
-#endif
#include <sys/x_dir.h>
#include <sys/x_errno.h>
#include <sys/x_exec.h>
-#include <sys/x_ioctl.h>
#include <sys/x_proc.h>
#include <sys/x_signal.h>
#include <sys/x_syslog.h>
char *x_fcvt __P((double x_arg, x_int x_ndigits, x_int *x_decpt, x_int *x_sign));
/* gen/fakcu.c */
-x_int x__cleanup __P((void));
+void x__cleanup __P((void));
/* gen/ffs.c */
x_int x_ffs __P((register x_long x_mask));
/* gen/malloc.c */
char *x_malloc __P((x_unsigned_int x_nbytes));
-x_int x_morecore __P((x_int x_bucket));
-x_int x_free __P((char *x_cp));
+void x_morecore __P((x_int x_bucket));
+void x_free __P((char *x_cp));
char *x_realloc __P((char *x_cp, x_unsigned_int x_nbytes));
-x_int x_mstats __P((char *x_s));
+void x_mstats __P((char *x_s));
/* gen/mkstemp.c */
x_int x_mkstemp __P((char *x_as));
char *x_mktemp __P((char *x_as));
/* gen/qsort.c */
-x_int x_qsort __P((char *x_base, x_int x_n, x_int x_size, x_int (*x_compar)(void)));
+void x_qsort __P((char *x_base, x_int x_n, x_int x_size, x_int (*x_compar)(void)));
/* gen/random.c */
x_int x_srandom __P((x_unsigned_int x_x));
+++ /dev/null
-#include "x_.h"
-
-#ifndef x__MP_H_
-#define x__MP_H_
-
-#include <x_gen.h>
-#include <x_stdio.h>
-
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- * @(#)mp.h 5.1 (Berkeley) 5/30/85
- */
-
-#define x_MINT struct x_mint
-x_MINT
-{ x_int x_len;
- x_short *x_val;
-};
-#define x_FREE(x_x) {if(x_x.x_len!=0) {x_free((char *)x_x.x_val); x_x.x_len=0;}}
-#ifndef x_DBG
-#define x_shfree(x_u) x_free((char *)x_u)
-#else
-#include <x_stdio.h>
-#define x_shfree(x_u) { if(x_dbg) x_fprintf(x_stderr, "free %o\n", x_u); x_free((char *)x_u);}
-extern x_int x_dbg;
-#endif
-#ifndef x_vax
-struct x_half
-{ x_short x_high;
- x_short x_low;
-};
-#else
-struct x_half
-{ x_short x_low;
- x_short x_high;
-};
-#endif
-/*extern MINT *itom();*/
-/*extern short *xalloc();*/
-
-#ifdef x_lint
-extern x_xv_oid;
-#define x_VOID x_xv_oid =
-#else
-#define x_VOID
-#endif
-
-#endif
#include <arpa/x_nameser.h>
#include <x_netdb.h>
#include <x_stdio.h>
+#include <sys/x_types.h>
/* formerly duplicated in netinet/in.h and netns/ns.h */
-#if !defined(x_vax) && !defined(x_ntohl) && !defined(x_lint)
+/* confuses cproto which thinks #define names are types or type modifiers */
+/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/
/*
* Macros for number representation conversion.
*/
-#define x_ntohl(x_x) (x_x)
-#define x_ntohs(x_x) (x_x)
-#define x_htonl(x_x) (x_x)
-#define x_htons(x_x) (x_x)
-#endif
+/*#define ntohl(x) (x)*/
+/*#define ntohs(x) (x)*/
+/*#define htonl(x) (x)*/
+/*#define htons(x) (x)*/
+/*#endif*/
-#if !defined(x_ntohl) && (defined(x_vax) || defined(x_lint))
+/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/
/*u_short ntohs(), htons();*/
/*u_long ntohl(), htonl();*/
-#endif
+/*#endif*/
#ifndef x_KERNEL
#ifndef __P
#endif
#endif
+/* net/htonl.c */
+x_u_long x_htonl __P((x_u_long x_hostlong));
+
+/* net/htons.c */
+x_u_short x_htons __P((x_int x_hostshort));
+
+/* net/ntohl.c */
+x_u_long x_ntohl __P((x_u_long x_netlong));
+
+/* net/ntohs.c */
+x_u_short x_ntohs __P((x_int x_netshort));
+
/* net/rcmd.c */
x_int x_rcmd __P((char **x_ahost, x_int x_rport, char *x_locuser, char *x_remuser, char *x_cmd, x_int *x_fd2p));
x_int x_rresvport __P((x_int *x_alport));
x_int x_rexec __P((char **x_ahost, x_int x_rport, char *x_name, char *x_pass, char *x_cmd, x_int *x_fd2p));
/* net/ruserpass.c */
-x_int x_ruserpass __P((char *x_host, char **x_aname, char **x_apass));
-x_int x_mkpwunclear __P((char *x_spasswd, x_int x_mch, char *x_sencpasswd));
-x_int x_mkpwclear __P((char *x_sencpasswd, x_int x_mch, char *x_spasswd));
+void x_ruserpass __P((char *x_host, char **x_aname, char **x_apass));
+void x_mkpwunclear __P((char *x_spasswd, x_int x_mch, char *x_sencpasswd));
+void x_mkpwclear __P((char *x_sencpasswd, x_int x_mch, char *x_spasswd));
#endif
#endif
x_int x__doprnt __P((x_u_char *x_fmt0, va_list x_argp, register x_FILE *x_fp));
/* stdio/doscan.c */
-x_int x__doscan __P((x_FILE *x_iop, register char *x_fmt, register va_list x_ap));
+x_int x__doscan __P((x_FILE *x_iop, register char *x_fmt, register va_list x_argp));
/* stdio/exit.c */
x_int x_exit __P((x_int x_code));
/* stdio/findiop.c */
x_FILE *x__findiop __P((void));
x_int x__f_morefiles __P((void));
-x_int x_f_prealloc __P((void));
-x_int x__fwalk __P((register x_int (*x_function)(void)));
-x_int x__cleanup __P((void));
+void x_f_prealloc __P((void));
+void x__fwalk __P((register x_int (*x_function)(void)));
+void x__cleanup __P((void));
/* stdio/flsbuf.c */
x_int x__flsbuf __P((x_int x_c, register x_FILE *x_iop));
x_int x_ungetc __P((x_int x_c, register x_FILE *x_iop));
/* stdio/vfprintf.c */
-x_int x_vfprintf __P((x_FILE *x_iop, char *x_fmt, va_list x_ap));
+x_int x_vfprintf __P((x_FILE *x_iop, char *x_fmt, va_list x_argp));
/* stdio/vprintf.c */
-x_int x_vprintf __P((char *x_fmt, va_list x_ap));
+x_int x_vprintf __P((char *x_fmt, va_list x_argp));
/* stdio/vsprintf.c */
-x_int x_vsprintf __P((char *x_str, char *x_fmt, va_list x_ap));
+x_int x_vsprintf __P((char *x_str, char *x_fmt, va_list x_argp));
#endif
#endif
#ifndef X_
#define X_
+
+#define _va_arg_short(argp) va_arg(argp, int)
+#define _va_arg_int(argp) va_arg(argp, int)
+#define _va_arg_long(argp) va_arg(argp, int)
+#define _va_arg_unsigned_short(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_int(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_long(argp) va_arg(argp, unsigned int)
+
typedef short x_short;
typedef int x_int;
typedef int x_long;
typedef unsigned short x_unsigned_short;
typedef unsigned int x_unsigned_int;
typedef unsigned int x_unsigned_long;
+
#endif
while (isalnum(p[l]) || p[l] == '_')
++l;
if (
+ (l == 6 && memcmp(p, "extern", 6) == 0) ||
(l == 8 && memcmp(p, "register", 8) == 0) ||
(l == 6 && memcmp(p, "static", 6) == 0)
) {
(m != 6 || memcmp(q, "struct", 6) != 0) &&
(m != 5 || memcmp(q, "union", 5) != 0) &&
(m != 8 || memcmp(q, "unsigned", 8) != 0) &&
- (m != 7 || memcmp(q, "va_list", 7) != 0)
+ (m != 7 || memcmp(q, "va_list", 7) != 0) &&
+ (m != 4 || memcmp(q, "void", 4) != 0)
) {
q += m;
m = 0;
--- /dev/null
+#!/bin/sh
+"`dirname "$0"`/xify" |\
+sed -e 's/\(extern\|register\|static\) x_int \(x_u_long\|x_u_short\)/\1 \2/g; s/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g'