+static int
+get_input(void)
+{
+ int ch;
+ ch = USING_WINDOW(stdscr, wgetch);
+ return ch;
+}
+
+#ifdef KEY_RESIZE
+static int
+update_refs(WINDOW *win)
+{
+ int x, y;
+
+ (void) win;
+ if (last_x != COLS - 1) {
+ for (y = 0; y <= last_y; y++) {
+ refs[y] = typeRealloc(int, (size_t) COLS, refs[y]);
+ if (!refs[y])
+ failed("update_refs");
+ for (x = last_x + 1; x < COLS; x++)
+ refs[y][x] = 0;
+ }
+ last_x = COLS - 1;
+ }
+ if (last_y != LINES - 1) {
+ for (y = LINES; y <= last_y; y++)
+ free(refs[y]);
+ refs = typeRealloc(int *, (size_t) LINES, refs);
+ for (y = last_y + 1; y < LINES; y++) {
+ refs[y] = typeMalloc(int, (size_t) COLS);
+ if (!refs[y])
+ failed("update_refs");
+ for (x = 0; x < COLS; x++)
+ refs[y][x] = 0;
+ }
+ last_y = LINES - 1;
+ }
+ return OK;
+}
+#endif
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: worm [options]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ ," -f fill screen with copies of \"WORM\" at start"
+ ," -l <n> set length of worms"
+ ," -n <n> set number of worms"
+ ," -t leave trail of \".\""
+#ifdef TRACE
+ ," -T <start>,<end> set trace interval"
+ ," -N suppress cursor-movement optimization"
+#endif
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+