#ifndef INET_H
#define INET_H

#include "scolPrerequisites.h"

#ifdef INET_C
#define EXT
#else
#define EXT extern
#endif



#define DINET_GETURL_SUCCESS 0x00
#define DINET_GETURL_ERROR   0x01


#if SCOL_PLATFORM == SCOL_PLATFORM_WINDOWS
	EXT ScolWindowHandle hscol;
	EXT int WM_INET;
#elif SCOL_PLATFORM == SCOL_PLATFORM_LINUX
	#define SOCKET int
	#define SOCKADDR_IN struct sockaddr_in
	#define INVALID_SOCKET -1
	#define closesocket close
	#define strnicmp strncasecmp
	#ifndef INADDR_NONE
		#define INADDR_NONE (-1)
	#endif
#else
	// TODO_MAC
#endif




//$ LB (13/07/2001) : add the authentication field in objinet data
//$LB (13/11/2001) : add the killed field in objinet data (dealing with the fact windows 2000 and xp 
//                   had problems to close certains sockets). We used to read once before close, in order
//                   to be sure all data had been received. Now we read while the flag Killed is not activated 
//                  
#define OBJINET_SIZE            6
#define OBJINET_AUTHENTICATION  0
#define OBJINET_REQUEST         1
#define OBJINET_REQPOS          2
#define OBJINET_FLAGS           3
#define OBJINET_INBUF           4
#define OBJINET_KILLED          5

/* defines pour les callbacks */
#define INET_RFL_NB     1
#define INET_RFL_DATA   0

#define INET_HEADER 1

EXT int ObjInetType;

EXT char* http_proxy_host;
EXT int http_proxy_port;









/*******************************************************/
/* scol v 4                                            */
/*                                                     */
/* int DINETGetURLconnect ( ... )                      */
/*                                                     */
/* C code from old DINETGetURLex function              */
/*                                                     */
/* connect the socket in order to send the http request*/
/*******************************************************/
int DINETGetURLconnect (SOCKET* sck, char* request, int x, int port);


int mygethost(char *host);



#endif
