From 792a1c8d8dc0cb576164da7cefaea4f43a95a1c2 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 20 Aug 2015 10:48:30 +0200 Subject: Typedefs, comments, etc. Not compiling yet. --- Linux_C_12/cTCP_121.c | 18 +++++++++++------- Linux_C_12/cTCP_121.h | 9 ++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Linux_C_12/cTCP_121.c b/Linux_C_12/cTCP_121.c index 0e8486e..a8c6ebd 100644 --- a/Linux_C_12/cTCP_121.c +++ b/Linux_C_12/cTCP_121.c @@ -1,16 +1,20 @@ /******************************************************************************************** - Clean OS Windows library module version 1.2.1. + Clean OS Linux library module version 1.2.1. This module is part of the Clean Object I/O library, version 1.2.1, - for the Windows platform. + for the Linux platform. ********************************************************************************************/ /******************************************************************************************** About this module: - Routines related to printing. + Routines related to TCP. ********************************************************************************************/ //#define FD_SETSIZE "maximal number of sockets to select on" (default is 64) -#include +#include +#include +#include +#include +#include #include "util_121.h" #include "Clean.h" #include "cTCP_121.h" @@ -153,7 +157,7 @@ int os_disconnected(SOCKET endpointRef) int os_connectrequestavailable(SOCKET endpointRef) { FD_SET readSet; - TIMEVAL timeout; + struct timeval timeout; int nr; printf("os_connectrequestavailable\n"); @@ -409,7 +413,7 @@ void os_connectTCPC(int onlyForMac, int block, int doTimeout, unsigned int stopT else { FD_SET writeSet, exptnSet; - TIMEVAL timeout; + struct timeval timeout; unsigned int now; int noOfWritableSockets, timeoutTicks; FD_ZERO(&writeSet); @@ -626,7 +630,7 @@ void selectChC( int justForMac, int nonBlocking, int doTimeout, unsigned int sto { int nRChannels, nSChannels, i; FD_SET *pReadSet, *pWriteSet; - TIMEVAL timeout; + struct timeval timeout; unsigned int now; int n, timeoutTicks; printf("selectChC\n"); diff --git a/Linux_C_12/cTCP_121.h b/Linux_C_12/cTCP_121.h index 303eea6..ed116e7 100644 --- a/Linux_C_12/cTCP_121.h +++ b/Linux_C_12/cTCP_121.h @@ -1,9 +1,11 @@ #ifndef __CTCP__ #define __CTCP__ -#if defined(mingw32_TARGET_OS) -#include +#include +typedef FILE* SOCKET; +typedef FILE* HANDLE; +typedef HANDLE HWND; typedef int DNSHdl; struct DNSInfo @@ -50,10 +52,11 @@ typedef struct dictitem dictitem; #define DNSReceiver 3 #define ConnectReceiver 4 +#define SOCKET_ERROR -1 + /* PA: InitSockets has no definition. void InitSockets(); */ extern dictitem* lookup(SOCKET endpointRef); -#endif #endif -- cgit v1.2.3