int win_width, win_height;
#endif
/* same buffer used both for network and console read/write */
- char buf[DATABUFSIZE]; /* allocating so static size is smaller */
+ char buf[DATABUFSIZE];
+ /* buffer to handle telnet negotiations */
char iacbuf[IACBUFSIZE];
struct termios termios_def;
struct termios termios_raw;
#define write_str(fd, str) write(fd, str, sizeof(str) - 1)
-static void /* buffer to handle telnet negotiations */
-doexit(int ev)
+static void doexit(int ev)
{
cookmode();
exit(ev);
G.gotsig = 0;
}
+
static void handlenetoutput(int len)
{
/* here we could do smart tricks how to handle 0xFF:s in output
write(G.netfd, outbuf, j);
}
-
static void handlenetinput(int len)
{
int i;
write(1, G.buf, len);
}
-
-/* ******************************* */
-
static void putiac(int c)
{
G.iacbuf[G.iaclen++] = c;
}
-
static void putiac2(byte wwdd, byte c)
{
if (G.iaclen + 3 > IACBUFSIZE)
}
#endif
-/* void putiacstring (subneg strings) */
-
-/* ******************************* */
-
static char const escapecharis[] = "\r\nEscape character is ";
static void setConMode(void)
{
- if (G.telflags & UF_ECHO)
- {
+ if (G.telflags & UF_ECHO) {
if (G.charmode == CHM_TRY) {
G.charmode = CHM_ON;
printf("\r\nEntering character mode%s'^]'.\r\n", escapecharis);
rawmode();
}
- }
- else
- {
+ } else {
if (G.charmode != CHM_OFF) {
G.charmode = CHM_OFF;
printf("\r\nEntering line mode%s'^C'.\r\n", escapecharis);
}
}
-/* ******************************* */
-
static void will_charmode(void)
{
G.charmode = CHM_TRY;
iacflush();
}
-/* ******************************* */
-
static void to_notsup(char c)
{
if (G.telwish == WILL)
}
}
-
-/* ******************************* */
-
/* subnegotiation -- ignore all (except TTYPE,NAWS) */
-
static int subneg(byte c)
{
switch (G.telstate) {
return FALSE;
}
-/* ******************************* */
-
static void fgotsig(int sig)
{
G.gotsig = sig;
static void rawmode(void)
{
- if (G.do_termios) tcsetattr(0, TCSADRAIN, &G.termios_raw);
+ if (G.do_termios)
+ tcsetattr(0, TCSADRAIN, &G.termios_raw);
}
static void cookmode(void)
{
- if (G.do_termios) tcsetattr(0, TCSADRAIN, &G.termios_def);
+ if (G.do_termios)
+ tcsetattr(0, TCSADRAIN, &G.termios_def);
}
void BUG_telnet_globals_too_big(void);