/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
char *ttyname(int fd);
#endif
-MODULE_ID("$Id: tset.c,v 1.123 2020/08/29 23:32:18 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.128 2021/04/03 23:03:48 tom Exp $")
#ifndef environ
extern char **environ;
#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))
-static void exit_error(void) GCC_NORETURN;
+static GCC_NORETURN void exit_error(void);
static int
CaselessCmp(const char *a, const char *b)
return LOWERCASE(*a) - LOWERCASE(*b);
}
-static void
+static GCC_NORETURN void
exit_error(void)
{
restore_tty_settings();
/* NOTREACHED */
}
-static void
+static GCC_NORETURN void
err(const char *fmt, ...)
{
va_list ap;
/* NOTREACHED */
}
-static void
+static GCC_NORETURN void
failed(const char *msg)
{
char temp[BUFSIZ];
askuser(const char *dflt)
{
static char answer[256];
- char *p;
/* We can get recalled; if so, don't continue uselessly. */
clearerr(stdin);
exit_error();
/* NOTREACHED */
}
+
for (;;) {
+ char *p;
+
if (dflt)
(void) fprintf(stderr, "Terminal type? [%s] ", dflt);
else
int speed;
} SPEEDS;
-#if (defined(_WIN32) || defined(_WIN64))
-static const SPEEDS speeds[] = { { "0", 0 } };
+#if defined(EXP_WIN32_DRIVER)
+static const SPEEDS speeds[] =
+{
+ {"0", 0}
+};
#else
static const SPEEDS speeds[] =
{
bool opt_w = FALSE; /* set window-size */
TTY mode, oldmode;
- my_fd = STDERR_FILENO;
obsolete(argv);
noinit = noset = quiet = Sflag = sflag = showterm = 0;
while ((ch = getopt(argc, argv, "a:cd:e:Ii:k:m:p:qQrSsVw")) != -1) {
oldmode = mode;
#ifdef TERMIOS
ospeed = (NCURSES_OSPEED) cfgetospeed(&mode);
-#elif (defined(_WIN32) || defined(_WIN64))
+#elif defined(EXP_WIN32_DRIVER)
ospeed = 0;
#else
ospeed = (NCURSES_OSPEED) mode.sg_ospeed;