annotate python/pydc/README.txt @ 29:6cc2b7fc7ea2

bigger pydc update: - cleanups and refactoring - python 2 fixes in var conversions (especially w/ respect to int vs long) - fix to pydc.free() which didn't work at all - fix to return python bool as actual bool - test lib covering all conversions (manual verification, though :-/)
author Tassilo Philipp
date Wed, 08 Apr 2020 22:17:43 +0200
parents edbbd467f50a
children baf087cf5971
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 dyncall python bindings
28
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
2 Copyright 2007-2016 Daniel Adler
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
3 2018-2020 Tassilo Philipp
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
4
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
5 Dec 4, 2007: initial
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
6 Mar 22, 2016: update to dyncall 0.9, includes breaking sig char changes
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
7 Apr 19, 2018: update to dyncall 1.0
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
8 Apr 7, 2020: update to dyncall 1.1, Python 3 support, using the Capsule
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
9 API, as well as support for python unicode strings
5
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
10
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11
7
4fd959b3df78 - python binding readme clarifications
cslag
parents: 5
diff changeset
12 BUILD/INSTALLATION
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
13 ==================
4
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
14
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
15 1) make sure dyncall is built and libraries/headers are in include paths or
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
16 CFLAGS points to them, etc.
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
17
10
6493c9ed4b33 - ruby and python binding readme updates
cslag
parents: 7
diff changeset
18 2) Build and install this extension with:
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
19
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
20 python setup.py install
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
21
28
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
22 Building a wheel package isn't supported, currently.
4
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
23
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
24
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25 API
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
26 ===
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28 libhandle = load(libpath)
5
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
29 funcptr = find(libhandle, symbolname)
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
30 call(funcptr, signature, ...)
29
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
31 free(libhandle)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32
7
4fd959b3df78 - python binding readme clarifications
cslag
parents: 5
diff changeset
33
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 SIGNATURE FORMAT
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
35 ================
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37 is a formated string
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39 format: "xxxxx)y"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
41 x is positional parameter-type charcode, y is result-type charcode
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42
29
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
43 SIG | FROM PYTHON 2 | FROM PYTHON 3 | C/C++ | TO PYTHON 2 | TO PYTHON 3
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
44 ----+------------------------------------------------------+------------------------------------------+---------------------------------+--------------------------------------+-------------------------------------
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
45 'v' | | | void | None (Py_None) (e.g. ret of "...)v") | None (Py_None) (e.g. ret of "...)v")
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
46 'B' | bool (PyBool) | bool (PyBool)# | int/bool | bool (PyBool) | bool (PyBool)@
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
47 'c' | int (PyLong)%, str (single char)% | int (PyLong)%, str (single char)% | char | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
48 'C' | int (PyLong)%, str (single char)% | int (PyLong)%, str (single char)% | unsigned char | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
49 's' | int (PyInt)% | int (PyLong)% | short | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
50 'S' | int (PyInt)% | int (PyLong)% | unsigned short | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
51 'i' | int (PyInt) | int (PyLong) | int | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
52 'I' | int (PyInt) | int (PyLong) | unsigned int | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
53 'j' | int (PyInt) | int (PyLong) | long | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
54 'J' | int (PyInt) | int (PyLong) | unsigned long | int (PyInt) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
55 'l' | int (PyInt), long (PyLong) | int (PyLongLong) | long long | long (PyLong) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
56 'L' | int (PyInt), long (PyLong) | int (PyLongLong) | unsigned long long | long (PyLong) | int (PyLong)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
57 'f' | float (PyFloat)$ | float (PyFloat)$ | float | float (PyFloat)^ | float (PyFloat)^
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
58 'd' | float (PyFloat) | float (PyFloat) | double | float (PyFloat) | float (PyFloat)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
59 'p' | str (PyUnicode/PyString), int (PyInt), long (PyLong) | str (PyUnicode), int (PyLong), (PyBytes) | void* | int,long (Py_ssize_t) | int (Py_ssize_t)
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
60 'Z' | str (PyUnicode/PyString) | str (PyUnicode), (PyBytes) | const char* (UTF-8 for unicode) | int (PyString) | str (PyUnicode)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61
29
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
62 # converted to 1 if True and 0 otherwise
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
63 @ converted to False if 0 and True otherwise
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
64 % range checked
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
65 $ cast to single precision
6cc2b7fc7ea2 bigger pydc update:
Tassilo Philipp
parents: 28
diff changeset
66 ^ cast to double precision
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
67
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
68 TODO
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
69 ====
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
70
28
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
71 - signature suffixes used to indicate calling conventions are not supported yet!
edbbd467f50a python binding:
Tassilo Philipp
parents: 24
diff changeset
72 - callback support
5
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
73