#ifndef TCPFUNCTIONS_h
#define TCPFUNCTIONS_h



#ifdef _MSC_VER
#define DllExport __declspec( dllexport )
#elif __MINGW32__
#define DllExport __declspec( dllexport )
#else
#define DllExport
#endif

#define BUFFSIZE 64000

#define REVERSE 1

#define KBUFFERSIZE 1024
#define VERBOSE 0
#define BUFFSIZEGVV 5000
#define CKBUFF 40
#define REVERSE 1
#define NETWORK_ERROR -1
#define NETWORK_OK     0


////////////////////////////////////////////////////////////////////////
// Prototypes
#ifdef __cplusplus
extern "C" {
#endif

 DllExport const char*   WSAGetLastErrorMessage(const char* pcMessagePrefix);
 DllExport int   SetUpListener(int nPort);
 DllExport int  AcceptConnection(int ListeningSocket,  struct sockaddr_in* sinRemote);
 DllExport int  startCserver(int nPort);
 DllExport int startNClientCserver(int nPort, int nC, int launchView, int clients[]);
 DllExport int  recv_ack2(int new_fd);
 DllExport int  recv_ack(int new_fd);
 DllExport void  send_ack(int new_fd);
 DllExport int  getVarValues(int new_fd,  int lenCKI, double CK[], int sizeCK, double I[], int sizeI);
 DllExport int  sendOutput(int new_fd, int len, const double *val, int size, int intLen, const double *intVal, int sizeIntVal, int num);
 DllExport int  sendChalk(int new_fd,   int chalk);

 DllExport int  shutdownConnection(int sd);
 DllExport void  ReportError(int, const char *);

#ifdef __cplusplus
}
#endif

///////////////////////////////////////////////////////////////////////////

#endif
