Mercurial > pub > dyncall > bindings
comparison python/pydc/README.txt @ 7:4fd959b3df78
- python binding readme clarifications
author | cslag |
---|---|
date | Sat, 26 Mar 2016 00:13:11 +0100 |
parents | bf5625bb6f05 |
children | 6493c9ed4b33 |
comparison
equal
deleted
inserted
replaced
6:80273969f043 | 7:4fd959b3df78 |
---|---|
2 (C) 2007-2016 Daniel Adler. | 2 (C) 2007-2016 Daniel Adler. |
3 Dec 4, 2007: initial | 3 Dec 4, 2007: initial |
4 Mar 22,2016: brought up to dyncall 0.9 | 4 Mar 22,2016: brought up to dyncall 0.9 |
5 | 5 |
6 | 6 |
7 INSTALLATION | 7 BUILD/INSTALLATION |
8 ------------ | 8 ------------------ |
9 | 9 |
10 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 |
11 CFLAGS points to them, etc. | 11 CFLAGS points to them, etc. |
12 | 12 |
13 2) python setup.py install | 13 2) Build and install this gem with: |
14 python setup.py install | |
14 | 15 |
15 | 16 |
16 API | 17 API |
17 --- | 18 --- |
18 | 19 |
19 libhandle = load(libpath) | 20 libhandle = load(libpath) |
20 funcptr = find(libhandle, symbolname) | 21 funcptr = find(libhandle, symbolname) |
21 call(funcptr, signature, ...) | 22 call(funcptr, signature, ...) |
22 | 23 |
24 | |
23 SIGNATURE FORMAT | 25 SIGNATURE FORMAT |
26 ---------------- | |
24 | 27 |
25 is a formated string | 28 is a formated string |
26 | 29 |
27 format: "xxxxx)y" | 30 format: "xxxxx)y" |
28 | 31 |
39 'p' C: void* <- Python: PyCObject | 42 'p' C: void* <- Python: PyCObject |
40 'Z' C: const char* <- Python: PyString | 43 'Z' C: const char* <- Python: PyString |
41 | 44 |
42 y is result-type charcode | 45 y is result-type charcode |
43 | 46 |
44 'v' void | 47 'v' C: void |
45 'B' bool -> PyBool | 48 'B' C++: bool -> Python: PyBool |
46 'c' char -> PyInt | 49 'c' C: char -> Python: PyInt |
47 's' short -> PyInt | 50 's' C: short -> Python: PyInt |
48 'i' int -> PyInt | 51 'i' C: int -> Python: PyInt |
49 'j' long -> PyLong | 52 'j' C: long -> Python: PyLong |
50 'l' long long -> PyLongLong | 53 'l' C: long long -> Python: PyLongLong |
51 'f' float -> PyFloat (cast to double precision) | 54 'f' C: float -> Python: PyFloat (cast to double precision) |
52 'd' double -> PyFloat | 55 'd' C: double -> Python: PyFloat |
53 'p' ptr -> PyCObject encapsulating a void* | 56 'p' C: ptr -> Python: PyCObject encapsulating a void* |
54 'Z' const char* -> PyString | 57 'Z' C: const char* -> Python: PyString |
55 | 58 |
56 | 59 |
57 BUGS | 60 BUGS |
58 ---- | 61 ---- |
59 | 62 |