ghazel-ffi_gen 1.3.5 → 1.3.6
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 +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 905c48454a26dbe7f5ccf7b1628ad0101f93c9a4
|
4
|
+
data.tar.gz: c56b7b4397a850020c2791d1db5fcecfcda3a6cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5202d969e6113cfccb7eee7d5b2962b93f52a882119b0d3bbcf83e6b7cd8f20183db482484690392d1efbe6466cc576f308651c089cff3a0e976edbe9914d7ec
|
7
|
+
data.tar.gz: 68882a7d939d360f06df65c4d0b52f9e5457337576adf6fdc43615b01977d4a1cdd98ede7e8846d003ba381d4d5c89fb24abaac3dd6759361b777ace0a7fbefc
|
data/lib/ffi_gen/java_output.rb
CHANGED
@@ -152,20 +152,22 @@ class FFIGen
|
|
152
152
|
|
153
153
|
class FunctionOrCallback
|
154
154
|
def write_java(writer)
|
155
|
+
return if @is_callback # static only
|
156
|
+
|
155
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)
|
156
162
|
if @is_callback
|
157
163
|
writer.puts "public static interface #{java_name} extends Callback {"
|
158
164
|
writer.indent do
|
165
|
+
jna_signature = "#{@parameters.map{ |parameter| "#{parameter[:type].java_jna_type} #{parameter[:name].to_java_downcase}" }.join(', ')}"
|
159
166
|
writer.puts "#{@return_type.java_jna_type} invoke(#{jna_signature});"
|
160
167
|
end
|
161
|
-
writer.puts "}"
|
162
|
-
|
163
|
-
writer.puts "@NativeName(\"#{@name.raw}\")", "#{@return_type.java_jna_type} #{java_name}(#{jna_signature});", ""
|
168
|
+
writer.puts "}", ""
|
169
|
+
return
|
164
170
|
end
|
165
|
-
end
|
166
|
-
|
167
|
-
def write_static_java(writer)
|
168
|
-
return if @is_callback # not yet supported
|
169
171
|
|
170
172
|
replace = {}
|
171
173
|
parameters = []
|