Handle arguments to global commands. Note that the `interval' and

`start' global commands are still special cased, which will change
This commit is contained in:
jwise 1999-12-16 04:49:32 +00:00
parent b5f0c03b3a
commit 420c21c43c
4 changed files with 19 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmds.c,v 1.11 1999/12/16 04:02:22 jwise Exp $ */
/* $NetBSD: cmds.c,v 1.12 1999/12/16 04:49:32 jwise Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95";
#endif
__RCSID("$NetBSD: cmds.c,v 1.11 1999/12/16 04:02:22 jwise Exp $");
__RCSID("$NetBSD: cmds.c,v 1.12 1999/12/16 04:49:32 jwise Exp $");
#endif /* not lint */
#include <stdlib.h>
@ -73,7 +73,7 @@ command(cmd)
for (c = global_commands; c->c_name; c++) {
if (strcmp(cmd, c->c_name) == 0) {
(c->c_cmd)();
(c->c_cmd)(cp);
goto done;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.12 1999/12/16 04:02:23 jwise Exp $ */
/* $NetBSD: extern.h,v 1.13 1999/12/16 04:49:33 jwise Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -94,10 +94,10 @@ void fetchnetstat __P((void));
void fetchpigs __P((void));
void fetchswap __P((void));
void fetchtcp __P((void));
void global_help __P((void));
void global_load __P((void));
void global_quit __P((void));
void global_stop __P((void));
void global_help __P((char *args));
void global_load __P((char *args));
void global_quit __P((char *args));
void global_stop __P((char *args));
int initbufcache __P((void));
int initicmp __P((void));
int initiostat __P((void));

View File

@ -1,4 +1,4 @@
/* $NetBSD: globalcmds.c,v 1.1 1999/12/16 04:40:03 jwise Exp $ */
/* $NetBSD: globalcmds.c,v 1.2 1999/12/16 04:49:33 jwise Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993 Jim Wise
@ -33,7 +33,8 @@
void
global_help()
global_help(args)
char *args;
{
int col, len;
struct mode *p;
@ -51,7 +52,8 @@ global_help()
}
void
global_load()
global_load(args)
char *args;
{
(void)getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0]));
mvprintw(CMDLINE, 0, "%4.1f %4.1f %4.1f",
@ -60,13 +62,15 @@ global_load()
}
void
global_quit()
global_quit(args)
char *args;
{
die(0);
}
void
global_stop()
global_stop(args)
char *args;
{
alarm(0);
mvaddstr(CMDLINE, 0, "Refresh disabled.");

View File

@ -1,4 +1,4 @@
/* $NetBSD: systat.h,v 1.4 1999/12/16 04:02:23 jwise Exp $ */
/* $NetBSD: systat.h,v 1.5 1999/12/16 04:49:33 jwise Exp $ */
/*-
* Copyright (c) 1980, 1989, 1992, 1993
@ -51,7 +51,7 @@ struct mode {
struct command {
char *c_name;
void (*c_cmd) __P((void));
void (*c_cmd) __P((char *args));
char *helptext;
};