summaryrefslogtreecommitdiff
path: root/usr.bin/top/machine.c
diff options
context:
space:
mode:
authorVadim Zhukov <zhuk@cvs.openbsd.org>2020-01-06 20:05:11 +0000
committerVadim Zhukov <zhuk@cvs.openbsd.org>2020-01-06 20:05:11 +0000
commitdbb8671022af504b35907927c4a9923e9dd7a2d5 (patch)
treed3f5a802133c6fda44b9672b41218b3d1730284e /usr.bin/top/machine.c
parent5e90370432ed440628c5d2bdbae2b7d47fefacfc (diff)
Implement scrolling in top(1) using 9 and 0 keys.
Planned improvements: scroll position displaying, using arrow/pgup/pgdown keys. okay tedu@
Diffstat (limited to 'usr.bin/top/machine.c')
-rw-r--r--usr.bin/top/machine.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 99ff72be160..b68e910eae5 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.c,v 1.101 2019/12/16 19:21:17 guenther Exp $ */
+/* $OpenBSD: machine.c,v 1.102 2020/01/06 20:05:10 zhuk Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
@@ -546,6 +546,14 @@ format_comm(struct kinfo_proc *kp)
return (buf);
}
+void
+skip_next_process(struct handle *hndl)
+{
+ /* find and remember the next proc structure */
+ hndl->next_proc++;
+ hndl->remaining--;
+}
+
char *
format_next_process(struct handle *hndl, const char *(*get_userid)(uid_t, int),
pid_t *pid)