X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=madtty%2Fmadtty.h;h=69d7288a3079a0521d7e741d39745d2816ebb60a;hb=d0e48d929c19d39c4a13e57e0f8a8dd6194d6dde;hp=373d1f36935a2a7aced4ca6a918e477c48763543;hpb=5618d7a42ce62103e5f29da3756b81f57198b22f;p=apps%2Fmadtty.git diff --git a/madtty/madtty.h b/madtty/madtty.h index 373d1f3..69d7288 100644 --- a/madtty/madtty.h +++ b/madtty/madtty.h @@ -118,6 +118,7 @@ typedef struct RoteTerm_ { * that will be used for newly inserted * characters */ + int pty; /* pty of the process */ pid_t childpid; /* pid of the child process running in the * terminal; 0 for none. This is READ-ONLY. */ @@ -166,7 +167,7 @@ void rote_vt_destroy(RoteTerm *rt); * to execute the command and will exit with status 127. You can catch * that by installing a SIGCHLD handler if you want. */ -pid_t rote_vt_forkpty(RoteTerm *rt, const char *command); +pid_t rote_vt_forkpty(RoteTerm *rt, const char *path, const char *argv[]); /* Disconnects the RoteTerm from its forked child process. This function * should be called when the child process dies or something of the sort. @@ -183,6 +184,8 @@ void rote_vt_forsake_child(RoteTerm *rt); * read from the child process it will return immediately. */ void rote_vt_update(RoteTerm *rt); +int rote_vt_read(RoteTerm *rt, char *buf, int buflen); + /* Puts data into the terminal: if there is a forked process running, * the data will be sent to it. If there is no forked process, * the data will simply be injected into the terminal (as in @@ -240,13 +243,4 @@ void *rote_vt_take_snapshot(RoteTerm *rt); * This function does NOT free() the passed buffer */ void rote_vt_restore_snapshot(RoteTerm *rt, void *snapbuf); -/* Returns the pseudo tty descriptor associated with the given terminal. - * Please don't do weird things with it (like close it for instance), - * or things will break - * - * This function returns -1 if the given terminal does not yet have - * an associated pty. A pty is only associated to a terminal when - * needed, e.g. on a call to rote_vt_forkpty. */ -int rote_vt_get_pty_fd(RoteTerm *rt); - #endif /* MADTTY_MADTTY_H */