-int errret;
-int slk_format = _nc_slk_format;
-SCREEN* current;
-#ifdef TRACE
-int t = _nc_getenv_num("NCURSES_TRACE");
-
- if (t >= 0)
- trace(t);
-#endif
-
- T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp));
-
- /* this loads the capability entry, then sets LINES and COLS */
- if (setupterm(name, fileno(ofp), &errret) == ERR)
- return 0;
-
- /* implement filter mode */
- if (filter_mode) {
- LINES = 1;
-
- if (init_tabs != -1)
- TABSIZE = init_tabs;
- else
- TABSIZE = 8;
-
- T(("TABSIZE = %d", TABSIZE));
-
- clear_screen = 0;
- cursor_down = parm_down_cursor = 0;
- cursor_address = 0;
- cursor_up = parm_up_cursor = 0;
- row_address = 0;
-
- cursor_home = carriage_return;
+ int errret;
+ int slk_format = _nc_slk_format;
+ SCREEN *current;
+
+ START_TRACE();
+ T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp));
+
+ /* this loads the capability entry, then sets LINES and COLS */
+ if (setupterm(name, fileno(ofp), &errret) == ERR)
+ returnSP(0);
+
+ /* implement filter mode */
+ if (filter_mode) {
+ LINES = 1;
+
+ if (VALID_NUMERIC(init_tabs))
+ TABSIZE = init_tabs;
+ else
+ TABSIZE = 8;
+
+ T(("TABSIZE = %d", TABSIZE));
+
+ clear_screen = 0;
+ cursor_down = parm_down_cursor = 0;
+ cursor_address = 0;
+ cursor_up = parm_up_cursor = 0;
+ row_address = 0;
+
+ cursor_home = carriage_return;
+ }
+
+ /* If we must simulate soft labels, grab off the line to be used.
+ We assume that we must simulate, if it is none of the standard
+ formats (4-4 or 3-2-3) for which there may be some hardware
+ support. */
+ if (num_labels <= 0 || !SLK_STDFMT(slk_format))
+ if (slk_format) {
+ if (ERR == _nc_ripoffline(-SLK_LINES(slk_format),
+ _nc_slk_initialize))
+ returnSP(0);