projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unicode for mac fixes
[wxWidgets.git]
/
src
/
mac
/
carbon
/
gsocket.c
diff --git
a/src/mac/carbon/gsocket.c
b/src/mac/carbon/gsocket.c
index 7fed13e8c4f1783ab75733fdf239220470788c8a..9e3ba3079a4c3e75ef5dc34ed064c596d7ef37a8 100644
(file)
--- a/
src/mac/carbon/gsocket.c
+++ b/
src/mac/carbon/gsocket.c
@@
-15,6
+15,7
@@
#ifndef __GSOCKET_STANDALONE__
#include "wx/setup.h"
#ifndef __GSOCKET_STANDALONE__
#include "wx/setup.h"
+#include "wx/platform.h"
#endif
#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__)
#endif
#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__)
@@
-35,7
+36,7
@@
#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#endif
#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#endif
-#if TARGET_CARBON
+#if TARGET_CARBON
&& !defined(OTAssert)
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif
@@
-86,6
+87,7
@@
extern pascal void OTDebugStr(const char* str);
#endif
InetSvcRef gInetSvcRef = 0 ;
int gOTInited = 0 ;
#endif
InetSvcRef gInetSvcRef = 0 ;
int gOTInited = 0 ;
+OTNotifyUPP gOTNotifierUPP = NULL ;
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
@@
-184,7
+186,7
@@
static void SetDefaultEndpointModes(EndpointRef ep , void *data )
junk = OTSetBlocking(ep);
OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr);
*/
junk = OTSetBlocking(ep);
OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr);
*/
- junk = OTInstallNotifier(ep,
OTInetEventHandler
, data);
+ junk = OTInstallNotifier(ep,
gOTNotifierUPP
, data);
OTAssert("SetDefaultEndpointModes: Could not install notifier", junk == noErr);
/*
junk = OTUseSyncIdleEvents(ep, true);
OTAssert("SetDefaultEndpointModes: Could not install notifier", junk == noErr);
/*
junk = OTUseSyncIdleEvents(ep, true);
@@
-194,6
+196,11
@@
static void SetDefaultEndpointModes(EndpointRef ep , void *data )
/* Global initialisers */
/* Global initialisers */
+void GSocket_SetGUIFunctions(struct GSocketGUIFunctionsTable *table)
+{
+ // do nothing, wxMac doesn't have wxBase-GUI separation yet
+}
+
int GSocket_Init()
{
return TRUE;
int GSocket_Init()
{
return TRUE;
@@
-228,6
+235,7
@@
int GSocket_Verify_Inited()
OTAssert("Could not open Inet Services", err == noErr);
return FALSE ;
}
OTAssert("Could not open Inet Services", err == noErr);
return FALSE ;
}
+ gOTNotifierUPP = NewOTNotifyUPP( OTInetEventHandler ) ;
return TRUE ;
}
return TRUE ;
}
@@
-242,6
+250,8
@@
void GSocket_Cleanup()
#else
CloseOpenTransport() ;
#endif
#else
CloseOpenTransport() ;
#endif
+ if ( gOTNotifierUPP )
+ DisposeOTNotifyUPP( gOTNotifierUPP ) ;
}
}
}
}
@@
-472,9
+482,6
@@
GAddress *GSocket_GetPeer(GSocket *socket)
*/
GSocketError GSocket_SetServer(GSocket *sck)
{
*/
GSocketError GSocket_SetServer(GSocket *sck)
{
- int type;
- int arg = 1;
-
assert(sck != NULL);
/* must not be in use */
assert(sck != NULL);
/* must not be in use */
@@
-544,9
+551,6
@@
GSocketError GSocket_SetServer(GSocket *sck)
GSocket *GSocket_WaitConnection(GSocket *socket)
{
GSocket *connection = NULL ;
GSocket *GSocket_WaitConnection(GSocket *socket)
{
GSocket *connection = NULL ;
- GSocketError err;
-
- int arg = 1;
assert(socket != NULL);
assert(socket != NULL);
@@
-639,8
+643,6
@@
GSocket *GSocket_WaitConnection(GSocket *socket)
*/
GSocketError GSocket_SetNonOriented(GSocket *sck)
{
*/
GSocketError GSocket_SetNonOriented(GSocket *sck)
{
- int arg = 1;
-
assert(sck != NULL);
if (sck->m_endpoint != kOTInvalidEndpointRef )
assert(sck != NULL);
if (sck->m_endpoint != kOTInvalidEndpointRef )
@@
-725,12
+727,9
@@
GSocketError GSocket_SetNonOriented(GSocket *sck)
*/
GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
{
*/
GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
{
- int ret;
- int arg = 1;
InetAddress addr ;
TEndpointInfo info;
InetAddress addr ;
TEndpointInfo info;
- OTFlags flags = 0;
- OSStatus err = kOTNoError;
+ OSStatus err = kOTNoError;
TCall peer ;
assert(sck != NULL);
TCall peer ;
assert(sck != NULL);
@@
-931,7
+930,6
@@
int GSocket_Write(GSocket *socket, const char *buffer, int size)
*/
GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
{
*/
GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
{
- OTResult state ;
assert(socket != NULL);
wxMacProcessNotifierEvents() ;
/*
assert(socket != NULL);
wxMacProcessNotifierEvents() ;
/*
@@
-1078,7
+1076,7
@@
int _GSocket_Recv_Stream(GSocket *socket, char *buffer, int size)
OTByteCount sz = 0 ;
OTCountDataBytes( socket->m_endpoint , &sz ) ;
OTByteCount sz = 0 ;
OTCountDataBytes( socket->m_endpoint , &sz ) ;
- if ( size > sz )
+ if ( size >
(int)
sz )
size = sz ;
res = OTRcv( socket->m_endpoint , buffer , size , &flags ) ;
if ( res < 0 )
size = sz ;
res = OTRcv( socket->m_endpoint , buffer , size , &flags ) ;
if ( res < 0 )
@@
-1326,8
+1324,6
@@
GSocketError GAddress_INET_SetAnyAddress(GAddress *address)
GSocketError GAddress_INET_SetHostAddress(GAddress *address,
unsigned long hostaddr)
{
GSocketError GAddress_INET_SetHostAddress(GAddress *address,
unsigned long hostaddr)
{
- struct in_addr *addr;
-
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
@@
-1353,8
+1349,7
@@
service_entry gServices[] =
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
const char *protocol)
{
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
const char *protocol)
{
- InetAddress *addr;
- int i ;
+ size_t i ;
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
@@
-1388,8
+1383,6
@@
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port)
{
GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port)
{
- InetAddress *addr;
-
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
address->m_port = port ;
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
address->m_port = port ;
@@
-1649,10
+1642,12
@@
void _GSocket_Internal_Proc(unsigned long e , void* d )
/* Hack added for Mac OS X */
GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf)
{
/* Hack added for Mac OS X */
GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf)
{
+ return GSOCK_INVADDR;
}
GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path)
{
}
GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path)
{
+ return GSOCK_INVADDR;
}
#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
}
#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */