29#define __unused __attribute((unused))
37#define teken_assert(x) \
39 printf("%s:%d *** assertion `%s' failed\n", __FILE__, __FUNC__, #x); \
43#define teken_assert(x)
46#define teken_printf(x,...) do { \
48 printf(x, ## __VA_ARGS__); \
60#define teken_wcwidth(c) ((c <= 0x1B) ? -1 : 1)
62#define teken_wcwidth(c) (1)
66#if defined(TEKEN_XTERM) && defined(TEKEN_UTF8)
69#define teken_scs_process(t, c) (c)
70#define teken_scs_restore(t)
71#define teken_scs_save(t)
72#define teken_scs_set(t, g, ts)
73#define teken_scs_switch(t, g)
77#define TS_FIRSTDIGIT 0x01
79#define TS_AUTOWRAP 0x04
82#define TS_WRAPPED 0x10
84#define TS_WRAPPED 0x00
214#if defined(TEKEN_XTERM) && defined(TEKEN_UTF8)
257 if ((c & 0x80) == 0x00) {
261 }
else if ((c & 0xe0) == 0xc0) {
264 t->t_utf8_partial = c & 0x1f;
265 }
else if ((c & 0xf0) == 0xe0) {
268 t->t_utf8_partial = c & 0x0f;
269 }
else if ((c & 0xf8) == 0xf0) {
272 t->t_utf8_partial = c & 0x07;
273 }
else if ((c & 0xc0) == 0x80) {
274 if (t->t_utf8_left == 0)
277 t->t_utf8_partial = (t->t_utf8_partial << 6) | (c & 0x3f);
278 if (t->t_utf8_left == 0) {
291 const char *c = (
const char *)buf;
366 if (c >=
'0' && c <=
'9') {
380 }
else if (c ==
';') {
A structure containing information about a file.
unsigned int t_nums[T_NUMSIZE]
const teken_funcs_t * t_funcs
teken_attr_t t_saved_curattr
unsigned int t_stateflags
teken_state_t * t_nextstate
teken_pos_t t_saved_cursor
tf_putchar_t * tf_putchar
tf_respond_t * tf_respond
static void teken_funcs_bell(teken_t *t)
static void teken_funcs_respond(teken_t *t, const void *buf, size_t len)
void teken_init(teken_t *t, const teken_funcs_t *tf, void *softc)
static int teken_state_numbers(teken_t *t, teken_char_t c)
static void teken_input_byte(teken_t *t, unsigned char c)
static void teken_state_switch(teken_t *t, teken_state_t *s)
void teken_input(teken_t *t, const void *buf, size_t len)
void teken_set_winsize(teken_t *t, const teken_pos_t *p)
static void teken_funcs_param(teken_t *t, int cmd, unsigned int value)
void teken_set_cursor(teken_t *t, const teken_pos_t *p)
static void teken_input_char(teken_t *t, teken_char_t c)
void teken_set_curattr(teken_t *t, const teken_attr_t *a)
static teken_state_t teken_state_init
void teken_set_defattr(teken_t *t, const teken_attr_t *a)
const teken_attr_t * teken_get_curattr(teken_t *t)
static void teken_funcs_putchar(teken_t *t, const teken_pos_t *p, teken_char_t c, const teken_attr_t *a)
const teken_attr_t * teken_get_defattr(teken_t *t)
#define teken_printf(x,...)
#define teken_scs_switch(t, g)
static void teken_funcs_fill(teken_t *t, const teken_rect_t *r, const teken_char_t c, const teken_attr_t *a)
static void teken_funcs_cursor(teken_t *t)
static void teken_funcs_copy(teken_t *t, const teken_rect_t *r, const teken_pos_t *p)
void teken_state_t(teken_t *, teken_char_t)
unsigned char teken_char_t
static void teken_subr_newline(teken_t *t)
static void teken_subr_newpage(teken_t *t)
static void teken_subr_horizontal_tab(teken_t *t)
static void teken_subr_do_reset(teken_t *t)
static void teken_subr_backspace(teken_t *t)
static void teken_subr_carriage_return(teken_t *t)
static void teken_subr_bell(teken_t *t)