freebsd-ports/net/omnitty/files/patch-machmgr.c
Tobias Kortkamp f0f35ca44f net/omnitty: Add abililty to "toggle" tagged machines
We often need to do "something" to about half the machines, then
do "something else" to the other half.  So add a hack to toggle the
"tagged" status of the machines.

This is implemented by means of the F1 menu; the command characters
"o" and "O" can toggle the "tagged" status of the machines.

PR:		211682
Submitted by:	maintainer
2018-08-09 12:25:08 +00:00

25 lines
554 B
C

--- machmgr.c.orig 2005-10-25 22:04:01 UTC
+++ machmgr.c
@@ -26,7 +26,7 @@
#include "machine.h"
#include "minibuf.h"
#include <string.h>
-#include <alloca.h>
+#include <stdlib.h>
#define MACHINE_MAX 256
@@ -261,5 +261,13 @@ void machmgr_delete_dead() {
int i;
for (i = machcount - 1; i >= 0; i--)
if (!machs[i]->alive) machmgr_delete(i);
+}
+
+void machmgr_toggle_tag_all(bool ignore_dead) {
+ int i;
+ for (i = 0; i < machcount; i++) {
+ if (!ignore_dead || machs[i]->alive)
+ machs[i]->tag = !machs[i]->tag;
+ }
}