version 1.17, 2010/09/11 15:43:11 |
version 1.18, 2010/09/11 16:19:22 |
|
|
u_int i; |
u_int i; |
int n, error; |
int n, error; |
char *s; |
char *s; |
|
const char *acs; |
|
|
SLIST_FOREACH(term, &tty_terms, entry) { |
SLIST_FOREACH(term, &tty_terms, entry) { |
if (strcmp(term->name, name) == 0) { |
if (strcmp(term->name, name) == 0) { |
|
|
term->name = xstrdup(name); |
term->name = xstrdup(name); |
term->references = 1; |
term->references = 1; |
term->flags = 0; |
term->flags = 0; |
memset(&term->codes, 0, sizeof term->codes); |
memset(term->codes, 0, sizeof term->codes); |
SLIST_INSERT_HEAD(&tty_terms, term, entry); |
SLIST_INSERT_HEAD(&tty_terms, term, entry); |
|
|
/* Set up curses terminal. */ |
/* Set up curses terminal. */ |
|
|
*/ |
*/ |
if (!tty_term_flag(term, TTYC_XENL)) |
if (!tty_term_flag(term, TTYC_XENL)) |
term->flags |= TERM_EARLYWRAP; |
term->flags |= TERM_EARLYWRAP; |
|
|
|
/* Generate ACS table. If none is present, use nearest ASCII. */ |
|
memset(term->acs, 0, sizeof term->acs); |
|
if (tty_term_has(term, TTYC_ACSC)) |
|
acs = tty_term_string(term, TTYC_ACSC); |
|
else |
|
acs = "a#j+k+l+m+n+o-p-q-r-s-t+u+v+w+x|y<z>~."; |
|
for (; acs[0] != '\0' && acs[1] != '\0'; acs += 2) |
|
term->acs[(u_char) acs[0]][0] = acs[1]; |
|
|
return (term); |
return (term); |
|
|