aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rclip.cc
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-05-23 08:30:31 +0000
committerFritz Elfert <felfert@to.com>2001-05-23 08:30:31 +0000
commit8e889a0ed94aa6422be8c078c123cec64774e2c2 (patch)
treef66ddcaaf9b322219d17cbdc297554a08ab2f46e /lib/rclip.cc
parentfcbde47029c0b94adb18fc1bbcdf6137d702c457 (diff)
downloadplptools-8e889a0ed94aa6422be8c078c123cec64774e2c2.tar.gz
plptools-8e889a0ed94aa6422be8c078c123cec64774e2c2.tar.bz2
plptools-8e889a0ed94aa6422be8c078c123cec64774e2c2.zip
Fixed iowatch
More clipboard work (Works now in direction Psion -> PC ;-)
Diffstat (limited to 'lib/rclip.cc')
-rw-r--r--lib/rclip.cc45
1 files changed, 22 insertions, 23 deletions
diff --git a/lib/rclip.cc b/lib/rclip.cc
index 6c55c39..365c117 100644
--- a/lib/rclip.cc
+++ b/lib/rclip.cc
@@ -127,15 +127,18 @@ sendListen() {
Enum<rfsv::errs> rclip::
checkNotify() {
Enum<rfsv::errs> ret;
-
bufferStore a;
- if ((ret = getResponse(a)) != rfsv::E_PSI_GEN_NONE)
- cerr << "RCLIP ERR:" << a << endl;
- else {
- if (a.getLen() != 1)
- ret = rfsv::E_PSI_GEN_FAIL;
- if (a.getByte(0) != 0)
- ret = rfsv::E_PSI_GEN_FAIL;
+
+ int r = skt->getBufferStore(a, false);
+ if (r < 0) {
+ ret = status = rfsv::E_PSI_FILE_DISC;
+ } else {
+ if (r == 0)
+ ret = rfsv::E_PSI_FILE_EOF;
+ else {
+ if ((a.getLen() != 1) || (a.getByte(0) != 0))
+ ret = rfsv::E_PSI_GEN_FAIL;
+ }
}
return ret;
}
@@ -146,12 +149,8 @@ waitNotify() {
bufferStore a;
sendCommand(RCLIP_LISTEN);
- if ((ret = getResponse(a)) != rfsv::E_PSI_GEN_NONE)
- cerr << "RCLIP ERR:" << a << endl;
- else {
- if (a.getLen() != 1)
- ret = rfsv::E_PSI_GEN_FAIL;
- if (a.getByte(0) != 0)
+ if ((ret = getResponse(a)) == rfsv::E_PSI_GEN_NONE) {
+ if ((a.getLen() != 1) || (a.getByte(0) != 0))
ret = rfsv::E_PSI_GEN_FAIL;
}
return ret;
@@ -163,24 +162,24 @@ notify() {
bufferStore a;
sendCommand(RCLIP_NOTIFY);
- if ((ret = getResponse(a)) != rfsv::E_PSI_GEN_NONE)
- cerr << "RCLIP ERR:" << a << endl;
- if (a.getLen() != 1)
- ret = rfsv::E_PSI_GEN_FAIL;
- if (a.getByte(0) != RCLIP_NOTIFY)
+ if ((ret = getResponse(a)) == rfsv::E_PSI_GEN_NONE) {
+ if ((a.getLen() != 1) || (a.getByte(0) != RCLIP_NOTIFY))
ret = rfsv::E_PSI_GEN_FAIL;
+ }
return ret;
}
Enum<rfsv::errs> rclip::
initClipbd() {
- Enum<rfsv::errs> ret = rfsv::E_PSI_GEN_NONE;
+ Enum<rfsv::errs> ret;
bufferStore a;
sendCommand(RCLIP_INIT);
- if ((ret = getResponse(a)) != rfsv::E_PSI_GEN_NONE)
- cerr << "RCLIP ERR:" << a << endl;
- cout << "RCLIP RESP: " << a << endl;
+ if ((ret = getResponse(a)) == rfsv::E_PSI_GEN_NONE) {
+ if ((a.getLen() != 3) || (a.getByte(0) != RCLIP_INIT) ||
+ (a.getWord(1) != 0x100))
+ ret = rfsv::E_PSI_GEN_FAIL;
+ }
return ret;
}