summaryrefslogtreecommitdiff
path: root/libvxi11client/perlbits/Client.xs
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-23 21:46:57 +0900
committerdaniel <danieruru@gmail.com>2013-01-23 21:46:57 +0900
commit5d66712261026f3f2da0958d98d60fb2142feedd (patch)
tree9ed2b7c10481fa73206c8bac9b910a8cbd1c7597 /libvxi11client/perlbits/Client.xs
parent2e50d8284b0d3e745cb7c24a1a8fa5a60bd1ebcf (diff)
Make readstb make sense :)
Diffstat (limited to 'libvxi11client/perlbits/Client.xs')
-rw-r--r--libvxi11client/perlbits/Client.xs20
1 files changed, 14 insertions, 6 deletions
diff --git a/libvxi11client/perlbits/Client.xs b/libvxi11client/perlbits/Client.xs
index d471fda..b09ee0a 100644
--- a/libvxi11client/perlbits/Client.xs
+++ b/libvxi11client/perlbits/Client.xs
@@ -136,14 +136,22 @@ vxi_read(context, OUTLIST bytesread, OUTLIST buffer, bufferlen, waitlock, termch
buffer = malloc(bufferlen + 1);
bytesread = vxi11_read(context, buffer, bufferlen, waitlock, termchrset, termchr, reason);
-int
-vxi_readstatusbyte(context, waitforlock)
+void
+vxi_readstatusbyte(context, waitforlock, OUTLIST error, OUTLIST statusbyte)
VXI11::Client context
bool waitforlock
- CODE:
- RETVAL = vxi11_readstatusbyte(context, waitforlock);
- OUTPUT:
- RETVAL
+ int* error
+ int* statusbyte
+ CODE:
+ int ret = vxi11_readstatusbyte(context, waitforlock);
+ if(ret > 0){
+ *statusbyte = ret & 0xff;
+ *error = 0;
+ }
+ else {
+ *statusbyte = 0;
+ *error = ret;
+ }
int
vxi_remote(context, waitforlock)