CWS-TOOLING: integrate CWS codecleanup02

This commit is contained in:
Vladimir Glazunov
2010-08-25 17:21:42 +02:00
24 changed files with 85 additions and 134 deletions

View File

@@ -76,10 +76,10 @@ public:
CommunicationManagerClient( BOOL bUseMultiChannel = FALSE ); CommunicationManagerClient( BOOL bUseMultiChannel = FALSE );
}; };
class CommunicationLinkViaSocket : public SimpleCommunicationLinkViaSocket, public NAMESPACE_VOS(OThread) class CommunicationLinkViaSocket : public SimpleCommunicationLinkViaSocket, public vos::OThread
{ {
public: public:
CommunicationLinkViaSocket( CommunicationManager *pMan, NAMESPACE_VOS(OStreamSocket) *pSocket ); CommunicationLinkViaSocket( CommunicationManager *pMan, vos::OStreamSocket *pSocket );
virtual ~CommunicationLinkViaSocket(); virtual ~CommunicationLinkViaSocket();
virtual BOOL IsCommunicationError(); virtual BOOL IsCommunicationError();
@@ -101,8 +101,8 @@ protected:
virtual BOOL ShutdownCommunication(); virtual BOOL ShutdownCommunication();
ULONG nConnectionClosedEventId; ULONG nConnectionClosedEventId;
ULONG nDataReceivedEventId; ULONG nDataReceivedEventId;
NAMESPACE_VOS(OMutex) aMConnectionClosed; // Notwendig, da Event verarbeitet werden kann bevor Variable gesetzt ist vos::OMutex aMConnectionClosed; // Notwendig, da Event verarbeitet werden kann bevor Variable gesetzt ist
NAMESPACE_VOS(OMutex) aMDataReceived; // Notwendig, da Event verarbeitet werden kann bevor Variable gesetzt ist vos::OMutex aMDataReceived; // Notwendig, da Event verarbeitet werden kann bevor Variable gesetzt ist
virtual void WaitForShutdown(); virtual void WaitForShutdown();
DECL_LINK( ShutdownLink, void* ); DECL_LINK( ShutdownLink, void* );
@@ -133,7 +133,7 @@ private:
void AddConnection( CommunicationLink *pNewConnection ); void AddConnection( CommunicationLink *pNewConnection );
}; };
class CommunicationManagerServerAcceptThread: public NAMESPACE_VOS(OThread) class CommunicationManagerServerAcceptThread: public vos::OThread
{ {
public: public:
CommunicationManagerServerAcceptThread( CommunicationManagerServerViaSocket* pServer, ULONG nPort, USHORT nMaxCon = CM_UNLIMITED_CONNECTIONS ); CommunicationManagerServerAcceptThread( CommunicationManagerServerViaSocket* pServer, ULONG nPort, USHORT nMaxCon = CM_UNLIMITED_CONNECTIONS );
@@ -145,11 +145,11 @@ protected:
private: private:
CommunicationManagerServerViaSocket* pMyServer; CommunicationManagerServerViaSocket* pMyServer;
NAMESPACE_VOS(OAcceptorSocket) *pAcceptorSocket; vos::OAcceptorSocket *pAcceptorSocket;
ULONG nPortToListen; ULONG nPortToListen;
USHORT nMaxConnections; USHORT nMaxConnections;
ULONG nAddConnectionEventId; ULONG nAddConnectionEventId;
NAMESPACE_VOS(OMutex) aMAddConnection; // Notwendig, da Event verarbeitet werden kann bevor Variable gesetzt ist vos::OMutex aMAddConnection; // Notwendig, da Event verarbeitet werden kann bevor Variable gesetzt ist
void CallInfoMsg( InfoString aMsg ){ pMyServer->CallInfoMsg( aMsg ); } void CallInfoMsg( InfoString aMsg ){ pMyServer->CallInfoMsg( aMsg ); }
CM_InfoType GetInfoType(){ return pMyServer->GetInfoType(); } CM_InfoType GetInfoType(){ return pMyServer->GetInfoType(); }
@@ -174,7 +174,7 @@ private:
ByteString aHostToTalk; ByteString aHostToTalk;
ULONG nPortToTalk; ULONG nPortToTalk;
protected: protected:
virtual CommunicationLink *CreateCommunicationLink( CommunicationManager *pCM, NAMESPACE_VOS(OConnectorSocket) *pCS ){ return new CommunicationLinkViaSocket( pCM, pCS ); } virtual CommunicationLink *CreateCommunicationLink( CommunicationManager *pCM, vos::OConnectorSocket *pCS ){ return new CommunicationLinkViaSocket( pCM, pCS ); }
}; };
#endif #endif

View File

