]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_initscr.c
ncurses 5.0
[ncurses.git] / ncurses / base / lib_initscr.c
similarity index 89%
rename from ncurses/lib_initscr.c
rename to ncurses/base/lib_initscr.c
index e33f0b345de7f1713ed8464c3acae80cb1268e0f..9a89a077cd44822bf0baf696f4477d8d670ec18c 100644 (file)
 #include <sys/termio.h>        /* needed for ISC */
 #endif
 
-MODULE_ID("$Id: lib_initscr.c,v 1.21 1998/02/11 12:14:00 tom Exp $")
+MODULE_ID("$Id: lib_initscr.c,v 1.26 1998/12/19 23:10:09 tom Exp $")
 
 WINDOW *initscr(void)
 {
 static bool initialized = FALSE;
-const char *name;
+NCURSES_CONST char *name;
+int value;
 
        T((T_CALLED("initscr()")));
        /* Portable applications must not call initscr() more than once */
@@ -66,25 +67,12 @@ const char *name;
                }
 
                /* allow user to set maximum escape delay from the environment */
-               if ((name = getenv("ESCDELAY")) != 0)
-                       ESCDELAY = atoi(getenv("ESCDELAY"));
+               if ((value = _nc_getenv_num("ESCDELAY")) >= 0) {
+                       ESCDELAY = value;
+               }
 
                /* def_shell_mode - done in newterm/_nc_setupscreen */
                def_prog_mode();
        }
        returnWin(stdscr);
 }
-
-char *termname(void)
-{
-char   *term = getenv("TERM");
-static char    ret[MAX_ALIAS];
-
-       T(("termname() called"));
-
-       if (term != 0) {
-               (void) strncpy(ret, term, sizeof(ret) - 1);
-               term = ret;
-       }
-       return term;
-}