/**************************************************/
/* scol v 4                                       */
/*                                                */
/* inetconnect.h                                  */
/*                                                */
/* scol inet, system part                         */
/*                                                */
/**************************************************/



#ifndef _INETCONNECT_H_
#define _INETCONNECT_H_

#include "scolPrerequisites.h"
#define INETCONNECT_RFL_NB 1



//$ LB (05/03/2002) : define OBJINETCONNECT object
//                  
#define OBJINETCONNECT_SIZE   2     
#define OBJINETCONNECT_URL    0  // url to use with INETisConnected test
#define OBJINETCONNECT_RESULT 1  // result of the test
// the callback and user param of _rflINETisConnected function 
// are stored as callback of this scol object


// index of INETCONNECT object callbacks
#define INETCONNECT_RFL_RESULT 0


// parameter of WN_USER Windows message 
#define RFL_INET_IS_CONNECTED_MSG 0x51











/*******************************************************************************************************************************/
/*******************************************************************************************************************************/
/**                                                                                                                           **/
/**             INETisConnected, synchronous version                                                                          **/
/**                                                                                                                           **/
/*******************************************************************************************************************************/
/*******************************************************************************************************************************/







//$ LB (17/07/2001) : add SCINETisConnected function
/*************************************************/
/*                                               */
/* int INETisConnected (char* url)               */
/*                                               */
/* returns 1 if physically connected to the net, */
/* 0 if not.                                     */
/* the parameter is the url on which the user    */
/* wants to test the connexion.                  */
/*                                               */
/*************************************************/
int INETisConnected (char* url);







/*******************************************************************************************************************************/
/*******************************************************************************************************************************/
/**                                                                                                                           **/
/**             _rflINETisConnected, threaded version of INETisConnected                                                      **/
/**                                                                                                                           **/
/*******************************************************************************************************************************/
/*******************************************************************************************************************************/









/****************************************/
/*                                      */
/* RflInetIsConnectedData_t             */
/*                                      */
/* define the set of data needed to     */
/* manage the threaded version of       */
/* INETisConnected function             */
/*                                      */
/****************************************/
typedef struct RflInetIsConnectedData_t
{
	mmachine machine;        // scol machine
	int      handle;         // INETCONNECT object handle
	
} RflInetIsConnectedData_t;



/********************************************************/
/*                                                      */
/* int SCrflINETisConnected_TerminateProcess            */
/*                                                      */
/* called by receiving a WN_USER message, with          */
/* RFL_INET_IS_CONNECTED_MSG as parameter.              */
/* execute the scol callback of _rflINETisConnected.    */
/*                                                      */
/********************************************************/

int SCrflINETisConnected_TerminateProcess (RflInetIsConnectedData_t * data);



//$LB (21/02/2002) : add threaded version of INETisConnected function
/*************************************************/
/*                                               */
/* int SCrflINETisConnected (mmachine m)         */
/*                                               */
/* create a thread and run INETisConnected in it.*/
/* the result of INETisConnected is returned in  */
/* using the callback pointer the user gave as   */
/* parameter.                                    */
/* the result is 1 if physically connected to    */
/* the net, 0 if not.                            */
/*                                               */
/* fun [S fun [S u0 I] u1 u0] I                  */
/*                                               */
/* parameters :                                  */
/*   - S : url on which the user wants to test   */
/*         the connexion.                        */
/*                                               */
/*   - fun [S u0 I] u1 : callback to check the   */
/*                       result of the test.     */
/*                       - S  : url tested       */
/*                       - u0 : user parameter   */
/*                       - I  : test result      */
/*                                               */
/*   - u0 : user parameter                       */
/*                                               */
/*************************************************/
int SCrflINETisConnected (mmachine m);













/*******************************************************************************************************************************/
/*******************************************************************************************************************************/
/**                                                                                                                           **/
/**             package definition                                                                                            **/
/**                                                                                                                           **/
/*******************************************************************************************************************************/
/*******************************************************************************************************************************/


#ifdef __cplusplus
extern "C" {
#endif
int SCOLloadINETCONNECT (mmachine m);
#ifdef __cplusplus
}
#endif



#endif