--- lbbs/src/io.c 2005/03/02 16:33:49 1.4 +++ lbbs/src/io.c 2005/03/17 10:48:46 1.5 @@ -19,6 +19,7 @@ #include "common.h" #include #include +#include int outc(char c) @@ -63,12 +64,14 @@ igetch () if (pos >= len) { - len = s_receive (socket_client, buf, 255, ""); pos = 0; + //len = s_receive (socket_client, buf, 255, ""); + len = read (0, buf, 255); + //For debug - for (j = 0; j < len; j++) - log_std ("<--[%u]\n", (buf[j] + 256) % 256); + //for (j = 0; j < len; j++) + // log_std ("<--[%u]\n", (buf[j] + 256) % 256); } while (pos < len) @@ -181,7 +184,17 @@ igetch () } //for debug - log_std ("-->[%u]\n", out); + //log_std ("-->[%u]\n", out); return out; } + +int +ikbhit() +{ + int len; + + ioctl (0, FIONREAD, &len); + + return len; +}