enet.h   enet.h 
skipping to change at line 15 skipping to change at line 15
#ifndef __ENET_ENET_H__ #ifndef __ENET_ENET_H__
#define __ENET_ENET_H__ #define __ENET_ENET_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#ifdef WIN32 #ifdef _WIN32
#include "enet/win32.h" #include "enet/win32.h"
#else #else
#include "enet/unix.h" #include "enet/unix.h"
#endif #endif
#include "enet/types.h" #include "enet/types.h"
#include "enet/protocol.h" #include "enet/protocol.h"
#include "enet/list.h" #include "enet/list.h"
#include "enet/callbacks.h" #include "enet/callbacks.h"
#define ENET_VERSION_MAJOR 1 #define ENET_VERSION_MAJOR 1
#define ENET_VERSION_MINOR 3 #define ENET_VERSION_MINOR 3
#define ENET_VERSION_PATCH 7 #define ENET_VERSION_PATCH 8
#define ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)< <8) | (patch)) #define ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)< <8) | (patch))
#define ENET_VERSION_GET_MAJOR(version) (((version)>>16)&0xFF)
#define ENET_VERSION_GET_MINOR(version) (((version)>>8)&0xFF)
#define ENET_VERSION_GET_PATCH(version) ((version)&0xFF)
#define ENET_VERSION ENET_VERSION_CREATE(ENET_VERSION_MAJOR, ENET_VERSION_M INOR, ENET_VERSION_PATCH) #define ENET_VERSION ENET_VERSION_CREATE(ENET_VERSION_MAJOR, ENET_VERSION_M INOR, ENET_VERSION_PATCH)
typedef enet_uint32 ENetVersion; typedef enet_uint32 ENetVersion;
struct _ENetHost; struct _ENetHost;
struct _ENetEvent; struct _ENetEvent;
struct _ENetPacket; struct _ENetPacket;
typedef enum _ENetSocketType typedef enum _ENetSocketType
{ {
ENET_SOCKET_TYPE_STREAM = 1, ENET_SOCKET_TYPE_STREAM = 1,
ENET_SOCKET_TYPE_DATAGRAM = 2 ENET_SOCKET_TYPE_DATAGRAM = 2
} ENetSocketType; } ENetSocketType;
typedef enum _ENetSocketWait typedef enum _ENetSocketWait
{ {
ENET_SOCKET_WAIT_NONE = 0, ENET_SOCKET_WAIT_NONE = 0,
ENET_SOCKET_WAIT_SEND = (1 << 0), ENET_SOCKET_WAIT_SEND = (1 << 0),
ENET_SOCKET_WAIT_RECEIVE = (1 << 1) ENET_SOCKET_WAIT_RECEIVE = (1 << 1),
ENET_SOCKET_WAIT_INTERRUPT = (1 << 2)
} ENetSocketWait; } ENetSocketWait;
typedef enum _ENetSocketOption typedef enum _ENetSocketOption
{ {
ENET_SOCKOPT_NONBLOCK = 1, ENET_SOCKOPT_NONBLOCK = 1,
ENET_SOCKOPT_BROADCAST = 2, ENET_SOCKOPT_BROADCAST = 2,
ENET_SOCKOPT_RCVBUF = 3, ENET_SOCKOPT_RCVBUF = 3,
ENET_SOCKOPT_SNDBUF = 4, ENET_SOCKOPT_SNDBUF = 4,
ENET_SOCKOPT_REUSEADDR = 5, ENET_SOCKOPT_REUSEADDR = 5,
ENET_SOCKOPT_RCVTIMEO = 6, ENET_SOCKOPT_RCVTIMEO = 6,
skipping to change at line 382 skipping to change at line 386
ENetCompressor compressor; ENetCompressor compressor;
enet_uint8 packetData [2][ENET_PROTOCOL_MAXIMUM_MTU]; enet_uint8 packetData [2][ENET_PROTOCOL_MAXIMUM_MTU];
ENetAddress receivedAddress; ENetAddress receivedAddress;
enet_uint8 * receivedData; enet_uint8 * receivedData;
size_t receivedDataLength; size_t receivedDataLength;
enet_uint32 totalSentData; /**< total data sent, user should reset to 0 as needed to prevent overflow */ enet_uint32 totalSentData; /**< total data sent, user should reset to 0 as needed to prevent overflow */
enet_uint32 totalSentPackets; /**< total UDP packets sent, user should reset to 0 as needed to prevent overflow */ enet_uint32 totalSentPackets; /**< total UDP packets sent, user should reset to 0 as needed to prevent overflow */
enet_uint32 totalReceivedData; /**< total data receiv ed, user should reset to 0 as needed to prevent overflow */ enet_uint32 totalReceivedData; /**< total data receiv ed, user should reset to 0 as needed to prevent overflow */
enet_uint32 totalReceivedPackets; /**< total UDP packets received, user should reset to 0 as needed to prevent overflow */ enet_uint32 totalReceivedPackets; /**< total UDP packets received, user should reset to 0 as needed to prevent overflow */
ENetInterceptCallback intercept; /**< callback the user can set to intercept received raw UDP packets */ ENetInterceptCallback intercept; /**< callback the user can set to intercept received raw UDP packets */
size_t connectedPeers;
size_t bandwidthLimitedPeers;
} ENetHost; } ENetHost;
/** /**
* An ENet event type, as specified in @ref ENetEvent. * An ENet event type, as specified in @ref ENetEvent.
*/ */
typedef enum _ENetEventType typedef enum _ENetEventType
{ {
/** no event occurred within the specified time limit */ /** no event occurred within the specified time limit */
ENET_EVENT_TYPE_NONE = 0, ENET_EVENT_TYPE_NONE = 0,
skipping to change at line 455 skipping to change at line 461
@returns 0 on success, < 0 on failure @returns 0 on success, < 0 on failure
*/ */
ENET_API int enet_initialize_with_callbacks (ENetVersion version, const ENe tCallbacks * inits); ENET_API int enet_initialize_with_callbacks (ENetVersion version, const ENe tCallbacks * inits);
/** /**
Shuts down ENet globally. Should be called when a program that has Shuts down ENet globally. Should be called when a program that has
initialized ENet exits. initialized ENet exits.
*/ */
ENET_API void enet_deinitialize (void); ENET_API void enet_deinitialize (void);
/**
Gives the linked version of the ENet library.
@returns the version number
*/
ENET_API ENetVersion enet_linked_version (void);
/** @} */ /** @} */
/** @defgroup private ENet private implementation functions */ /** @defgroup private ENet private implementation functions */
/** /**
Returns the wall-time in milliseconds. Its initial value is unspecified Returns the wall-time in milliseconds. Its initial value is unspecified
unless otherwise set. unless otherwise set.
*/ */
ENET_API enet_uint32 enet_time_get (void); ENET_API enet_uint32 enet_time_get (void);
/** /**
Sets the current wall-time in milliseconds. Sets the current wall-time in milliseconds.
*/ */
ENET_API void enet_time_set (enet_uint32); ENET_API void enet_time_set (enet_uint32);
/** @defgroup socket ENet socket functions /** @defgroup socket ENet socket functions
@{ @{
*/ */
ENET_API ENetSocket enet_socket_create (ENetSocketType); ENET_API ENetSocket enet_socket_create (ENetSocketType);
ENET_API int enet_socket_bind (ENetSocket, const ENetAddress *); ENET_API int enet_socket_bind (ENetSocket, const ENetAddress *);
ENET_API int enet_socket_get_address (ENetSocket, ENetAddress *);
ENET_API int enet_socket_listen (ENetSocket, int); ENET_API int enet_socket_listen (ENetSocket, int);
ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *); ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *);
ENET_API int enet_socket_connect (ENetSocket, const ENetAddress *); ENET_API int enet_socket_connect (ENetSocket, const ENetAddress *);
ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, cons t ENetBuffer *, size_t); ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, cons t ENetBuffer *, size_t);
ENET_API int enet_socket_receive (ENetSocket, ENetAddress *, ENetBuf fer *, size_t); ENET_API int enet_socket_receive (ENetSocket, ENetAddress *, ENetBuf fer *, size_t);
ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint3 2); ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint3 2);
ENET_API int enet_socket_set_option (ENetSocket, ENetSocketOption, i nt); ENET_API int enet_socket_set_option (ENetSocket, ENetSocketOption, i nt);
ENET_API int enet_socket_shutdown (ENetSocket, ENetSocketShutdown); ENET_API int enet_socket_shutdown (ENetSocket, ENetSocketShutdown);
ENET_API void enet_socket_destroy (ENetSocket); ENET_API void enet_socket_destroy (ENetSocket);
ENET_API int enet_socketset_select (ENetSocket, ENetSocketSet *, ENe tSocketSet *, enet_uint32); ENET_API int enet_socketset_select (ENetSocket, ENetSocketSet *, ENe tSocketSet *, enet_uint32);
skipping to change at line 558 skipping to change at line 571
ENET_API void enet_peer_disconnect_later (ENetPeer *, enet_u int32); ENET_API void enet_peer_disconnect_later (ENetPeer *, enet_u int32);
ENET_API void enet_peer_throttle_configure (ENetPeer *, enet _uint32, enet_uint32, enet_uint32); ENET_API void enet_peer_throttle_configure (ENetPeer *, enet _uint32, enet_uint32, enet_uint32);
extern int enet_peer_throttle (ENetPeer *, enet_uint32); extern int enet_peer_throttle (ENetPeer *, enet_uint32);
extern void enet_peer_reset_queues (ENetPeer *); extern void enet_peer_reset_queues (ENetPeer *);
extern void enet_peer_setup_outgoing_command (ENetPeer *, ENetOutgoingCommand *); extern void enet_peer_setup_outgoing_command (ENetPeer *, ENetOutgoingCommand *);
extern ENetOutgoingCommand * enet_peer_queue_outgoing_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16); extern ENetOutgoingCommand * enet_peer_queue_outgoing_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16);
extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32); extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32);
extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, c onst ENetProtocol *, enet_uint16); extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, c onst ENetProtocol *, enet_uint16);
extern void enet_peer_dispatch_incoming_unreliable_command s (ENetPeer *, ENetChannel *); extern void enet_peer_dispatch_incoming_unreliable_command s (ENetPeer *, ENetChannel *);
extern void enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *); extern void enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *);
extern void enet_peer_on_connect (ENetPeer *);
extern void enet_peer_on_disconnect (ENetPeer *);
ENET_API void * enet_range_coder_create (void); ENET_API void * enet_range_coder_create (void);
ENET_API void enet_range_coder_destroy (void *); ENET_API void enet_range_coder_destroy (void *);
ENET_API size_t enet_range_coder_compress (void *, const ENetBuffer *, size _t, size_t, enet_uint8 *, size_t); ENET_API size_t enet_range_coder_compress (void *, const ENetBuffer *, size _t, size_t, enet_uint8 *, size_t);
ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, si ze_t, enet_uint8 *, size_t); ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, si ze_t, enet_uint8 *, size_t);
extern size_t enet_protocol_command_size (enet_uint8); extern size_t enet_protocol_command_size (enet_uint8);
#ifdef __cplusplus #ifdef __cplusplus
} }
 End of changes. 8 change blocks. 
