summaryrefslogtreecommitdiff
path: root/libvxi11client/client.c
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-09 13:35:18 +0900
committerdaniel <danieruru@gmail.com>2013-01-09 13:35:18 +0900
commitc4ef0522de10e86ff7af432066123e59665913c4 (patch)
treea460058da76af0f5033011b2df17ee4362bad8cc /libvxi11client/client.c
parent616248011d26981b6b54225ee359cb4a5d43f05d (diff)
Some little clean ups for the client library before I turn it into a perl module
Diffstat (limited to 'libvxi11client/client.c')
-rw-r--r--libvxi11client/client.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libvxi11client/client.c b/libvxi11client/client.c
index f946547..747947b 100644
--- a/libvxi11client/client.c
+++ b/libvxi11client/client.c
@@ -6,7 +6,7 @@
static char* geterrorstring(int errorcode) {
switch (errorcode) {
case 0:
- return "no response from server";
+ return "invalid state (not connected) or no response from server";
case -8:
return "operation not supported";
default:
@@ -14,12 +14,18 @@ static char* geterrorstring(int errorcode) {
}
}
-int main() {
+int main(int argc, char *argv[]) {
+
printf("VXI-11 test client\n");
+ if (argc != 2) {
+ printf("usage; %s <host>\n", argv[0]);
+ exit(1);
+ }
+
int err = 0;
- if ((err = vxi11_open("192.168.2.250")) > 0) {
+ if ((err = vxi11_open(argv[1])) > 0) {
// write some bytes
int byteswritten = vxi11_write(IDENTIFY, sizeof(IDENTIFY));