dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit c16ea5c1b8869a78a2ea8337df4a9a2b7f45d206
parent eab8d2f39bd4d51d473b58b2276468b9b785f919
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Sat, 24 Sep 2011 08:50:41 +0200

vt: rename custom sequence handler

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
vt.c | 14+++++++-------
vt.h | 10+++++-----
2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/vt.c b/vt.c @@ -139,7 +139,7 @@ struct Vt { vt_event_handler_t event_handler; /* custom escape sequence handler */ - vt_handler_t handler; + vt_escseq_handler_t escseq_handler; void *data; }; @@ -854,12 +854,12 @@ static void try_interpret_escape_seq(Vt *t) if (!*t->ebuf) return; - if (t->handler) { - switch ((*(t->handler)) (t, t->ebuf)) { - case VT_HANDLER_OK: + if (t->escseq_handler) { + switch ((*(t->escseq_handler)) (t, t->ebuf)) { + case VT_ESCSEQ_HANDLER_OK: cancel_escape_sequence(t); return; - case VT_HANDLER_NOTYET: + case VT_ESCSEQ_HANDLER_NOTYET: if (t->elen + 1 >= sizeof(t->ebuf)) goto cancel; return; @@ -1579,9 +1579,9 @@ void vt_init(void) is_utf8_locale(); } -void vt_set_handler(Vt *t, vt_handler_t handler) +void vt_set_escseq_handler(Vt *t, vt_escseq_handler_t handler) { - t->handler = handler; + t->escseq_handler = handler; } void vt_set_event_handler(Vt *t, vt_event_handler_t handler) diff --git a/vt.h b/vt.h @@ -33,7 +33,7 @@ enum { /* means escape sequence was handled */ - VT_HANDLER_OK, + VT_ESCSEQ_HANDLER_OK, /* means the escape sequence was not recognized yet, but * there is hope that it still will once more characters * arrive (i.e. it is not yet complete). @@ -42,16 +42,16 @@ enum { * and calling the handler as each character arrives until * either OK or NOWAY is returned. */ - VT_HANDLER_NOTYET, + VT_ESCSEQ_HANDLER_NOTYET, /* means the escape sequence was not recognized, and there * is no chance that it will even if more characters are * added to it. */ - VT_HANDLER_NOWAY + VT_ESCSEQ_HANDLER_NOWAY }; typedef struct Vt Vt; -typedef int (*vt_handler_t)(Vt *, char *es); +typedef int (*vt_escseq_handler_t)(Vt *, char *es); enum { VT_EVENT_TITLE, @@ -60,7 +60,7 @@ enum { typedef void (*vt_event_handler_t)(Vt *, int event, void *data); void vt_init(void); -void vt_set_handler(Vt *, vt_handler_t); +void vt_set_escseq_handler(Vt *, vt_escseq_handler_t); void vt_set_event_handler(Vt *, vt_event_handler_t); void vt_set_data(Vt *, void *); void *vt_get_data(Vt *);