diff options
author | daniel <danieruru@gmail.com> | 2013-01-17 18:01:30 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-17 18:01:30 +0900 |
commit | 74d4fb6c3b452599e9fc40c2f7df683bb1cf16d6 (patch) | |
tree | facd2a62c7b420332cc4c855b3a4e26034827c67 /libvxi11client/libvxi11client.c | |
parent | 44fa490c0a2bf5f85f914ed48c85db0d51afa875 (diff) |
make module perlish (object methods)
Diffstat (limited to 'libvxi11client/libvxi11client.c')
-rw-r--r-- | libvxi11client/libvxi11client.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c index 8936545..4b17532 100644 --- a/libvxi11client/libvxi11client.c +++ b/libvxi11client/libvxi11client.c @@ -99,7 +99,7 @@ static Device_Flags vxi11_generateflags(bool waitlock, bool end, bool termchrset * $device is apparently used for VXI-11 -> GPIB gateways.. this is untested. */ -int vxi11_open(Context* context, char* address, char* device) { +int vxi11_open(VXI11Context* context, char* address, char* device) { context->clnt = clnt_create(address, DEVICE_CORE, DEVICE_CORE_VERSION, "tcp"); if (context->clnt == NULL) @@ -154,7 +154,7 @@ int vxi11_open(Context* context, char* address, char* device) { * read the status byte of the connected server */ -int vxi11_readstatusbyte(Context* context, bool waitforlock) { +int vxi11_readstatusbyte(VXI11Context* context, bool waitforlock) { if (context->clnt == NULL) return 0; @@ -174,7 +174,7 @@ int vxi11_readstatusbyte(Context* context, bool waitforlock) { * write to the connected device */ -int vxi11_write(Context* context, char* data, unsigned int len, bool waitlock, bool end) { +int vxi11_write(VXI11Context* context, char* data, unsigned int len, bool waitlock, bool end) { if (context->clnt == NULL) return 0; @@ -196,7 +196,8 @@ int vxi11_write(Context* context, char* data, unsigned int len, bool waitlock, b * read from the connected device */ -int vxi11_read(Context* context, char* buffer, unsigned int bufferlen, bool waitlock, bool termchrset, char termchr) { +int vxi11_read(VXI11Context* context, char* buffer, unsigned int bufferlen, bool waitlock, bool termchrset, + char termchr) { if (context->clnt == NULL) return 0; @@ -223,7 +224,7 @@ int vxi11_read(Context* context, char* buffer, unsigned int bufferlen, bool wait * */ -int vxi11_docmd(Context* context, unsigned long cmd, bool waitforlock) { +int vxi11_docmd(VXI11Context* context, unsigned long cmd, bool waitforlock) { if (context->clnt == NULL) return 0; @@ -247,7 +248,7 @@ int vxi11_docmd(Context* context, unsigned long cmd, bool waitforlock) { * trigger the connected device */ -int vxi11_trigger(Context* context, bool waitforlock) { +int vxi11_trigger(VXI11Context* context, bool waitforlock) { if (context->clnt == NULL) return 0; @@ -265,7 +266,7 @@ int vxi11_trigger(Context* context, bool waitforlock) { * clear the connected device */ -int vxi11_clear(Context* context, bool waitforlock) { +int vxi11_clear(VXI11Context* context, bool waitforlock) { if (context->clnt == NULL) return 0; Device_GenericParms params = { .lid = context->devicelink, .flags = vxi11_generateflags(waitforlock, false, false), @@ -283,7 +284,7 @@ int vxi11_clear(Context* context, bool waitforlock) { * remote the connected device */ -int vxi11_remote(Context* context, bool waitforlock) { +int vxi11_remote(VXI11Context* context, bool waitforlock) { if (context->clnt == NULL) return 0; Device_GenericParms params = { .lid = context->devicelink, .flags = vxi11_generateflags(waitforlock, false, false), @@ -301,7 +302,7 @@ int vxi11_remote(Context* context, bool waitforlock) { * local the connected device */ -int vxi11_local(Context* context, bool waitforlock) { +int vxi11_local(VXI11Context* context, bool waitforlock) { if (context->clnt == NULL) return 0; Device_GenericParms params = { .lid = context->devicelink, .flags = vxi11_generateflags(waitforlock, false, false), @@ -319,7 +320,7 @@ int vxi11_local(Context* context, bool waitforlock) { * lock the connected device */ -int vxi11_lock(Context* context, bool waitforlock) { +int vxi11_lock(VXI11Context* context, bool waitforlock) { if (context->clnt == NULL) return 0; Device_LockParms params = { .lid = context->devicelink, .flags = vxi11_generateflags(waitforlock, false, false), @@ -337,7 +338,7 @@ int vxi11_lock(Context* context, bool waitforlock) { * unlock the connected device */ -int vxi11_unlock(Context* context) { +int vxi11_unlock(VXI11Context* context) { if (context->clnt == NULL) return 0; Device_Error* error = device_unlock_1(&(context->devicelink), context->clnt); @@ -443,7 +444,7 @@ int vxi11_stop_interrupt_server() { /** * create an interrupt channel from the connected device */ -int vxi11_create_intr_chan(Context* context) { +int vxi11_create_intr_chan(VXI11Context* context) { if (context->clnt == NULL || context->interruptchannelopen) return 0; else if (interruptthread == NULL) { @@ -473,7 +474,7 @@ int vxi11_create_intr_chan(Context* context) { * destroy an interrupt channel from the connected device */ -int vxi11_destroy_intr_chan(Context* context) { +int vxi11_destroy_intr_chan(VXI11Context* context) { if (context->clnt == NULL || !(context->interruptchannelopen)) return 0; else if (interruptthread == NULL) @@ -494,7 +495,7 @@ int vxi11_destroy_intr_chan(Context* context) { * enable interrupts */ -int vxi11_enable_srq(Context* context, bool enable, char* handle) { +int vxi11_enable_srq(VXI11Context* context, bool enable, char* handle) { if (context->clnt == NULL || !(context->interruptchannelopen)) return 0; else if (interruptthread == NULL) @@ -525,7 +526,7 @@ int vxi11_enable_srq(Context* context, bool enable, char* handle) { * send an abort to the connected device */ -int vxi11_abort(Context* context) { +int vxi11_abort(VXI11Context* context) { if (context->abortclnt == NULL) return 0; Device_Error* error = device_abort_1(&(context->devicelink), context->abortclnt); @@ -541,7 +542,7 @@ int vxi11_abort(Context* context) { * close the current link and free the RPC client */ -int vxi11_close(Context* context) { +int vxi11_close(VXI11Context* context) { if (context->clnt == NULL) return 0; |