X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=madtty%2Fmadtty.h;h=0a1e451b0496b89ac86c6a6fcb4d3f1989574180;hb=5e8bd7606f26abce289b94c905db65487926bc9c;hp=8e8424a69afa4d4c5842f8d4ae4010fc2a3d8549;hpb=6be1cb501cb582f98b6d800d7adfd7a42677ea77;p=apps%2Fmadtty.git diff --git a/madtty/madtty.h b/madtty/madtty.h index 8e8424a..0a1e451 100644 --- a/madtty/madtty.h +++ b/madtty/madtty.h @@ -30,11 +30,31 @@ #include #include +enum { + /* means escape sequence was handled */ + MADTTY_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). + * + * The library will thus continue collecting characters + * and calling the handler as each character arrives until + * either OK or NOWAY is returned. + */ + MADTTY_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. + */ + MADTTY_HANDLER_NOWAY +}; + typedef struct madtty_t madtty_t; +typedef int (*madtty_handler_t)(madtty_t *, char *es); void madtty_init_colors(void); void madtty_init_vt100_graphics(void); - +void madtty_set_handler(madtty_t *, madtty_handler_t); int madtty_color_pair(int fg, int bg); madtty_t *madtty_create(int rows, int cols);