Tidy up the way terminals are described and move some structs out of tmux.h.

This commit is contained in:
nicm
2015-07-28 15:18:10 +00:00
parent d33adc4fd0
commit b254115acd
4 changed files with 277 additions and 267 deletions

32
tmux.h
View File

@ -387,32 +387,6 @@ enum tty_code_code {
TTYC_XENL, /* eat_newline_glitch, xn */
TTYC_XT, /* xterm(1)-compatible title, XT */
};
#define NTTYCODE (TTYC_XT + 1)
/* Termcap types. */
enum tty_code_type {
TTYCODE_NONE = 0,
TTYCODE_STRING,
TTYCODE_NUMBER,
TTYCODE_FLAG,
};
/* Termcap code. */
struct tty_code {
enum tty_code_type type;
union {
char *string;
int number;
int flag;
} value;
};
/* Entry in terminal code table. */
struct tty_term_code_entry {
enum tty_code_code code;
enum tty_code_type type;
const char *name;
};
/* Message codes. */
enum msgtype {
@ -1096,13 +1070,14 @@ struct tty_key {
struct tty_key *next;
};
struct tty_code;
struct tty_term {
char *name;
u_int references;
char acs[UCHAR_MAX + 1][2];
struct tty_code codes[NTTYCODE];
struct tty_code *codes;
#define TERM_256COLOURS 0x1
#define TERM_EARLYWRAP 0x2
@ -1643,7 +1618,7 @@ void tty_bell(struct tty *);
/* tty-term.c */
extern struct tty_terms tty_terms;
extern const struct tty_term_code_entry tty_term_codes[NTTYCODE];
u_int tty_term_ncodes(void);
struct tty_term *tty_term_find(char *, int, char **);
void tty_term_free(struct tty_term *);
int tty_term_has(struct tty_term *, enum tty_code_code);
@ -1657,6 +1632,7 @@ const char *tty_term_ptr2(struct tty_term *, enum tty_code_code,
const void *, const void *);
int tty_term_number(struct tty_term *, enum tty_code_code);
int tty_term_flag(struct tty_term *, enum tty_code_code);
const char *tty_term_describe(struct tty_term *, enum tty_code_code);
/* tty-acs.c */
const char *tty_acs_get(struct tty *, u_char);