author | ulf69 <ulf69> | 2004-10-15 05:30:12 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-15 05:30:12 (UTC) |
commit | c2fb960297c4b08980921c818a4d347057732390 (patch) (side-by-side diff) | |
tree | b96dba18fa1af192eeb4bd2da0b2dc1805cf3c96 /pwmanager/pwmanager/ipc.h | |
parent | 6b6545368e5a5746c6fec02bb8d0708333f894e0 (diff) | |
download | kdepimpi-c2fb960297c4b08980921c818a4d347057732390.zip kdepimpi-c2fb960297c4b08980921c818a4d347057732390.tar.gz kdepimpi-c2fb960297c4b08980921c818a4d347057732390.tar.bz2 |
replaced system calls that do nto comply with gcc2.95
-rw-r--r-- | pwmanager/pwmanager/ipc.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/pwmanager/pwmanager/ipc.h b/pwmanager/pwmanager/ipc.h index ccdaafb..e5a496d 100644 --- a/pwmanager/pwmanager/ipc.h +++ b/pwmanager/pwmanager/ipc.h @@ -20,10 +20,14 @@ #ifndef __PWM_IPC_H #define __PWM_IPC_H +#include <qobject.h> #include <unistd.h> -#include <qobject.h> +#ifndef PWM_EMBEDDED #include <stdio.h> +#else +#include <qsocket.h> +#endif class QSocketNotifier; @@ -44,8 +48,13 @@ public: /** send data to the other socket end * (To the connected ipc object) */ +#ifndef PWM_EMBEDDED void send(const char *buf, size_t size) { write(sock[0], buf, size); } +#else + void send(const char *buf, size_t size) + { qSock->writeBlock(buf, size); } +#endif signals: /** a line is available */ @@ -56,18 +65,25 @@ protected slots: void receiveData(int s); protected: - /** full-duplex socket file desciptors */ - int sock[2]; +#ifndef PWM_EMBEDDED /** stream on "this" end of the socket (sock[0]) */ FILE *stream; + /** current receive buffer size */ + size_t rdBufSize; +#else + QSocket* qSock; + /** current receive buffer size */ + unsigned int rdBufSize; +#endif + + /** full-duplex socket file desciptors */ + int sock[2]; /** socket notifier */ QSocketNotifier *notifier; /** are we the host or the client object? */ bool host; /** receive buffer */ char *rdBuf; - /** current receive buffer size */ - size_t rdBufSize; }; #endif // __PWM_IPC_H |