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

UCC git Repository :: git.ucc.asn.au