version 1.19, 2011/01/01 03:32:28 |
version 1.20, 2011/01/26 00:11:47 |
|
|
void tty_term_override(struct tty_term *, const char *); |
void tty_term_override(struct tty_term *, const char *); |
char *tty_term_strip(const char *); |
char *tty_term_strip(const char *); |
|
|
struct tty_terms tty_terms = SLIST_HEAD_INITIALIZER(tty_terms); |
struct tty_terms tty_terms = LIST_HEAD_INITIALIZER(tty_terms); |
|
|
const struct tty_term_code_entry tty_term_codes[NTTYCODE] = { |
const struct tty_term_code_entry tty_term_codes[NTTYCODE] = { |
{ TTYC_ACSC, TTYCODE_STRING, "acsc" }, |
{ TTYC_ACSC, TTYCODE_STRING, "acsc" }, |
|
|
char *s; |
char *s; |
const char *acs; |
const char *acs; |
|
|
SLIST_FOREACH(term, &tty_terms, entry) { |
LIST_FOREACH(term, &tty_terms, entry) { |
if (strcmp(term->name, name) == 0) { |
if (strcmp(term->name, name) == 0) { |
term->references++; |
term->references++; |
return (term); |
return (term); |
|
|
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); |
LIST_INSERT_HEAD(&tty_terms, term, entry); |
|
|
/* Set up curses terminal. */ |
/* Set up curses terminal. */ |
if (setupterm(name, fd, &error) != OK) { |
if (setupterm(name, fd, &error) != OK) { |
|
|
if (--term->references != 0) |
if (--term->references != 0) |
return; |
return; |
|
|
SLIST_REMOVE(&tty_terms, term, tty_term, entry); |
LIST_REMOVE(term, entry); |
|
|
for (i = 0; i < NTTYCODE; i++) { |
for (i = 0; i < NTTYCODE; i++) { |
if (term->codes[i].type == TTYCODE_STRING) |
if (term->codes[i].type == TTYCODE_STRING) |