Mercurial > pub > dyncall > bindings
annotate python/pydc/README.txt @ 19:5b51738793c6
- layout restructuring
author | cslag |
---|---|
date | Wed, 30 Mar 2016 02:06:16 +0200 |
parents | a40084782546 |
children | 681db37a300c |
rev | line source |
---|---|
0 | 1 dyncall python bindings |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
2 (C) 2007-2016 Daniel Adler |
5 | 3 Dec 4, 2007: initial |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
4 Mar 22,2016: update to dyncall 0.9, includes breaking sig char changes |
5 | 5 |
0 | 6 |
7 | 7 BUILD/INSTALLATION |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
8 ================== |
4 | 9 |
10 1) make sure dyncall is built and libraries/headers are in include paths or | |
11 CFLAGS points to them, etc. | |
12 | |
10 | 13 2) Build and install this extension with: |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
14 |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
15 python setup.py install |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
16 |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
17 Building an egg isn't supported, currently. |
4 | 18 |
19 | |
0 | 20 API |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
21 === |
0 | 22 |
23 libhandle = load(libpath) | |
5 | 24 funcptr = find(libhandle, symbolname) |
25 call(funcptr, signature, ...) | |
0 | 26 |
7 | 27 |
0 | 28 SIGNATURE FORMAT |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
29 ================ |
0 | 30 |
31 is a formated string | |
32 | |
33 format: "xxxxx)y" | |
34 | |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
35 x is positional parameter-type charcode, y is result-type charcode |
0 | 36 |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
37 SIG | FROM PYTHON | C/C++ | TO PYTHON |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
38 ----+------------------------------------+--------------------+----------------------------------- |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
39 'v' | | void | |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
40 'B' | PyBool | bool | PyBool |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
41 'c' | PyInt (range checked) | char | PyInt |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
42 'C' | PyInt (range checked) | unsigned char | PyInt |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
43 's' | PyInt (range checked) | short | PyInt |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
44 'S' | PyInt (range checked) | unsigned short | PyInt |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
45 'i' | PyInt | int | PyInt |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
46 'I' | PyInt | unsigned int | PyInt |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
47 'j' | PyLong | long | PyLong |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
48 'J' | PyLong | unsigned long | PyLong |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
49 'l' | PyLongLong | long long | PyLongLong |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
50 'L' | PyLongLong | unsigned long long | PyLongLong |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
51 'f' | PyFloat (cast to single precision) | float | PyFloat (cast to double precision) |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
52 'd' | PyFloat | double | PyFloat |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
53 'p' | PyCObject | void* | PyCObject encapsulating a void* |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
54 'Z' | PyString | const char* | PyString |
0 | 55 |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
56 |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
57 TODO |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
58 ==== |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
59 |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
60 - support signature suffixes used to indicate calling conventions, are not supported yet! |
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
61 - not sure if returning 'p' is working, creating PyCObject, check and write test code |
5 | 62 |
0 | 63 |
64 BUGS | |
16
a40084782546
- added support for more return values to python binding
cslag
parents:
10
diff
changeset
|
65 ==== |
0 | 66 |
67 * build on osx/ppc - link error i386 something... [MacPython 2.4] | |
68 | |
69 solution: | |
4 | 70 installation of latest python for os x (MacPython 2.5) |
0 | 71 |
72 build log: | |
73 | |
74 python setup.py install | |
75 running install | |
76 running build | |
77 running build_py | |
78 creating build | |
79 creating build/lib.macosx-10.3-fat-2.4 | |
80 copying pydc.py -> build/lib.macosx-10.3-fat-2.4 | |
81 running build_ext | |
82 building 'pydcext' extension | |
83 creating build/temp.macosx-10.3-fat-2.4 | |
84 gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I../../../dyncall -I../../../dynload -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c pydcext.c -o build/temp.macosx-10.3-fat-2.4/pydcext.o | |
85 gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.4/pydcext.o -L../../../dyncall -L../../../dynload -ldyncall_s -ldynload_s -lstdc++ -o build/lib.macosx-10.3-fat-2.4/pydcext.so | |
86 /usr/bin/ld: for architecture i386 | |
87 /usr/bin/ld: warning ../../../dyncall/libdyncall_s.a archive's cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (can't load from it) | |
88 /usr/bin/ld: warning ../../../dynload/libdynload_s.a archive's cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (can't load from it) | |
89 running install_lib | |
90 copying build/lib.macosx-10.3-fat-2.4/pydcext.so -> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages | |
91 |