| enet.h | | enet.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| #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 8 | | #define ENET_VERSION_PATCH 9 | |
| #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_MAJOR(version) (((version)>>16)&0xFF) | |
| #define ENET_VERSION_GET_MINOR(version) (((version)>>8)&0xFF) | | #define ENET_VERSION_GET_MINOR(version) (((version)>>8)&0xFF) | |
| #define ENET_VERSION_GET_PATCH(version) ((version)&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; | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 63 | |
| } 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, | |
|
| ENET_SOCKOPT_SNDTIMEO = 7 | | ENET_SOCKOPT_SNDTIMEO = 7, | |
| | | ENET_SOCKOPT_ERROR = 8 | |
| } ENetSocketOption; | | } ENetSocketOption; | |
| | | | |
| typedef enum _ENetSocketShutdown | | typedef enum _ENetSocketShutdown | |
| { | | { | |
| ENET_SOCKET_SHUTDOWN_READ = 0, | | ENET_SOCKET_SHUTDOWN_READ = 0, | |
| ENET_SOCKET_SHUTDOWN_WRITE = 1, | | ENET_SOCKET_SHUTDOWN_WRITE = 1, | |
| ENET_SOCKET_SHUTDOWN_READ_WRITE = 2 | | ENET_SOCKET_SHUTDOWN_READ_WRITE = 2 | |
| } ENetSocketShutdown; | | } ENetSocketShutdown; | |
| | | | |
|
| enum | | #define ENET_HOST_ANY 0 | |
| { | | #define ENET_HOST_BROADCAST 0xFFFFFFFFU | |
| ENET_HOST_ANY = 0, /**< specifies the default server ho | | #define ENET_PORT_ANY 0 | |
| st */ | | | |
| ENET_HOST_BROADCAST = 0xFFFFFFFF, /**< specifies a subnet-wide broadca | | | |
| st */ | | | |
| | | | |
| ENET_PORT_ANY = 0 /**< specifies that a port should be | | | |
| automatically chosen */ | | | |
| }; | | | |
| | | | |
| /** | | /** | |
| * Portable internet address structure. | | * Portable internet address structure. | |
| * | | * | |
| * The host must be specified in network byte-order, and the port must be i
n host | | * The host must be specified in network byte-order, and the port must be i
n host | |
| * byte-order. The constant ENET_HOST_ANY may be used to specify the defaul
t | | * byte-order. The constant ENET_HOST_ANY may be used to specify the defaul
t | |
| * server host. The constant ENET_HOST_BROADCAST may be used to specify the | | * server host. The constant ENET_HOST_BROADCAST may be used to specify the | |
| * broadcast address (255.255.255.255). This makes sense for enet_host_con
nect, | | * broadcast address (255.255.255.255). This makes sense for enet_host_con
nect, | |
| * but not for enet_host_create. Once a server responds to a broadcast, th
e | | * but not for enet_host_create. Once a server responds to a broadcast, th
e | |
| * address is updated from ENET_HOST_BROADCAST to the server's actual IP ad
dress. | | * address is updated from ENET_HOST_BROADCAST to the server's actual IP ad
dress. | |
| | | | |
| skipping to change at line 388 | | skipping to change at line 385 | |
| 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 connectedPeers; | |
| size_t bandwidthLimitedPeers; | | size_t bandwidthLimitedPeers; | |
|
| | | size_t duplicatePeers; /**< optional number o
f allowed peers from duplicate IPs, defaults to ENET_PROTOCOL_MAXIMUM_PEER_
ID */ | |
| } 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 494 | | skipping to change at line 492 | |
| 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_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_get_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); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| /** @defgroup Address ENet address functions | | /** @defgroup Address ENet address functions | |
| @{ | | @{ | |
| */ | | */ | |
| /** Attempts to resolve the host named by the parameter hostName and sets | | /** Attempts to resolve the host named by the parameter hostName and sets | |
| | | | |
| skipping to change at line 552 | | skipping to change at line 551 | |
| ENET_API ENetPeer * enet_host_connect (ENetHost *, const ENetAddress *, siz
e_t, enet_uint32); | | ENET_API ENetPeer * enet_host_connect (ENetHost *, const ENetAddress *, siz
e_t, enet_uint32); | |
| ENET_API int enet_host_check_events (ENetHost *, ENetEvent *); | | ENET_API int enet_host_check_events (ENetHost *, ENetEvent *); | |
| ENET_API int enet_host_service (ENetHost *, ENetEvent *, enet_uint32
); | | ENET_API int enet_host_service (ENetHost *, ENetEvent *, enet_uint32
); | |
| ENET_API void enet_host_flush (ENetHost *); | | ENET_API void enet_host_flush (ENetHost *); | |
| ENET_API void enet_host_broadcast (ENetHost *, enet_uint8, ENetPacket
*); | | ENET_API void enet_host_broadcast (ENetHost *, enet_uint8, ENetPacket
*); | |
| ENET_API void enet_host_compress (ENetHost *, const ENetCompressor *)
; | | ENET_API void enet_host_compress (ENetHost *, const ENetCompressor *)
; | |
| ENET_API int enet_host_compress_with_range_coder (ENetHost * host); | | ENET_API int enet_host_compress_with_range_coder (ENetHost * host); | |
| ENET_API void enet_host_channel_limit (ENetHost *, size_t); | | ENET_API void enet_host_channel_limit (ENetHost *, size_t); | |
| ENET_API void enet_host_bandwidth_limit (ENetHost *, enet_uint32, ene
t_uint32); | | ENET_API void enet_host_bandwidth_limit (ENetHost *, enet_uint32, ene
t_uint32); | |
| extern void enet_host_bandwidth_throttle (ENetHost *); | | extern void enet_host_bandwidth_throttle (ENetHost *); | |
|
| | | extern enet_uint32 enet_host_random_seed (void); | |
| | | | |
| ENET_API int enet_peer_send (ENetPeer *, enet_uint8, ENetPa
cket *); | | ENET_API int enet_peer_send (ENetPeer *, enet_uint8, ENetPa
cket *); | |
| ENET_API ENetPacket * enet_peer_receive (ENetPeer *, enet_uint8 * ch
annelID); | | ENET_API ENetPacket * enet_peer_receive (ENetPeer *, enet_uint8 * ch
annelID); | |
| ENET_API void enet_peer_ping (ENetPeer *); | | ENET_API void enet_peer_ping (ENetPeer *); | |
| ENET_API void enet_peer_ping_interval (ENetPeer *, enet_uint
32); | | ENET_API void enet_peer_ping_interval (ENetPeer *, enet_uint
32); | |
| ENET_API void enet_peer_timeout (ENetPeer *, enet_uint32, en
et_uint32, enet_uint32); | | ENET_API void enet_peer_timeout (ENetPeer *, enet_uint32, en
et_uint32, enet_uint32); | |
| ENET_API void enet_peer_reset (ENetPeer *); | | ENET_API void enet_peer_reset (ENetPeer *); | |
| ENET_API void enet_peer_disconnect (ENetPeer *, enet_uint32)
; | | ENET_API void enet_peer_disconnect (ENetPeer *, enet_uint32)
; | |
| ENET_API void enet_peer_disconnect_now (ENetPeer *, enet_uin
t32); | | ENET_API void enet_peer_disconnect_now (ENetPeer *, enet_uin
t32); | |
| ENET_API void enet_peer_disconnect_later (ENetPeer *, enet_u
int32); | | ENET_API void enet_peer_disconnect_later (ENetPeer *, enet_u
int32); | |
| | | | |
End of changes. 6 change blocks. |
| 12 lines changed or deleted | | 9 lines changed or added | |
|