diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-10-26 16:44:17 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-10-26 16:44:17 (GMT) |
commit | 79d64f400391ce81b4eda73977cb40099256b348 (patch) | |
tree | 47afaed270cf59335dbaf4eb7965eac64a02a687 /xpa/python/PythonXPA/client/XPAClient.py | |
parent | 1377ae8b2142276c24d28d65865e459038984c62 (diff) | |
download | blt-79d64f400391ce81b4eda73977cb40099256b348.zip blt-79d64f400391ce81b4eda73977cb40099256b348.tar.gz blt-79d64f400391ce81b4eda73977cb40099256b348.tar.bz2 |
upgrade XPA
Diffstat (limited to 'xpa/python/PythonXPA/client/XPAClient.py')
-rw-r--r-- | xpa/python/PythonXPA/client/XPAClient.py | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/xpa/python/PythonXPA/client/XPAClient.py b/xpa/python/PythonXPA/client/XPAClient.py deleted file mode 100644 index 29e39eb..0000000 --- a/xpa/python/PythonXPA/client/XPAClient.py +++ /dev/null @@ -1,98 +0,0 @@ - -import sys -from ctypes import * - -libxpa=cdll.LoadLibrary("../../libxpa.so.1.0") -libc=cdll.LoadLibrary(None); - - -#xpa_t = c_void_p -#xpa = xpa_t(None) - -c_byte_p = POINTER(c_byte) - - - -############## - -NXPA = 10 - -############## - - -def free_bufs(p_arr, len): - for i in range(len): - if p_arr[i]: - print "freeing [", i, "] ", p_arr[i][0], p_arr[i][1] - libc.free(p_arr[i]) - - - - - -## XPA XPAOpen(char *mode); - -XPAOpen = libxpa.XPAOpen -libxpa.XPAOpen.restype = c_void_p -libxpa.XPAOpen.argtypes = [c_char_p] - -## void XPAClose(XPA xpa); -XPAClose = libxpa.XPAClose -libxpa.XPAClose.argtypes = [c_void_p] - - -## int XPAGet(XPA xpa, char *template, char *paramlist, char *mode, -## char **bufs, int *lens, char **names, char **messages, int n); - -XPAGet = libxpa.XPAGet -libxpa.XPAGet.restype = c_int -libxpa.XPAGet.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, \ - c_byte_p*NXPA, c_int*NXPA, c_byte_p*NXPA, c_byte_p*NXPA, \ - c_int] - - -## when you want to send something like "hello\0x00 you" use this - -## int XPASet(XPA xpa, -## char *template, char *paramlist, char *mode, -## char *buf, int len, char **names, char **messages, -## int n); - -#libxpa.XPASet.restype = c_int -#libxpa.XPASet.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, \ -# c_byte_p, c_int, c_char_p*NXPA, c_char_p*NXPA, \ -# c_int] - -## when you know, you will send strings only, use this one to avoid conversions - -XPASet = libxpa.XPASet -libxpa.XPASet.restype = c_int -libxpa.XPASet.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, \ - c_char_p, c_int, c_byte_p*NXPA, c_byte_p*NXPA, \ - c_int] - -## int XPAInfo(XPA xpa, -## char *template, char *paramlist, char *mode, -## char **names, char **messages, int n); - -XPAInfo = libxpa.XPAInfo -libxpa.XPAInfo.restype = c_int -libxpa.XPAInfo.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, \ - c_byte_p*NXPA, c_byte_p*NXPA, \ - c_int] - -## int XPAAccess(XPA xpa, -## char *template, char *paramlist, char *mode, -## char **names, char **messages, int n); - -XPAAccess = libxpa.XPAAccess -libxpa.XPAAccess.restype = c_int -libxpa.XPAAccess.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, \ - c_byte_p*NXPA, c_byte_p*NXPA, \ - c_int] - -#del libxpa - - - - |