ffi-clang 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eed14776878ea1dd5fe61ec2b8c9bb57be78116944d5943722077dd958e65b90
4
- data.tar.gz: 15acda164aae15f941ae12031e1f68a8a220f0b5e48c6ed07737e0d8a733893d
3
+ metadata.gz: 54ebc6d99d0f99d46028bd950f969bacaaf32e95b8824fa504902974357882d2
4
+ data.tar.gz: 9732b945316e50383c601f5f9938f555445d13f5ce25428a6acadfacb57df284
5
5
  SHA512:
6
- metadata.gz: bb918188b02394a8d21f863f1b989a2cb96789f11c97d83c417258ac25a590e63297daf7e7fb6851f06e4890051f9130b9c75d850f1662ad29f6652a244bceb4
7
- data.tar.gz: 6b48dabf35dc7606859f18f4267800f4e6de1a2eec1496e3e89cbad282727cb8f80c4820b1405e772bad59bfd8559a98076804e2320b453d65e0d22104ba9bd0
6
+ metadata.gz: e3bb22b3b0e304d05edd4628570642efb0ef7dea8fe588bd37c6d284e06291d0cf7561ceffc8ff9ded5450e1f7751943e91843cb29eaca5c59227cb891ea39cb
7
+ data.tar.gz: 74d1a5920126e62a88a089fa205cdfa1b117ea2e0b8ca90ebc7807395172c436c0d72ccdcb6384a00c6d1d47b96c30e5568e0e991a2bcb0d2fc4d36df8a02731
checksums.yaml.gz.sig CHANGED
Binary file
@@ -146,6 +146,9 @@ module FFI
146
146
 
147
147
  def qualified_name
148
148
  if self.kind != :cursor_translation_unit
149
+ if self.semantic_parent.kind == :cursor_invalid_file
150
+ raise(ArgumentError, "Invalid semantic parent: #{self}")
151
+ end
149
152
  result = self.semantic_parent.qualified_name
150
153
  result ? "#{result}::#{self.spelling}" : self.spelling
151
154
  end
@@ -298,6 +301,10 @@ module FFI
298
301
  Lib.visit_children(@cursor, adapter, nil)
299
302
  end
300
303
 
304
+ def visit_children(&block)
305
+ each(false, &block)
306
+ end
307
+
301
308
  def ancestors_by_kind(*kinds)
302
309
  result = Array.new
303
310
 
@@ -341,6 +348,10 @@ module FFI
341
348
  Lib.get_cursor_linkage(@cursor)
342
349
  end
343
350
 
351
+ def exception_specification
352
+ Lib.get_cursor_exception_specification_type(@cursor)
353
+ end
354
+
344
355
  def availability
345
356
  Lib.get_cursor_availability(@cursor)
346
357
  end
@@ -319,6 +319,19 @@ module FFI
319
319
  :external, 4,
320
320
  ]
321
321
 
322
+ enum :exception_specification_type, [
323
+ :none,
324
+ :dynamic_none,
325
+ :dynamic,
326
+ :ms_any,
327
+ :basic_noexcept,
328
+ :computed_noexcept,
329
+ :unevaluated,
330
+ :uninstantiated,
331
+ :unparsed,
332
+ :no_throw
333
+ ]
334
+
322
335
  class CXCursor < FFI::Struct
323
336
  layout(
324
337
  :kind, :cursor_kind,
@@ -454,6 +467,7 @@ module FFI
454
467
 
455
468
  attach_function :get_cursor_availability, :clang_getCursorAvailability, [CXCursor.by_value], :availability
456
469
  attach_function :get_cursor_linkage, :clang_getCursorLinkage, [CXCursor.by_value], :linkage_kind
470
+ attach_function :get_cursor_exception_specification_type, :clang_getCursorExceptionSpecificationType, [CXCursor.by_value], :exception_specification_type
457
471
  attach_function :get_included_file, :clang_getIncludedFile, [CXCursor.by_value], :CXFile
458
472
  attach_function :get_cursor_hash, :clang_hashCursor, [CXCursor.by_value], :uint
459
473
 
@@ -169,6 +169,20 @@ module FFI
169
169
  :layout_error_undeduced, -6
170
170
  ]
