/*
 
NetDef.h : general constants / types definitions
 
*/
 
#ifndef NETDEF_H
#define NETDEF_H
 
#include <NET\macros.h>
 
 
 
M_BeginDeclareEnumerate(NetLib_tdeErrorStatus)
 NetLib_E_es_NoError,/*0*/
 NetLib_E_es_AlreadyTooMuchPlayers,
 NetLib_E_es_BroadcastSimulation,
 NetLib_E_es_ConnectionFailure,
 NetLib_E_es_ConnectionRemoteRefused,
 NetLib_E_es_ConnectionSessionChanged,/*5*/
 NetLib_E_es_ConnectionWaitBusy,
 NetLib_E_es_False,
 NetLib_E_es_EmissionInProgress,
 NetLib_E_es_FIFOIsEmpty,
 NetLib_E_es_FIFOIsFull,/*10*/
 NetLib_E_es_FoundLessThanRequest,
 NetLib_E_es_InvalidHandle,
 NetLib_E_es_InvalidMessage,
 NetLib_E_es_MessageTooLong,
 NetLib_E_es_NoMorePlayers,/*15*/
 NetLib_E_es_NoNewPlayer,
 NetLib_E_es_NotEnoughMemory,
 NetLib_E_es_NotInitialized,
 NetLib_E_es_NumberOfPlayerLarger,
 NetLib_E_es_NumberOfPlayerSmaller,/*20*/
 NetLib_E_es_OperationInProgress,
 NetLib_E_es_PlayersNotInformed,
 NetLib_E_es_RouteUnkown,
 NetLib_E_es_ServiceNotYetProvided,
 NetLib_E_es_ShouldNotReach,/*25*/
 NetLib_E_es_ShouldWait,
 NetLib_E_es_SystemMessageUnknown,
 NetLib_E_es_TimeOut,
 NetLib_E_es_TimeOutExpired,
 NetLib_E_es_TimeOutNotExpired,/*30*/
 NetLib_E_es_TimeOutNotInitialised,
 NetLib_E_es_True,
 NetLib_E_es_UnknownError,
 NetLib_E_es_UnknownInitialRecipient,
 NetLib_E_es_UnknownPlayerId,/*35*/
 NetLib_E_es_UnknownRecipientId,
 NetLib_E_es_UnknownSenderId,
 NetLib_E_es_UnknownSessionId,
 
 /* LEVEL 1 errors :*/
 NetLib_E_es_IdAlreadyInRouteTable,/*39*/
 NetLib_E_es_InvalidProtocol,/*40*/
 NetLib_E_es_NoBroadcastProtocol,
 NetLib_E_es_RouteTableIsFull,
 NetLib_E_es_SendFailure,
 NetLib_E_es_SessionIdAlreadyAcknowledged,
 
 /* LEVEL 0 :*/
 NetLib_E_es_NoFullMessage,/*45*/
 NetLib_E_es_BufferIsFull,
 NetLib_E_es_ChannelIsInvalid,
 NetLib_E_es_NoChannelAvaible,
 NetLib_E_es_ChannelUninitialized,
 NetLib_E_es_InvalidChannel,/*50*/
 NetLib_E_es_ProtocolNotInitialized,
 NetLib_E_es_InvalidPortNumber,
 
 NetLib_E_es_SerialFileCreationFailure,/*53*/
 NetLib_E_es_SerialInitFailure,
 NetLib_E_es_SerialSysMsgDone,/*55*/
 NetLib_E_es_SerialSysFailure,
 NetLib_E_es_SerialNotAllComInitialized,
 
 NetLib_E_es_InitialisationSocketError,/*58*/
 NetLib_E_es_NoPortSelected,
 NetLib_E_es_PortAlreadyUsed,/*60*/
 NetLib_E_es_SelectSocketFailure,
 NetLib_E_es_SendSocketFailure,
 NetLib_E_es_MessagePartlySent,
 
 NetLib_E_es_SharedMemNoName,/*64*/
 NetLib_E_es_SharedMemNameTooLong,/*65*/
 NetLib_E_es_SharedMemDefTableAlreadyExist,
 NetLib_E_es_SharedMemDefTableFull,
 NetLib_E_es_SharedMemCreateFailure,
 NetLib_E_es_SharedMemMapFailure,
 NetLib_E_es_SharedMemMutexFailure,/*70*/
 NetLib_E_es_SharedMemDataCorrupted,
 
 NetLib_E_es_InitialisationModemError,/*72*/
 NetLib_E_es_SynchroWait,
 NetLib_E_es_SynchroOk,
 NetLib_E_es_SynchroNoAck,
 NetLib_E_es_SynchroNoSync
