X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=madtty%2Fmadtty.h;fp=madtty%2Fmadtty.h;h=373d1f36935a2a7aced4ca6a918e477c48763543;hb=5618d7a42ce62103e5f29da3756b81f57198b22f;hp=d14c09e0faae93c2c21787e29c3eb58cf62b8231;hpb=8f56ed8cb875b860ded79f630d439c953bc4aa4d;p=apps%2Fmadtty.git diff --git a/madtty/madtty.h b/madtty/madtty.h index d14c09e..373d1f3 100644 --- a/madtty/madtty.h +++ b/madtty/madtty.h @@ -249,55 +249,4 @@ void rote_vt_restore_snapshot(RoteTerm *rt, void *snapbuf); * needed, e.g. on a call to rote_vt_forkpty. */ int rote_vt_get_pty_fd(RoteTerm *rt); -/* Declaration of custom escape sequence callback type. See the - * rote_vt_add_es_handler function for more info */ -typedef int (*rote_es_handler_t)(RoteTerm *rt, const char *es); - -/* Installs a custom escape sequence handler for the given RoteTerm. - * The handler will be called by the library every time it tries to - * recognize an escape sequence; depending on the return value of the - * handler, it will proceed in a different manner. See the description - * of the possible return values (ROTE_HANDLERESULT_* constants) below - * for more info. - * - * This handler will be called EACH TIME THE ESCAPE SEQUENCE BUFFER - * RECEIVES A CHARACTER. Therefore, it must execute speedily in order - * not to create too heavy a performance penalty. In particular, the - * writer of the handler should take care to quickly test for invalid - * or incomplete escape sequences before trying to do more elaborate - * parsing. - * - * The handler will NOT be called with an empty escape sequence (i.e. - * one in which only the initial ESC was received). - * - * The custom handler receives the terminal it pertains to and the - * escape sequence as a string (without the initial escape character). - * - * The handler may of course modify the terminal as it sees fit, taking - * care not to corrupt it of course (in particular, it should appropriately - * raise the line_dirty[] and curpos_dirty flags to indicate what it has - * changed). - */ -void rote_vt_install_handler(RoteTerm *rt, rote_es_handler_t handler); - -/* Possible return values for the custom handler function and their - * meanings: */ -#define ROTE_HANDLERESULT_OK 0 /* means escape sequence was handled */ - -#define ROTE_HANDLERESULT_NOTYET 1 /* 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. - */ - -#define ROTE_HANDLERESULT_NOWAY 2 /* means the escape sequence was not - * recognized, and there is no chance - * that it will even if more characters - * are added to it. */ - #endif /* MADTTY_MADTTY_H */