X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=madtty%2Fmadtty.h;fp=madtty%2Fmadtty.h;h=cd9e7d4d07d2c9b3644bcceed0bd1cde1c20d6a7;hb=c3f780f9456ff7adde5b8041596e200a9b41c588;hp=edecde95de7b78bfb267dce3ca93f81189f0b38f;hpb=2ce3ba8535147bd21ce80c140afb13083dd5d289;p=apps%2Fmadtty.git diff --git a/madtty/madtty.h b/madtty/madtty.h index edecde9..cd9e7d4 100644 --- a/madtty/madtty.h +++ b/madtty/madtty.h @@ -30,51 +30,19 @@ #include #include -#define MAX_CSI_ES_PARAMS 32 - -typedef struct mtty_row_t mtty_row_t; - -typedef struct { - int pty; - pid_t childpid; - - /* flags */ - unsigned seen_input : 1; - unsigned insert : 1; - unsigned escaped : 1; - unsigned graphmode : 1; - unsigned curshid : 1; - - /* geometry */ - int rows, cols; - - mtty_row_t *lines; - mtty_row_t *scroll_top; - mtty_row_t *scroll_bot; - - /* cursor */ - unsigned curattrs; - mtty_row_t *curs_row; - int curs_col; - int curs_srow, curs_scol; - - /* buffers and parsing state */ - mbstate_t ps; - char rbuf[BUFSIZ]; - char ebuf[BUFSIZ]; - int rlen, elen; -} madtty_t; - void madtty_initialize(void); -madtty_t *madtty_create(int rows, int cols); -void madtty_resize(madtty_t *rt, int rows, int cols); -void madtty_destroy(madtty_t *rt); -pid_t madtty_forkpty(madtty_t *rt, const char *path, const char *argv[]); +typedef struct madtty_t madtty_t; -int madtty_process(madtty_t *rt); -void madtty_keypress(madtty_t *rt, int keycode); -void madtty_draw(madtty_t *rt, WINDOW *win, int startrow, int startcol); +madtty_t *madtty_create(int rows, int cols); +void madtty_resize(madtty_t *, int rows, int cols); +void madtty_destroy(madtty_t *); +pid_t madtty_forkpty(madtty_t *, const char *, const char *argv[], int *pty); +int madtty_getpty(madtty_t *); + +int madtty_process(madtty_t *); +void madtty_keypress(madtty_t *, int keycode); +void madtty_draw(madtty_t *, WINDOW *win, int startrow, int startcol); #endif /* MADTTY_MADTTY_H */