comparison ruby/rbdc/README.txt @ 6:80273969f043

- ruby binding path cleanup, previous version required bindings and dyncall be checked out in same parent directory
author cslag
date Sat, 26 Mar 2016 00:12:40 +0100
parents a27ef6fdc275
children 6493c9ed4b33
comparison
equal deleted inserted replaced
5:bf5625bb6f05 6:80273969f043
1 dyncall ruby bindings 1 dyncall ruby bindings
2 Copyright 2007-2015 Tassilo Philipp 2 Copyright 2007-2015 Tassilo Philipp
3 3
4 4
5 BUILD 5 BUILD/INSTALLATION
6 ------------------
6 7
7 Build and install this gem with: 8 1) The extension isn't built here, but its code along with dyncall's source is bundled
8 (cd ../../../dyncall; make distclean) || (gem build rbdc.gemspec && gem install ../../../rbdc-*.gem) 9 in a .gem file to then be built and installed on the platform where the gem is installed.
10 So, you need dyncall's full source code to be included. Unfortunately, the .gemspec isn't
11 flexible enough to pull from different paths, so building the .gem file requires dyncall
12 to be found next to rbdc.c and extconf.rb. This means either copy dyncall's base directory
13 do ./dyncall or create a symlink ./dyncall, that points to it.
14
15 2) Then, build this gem with:
16 gem build rbdc.gemspec
17
18 3) On the target platform, install the gem with:
19 gem install ../../../rbdc-*.gem
20
21
22 API
23 ---
24
25 l = Dyncall::ExtLib.new
26 l.load(libpath)
27 l.syms_init(libpath)
28 l.syms_count
29 l.syms_each { |sym_name| ... }
30 l.exists?(:symbolname)
31 l.call(:symbolname, sigstring, ...)
9 32
10 33
11 SIGNATURE FORMAT 34 SIGNATURE FORMAT
35 ----------------
12 36
13 format: "xxxxx)y" 37 format: "xxxxx)y"
14 38
15 x is positional parameter-type charcode 39 x is positional parameter-type charcode
16 40
17 'B' C++: bool <- Ruby: TrueClass, FalseClass, NilClass, Fixnum 41 'B' C++: bool <- Ruby: TrueClass, FalseClass, NilClass, Fixnum
18 'c' C: char <- Ruby: Fixnum 42 'c' C: char <- Ruby: Fixnum
19 'C' C: unsigned char <- Ruby: Fixnum 43 'C' C: unsigned char <- Ruby: Fixnum
20 's' C: short <- Ruby: Fixnum 44 's' C: short <- Ruby: Fixnum
21 'S' C: unsigned short <- Ruby: Fixnum 45 'S' C: unsigned short <- Ruby: Fixnum
22 'i' C: int <- Ruby: Fixnum 46 'i' C: int <- Ruby: Fixnum
23 'I' C: unsigned int <- Ruby: Fixnum 47 'I' C: unsigned int <- Ruby: Fixnum
24 'j' C: long <- Ruby: Fixnum 48 'j' C: long <- Ruby: Fixnum
25 'J' C: unsigned long <- Ruby: Fixnum 49 'J' C: unsigned long <- Ruby: Fixnum
26 'l' C: long long <- Ruby: Fixnum 50 'l' C: long long <- Ruby: Fixnum
27 'L' C: unsigned long long <- Ruby: Fixnum 51 'L' C: unsigned long long <- Ruby: Fixnum
28 'f' C: float <- Ruby: Float 52 'f' C: float <- Ruby: Float
29 'd' C: double <- Ruby: Float 53 'd' C: double <- Ruby: Float
30 'p' C: void* <- Ruby: String (check if there are other pointer-convertible ruby types @@@) 54 'p' C: void* <- Ruby: String (check if there are other pointer-convertible ruby types @@@)
31 'Z' C: void* <- Ruby: String 55 'Z' C: void* <- Ruby: String
32 56
33 y is result-type charcode 57 y is result-type charcode
34 58
35 'v' C: void -> Ruby: NilClass 59 'v' C: void -> Ruby: NilClass
36 'B' C: bool -> Ruby: TrueClass, FalseClass 60 'B' C: bool -> Ruby: TrueClass, FalseClass
37 'c' C: char -> Ruby: Fixnum 61 'c' C: char -> Ruby: Fixnum
38 'C' C: unsigned char -> Ruby: Fixnum 62 'C' C: unsigned char -> Ruby: Fixnum
39 's' C: short -> Ruby: Fixnum 63 's' C: short -> Ruby: Fixnum
40 'S' C: unsigned short -> Ruby: Fixnum 64 'S' C: unsigned short -> Ruby: Fixnum
41 'i' C: int -> Ruby: Fixnum 65 'i' C: int -> Ruby: Fixnum
42 'I' C: unsigned int -> Ruby: Fixnum 66 'I' C: unsigned int -> Ruby: Fixnum
43 'j' C: long -> Ruby: Fixnum 67 'j' C: long -> Ruby: Fixnum
44 'J' C: unsigned long -> Ruby: Fixnum 68 'J' C: unsigned long -> Ruby: Fixnum
45 'l' C: long long -> Ruby: Fixnum 69 'l' C: long long -> Ruby: Fixnum
46 'L' C: unsigned long long -> Ruby: Fixnum 70 'L' C: unsigned long long -> Ruby: Fixnum
47 'f' C: float -> Ruby: Float 71 'f' C: float -> Ruby: Float
48 'd' C: double -> Ruby: Float 72 'd' C: double -> Ruby: Float
49 'p' C: void* -> unsupported at the moment @@@ 73 'p' C: void* -> unsupported at the moment @@@
50 'Z' C: void* -> Ruby: String 74 'Z' C: void* -> Ruby: String
51 75
52 76
53 -> Note that signature suffixes used to indicate calling 77 -> Note that signature suffixes used to indicate calling
54 -> conventions, are not supported yet! @@@ 78 -> conventions, are not supported yet! @@@
79