#include <curses.h> /* for bool typedef */
#include <dump_entry.h>
-MODULE_ID("$Id: tset.c,v 0.31 1998/02/11 12:14:02 tom Exp $")
+MODULE_ID("$Id: tset.c,v 0.37 1999/03/14 12:30:02 tom Exp $")
extern char **environ;
}
#if !HAVE_STRDUP
-static char *strdup (char *s)
-{
- char *p;
-
- p = malloc(strlen(s)+1);
- if (p)
- strcpy(p,s);
- return(p);
-}
+#define strdup _nc_strdup
+extern char *_nc_strdup(const char *);
#endif /* not HAVE_STRDUP */
static void
const char *porttype; /* Port type, or "" for any. */
const char *type; /* Terminal type to select. */
int conditional; /* Baud rate conditionals bitmask. */
- int speed; /* Baud rate to compare against. */
+ speed_t speed; /* Baud rate to compare against. */
} MAP;
static MAP *cur, *maplist;
char *base = 0;
copy = strdup(arg);
- mapp = malloc((u_int)sizeof(MAP));
+ mapp = malloc(sizeof(MAP));
if (copy == 0 || mapp == 0)
failed("malloc");
mapp->next = 0;
* ttype now contains a pointer to the type of the terminal.
* If the first character is '?', ask the user.
*/
- if (ttype[0] == '?')
+ if (ttype[0] == '?') {
if (ttype[1] != '\0')
ttype = askuser(ttype + 1);
else
ttype = askuser(0);
-
+ }
/* Find the terminfo entry. If it doesn't exist, ask the user. */
- while ((rval = setupterm(ttype, STDOUT_FILENO, &errret)) != OK) {
+ while ((rval = setupterm((NCURSES_CONST char *)ttype, STDOUT_FILENO, &errret)) != OK) {
if (errret == 0) {
(void)fprintf(stderr, "tset: unknown terminal type %s\n",
ttype);
ttype = 0;
}
else {
- (void)fprintf(stderr, "tset: can't initialize terminal\
- type %s (error %d)\n", ttype, errret);
+ (void)fprintf(stderr, "tset: can't initialize terminal type %s (error %d)\n", ttype, errret);
ttype = 0;
}
ttype = askuser(ttype);
* Tell the user if a control key has been changed from the default value.
*/
static void
-report(const char *name, int which, u_int def)
+report(const char *name, int which, unsigned def)
{
#ifdef TERMIOS
- u_int older, newer;
+ unsigned older, newer;
char *p;
newer = mode.c_cc[which];
if (newer == 0177)
(void)fprintf(stderr, "delete.\n");
else if ((p = key_backspace) != 0
- && newer == (u_int)p[0]
+ && newer == (unsigned char)p[0]
&& p[1] == '\0')
(void)fprintf(stderr, "backspace.\n");
else if (newer < 040) {