+
+static int tw_on;
+static int tw_pos;
+static char tw_chars[] = "|/-\\";
+
+reset_twiddle()
+{
+ if (tw_on)
+ putchar('\b');
+ tw_on = 0;
+ tw_pos = 0;
+}
+
+twiddle()
+{
+ if (tw_on)
+ putchar('\b');
+ else
+ tw_on = 1;
+ putchar(tw_chars[tw_pos++]);
+ tw_pos %= (sizeof(tw_chars) - 1);
+}