summaryrefslogtreecommitdiffstats
path: root/tdecore/kextsock.h
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/kextsock.h')
-rw-r--r--tdecore/kextsock.h67
1 files changed, 24 insertions, 43 deletions
diff --git a/tdecore/kextsock.h b/tdecore/kextsock.h
index fad502c04..3b3018b59 100644
--- a/tdecore/kextsock.h
+++ b/tdecore/kextsock.h
@@ -22,10 +22,6 @@
#include "tdelibs_export.h"
-#ifdef Q_MOC_RUN
-#define Q_OS_UNIX
-#endif // Q_MOC_RUN
-
#ifdef Q_OS_UNIX
#include <sys/time.h>
@@ -44,10 +40,10 @@ class KAddressInfo; /* our abstraction of it */
class TQSocketNotifier;
/*
- * This is extending QIODevice's error codes
+ * This is extending TQIODevice's error codes
*
* According to tqiodevice.h, the last error is IO_UnspecifiedError
- * These errors will never occur in functions declared in QIODevice
+ * These errors will never occur in functions declared in TQIODevice
* (except open, but you shouldn't call open)
*/
#define IO_ListenError (IO_UnspecifiedError+1)
@@ -67,7 +63,7 @@ class KExtendedSocketPrivate;
* only difference is that the passiveSocket flag must be passed either to
* the constructor or to setSocketFlags(). If passiveSocket is used, the class will
* enable functions listen() and accept() and related signals, and will
- * also disable tqreadBlock() and tqwriteBlock().
+ * also disable readBlock() and writeBlock().
*
* To create a Unix socket, one would pass flag unixSocket to the constructor
* or setSocketFlags(). The hostname and service/port can be set to whatever is
@@ -92,9 +88,9 @@ class KExtendedSocketPrivate;
* @author Thiago Macieira <thiago.macieira@kdemail.net>
* @short an extended socket
*/
-class TDECORE_EXPORT KExtendedSocket: public TDEBufferedIO // public TQObject, public QIODevice
+class TDECORE_EXPORT KExtendedSocket: public TDEBufferedIO // public TQObject, public TQIODevice
{
- Q_OBJECT
+ TQ_OBJECT
public:
@@ -211,12 +207,7 @@ public:
* freeing any related resources still being kept.
* @since 3.1
*/
-#ifdef USE_QT3
void reset();
-#endif // USE_QT3
-#ifdef USE_QT4
- bool reset();
-#endif // USE_QT4
/*
* --- status, flags and internal variables --- *
@@ -627,7 +618,7 @@ public:
* @return true if successful, false when an error occurred or the most was
* not correct
*/
- virtual bool open(TQ_OpenMode mode = (TQ_OpenMode)(IO_Raw | IO_ReadWrite));
+ virtual bool open(int mode = (int)(IO_Raw | IO_ReadWrite));
/**
* Closes the socket. If we have data still in the write buffer yet to be
@@ -677,7 +668,7 @@ public:
* ready to receive data, it will block, unless this is a non-blocking socket.
*
* This function does not touch the read buffer. You can empty it by calling
- * tqreadBlock() with a null destination buffer.
+ * readBlock() with a null destination buffer.
*/
virtual void flush();
@@ -685,12 +676,7 @@ public:
* Returns length of this socket. This call is not supported on sockets.
* @return the length of this socket, or 0 if unsupported
*/
-#ifdef USE_QT3
virtual inline TQ_ULONG size() const
-#endif // USE_QT3
-#ifdef USE_QT4
- virtual inline qint64 size() const
-#endif // USE_QT4
{ return 0; }
/**
@@ -745,7 +731,7 @@ public:
* This function returns 0, if the function detected end-of-file condition
* (socket was closed)
*/
- virtual TQT_TQIO_LONG tqreadBlock(char *data, TQT_TQIO_ULONG maxlen);
+ virtual TQ_LONG readBlock(char *data, TQ_ULONG maxlen);
/**
* Writes a block of data to the socket.
@@ -770,7 +756,7 @@ public:
* The return value might be less than @p len if the output buffers cannot
* accommodate that many bytes and -1 in the case of an errro.
*/
- virtual TQT_TQIO_LONG tqwriteBlock(const char *data, TQT_TQIO_ULONG len);
+ virtual TQ_LONG writeBlock(const char *data, TQ_ULONG len);
/**
* Peeks at a block of data from the socket.
@@ -805,12 +791,7 @@ public:
* @return The number of available bytes, or -1 on error or -2 if this call is invalid
* in the current state.
*/
-#ifdef USE_QT3
virtual int bytesAvailable() const;
-#endif // USE_QT3
-#ifdef USE_QT4
- virtual qint64 bytesAvailable() const;
-#endif // USE_QT4
/**
* Waits @p msec milliseconds for more data to be available (use 0 to
@@ -950,7 +931,7 @@ public:
* @param flags the same flags as getnameinfo()
* @returns 0 on success, nonzero otherwise.
*/
- static int resolve(sockaddr* sock, ksocklen_t len, TQString& host, TQString& port, int flags = 0) KDE_DEPRECATED;
+ static int resolve(sockaddr* sock, ksocklen_t len, TQString& host, TQString& port, int flags = 0) TDE_DEPRECATED;
/**
* Performs resolution on the given socket address.
@@ -964,7 +945,7 @@ public:
* @param flags the same flags as getnameinfo()
* @returns 0 on success, nonzero otherwise.
*/
- static int resolve(::TDESocketAddress* sock, TQString& host, TQString& port, int flags = 0) KDE_DEPRECATED;
+ static int resolve(::TDESocketAddress* sock, TQString& host, TQString& port, int flags = 0) TDE_DEPRECATED;
/** @deprecated
* This function is now deprecated. Please use @ref KNetwork::KResolver::resolve.
@@ -986,7 +967,7 @@ public:
* @param error pointer to a variable holding the error code
* @return a list of KAddressInfos
*/
- static TQPtrList<KAddressInfo> lookup(const TQString& host, const TQString& port, int flags = 0, int *error = 0) KDE_DEPRECATED;
+ static TQPtrList<KAddressInfo> lookup(const TQString& host, const TQString& port, int flags = 0, int *error = 0) TDE_DEPRECATED;
/**
* Returns the local socket address
@@ -994,7 +975,7 @@ public:
* @param fd the file descriptor
* @return the local socket address or 0 if an error occurred. Delete after use.
*/
- static ::TDESocketAddress *localAddress(int fd) KDE_DEPRECATED;
+ static ::TDESocketAddress *localAddress(int fd) TDE_DEPRECATED;
/**
* Returns the peer socket address. Use KExtendedSocket::resolve() to
@@ -1003,7 +984,7 @@ public:
* @param fd the file descriptor
* @return the peer socket address or 0 if an error occurred. Delete after use.
*/
- static ::TDESocketAddress *peerAddress(int fd) KDE_DEPRECATED;
+ static ::TDESocketAddress *peerAddress(int fd) TDE_DEPRECATED;
/**
* Returns the representing text of this error code
@@ -1022,7 +1003,7 @@ public:
* @param enable if true, set address reusable
* @return true on success, false on failure.
*/
- static bool setAddressReusable(int fd, bool enable) KDE_DEPRECATED;
+ static bool setAddressReusable(int fd, bool enable) TDE_DEPRECATED;
protected:
virtual void virtual_hook( int id, void* data );
@@ -1059,20 +1040,20 @@ public:
* Returns the KAddressInfo's TDESocketAddress.
* Only valid as long as the KAddressInfo exists.
*/
- inline KDE_DEPRECATED operator const ::TDESocketAddress*() const
+ inline TDE_DEPRECATED operator const ::TDESocketAddress*() const
{ return addr; }
/**
* Returns the KAddressInfo's addrinfo.
*/
- inline KDE_DEPRECATED operator const addrinfo&() const
+ inline TDE_DEPRECATED operator const addrinfo&() const
{ return *ai; }
/**
* Returns a pointer to KAddressInfo's addrinfo.
* Only valid as long as the KAddressInfo exists.
*/
- inline KDE_DEPRECATED operator const addrinfo*() const
+ inline TDE_DEPRECATED operator const addrinfo*() const
{ return ai; }
/**
@@ -1080,32 +1061,32 @@ public:
* Only valid as long as the KAddressInfo exists.
* @return the KAddressInfo's TDESocketAddress.
*/
- inline KDE_DEPRECATED const ::TDESocketAddress* address() const
+ inline TDE_DEPRECATED const ::TDESocketAddress* address() const
{ return addr; }
/**
* Returns the flags of the address info (see getaddrinfo(3)).
* @return the flags of the addres info.
*/
- int flags() const KDE_DEPRECATED;
+ int flags() const TDE_DEPRECATED;
/**
* Returns the family of the address info (see getaddrinfo(3)).
* @return the family of the addres info.
*/
- int family() const KDE_DEPRECATED;
+ int family() const TDE_DEPRECATED;
/**
* Returns the socket type of the address info (see getaddrinfo(3)).
* @return the socket type of the addres info.
*/
- int socktype() const KDE_DEPRECATED;
+ int socktype() const TDE_DEPRECATED;
/**
* Returns the protocol of the address info (see getaddrinfo(3)).
* @return the protocol of the addres info.
*/
- int protocol() const KDE_DEPRECATED;
+ int protocol() const TDE_DEPRECATED;
/**
@@ -1113,7 +1094,7 @@ public:
* Only valid as long as the KAddressInfo exists.
* @return the official name of the host
*/
- const char* canonname() const KDE_DEPRECATED;
+ const char* canonname() const TDE_DEPRECATED;
/**
* Returns the length of the TDESocketAddress.