annotate python/pydc/README.txt @ 18:3bfef07b0cd9

- cleanup of non-working java binding, restart work, somewhat different interface
author cslag
date Wed, 30 Mar 2016 02:05:06 +0200
parents a40084782546
children 681db37a300c
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
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
2 (C) 2007-2016 Daniel Adler
5
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
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
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
5
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6
7
4fd959b3df78 - python binding readme clarifications
cslag
parents: 5
diff changeset
7 BUILD/INSTALLATION
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
8 ==================
4
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
9
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
10 1) make sure dyncall is built and libraries/headers are in include paths or
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
11 CFLAGS points to them, etc.
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
12
10
6493c9ed4b33 - ruby and python binding readme updates
cslag
parents: 7
diff changeset
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
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
18
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
19
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 API
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
21 ===
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23 libhandle = load(libpath)
5
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
24 funcptr = find(libhandle, symbolname)
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
25 call(funcptr, signature, ...)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26
7
4fd959b3df78 - python binding readme clarifications
cslag
parents: 5
diff changeset
27
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28 SIGNATURE FORMAT
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
29 ================
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 is a formated string
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 format: "xxxxx)y"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
bf5625bb6f05 - brought python binding up to dc v0.9
cslag
parents: 4
diff changeset
62
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64 BUGS
16
a40084782546 - added support for more return values to python binding
cslag
parents: 10
diff changeset
65 ====
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
67 * build on osx/ppc - link error i386 something... [MacPython 2.4]
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
68
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69 solution:
4
4c5019f00f5b - python binding cleanup
cslag
parents: 0
diff changeset
70 installation of latest python for os x (MacPython 2.5)
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
71
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
72 build log:
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74 python setup.py install
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75 running install
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
76 running build
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
77 running build_py
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
78 creating build
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
79 creating build/lib.macosx-10.3-fat-2.4
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
80 copying pydc.py -> build/lib.macosx-10.3-fat-2.4
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
81 running build_ext
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
82 building 'pydcext' extension
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
83 creating build/temp.macosx-10.3-fat-2.4
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
86 /usr/bin/ld: for architecture i386
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
89 running install_lib
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
90 copying build/lib.macosx-10.3-fat-2.4/pydcext.so -> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
91