Lines Matching +full:toggle +full:- +full:mode

14  *  mode commands.  Note that some of the commands are implemented in-line
37 struct errs /* structure for a system-call error */
48 * show_help() - display the help screen; invoked in response to
56 {'a', "toggle the display of process titles", false, CMD_showargs},
57 {'C', "toggle the display of raw or weighted CPU percentage", false, CMD_wcputog},
60 {'H', "toggle the display of threads", false, CMD_thrtog},
63 {'i', "toggle the display of idle processes", false, CMD_idletog},
66 {'j', "toggle the display of jail ID", false, CMD_jidtog},
68 {'m', "toggle the display between 'cpu' and 'io' modes", false, CMD_viewtog},
72 {'P', "toggle the display of per-CPU statistics", false, CMD_pcputog},
76 {'S', "toggle the display of system processes", false, CMD_viewsys},
78 {'T', "toggle the display of thread IDs", false, CMD_toggletid},
79 {'t', "toggle the display of this process", false, CMD_selftog},
81 {'w', "toggle the display of swap use for each process", false, CMD_swaptog},
82 {'z', "toggle the display of the system idle process", false, CMD_kidletog},
95 while (curcmd->c != 0) { in show_help()
96 if (overstrike && !curcmd->available_to_dumb) { in show_help()
100 if (curcmd->desc == NULL) { in show_help()
106 if (nextcmd->desc == NULL && nextcmd->c != '\0') { in show_help()
107 sprintf(keys, "%c or %c", curcmd->c, nextcmd->c); in show_help()
108 } else if (curcmd->c == ' '){ in show_help()
113 sprintf(keys, "%c", curcmd->c); in show_help()
115 printf("%s\t- %s\n", keys, curcmd->desc); in show_help()
155 return(-1); in scanint()
162 val = val * 10 + (ch - '0'); in scanint()
170 return(-1); in scanint()
207 * err_string() - return an appropriate error string. This is what the
221 int currerr = -1; in err_string()
237 stringlen = STRMAX - 2; in err_string()
243 if (errp->errnum != currerr) in err_string()
253 currerr = errp->errnum; in err_string()
256 if ((stringlen = str_addarg(string, stringlen, errp->arg, first)) ==0) in err_string()
271 * str_adderr(str, len, err) - add an explanation of error "err" to
289 return(len - msglen); in str_adderr()
293 * str_addarg(str, len, arg, first) - add the string argument "arg" to
317 return(len - arglen); in str_addarg()
321 * err_compar(p1, p2) - comparison routine used by "qsort"
334 if ((result = g1->errnum - g2->errnum) == 0) in err_compar()
336 return(strcmp(g1->arg, g2->arg)); in err_compar()
342 * error_count() - return the number of errors currently logged.
352 * show_errors() - display on stdout the current log of errors.
364 printf("%5s: %s\n", errp->arg, in show_errors()
365 errp->errnum == 0 ? "Not a number" : strerror(errp->errnum)); in show_errors()
386 return (-1); in signame_to_signum()
390 * kill_procs(str) - send signals to processes, much like the "kill"
407 if (str[0] == '-') in kill_procs()
428 if (signum == -1 ) in kill_procs()
440 if (scanint(str, &procnum) == -1) in kill_procs()
447 if (kill(procnum, signum) == -1) in kill_procs()
460 * renice_procs(str) - change the "nice" of processes, much like the
474 if ((negate = (*str == '-')) != 0) in renice_procs()
486 prio = -prio; in renice_procs()
490 if (procnum == -1 || prio < PRIO_MIN || prio > PRIO_MAX) in renice_procs()
504 if (scanint(str, &procnum) == -1) in renice_procs()
509 if (setpriority(PRIO_PROCESS, procnum, prio) == -1) in renice_procs()