Changed internal naming convention (local variables now start with a lower case character)

Removed the AudioResource class

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1166 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-07-11 22:17:24 +00:00
parent 7cc00085d8
commit 45b150648d
245 changed files with 7865 additions and 8065 deletions

View file

@ -114,151 +114,151 @@ enum sfFtpStatus
////////////////////////////////////////////////////////////
/// Destroy an existing Ftp listing response
///
/// \param FtpResponse : Ftp listing response to destroy
/// \param ftpListingResponse : Ftp listing response to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfFtpListingResponse_Destroy(sfFtpListingResponse* FtpListingResponse);
CSFML_API void sfFtpListingResponse_Destroy(sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// Convenience function to check if the response status code
/// means a success
///
/// \param FtpListingResponse : Ftp listing response
/// \param ftpListingResponse : Ftp listing response
///
/// \return sfTrue if status is success (code < 400)
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfFtpListingResponse_IsOk(sfFtpListingResponse* FtpListingResponse);
CSFML_API sfBool sfFtpListingResponse_IsOk(sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// Get the response status code
///
/// \param FtpListingResponse : Ftp listing response
/// \param ftpListingResponse : Ftp listing response
///
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* FtpListingResponse);
CSFML_API sfFtpStatus sfFtpListingResponse_GetStatus(sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// Get the full message contained in the response
///
/// \param FtpListingResponse : Ftp listing response
/// \param ftpListingResponse : Ftp listing response
///
/// \return The response message
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* FtpListingResponse);
CSFML_API const char* sfFtpListingResponse_GetMessage(sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// Get the number of filenames in the listing
///
/// \param FtpListingResponse : Ftp listing response
/// \param ftpListingResponse : Ftp listing response
///
/// \return Total number of filenames
///
////////////////////////////////////////////////////////////
CSFML_API size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* FtpListingResponse);
CSFML_API size_t sfFtpListingResponse_GetCount(sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// Get the Index-th filename in the directory
///
/// \param FtpListingResponse : Ftp listing response
/// \param Index : Index of the filename to get
/// \param ftpListingResponse : Ftp listing response
/// \param index : Index of the filename to get
///
/// \return Index-th filename
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpListingResponse_GetFilename(sfFtpListingResponse* FtpListingResponse, size_t Index);
CSFML_API const char* sfFtpListingResponse_GetFilename(sfFtpListingResponse* ftpListingResponse, size_t index);
////////////////////////////////////////////////////////////
/// Destroy an existing Ftp directory response
///
/// \param FtpDirectoryResponse : Ftp directory response to destroy
/// \param ftpDirectoryResponse : Ftp directory response to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* FtpDirectoryResponse);
CSFML_API void sfFtpDirectoryResponse_Destroy(sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// Convenience function to check if the response status code
/// means a success
///
/// \param FtpDirectoryResponse : Ftp directory response
/// \param ftpDirectoryResponse : Ftp directory response
///
/// \return sfTrue if status is success (code < 400)
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfFtpDirectoryResponse_IsOk(sfFtpDirectoryResponse* FtpDirectoryResponse);
CSFML_API sfBool sfFtpDirectoryResponse_IsOk(sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// Get the response status code
///
/// \param FtpDirectoryResponse : Ftp directory response
/// \param ftpDirectoryResponse : Ftp directory response
///
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* FtpDirectoryResponse);
CSFML_API sfFtpStatus sfFtpDirectoryResponse_GetStatus(sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// Get the full message contained in the response
///
/// \param FtpDirectoryResponse : Ftp directory response
/// \param ftpDirectoryResponse : Ftp directory response
///
/// \return The response message
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* FtpDirectoryResponse);
CSFML_API const char* sfFtpDirectoryResponse_GetMessage(sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// Get the directory returned in the response
///
/// \param FtpDirectoryResponse : Ftp directory response
/// \param ftpDirectoryResponse : Ftp directory response
///
/// \return Directory name
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* FtpDirectoryResponse);
CSFML_API const char* sfFtpDirectoryResponse_GetDirectory(sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// Destroy an existing Ftp response
///
/// \param FtpResponse : Ftp response to destroy
/// \param ftpResponse : Ftp response to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfFtpResponse_Destroy(sfFtpResponse* FtpResponse);
CSFML_API void sfFtpResponse_Destroy(sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// Convenience function to check if the response status code
/// means a success
///
/// \param FtpResponse : Ftp response
/// \param ftpResponse : Ftp response
///
/// \return sfTrue if status is success (code < 400)
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfFtpResponse_IsOk(sfFtpResponse* FtpResponse);
CSFML_API sfBool sfFtpResponse_IsOk(sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// Get the response status code
///
/// \param FtpResponse : Ftp response
/// \param ftpResponse : Ftp response
///
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* FtpResponse);
CSFML_API sfFtpStatus sfFtpResponse_GetStatus(sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// Get the full message contained in the response
///
/// \param FtpResponse : Ftp response
/// \param ftpResponse : Ftp response
///
/// \return The response message
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* FtpResponse);
CSFML_API const char* sfFtpResponse_GetMessage(sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// Construct a new Ftp
@ -271,179 +271,179 @@ CSFML_API sfFtp* sfFtp_Create();
////////////////////////////////////////////////////////////
/// Destroy an existing Ftp
///
/// \param Ftp : Ftp to destroy
/// \param ftp : Ftp to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfFtp_Destroy(sfFtp* Ftp);
CSFML_API void sfFtp_Destroy(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// Connect to the specified FTP server
///
/// \param Ftp : Ftp instance
/// \param Server : FTP server to connect to
/// \param Port : Port used for connection (21 by default, standard FTP port)
/// \param Timeout : Maximum time to wait (0 to use no timeout)
/// \param ftp : Ftp instance
/// \param server : FTP server to connect to
/// \param port : Port used for connection (21 by default, standard FTP port)
/// \param timeout : Maximum time to wait (0 to use no timeout)
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* Ftp, sfIPAddress Server, unsigned short Port, float Timeout);
CSFML_API sfFtpResponse* sfFtp_Connect(sfFtp* ftp, sfIPAddress server, unsigned short port, float timeout);
////////////////////////////////////////////////////////////
/// Log in using anonymous account
///
/// \param Ftp : Ftp instance
/// \param ftp : Ftp instance
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* Ftp);
CSFML_API sfFtpResponse* sfFtp_LoginAnonymous(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// Log in using a username and a password
///
/// \param Ftp : Ftp instance
/// \param UserName : User name
/// \param Password : Password
/// \param ftp : Ftp instance
/// \param userName : User name
/// \param password : Password
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Login(sfFtp* Ftp, const char* UserName, const char* Password);
CSFML_API sfFtpResponse* sfFtp_Login(sfFtp* ftp, const char* userName, const char* password);
////////////////////////////////////////////////////////////
/// Close the connection with FTP server
///
/// \param Ftp : Ftp instance
/// \param ftp : Ftp instance
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Disconnect(sfFtp* Ftp);
CSFML_API sfFtpResponse* sfFtp_Disconnect(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// Send a null command just to prevent from being disconnected
///
/// \param Ftp : Ftp instance
/// \param ftp : Ftp instance
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_KeepAlive(sfFtp* Ftp);
CSFML_API sfFtpResponse* sfFtp_KeepAlive(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// Get the current working directory
///
/// \param Ftp : Ftp instance
/// \param ftp : Ftp instance
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* Ftp);
CSFML_API sfFtpDirectoryResponse* sfFtp_GetWorkingDirectory(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// Get the contents of the given directory
/// (subdirectories and files)
///
/// \param Ftp : Ftp instance
/// \param Directory : Directory to list ("" by default, the current one)
/// \param ftp : Ftp instance
/// \param directory : Directory to list ("" by default, the current one)
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* Ftp, const char* Directory);
CSFML_API sfFtpListingResponse* sfFtp_GetDirectoryListing(sfFtp* ftp, const char* directory);
////////////////////////////////////////////////////////////
/// Change the current working directory
///
/// \param Ftp : Ftp instance
/// \param Directory : New directory, relative to the current one
/// \param ftp : Ftp instance
/// \param directory : New directory, relative to the current one
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* Ftp, const char* Directory);
CSFML_API sfFtpResponse* sfFtp_ChangeDirectory(sfFtp* ftp, const char* directory);
////////////////////////////////////////////////////////////
/// Go to the parent directory of the current one
///
/// \param Ftp : Ftp instance
/// \param ftp : Ftp instance
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* Ftp);
CSFML_API sfFtpResponse* sfFtp_ParentDirectory(sfFtp* ftp);
////////////////////////////////////////////////////////////
/// Create a new directory
///
/// \param Ftp : Ftp instance
/// \param Name : Name of the directory to create
/// \param ftp : Ftp instance
/// \param name : Name of the directory to create
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_MakeDirectory(sfFtp* Ftp, const char* Name);
CSFML_API sfFtpResponse* sfFtp_MakeDirectory(sfFtp* ftp, const char* name);
////////////////////////////////////////////////////////////
/// Remove an existing directory
///
/// \param Ftp : Ftp instance
/// \param Name : Name of the directory to remove
/// \param ftp : Ftp instance
/// \param name : Name of the directory to remove
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* Ftp, const char* Name);
CSFML_API sfFtpResponse* sfFtp_DeleteDirectory(sfFtp* ftp, const char* name);
////////////////////////////////////////////////////////////
/// Rename a file
///
/// \param Ftp : Ftp instance
/// \param File : File to rename
/// \param NewName : New name
/// \param ftp : Ftp instance
/// \param file : File to rename
/// \param newName : New name
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_RenameFile(sfFtp* Ftp, const char* File, const char* NewName);
CSFML_API sfFtpResponse* sfFtp_RenameFile(sfFtp* ftp, const char* file, const char* newName);
////////////////////////////////////////////////////////////
/// Remove an existing file
///
/// \param Ftp : Ftp instance
/// \param Name : File to remove
/// \param ftp : Ftp instance
/// \param name : File to remove
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_DeleteFile(sfFtp* Ftp, const char* Name);
CSFML_API sfFtpResponse* sfFtp_DeleteFile(sfFtp* ftp, const char* name);
////////////////////////////////////////////////////////////
/// Download a file from the server
///
/// \param Ftp : Ftp instance
/// \param DistantFile : Path of the distant file to download
/// \param DestPath : Where to put to file on the local computer
/// \param Mode : Transfer mode (binary by default)
/// \param ftp : Ftp instance
/// \param distantFile : Path of the distant file to download
/// \param destPath : Where to put to file on the local computer
/// \param mode : Transfer mode (binary by default)
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Download(sfFtp* Ftp, const char* DistantFile, const char* DestPath, sfFtpTransferMode Mode);
CSFML_API sfFtpResponse* sfFtp_Download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
////////////////////////////////////////////////////////////
/// Upload a file to the server
///
/// \param Ftp : Ftp instance
/// \param LocalFile : Path of the local file to upload
/// \param DestPath : Where to put to file on the server
/// \param Mode : Transfer mode (binary by default)
/// \param ftp : Ftp instance
/// \param localFile : Path of the local file to upload
/// \param destPath : Where to put to file on the server
/// \param mode : Transfer mode (binary by default)
///
/// \return Server response to the request
///
////////////////////////////////////////////////////////////
CSFML_API sfFtpResponse* sfFtp_Upload(sfFtp* Ftp, const char* LocalFile, const char* DestPath, sfFtpTransferMode Mode);
CSFML_API sfFtpResponse* sfFtp_Upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
#endif // SFML_FTP_H

View file

@ -90,111 +90,111 @@ CSFML_API sfHttpRequest* sfHttpRequest_Create();
////////////////////////////////////////////////////////////
/// Destroy an existing Http request
///
/// \param HttpRequest : Http request to destroy
/// \param httpRequest : Http request to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_Destroy(sfHttpRequest* HttpRequest);
CSFML_API void sfHttpRequest_Destroy(sfHttpRequest* httpRequest);
////////////////////////////////////////////////////////////
/// Set the value of a field; the field is added if it doesn't exist
///
/// \param HttpRequest : Http request to modify
/// \param Field : Name of the field to set (case-insensitive)
/// \param Value : Value of the field
/// \param httpRequest : Http request to modify
/// \param field : Name of the field to set (case-insensitive)
/// \param value : Value of the field
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetField(sfHttpRequest* HttpRequest, const char* Field, const char* Value);
CSFML_API void sfHttpRequest_SetField(sfHttpRequest* httpRequest, const char* field, const char* value);
////////////////////////////////////////////////////////////
/// Set the request method.
/// This parameter is sfHttpGet by default
///
/// \param HttpRequest : Http request to modify
/// \param RequestMethod : Method to use for the request
/// \param httpRequest : Http request to modify
/// \param method : Method to use for the request
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetMethod(sfHttpRequest* HttpRequest, sfHttpMethod Method);
CSFML_API void sfHttpRequest_SetMethod(sfHttpRequest* httpRequest, sfHttpMethod method);
////////////////////////////////////////////////////////////
/// Set the target URI of the request.
/// This parameter is "/" by default
///
/// \param HttpRequest : Http request to modify
/// \param httpRequest : Http request to modify
/// \param URI : URI to request, local to the host
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetURI(sfHttpRequest* HttpRequest, const char* URI);
CSFML_API void sfHttpRequest_SetURI(sfHttpRequest* httpRequest, const char* URI);
////////////////////////////////////////////////////////////
/// Set the HTTP version of the request.
/// This parameter is 1.0 by default
///
/// \param HttpRequest : Http request to modify
/// \param Major : Major version number
/// \param Minor : Minor version number
/// \param httpRequest : Http request to modify
/// \param major : Major version number
/// \param minor : Minor version number
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetHttpVersion(sfHttpRequest* HttpRequest, unsigned int Major, unsigned int Minor);
CSFML_API void sfHttpRequest_SetHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor);
////////////////////////////////////////////////////////////
/// Set the body of the request. This parameter is optional and
/// makes sense only for POST requests.
/// This parameter is empty by default
///
/// \param HttpRequest : Http request to modify
/// \param Body : Content of the request body
/// \param httpRequest : Http request to modify
/// \param body : Content of the request body
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttpRequest_SetBody(sfHttpRequest* HttpRequest, const char* Body);
CSFML_API void sfHttpRequest_SetBody(sfHttpRequest* httpRequest, const char* body);
////////////////////////////////////////////////////////////
/// Destroy an existing Http response
///
/// \param HttpResponse : Http response to destroy
/// \param httpResponse : Http response to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttpResponse_Destroy(sfHttpResponse* HttpResponse);
CSFML_API void sfHttpResponse_Destroy(sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// Get the value of a field; returns NULL if the field doesn't exist
///
/// \param HttpResponse : Http response
/// \param Field : Field to get
/// \param httpResponse : Http response
/// \param field : Field to get
///
/// \return Value of the field (NULL if it doesn't exist)
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfHttpResponse_GetField(sfHttpResponse* HttpResponse, const char* Field);
CSFML_API const char* sfHttpResponse_GetField(sfHttpResponse* httpResponse, const char* field);
////////////////////////////////////////////////////////////
/// Get the status of a response
///
/// \param HttpResponse : Http response
/// \param httpResponse : Http response
///
/// \return Status of the response
///
////////////////////////////////////////////////////////////
CSFML_API sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* HttpResponse);
CSFML_API sfHttpStatus sfHttpResponse_GetStatus(sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// Get the major HTTP version of a response
///
/// \param HttpResponse : Http response
/// \param httpResponse : Http response
///
/// \return HTTP major version of the response
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfHttpResponse_GetMajorVersion(sfHttpResponse* HttpResponse);
CSFML_API unsigned int sfHttpResponse_GetMajorVersion(sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// Get the minor HTTP version of a response
///
/// \param HttpResponse : Http response
/// \param httpResponse : Http response
///
/// \return HTTP minor version of the response
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* HttpResponse);
CSFML_API unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// Get the body of the response. The body can contain :
@ -203,12 +203,12 @@ CSFML_API unsigned int sfHttpResponse_GetMinorVersion(sfHttpResponse* HttpRespon
/// - nothing (for HEAD requests)
/// - an error message (in case of an error)
///
/// \param HttpResponse : Http response
/// \param httpResponse : Http response
///
/// \return Body of the response (empty string if no body)
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfHttpResponse_GetBody(sfHttpResponse* HttpResponse);
CSFML_API const char* sfHttpResponse_GetBody(sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// Construct a new Http object
@ -224,17 +224,17 @@ CSFML_API sfHttp* sfHttp_Create();
/// \param Http : Http to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttp_Destroy(sfHttp* Http);
CSFML_API void sfHttp_Destroy(sfHttp* http);
////////////////////////////////////////////////////////////
/// Set the target host of a Http server
///
/// \param Http : Http object
/// \param Host : Web server to connect to
/// \param Port : Port to use for connection (0 to use the standard port of the protocol used)
/// \param http : Http object
/// \param host : Web server to connect to
/// \param port : Port to use for connection (0 to use the standard port of the protocol used)
///
////////////////////////////////////////////////////////////
CSFML_API void sfHttp_SetHost(sfHttp* Http, const char* Host, unsigned short Port);
CSFML_API void sfHttp_SetHost(sfHttp* http, const char* host, unsigned short port);
////////////////////////////////////////////////////////////
/// Send a HTTP request and return the server's response.
@ -244,14 +244,14 @@ CSFML_API void sfHttp_SetHost(sfHttp* Http, const char* Host, unsigned short Por
/// not return instantly; use a thread if you don't want to block your
/// application.
///
/// \param Http : Http object
/// \param Request : Request to send
/// \param Timeout : Maximum time to wait (0 to use no timeout)
/// \param http : Http object
/// \param request : Request to send
/// \param timeout : Maximum time to wait (0 to use no timeout)
///
/// \return Server's response, or NULL if request is invalid
///
////////////////////////////////////////////////////////////
CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* Http, sfHttpRequest* Request, float Timeout);
CSFML_API sfHttpResponse* sfHttp_SendRequest(sfHttp* http, sfHttpRequest* request, float timeout);
#endif // SFML_HTTP_H

View file

@ -43,62 +43,62 @@ typedef struct
////////////////////////////////////////////////////////////
/// Construct an address from a string
///
/// \param String : IP address ("xxx.xxx.xxx.xxx") or network name
/// \param string : IP address ("xxx.xxx.xxx.xxx") or network name
///
/// \return Resulting address
///
////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_FromString(const char* String);
CSFML_API sfIPAddress sfIPAddress_FromString(const char* string);
////////////////////////////////////////////////////////////
/// Construct an address from 4 bytes
///
/// \param Byte0 : First byte of the address
/// \param Byte1 : Second byte of the address
/// \param Byte2 : Third byte of the address
/// \param Byte3 : Fourth byte of the address
/// \param byte0 : First byte of the address
/// \param byte1 : Second byte of the address
/// \param byte2 : Third byte of the address
/// \param byte3 : Fourth byte of the address
///
/// \return Resulting address
///
////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_FromBytes(sfUint8 Byte0, sfUint8 Byte1, sfUint8 Byte2, sfUint8 Byte3);
CSFML_API sfIPAddress sfIPAddress_FromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3);
////////////////////////////////////////////////////////////
/// Construct the address from a 32-bits integer
///
/// \param Address : 4 bytes of the address packed into a 32-bits integer
/// \param address : 4 bytes of the address packed into a 32-bits integer
///
////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_FromInteger(sfUint32 Address);
CSFML_API sfIPAddress sfIPAddress_FromInteger(sfUint32 address);
////////////////////////////////////////////////////////////
/// Tell if an address is a valid one
///
/// \param Address : Address to check
/// \param address : Address to check
///
/// \return sfTrue if address has a valid syntax
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfIPAddress_IsValid(sfIPAddress Address);
CSFML_API sfBool sfIPAddress_IsValid(sfIPAddress address);
////////////////////////////////////////////////////////////
/// Get a string representation of an address
///
/// \param Address : Address to convert
/// \param String : Char array to fill (size must be >= 16)
/// \param address : Address to convert
/// \param string : Char array to fill (size must be >= 16)
///
////////////////////////////////////////////////////////////
CSFML_API void sfIPAddress_ToString(sfIPAddress Address, char* String);
CSFML_API void sfIPAddress_ToString(sfIPAddress address, char* string);
////////////////////////////////////////////////////////////
/// Get an integer representation of the address
///
/// \param Address : Address to convert
/// \param address : Address to convert
///
/// \return 32-bits integer containing the 4 bytes of the address, in system endianness
///
////////////////////////////////////////////////////////////
CSFML_API sfUint32 sfIPAddress_ToInteger(sfIPAddress Address);
CSFML_API sfUint32 sfIPAddress_ToInteger(sfIPAddress address);
////////////////////////////////////////////////////////////
/// Get the computer's local IP address (from the LAN point of view)
@ -114,12 +114,12 @@ CSFML_API sfIPAddress sfIPAddress_GetLocalAddress();
/// distant website ; as a consequence, this function may be
/// very slow -- use it as few as possible !
///
/// \param Timeout : Maximum time to wait, in seconds (use 0 for no timeout)
/// \param timeout : Maximum time to wait, in seconds (use 0 for no timeout)
///
/// \return Public IP address
///
////////////////////////////////////////////////////////////
CSFML_API sfIPAddress sfIPAddress_GetPublicAddress(float Timeout);
CSFML_API sfIPAddress sfIPAddress_GetPublicAddress(float timeout);
////////////////////////////////////////////////////////////
/// Get the computer's loopback address

View file

@ -43,106 +43,106 @@ CSFML_API sfPacket* sfPacket_Create();
////////////////////////////////////////////////////////////
/// Destroy an existing packet
///
/// \param Packet : Packet to delete
/// \param packet : Packet to delete
///
////////////////////////////////////////////////////////////
CSFML_API void sfPacket_Destroy(sfPacket* Packet);
CSFML_API void sfPacket_Destroy(sfPacket* packet);
////////////////////////////////////////////////////////////
/// Append data to the end of a packet
///
/// \param Packet : Packet to fill
/// \param Data : Pointer to the bytes to append
/// \param SizeInBytes : Number of bytes to append
/// \param packet : Packet to fill
/// \param data : Pointer to the bytes to append
/// \param sizeInBytes : Number of bytes to append
///
////////////////////////////////////////////////////////////
CSFML_API void sfPacket_Append(sfPacket* Packet, void* Data, size_t SizeInBytes);
CSFML_API void sfPacket_Append(sfPacket* packet, void* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// Clear all the data of a packet
///
/// \param Packet : Packet to clear
/// \param packet : Packet to clear
///
///////////////////////////////////////////////////////////
CSFML_API void sfPacket_Clear(sfPacket* Packet);
CSFML_API void sfPacket_Clear(sfPacket* packet);
////////////////////////////////////////////////////////////
/// Get a pointer to the data contained in a packet
/// Warning : the returned pointer may be invalid after you
/// append data to the packet
///
/// \param Packet : Packet to get data from
/// \param packet : Packet to get data from
///
/// \return Pointer to the data
///
////////////////////////////////////////////////////////////
CSFML_API const char* sfPacket_GetData(sfPacket* Packet);
CSFML_API const char* sfPacket_GetData(sfPacket* packet);
////////////////////////////////////////////////////////////
/// Get the size of the data contained in a packet
///
/// \param Packet : Packet to get data size from
/// \param packet : Packet to get data size from
///
/// \return Data size, in bytes
///
////////////////////////////////////////////////////////////
CSFML_API size_t sfPacket_GetDataSize(sfPacket* Packet);
CSFML_API size_t sfPacket_GetDataSize(sfPacket* packet);
////////////////////////////////////////////////////////////
/// Tell if the reading position has reached the end of the packet
///
/// \param Packet : Packet to check
/// \param packet : Packet to check
///
/// \return sfTrue if all data have been read into the packet
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfPacket_EndOfPacket(sfPacket* Packet);
CSFML_API sfBool sfPacket_EndOfPacket(sfPacket* packet);
////////////////////////////////////////////////////////////
/// Return the validity of packet
///
/// \param Packet : Packet to check
/// \param packet : Packet to check
///
/// \return sfTrue if last data extraction from packet was successful
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfPacket_CanRead(sfPacket* Packet);
CSFML_API sfBool sfPacket_CanRead(sfPacket* packet);
////////////////////////////////////////////////////////////
/// Functions to extract data from a packet
///
/// \param Packet : Packet to read
/// \param packet : Packet to read
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfPacket_ReadBool(sfPacket* Packet);
CSFML_API sfInt8 sfPacket_ReadInt8(sfPacket* Packet);
CSFML_API sfUint8 sfPacket_ReadUint8(sfPacket* Packet);
CSFML_API sfInt16 sfPacket_ReadInt16(sfPacket* Packet);
CSFML_API sfUint16 sfPacket_ReadUint16(sfPacket* Packet);
CSFML_API sfInt32 sfPacket_ReadInt32(sfPacket* Packet);
CSFML_API sfUint32 sfPacket_ReadUint32(sfPacket* Packet);
CSFML_API float sfPacket_ReadFloat(sfPacket* Packet);
CSFML_API double sfPacket_ReadDouble(sfPacket* Packet);
CSFML_API void sfPacket_ReadString(sfPacket* Packet, char* String);
CSFML_API void sfPacket_ReadWideString(sfPacket* Packet, wchar_t* String);
CSFML_API sfBool sfPacket_ReadBool(sfPacket* packet);
CSFML_API sfInt8 sfPacket_ReadInt8(sfPacket* packet);
CSFML_API sfUint8 sfPacket_ReadUint8(sfPacket* packet);
CSFML_API sfInt16 sfPacket_ReadInt16(sfPacket* packet);
CSFML_API sfUint16 sfPacket_ReadUint16(sfPacket* packet);
CSFML_API sfInt32 sfPacket_ReadInt32(sfPacket* packet);
CSFML_API sfUint32 sfPacket_ReadUint32(sfPacket* packet);
CSFML_API float sfPacket_ReadFloat(sfPacket* packet);
CSFML_API double sfPacket_ReadDouble(sfPacket* packet);
CSFML_API void sfPacket_ReadString(sfPacket* packet, char* string);
CSFML_API void sfPacket_ReadWideString(sfPacket* packet, wchar_t* string);
////////////////////////////////////////////////////////////
/// Functions to insert data into a packet
///
/// \param Packet : Packet to write
/// \param packet : Packet to write
///
////////////////////////////////////////////////////////////
CSFML_API void sfPacket_WriteBool(sfPacket* Packet, sfBool);
CSFML_API void sfPacket_WriteInt8(sfPacket* Packet, sfInt8);
CSFML_API void sfPacket_WriteUint8(sfPacket* Packet, sfUint8);
CSFML_API void sfPacket_WriteInt16(sfPacket* Packet, sfInt16);
CSFML_API void sfPacket_WriteUint16(sfPacket* Packet, sfUint16);
CSFML_API void sfPacket_WriteInt32(sfPacket* Packet, sfInt32);
CSFML_API void sfPacket_WriteUint32(sfPacket* Packet, sfUint32);
CSFML_API void sfPacket_WriteFloat(sfPacket* Packet, float);
CSFML_API void sfPacket_WriteDouble(sfPacket* Packet, double);
CSFML_API void sfPacket_WriteString(sfPacket* Packet, const char* String);
CSFML_API void sfPacket_WriteWideString(sfPacket* Packet, const wchar_t* String);
CSFML_API void sfPacket_WriteBool(sfPacket* packet, sfBool);
CSFML_API void sfPacket_WriteInt8(sfPacket* packet, sfInt8);
CSFML_API void sfPacket_WriteUint8(sfPacket* packet, sfUint8);
CSFML_API void sfPacket_WriteInt16(sfPacket* packet, sfInt16);
CSFML_API void sfPacket_WriteUint16(sfPacket* packet, sfUint16);
CSFML_API void sfPacket_WriteInt32(sfPacket* packet, sfInt32);
CSFML_API void sfPacket_WriteUint32(sfPacket* packet, sfUint32);
CSFML_API void sfPacket_WriteFloat(sfPacket* packet, float);
CSFML_API void sfPacket_WriteDouble(sfPacket* packet, double);
CSFML_API void sfPacket_WriteString(sfPacket* packet, const char* string);
CSFML_API void sfPacket_WriteWideString(sfPacket* packet, const wchar_t* string);
#endif // SFML_PACKET_H

View file

@ -44,68 +44,68 @@ CSFML_API sfSelectorUDP* sfSelectorUDP_Create();
////////////////////////////////////////////////////////////
/// Destroy an existing selector
///
/// \param Selector : Selector to delete
/// \param selector : Selector to delete
///
////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Destroy(sfSelectorTCP* Selector);
CSFML_API void sfSelectorUDP_Destroy(sfSelectorUDP* Selector);
CSFML_API void sfSelectorTCP_Destroy(sfSelectorTCP* selector);
CSFML_API void sfSelectorUDP_Destroy(sfSelectorUDP* selector);
////////////////////////////////////////////////////////////
/// Add a socket to watch to a selector
///
/// \param Selector : Selector to add the socket to
/// \param Socket : Socket to add
/// \param selector : Selector to add the socket to
/// \param socket : Socket to add
///
////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Add(sfSelectorTCP* Selector, sfSocketTCP* Socket);
CSFML_API void sfSelectorUDP_Add(sfSelectorUDP* Selector, sfSocketUDP* Socket);
CSFML_API void sfSelectorTCP_Add(sfSelectorTCP* selector, sfSocketTCP* socket);
CSFML_API void sfSelectorUDP_Add(sfSelectorUDP* selector, sfSocketUDP* socket);
////////////////////////////////////////////////////////////
/// Remove a socket from a selector
///
/// \param Selector : Selector to remove the socket from
/// \param Socket : Socket to remove
/// \param selector : Selector to remove the socket from
/// \param socket : Socket to remove
///
////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Remove(sfSelectorTCP* Selector, sfSocketTCP* Socket);
CSFML_API void sfSelectorUDP_Remove(sfSelectorUDP* Selector, sfSocketUDP* Socket);
CSFML_API void sfSelectorTCP_Remove(sfSelectorTCP* selector, sfSocketTCP* socket);
CSFML_API void sfSelectorUDP_Remove(sfSelectorUDP* selector, sfSocketUDP* socket);
////////////////////////////////////////////////////////////
/// Remove all sockets from a selector
///
/// \param Selector : Selector to remove the socket from
/// \param selector : Selector to remove the socket from
///
////////////////////////////////////////////////////////////
CSFML_API void sfSelectorTCP_Clear(sfSelectorTCP* Selector);
CSFML_API void sfSelectorUDP_Clear(sfSelectorUDP* Selector);
CSFML_API void sfSelectorTCP_Clear(sfSelectorTCP* selector);
CSFML_API void sfSelectorUDP_Clear(sfSelectorUDP* selector);
////////////////////////////////////////////////////////////
/// Wait and collect sockets which are ready for reading.
/// This functions will return either when at least one socket
/// is ready, or when the given time is out
///
/// \param Selector : Selector to check
/// \param Timeout : Maximum time to wait, in seconds (0 to disable timeout)
/// \param selector : Selector to check
/// \param timeout : Maximum time to wait, in seconds (0 to disable timeout)
///
/// \return Number of sockets ready
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSelectorTCP_Wait(sfSelectorTCP* Selector, float Timeout);
CSFML_API unsigned int sfSelectorUDP_Wait(sfSelectorUDP* Selector, float Timeout);
CSFML_API unsigned int sfSelectorTCP_Wait(sfSelectorTCP* selector, float timeout);
CSFML_API unsigned int sfSelectorUDP_Wait(sfSelectorUDP* selector, float timeout);
////////////////////////////////////////////////////////////
/// After a call to Wait(), get the Index-th socket which is
/// ready for reading. The total number of sockets ready
/// is the integer returned by the previous call to Wait()
///
/// \param Selector : Selector to check
/// \param Index : Index of the socket to get
/// \param selector : Selector to check
/// \param index : Index of the socket to get
///
/// \return The Index-th socket
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketTCP* sfSelectorTCP_GetSocketReady(sfSelectorTCP* Selector, unsigned int Index);
CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* Selector, unsigned int Index);
CSFML_API sfSocketTCP* sfSelectorTCP_GetSocketReady(sfSelectorTCP* selector, unsigned int index);
CSFML_API sfSocketUDP* sfSelectorUDP_GetSocketReady(sfSelectorUDP* selector, unsigned int index);
#endif // SFML_SELECTOR_H

View file

@ -45,116 +45,116 @@ CSFML_API sfSocketTCP* sfSocketTCP_Create();
////////////////////////////////////////////////////////////
/// Destroy an existing TCP socket
///
/// \param Socket : Socket to destroy
/// \param socket : Socket to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfSocketTCP_Destroy(sfSocketTCP* Socket);
CSFML_API void sfSocketTCP_Destroy(sfSocketTCP* socket);
////////////////////////////////////////////////////////////
/// Change the blocking state of a TCP socket.
/// The default behaviour of a socket is blocking
///
/// \param Socket : Socket to modify
/// \param Blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
/// \param socket : Socket to modify
/// \param blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_API void sfSocketTCP_SetBlocking(sfSocketTCP* Socket, sfBool Blocking);
CSFML_API void sfSocketTCP_SetBlocking(sfSocketTCP* socket, sfBool blocking);
////////////////////////////////////////////////////////////
/// Connect a TCP socket to another computer on a specified port
///
/// \param Socket : Socket to use for connecting
/// \param Port : Port to use for transfers (warning : ports < 1024 are reserved)
/// \param HostAddress : IP Address of the host to connect to
/// \param Timeout : Maximum time to wait (0 to use no timeout)
/// \param socket : Socket to use for connecting
/// \param port : Port to use for transfers (warning : ports < 1024 are reserved)
/// \param host : IP Address of the host to connect to
/// \param timeout : Maximum time to wait (0 to use no timeout)
///
/// \return sfTrue if operation has been successful
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Connect(sfSocketTCP* Socket, unsigned short Port, sfIPAddress HostAddress, float Timeout);
CSFML_API sfSocketStatus sfSocketTCP_Connect(sfSocketTCP* socket, unsigned short port, sfIPAddress host, float timeout);
////////////////////////////////////////////////////////////
/// Listen to a specified port for incoming data or connections
///
/// \param Socket : Socket to use for listening
/// \param Port : Port to listen to
/// \param socket : Socket to use for listening
/// \param port : Port to listen to
///
/// \return sfTrue if operation has been successful
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketTCP_Listen(sfSocketTCP* Socket, unsigned short Port);
CSFML_API sfBool sfSocketTCP_Listen(sfSocketTCP* socket, unsigned short port);
////////////////////////////////////////////////////////////
/// Wait for a connection (must be listening to a port).
/// This function is blocking, ie. it won't return before
/// a connection has been accepted
///
/// \param Socket : Socket to use for accepting
/// \param Connected : Pointer to a socket pointer that will be filled with the connected client
/// \param Address : Pointer to an address to fill with client infos
/// \param socket : Socket to use for accepting
/// \param connected : Pointer to a socket pointer that will be filled with the connected client
/// \param address : Pointer to an address to fill with client infos
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Accept(sfSocketTCP* Socket, sfSocketTCP** Connected, sfIPAddress* Address);
CSFML_API sfSocketStatus sfSocketTCP_Accept(sfSocketTCP* socket, sfSocketTCP** connected, sfIPAddress* address);
////////////////////////////////////////////////////////////
/// Send an array of bytes to the host (must be connected first)
///
/// \param Socket : Socket to use for sending
/// \param Data : Pointer to the bytes to send
/// \param Size : Number of bytes to send
/// \param socket : Socket to use for sending
/// \param data : Pointer to the bytes to send
/// \param size : Number of bytes to send
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Send(sfSocketTCP* Socket, const char* Data, size_t Size);
CSFML_API sfSocketStatus sfSocketTCP_Send(sfSocketTCP* socket, const char* data, size_t size);
////////////////////////////////////////////////////////////
/// Receive an array of bytes from the host (must be connected first)
///
/// \param Socket : Socket to use for receiving
/// \param Data : Pointer to a byte array to fill (make sure it is big enough)
/// \param MaxSize : Maximum number of bytes to read
/// \param SizeReceived : Number of bytes received
/// \param socket : Socket to use for receiving
/// \param data : Pointer to a byte array to fill (make sure it is big enough)
/// \param maxSize : Maximum number of bytes to read
/// \param sizeReceived : Number of bytes received
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_Receive(sfSocketTCP* Socket, char* Data, size_t MaxSize, size_t* SizeReceived);
CSFML_API sfSocketStatus sfSocketTCP_Receive(sfSocketTCP* socket, char* data, size_t maxSize, size_t* sizeReceived);
////////////////////////////////////////////////////////////
/// Send a packet of data to the host (must be connected first)
///
/// \param Socket : Socket to use for sending
/// \param Packet : Packet to send
/// \param socket : Socket to use for sending
/// \param packet : Packet to send
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_SendPacket(sfSocketTCP* Socket, sfPacket* Packet);
CSFML_API sfSocketStatus sfSocketTCP_SendPacket(sfSocketTCP* socket, sfPacket* packet);
////////////////////////////////////////////////////////////
/// Receive a packet from the host (must be connected first)
///
/// \param Socket : Socket to use for receiving
/// \param Packet : Packet to fill with received data
/// \param socket : Socket to use for receiving
/// \param packet : Packet to fill with received data
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketTCP_ReceivePacket(sfSocketTCP* Socket, sfPacket* Packet);
CSFML_API sfSocketStatus sfSocketTCP_ReceivePacket(sfSocketTCP* socket, sfPacket* packet);
////////////////////////////////////////////////////////////
/// Check if a socket is in a valid state ; this function
/// can be called any time to check if the socket is OK
///
/// \param Socket : Socket to check
/// \param socket : Socket to check
///
/// \return True if the socket is valid
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketTCP_IsValid(sfSocketTCP* Socket);
CSFML_API sfBool sfSocketTCP_IsValid(sfSocketTCP* socket);
#endif // SFML_SOCKETTCP_H

View file

@ -45,111 +45,111 @@ CSFML_API sfSocketUDP* sfSocketUDP_Create();
////////////////////////////////////////////////////////////
/// Destroy an existing UDP socket
///
/// \param Socket : Socket to destroy
/// \param socket : Socket to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfSocketUDP_Destroy(sfSocketUDP* Socket);
CSFML_API void sfSocketUDP_Destroy(sfSocketUDP* socket);
////////////////////////////////////////////////////////////
/// Change the blocking state of a UDP socket.
/// The default behaviour of a socket is blocking
///
/// \param Socket : Socket to modify
/// \param Blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
/// \param socket : Socket to modify
/// \param blocking : Pass sfTrue to set the socket as blocking, or false for non-blocking
///
////////////////////////////////////////////////////////////
CSFML_API void sfSocketUDP_SetBlocking(sfSocketUDP* Socket, sfBool Blocking);
CSFML_API void sfSocketUDP_SetBlocking(sfSocketUDP* socket, sfBool blocking);
////////////////////////////////////////////////////////////
/// Bind a socket to a specific port
///
/// \param Socket : Socket to bind
/// \param Port : Port to bind the socket to
/// \param socket : Socket to bind
/// \param port : Port to bind the socket to
///
/// \return True if operation has been successful
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketUDP_Bind(sfSocketUDP* Socket, unsigned short Port);
CSFML_API sfBool sfSocketUDP_Bind(sfSocketUDP* socket, unsigned short port);
////////////////////////////////////////////////////////////
/// Unbind a socket from its previous port, if any
///
/// \param Socket : Socket to unbind
/// \param socket : Socket to unbind
///
/// \return sfTrue if operation has been successful
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketUDP_Unbind(sfSocketUDP* Socket);
CSFML_API sfBool sfSocketUDP_Unbind(sfSocketUDP* socket);
////////////////////////////////////////////////////////////
/// Send an array of bytes
///
/// \param Socket : Socket to use for sending
/// \param Data : Pointer to the bytes to send
/// \param Size : Number of bytes to send
/// \param Address : Address of the computer to send the packet to
/// \param Port : Port to use for communication
/// \param socket : Socket to use for sending
/// \param data : Pointer to the bytes to send
/// \param size : Number of bytes to send
/// \param address : Address of the computer to send the packet to
/// \param port : Port to use for communication
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_Send(sfSocketUDP* Socket, const char* Data, size_t Size, sfIPAddress Address, unsigned short Port);
CSFML_API sfSocketStatus sfSocketUDP_Send(sfSocketUDP* socket, const char* data, size_t size, sfIPAddress address, unsigned short port);
////////////////////////////////////////////////////////////
/// Receive an array of bytes.
/// This function is blocking, ie. it won't return before some
/// bytes have been received
///
/// \param Socket : Socket to use for receiving
/// \param Data : Pointer to a byte array to fill (make sure it is big enough)
/// \param MaxSize : Maximum number of bytes to read
/// \param SizeReceived : Number of bytes received
/// \param Address : Address of the computer which sent the data
/// \param Port : Port on which the remote computer sent the data
/// \param socket : Socket to use for receiving
/// \param data : Pointer to a byte array to fill (make sure it is big enough)
/// \param maxSize : Maximum number of bytes to read
/// \param sizeReceived : Number of bytes received
/// \param address : Address of the computer which sent the data
/// \param port : Port on which the remote computer sent the data
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_Receive(sfSocketUDP* Socket, char* Data, size_t MaxSize, size_t* SizeReceived, sfIPAddress* Address, unsigned short* Port);
CSFML_API sfSocketStatus sfSocketUDP_Receive(sfSocketUDP* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIPAddress* address, unsigned short* port);
////////////////////////////////////////////////////////////
/// Send a packet of data
///
/// \param Socket : Socket to use for sending
/// \param Packet : Packet to send
/// \param Address : Address of the computer to send the packet to
/// \param Port : Port to use for communication
/// \param socket : Socket to use for sending
/// \param packet : Packet to send
/// \param address : Address of the computer to send the packet to
/// \param port : Port to use for communication
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_SendPacket(sfSocketUDP* Socket, sfPacket* Packet, sfIPAddress Address, unsigned short Port);
CSFML_API sfSocketStatus sfSocketUDP_SendPacket(sfSocketUDP* socket, sfPacket* packet, sfIPAddress address, unsigned short port);
////////////////////////////////////////////////////////////
/// Receive a packet.
/// This function is blocking, ie. it won't return before a
/// packet is received
///
/// \param Socket : Socket to use for receiving
/// \param Packet : Packet to fill with received data
/// \param Address : Address of the computer which sent the packet
/// \param Port : Port on which the remote computer sent the data
/// \param socket : Socket to use for receiving
/// \param packet : Packet to fill with received data
/// \param address : Address of the computer which sent the packet
/// \param port : Port on which the remote computer sent the data
///
/// \return Socket status
///
////////////////////////////////////////////////////////////
CSFML_API sfSocketStatus sfSocketUDP_ReceivePacket(sfSocketUDP* Socket, sfPacket* Packet, sfIPAddress* Address, unsigned short* Port);
CSFML_API sfSocketStatus sfSocketUDP_ReceivePacket(sfSocketUDP* socket, sfPacket* packet, sfIPAddress* address, unsigned short* port);
////////////////////////////////////////////////////////////
/// Check if a socket is in a valid state ; this function
/// can be called any time to check if the socket is OK
///
/// \param Socket : Socket to check
/// \param socket : Socket to check
///
/// \return sfTrue if the socket is valid
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSocketUDP_IsValid(sfSocketUDP* Socket);
CSFML_API sfBool sfSocketUDP_IsValid(sfSocketUDP* socket);
#endif // SFML_SOCKETUDP_H