Always provide 9 arguments to tparm(3). Fixes build on NetBSD. diff --git a/ui_ti.c b/ui_ti.c index 7aec077..030ed43 100644 --- a/ui_ti.c +++ b/ui_ti.c @@ -35,18 +35,18 @@ uisetup(void) tcsetattr(0, TCSANOW, &tsacc); setupterm(NULL, 1, NULL); - putp(tparm(clear_screen)); - putp(tparm(save_cursor)); - putp(tparm(change_scroll_region, 0, lines-2)); - putp(tparm(restore_cursor)); + putp(tparm(clear_screen, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(change_scroll_region, 0, lines-2, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); fflush(stdout); } void uicleanup(void) { - putp(tparm(change_scroll_region, 0, lines-1)); - putp(tparm(clear_screen)); + putp(tparm(change_scroll_region, 0, lines-1, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(clear_screen, 0, 0, 0, 0, 0, 0, 0, 0, 0)); tcsetattr(0, TCSANOW, &tsave); fflush(stdout); } @@ -59,17 +59,17 @@ uiprompt(char *fmt, ...) size_t n = 0; ssize_t r; - putp(tparm(save_cursor)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - putp(tparm(cursor_address, lines-1, 0)); - putp(tparm(clr_eol)); - putp(tparm(enter_standout_mode)); + putp(tparm(cursor_address, lines-1, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(clr_eol, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(enter_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); - putp(tparm(exit_standout_mode)); + putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); tsacc.c_lflag |= (ECHO|ICANON); tcsetattr(0, TCSANOW, &tsacc); @@ -79,7 +79,7 @@ uiprompt(char *fmt, ...) tsacc.c_lflag &= ~(ECHO|ICANON); tcsetattr(0, TCSANOW, &tsacc); - putp(tparm(restore_cursor)); + putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); fflush(stdout); if (r < 0) @@ -124,10 +124,10 @@ uistatus(char *fmt, ...) { va_list ap; - putp(tparm(save_cursor)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - putp(tparm(cursor_address, lines-1, 0)); - putp(tparm(enter_standout_mode)); + putp(tparm(cursor_address, lines-1, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(enter_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); va_start(ap, fmt); vprintf(fmt, ap); @@ -136,9 +136,9 @@ uistatus(char *fmt, ...) printf(" [Press a key to continue ☃]"); getchar(); - putp(tparm(exit_standout_mode)); + putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - putp(tparm(restore_cursor)); + putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); fflush(stdout); } @@ -149,17 +149,17 @@ displaystatus(Item *item) size_t nitems = dir ? dir->nitems : 0; unsigned long long printoff = dir ? dir->printoff : 0; - putp(tparm(save_cursor)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - putp(tparm(cursor_address, lines-1, 0)); - putp(tparm(enter_standout_mode)); + putp(tparm(cursor_address, lines-1, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(enter_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); printf("%3lld%%| %s:%s%s", (printoff + lines-1 >= nitems) ? 100 : (printoff + lines-1) * 100 / nitems, item->host, item->port, item->selector); - putp(tparm(exit_standout_mode)); + putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - putp(tparm(restore_cursor)); + putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); fflush(stdout); } @@ -174,13 +174,13 @@ uidisplay(Item *entry) !(entry->type == '1' || entry->type == '+' || entry->type == '7')) return; - putp(tparm(clear_screen)); + putp(tparm(clear_screen, 0, 0, 0, 0, 0, 0, 0, 0, 0)); displaystatus(entry); if (!(dir = entry->dat)) return; - putp(tparm(save_cursor)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); items = dir->items; nitems = dir->nitems; @@ -190,18 +190,18 @@ uidisplay(Item *entry) for (i = printoff; i < nitems && i < lastln; ++i) { if (i != printoff) - putp(tparm(cursor_down)); + putp(tparm(cursor_down, 0, 0, 0, 0, 0, 0, 0, 0, 0)); if (i == curln) { - putp(tparm(save_cursor)); - putp(tparm(enter_standout_mode)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(enter_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); } printitem(items[i]); - putp(tparm(column_address, 0)); + putp(tparm(column_address, 0, 0, 0, 0, 0, 0, 0, 0, 0)); if (i == curln) - putp(tparm(exit_standout_mode)); + putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); } - putp(tparm(restore_cursor)); + putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); fflush(stdout); } @@ -227,34 +227,34 @@ movecurline(Item *item, int l) if (l > 0) { offline = dir->printoff + lines-1; if (curline - dir->printoff >= plines / 2 && offline < nitems) { - putp(tparm(save_cursor)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - putp(tparm(cursor_address, plines, 0)); - putp(tparm(scroll_forward)); + putp(tparm(cursor_address, plines, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(scroll_forward, 0, 0, 0, 0, 0, 0, 0, 0, 0)); printitem(dir->items[offline]); - putp(tparm(restore_cursor)); + putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); dir->printoff += l; } } else { offline = dir->printoff + l; if (curline - offline <= plines / 2 && offline >= 0) { - putp(tparm(save_cursor)); + putp(tparm(save_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - putp(tparm(cursor_address, 0, 0)); - putp(tparm(scroll_reverse)); + putp(tparm(cursor_address, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(scroll_reverse, 0, 0, 0, 0, 0, 0, 0, 0, 0)); printitem(dir->items[offline]); putchar('\n'); - putp(tparm(restore_cursor)); + putp(tparm(restore_cursor, 0, 0, 0, 0, 0, 0, 0, 0, 0)); dir->printoff += l; } } - putp(tparm(cursor_address, curline - dir->printoff, 0)); - putp(tparm(enter_standout_mode)); + putp(tparm(cursor_address, curline - dir->printoff, 0, 0, 0, 0, 0, 0, 0, 0)); + putp(tparm(enter_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); printitem(dir->items[curline]); - putp(tparm(exit_standout_mode)); + putp(tparm(exit_standout_mode, 0, 0, 0, 0, 0, 0, 0, 0, 0)); displaystatus(item); fflush(stdout); }