10e23615bSJeroen Ruigrok/asmodai /*
20e23615bSJeroen Ruigrok/asmodai * Copyright (c) 2003, Trent Nelson, <trent@arpa.com>.
30e23615bSJeroen Ruigrok/asmodai * All rights reserved.
40e23615bSJeroen Ruigrok/asmodai *
50e23615bSJeroen Ruigrok/asmodai * Redistribution and use in source and binary forms, with or without
60e23615bSJeroen Ruigrok/asmodai * modification, are permitted provided that the following conditions
70e23615bSJeroen Ruigrok/asmodai * are met:
80e23615bSJeroen Ruigrok/asmodai * 1. Redistributions of source code must retain the above copyright
90e23615bSJeroen Ruigrok/asmodai * notice, this list of conditions and the following disclaimer.
100e23615bSJeroen Ruigrok/asmodai * 2. Redistributions in binary form must reproduce the above copyright
110e23615bSJeroen Ruigrok/asmodai * notice, this list of conditions and the following disclaimer in the
120e23615bSJeroen Ruigrok/asmodai * documentation and/or other materials provided with the distribution.
130e23615bSJeroen Ruigrok/asmodai * 3. The name of the author may not be used to endorse or promote products
140e23615bSJeroen Ruigrok/asmodai * derived from this software without specific prior written permission.
150e23615bSJeroen Ruigrok/asmodai *
160e23615bSJeroen Ruigrok/asmodai * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
170e23615bSJeroen Ruigrok/asmodai * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
180e23615bSJeroen Ruigrok/asmodai * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
190e23615bSJeroen Ruigrok/asmodai * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
200e23615bSJeroen Ruigrok/asmodai * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
210e23615bSJeroen Ruigrok/asmodai * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
220e23615bSJeroen Ruigrok/asmodai * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
230e23615bSJeroen Ruigrok/asmodai * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
240e23615bSJeroen Ruigrok/asmodai * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
250e23615bSJeroen Ruigrok/asmodai * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
260e23615bSJeroen Ruigrok/asmodai * SUCH DAMAGE.
270e23615bSJeroen Ruigrok/asmodai *
28a64bdeb1SPeter Avalos * $FreeBSD: src/usr.bin/systat/ifcmds.c,v 1.6 2006/11/27 16:14:32 yar Exp $
290e23615bSJeroen Ruigrok/asmodai */
300e23615bSJeroen Ruigrok/asmodai
310e23615bSJeroen Ruigrok/asmodai #include "systat.h"
320e23615bSJeroen Ruigrok/asmodai #include "extern.h"
330e23615bSJeroen Ruigrok/asmodai #include "convtbl.h"
340e23615bSJeroen Ruigrok/asmodai
35*52bed69fSzrj u_int curscale = SC_AUTO;
360e23615bSJeroen Ruigrok/asmodai
370e23615bSJeroen Ruigrok/asmodai int
ifcmd(const char * cmd,const char * args)380e23615bSJeroen Ruigrok/asmodai ifcmd(const char *cmd, const char *args)
390e23615bSJeroen Ruigrok/asmodai {
40a64bdeb1SPeter Avalos int scale;
41a64bdeb1SPeter Avalos
42cae49b89SSascha Wildner if (prefix(cmd, "scale")) {
43a64bdeb1SPeter Avalos if ((scale = get_scale(args)) != -1)
44a64bdeb1SPeter Avalos curscale = scale;
450e23615bSJeroen Ruigrok/asmodai else {
460e23615bSJeroen Ruigrok/asmodai move(CMDLINE, 0);
470e23615bSJeroen Ruigrok/asmodai clrtoeol();
48a64bdeb1SPeter Avalos addstr("what scale? ");
49a64bdeb1SPeter Avalos addstr(get_helplist());
500e23615bSJeroen Ruigrok/asmodai }
510e23615bSJeroen Ruigrok/asmodai }
52a64bdeb1SPeter Avalos return (1);
530e23615bSJeroen Ruigrok/asmodai }
54