X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Firc_src%2Fmain.c;h=16eee395dac0bb39b413ae4e2af7fa8214bfece7;hb=b0da731b2d89b9dd58de2c98eaf6218a41a21920;hp=901e8ac1853ee5f6a8c0e1cd8be2879e526d6799;hpb=81200d86b87251638035072c249a0691972f98a1;p=tpg%2Facess2.git diff --git a/Usermode/Applications/irc_src/main.c b/Usermode/Applications/irc_src/main.c index 901e8ac1..16eee395 100644 --- a/Usermode/Applications/irc_src/main.c +++ b/Usermode/Applications/irc_src/main.c @@ -78,7 +78,7 @@ char *gsNickname = "acess"; tServer *gpServers; tWindow gWindow_Status = { NULL, NULL, NULL, // No next, empty list, no server - 0, "" // No activity, empty name (rendered as status) + 0, {""} // No activity, empty name (rendered as status) }; tWindow *gpWindows = &gWindow_Status; tWindow *gpCurrentWindow = &gWindow_Status; @@ -102,8 +102,8 @@ int main(int argc, const char *argv[], const char *envp[]) atexit(ExitHandler); - giTerminal_Width = ioctl(1, 5, NULL); // getset_width - giTerminal_Height = ioctl(1, 6, NULL); // getset_height + giTerminal_Width = _SysIOCtl(1, 5, NULL); // getset_width + giTerminal_Height = _SysIOCtl(1, 6, NULL); // getset_height printf("\x1B[?1047h"); printf("\x1B[%i;%ir", 0, giTerminal_Height-1); @@ -194,7 +194,7 @@ int main(int argc, const char *argv[], const char *envp[]) { tServer *srv; for( srv = gpServers; srv; srv = srv->Next ) - close(srv->FD); + _SysClose(srv->FD); } return 0; } @@ -659,11 +659,11 @@ int ProcessIncoming(tServer *Server) // ioctl#8 on a TCP client gets the number of bytes in the recieve buffer // - Used to avoid blocking #if NON_BLOCK_READ - while( (len = ioctl(Server->FD, 8, NULL)) > 0 ) + while( (len = _SysIOCtl(Server->FD, 8, NULL)) > 0 ) { #endif // Read data - len = read(Server->FD, &Server->InBuf[Server->ReadPos], BUFSIZ - Server->ReadPos); + len = _SysRead(Server->FD, &Server->InBuf[Server->ReadPos], BUFSIZ - Server->ReadPos); if( len == -1 ) { return -1; } @@ -717,7 +717,7 @@ int writef(int FD, const char *Format, ...) vsnprintf(buf, len+1, Format, args); va_end(args); - return write(FD, buf, len); + return _SysWrite(FD, buf, len); } } @@ -747,12 +747,12 @@ int OpenTCP(const char *AddressString, short PortNumber) // Set remote port and address // printf("Setting port and remote address\n"); - ioctl(fd, 5, &PortNumber); - ioctl(fd, 6, addrBuffer); + _SysIOCtl(fd, 5, &PortNumber); + _SysIOCtl(fd, 6, addrBuffer); // Connect // printf("Initiating connection\n"); - if( ioctl(fd, 7, NULL) == 0 ) { + if( _SysIOCtl(fd, 7, NULL) == 0 ) { // Shouldn't happen :( fprintf(stderr, "Unable to start connection\n"); return -1; @@ -797,7 +797,7 @@ int SetCursorPos(int Row, int Col) Row = Col / giTerminal_Width; Col = Col % giTerminal_Width; } - rv = ioctl(1, 9, NULL); // Ugh, constants + rv = _SysIOCtl(1, 9, NULL); // Ugh, constants printf("\x1B[%i;%iH", Col, Row); return rv; }