M_EndDeclareEnumerate(NetLib_tdeErrorStatus, unsigned char)
 
 
/* Typedef for the length of a description (both player and session)*/
typedef unsigned char NetLib_tduxDescriptionLength;
     
/* player identification */
typedef unsigned char NetLib_tduxPlayerId;
 
/* session identification */
typedef unsigned char NetLib_tduxSessionId;
 
typedef char *tdpPointer;
 
/* read receipt operations */
typedef unsigned char NetLib_uxReadReceiptId;
typedef unsigned char NetLib_ucReadReceiptFlag;
 
/* little/big endian identification */
typedef unsigned char NetLib_tducBigLittleEndian;
 
#ifdef _EXPORT_NETLIB_
 #define _NET_CALLING_CONV_ __cdecl
 #ifdef __cplusplus
  #define _NET_EXPORT_ extern "C" __declspec( dllexport )
 #else
  #define _NET_EXPORT_ __declspec( dllexport )
 #endif
#else
 #define _NET_CALLING_CONV_ 
#ifdef __cplusplus
 #define _NET_EXPORT_ extern "C"
#else
 #define _NET_EXPORT_
#endif
#endif
typedef void* (_NET_CALLING_CONV_ *td_pfn_vNetMemcpy)( void *, const void *, unsigned int);
 
#define C_pNull ((tdpPointer) 0) 
#define C_uxNetInvalidId ((NetLib_tduxPlayerId)255)
#define C_uxNetLastUserId ((NetLib_tduxPlayerId)250)
#define C_uxNetBroadcastId ((NetLib_tduxPlayerId)254)
#define C_uxNetSystemId ((NetLib_tduxPlayerId)253)
#define C_uwNetInvalidChannel ((tduwNetChannel)-1)
#define C_GetNbrMsg_OUTGOING 1
#define C_GetNbrMsg_INCOMING 2
 
 
  /* typedef for the Time information*/
  typedef unsigned long NetLib_tdulTimeInfo;
 
  /* defining priorities :*/
typedef unsigned short NetLib_tduxPriority;
typedef unsigned short NetLib_tduxReplaceType;
typedef unsigned short NetLib_tduxReplaceFlag;
 
#define NetLib_C_uxNoPriority 0            /* Smallest priority.*/
#define NetLib_C_uxMaxPriority 15          /* Max priority.*/
#define NetLib_C_uxMaxReplaceType 15       /* Max replace type.*/
#define NetLib_C_uxReplaceOk 1             /* Activ replace.*/
#define NetLib_C_uxNoReplace 0             /* No replace.*/
 
  
  /* Type of join game. */
#define NetLib_Join_Create 0
#define NetLib_Join_Join 1
#define NetLib_Join_Watch 2
#define NetLib_Join_NoGame 3
 
typedef unsigned short NetLib_tduwJoinType;
 
#define NetLib_Mode_Direct 0
#define NetLib_Mode_TEN 1
#define NetLib_Mode_UBI 2
#define NetLib_Mode_MPATH 4
#define NetLib_Mode_DPlay 5
 
typedef unsigned short NetLib_tduwMode;
 
typedef enum {
   Netlib_E_mcs_IDLE,
   Netlib_E_mcs_BUSY,
   Netlib_E_mcs_OFFERING,
   Netlib_E_mcs_ACCEPTED,
   Netlib_E_mcs_DIALTONE,
   Netlib_E_mcs_DIALING,
   Netlib_E_mcs_PROCEEDING,
   Netlib_E_mcs_RINGBACK,
   Netlib_E_mcs_CONNECTED,
   Netlib_E_mcs_DISCONNECTED
} Netlib_tdeModemCallState;
 
typedef enum {
   Netlib_E_mdc_NORMAL,
   Netlib_E_mdc_UNKNOWN,
   Netlib_E_mdc_REJECT,
   Netlib_E_mdc_PICKUP,
   Netlib_E_mdc_FORWARDED,
   Netlib_E_mdc_BUSY,
   Netlib_E_mdc_NOANSWER,
   Netlib_E_mdc_BADADDRESS,
   Netlib_E_mdc_UNREACHABLE,
   Netlib_E_mdc_CONGESTION,
   Netlib_E_mdc_INCOMPATIBLE,
   Netlib_E_mdc_UNAVAIL,
   Netlib_E_mdc_NODIALTONE
} Netlib_tdeModemDisconnectCause;
   
typedef void (*tdfnvModemCallback)(long, long);
 
 
#endif /* NETDEF_H */
