Mercurial > pub > dyncall > bindings
annotate ruby/rbdc/README.txt @ 28:edbbd467f50a
python binding:
- update to dyncall 1.1
- Python 3 support (supports both, Python 2 and 3)
- using the Capsule API over PyCObject, when available
- support for python unicode strings (for both, Python 2 and 3)
- doc cleanup
ruby binding:
- doc cleanup
author | Tassilo Philipp |
---|---|
date | Tue, 07 Apr 2020 21:16:37 +0200 |
parents | 3745790db233 |
children | b6114d9a9a98 |
rev | line source |
---|---|
0 | 1 dyncall ruby bindings |
25 | 2 Copyright 2007-2018 Tassilo Philipp |
0 | 3 |
4 | |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
5 BUILD/INSTALLATION |
17 | 6 ================== |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
7 |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
8 1) The extension isn't built here, but its code along with dyncall's source is bundled |
10 | 9 in a .gem file to then be built and installed on the target platform. |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
10 So, you need dyncall's full source code to be included. Unfortunately, the .gemspec isn't |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
11 flexible enough to pull from different paths, so building the .gem file requires dyncall |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
12 to be found next to rbdc.c and extconf.rb. This means either copy dyncall's base directory |
26 | 13 to ./dyncall or create a symlink ./dyncall, that points to it. |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
14 |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
15 2) Then, build this gem with: |
17 | 16 |
17 gem build rbdc.gemspec | |
0 | 18 |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
19 3) On the target platform, install the gem with: |
17 | 20 |
21 gem install rbdc-*.gem | |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
22 |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
23 |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
24 API |
17 | 25 === |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
26 |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
27 l = Dyncall::ExtLib.new |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
28 l.load(libpath) |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
29 l.syms_init(libpath) |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
30 l.syms_count |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
31 l.syms_each { |sym_name| ... } |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
32 l.exists?(:symbolname) |
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
33 l.call(:symbolname, sigstring, ...) |
0 | 34 |
35 | |
36 SIGNATURE FORMAT | |
17 | 37 ================ |
0 | 38 |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
39 format: "xxxxx)y" |
0 | 40 |
17 | 41 x is positional parameter-type charcode, y is result-type charcode |
0 | 42 |
17 | 43 SIG | FROM RUBY | C/C++ | TO RUBY |
44 ----+-----------------------------------------+--------------------+----------------------------------- | |
45 'v' | | void | NilClass | |
46 'B' | TrueClass, FalseClass, NilClass, Fixnum | bool | TrueClass, FalseClass | |
47 'c' | Fixnum | char | Fixnum | |
48 'C' | Fixnum | unsigned char | Fixnum | |
49 's' | Fixnum | short | Fixnum | |
50 'S' | Fixnum | unsigned short | Fixnum | |
51 'i' | Fixnum | int | Fixnum | |
52 'I' | Fixnum | unsigned int | Fixnum | |
53 'j' | Fixnum | long | Fixnum | |
54 'J' | Fixnum | unsigned long | Fixnum | |
55 'l' | Fixnum | long long | Fixnum | |
56 'L' | Fixnum | unsigned long long | Fixnum | |
57 'f' | Float | float | Float | |
58 'd' | Float | double | Float | |
59 'p' | String (other ruby types? @@@) | void* | unsupported at the moment @@@ | |
60 'Z' | String | void* | String | |
0 | 61 |
62 | |
17 | 63 TODO |
64 ==== | |
6
80273969f043
- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
cslag
parents:
2
diff
changeset
|
65 |
28 | 66 - signature suffixes used to indicate calling conventions are not supported yet! |
17 | 67 - C pointer -> ruby... array? |
68 - callback support | |
69 |