Sent3270TerminalType
= 0;
init_ctlr(); /* Initialize some things */
#endif /* defined(TN3270) */
* DataToNetwork - queue up some data to go to network. If "done" is set,
* then when last byte is queued, we add on an IAC EOR sequence (so,
* don't call us with "done" until you want that done...)
* We actually do send all the data to the network buffer, since our
* only client needs for us to do that.
DataToNetwork(buffer
, count
, done
)
register char *buffer
; /* where the data is */
register int count
; /* how much to send */
int done
; /* is this the last of a logical block */
if ((netobuf
+sizeof netobuf
- nfrontp
) < 6) {
while ((netobuf
+sizeof netobuf
- nfrontp
) < 6) {
(void) select(net
+1, (fd_set
*) 0, &o
, (fd_set
*) 0,
netflush(); /* try to move along as quickly as ... */
return(origCount
- count
);
#endif /* defined(unix) */
* The following routines are places where the various tn3270
* routines make calls into telnet.c.
/* TtyChars() - returns the number of characters in the TTY buffer */
/* DataToTerminal - queue up some data to go to terminal. */
DataToTerminal(buffer
, count
)
register char *buffer
; /* where the data is */
register int count
; /* how much to send */
#endif /* defined(unix) */
if (tfrontp
>= ttyobuf
+sizeof ttyobuf
) {
while (tfrontp
>= ttyobuf
+sizeof ttyobuf
) {
(void) select(tout
+1, (fd_set
*) 0, &o
, (fd_set
*) 0,
#endif /* defined(unix) */
return(origCount
- count
);
/* EmptyTerminal - called to make sure that the terminal buffer is empty.
* Note that we consider the buffer to run all the
* way to the kernel (thus the select).
#endif /* defined(unix) */
(void) select(tout
+1, (int *) 0, &o
, (int *) 0,
(struct timeval
*) 0); /* wait for TTLOWAT */
#endif /* defined(unix) */
while (tfrontp
!= tbackp
) {
(void) select(tout
+1, (int *) 0, &o
, (int *) 0,
(struct timeval
*) 0); /* wait for TTLOWAT */
#endif /* defined(unix) */
* Push3270 - Try to send data along the 3270 output (to screen) direction.
if (Ifrontp
+scc
> Ibuf
+sizeof Ibuf
) {
memcpy(Ibuf
, Ibackp
, Ifrontp
-Ibackp
);
Ifrontp
-= (Ibackp
-Ibuf
);
if (Ifrontp
+scc
< Ibuf
+sizeof Ibuf
) {
* Finish3270 - get the last dregs of 3270 data out to the terminal
while (Push3270() || !DoTerminalOutput()) {
#endif /* defined(unix) */
/* StringToTerminal - output a null terminated string to the terminal */
(void) DataToTerminal(s
, count
); /* we know it always goes... */
#if ((!defined(NOT43)) || defined(PUTCHAR))
/* _putchar - output a single character to the terminal. This name is so that
* curses(3x) can call us to send out data.
if (tfrontp
>= ttyobuf
+sizeof ttyobuf
) {
(void) DataToTerminal(&c
, 1);
*tfrontp
++ = c
; /* optimize if possible. */
#endif /* ((!defined(NOT43)) || defined(PUTCHAR)) */
#endif /* defined(TN3270) */