@@ -337,14 +337,14 @@ private:
ByteString aMyName; ByteString aMyName;
TCPIO* pTCPIO; TCPIO* pTCPIO;
NAMESPACE_VOS(OStreamSocket) *pStreamSocket; vos::OStreamSocket *pStreamSocket;
protected: protected:
SimpleCommunicationLinkViaSocket( CommunicationManager *pMan, NAMESPACE_VOS(OStreamSocket) *pSocket ); SimpleCommunicationLinkViaSocket( CommunicationManager *pMan, vos::OStreamSocket *pSocket );
virtual ~SimpleCommunicationLinkViaSocket(); virtual ~SimpleCommunicationLinkViaSocket();
NAMESPACE_VOS(OStreamSocket)* GetStreamSocket() { return pStreamSocket; } vos::OStreamSocket* GetStreamSocket() { return pStreamSocket; }
void SetStreamSocket( NAMESPACE_VOS(OStreamSocket)* pSocket ); void SetStreamSocket( vos::OStreamSocket* pSocket );
SvStream *pReceiveStream; SvStream *pReceiveStream;
BOOL DoReceiveDataStream(); /// Recieve DataPacket from Socket BOOL DoReceiveDataStream(); /// Recieve DataPacket from Socket
@@ -358,7 +358,7 @@ protected:
class SimpleCommunicationLinkViaSocketWithReceiveCallbacks : public SimpleCommunicationLinkViaSocket class SimpleCommunicationLinkViaSocketWithReceiveCallbacks : public SimpleCommunicationLinkViaSocket
{ {
public: public:
SimpleCommunicationLinkViaSocketWithReceiveCallbacks( CommunicationManager *pMan, NAMESPACE_VOS(OStreamSocket) *pSocket ); SimpleCommunicationLinkViaSocketWithReceiveCallbacks( CommunicationManager *pMan, vos::OStreamSocket *pSocket );
~SimpleCommunicationLinkViaSocketWithReceiveCallbacks(); ~SimpleCommunicationLinkViaSocketWithReceiveCallbacks();
virtual BOOL ReceiveDataStream(); virtual BOOL ReceiveDataStream();
protected: protected:
@@ -371,7 +371,7 @@ class CommonSocketFunctions
public: public:
BOOL DoStartCommunication( CommunicationManager *pCM, ICommunicationManagerClient *pCMC, ByteString aHost, ULONG nPort ); BOOL DoStartCommunication( CommunicationManager *pCM, ICommunicationManagerClient *pCMC, ByteString aHost, ULONG nPort );
protected: protected:
virtual CommunicationLink *CreateCommunicationLink( CommunicationManager *pCM, NAMESPACE_VOS(OConnectorSocket) *pCS )=0; virtual CommunicationLink *CreateCommunicationLink( CommunicationManager *pCM, vos::OConnectorSocket *pCS )=0;
}; };
class SingleCommunicationManagerClientViaSocket : public SingleCommunicationManager, public ICommunicationManagerClient, CommonSocketFunctions class SingleCommunicationManagerClientViaSocket : public SingleCommunicationManager, public ICommunicationManagerClient, CommonSocketFunctions
@@ -387,7 +387,7 @@ private:
ByteString aHostToTalk; ByteString aHostToTalk;
ULONG nPortToTalk; ULONG nPortToTalk;
protected: protected:
virtual CommunicationLink *CreateCommunicationLink( CommunicationManager *pCM, NAMESPACE_VOS(OConnectorSocket) *pCS ){ return new SimpleCommunicationLinkViaSocketWithReceiveCallbacks( pCM, pCS ); } virtual CommunicationLink *CreateCommunicationLink( CommunicationManager *pCM, vos::OConnectorSocket *pCS ){ return new SimpleCommunicationLinkViaSocketWithReceiveCallbacks( pCM, pCS ); }
}; };
#endif #endif

View File

