Mercurial > pub > dyncall > bindings
comparison python/pydc/README.txt @ 5:bf5625bb6f05
- brought python binding up to dc v0.9
author | cslag |
---|---|
date | Tue, 22 Mar 2016 01:49:34 +0100 |
parents | 4c5019f00f5b |
children | 4fd959b3df78 |
comparison
equal
deleted
inserted
replaced
4:4c5019f00f5b | 5:bf5625bb6f05 |
---|---|
1 dyncall python bindings | 1 dyncall python bindings |
2 (C) 2007 Daniel Adler. | 2 (C) 2007-2016 Daniel Adler. |
3 2007 04. December | 3 Dec 4, 2007: initial |
4 Mar 22,2016: brought up to dyncall 0.9 | |
5 | |
4 | 6 |
5 INSTALLATION | 7 INSTALLATION |
6 ------------ | 8 ------------ |
7 | 9 |
8 1) make sure dyncall is built and libraries/headers are in include paths or | 10 1) make sure dyncall is built and libraries/headers are in include paths or |
13 | 15 |
14 API | 16 API |
15 --- | 17 --- |
16 | 18 |
17 libhandle = load(libpath) | 19 libhandle = load(libpath) |
18 funcptr = find(libhandle, symbolname ) | 20 funcptr = find(libhandle, symbolname) |
19 call( funcptr,signature, ... ) | 21 call(funcptr, signature, ...) |
20 | 22 |
21 SIGNATURE FORMAT | 23 SIGNATURE FORMAT |
22 | 24 |
23 is a formated string | 25 is a formated string |
24 | 26 |
25 format: "xxxxx)y" | 27 format: "xxxxx)y" |
26 | 28 |
27 x is positional parameter-type charcode | 29 x is positional parameter-type charcode |
28 | 30 |
29 'b' C++: bool <- Python: PyBool | 31 'B' C++: bool <- Python: PyBool |
32 'c' C: char <- Python: PyInt (range checked) | |
33 's' C: short <- Python: PyInt (range checked) | |
30 'i' C: int <- Python: PyInt | 34 'i' C: int <- Python: PyInt |
35 'j' C: long <- Python: PyLong | |
31 'l' C: long long <- Python: PyLongLong | 36 'l' C: long long <- Python: PyLongLong |
37 'f' C: float <- Python: PyFloat (cast to single precision) | |
38 'd' C: double <- Python: PyFloat | |
32 'p' C: void* <- Python: PyCObject | 39 'p' C: void* <- Python: PyCObject |
33 's' C: const char* <- Python: PyString | 40 'Z' C: const char* <- Python: PyString |
34 | 41 |
35 y is result-type charcode | 42 y is result-type charcode |
36 | 43 |
37 'v' void | 44 'v' void |
45 'B' bool -> PyBool | |
46 'c' char -> PyInt | |
47 's' short -> PyInt | |
38 'i' int -> PyInt | 48 'i' int -> PyInt |
39 'l' long -> PyLong | 49 'j' long -> PyLong |
50 'l' long long -> PyLongLong | |
51 'f' float -> PyFloat (cast to double precision) | |
52 'd' double -> PyFloat | |
40 'p' ptr -> PyCObject encapsulating a void* | 53 'p' ptr -> PyCObject encapsulating a void* |
41 'f' float -> PyFloat (upcast to double) | 54 'Z' const char* -> PyString |
42 'd' double -> PyFloat | 55 |
43 | 56 |
44 BUGS | 57 BUGS |
45 ---- | 58 ---- |
46 | 59 |
47 * build on osx/ppc - link error i386 something... [MacPython 2.4] | 60 * build on osx/ppc - link error i386 something... [MacPython 2.4] |