diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/ntqdns.h | 12 | ||||
-rw-r--r-- | src/network/ntqftp.h | 6 | ||||
-rw-r--r-- | src/network/ntqhostaddress.h | 14 | ||||
-rw-r--r-- | src/network/ntqhttp.h | 8 | ||||
-rw-r--r-- | src/network/ntqserversocket.h | 8 | ||||
-rw-r--r-- | src/network/ntqsocket.h | 26 | ||||
-rw-r--r-- | src/network/ntqsocketdevice.h | 24 | ||||
-rw-r--r-- | src/network/qdns.cpp | 50 | ||||
-rw-r--r-- | src/network/qftp.cpp | 24 | ||||
-rw-r--r-- | src/network/qhostaddress.cpp | 34 | ||||
-rw-r--r-- | src/network/qhttp.cpp | 30 | ||||
-rw-r--r-- | src/network/qserversocket.cpp | 8 | ||||
-rw-r--r-- | src/network/qsocket.cpp | 48 | ||||
-rw-r--r-- | src/network/qsocketdevice.cpp | 2 | ||||
-rw-r--r-- | src/network/qsocketdevice_unix.cpp | 22 |
15 files changed, 158 insertions, 158 deletions
diff --git a/src/network/ntqdns.h b/src/network/ntqdns.h index fdf255a72..c594e3941 100644 --- a/src/network/ntqdns.h +++ b/src/network/ntqdns.h @@ -93,22 +93,22 @@ public: class TQM_EXPORT_DNS MailServer { public: - MailServer( const TQString & n=TQString::null, Q_UINT16 p=0 ) + MailServer( const TQString & n=TQString::null, TQ_UINT16 p=0 ) :name(n), priority(p) {} TQString name; - Q_UINT16 priority; + TQ_UINT16 priority; Q_DUMMY_COMPARISON_OPERATOR(MailServer) }; TQValueList<MailServer> mailServers() const; class TQM_EXPORT_DNS Server { public: - Server(const TQString & n=TQString::null, Q_UINT16 p=0, Q_UINT16 w=0, Q_UINT16 po=0 ) + Server(const TQString & n=TQString::null, TQ_UINT16 p=0, TQ_UINT16 w=0, TQ_UINT16 po=0 ) : name(n), priority(p), weight(w), port(po) {} TQString name; - Q_UINT16 priority; - Q_UINT16 weight; - Q_UINT16 port; + TQ_UINT16 priority; + TQ_UINT16 weight; + TQ_UINT16 port; Q_DUMMY_COMPARISON_OPERATOR(Server) }; TQValueList<Server> servers() const; diff --git a/src/network/ntqftp.h b/src/network/ntqftp.h index af4036fb6..e68867ad0 100644 --- a/src/network/ntqftp.h +++ b/src/network/ntqftp.h @@ -102,7 +102,7 @@ public: RawCommand }; - int connectToHost( const TQString &host, Q_UINT16 port=21 ); + int connectToHost( const TQString &host, TQ_UINT16 port=21 ); int login( const TQString &user=TQString::null, const TQString &password=TQString::null ); int close(); int list( const TQString &dir=TQString::null ); @@ -117,8 +117,8 @@ public: int rawCommand( const TQString &command ); - Q_ULONG bytesAvailable() const; - Q_LONG readBlock( char *data, Q_ULONG maxlen ); + TQ_ULONG bytesAvailable() const; + TQ_LONG readBlock( char *data, TQ_ULONG maxlen ); TQByteArray readAll(); int currentId() const; diff --git a/src/network/ntqhostaddress.h b/src/network/ntqhostaddress.h index 2ae4a8ea1..e28e3c206 100644 --- a/src/network/ntqhostaddress.h +++ b/src/network/ntqhostaddress.h @@ -55,15 +55,15 @@ class TQHostAddressPrivate; typedef struct { - Q_UINT8 c[16]; + TQ_UINT8 c[16]; } Q_IPV6ADDR; class TQM_EXPORT_NETWORK TQHostAddress { public: TQHostAddress(); - TQHostAddress( Q_UINT32 ip4Addr ); - TQHostAddress( Q_UINT8 *ip6Addr ); + TQHostAddress( TQ_UINT32 ip4Addr ); + TQHostAddress( TQ_UINT8 *ip6Addr ); TQHostAddress(const Q_IPV6ADDR &ip6Addr); #ifndef QT_NO_STRINGLIST TQHostAddress(const TQString &address); @@ -73,16 +73,16 @@ public: TQHostAddress & operator=( const TQHostAddress & ); - void setAddress( Q_UINT32 ip4Addr ); - void setAddress( Q_UINT8 *ip6Addr ); + void setAddress( TQ_UINT32 ip4Addr ); + void setAddress( TQ_UINT8 *ip6Addr ); #ifndef QT_NO_STRINGLIST bool setAddress( const TQString& address ); #endif bool isIp4Addr() const; // obsolete - Q_UINT32 ip4Addr() const; // obsolete + TQ_UINT32 ip4Addr() const; // obsolete bool isIPv4Address() const; - Q_UINT32 toIPv4Address() const; + TQ_UINT32 toIPv4Address() const; bool isIPv6Address() const; Q_IPV6ADDR toIPv6Address() const; diff --git a/src/network/ntqhttp.h b/src/network/ntqhttp.h index 278493506..98d77bc85 100644 --- a/src/network/ntqhttp.h +++ b/src/network/ntqhttp.h @@ -173,7 +173,7 @@ class TQM_EXPORT_HTTP TQHttp : public TQNetworkProtocol public: TQHttp(); TQHttp( TQObject* parent, const char* name = 0 ); // ### TQt 4.0: make parent=0 and get rid of the TQHttp() constructor - TQHttp( const TQString &hostname, Q_UINT16 port=80, TQObject* parent=0, const char* name = 0 ); + TQHttp( const TQString &hostname, TQ_UINT16 port=80, TQObject* parent=0, const char* name = 0 ); virtual ~TQHttp(); int supportedOperations() const; @@ -190,7 +190,7 @@ public: Aborted }; - int setHost(const TQString &hostname, Q_UINT16 port=80 ); + int setHost(const TQString &hostname, TQ_UINT16 port=80 ); int get( const TQString& path, TQIODevice* to=0 ); int post( const TQString& path, TQIODevice* data, TQIODevice* to=0 ); @@ -201,8 +201,8 @@ public: int closeConnection(); - Q_ULONG bytesAvailable() const; - Q_LONG readBlock( char *data, Q_ULONG maxlen ); + TQ_ULONG bytesAvailable() const; + TQ_LONG readBlock( char *data, TQ_ULONG maxlen ); TQByteArray readAll(); int currentId() const; diff --git a/src/network/ntqserversocket.h b/src/network/ntqserversocket.h index 7d1510302..4da629e67 100644 --- a/src/network/ntqserversocket.h +++ b/src/network/ntqserversocket.h @@ -61,16 +61,16 @@ class TQM_EXPORT_NETWORK TQServerSocket : public TQObject { TQ_OBJECT public: - TQServerSocket( Q_UINT16 port, int backlog = 1, + TQServerSocket( TQ_UINT16 port, int backlog = 1, TQObject *parent=0, const char *name=0 ); - TQServerSocket( const TQHostAddress & address, Q_UINT16 port, int backlog = 1, + TQServerSocket( const TQHostAddress & address, TQ_UINT16 port, int backlog = 1, TQObject *parent=0, const char *name=0 ); TQServerSocket( TQObject *parent=0, const char *name=0 ); virtual ~TQServerSocket(); bool ok() const; - Q_UINT16 port() const ; + TQ_UINT16 port() const ; int socket() const ; virtual void setSocket( int socket ); @@ -87,7 +87,7 @@ private slots: private: TQServerSocketPrivate *d; - void init( const TQHostAddress & address, Q_UINT16 port, int backlog ); + void init( const TQHostAddress & address, TQ_UINT16 port, int backlog ); }; #endif // QT_NO_NETWORK diff --git a/src/network/ntqsocket.h b/src/network/ntqsocket.h index 545647ee5..e5131926b 100644 --- a/src/network/ntqsocket.h +++ b/src/network/ntqsocket.h @@ -83,7 +83,7 @@ public: virtual void setSocketDevice( TQSocketDevice * ); #ifndef QT_NO_DNS - virtual void connectToHost( const TQString &host, Q_UINT16 port ); + virtual void connectToHost( const TQString &host, TQ_UINT16 port ); #endif TQString peerName() const; @@ -96,15 +96,15 @@ public: bool at( Offset ); bool atEnd() const; - Q_ULONG bytesAvailable() const; // ### TQIODevice::Offset instead? - Q_ULONG waitForMore( int msecs, bool *timeout ) const; - Q_ULONG waitForMore( int msecs ) const; // ### TQt 4.0: merge the two overloads - Q_ULONG bytesToWrite() const; + TQ_ULONG bytesAvailable() const; // ### TQIODevice::Offset instead? + TQ_ULONG waitForMore( int msecs, bool *timeout ) const; + TQ_ULONG waitForMore( int msecs ) const; // ### TQt 4.0: merge the two overloads + TQ_ULONG bytesToWrite() const; void clearPendingData(); - Q_LONG readBlock( char *data, Q_ULONG maxlen ); - Q_LONG writeBlock( const char *data, Q_ULONG len ); - Q_LONG readLine( char *data, Q_ULONG maxlen ); + TQ_LONG readBlock( char *data, TQ_ULONG maxlen ); + TQ_LONG writeBlock( const char *data, TQ_ULONG len ); + TQ_LONG readLine( char *data, TQ_ULONG maxlen ); int getch(); int putch( int ); @@ -113,13 +113,13 @@ public: bool canReadLine() const; virtual TQString readLine(); - Q_UINT16 port() const; - Q_UINT16 peerPort() const; + TQ_UINT16 port() const; + TQ_UINT16 peerPort() const; TQHostAddress address() const; TQHostAddress peerAddress() const; - void setReadBufferSize( Q_ULONG ); - Q_ULONG readBufferSize() const; + void setReadBufferSize( TQ_ULONG ); + TQ_ULONG readBufferSize() const; signals: void hostFound(); @@ -141,7 +141,7 @@ private slots: private: TQSocketPrivate *d; - bool consumeWriteBuf( Q_ULONG nbytes ); + bool consumeWriteBuf( TQ_ULONG nbytes ); void tryConnection(); void setSocketIntern( int socket ); diff --git a/src/network/ntqsocketdevice.h b/src/network/ntqsocketdevice.h index a8a5b83cd..bff859343 100644 --- a/src/network/ntqsocketdevice.h +++ b/src/network/ntqsocketdevice.h @@ -95,25 +95,25 @@ public: int sendBufferSize() const; virtual void setSendBufferSize( uint ); - virtual bool connect( const TQHostAddress &, Q_UINT16 ); + virtual bool connect( const TQHostAddress &, TQ_UINT16 ); - virtual bool bind( const TQHostAddress &, Q_UINT16 ); + virtual bool bind( const TQHostAddress &, TQ_UINT16 ); virtual bool listen( int backlog ); virtual int accept(); - Q_LONG bytesAvailable() const; - Q_LONG waitForMore( int msecs, bool *timeout=0 ) const; - Q_LONG readBlock( char *data, Q_ULONG maxlen ); - Q_LONG writeBlock( const char *data, Q_ULONG len ); - virtual Q_LONG writeBlock( const char *data, Q_ULONG len, - const TQHostAddress & host, Q_UINT16 port ); + TQ_LONG bytesAvailable() const; + TQ_LONG waitForMore( int msecs, bool *timeout=0 ) const; + TQ_LONG readBlock( char *data, TQ_ULONG maxlen ); + TQ_LONG writeBlock( const char *data, TQ_ULONG len ); + virtual TQ_LONG writeBlock( const char *data, TQ_ULONG len, + const TQHostAddress & host, TQ_UINT16 port ); int getch(); int putch( int ); int ungetch(int); - Q_UINT16 port() const; - Q_UINT16 peerPort() const; + TQ_UINT16 port() const; + TQ_UINT16 peerPort() const; TQHostAddress address() const; TQHostAddress peerAddress() const; @@ -138,9 +138,9 @@ protected: private: int fd; Type t; - Q_UINT16 p; + TQ_UINT16 p; TQHostAddress a; - Q_UINT16 pp; + TQ_UINT16 pp; TQHostAddress pa; TQSocketDevice::Error e; TQSocketDevicePrivate * d; diff --git a/src/network/qdns.cpp b/src/network/qdns.cpp index ac5ced853..7a4c534fb 100644 --- a/src/network/qdns.cpp +++ b/src/network/qdns.cpp @@ -84,14 +84,14 @@ //#define TQDNS_DEBUG -static Q_UINT16 id; // ### seeded started by now() +static TQ_UINT16 id; // ### seeded started by now() static TQDateTime * originOfTime = 0; static TQCleanupHandler<TQDateTime> qdns_cleanup_time; -static Q_UINT32 now() +static TQ_UINT32 now() { if ( originOfTime ) return originOfTime->secsTo( TQDateTime::currentDateTime() ); @@ -175,18 +175,18 @@ public: TQDns::RecordType t; bool nxdomain; bool current; - Q_UINT32 expireTime; - Q_UINT32 deleteTime; + TQ_UINT32 expireTime; + TQ_UINT32 deleteTime; // somewhat space-wasting per-type data // a / aaaa TQHostAddress address; // cname / mx / srv / ptr TQString target; // mx / srv - Q_UINT16 priority; + TQ_UINT16 priority; // srv - Q_UINT16 weight; - Q_UINT16 port; + TQ_UINT16 weight; + TQ_UINT16 port; // txt TQString text; // could be overloaded into target... private: @@ -204,7 +204,7 @@ public: void take( TQDnsRR * ); - void sweep( Q_UINT32 thisSweep ); + void sweep( TQ_UINT32 thisSweep ); bool isEmpty() const { return rrs == 0 || rrs->isEmpty(); } @@ -222,12 +222,12 @@ public: id( 0 ), t( TQDns::None ), step(0), started(0), dns( new TQPtrDict<void>(17) ) {} ~TQDnsQuery() { delete dns; } - Q_UINT16 id; + TQ_UINT16 id; TQDns::RecordType t; TQString l; uint step; - Q_UINT32 started; + TQ_UINT32 started; TQPtrDict<void> * dns; }; @@ -248,7 +248,7 @@ public: private: TQDnsQuery * query; - Q_UINT8 * answer; + TQ_UINT8 * answer; int size; int pp; @@ -320,7 +320,7 @@ TQDnsAnswer::TQDnsAnswer( const TQByteArray& answer_, { ok = TRUE; - answer = (Q_UINT8 *)(answer_.data()); + answer = (TQ_UINT8 *)(answer_.data()); size = (int)answer_.size(); query = query_; pp = 0; @@ -351,7 +351,7 @@ TQString TQDnsAnswer::readString(bool multipleLabels) { int p = pp; TQString r = TQString::null; - Q_UINT8 b; + TQ_UINT8 b; for( ;; ) { b = 128; // Read one character @@ -1026,14 +1026,14 @@ TQDnsManager::~TQDnsManager() #endif } -static Q_UINT32 lastSweep = 0; +static TQ_UINT32 lastSweep = 0; void TQDnsManager::cleanCache() { bool again = FALSE; TQDictIterator<TQDnsDomain> it( cache ); TQDnsDomain * d; - Q_UINT32 thisSweep = now(); + TQ_UINT32 thisSweep = now(); #if defined(TQDNS_DEBUG) tqDebug( "TQDnsManager::cleanCache(: Called, time is %u, last was %u", thisSweep, lastSweep ); @@ -1094,7 +1094,7 @@ void TQDnsManager::answer() // of our name servers... a.resize( r ); - Q_UINT16 aid = (((Q_UINT8)a[0]) << 8) + ((Q_UINT8)a[1]); + TQ_UINT16 aid = (((TQ_UINT8)a[0]) << 8) + ((TQ_UINT8)a[1]); uint i = 0; while( i < queries.size() && !( queries[i] && queries[i]->id == aid ) ) @@ -1108,7 +1108,7 @@ void TQDnsManager::answer() // at this point queries[i] is whatever we asked for. - if ( ( (Q_UINT8)(a[2]) & 0x80 ) == 0 ) { + if ( ( (TQ_UINT8)(a[2]) & 0x80 ) == 0 ) { #if defined(TQDNS_DEBUG) tqDebug( "DNS Manager: received a query" ); #endif @@ -1527,7 +1527,7 @@ TQPtrList<TQDnsRR> * TQDnsDomain::cached( const TQDns * r ) } -void TQDnsDomain::sweep( Q_UINT32 thisSweep ) +void TQDnsDomain::sweep( TQ_UINT32 thisSweep ) { if ( !rrs ) return; @@ -1920,7 +1920,7 @@ TQString TQDns::toInAddrArpaDomain( const TQHostAddress &address ) // if the address isn't valid, neither of the other two make // cases make sense. better to just return. } else if ( address.isIp4Addr() ) { - Q_UINT32 i = address.ip4Addr(); + TQ_UINT32 i = address.ip4Addr(); s.sprintf( "%d.%d.%d.%d.IN-ADDR.ARPA", i & 0xff, (i >> 8) & 0xff, (i>>16) & 0xff, (i>>24) & 0xff ); } else { @@ -1976,7 +1976,7 @@ bool TQDns::isWorking() const #endif TQPtrList<TQDnsRR> * ll = TQDnsDomain::cached( this ); - Q_LONG queries = n.count(); + TQ_LONG queries = n.count(); while( ll->current() != 0 ) { if ( ll->current()->nxdomain ) { queries--; @@ -2056,7 +2056,7 @@ TQValueList<TQHostAddress> TQDns::addresses() const class \c TQDns::MailServer contains the following public variables: \list \i TQString TQDns::MailServer::name - \i Q_UINT16 TQDns::MailServer::priority + \i TQ_UINT16 TQDns::MailServer::priority \endlist Note that if you want to iterate over the list, you should iterate @@ -2112,9 +2112,9 @@ TQValueList<TQDns::MailServer> TQDns::mailServers() const \c TQDns::Server contains the following public variables: \list \i TQString TQDns::Server::name - \i Q_UINT16 TQDns::Server::priority - \i Q_UINT16 TQDns::Server::weight - \i Q_UINT16 TQDns::Server::port + \i TQ_UINT16 TQDns::Server::priority + \i TQ_UINT16 TQDns::Server::weight + \i TQ_UINT16 TQDns::Server::port \endlist Note that if you want to iterate over the list, you should iterate @@ -2461,7 +2461,7 @@ void TQDns::doResInit() last = nameServer.length(); TQDns tmp( nameServer.mid( first, last-first ), TQDns::A ); TQValueList<TQHostAddress> address = tmp.addresses(); - Q_LONG i = address.count(); + TQ_LONG i = address.count(); while( i ) ns->append( new TQHostAddress(address[--i]) ); first = last+1; diff --git a/src/network/qftp.cpp b/src/network/qftp.cpp index cb7af95a5..222c2a594 100644 --- a/src/network/qftp.cpp +++ b/src/network/qftp.cpp @@ -92,18 +92,18 @@ public: TQString errorMessage() const; void clearError(); - void connectToHost( const TQString & host, Q_UINT16 port ) + void connectToHost( const TQString & host, TQ_UINT16 port ) { socket.connectToHost( host, port ); } TQSocket::State socketState() const { return socket.state(); } - Q_ULONG bytesAvailable() const + TQ_ULONG bytesAvailable() const { return socket.bytesAvailable(); } - Q_LONG readBlock( char *data, Q_ULONG maxlen ) + TQ_LONG readBlock( char *data, TQ_ULONG maxlen ) { - Q_LONG read = socket.readBlock( data, maxlen ); + TQ_LONG read = socket.readBlock( data, maxlen ); bytesDone += read; return read; } @@ -163,7 +163,7 @@ class TQFtpPI : public TQObject public: TQFtpPI( TQObject *parent = 0 ); - void connectToHost( const TQString &host, Q_UINT16 port ); + void connectToHost( const TQString &host, TQ_UINT16 port ); bool sendCommands( const TQStringList &cmds ); bool sendCommand( const TQString &cmd ) @@ -338,7 +338,7 @@ void TQFtpDTP::writeData() const int blockSize = 16*1024; char buf[blockSize]; while ( !data.dev->atEnd() && socket.bytesToWrite()==0 ) { - Q_LONG read = data.dev->readBlock( buf, blockSize ); + TQ_LONG read = data.dev->readBlock( buf, blockSize ); #if defined(TQFTPDTP_DEBUG) tqDebug( "TQFtpDTP::writeData: writeBlock() of size %d bytes", (int)read ); #endif @@ -562,7 +562,7 @@ void TQFtpDTP::socketReadyRead() } else { if ( !is_ba && data.dev ) { TQByteArray ba( socket.bytesAvailable() ); - Q_LONG bytesRead = socket.readBlock( ba.data(), ba.size() ); + TQ_LONG bytesRead = socket.readBlock( ba.data(), ba.size() ); if ( bytesRead < 0 ) { // ### error handling return; @@ -654,7 +654,7 @@ TQFtpPI::TQFtpPI( TQObject *parent ) : SLOT(dtpConnectState(int)) ); } -void TQFtpPI::connectToHost( const TQString &host, Q_UINT16 port ) +void TQFtpPI::connectToHost( const TQString &host, TQ_UINT16 port ) { emit connectState( TQFtp::HostLookup ); commandSocket.connectToHost( host, port ); @@ -884,7 +884,7 @@ bool TQFtpPI::processReply() } else { TQStringList lst = addrPortPattern.capturedTexts(); TQString host = lst[1] + "." + lst[2] + "." + lst[3] + "." + lst[4]; - Q_UINT16 port = ( lst[5].toUInt() << 8 ) + lst[6].toUInt(); + TQ_UINT16 port = ( lst[5].toUInt() << 8 ) + lst[6].toUInt(); waitForDtpToConnect = TRUE; dtp.connectToHost( host, port ); } @@ -1448,7 +1448,7 @@ void TQFtp::init() \sa stateChanged() commandStarted() commandFinished() */ -int TQFtp::connectToHost( const TQString &host, Q_UINT16 port ) +int TQFtp::connectToHost( const TQString &host, TQ_UINT16 port ) { TQStringList cmds; cmds << host; @@ -1761,7 +1761,7 @@ int TQFtp::rawCommand( const TQString &command ) \sa get() readyRead() readBlock() readAll() */ -Q_ULONG TQFtp::bytesAvailable() const +TQ_ULONG TQFtp::bytesAvailable() const { TQFtpPrivate *d = ::d( this ); return d->pi.dtp.bytesAvailable(); @@ -1773,7 +1773,7 @@ Q_ULONG TQFtp::bytesAvailable() const \sa get() readyRead() bytesAvailable() readAll() */ -Q_LONG TQFtp::readBlock( char *data, Q_ULONG maxlen ) +TQ_LONG TQFtp::readBlock( char *data, TQ_ULONG maxlen ) { TQFtpPrivate *d = ::d( this ); return d->pi.dtp.readBlock( data, maxlen ); diff --git a/src/network/qhostaddress.cpp b/src/network/qhostaddress.cpp index 43d614cc9..fdbc0e395 100644 --- a/src/network/qhostaddress.cpp +++ b/src/network/qhostaddress.cpp @@ -45,10 +45,10 @@ class TQHostAddressPrivate { public: - TQHostAddressPrivate( Q_UINT32 a_=0 ) : a(a_), isIp4(TRUE) + TQHostAddressPrivate( TQ_UINT32 a_=0 ) : a(a_), isIp4(TRUE) { } - TQHostAddressPrivate( Q_UINT8 *a_ ); + TQHostAddressPrivate( TQ_UINT8 *a_ ); TQHostAddressPrivate(const Q_IPV6ADDR &a_); ~TQHostAddressPrivate() { @@ -63,14 +63,14 @@ public: } private: - Q_UINT32 a; // ip 4 address + TQ_UINT32 a; // ip 4 address Q_IPV6ADDR a6; // ip 6 address bool isIp4; friend class TQHostAddress; }; -TQHostAddressPrivate::TQHostAddressPrivate(Q_UINT8 *a_) : a(0), isIp4(FALSE) +TQHostAddressPrivate::TQHostAddressPrivate(TQ_UINT8 *a_) : a(0), isIp4(FALSE) { for ( int i=0; i<16; i++ ) { a6.c[i] = a_[i]; @@ -119,7 +119,7 @@ TQHostAddress::TQHostAddress() /*! Creates a host address object for the IPv4 address \a ip4Addr. */ -TQHostAddress::TQHostAddress( Q_UINT32 ip4Addr ) +TQHostAddress::TQHostAddress( TQ_UINT32 ip4Addr ) : d( new TQHostAddressPrivate( ip4Addr ) ) { } @@ -131,7 +131,7 @@ TQHostAddress::TQHostAddress( Q_UINT32 ip4Addr ) \a ip6Addr must be a 16 byte array in network byte order (high-order byte first). */ -TQHostAddress::TQHostAddress( Q_UINT8 *ip6Addr ) +TQHostAddress::TQHostAddress( TQ_UINT8 *ip6Addr ) : d( new TQHostAddressPrivate( ip6Addr ) ) { } @@ -188,7 +188,7 @@ TQHostAddress & TQHostAddress::operator=( const TQHostAddress & address ) /*! Set the IPv4 address specified by \a ip4Addr. */ -void TQHostAddress::setAddress( Q_UINT32 ip4Addr ) +void TQHostAddress::setAddress( TQ_UINT32 ip4Addr ) { delete d; d = new TQHostAddressPrivate( ip4Addr ); @@ -203,14 +203,14 @@ void TQHostAddress::setAddress( Q_UINT32 ip4Addr ) \a ip6Addr must be a 16 byte array in network byte order (high-order byte first). */ -void TQHostAddress::setAddress( Q_UINT8 *ip6Addr ) +void TQHostAddress::setAddress( TQ_UINT8 *ip6Addr ) { delete d; d = new TQHostAddressPrivate( ip6Addr ); } #ifndef QT_NO_STRINGLIST -static bool parseIp4(const TQString& address, Q_UINT32 *addr) +static bool parseIp4(const TQString& address, TQ_UINT32 *addr) { TQStringList ipv4 = TQStringList::split(".", address, FALSE); if (ipv4.count() == 4) { @@ -243,7 +243,7 @@ bool TQHostAddress::setAddress(const TQString& address) TQString a = address.simplifyWhiteSpace(); // try ipv4 - Q_UINT32 maybeIp4 = 0; + TQ_UINT32 maybeIp4 = 0; if (parseIp4(address, &maybeIp4)) { setAddress(maybeIp4); return TRUE; @@ -256,7 +256,7 @@ bool TQHostAddress::setAddress(const TQString& address) return FALSE; // there must be at least two ":" if (count > 8) return FALSE; // maximum of seven ":" exceeded - Q_UINT8 maybeIp6[16]; + TQ_UINT8 maybeIp6[16]; int mc = 16; int fillCount = 9 - count; for (int i=count-1; i>=0; --i) { @@ -339,7 +339,7 @@ bool TQHostAddress::isIPv4Address() const Use toIPv4Address() instead. */ -Q_UINT32 TQHostAddress::ip4Addr() const +TQ_UINT32 TQHostAddress::ip4Addr() const { return toIPv4Address(); } @@ -354,7 +354,7 @@ Q_UINT32 TQHostAddress::ip4Addr() const \sa toString() */ -Q_UINT32 TQHostAddress::toIPv4Address() const +TQ_UINT32 TQHostAddress::toIPv4Address() const { return d->a; } @@ -402,16 +402,16 @@ Q_IPV6ADDR TQHostAddress::toIPv6Address() const TQString TQHostAddress::toString() const { if ( d->isIp4 ) { - Q_UINT32 i = ip4Addr(); + TQ_UINT32 i = ip4Addr(); TQString s; s.sprintf( "%d.%d.%d.%d", (i>>24) & 0xff, (i>>16) & 0xff, (i >> 8) & 0xff, i & 0xff ); return s; } else { - Q_UINT16 ugle[8]; + TQ_UINT16 ugle[8]; for ( int i=0; i<8; i++ ) { - ugle[i] = ( (Q_UINT16)( d->a6.c[2*i] ) << 8 ) | - ( (Q_UINT16)( d->a6.c[2*i+1] ) ); + ugle[i] = ( (TQ_UINT16)( d->a6.c[2*i] ) << 8 ) | + ( (TQ_UINT16)( d->a6.c[2*i+1] ) ); } TQString s; s.sprintf( "%X:%X:%X:%X:%X:%X:%X:%X", diff --git a/src/network/qhttp.cpp b/src/network/qhttp.cpp index 1962557bb..af50e8cef 100644 --- a/src/network/qhttp.cpp +++ b/src/network/qhttp.cpp @@ -80,7 +80,7 @@ public: TQString errorString; TQString hostname; - Q_UINT16 port; + TQ_UINT16 port; TQByteArray buffer; TQIODevice* toDevice; @@ -88,7 +88,7 @@ public: uint bytesDone; uint bytesTotal; - Q_LONG chunkedSize; + TQ_LONG chunkedSize; TQHttpRequestHeader header; @@ -278,7 +278,7 @@ void TQHttpPGHRequest::start( TQHttp *http ) class TQHttpSetHostRequest : public TQHttpRequest { public: - TQHttpSetHostRequest( const TQString &h, Q_UINT16 p ) : + TQHttpSetHostRequest( const TQString &h, TQ_UINT16 p ) : hostname(h), port(p) { } @@ -291,7 +291,7 @@ public: private: TQString hostname; - Q_UINT16 port; + TQ_UINT16 port; }; void TQHttpSetHostRequest::start( TQHttp *http ) @@ -1208,7 +1208,7 @@ TQHttp::TQHttp( TQObject* parent, const char* name ) \sa setHost() */ -TQHttp::TQHttp( const TQString &hostname, Q_UINT16 port, TQObject* parent, const char* name ) +TQHttp::TQHttp( const TQString &hostname, TQ_UINT16 port, TQObject* parent, const char* name ) { if ( parent ) parent->insertChild( this ); @@ -1432,7 +1432,7 @@ void TQHttp::abort() \sa get() post() request() readyRead() readBlock() readAll() */ -Q_ULONG TQHttp::bytesAvailable() const +TQ_ULONG TQHttp::bytesAvailable() const { #if defined(TQHTTP_DEBUG) tqDebug( "TQHttp::bytesAvailable(): %d bytes", (int)d->rba.size() ); @@ -1446,7 +1446,7 @@ Q_ULONG TQHttp::bytesAvailable() const \sa get() post() request() readyRead() bytesAvailable() readAll() */ -Q_LONG TQHttp::readBlock( char *data, Q_ULONG maxlen ) +TQ_LONG TQHttp::readBlock( char *data, TQ_ULONG maxlen ) { if ( data == 0 && maxlen != 0 ) { #if defined(QT_CHECK_NULL) @@ -1472,9 +1472,9 @@ Q_LONG TQHttp::readBlock( char *data, Q_ULONG maxlen ) */ TQByteArray TQHttp::readAll() { - Q_ULONG avail = bytesAvailable(); + TQ_ULONG avail = bytesAvailable(); TQByteArray tmp( avail ); - Q_LONG read = readBlock( tmp.data(), avail ); + TQ_LONG read = readBlock( tmp.data(), avail ); tmp.resize( read ); return tmp; } @@ -1591,7 +1591,7 @@ void TQHttp::clearPendingRequests() \sa get() post() head() request() requestStarted() requestFinished() done() */ -int TQHttp::setHost(const TQString &hostname, Q_UINT16 port ) +int TQHttp::setHost(const TQString &hostname, TQ_UINT16 port ) { return addRequest( new TQHttpSetHostRequest( hostname, port ) ); } @@ -1998,7 +1998,7 @@ void TQHttp::slotReadyRead() if ( currentRequest().method() == "HEAD" ) { everythingRead = TRUE; } else { - Q_ULONG n = d->socket.bytesAvailable(); + TQ_ULONG n = d->socket.bytesAvailable(); TQByteArray *arr = 0; if ( d->chunkedSize != -1 ) { // transfer-encoding is chunked @@ -2039,19 +2039,19 @@ void TQHttp::slotReadyRead() n = d->socket.bytesAvailable(); if ( n == 0 ) break; - if ( (Q_LONG)n == d->chunkedSize || (Q_LONG)n == d->chunkedSize+1 ) { + if ( (TQ_LONG)n == d->chunkedSize || (TQ_LONG)n == d->chunkedSize+1 ) { n = d->chunkedSize - 1; if ( n == 0 ) break; } // read data - uint toRead = TQMIN( (Q_LONG)n, (d->chunkedSize < 0 ? (Q_LONG)n : d->chunkedSize) ); + uint toRead = TQMIN( (TQ_LONG)n, (d->chunkedSize < 0 ? (TQ_LONG)n : d->chunkedSize) ); if ( !arr ) arr = new TQByteArray( 0 ); uint oldArrSize = arr->size(); arr->resize( oldArrSize + toRead ); - Q_LONG read = d->socket.readBlock( arr->data()+oldArrSize, toRead ); + TQ_LONG read = d->socket.readBlock( arr->data()+oldArrSize, toRead ); arr->resize( oldArrSize + read ); d->chunkedSize -= read; @@ -2071,7 +2071,7 @@ void TQHttp::slotReadyRead() n = TQMIN( d->response.contentLength() - d->bytesDone, n ); if ( n > 0 ) { arr = new TQByteArray( n ); - Q_LONG read = d->socket.readBlock( arr->data(), n ); + TQ_LONG read = d->socket.readBlock( arr->data(), n ); arr->resize( read ); } if ( d->bytesDone + bytesAvailable() + n == d->response.contentLength() ) diff --git a/src/network/qserversocket.cpp b/src/network/qserversocket.cpp index 840ee231c..97dd95594 100644 --- a/src/network/qserversocket.cpp +++ b/src/network/qserversocket.cpp @@ -94,7 +94,7 @@ public: value larger than 0. */ -TQServerSocket::TQServerSocket( Q_UINT16 port, int backlog, +TQServerSocket::TQServerSocket( TQ_UINT16 port, int backlog, TQObject *parent, const char *name ) : TQObject( parent, name ) { @@ -116,7 +116,7 @@ TQServerSocket::TQServerSocket( Q_UINT16 port, int backlog, value larger than 0. */ -TQServerSocket::TQServerSocket( const TQHostAddress & address, Q_UINT16 port, +TQServerSocket::TQServerSocket( const TQHostAddress & address, TQ_UINT16 port, int backlog, TQObject *parent, const char *name ) : TQObject( parent, name ) @@ -157,7 +157,7 @@ bool TQServerSocket::ok() const /* The common bit of the constructors. */ -void TQServerSocket::init( const TQHostAddress & address, Q_UINT16 port, int backlog ) +void TQServerSocket::init( const TQHostAddress & address, TQ_UINT16 port, int backlog ) { d->s = new TQSocketDevice( TQSocketDevice::Stream, address.isIPv4Address() ? TQSocketDevice::IPv4 : TQSocketDevice::IPv6, 0 ); @@ -224,7 +224,7 @@ void TQServerSocket::incomingConnection( int ) \sa address() TQSocketDevice::port() */ -Q_UINT16 TQServerSocket::port() const +TQ_UINT16 TQServerSocket::port() const { if ( !d || !d->s ) return 0; diff --git a/src/network/qsocket.cpp b/src/network/qsocket.cpp index 10cd2173e..fe6e0b6c0 100644 --- a/src/network/qsocket.cpp +++ b/src/network/qsocket.cpp @@ -88,7 +88,7 @@ buffer.open( IO_ReadOnly ); TQDataStream os( &buffer ); - Q_UINT32 x; + TQ_UINT32 x; os >> x; buffer.close(); @@ -101,7 +101,7 @@ TQBuffer buf; buf.open( IO_ReadOnly ); TQDataStream ds( &buf ); - Q_INT32 x; + TQ_INT32 x; ds >> x; buf.close(); @@ -123,11 +123,11 @@ public: TQSocket::State state; // connection state TQString host; // host name - Q_UINT16 port; // host port + TQ_UINT16 port; // host port TQSocketDevice *socket; // connection socket TQSocketNotifier *rsn, *wsn; // socket notifiers TQMembuf rba; // read buffer - Q_ULONG readBufferSize; // limit for the read buffer size + TQ_ULONG readBufferSize; // limit for the read buffer size TQPtrList<TQByteArray> wba; // list of write bufs TQHostAddress addr; // connection address TQValueList<TQHostAddress> addresses; // alternatives looked up @@ -408,7 +408,7 @@ TQSocket::State TQSocket::state() const \sa state() */ -void TQSocket::connectToHost( const TQString &host, Q_UINT16 port ) +void TQSocket::connectToHost( const TQString &host, TQ_UINT16 port ) { #if defined(TQSOCKET_DEBUG) tqDebug( "TQSocket (%s)::connectToHost: host %s, port %d", @@ -716,7 +716,7 @@ void TQSocket::close() buffer. */ -bool TQSocket::consumeWriteBuf( Q_ULONG nbytes ) +bool TQSocket::consumeWriteBuf( TQ_ULONG nbytes ) { if ( nbytes <= 0 || nbytes > d->wsize ) return FALSE; @@ -860,7 +860,7 @@ bool TQSocket::at( Offset index ) { if ( index > d->rba.size() ) return FALSE; - d->rba.consumeBytes( (Q_ULONG)index, 0 ); // throw away data 0..index-1 + d->rba.consumeBytes( (TQ_ULONG)index, 0 ); // throw away data 0..index-1 // After we read data from our internal buffer, if we use the // setReadBufferSize() to limit our buffer, we might now be able to // read more data in our buffer. So enable the read socket notifier, @@ -899,7 +899,7 @@ bool TQSocket::atEnd() const \sa bytesToWrite() */ -Q_ULONG TQSocket::bytesAvailable() const +TQ_ULONG TQSocket::bytesAvailable() const { if ( d->socket == 0 ) return 0; @@ -929,7 +929,7 @@ Q_ULONG TQSocket::bytesAvailable() const \sa bytesAvailable() */ -Q_ULONG TQSocket::waitForMore( int msecs, bool *timeout ) const +TQ_ULONG TQSocket::waitForMore( int msecs, bool *timeout ) const { if ( d->socket == 0 ) return 0; @@ -942,7 +942,7 @@ Q_ULONG TQSocket::waitForMore( int msecs, bool *timeout ) const /*! \overload */ -Q_ULONG TQSocket::waitForMore( int msecs ) const +TQ_ULONG TQSocket::waitForMore( int msecs ) const { return waitForMore( msecs, 0 ); } @@ -954,7 +954,7 @@ Q_ULONG TQSocket::waitForMore( int msecs ) const \sa bytesAvailable() clearPendingData() */ -Q_ULONG TQSocket::bytesToWrite() const +TQ_ULONG TQSocket::bytesToWrite() const { return d->wsize; } @@ -977,7 +977,7 @@ void TQSocket::clearPendingData() number of bytes read. Returns -1 if an error occurred. */ -Q_LONG TQSocket::readBlock( char *data, Q_ULONG maxlen ) +TQ_LONG TQSocket::readBlock( char *data, TQ_ULONG maxlen ) { if ( data == 0 && maxlen != 0 ) { #if defined(QT_CHECK_NULL) @@ -1015,7 +1015,7 @@ Q_LONG TQSocket::readBlock( char *data, Q_ULONG maxlen ) number of bytes written. Returns -1 if an error occurred. */ -Q_LONG TQSocket::writeBlock( const char *data, Q_ULONG len ) +TQ_LONG TQSocket::writeBlock( const char *data, TQ_ULONG len ) { #if defined(QT_CHECK_NULL) if ( data == 0 && len != 0 ) { @@ -1158,7 +1158,7 @@ bool TQSocket::canReadLine() const \internal So that it's not hidden by our other readLine(). */ -Q_LONG TQSocket::readLine( char *data, Q_ULONG maxlen ) +TQ_LONG TQSocket::readLine( char *data, TQ_ULONG maxlen ) { return TQIODevice::readLine(data,maxlen); } @@ -1196,7 +1196,7 @@ TQString TQSocket::readLine() void TQSocket::sn_read( bool force ) { - Q_LONG maxToRead = 0; + TQ_LONG maxToRead = 0; if ( d->readBufferSize > 0 ) { maxToRead = d->readBufferSize - d->rba.size(); if ( maxToRead <= 0 ) { @@ -1214,8 +1214,8 @@ void TQSocket::sn_read( bool force ) TQSocketPrivate::sn_read_alreadyCalled.append( this ); char buf[4096]; - Q_LONG nbytes = d->socket->bytesAvailable(); - Q_LONG nread; + TQ_LONG nbytes = d->socket->bytesAvailable(); + TQ_LONG nread; TQByteArray *a = 0; if ( state() == Connecting ) { @@ -1239,7 +1239,7 @@ void TQSocket::sn_read( bool force ) // event is processed. A new read operation would then block. // This code is also useful when TQSocket is used without an // event loop. - nread = d->socket->readBlock( buf, maxToRead ? TQMIN((Q_LONG)sizeof(buf),maxToRead) : sizeof(buf) ); + nread = d->socket->readBlock( buf, maxToRead ? TQMIN((TQ_LONG)sizeof(buf),maxToRead) : sizeof(buf) ); if ( nread == 0 ) { // really closed if ( !d->socket->isOpen() ) { #if defined(TQSOCKET_DEBUG) @@ -1280,7 +1280,7 @@ void TQSocket::sn_read( bool force ) nread = d->socket->readBlock( a->data(), maxToRead ? TQMIN(nbytes,maxToRead) : nbytes ); } else { a = 0; - nread = d->socket->readBlock( buf, maxToRead ? TQMIN((Q_LONG)sizeof(buf),maxToRead) : sizeof(buf) ); + nread = d->socket->readBlock( buf, maxToRead ? TQMIN((TQ_LONG)sizeof(buf),maxToRead) : sizeof(buf) ); if ( nread > 0 ) { // ##### could setRawData a = new TQByteArray( nread ); @@ -1408,7 +1408,7 @@ void TQSocket::setSocketIntern( int socket ) clearPendingData(); close(); } - Q_ULONG oldBufferSize = d ? d->readBufferSize : 0; + TQ_ULONG oldBufferSize = d ? d->readBufferSize : 0; delete d; d = new TQSocketPrivate; @@ -1443,7 +1443,7 @@ void TQSocket::setSocketIntern( int socket ) Returns the host port number of this socket, in native byte order. */ -Q_UINT16 TQSocket::port() const +TQ_UINT16 TQSocket::port() const { if ( d->socket == 0 ) return 0; @@ -1460,7 +1460,7 @@ Q_UINT16 TQSocket::port() const there is no need to call htons(). */ -Q_UINT16 TQSocket::peerPort() const +TQ_UINT16 TQSocket::peerPort() const { if ( d->socket == 0 ) return 0; @@ -1527,7 +1527,7 @@ TQString TQSocket::peerName() const \sa readBufferSize() */ -void TQSocket::setReadBufferSize( Q_ULONG bufSize ) +void TQSocket::setReadBufferSize( TQ_ULONG bufSize ) { d->readBufferSize = bufSize; } @@ -1538,7 +1538,7 @@ void TQSocket::setReadBufferSize( Q_ULONG bufSize ) \sa setReadBufferSize() */ -Q_ULONG TQSocket::readBufferSize() const +TQ_ULONG TQSocket::readBufferSize() const { return d->readBufferSize; } diff --git a/src/network/qsocketdevice.cpp b/src/network/qsocketdevice.cpp index 7be3accb1..a2055899d 100644 --- a/src/network/qsocketdevice.cpp +++ b/src/network/qsocketdevice.cpp @@ -539,7 +539,7 @@ void TQSocketDevice::setSendBufferSize( uint size ) Note that TQt always uses native byte order, i.e. 67 is 67 in TQt; there is no need to call htons(). */ -Q_UINT16 TQSocketDevice::port() const +TQ_UINT16 TQSocketDevice::port() const { return p; } diff --git a/src/network/qsocketdevice_unix.cpp b/src/network/qsocketdevice_unix.cpp index 2d359f218..827cc349b 100644 --- a/src/network/qsocketdevice_unix.cpp +++ b/src/network/qsocketdevice_unix.cpp @@ -91,7 +91,7 @@ static inline int qt_socket_socket(int domain, int type, int protocol) static inline void qt_socket_getportaddr( struct sockaddr *sa, - Q_UINT16 *port, TQHostAddress *addr ) + TQ_UINT16 *port, TQHostAddress *addr ) { #if !defined(QT_NO_IPV6) if ( sa->sa_family == AF_INET6 ) { @@ -402,7 +402,7 @@ void TQSocketDevice::setOption( Option opt, int v ) sockets; this just means that you can call connect() again in a little while and it'll probably succeed. */ -bool TQSocketDevice::connect( const TQHostAddress &addr, Q_UINT16 port ) +bool TQSocketDevice::connect( const TQHostAddress &addr, TQ_UINT16 port ) { if ( !isValid() ) return FALSE; @@ -493,7 +493,7 @@ bool TQSocketDevice::connect( const TQHostAddress &addr, Q_UINT16 port ) bind() is used by servers for setting up incoming connections. Call bind() before listen(). */ -bool TQSocketDevice::bind( const TQHostAddress &address, Q_UINT16 port ) +bool TQSocketDevice::bind( const TQHostAddress &address, TQ_UINT16 port ) { if ( !isValid() ) return FALSE; @@ -671,7 +671,7 @@ int TQSocketDevice::accept() data on the socket is to read it using readBlock(). TQSocket has workarounds to deal with this problem. */ -Q_LONG TQSocketDevice::bytesAvailable() const +TQ_LONG TQSocketDevice::bytesAvailable() const { if ( !isValid() ) return -1; @@ -695,7 +695,7 @@ Q_LONG TQSocketDevice::bytesAvailable() const // gives shorter than true amounts on Unix domain sockets. if ( ::ioctl(fd, FIONREAD, (char*)&nbytes) < 0 ) return -1; - return (Q_LONG) *((int *) &nbytes); + return (TQ_LONG) *((int *) &nbytes); } @@ -717,7 +717,7 @@ Q_LONG TQSocketDevice::bytesAvailable() const \sa bytesAvailable() */ -Q_LONG TQSocketDevice::waitForMore( int msecs, bool *timeout ) const +TQ_LONG TQSocketDevice::waitForMore( int msecs, bool *timeout ) const { if ( !isValid() ) return -1; @@ -756,7 +756,7 @@ Q_LONG TQSocketDevice::waitForMore( int msecs, bool *timeout ) const host closes the connection. For Datagram sockets, 0 is a valid datagram size. */ -Q_LONG TQSocketDevice::readBlock( char *data, Q_ULONG maxlen ) +TQ_LONG TQSocketDevice::readBlock( char *data, TQ_ULONG maxlen ) { #if defined(QT_CHECK_NULL) if ( data == 0 && maxlen != 0 ) { @@ -847,7 +847,7 @@ Q_LONG TQSocketDevice::readBlock( char *data, Q_ULONG maxlen ) This is used for \c TQSocketDevice::Stream sockets. */ -Q_LONG TQSocketDevice::writeBlock( const char *data, Q_ULONG len ) +TQ_LONG TQSocketDevice::writeBlock( const char *data, TQ_ULONG len ) { if ( data == 0 && len != 0 ) { #if defined(QT_CHECK_NULL) || defined(TQSOCKETDEVICE_DEBUG) @@ -934,8 +934,8 @@ Q_LONG TQSocketDevice::writeBlock( const char *data, Q_ULONG len ) This is used for \c TQSocketDevice::Datagram sockets. You must specify the \a host and \a port of the destination of the data. */ -Q_LONG TQSocketDevice::writeBlock( const char * data, Q_ULONG len, - const TQHostAddress & host, Q_UINT16 port ) +TQ_LONG TQSocketDevice::writeBlock( const char * data, TQ_ULONG len, + const TQHostAddress & host, TQ_UINT16 port ) { if ( t != Datagram ) { #if defined(QT_CHECK_STATE) || defined(TQSOCKETDEVICE_DEBUG) @@ -1077,7 +1077,7 @@ void TQSocketDevice::fetchConnectionParameters() Note that for Datagram sockets, this is the source port of the last packet received, and that it is in native byte order. */ -Q_UINT16 TQSocketDevice::peerPort() const +TQ_UINT16 TQSocketDevice::peerPort() const { return pp; } |