diff options
author | daniel <danieruru@gmail.com> | 2013-01-17 06:08:31 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-17 06:08:31 +0900 |
commit | 68247df5e2a1c6ee1b02834eac49e0b75875d03a (patch) | |
tree | b9b09feb736d79f999d1e2f22ca1f6aa87207df5 /libvxi11client/libvxi11client.h | |
parent | 06907995e46e24396ade38042aabf2d382125917 (diff) |
add a "context" for handling multiple instruments
Diffstat (limited to 'libvxi11client/libvxi11client.h')
-rw-r--r-- | libvxi11client/libvxi11client.h | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/libvxi11client/libvxi11client.h b/libvxi11client/libvxi11client.h index d94662e..0546ac4 100644 --- a/libvxi11client/libvxi11client.h +++ b/libvxi11client/libvxi11client.h @@ -1,4 +1,5 @@ #include <stdbool.h> +#include "vxi11.h" #define ERR_SYNTAXERROR -1 #define ERR_DEVICENOTACCESSIBLE -3 @@ -15,19 +16,26 @@ #define ERR_ABORT -23 #define ERR_CHANNELALREADYESTABLISHED -29 -int vxi11_open(char* address, char* device); -int vxi11_abort(void); -int vxi11_trigger(bool waitforlock); -int vxi11_clear(bool waitforlock); -int vxi11_write(char* data, unsigned int len, bool waitlock, bool end); -int vxi11_read(char* buffer, unsigned int bufferlen, bool waitlock, bool termchrset, char termchr); -int vxi11_lock(bool waitforlock); -int vxi11_unlock(void); -int vxi11_local(bool waitforlock); -int vxi11_remote(bool waitforlock); -int vxi11_readstatusbyte(bool waitforlock); -int vxi11_create_intr_chan(void); -int vxi11_destroy_intr_chan(void); -int vxi11_enable_srq(bool enable, char* handle, void (*callback)(void)); -int vxi11_docmd(unsigned long cmd, bool waitforlock); -int vxi11_close(void); +typedef struct { + CLIENT* clnt; + CLIENT* abortclnt; + Device_Link devicelink; + bool interruptsenabled; +} Context; + +int vxi11_open(Context* context, char* address, char* device); +int vxi11_abort(Context* context); +int vxi11_trigger(Context* context, bool waitforlock); +int vxi11_clear(Context* context, bool waitforlock); +int vxi11_write(Context* context, char* data, unsigned int len, bool waitlock, bool end); +int vxi11_read(Context* context, char* buffer, unsigned int bufferlen, bool waitlock, bool termchrset, char termchr); +int vxi11_lock(Context* context, bool waitforlock); +int vxi11_unlock(Context* context); +int vxi11_local(Context* context, bool waitforlock); +int vxi11_remote(Context* context, bool waitforlock); +int vxi11_readstatusbyte(Context* context, bool waitforlock); +int vxi11_create_intr_chan(Context* context); +int vxi11_destroy_intr_chan(Context* context); +int vxi11_enable_srq(Context* context, bool enable, char* handle, void (*callback)(void)); +int vxi11_docmd(Context* context, unsigned long cmd, bool waitforlock); +int vxi11_close(Context* context); |