- some KNF.

- use __RCSID().
- WARNS=1
This commit is contained in:
mrg 1997-07-21 07:04:56 +00:00
parent cd53f1ab76
commit 5941399374
14 changed files with 89 additions and 64 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmds.c,v 1.6 1996/12/21 09:16:35 matthias Exp $ */
/* $NetBSD: cmds.c,v 1.7 1997/07/21 07:04:56 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95";
#endif
static char rcsid[] = "$NetBSD: cmds.c,v 1.6 1996/12/21 09:16:35 matthias Exp $";
__RCSID("$NetBSD: cmds.c,v 1.7 1997/07/21 07:04:56 mrg Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -160,7 +161,7 @@ lookup(name)
longest = 0;
nmatches = 0;
found = (struct cmdtab *) 0;
for (c = cmdtab; p = c->c_name; c++) {
for (c = cmdtab; (p = c->c_name); c++) {
for (q = name; *q == *p++; q++)
if (*q == 0) /* exact match? */
return (c);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmdtab.c,v 1.3 1996/12/13 19:26:19 scottr Exp $ */
/* $NetBSD: cmdtab.c,v 1.4 1997/07/21 07:04:57 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: cmdtab.c,v 1.3 1996/12/13 19:26:19 scottr Exp $";
__RCSID("$NetBSD: cmdtab.c,v 1.4 1997/07/21 07:04:57 mrg Exp $");
#endif /* not lint */
#include "systat.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: disks.c,v 1.4 1996/05/10 23:16:33 thorpej Exp $ */
/* $NetBSD: disks.c,v 1.5 1997/07/21 07:04:59 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,17 +33,25 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)disks.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: disks.c,v 1.4 1996/05/10 23:16:33 thorpej Exp $";
__RCSID("$NetBSD: disks.c,v 1.5 1997/07/21 07:04:59 mrg Exp $");
#endif /* not lint */
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include "systat.h"
#include "extern.h"
static void dkselect(char *args, int truefalse, int selections[]);
static void dkselect(char *args, int truefalse, int selections[]);
int
dkcmd(cmd, args)
@ -75,7 +83,6 @@ dkselect(args, truefalse, selections)
{
register char *cp;
register int i;
char *index();
cp = index(args, '\n');
if (cp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.4 1996/12/13 19:26:19 scottr Exp $ */
/* $NetBSD: extern.h,v 1.5 1997/07/21 07:05:00 mrg Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -91,7 +91,7 @@ int initmbufs __P((void));
int initnetstat __P((void));
int initpigs __P((void));
int initswap __P((void));
int keyboard __P((void));
int keyboard __P((void)) __attribute__((__noreturn__));
int kvm_ckread __P((void *, void *, int));
void labeliostat __P((void));
void labelkre __P((void));

View File

@ -1,4 +1,4 @@
/* $NetBSD: fetch.c,v 1.2 1995/01/20 08:51:56 jtc Exp $ */
/* $NetBSD: fetch.c,v 1.3 1997/07/21 07:05:01 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)fetch.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: fetch.c,v 1.2 1995/01/20 08:51:56 jtc Exp $";
__RCSID("$NetBSD: fetch.c,v 1.3 1997/07/21 07:05:01 mrg Exp $");
#endif /* not lint */
#include <sys/types.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: iostat.c,v 1.7 1997/05/24 00:48:24 jtc Exp $ */
/* $NetBSD: iostat.c,v 1.8 1997/07/21 07:05:01 mrg Exp $ */
/*
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: iostat.c,v 1.7 1997/05/24 00:48:24 jtc Exp $";
__RCSID("$NetBSD: iostat.c,v 1.8 1997/07/21 07:05:01 mrg Exp $");
#endif not lint
#include <sys/param.h>
@ -70,6 +71,7 @@ static void stat1 __P((int, int));
WINDOW *
openiostat()
{
return (subwin(stdscr, LINES-1-5, 0, 5, 0));
}
@ -77,6 +79,7 @@ void
closeiostat(w)
WINDOW *w;
{
if (w == NULL)
return;
wclear(w);
@ -87,13 +90,16 @@ closeiostat(w)
int
initiostat()
{
dkinit(1);
dkreadstats();
return(1);
}
void
fetchiostat()
{
if (dk_ndrive == 0)
return;
dkreadstats();
@ -189,7 +195,6 @@ barlabels(row)
void
showiostat()
{
register u_int64_t t;
register int i, row, col;
if (dk_ndrive == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: keyboard.c,v 1.3 1996/12/13 19:26:20 scottr Exp $ */
/* $NetBSD: keyboard.c,v 1.4 1997/07/21 07:05:02 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: keyboard.c,v 1.3 1996/12/13 19:26:20 scottr Exp $";
__RCSID("$NetBSD: keyboard.c,v 1.4 1997/07/21 07:05:02 mrg Exp $");
#endif /* not lint */
#include <ctype.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $ */
/* $NetBSD: main.c,v 1.11 1997/07/21 07:05:03 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,17 +33,14 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1980, 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1980, 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $";
__RCSID("$NetBSD: main.c,v 1.11 1997/07/21 07:05:03 mrg Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -55,6 +52,8 @@ static char rcsid[] = "$NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include "systat.h"
#include "extern.h"
@ -86,7 +85,8 @@ int CMDLINE;
static WINDOW *wload; /* one line window for load average */
static void usage();
static void usage __P((void));
int main __P((int, char **));
int
main(argc, argv)

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbufs.c,v 1.3 1997/05/24 00:48:26 jtc Exp $ */
/* $NetBSD: mbufs.c,v 1.4 1997/07/21 07:05:04 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: mbufs.c,v 1.3 1997/05/24 00:48:26 jtc Exp $";
__RCSID("$NetBSD: mbufs.c,v 1.4 1997/07/21 07:05:04 mrg Exp $");
#endif /* not lint */
#include <sys/param.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $ */
/* $NetBSD: netcmds.c,v 1.5 1997/07/21 07:05:05 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $";
__RCSID("$NetBSD: netcmds.c,v 1.5 1997/07/21 07:05:05 mrg Exp $");
#endif /* not lint */
/*
@ -74,7 +75,7 @@ static struct hitem {
int nports, nhosts, protos;
static void changeitems __P((char *, int));
static int selectproto __P((char *));
static void selectproto __P((char *));
static void showprotos __P((void));
static int selectport __P((long, int));
static void showports __P((void));
@ -131,7 +132,6 @@ changeitems(args, onoff)
struct servent *sp;
struct hostent *hp;
struct in_addr in;
char *index();
cp = index(args, '\n');
if (cp)
@ -164,19 +164,17 @@ changeitems(args, onoff)
}
}
static int
static void
selectproto(proto)
char *proto;
{
int new = protos;
if (proto == 0 || streq(proto, "all"))
new = TCP|UDP;
protos = TCP|UDP;
else if (streq(proto, "tcp"))
new = TCP;
protos = TCP;
else if (streq(proto, "udp"))
new = UDP;
return (new != protos, protos = new);
protos = UDP;
}
static void
@ -246,7 +244,7 @@ showports()
for (p = ports; p < ports+nports; p++) {
sp = getservbyport(p->port,
protos == TCP|UDP ? 0 : protos == TCP ? "tcp" : "udp");
protos == (TCP|UDP) ? 0 : protos == TCP ? "tcp" : "udp");
if (!p->onoff)
addch('!');
if (sp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: netstat.c,v 1.6 1997/05/24 00:48:28 jtc Exp $ */
/* $NetBSD: netstat.c,v 1.7 1997/07/21 07:05:06 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: netstat.c,v 1.6 1997/05/24 00:48:28 jtc Exp $";
__RCSID("$NetBSD: netstat.c,v 1.7 1997/07/21 07:05:06 mrg Exp $");
#endif /* not lint */
/*
@ -50,7 +51,10 @@ static char rcsid[] = "$NetBSD: netstat.c,v 1.6 1997/05/24 00:48:28 jtc Exp $";
#include <sys/protosw.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/route.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/in_pcb.h>
@ -114,8 +118,9 @@ static struct {
static int aflag = 0;
static int nflag = 0;
static int lastrow = 1;
static void enter(), inetprint();
static char *inetname();
static void enter __P((struct inpcb *, struct socket *, int, char *));
static void inetprint __P((struct in_addr *, int, char *));
static char *inetname __P((struct in_addr));
void
closenetstat(w)
@ -198,7 +203,7 @@ again:
while (next != head) {
KREAD(next, &inpcb, sizeof (inpcb));
if (inpcb.inp_queue.cqe_prev != prev) {
printf("prev = %x, head = %x, next = %x, inpcb...prev = %x\n", prev, head, next, inpcb.inp_queue.cqe_prev);
printf("prev = %p, head = %p, next = %p, inpcb...prev = %p\n", prev, head, next, inpcb.inp_queue.cqe_prev);
p = netcb.ni_forw;
for (; p != (struct netinfo *)&netcb; p = p->ni_forw)
p->ni_seen = 1;
@ -230,8 +235,8 @@ printf("prev = %x, head = %x, next = %x, inpcb...prev = %x\n", prev, head, next,
static void
enter(inp, so, state, proto)
register struct inpcb *inp;
register struct socket *so;
struct inpcb *inp;
struct socket *so;
int state;
char *proto;
{
@ -378,12 +383,12 @@ shownetstat()
*/
static void
inetprint(in, port, proto)
register struct in_addr *in;
struct in_addr *in;
int port;
char *proto;
{
struct servent *sp = 0;
char line[80], *cp, *index();
char line[80], *cp;
sprintf(line, "%.*s.", 16, inetname(*in));
cp = index(line, '\0');

View File

@ -1,4 +1,4 @@
/* $NetBSD: pigs.c,v 1.5 1997/05/24 00:48:29 jtc Exp $ */
/* $NetBSD: pigs.c,v 1.6 1997/07/21 07:05:07 mrg Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)pigs.c 8.2 (Berkeley) 9/23/93";
#endif
static char rcsid[] = "$NetBSD: pigs.c,v 1.5 1997/05/24 00:48:29 jtc Exp $";
__RCSID("$NetBSD: pigs.c,v 1.6 1997/07/21 07:05:07 mrg Exp $");
#endif /* not lint */
/*
@ -131,7 +132,7 @@ showpigs()
wmove(wnd, y, 0);
wclrtoeol(wnd);
mvwaddstr(wnd, y, 0, uname);
sprintf(pidname, "%10.10s", pname, 0);
sprintf(pidname, "%10.10s", pname);
mvwaddstr(wnd, y, 9, pidname);
wmove(wnd, y, 20);
for (j = pt[k].pt_pctcpu*factor + 0.5; j > 0; j--)

View File

@ -1,4 +1,4 @@
/* $NetBSD: systat.h,v 1.2 1995/01/20 08:52:14 jtc Exp $ */
/* $NetBSD: systat.h,v 1.3 1997/07/21 07:05:08 mrg Exp $ */
/*-
* Copyright (c) 1980, 1989, 1992, 1993
@ -38,15 +38,15 @@
#include <curses.h>
struct cmdtab {
char *c_name; /* command name */
void (*c_refresh)(); /* display refresh */
void (*c_fetch)(); /* sets up data structures */
void (*c_label)(); /* label display */
int (*c_init)(); /* initialize namelist, etc. */
WINDOW *(*c_open)(); /* open display */
void (*c_close)(); /* close display */
int (*c_cmd)(); /* display command interpreter */
char c_flags; /* see below */
char *c_name; /* command name */
void (*c_refresh) __P((void)); /* display refresh */
void (*c_fetch) __P((void)); /* sets up data structures */
void (*c_label) __P((void)); /* label display */
int (*c_init) __P((void)); /* initialize namelist, etc. */
WINDOW *(*c_open) __P((void)); /* open display */
void (*c_close) __P((WINDOW *)); /* close display */
int (*c_cmd) __P((char *, char *)); /* display command interpreter*/
char c_flags; /* see below */
};
#define CF_INIT 0x1 /* been initialized */
@ -60,3 +60,6 @@ struct cmdtab {
#define NPTR(indx) (void *)NVAL((indx))
#define NREAD(indx, buf, len) kvm_ckread(NPTR((indx)), (buf), (len))
#define LONG (sizeof (long))
void dkreadstats __P((void)); /* XXX: from ../vmstat/dkstats.c */
void dkswap __P((void)); /* XXX: from ../vmstat/dkstats.c */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vmstat.c,v 1.7 1996/12/13 19:26:23 scottr Exp $ */
/* $NetBSD: vmstat.c,v 1.8 1997/07/21 07:05:10 mrg Exp $ */
/*-
* Copyright (c) 1983, 1989, 1992, 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
static char rcsid[] = "$NetBSD: vmstat.c,v 1.7 1996/12/13 19:26:23 scottr Exp $";
__RCSID("$NetBSD: vmstat.c,v 1.8 1997/07/21 07:05:10 mrg Exp $");
#endif /* not lint */
/*