@@ -66,9 +66,9 @@ _SV_SEEK_PTR( nm, AE )
SV_IMPL_PTRARR_SORT( CommunicationLinkList, CommunicationLink* ); SV_IMPL_PTRARR_SORT( CommunicationLinkList, CommunicationLink* );
NAMESPACE_VOS(OMutex) *pMPostUserEvent=NULL; // Notwendig, da nicht threadfest vos::OMutex *pMPostUserEvent=NULL; // Notwendig, da nicht threadfest
CommunicationLinkViaSocket::CommunicationLinkViaSocket( CommunicationManager *pMan, NAMESPACE_VOS(OStreamSocket) *pSocket ) CommunicationLinkViaSocket::CommunicationLinkViaSocket( CommunicationManager *pMan, vos::OStreamSocket *pSocket )
: SimpleCommunicationLinkViaSocket( pMan, pSocket ) : SimpleCommunicationLinkViaSocket( pMan, pSocket )
, nConnectionClosedEventId( 0 ) , nConnectionClosedEventId( 0 )
, nDataReceivedEventId( 0 ) , nDataReceivedEventId( 0 )
@@ -77,7 +77,7 @@ CommunicationLinkViaSocket::CommunicationLinkViaSocket( CommunicationManager *pM
{ {
SetPutDataReceivedHdl(LINK( this, CommunicationLinkViaSocket, PutDataReceivedHdl )); SetPutDataReceivedHdl(LINK( this, CommunicationLinkViaSocket, PutDataReceivedHdl ));
if ( !pMPostUserEvent ) if ( !pMPostUserEvent )
pMPostUserEvent = new NAMESPACE_VOS(OMutex); pMPostUserEvent = new vos::OMutex;
// this is necassary to prevent the running thread from sending the close event // this is necassary to prevent the running thread from sending the close event
// before the open event has been sent. // before the open event has been sent.
StartCallback(); StartCallback();
@@ -92,7 +92,7 @@ CommunicationLinkViaSocket::~CommunicationLinkViaSocket()
while ( nConnectionClosedEventId || nDataReceivedEventId ) while ( nConnectionClosedEventId || nDataReceivedEventId )
GetpApp()->Yield(); GetpApp()->Yield();
{ {
NAMESPACE_VOS(OGuard) aGuard( aMConnectionClosed ); vos::OGuard aGuard( aMConnectionClosed );
if ( nConnectionClosedEventId ) if ( nConnectionClosedEventId )
{ {
GetpApp()->RemoveUserEvent( nConnectionClosedEventId ); GetpApp()->RemoveUserEvent( nConnectionClosedEventId );
@@ -103,7 +103,7 @@ CommunicationLinkViaSocket::~CommunicationLinkViaSocket()
} }
} }
{ {
NAMESPACE_VOS(OGuard) aGuard( aMDataReceived ); vos::OGuard aGuard( aMDataReceived );
if ( nDataReceivedEventId ) if ( nDataReceivedEventId )
{ {
GetpApp()->RemoveUserEvent( nDataReceivedEventId ); GetpApp()->RemoveUserEvent( nDataReceivedEventId );
@@ -132,7 +132,7 @@ BOOL CommunicationLinkViaSocket::ShutdownCommunication()
join(); join();
NAMESPACE_VOS(OStreamSocket) *pTempSocket = GetStreamSocket(); vos::OStreamSocket *pTempSocket = GetStreamSocket();
SetStreamSocket( NULL ); SetStreamSocket( NULL );
delete pTempSocket; delete pTempSocket;
@@ -209,8 +209,8 @@ void CommunicationLinkViaSocket::run()
SetNewPacketAsCurrent(); SetNewPacketAsCurrent();
StartCallback(); StartCallback();
{ {
NAMESPACE_VOS(OGuard) aGuard( aMDataReceived ); vos::OGuard aGuard( aMDataReceived );
NAMESPACE_VOS(OGuard) aGuard2( *pMPostUserEvent ); vos::OGuard aGuard2( *pMPostUserEvent );
mlPutDataReceived.Call(this); mlPutDataReceived.Call(this);
} }
} }
@@ -220,8 +220,8 @@ void CommunicationLinkViaSocket::run()
StartCallback(); StartCallback();
{ {
NAMESPACE_VOS(OGuard) aGuard( aMConnectionClosed ); vos::OGuard aGuard( aMConnectionClosed );
NAMESPACE_VOS(OGuard) aGuard2( *pMPostUserEvent ); vos::OGuard aGuard2( *pMPostUserEvent );
nConnectionClosedEventId = GetpApp()->PostUserEvent( LINK( this, CommunicationLinkViaSocket, ConnectionClosed ) ); nConnectionClosedEventId = GetpApp()->PostUserEvent( LINK( this, CommunicationLinkViaSocket, ConnectionClosed ) );
} }
} }
@@ -238,7 +238,7 @@ BOOL CommunicationLinkViaSocket::DoTransferDataStream( SvStream *pDataStream, CM
long CommunicationLinkViaSocket::ConnectionClosed( void* EMPTYARG ) long CommunicationLinkViaSocket::ConnectionClosed( void* EMPTYARG )
{ {
{ {
NAMESPACE_VOS(OGuard) aGuard( aMConnectionClosed ); vos::OGuard aGuard( aMConnectionClosed );
nConnectionClosedEventId = 0; // Achtung!! alles andere mu<6D> oben gemacht werden. nConnectionClosedEventId = 0; // Achtung!! alles andere mu<6D> oben gemacht werden.
} }
ShutdownCommunication(); ShutdownCommunication();
@@ -249,7 +249,7 @@ long CommunicationLinkViaSocket::ConnectionClosed( void* EMPTYARG )
long CommunicationLinkViaSocket::DataReceived( void* EMPTYARG ) long CommunicationLinkViaSocket::DataReceived( void* EMPTYARG )
{ {
{ {
NAMESPACE_VOS(OGuard) aGuard( aMDataReceived ); vos::OGuard aGuard( aMDataReceived );
nDataReceivedEventId = 0; // Achtung!! alles andere mu<6D> oben gemacht werden. nDataReceivedEventId = 0; // Achtung!! alles andere mu<6D> oben gemacht werden.
} }
return CommunicationLink::DataReceived( ); return CommunicationLink::DataReceived( );
@@ -453,7 +453,7 @@ CommunicationManagerServerAcceptThread::CommunicationManagerServerAcceptThread(
, xmNewConnection( NULL ) , xmNewConnection( NULL )
{ {
if ( !pMPostUserEvent ) if ( !pMPostUserEvent )
pMPostUserEvent = new NAMESPACE_VOS(OMutex); pMPostUserEvent = new vos::OMutex;
create(); create();
} }
@@ -480,7 +480,7 @@ CommunicationManagerServerAcceptThread::~CommunicationManagerServerAcceptThread(
DEBUGPRINTF ("Destructor CommunicationManagerServerAcceptThread <20>bersprungen!!!! (wegen Solaris BUG)\n"); DEBUGPRINTF ("Destructor CommunicationManagerServerAcceptThread <20>bersprungen!!!! (wegen Solaris BUG)\n");
#endif #endif
{ {
NAMESPACE_VOS(OGuard) aGuard( aMAddConnection ); vos::OGuard aGuard( aMAddConnection );
if ( nAddConnectionEventId ) if ( nAddConnectionEventId )
{ {
GetpApp()->RemoveUserEvent( nAddConnectionEventId ); GetpApp()->RemoveUserEvent( nAddConnectionEventId );
@@ -500,8 +500,8 @@ void CommunicationManagerServerAcceptThread::run()
if ( !nPortToListen ) if ( !nPortToListen )
return; return;
pAcceptorSocket = new NAMESPACE_VOS(OAcceptorSocket)(); pAcceptorSocket = new vos::OAcceptorSocket();
NAMESPACE_VOS(OInetSocketAddr) Addr; vos::OInetSocketAddr Addr;
Addr.setPort( nPortToListen ); Addr.setPort( nPortToListen );
pAcceptorSocket->setReuseAddr( 1 ); pAcceptorSocket->setReuseAddr( 1 );
if ( !pAcceptorSocket->bind( Addr ) ) if ( !pAcceptorSocket->bind( Addr ) )
@@ -514,14 +514,14 @@ void CommunicationManagerServerAcceptThread::run()
} }
NAMESPACE_VOS(OStreamSocket) *pStreamSocket = NULL; vos::OStreamSocket *pStreamSocket = NULL;
while ( schedule() ) while ( schedule() )
{ {
pStreamSocket = new NAMESPACE_VOS(OStreamSocket); pStreamSocket = new vos::OStreamSocket;
switch ( pAcceptorSocket->acceptConnection( *pStreamSocket ) ) switch ( pAcceptorSocket->acceptConnection( *pStreamSocket ) )
{ {
case NAMESPACE_VOS(ISocketTypes::TResult_Ok): case vos::ISocketTypes::TResult_Ok:
{ {
pStreamSocket->setTcpNoDelay( 1 ); pStreamSocket->setTcpNoDelay( 1 );
@@ -531,23 +531,23 @@ void CommunicationManagerServerAcceptThread::run()
xmNewConnection = new CommunicationLinkViaSocket( pMyServer, pStreamSocket ); xmNewConnection = new CommunicationLinkViaSocket( pMyServer, pStreamSocket );
xmNewConnection->StartCallback(); xmNewConnection->StartCallback();
{ {
NAMESPACE_VOS(OGuard) aGuard( aMAddConnection ); vos::OGuard aGuard( aMAddConnection );
NAMESPACE_VOS(OGuard) aGuard2( *pMPostUserEvent ); vos::OGuard aGuard2( *pMPostUserEvent );
nAddConnectionEventId = GetpApp()->PostUserEvent( LINK( this, CommunicationManagerServerAcceptThread, AddConnection ) ); nAddConnectionEventId = GetpApp()->PostUserEvent( LINK( this, CommunicationManagerServerAcceptThread, AddConnection ) );
} }
} }
break; break;
case NAMESPACE_VOS(ISocketTypes::TResult_TimedOut): case vos::ISocketTypes::TResult_TimedOut:
delete pStreamSocket; delete pStreamSocket;
pStreamSocket = NULL; pStreamSocket = NULL;
break; break;
case NAMESPACE_VOS(ISocketTypes::TResult_Error): case vos::ISocketTypes::TResult_Error:
delete pStreamSocket; delete pStreamSocket;
pStreamSocket = NULL; pStreamSocket = NULL;
break; break;
case NAMESPACE_VOS(ISocketTypes::TResult_Interrupted): case vos::ISocketTypes::TResult_Interrupted:
case NAMESPACE_VOS(ISocketTypes::TResult_InProgress): case vos::ISocketTypes::TResult_InProgress:
break; // -Wall not handled... break; // -Wall not handled...
} }
} }
@@ -557,7 +557,7 @@ void CommunicationManagerServerAcceptThread::run()
IMPL_LINK( CommunicationManagerServerAcceptThread, AddConnection, void*, EMPTYARG ) IMPL_LINK( CommunicationManagerServerAcceptThread, AddConnection, void*, EMPTYARG )
{ {
{ {
NAMESPACE_VOS(OGuard) aGuard( aMAddConnection ); vos::OGuard aGuard( aMAddConnection );
nAddConnectionEventId = 0; nAddConnectionEventId = 0;
} }
pMyServer->AddConnection( xmNewConnection ); pMyServer->AddConnection( xmNewConnection );

View File

@@ -3083,13 +3083,6 @@ BOOL StatementCommand::Execute()
nDirFlags = nFlags = Sb_ATTR_HIDDEN | Sb_ATTR_SYSTEM | Sb_ATTR_DIRECTORY; nDirFlags = nFlags = Sb_ATTR_HIDDEN | Sb_ATTR_SYSTEM | Sb_ATTR_DIRECTORY;
// Nur diese Bitmaske ist unter Windows erlaubt // Nur diese Bitmaske ist unter Windows erlaubt
#ifdef WIN
if( nFlags & ~0x1E )
{
nDirFlags = 0;
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
#endif
// Sb_ATTR_VOLUME wird getrennt gehandelt // Sb_ATTR_VOLUME wird getrennt gehandelt
if( nDirFlags & Sb_ATTR_VOLUME ) if( nDirFlags & Sb_ATTR_VOLUME )
aPath = aEntry.GetVolume(); aPath = aEntry.GetVolume();
@@ -3121,31 +3114,7 @@ BOOL StatementCommand::Execute()
} }
DirEntry aNextEntry=(*(pDir))[nDirPos++]; DirEntry aNextEntry=(*(pDir))[nDirPos++];
aPath = aNextEntry.GetName(); //Full(); aPath = aNextEntry.GetName(); //Full();
#ifdef WIN
aNextEntry.ToAbs();
String sFull(aNextEntry.GetFull());
unsigned nFlags;
if (_dos_getfileattr( sFull.GetStr(), &nFlags ))
nErrorcode = FSYS_ERR_NOTEXISTS;
else
{
INT16 nCurFlags = nDirFlags;
if( (nCurFlags == Sb_ATTR_NORMAL)
&& !(nFlags & ( _A_HIDDEN | _A_SYSTEM | _A_VOLID | _A_SUBDIR ) ) )
break; break;
else if( (nCurFlags & Sb_ATTR_HIDDEN) && (nFlags & _A_HIDDEN) )
break;
else if( (nCurFlags & Sb_ATTR_SYSTEM) && (nFlags & _A_SYSTEM) )
break;
else if( (nCurFlags & Sb_ATTR_VOLUME) && (nFlags & _A_VOLID) )
break;
else if( (nCurFlags & Sb_ATTR_DIRECTORY) && (nFlags & _A_SUBDIR) )
break;
}
#else
break;
#endif
} }
} }
if ( !nErrorcode ) if ( !nErrorcode )

View File

@@ -136,7 +136,7 @@ void CommunicationLink::SetApplication( const ByteString& aApp )
} }
SimpleCommunicationLinkViaSocket::SimpleCommunicationLinkViaSocket( CommunicationManager *pMan, NAMESPACE_VOS(OStreamSocket) *pSocket ) SimpleCommunicationLinkViaSocket::SimpleCommunicationLinkViaSocket( CommunicationManager *pMan, vos::OStreamSocket *pSocket )
: CommunicationLink( pMan ) : CommunicationLink( pMan )
, aCommunicationPartner() , aCommunicationPartner()
, aMyName() , aMyName()
@@ -158,7 +158,7 @@ SimpleCommunicationLinkViaSocket::~SimpleCommunicationLinkViaSocket()
pStreamSocket = NULL; pStreamSocket = NULL;
} }
void SimpleCommunicationLinkViaSocket::SetStreamSocket( NAMESPACE_VOS(OStreamSocket)* pSocket ) void SimpleCommunicationLinkViaSocket::SetStreamSocket( vos::OStreamSocket* pSocket )
{ {
if ( pTCPIO ) if ( pTCPIO )
pTCPIO->SetStreamSocket( pSocket ); pTCPIO->SetStreamSocket( pSocket );
@@ -202,9 +202,9 @@ ByteString SimpleCommunicationLinkViaSocket::GetCommunicationPartner( CM_NameTyp
case CM_DOTTED: case CM_DOTTED:
{ {
rtl::OUString aDotted; rtl::OUString aDotted;
NAMESPACE_VOS(OSocketAddr) *pPeerAdr = new NAMESPACE_VOS(OSocketAddr); vos::OSocketAddr *pPeerAdr = new vos::OSocketAddr;
pStreamSocket->getPeerAddr( *pPeerAdr ); pStreamSocket->getPeerAddr( *pPeerAdr );
((NAMESPACE_VOS(OInetSocketAddr*))pPeerAdr)->getDottedAddr( aDotted ); ((vos::OInetSocketAddr*)pPeerAdr)->getDottedAddr( aDotted );
delete pPeerAdr; delete pPeerAdr;
return ByteString( UniString(aDotted), RTL_TEXTENCODING_UTF8 ); return ByteString( UniString(aDotted), RTL_TEXTENCODING_UTF8 );
} }
@@ -234,9 +234,9 @@ ByteString SimpleCommunicationLinkViaSocket::GetMyName( CM_NameType eType )
case CM_DOTTED: case CM_DOTTED:
{ {
rtl::OUString aDotted; rtl::OUString aDotted;
NAMESPACE_VOS(OSocketAddr) *pPeerAdr = new NAMESPACE_VOS(OSocketAddr); vos::OSocketAddr *pPeerAdr = new vos::OSocketAddr;
pStreamSocket->getLocalAddr( *pPeerAdr ); pStreamSocket->getLocalAddr( *pPeerAdr );
((NAMESPACE_VOS(OInetSocketAddr*))pPeerAdr)->getDottedAddr( aDotted ); ((vos::OInetSocketAddr*)pPeerAdr)->getDottedAddr( aDotted );
delete pPeerAdr; delete pPeerAdr;
return ByteString( UniString(aDotted), RTL_TEXTENCODING_UTF8 ); return ByteString( UniString(aDotted), RTL_TEXTENCODING_UTF8 );
} }
@@ -352,7 +352,7 @@ BOOL SimpleCommunicationLinkViaSocket::SendHandshake( HandshakeType aHandshakeTy
return !bWasError; return !bWasError;
} }
SimpleCommunicationLinkViaSocketWithReceiveCallbacks::SimpleCommunicationLinkViaSocketWithReceiveCallbacks( CommunicationManager *pMan, NAMESPACE_VOS(OStreamSocket) *pSocket ) SimpleCommunicationLinkViaSocketWithReceiveCallbacks::SimpleCommunicationLinkViaSocketWithReceiveCallbacks( CommunicationManager *pMan, vos::OStreamSocket *pSocket )
: SimpleCommunicationLinkViaSocket( pMan, pSocket ) : SimpleCommunicationLinkViaSocket( pMan, pSocket )
{ {
} }
@@ -396,7 +396,7 @@ BOOL SimpleCommunicationLinkViaSocketWithReceiveCallbacks::ShutdownCommunication
if ( GetStreamSocket() ) if ( GetStreamSocket() )
GetStreamSocket()->close(); GetStreamSocket()->close();
NAMESPACE_VOS(OStreamSocket) *pTempSocket = GetStreamSocket(); vos::OStreamSocket *pTempSocket = GetStreamSocket();
SetStreamSocket( NULL ); SetStreamSocket( NULL );
delete pTempSocket; delete pTempSocket;
@@ -437,7 +437,7 @@ BOOL CommunicationManager::StartCommunication( ByteString aHost, ULONG nPort )
ByteString CommunicationManager::GetMyName( CM_NameType ) ByteString CommunicationManager::GetMyName( CM_NameType )
{ {
rtl::OUString aHostname; rtl::OUString aHostname;
NAMESPACE_VOS(OSocketAddr)::getLocalHostname( aHostname ); vos::OSocketAddr::getLocalHostname( aHostname );
return ByteString( UniString(aHostname), RTL_TEXTENCODING_UTF8 ); return ByteString( UniString(aHostname), RTL_TEXTENCODING_UTF8 );
} }
@@ -672,8 +672,8 @@ SingleCommunicationManagerClientViaSocket::SingleCommunicationManagerClientViaSo
BOOL CommonSocketFunctions::DoStartCommunication( CommunicationManager *pCM, ICommunicationManagerClient *pCMC, ByteString aHost, ULONG nPort ) BOOL CommonSocketFunctions::DoStartCommunication( CommunicationManager *pCM, ICommunicationManagerClient *pCMC, ByteString aHost, ULONG nPort )
{ {
NAMESPACE_VOS(OInetSocketAddr) Addr; vos::OInetSocketAddr Addr;
NAMESPACE_VOS(OConnectorSocket) *pConnSocket; vos::OConnectorSocket *pConnSocket;
Addr.setAddr( rtl::OUString( UniString( aHost, RTL_TEXTENCODING_UTF8 ) ) ); Addr.setAddr( rtl::OUString( UniString( aHost, RTL_TEXTENCODING_UTF8 ) ) );
Addr.setPort( nPort ); Addr.setPort( nPort );
@@ -683,9 +683,9 @@ BOOL CommonSocketFunctions::DoStartCommunication( CommunicationManager *pCM, ICo
aTV.Nanosec = 0; aTV.Nanosec = 0;
do do
{ {
pConnSocket = new NAMESPACE_VOS(OConnectorSocket)(); pConnSocket = new vos::OConnectorSocket();
pConnSocket->setTcpNoDelay( 1 ); pConnSocket->setTcpNoDelay( 1 );
if ( pConnSocket->connect( Addr, &aTV ) == NAMESPACE_VOS(ISocketTypes::TResult_Ok) ) if ( pConnSocket->connect( Addr, &aTV ) == vos::ISocketTypes::TResult_Ok )
{ {
pConnSocket->setTcpNoDelay( 1 ); pConnSocket->setTcpNoDelay( 1 );

View File

@@ -63,7 +63,7 @@ comm_USHORT TCPIO::ReceiveBytes( void* pBuffer, comm_UINT32 nLen )
// helper // helper
void TCPIO::SetStreamSocket( NAMESPACE_VOS(OStreamSocket) *pSocket ) void TCPIO::SetStreamSocket( vos::OStreamSocket *pSocket )
{ {
vos::OGuard aRGuard( aMSocketReadAccess ); vos::OGuard aRGuard( aMSocketReadAccess );
vos::OGuard aWGuard( aMSocketWriteAccess ); vos::OGuard aWGuard( aMSocketWriteAccess );

View File

@@ -36,14 +36,14 @@
class TCPIO : public ITransmiter, public IReceiver class TCPIO : public ITransmiter, public IReceiver
{ {
private: private:
NAMESPACE_VOS(OStreamSocket) *pStreamSocket; vos::OStreamSocket *pStreamSocket;
vos::OMutex aMSocketReadAccess; vos::OMutex aMSocketReadAccess;
vos::OMutex aMSocketWriteAccess; vos::OMutex aMSocketWriteAccess;
public: public:
/// ///
TCPIO( NAMESPACE_VOS(OStreamSocket) *pSocket ):pStreamSocket( pSocket ){} TCPIO( vos::OStreamSocket *pSocket ):pStreamSocket( pSocket ){}
virtual ~TCPIO(){} virtual ~TCPIO(){}
@@ -54,7 +54,7 @@ public:
virtual comm_USHORT ReceiveBytes( void* pBuffer, comm_UINT32 nLen ); virtual comm_USHORT ReceiveBytes( void* pBuffer, comm_UINT32 nLen );
// helper // helper
void SetStreamSocket( NAMESPACE_VOS(OStreamSocket) *pSocket ); void SetStreamSocket( vos::OStreamSocket *pSocket );
}; };

View File

@@ -78,7 +78,7 @@ BOOL HttpRequest::Execute()
Init(); Init();
// Open channel to standard redir host // Open channel to standard redir host
NAMESPACE_VOS(OInetSocketAddr) aConnectAddr; vos::OInetSocketAddr aConnectAddr;
if ( aProxyHost.Len() ) if ( aProxyHost.Len() )
{ {
@@ -95,8 +95,8 @@ BOOL HttpRequest::Execute()
aTV.Seconds = 10; // Warte 10 Sekunden aTV.Seconds = 10; // Warte 10 Sekunden
aTV.Nanosec = 0; aTV.Nanosec = 0;
pOutSocket = new NAMESPACE_VOS(OConnectorSocket)(); pOutSocket = new vos::OConnectorSocket();
if ( pOutSocket->connect( aConnectAddr, &aTV ) == NAMESPACE_VOS(ISocketTypes::TResult_Ok) ) if ( pOutSocket->connect( aConnectAddr, &aTV ) == vos::ISocketTypes::TResult_Ok )
{ {
// pOutSocket->setTcpNoDelay( 1 ); // pOutSocket->setTcpNoDelay( 1 );
} }

View File

@@ -91,9 +91,7 @@ using namespace ::com::sun::star::io;
using namespace ::com::sun::star::resource; using namespace ::com::sun::star::resource;
using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::ui::dialogs;
#if defined(MAC) #if defined(UNX)
#define FILTERMASK_ALL "****"
#elif defined(OW) || defined(MTF)
#define FILTERMASK_ALL "*" #define FILTERMASK_ALL "*"
#elif defined(PM2) #elif defined(PM2)
#define FILTERMASK_ALL "" #define FILTERMASK_ALL ""

View File

@@ -959,7 +959,7 @@ void TPGalleryThemeProperties::FillFilterList()
} }
} }
#if defined(WIN) || defined(WNT) #if defined(WNT)
if ( aExtensions.Len() > 240 ) if ( aExtensions.Len() > 240 )
aExtensions = DEFINE_CONST_UNICODE( "*.*" ); aExtensions = DEFINE_CONST_UNICODE( "*.*" );
#endif #endif

View File

@@ -279,7 +279,7 @@ void LdapConnection::loadModule()
{ {
if ( !s_Ldap_Module ) if ( !s_Ldap_Module )
{ {
#if defined(WIN) || defined(WNT) #if defined(WNT)
# define LIBLDAP "nsldap32v50.dll" # define LIBLDAP "nsldap32v50.dll"
#else #else
# ifdef WITH_OPENLDAP # ifdef WITH_OPENLDAP

View File

@@ -90,10 +90,10 @@ protected:
int m_nSocket; int m_nSocket;
std::vector<MediatorMessage*> m_aMessageQueue; std::vector<MediatorMessage*> m_aMessageQueue;
NAMESPACE_VOS(OMutex) m_aQueueMutex; vos::OMutex m_aQueueMutex;
NAMESPACE_VOS(OMutex) m_aSendMutex; vos::OMutex m_aSendMutex;
// only one thread can send a message at any given time // only one thread can send a message at any given time
NAMESPACE_VOS(OCondition) m_aNewMessageCdtn; vos::OCondition m_aNewMessageCdtn;
MediatorListener* m_pListener; MediatorListener* m_pListener;
// thread to fill the queue // thread to fill the queue
@@ -150,7 +150,7 @@ public:
} }
}; };
class MediatorListener : public NAMESPACE_VOS( OThread ) class MediatorListener : public vos:: OThread
{ {
friend class Mediator; friend class Mediator;
private: private:

View File

@@ -166,7 +166,7 @@ public:
class PluginConnector : public Mediator class PluginConnector : public Mediator
{ {
protected: protected:
NAMESPACE_VOS(OMutex) m_aUserEventMutex; vos::OMutex m_aUserEventMutex;
static std::vector<PluginConnector*> allConnectors; static std::vector<PluginConnector*> allConnectors;

View File

@@ -80,7 +80,7 @@ ULONG Mediator::SendMessage( ULONG nBytes, const char* pBytes, ULONG nMessageID
if( ! m_pListener ) if( ! m_pListener )
return 0; return 0;
NAMESPACE_VOS(OGuard) aGuard( m_aSendMutex ); vos::OGuard aGuard( m_aSendMutex );
if( ! nMessageID ) if( ! nMessageID )
nMessageID = m_nCurrentID; nMessageID = m_nCurrentID;
@@ -132,7 +132,7 @@ MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID )
while( m_pListener ) while( m_pListener )
{ {
{ {
NAMESPACE_VOS(OGuard) aGuard( m_aQueueMutex ); vos::OGuard aGuard( m_aQueueMutex );
for( size_t i = 0; i < m_aMessageQueue.size(); i++ ) for( size_t i = 0; i < m_aMessageQueue.size(); i++ )
{ {
MediatorMessage* pMessage = m_aMessageQueue[ i ]; MediatorMessage* pMessage = m_aMessageQueue[ i ];
@@ -157,7 +157,7 @@ MediatorMessage* Mediator::GetNextMessage( BOOL bWait )
{ {
// guard must be after WaitForMessage, else the listener // guard must be after WaitForMessage, else the listener
// cannot insert a new one -> deadlock // cannot insert a new one -> deadlock
NAMESPACE_VOS(OGuard) aGuard( m_aQueueMutex ); vos::OGuard aGuard( m_aQueueMutex );
for( size_t i = 0; i < m_aMessageQueue.size(); i++ ) for( size_t i = 0; i < m_aMessageQueue.size(); i++ )
{ {
MediatorMessage* pMessage = m_aMessageQueue[ i ]; MediatorMessage* pMessage = m_aMessageQueue[ i ];
@@ -207,7 +207,7 @@ void MediatorListener::run()
{ {
::vos::OGuard aMyGuard( m_aMutex ); ::vos::OGuard aMyGuard( m_aMutex );
{ {
NAMESPACE_VOS(OGuard) vos::OGuard
aGuard( m_pMediator->m_aQueueMutex ); aGuard( m_pMediator->m_aQueueMutex );
MediatorMessage* pMessage = MediatorMessage* pMessage =
new MediatorMessage( nHeader[ 0 ], nHeader[ 1 ], pBuffer ); new MediatorMessage( nHeader[ 0 ], nHeader[ 1 ], pBuffer );

View File

@@ -27,7 +27,7 @@ PluginConnector::PluginConnector( int nSocket ) :
PluginConnector::~PluginConnector() PluginConnector::~PluginConnector()
{ {
NAMESPACE_VOS(OGuard) aGuard( m_aUserEventMutex ); vos::OGuard aGuard( m_aUserEventMutex );
for( std::vector< PluginConnector* >::iterator it = allConnectors.begin(); for( std::vector< PluginConnector* >::iterator it = allConnectors.begin();
it != allConnectors.end(); ++it ) it != allConnectors.end(); ++it )
{ {
@@ -41,7 +41,7 @@ PluginConnector::~PluginConnector()
IMPL_LINK( PluginConnector, NewMessageHdl, Mediator*, /*pMediator*/ ) IMPL_LINK( PluginConnector, NewMessageHdl, Mediator*, /*pMediator*/ )
{ {
NAMESPACE_VOS(OGuard) aGuard( m_aUserEventMutex ); vos::OGuard aGuard( m_aUserEventMutex );
bool bFound = false; bool bFound = false;
for( std::vector< PluginConnector* >::iterator it = allConnectors.begin(); for( std::vector< PluginConnector* >::iterator it = allConnectors.begin();
it != allConnectors.end() && bFound == false; ++it ) it != allConnectors.end() && bFound == false; ++it )
@@ -68,7 +68,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ )
return 0; return 0;
/* /*
{ {
NAMESPACE_VOS(OGuard) aGuard( m_aUserEventMutex ); vos::OGuard aGuard( m_aUserEventMutex );
m_aUserEventIDs.pop_front(); m_aUserEventIDs.pop_front();
} }
*/ */

View File

@@ -172,7 +172,7 @@ MediatorMessage* PluginConnector::WaitForAnswer( ULONG nMessageID )
while( m_pListener ) while( m_pListener )
{ {
{ {
NAMESPACE_VOS(OGuard) aGuard( m_aQueueMutex ); vos::OGuard aGuard( m_aQueueMutex );
for( size_t i = 0; i < m_aMessageQueue.size(); i++ ) for( size_t i = 0; i < m_aMessageQueue.size(); i++ )
{ {
MediatorMessage* pMessage = m_aMessageQueue[ i ]; MediatorMessage* pMessage = m_aMessageQueue[ i ];

View File

@@ -74,10 +74,7 @@ using namespace ::com::sun::star;
#define FIXTODOUBLE( nFix ) ((double)nFix.Whole+(double)nFix.Frac/65536.) #define FIXTODOUBLE( nFix ) ((double)nFix.Whole+(double)nFix.Frac/65536.)
#define FIXTOLONG( nFix ) ((long)floor(FIXTODOUBLE(nFix)+0.5)) #define FIXTOLONG( nFix ) ((long)floor(FIXTODOUBLE(nFix)+0.5))
#if defined WIN #if defined WNT
#define TWAIN_LIBNAME "TWAIN.DLL"
#define TWAIN_FUNCNAME "DSM_Entry"
#elif defined WNT
#define TWAIN_LIBNAME "TWAIN_32.DLL" #define TWAIN_LIBNAME "TWAIN_32.DLL"
#define TWAIN_FUNCNAME "DSM_Entry" #define TWAIN_FUNCNAME "DSM_Entry"
#endif #endif
@@ -109,7 +106,7 @@ class ImpTwain : public ::cppu::WeakImplHelper1< util::XCloseListener >
TW_IDENTITY aSrcIdent; TW_IDENTITY aSrcIdent;
Link aNotifyLink; Link aNotifyLink;
DSMENTRYPROC pDSM; DSMENTRYPROC pDSM;
NAMESPACE_VOS( OModule )* pMod; vos:: OModule * pMod;
ULONG nCurState; ULONG nCurState;
HWND hTwainWnd; HWND hTwainWnd;
HHOOK hTwainHook; HHOOK hTwainHook;

View File

@@ -31,7 +31,7 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#if defined( WNT ) || defined (WIN) #if defined( WNT )
#include <tools/svwin.h> #include <tools/svwin.h>
#endif #endif
#ifdef OS2 #ifdef OS2
@@ -52,10 +52,7 @@
#define FIXTODOUBLE( nFix ) ((double)nFix.Whole+(double)nFix.Frac/65536.) #define FIXTODOUBLE( nFix ) ((double)nFix.Whole+(double)nFix.Frac/65536.)
#define FIXTOLONG( nFix ) ((long)floor(FIXTODOUBLE(nFix)+0.5)) #define FIXTOLONG( nFix ) ((long)floor(FIXTODOUBLE(nFix)+0.5))
#if defined WIN #if defined WNT
#define TWAIN_LIBNAME "TWAIN.DLL"
#define TWAIN_FUNCNAME "DSM_Entry"
#elif defined WNT
#define TWAIN_LIBNAME "TWAIN_32.DLL" #define TWAIN_LIBNAME "TWAIN_32.DLL"
#define TWAIN_FUNCNAME "DSM_Entry" #define TWAIN_FUNCNAME "DSM_Entry"
#elif defined OS2 #elif defined OS2
@@ -242,7 +239,7 @@ void ImpTwain::ImplOpenSourceManager()
{ {
if( 1 == nCurState ) if( 1 == nCurState )
{ {
pMod = new NAMESPACE_VOS( OModule )(); pMod = new vos:: OModule ();
if( pMod->load( TWAIN_LIBNAME ) ) if( pMod->load( TWAIN_LIBNAME ) )
{ {

View File

@@ -57,7 +57,7 @@ class ImpTwain
Link aNotifyLink; Link aNotifyLink;
Bitmap aBitmap; Bitmap aBitmap;
DSMENTRYPROC pDSM; DSMENTRYPROC pDSM;
NAMESPACE_VOS( OModule )* pMod; vos:: OModule * pMod;
ULONG nCurState; ULONG nCurState;
void ImplCreate(); void ImplCreate();

View File

@@ -53,10 +53,8 @@
#include "testfactreg.hxx" #include "testfactreg.hxx"
#ifndef _VOS_NO_NAMESPACE
using namespace vos; using namespace vos;
using namespace usr; using namespace usr;
#endif
#define DATASTREAM_TEST_MAX_HANDLE 1 #define DATASTREAM_TEST_MAX_HANDLE 1

View File

@@ -50,12 +50,8 @@
#include "testfactreg.hxx" #include "testfactreg.hxx"
#ifndef _VOS_NO_NAMESPACE
using namespace vos; using namespace vos;
using namespace usr; using namespace usr;
#endif
class OMarkableOutputStreamTest : class OMarkableOutputStreamTest :
public XSimpleTest, public XSimpleTest,

View File

@@ -48,10 +48,8 @@
#define IMPLEMENTATION_NAME L"test.com.sun.star.comp.extensions.stm.Pipe" #define IMPLEMENTATION_NAME L"test.com.sun.star.comp.extensions.stm.Pipe"
#define SERVICE_NAME L"test.com.sun.star.io.Pipe" #define SERVICE_NAME L"test.com.sun.star.io.Pipe"
#ifndef _VOS_NO_NAMESPACE
using namespace vos; using namespace vos;
using namespace usr; using namespace usr;
#endif
class WriteToStreamThread : class WriteToStreamThread :
public OThread public OThread

View File

@@ -35,10 +35,8 @@
#include "testfactreg.hxx" #include "testfactreg.hxx"
#ifndef _VOS_NO_NAMESPACE
using namespace vos; using namespace vos;
using namespace usr; using namespace usr;
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"

View File

@@ -555,7 +555,7 @@ BOOL install (
String aModule ("module://"); String aModule ("module://");
char pBuffer[1024]; char pBuffer[1024];
NAMESPACE_VOS(ORealDynamicLoader)::computeModuleName ( vos::ORealDynamicLoader::computeModuleName (
prefix, pBuffer, sizeof(pBuffer)); prefix, pBuffer, sizeof(pBuffer));
aModule += pBuffer; aModule += pBuffer;
@@ -573,7 +573,7 @@ BOOL uninstall (
String aModule ("module://"); String aModule ("module://");
char pBuffer[1024]; char pBuffer[1024];
NAMESPACE_VOS(ORealDynamicLoader)::computeModuleName ( vos::ORealDynamicLoader::computeModuleName (
prefix, pBuffer, sizeof(pBuffer)); prefix, pBuffer, sizeof(pBuffer));
aModule += pBuffer; aModule += pBuffer;