/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.159 2014/03/08 20:32:59 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.165 2016/02/13 21:20:05 tom Exp $")
/****************************************************************************
*
#endif
#if HAVE_SIZECHANGE
/* try asking the OS */
- if (isatty(cur_term->Filedes)) {
+ if (NC_ISATTY(cur_term->Filedes)) {
STRUCT_WINSIZE size;
errno = 0;
_nc_locale_breaks_acs(TERMINAL * termp)
{
const char *env_name = "NCURSES_NO_UTF8_ACS";
- char *env;
+ const char *env;
int value;
int result = 0;
+ T((T_CALLED("_nc_locale_breaks_acs:%d"), result));
if (getenv(env_name) != 0) {
result = _nc_getenv_num(env_name);
} else if ((value = tigetnum("U8")) >= 0) {
}
}
}
- return result;
+ returnCode(result);
}
NCURSES_EXPORT(int)
* Allow output redirection. This is what SVr3 does. If stdout is
* directed to a file, screen updates go to standard error.
*/
- if (Filedes == STDOUT_FILENO && !isatty(Filedes))
+ if (Filedes == STDOUT_FILENO && !NC_ISATTY(Filedes))
Filedes = STDERR_FILENO;
/*
termp->Filedes = (short) Filedes;
termp->_termname = strdup(tname);
} else {
- ret_error0(TGETENT_ERR,
+ ret_error0(errret ? *errret : TGETENT_ERR,
"Could not find any driver to handle this terminal.\n");
}
#else
* _nc_setupscreen(). Do it now anyway, so we can initialize the
* baudrate.
*/
- if (isatty(Filedes)) {
+ if (NC_ISATTY(Filedes)) {
def_prog_mode();
baudrate();
}
NCURSES_EXPORT(SCREEN *)
new_prescr(void)
{
- static SCREEN *sp;
+ SCREEN *sp;
START_TRACE();
T((T_CALLED("new_prescr()")));
- if (sp == 0) {
- sp = _nc_alloc_screen_sp();
- if (sp != 0) {
- sp->rsp = sp->rippedoff;
- sp->_filtered = _nc_prescreen.filter_mode;
- sp->_use_env = _nc_prescreen.use_env;
+ sp = _nc_alloc_screen_sp();
+ if (sp != 0) {
+ sp->rsp = sp->rippedoff;
+ sp->_filtered = _nc_prescreen.filter_mode;
+ sp->_use_env = _nc_prescreen.use_env;
#if NCURSES_NO_PADDING
- sp->_no_padding = _nc_prescreen._no_padding;
+ sp->_no_padding = _nc_prescreen._no_padding;
#endif
- sp->slk_format = 0;
- sp->_slk = 0;
- sp->_prescreen = TRUE;
- SP_PRE_INIT(sp);
+ sp->slk_format = 0;
+ sp->_slk = 0;
+ sp->_prescreen = TRUE;
+ SP_PRE_INIT(sp);
#if USE_REENTRANT
- sp->_TABSIZE = _nc_prescreen._TABSIZE;
- sp->_ESCDELAY = _nc_prescreen._ESCDELAY;
+ sp->_TABSIZE = _nc_prescreen._TABSIZE;
+ sp->_ESCDELAY = _nc_prescreen._ESCDELAY;
#endif
- }
}
returnSP(sp);
}
NCURSES_EXPORT(int)
setupterm(NCURSES_CONST char *tname, int Filedes, int *errret)
{
+ START_TRACE();
return _nc_setupterm(tname, Filedes, errret, FALSE);
}