171
171
 
172
+ # Also defined in cursor.rb
173
+ enum :exception_specification_type, [
174
+ :none,
175
+ :dynamic_none,
176
+ :dynamic,
177
+ :ms_any,
178
+ :basic_noexcept,
179
+ :computed_noexcept,
180
+ :unevaluated,
181
+ :uninstantiated,
182
+ :unparsed,
183
+ :no_throw
184
+ ]
185
+
172
186
  class CXType < FFI::Struct
173
187
  layout(
174
188
  :kind, :kind,
@@ -206,6 +220,7 @@ module FFI
206
220
  attach_function :type_get_cxx_ref_qualifier, :clang_Type_getCXXRefQualifier, [CXType.by_value], :ref_qualifier_kind
207
221
 
208
222
  attach_function :get_fuction_type_calling_conv, :clang_getFunctionTypeCallingConv, [CXType.by_value], :calling_conv
223
+ attach_function :get_exception_specification_type, :clang_getExceptionSpecificationType, [CXType.by_value], :exception_specification_type
209
224
 
210
225
  attach_function :equal_types, :clang_equalTypes, [CXType.by_value, CXType.by_value], :uint
211
226
  end
@@ -2,6 +2,8 @@ module FFI
2
2
  module Clang
3
3
  module Types
4
4
  class Function < Type
5
+ include Enumerable
6
+
5
7
  def variadic?
6
8
  Lib.is_function_type_variadic(@type) != 0
7
9
  end
@@ -14,6 +16,16 @@ module FFI
14
16
  Type.create Lib.get_arg_type(@type, i), @translation_unit
15
17
  end
16
18
 
19
+ def arg_types
20
+ return to_enum(:arg_types) unless block_given?
21
+
22
+ self.args_size.times do |i|
23
+ yield self.arg_type(i)
24
+ end
25
+
26
+ self
27
+ end
28
+
17
29
  def result_type
18
30
  Type.create Lib.get_result_type(@type), @translation_unit
19
31
  end
@@ -21,6 +33,10 @@ module FFI
21
33
  def calling_conv
22
34
  Lib.get_fuction_type_calling_conv(@type)
23
35
  end
36
+
37
+ def exception_specification
38
+ Lib.get_exception_specification_type(@type)
39
+ end
24
40
  end
25
41
  end
26
42
  end
@@ -14,7 +14,7 @@ module FFI
14
14
  class Type
15
15
  attr_reader :type, :translation_unit
16
16
 
17
- # Just hard code the types - they don't likely to change
17
+ # Just hard code the types - they are not likely to change
18
18
  def self.create(cxtype, translation_unit)
19
19
  case cxtype[:kind]
20
20
  when :type_pointer, :type_block_pointer, :type_obj_c_object_pointer, :type_member_pointer
@@ -85,6 +85,10 @@ module FFI
85
85
  Cursor.new Lib.get_type_declaration(@type), @translation_unit
86
86
  end
87
87
 
88
+ def non_reference_type
89
+ Type.create Lib.get_non_reference_type(@type),@translation_unit
90
+ end
91
+
88
92
  def ==(other)
89
93
  Lib.equal_types(@type, other.type) != 0
90
94
  end
@@ -7,6 +7,6 @@
7
7
 
8
8
  module FFI
9
9
  module Clang
10
- VERSION = "0.10.0"
10
+ VERSION = "0.11.0"
11
11
  end
12
12
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-clang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -55,7 +55,7 @@ cert_chain:
55
55
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
56
56
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
57
57
  -----END CERTIFICATE-----
58
- date: 2024-06-14 00:00:00.000000000 Z
58
+ date: 2024-11-13 00:00:00.000000000 Z
59
59
  dependencies:
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: ffi
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.5.9
146
+ rubygems_version: 3.5.22
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Ruby FFI bindings for libclang C interface.
metadata.gz.sig CHANGED
Binary file