5 lines changed or deleted 20 lines changed or added


 protocol.h   protocol.h 
skipping to change at line 60 skipping to change at line 60
ENET_PROTOCOL_HEADER_FLAG_SENT_TIME = (1 << 15), ENET_PROTOCOL_HEADER_FLAG_SENT_TIME = (1 << 15),
ENET_PROTOCOL_HEADER_FLAG_MASK = ENET_PROTOCOL_HEADER_FLAG_COMPRES SED | ENET_PROTOCOL_HEADER_FLAG_SENT_TIME, ENET_PROTOCOL_HEADER_FLAG_MASK = ENET_PROTOCOL_HEADER_FLAG_COMPRES SED | ENET_PROTOCOL_HEADER_FLAG_SENT_TIME,
ENET_PROTOCOL_HEADER_SESSION_MASK = (3 << 12), ENET_PROTOCOL_HEADER_SESSION_MASK = (3 << 12),
ENET_PROTOCOL_HEADER_SESSION_SHIFT = 12 ENET_PROTOCOL_HEADER_SESSION_SHIFT = 12
} ENetProtocolFlag; } ENetProtocolFlag;
#ifdef _MSC_VER_ #ifdef _MSC_VER_
#pragma pack(push, 1) #pragma pack(push, 1)
#define ENET_PACKED #define ENET_PACKED
#elif defined(__GNUC__) #elif defined(__GNUC__) || defined(__clang__)
#define ENET_PACKED __attribute__ ((packed)) #define ENET_PACKED __attribute__ ((packed))
#else #else
#define ENET_PACKED #define ENET_PACKED
#endif #endif
typedef struct _ENetProtocolHeader typedef struct _ENetProtocolHeader
{ {
enet_uint16 peerID; enet_uint16 peerID;
enet_uint16 sentTime; enet_uint16 sentTime;
} ENET_PACKED ENetProtocolHeader; } ENET_PACKED ENetProtocolHeader;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 unix.h   unix.h 
/** /**
@file unix.h @file unix.h
@brief ENet Unix header @brief ENet Unix header
*/ */
#ifndef __ENET_UNIX_H__ #ifndef __ENET_UNIX_H__
#define __ENET_UNIX_H__ #define __ENET_UNIX_H__
#include <stdlib.h> #include <stdlib.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <unistd.h> #include <unistd.h>
#ifdef MSG_MAXIOVLEN
#define ENET_BUFFER_MAXIMUM MSG_MAXIOVLEN
#endif
typedef int ENetSocket; typedef int ENetSocket;
enum enum
{ {
ENET_SOCKET_NULL = -1 ENET_SOCKET_NULL = -1
}; };
#define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */ #define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */
#define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */ #define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */
 End of changes. 2 change blocks. 
0 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/