+ for_each_string(j, tp) {
+ char *a = tp->Strings[j];
+ if (VALID_STRING(a))
+ check_params(tp, ExtStrname(tp, (int) j, strnames), a);
+ }
+
+ check_acs(tp);
+ check_colors(tp);
+ check_cursor(tp);
+ check_keypad(tp);
+ check_printer(tp);
+ check_screen(tp);
+
+ /*
+ * These may be mismatched because the terminal description relies on
+ * restoring the cursor visibility by resetting it.
+ */
+ ANDMISSING(cursor_invisible, cursor_normal);
+ ANDMISSING(cursor_visible, cursor_normal);
+
+ if (PRESENT(cursor_visible) && PRESENT(cursor_normal)
+ && !_nc_capcmp(cursor_visible, cursor_normal))
+ _nc_warning("cursor_visible is same as cursor_normal");
+
+ /*
+ * From XSI & O'Reilly, we gather that sc/rc are required if csr is
+ * given, because the cursor position after the scrolling operation is
+ * performed is undefined.
+ */
+ ANDMISSING(change_scroll_region, save_cursor);
+ ANDMISSING(change_scroll_region, restore_cursor);
+
+ /*
+ * If we can clear tabs, we should be able to initialize them.
+ */
+ ANDMISSING(clear_all_tabs, set_tab);
+
+ if (PRESENT(set_attributes)) {
+ char *zero = 0;
+
+ _nc_tparm_err = 0;
+ if (PRESENT(exit_attribute_mode)) {
+ zero = strdup(CHECK_SGR(0, exit_attribute_mode));
+ } else {
+ zero = strdup(TPARM_9(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, 0));
+ }
+ if (_nc_tparm_err)
+ _nc_warning("stack error in sgr(0) string");
+
+ if (zero != 0) {
+ CHECK_SGR(1, enter_standout_mode);
+ CHECK_SGR(2, enter_underline_mode);
+ CHECK_SGR(3, enter_reverse_mode);
+ CHECK_SGR(4, enter_blink_mode);
+ CHECK_SGR(5, enter_dim_mode);
+ CHECK_SGR(6, enter_bold_mode);
+ CHECK_SGR(7, enter_secure_mode);
+ CHECK_SGR(8, enter_protected_mode);
+ CHECK_SGR(9, enter_alt_charset_mode);
+ free(zero);
+ } else {
+ _nc_warning("sgr(0) did not return a value");
+ }
+ } else if (PRESENT(exit_attribute_mode) &&
+ set_attributes != CANCELLED_STRING) {
+ if (_nc_syntax == SYN_TERMINFO)
+ _nc_warning("missing sgr string");
+ }
+
+ if (PRESENT(exit_attribute_mode)) {
+ char *check_sgr0 = _nc_trim_sgr0(tp);
+
+ if (check_sgr0 == 0 || *check_sgr0 == '\0') {
+ _nc_warning("trimmed sgr0 is empty");
+ } else {
+ show_where(2);
+ if (check_sgr0 != exit_attribute_mode) {
+ DEBUG(2,
+ ("will trim sgr0\n\toriginal sgr0=%s\n\ttrimmed sgr0=%s",
+ _nc_visbuf2(1, exit_attribute_mode),
+ _nc_visbuf2(2, check_sgr0)));
+ free(check_sgr0);
+ } else {
+ DEBUG(2,
+ ("will not trim sgr0\n\toriginal sgr0=%s",
+ _nc_visbuf(exit_attribute_mode)));
+ }
+ }
+ }
+#ifdef TRACE
+ show_where(2);
+ if (!auto_right_margin) {
+ DEBUG(2,
+ ("can write to lower-right directly"));
+ } else if (PRESENT(enter_am_mode) && PRESENT(exit_am_mode)) {
+ DEBUG(2,
+ ("can write to lower-right by suppressing automargin"));
+ } else if ((PRESENT(enter_insert_mode) && PRESENT(exit_insert_mode))
+ || PRESENT(insert_character) || PRESENT(parm_ich)) {
+ DEBUG(2,
+ ("can write to lower-right by using inserts"));
+ } else {
+ DEBUG(2,
+ ("cannot write to lower-right"));
+ }
+#endif
+
+ /*
+ * Some standard applications (e.g., vi) and some non-curses
+ * applications (e.g., jove) get confused if we have both ich1 and
+ * smir/rmir. Let's be nice and warn about that, too, even though
+ * ncurses handles it.
+ */
+ if ((PRESENT(enter_insert_mode) || PRESENT(exit_insert_mode))
+ && PRESENT(parm_ich)) {
+ _nc_warning("non-curses applications may be confused by ich1 with smir/rmir");
+ }
+
+ /*
+ * Finally, do the non-verbose checks
+ */
+ if (save_check_termtype != 0)
+ save_check_termtype(tp, literal);