version 1.18, 2004/02/20 20:34:32 |
version 1.19, 2004/05/26 18:17:58 |
|
|
* get a file from the remote host |
* get a file from the remote host |
*/ |
*/ |
void |
void |
getfl(c) |
getfl(char c) |
char c; |
|
{ |
{ |
char buf[256], *cp, *expand(); |
char buf[256], *cp, *expand(); |
|
|
|
|
* Cu-like take command |
* Cu-like take command |
*/ |
*/ |
void |
void |
cu_take(cc) |
cu_take(char cc) |
char cc; |
|
{ |
{ |
int fd, argc; |
int fd, argc; |
char line[BUFSIZ], *expand(), *cp; |
char line[BUFSIZ], *expand(), *cp; |
|
|
|
|
parwrite(FD, buf, size(buf)); |
parwrite(FD, buf, size(buf)); |
quit = 0; |
quit = 0; |
kill(pid, SIGIOT); |
kill(tipout_pid, SIGIOT); |
read(repdes[0], (char *)&ccc, 1); /* Wait until read process stops */ |
read(repdes[0], (char *)&ccc, 1); /* Wait until read process stops */ |
|
|
/* |
/* |
|
|
time_t start_t, stop_t; |
time_t start_t, stop_t; |
sig_t f; |
sig_t f; |
|
|
kill(pid, SIGIOT); /* put TIPOUT into a wait state */ |
kill(tipout_pid, SIGIOT); /* put TIPOUT into a wait state */ |
stop = 0; |
stop = 0; |
f = signal(SIGINT, stopsnd); |
f = signal(SIGINT, stopsnd); |
tcsetattr(0, TCSAFLUSH, &defchars); |
tcsetattr(0, TCSAFLUSH, &defchars); |
|
|
* wait for echo & handle timeout |
* wait for echo & handle timeout |
*/ |
*/ |
void |
void |
send(c) |
send(int c) |
int c; |
|
{ |
{ |
char cc; |
char cc; |
int retry = 0; |
int retry = 0; |
|
|
putchar(c); |
putchar(c); |
if (prompt("Local command? ", buf, sizeof(buf))) |
if (prompt("Local command? ", buf, sizeof(buf))) |
return; |
return; |
kill(pid, SIGIOT); /* put TIPOUT into a wait state */ |
kill(tipout_pid, SIGIOT); /* put TIPOUT into a wait state */ |
signal(SIGINT, SIG_IGN); |
signal(SIGINT, SIG_IGN); |
signal(SIGQUIT, SIG_IGN); |
signal(SIGQUIT, SIG_IGN); |
tcsetattr(0, TCSAFLUSH, &defchars); |
tcsetattr(0, TCSAFLUSH, &defchars); |
|
|
* 2 <-> local tty out |
* 2 <-> local tty out |
*/ |
*/ |
void |
void |
consh(c) |
consh(int c) |
{ |
{ |
char buf[256]; |
char buf[256]; |
int status, p; |
int status, p; |
|
|
putchar(c); |
putchar(c); |
if (prompt("Local command? ", buf, sizeof(buf))) |
if (prompt("Local command? ", buf, sizeof(buf))) |
return; |
return; |
kill(pid, SIGIOT); /* put TIPOUT into a wait state */ |
kill(tipout_pid, SIGIOT); /* put TIPOUT into a wait state */ |
signal(SIGINT, SIG_IGN); |
signal(SIGINT, SIG_IGN); |
signal(SIGQUIT, SIG_IGN); |
signal(SIGQUIT, SIG_IGN); |
tcsetattr(0, TCSAFLUSH, &defchars); |
tcsetattr(0, TCSAFLUSH, &defchars); |
|
|
* Escape to local shell |
* Escape to local shell |
*/ |
*/ |
void |
void |
shell() |
shell(void) |
{ |
{ |
int status; |
int status; |
char *cp; |
char *cp; |
|
|
/* |
/* |
* enable TIPOUT side for dialogue |
* enable TIPOUT side for dialogue |
*/ |
*/ |
kill(pid, SIGEMT); |
kill(tipout_pid, SIGEMT); |
if (boolean(value(SCRIPT))) |
if (boolean(value(SCRIPT))) |
write(fildes[1], value(RECORD), size(value(RECORD))); |
write(fildes[1], value(RECORD), size(value(RECORD))); |
write(fildes[1], "\n", 1); |
write(fildes[1], "\n", 1); |
|
|
char *msg; |
char *msg; |
{ |
{ |
|
|
kill(pid, SIGTERM); |
kill(tipout_pid, SIGTERM); |
disconnect(msg); |
disconnect(msg); |
if (msg != NOSTR) |
if (msg != NOSTR) |
printf("\r\n%s", msg); |
printf("\r\n%s", msg); |
|
|
vlex(buf); |
vlex(buf); |
if (vtable[BEAUTIFY].v_access&CHANGED) { |
if (vtable[BEAUTIFY].v_access&CHANGED) { |
vtable[BEAUTIFY].v_access &= ~CHANGED; |
vtable[BEAUTIFY].v_access &= ~CHANGED; |
kill(pid, SIGSYS); |
kill(tipout_pid, SIGSYS); |
} |
} |
if (vtable[SCRIPT].v_access&CHANGED) { |
if (vtable[SCRIPT].v_access&CHANGED) { |
vtable[SCRIPT].v_access &= ~CHANGED; |
vtable[SCRIPT].v_access &= ~CHANGED; |