diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-03-02 06:23:57 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-03-02 06:23:57 +0000 |
commit | e52ae7d7cb3b9267a450ee786b056b14391f2f50 (patch) | |
tree | 852bbb003a1438d75ce8016c9feef856d56fd2fd /lib/libcurses/tinfo/lib_setup.c | |
parent | aedffcef562be3c46e9a21641c0a65c968b1d889 (diff) |
ncurses-4.2-990301
Diffstat (limited to 'lib/libcurses/tinfo/lib_setup.c')
-rw-r--r-- | lib/libcurses/tinfo/lib_setup.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/libcurses/tinfo/lib_setup.c b/lib/libcurses/tinfo/lib_setup.c index 7ff479cca77..f496c05f992 100644 --- a/lib/libcurses/tinfo/lib_setup.c +++ b/lib/libcurses/tinfo/lib_setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_setup.c,v 1.2 1999/01/22 04:50:43 millert Exp $ */ +/* $OpenBSD: lib_setup.c,v 1.3 1999/03/02 06:23:29 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -43,6 +43,7 @@ #include <curses.priv.h> #include <tic.h> /* for MAX_NAME_SIZE */ +#include <term_entry.h> #if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -50,7 +51,7 @@ #include <term.h> /* lines, columns, cur_term */ -MODULE_ID("$From: lib_setup.c,v 1.48 1999/01/02 23:11:56 tom Exp $") +MODULE_ID("$From: lib_setup.c,v 1.51 1999/02/27 22:13:00 tom Exp $") /**************************************************************************** * @@ -263,11 +264,11 @@ static int grab_entry(const char *const tn, TERMTYPE *const tp) * a string is cancelled, for merging entries). */ if (status == 1) { - unsigned n; - for (n = 0; n < BOOLCOUNT; n++) + int n; + for_each_boolean(n,tp) if (!VALID_BOOLEAN(tp->Booleans[n])) tp->Booleans[n] = FALSE; - for (n = 0; n < STRCOUNT; n++) + for_each_string(n,tp) if (tp->Strings[n] == CANCELLED_STRING) tp->Strings[n] = ABSENT_STRING; } @@ -323,7 +324,7 @@ int status; if (fallback) { - memcpy(&term_ptr->type, fallback, sizeof(TERMTYPE)); + term_ptr->type = *fallback; status = 1; } } @@ -380,7 +381,7 @@ int status; static void do_prototype(void) { -int i, j; +int i; char CC; char proto; char *tmp; @@ -389,12 +390,10 @@ char *tmp; CC = *tmp; proto = *command_character; - for (i=0; i < STRCOUNT; i++) { - j = 0; - while (cur_term->type.Strings[i][j]) { - if (cur_term->type.Strings[i][j] == proto) - cur_term->type.Strings[i][j] = CC; - j++; - } + for_each_string(i, &(cur_term->type)) { + for (tmp = cur_term->type.Strings[i]; *tmp; tmp++) { + if (*tmp == proto) + *tmp = CC; + } } } |