1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 20:42:48 -05:00

pterm now uses the new uxsel module, so it's one step closer to

being able to be a PuTTY as well as a pterm. In the process I've
also moved icky things like actually reading from the pty fd and
printing the `terminated on signal' messages into pty.c where they
obviously should have been in the first place. Also there's been one
interesting repercussion in the terminal code: terminal.c's
from_backend now calls term_out() directly rather than expecting the
front end to call it afterwards. This has had the entertaining side
effect of fixing a Windows-specific bug whereby activity in a port
forwarding through a PuTTY with a blinking cursor caused the cursor
to blink to ON (!!!!). So, a surprisingly far-reaching checkin as it
turns out...

[originally from svn r3017]
This commit is contained in:
Simon Tatham
2003-03-29 18:30:14 +00:00
parent 54d5f41c95
commit 5107780c54
9 changed files with 183 additions and 109 deletions

View File

@ -19,6 +19,7 @@ struct fd {
int fd;
int rwx; /* 4=except 2=write 1=read */
uxsel_callback_fn callback;
int id; /* for uxsel_input_remove */
};
static tree234 *fds;
@ -70,17 +71,20 @@ void uxsel_set(int fd, int rwx, uxsel_callback_fn callback)
oldfd = find234(fds, newfd, NULL);
if (oldfd) {
uxsel_input_remove(oldfd->id);
del234(fds, oldfd);
sfree(oldfd);
}
add234(fds, newfd);
newfd->id = uxsel_input_add(fd, rwx);
}
void uxsel_del(int fd)
{
struct fd *oldfd = find234(fds, &fd, uxsel_fd_findcmp);
if (oldfd) {
uxsel_input_remove(oldfd->id);
del234(fds, oldfd);
sfree(oldfd);
}