From: btakahashi Date: Fri, 8 Jul 2005 01:34:09 +0000 (+0000) Subject: Added rote_vt_get_pty_fd function X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=7f23e2cf7b485ba8c4a66ccc2ee7fc4ee8172109;p=apps%2Fmadtty.git Added rote_vt_get_pty_fd function --- diff --git a/configure.ac b/configure.ac index 8070a62..ec486c5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([rote], 0.2.7) +AC_INIT([rote], 0.2.8) AC_SUBST(PACKAGE_NAME) AC_SUBST(PACKAGE_VERSION) diff --git a/rote.c b/rote.c index 322e8eb..6d61820 100644 --- a/rote.c +++ b/rote.c @@ -237,4 +237,7 @@ void rote_vt_restore_snapshot(RoteTerm *rt, void *snapbuf) { } } +int rote_vt_get_pty_fd(RoteTerm *rt) { + return rt->pd->pty; +} diff --git a/rote.h b/rote.h index a4f6b3e..62846d6 100644 --- a/rote.h +++ b/rote.h @@ -240,6 +240,15 @@ 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); + /* 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);