projects
/
apps
/
madtty.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
I want the pty to be seen.
[apps/madtty.git]
/
madtty
/
madtty.c
diff --git
a/madtty/madtty.c
b/madtty/madtty.c
index
f76e743
..
8fbc469
100644
(file)
--- a/
madtty/madtty.c
+++ b/
madtty/madtty.c
@@
-73,7
+73,7
@@
RoteTerm *rote_vt_create(int rows, int cols)
/* allocate private data */
rt->pd = (RoteTermPrivate*)calloc(sizeof(RoteTermPrivate), 1);
/* allocate private data */
rt->pd = (RoteTermPrivate*)calloc(sizeof(RoteTermPrivate), 1);
- rt->p
d->p
ty = -1; /* no pty for now */
+ rt->pty = -1; /* no pty for now */
/* initial scrolling area is the whole window */
rt->pd->scrolltop = 0;
/* initial scrolling area is the whole window */
rt->pd->scrolltop = 0;
@@
-219,19
+219,19
@@
pid_t rote_vt_forkpty(RoteTerm *rt, const char *path, const char *argv[])
ws.ws_col = rt->cols;
ws.ws_xpixel = ws.ws_ypixel = 0;
ws.ws_col = rt->cols;
ws.ws_xpixel = ws.ws_ypixel = 0;
- if (run_process(path, argv, &rt->p
d->p
ty, &rt->childpid)) {
+ if (run_process(path, argv, &rt->pty, &rt->childpid)) {
return -1;
}
return -1;
}
- ioctl(rt->p
d->p
ty, TIOCSWINSZ, &ws);
+ ioctl(rt->pty, TIOCSWINSZ, &ws);
return rt->childpid;
}
void rote_vt_forsake_child(RoteTerm *rt)
{
return rt->childpid;
}
void rote_vt_forsake_child(RoteTerm *rt)
{
- if (rt->p
d->p
ty >= 0)
- close(rt->p
d->p
ty);
- rt->p
d->p
ty = -1;
+ if (rt->pty >= 0)
+ close(rt->pty);
+ rt->pty = -1;
rt->childpid = 0;
}
rt->childpid = 0;
}
@@
-260,17
+260,17
@@
void rote_vt_update(RoteTerm *rt)
int rote_vt_read(RoteTerm *rt, char *buf, int buflen)
{
int rote_vt_read(RoteTerm *rt, char *buf, int buflen)
{
- if (rt->p
d->p
ty < 0) {
+ if (rt->pty < 0) {
errno = EINVAL;
return -1;
}
errno = EINVAL;
return -1;
}
- return read(rt->p
d->p
ty, buf, buflen);
+ return read(rt->pty, buf, buflen);
}
void rote_vt_write(RoteTerm *rt, const char *data, int len)
{
}
void rote_vt_write(RoteTerm *rt, const char *data, int len)
{
- if (rt->p
d->p
ty < 0) {
+ if (rt->pty < 0) {
/* no pty, so just inject the data plain and simple */
rote_vt_inject(rt, data, len);
return;
/* no pty, so just inject the data plain and simple */
rote_vt_inject(rt, data, len);
return;
@@
-279,7
+279,7
@@
void rote_vt_write(RoteTerm *rt, const char *data, int len)
/* write data to pty. Keep calling write() until we have written
* everything. */
while (len > 0) {
/* write data to pty. Keep calling write() until we have written
* everything. */
while (len > 0) {
- int byteswritten = write(rt->p
d->p
ty, data, len);
+ int byteswritten = write(rt->pty, data, len);
if (byteswritten < 0) {
/* very ugly way to inform the error. Improvements welcome! */
static char errormsg[] = "\n(ROTE: pty write() error)\n";
if (byteswritten < 0) {
/* very ugly way to inform the error. Improvements welcome! */
static char errormsg[] = "\n(ROTE: pty write() error)\n";
@@
-317,11
+317,6
@@
void rote_vt_restore_snapshot(RoteTerm *rt, void *snapbuf)
}
}
}
}
-int rote_vt_get_pty_fd(RoteTerm *rt)
-{
- return rt->pd->pty;
-}
-
static const char *keytable[KEY_MAX+1];
static void keytable_init()
static const char *keytable[KEY_MAX+1];
static void keytable_init()