ghazel-ffi_gen 1.3.7 → 1.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ffi_gen/java_output.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32ad2abdaee3cc109a729362447b3938e4b66e4b
|
4
|
+
data.tar.gz: 0e553a6093fd7a600ffae764a8a232b8f36375d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64e7336d1f6f8dd02fc6957b182c16fac32ab6177eabb5d85afd24e1838c9c2b21e9d5ad19189548389b85d0f7ea57a9767f9eb07dd6e7cefbb86cd7254f6c57
|
7
|
+
data.tar.gz: 750846ae5693d8ffd36b37cbc36c66191d5f8c943092566b76d5b568b9d46089b9d025d2da4f75d6abcd611e37f5151ba0fa2877e02a064cfef5f33b10b56b5c
|
data/lib/ffi_gen/java_output.rb
CHANGED
@@ -152,15 +152,8 @@ class FFIGen
|
|
152
152
|
|
153
153
|
class FunctionOrCallback
|
154
154
|
def write_java(writer)
|
155
|
-
return if @is_callback # static only
|
156
|
-
|
157
|
-
jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
|
158
|
-
writer.puts "@NativeName(\"#{@name.raw}\")", "#{@return_type.java_jna_type} #{java_name}(#{jna_signature});", ""
|
159
|
-
end
|
160
|
-
|
161
|
-
def write_static_java(writer)
|
162
155
|
if @is_callback
|
163
|
-
writer.puts "public static interface #{java_name} extends Callback {"
|
156
|
+
writer.puts "public static interface #{java_name.split('.').last} extends Callback {"
|
164
157
|
writer.indent do
|
165
158
|
jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
|
166
159
|
writer.puts "#{@return_type.java_jna_type} invoke(#{jna_signature});"
|
@@ -168,6 +161,13 @@ class FFIGen
|
|
168
161
|
writer.puts "}", ""
|
169
162
|
return
|
170
163
|
end
|
164
|
+
|
165
|
+
jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
|
166
|
+
writer.puts "@NativeName(\"#{@name.raw}\")", "#{@return_type.java_jna_type} #{java_name}(#{jna_signature});", ""
|
167
|
+
end
|
168
|
+
|
169
|
+
def write_static_java(writer)
|
170
|
+
return if @is_callback # must be in Library
|
171
171
|
|
172
172
|
replace = {}
|
173
173
|
parameters = []
|
@@ -221,7 +221,8 @@ class FFIGen
|
|
221
221
|
end
|
222
222
|
|
223
223
|
def java_name
|
224
|
-
@
|
224
|
+
n = (@is_callback ? (@generator.module_name + 'Interface.') : '') + @name.to_java_downcase
|
225
|
+
@java_name ||= n
|
225
226
|
end
|
226
227
|
|
227
228
|
def java_jna_type
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghazel-ffi_gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Musiol
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|