ffi_gen 0.8 → 1.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.
Files changed (5) hide show
  1. data/LICENSE +20 -0
  2. data/README.md +77 -0
  3. data/lib/ffi_gen.rb +195 -108
  4. data/lib/ffi_gen/clang.rb +351 -349
  5. metadata +6 -4
@@ -5,14 +5,11 @@ require 'ffi'
5
5
  module Clang
6
6
  extend FFI::Library
7
7
  ffi_lib 'clang'
8
-
8
+
9
9
  # A single translation unit, which resides in an index.
10
- #
11
- # = Fields:
12
- #
13
10
  class TranslationUnitImpl < FFI::Struct
14
11
  end
15
-
12
+
16
13
  # Provides the contents of a file that has not yet been saved to disk.
17
14
  #
18
15
  # Each CXUnsavedFile instance provides the name of a file on the
@@ -28,17 +25,18 @@ module Clang
28
25
  # (String) A buffer containing the unsaved contents of this file.
29
26
  # :length ::
30
27
  # (Integer) The length of the unsaved contents of this buffer.
31
- #
32
28
  class UnsavedFile < FFI::Struct
33
29
  layout :filename, :string,
34
30
  :contents, :string,
35
31
  :length, :ulong
36
32
  end
37
-
33
+
38
34
  # Describes the availability of a particular entity, which indicates
39
35
  # whether the use of this entity will result in a warning or error due to
40
36
  # it being deprecated or unavailable.
41
37
  #
38
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:availability_kind).</em>
39
+ #
42
40
  # === Options:
43
41
  # :available ::
44
42
  # The entity is available.
@@ -50,18 +48,17 @@ module Clang
50
48
  # :not_accessible ::
51
49
  # The entity is available, but not accessible; any use of it will be
52
50
  # an error.
53
- #
54
- # @return [Array<Symbol>]
55
- def self.availability_kind_enum
56
- [:available, :deprecated, :not_available, :not_accessible]
57
- end
51
+ #
52
+ # @method _enum_availability_kind_
53
+ # @return [Symbol]
54
+ # @scope class
58
55
  enum :availability_kind, [
59
56
  :available,
60
57
  :deprecated,
61
58
  :not_available,
62
59
  :not_accessible
63
60
  ]
64
-
61
+
65
62
  # A character string.
66
63
  #
67
64
  # The \c CXString type is used to return strings from the interface when
@@ -74,12 +71,11 @@ module Clang
74
71
  # (FFI::Pointer(*Void))
75
72
  # :private_flags ::
76
73
  # (Integer)
77
- #
78
74
  class String < FFI::Struct
79
75
  layout :data, :pointer,
80
76
  :private_flags, :uint
81
77
  end
82
-
78
+
83
79
  # Retrieve the character data associated with the given string.
84
80
  #
85
81
  # @method get_c_string(string)
@@ -87,7 +83,7 @@ module Clang
87
83
  # @return [String]
88
84
  # @scope class
89
85
  attach_function :get_c_string, :clang_getCString, [String.by_value], :string
90
-
86
+
91
87
  # Free the given string,
92
88
  #
93
89
  # @method dispose_string(string)
@@ -95,7 +91,7 @@ module Clang
95
91
  # @return [nil]
96
92
  # @scope class
97
93
  attach_function :dispose_string, :clang_disposeString, [String.by_value], :void
98
-
94
+
99
95
  # clang_createIndex() provides a shared context for creating
100
96
  # translation units. It provides two options:
101
97
  #
@@ -138,7 +134,7 @@ module Clang
138
134
  # @return [FFI::Pointer(Index)]
139
135
  # @scope class
140
136
  attach_function :create_index, :clang_createIndex, [:int, :int], :pointer
141
-
137
+
142
138
  # Destroy the given index.
143
139
  #
144
140
  # The index must not be destroyed until all of the translation units created
@@ -149,7 +145,7 @@ module Clang
149
145
  # @return [nil]
150
146
  # @scope class
151
147
  attach_function :dispose_index, :clang_disposeIndex, [:pointer], :void
152
-
148
+
153
149
  # Retrieve the complete file and path name of the given file.
154
150
  #
155
151
  # @method get_file_name(s_file)
@@ -157,7 +153,7 @@ module Clang
157
153
  # @return [String]
158
154
  # @scope class
159
155
  attach_function :get_file_name, :clang_getFileName, [:pointer], String.by_value
160
-
156
+
161
157
  # Retrieve the last modification time of the given file.
162
158
  #
163
159
  # @method get_file_time(s_file)
@@ -165,7 +161,7 @@ module Clang
165
161
  # @return [Integer]
166
162
  # @scope class
167
163
  attach_function :get_file_time, :clang_getFileTime, [:pointer], :long
168
-
164
+
169
165
  # Determine whether the given header is guarded against
170
166
  # multiple inclusions, either with the conventional
171
167
  # #ifndef/#define/#endif macro guards or with #pragma once.
@@ -176,7 +172,7 @@ module Clang
176
172
  # @return [Integer]
177
173
  # @scope class
178
174
  attach_function :is_file_multiple_include_guarded, :clang_isFileMultipleIncludeGuarded, [:pointer, :pointer], :uint
179
-
175
+
180
176
  # Retrieve a file handle within the given translation unit.
181
177
  #
182
178
  # @method get_file(tu, file_name)
@@ -186,7 +182,7 @@ module Clang
186
182
  # or a NULL file handle if the file was not a part of this translation unit.
187
183
  # @scope class
188
184
  attach_function :get_file, :clang_getFile, [:pointer, :string], :pointer
189
-
185
+
190
186
  # Identifies a specific source location within a translation
191
187
  # unit.
192
188
  #
@@ -198,12 +194,11 @@ module Clang
198
194
  # (Array<FFI::Pointer(*Void)>)
199
195
  # :int_data ::
200
196
  # (Integer)
201
- #
202
197
  class SourceLocation < FFI::Struct
203
198
  layout :ptr_data, [:pointer, 2],
204
199
  :int_data, :uint
205
200
  end
206
-
201
+
207
202
  # Identifies a half-open character range in the source code.
208
203
  #
209
204
  # Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the
@@ -216,20 +211,19 @@ module Clang
216
211
  # (Integer)
217
212
  # :end_int_data ::
218
213
  # (Integer)
219
- #
220
214
  class SourceRange < FFI::Struct
221
215
  layout :ptr_data, [:pointer, 2],
222
216
  :begin_int_data, :uint,
223
217
  :end_int_data, :uint
224
218
  end
225
-
219
+
226
220
  # Retrieve a NULL (invalid) source location.
227
221
  #
228
222
  # @method get_null_location()
229
223
  # @return [SourceLocation]
230
224
  # @scope class
231
225
  attach_function :get_null_location, :clang_getNullLocation, [], SourceLocation.by_value
232
-
226
+
233
227
  # Determine whether two source locations, which must refer into
234
228
  # the same translation unit, refer to exactly the same point in the source
235
229
  # code.
@@ -241,7 +235,7 @@ module Clang
241
235
  # if they refer to different locations.
242
236
  # @scope class
243
237
  attach_function :equal_locations, :clang_equalLocations, [SourceLocation.by_value, SourceLocation.by_value], :uint
244
-
238
+
245
239
  # Retrieves the source location associated with a given file/line/column
246
240
  # in a particular translation unit.
247
241
  #
@@ -253,7 +247,7 @@ module Clang
253
247
  # @return [SourceLocation]
254
248
  # @scope class
255
249
  attach_function :get_location, :clang_getLocation, [:pointer, :pointer, :uint, :uint], SourceLocation.by_value
256
-
250
+
257
251
  # Retrieves the source location associated with a given character offset
258
252
  # in a particular translation unit.
259
253
  #
@@ -264,14 +258,14 @@ module Clang
264
258
  # @return [SourceLocation]
265
259
  # @scope class
266
260
  attach_function :get_location_for_offset, :clang_getLocationForOffset, [:pointer, :pointer, :uint], SourceLocation.by_value
267
-
261
+
268
262
  # Retrieve a NULL (invalid) source range.
269
263
  #
270
264
  # @method get_null_range()
271
265
  # @return [SourceRange]
272
266
  # @scope class
273
267
  attach_function :get_null_range, :clang_getNullRange, [], SourceRange.by_value
274
-
268
+
275
269
  # Retrieve a source range given the beginning and ending source
276
270
  # locations.
277
271
  #
@@ -281,7 +275,7 @@ module Clang
281
275
  # @return [SourceRange]
282
276
  # @scope class
283
277
  attach_function :get_range, :clang_getRange, [SourceLocation.by_value, SourceLocation.by_value], SourceRange.by_value
284
-
278
+
285
279
  # Determine whether two ranges are equivalent.
286
280
  #
287
281
  # @method equal_ranges(range1, range2)
@@ -290,7 +284,7 @@ module Clang
290
284
  # @return [Integer] non-zero if the ranges are the same, zero if they differ.
291
285
  # @scope class
292
286
  attach_function :equal_ranges, :clang_equalRanges, [SourceRange.by_value, SourceRange.by_value], :uint
293
-
287
+
294
288
  # Returns non-zero if \arg range is null.
295
289
  #
296
290
  # @method range_is_null(range)
@@ -298,7 +292,7 @@ module Clang
298
292
  # @return [Integer]
299
293
  # @scope class
300
294
  attach_function :range_is_null, :clang_Range_isNull, [SourceRange.by_value], :int
301
-
295
+
302
296
  # Retrieve the file, line, column, and offset represented by
303
297
  # the given source location, as specified in a # line directive.
304
298
  #
@@ -336,7 +330,7 @@ module Clang
336
330
  # @return [nil]
337
331
  # @scope class
338
332
  attach_function :get_presumed_location, :clang_getPresumedLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer], :void
339
-
333
+
340
334
  # Legacy API to retrieve the file, line, column, and offset represented
341
335
  # by the given source location.
342
336
  #
@@ -353,7 +347,7 @@ module Clang
353
347
  # @return [nil]
354
348
  # @scope class
355
349
  attach_function :get_instantiation_location, :clang_getInstantiationLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer, :pointer], :void
356
-
350
+
357
351
  # Retrieve the file, line, column, and offset represented by
358
352
  # the given source location.
359
353
  #
@@ -374,7 +368,7 @@ module Clang
374
368
  # @return [nil]
375
369
  # @scope class
376
370
  attach_function :get_spelling_location, :clang_getSpellingLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer, :pointer], :void
377
-
371
+
378
372
  # Retrieve a source location representing the first character within a
379
373
  # source range.
380
374
  #
@@ -383,7 +377,7 @@ module Clang
383
377
  # @return [SourceLocation]
384
378
  # @scope class
385
379
  attach_function :get_range_start, :clang_getRangeStart, [SourceRange.by_value], SourceLocation.by_value
386
-
380
+
387
381
  # Retrieve a source location representing the last character within a
388
382
  # source range.
389
383
  #
@@ -392,9 +386,11 @@ module Clang
392
386
  # @return [SourceLocation]
393
387
  # @scope class
394
388
  attach_function :get_range_end, :clang_getRangeEnd, [SourceRange.by_value], SourceLocation.by_value
395
-
389
+
396
390
  # Describes the severity of a particular diagnostic.
397
391
  #
392
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:diagnostic_severity).</em>
393
+ #
398
394
  # === Options:
399
395
  # :ignored ::
400
396
  # A diagnostic that has been suppressed, e.g., by a command-line
@@ -411,11 +407,10 @@ module Clang
411
407
  # This diagnostic indicates that the code is ill-formed such
412
408
  # that future parser recovery is unlikely to produce useful
413
409
  # results.
414
- #
415
- # @return [Array<Symbol>]
416
- def self.diagnostic_severity_enum
417
- [:ignored, :note, :warning, :error, :fatal]
418
- end
410
+ #
411
+ # @method _enum_diagnostic_severity_
412
+ # @return [Symbol]
413
+ # @scope class
419
414
  enum :diagnostic_severity, [
420
415
  :ignored, 0,
421
416
  :note, 1,
@@ -423,7 +418,7 @@ module Clang
423
418
  :error, 3,
424
419
  :fatal, 4
425
420
  ]
426
-
421
+
427
422
  # Determine the number of diagnostics produced for the given
428
423
  # translation unit.
429
424
  #
@@ -432,7 +427,7 @@ module Clang
432
427
  # @return [Integer]
433
428
  # @scope class
434
429
  attach_function :get_num_diagnostics, :clang_getNumDiagnostics, [:pointer], :uint
435
-
430
+
436
431
  # Retrieve a diagnostic associated with the given translation unit.
437
432
  #
438
433
  # @method get_diagnostic(unit, index)
@@ -442,7 +437,7 @@ module Clang
442
437
  # via a call to \c clang_disposeDiagnostic().
443
438
  # @scope class
444
439
  attach_function :get_diagnostic, :clang_getDiagnostic, [:pointer, :uint], :pointer
445
-
440
+
446
441
  # Destroy a diagnostic.
447
442
  #
448
443
  # @method dispose_diagnostic(diagnostic)
@@ -450,12 +445,14 @@ module Clang
450
445
  # @return [nil]
451
446
  # @scope class
452
447
  attach_function :dispose_diagnostic, :clang_disposeDiagnostic, [:pointer], :void
453
-
448
+
454
449
  # Options to control the display of diagnostics.
455
450
  #
456
451
  # The values in this enum are meant to be combined to customize the
457
452
  # behavior of \c clang_displayDiagnostic().
458
453
  #
454
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:diagnostic_display_options).</em>
455
+ #
459
456
  # === Options:
460
457
  # :display_source_location ::
461
458
  # Display the source-location information where the
@@ -499,11 +496,10 @@ module Clang
499
496
  # The category name is displayed within brackets after the diagnostic text.
500
497
  # This option corresponds to the clang flag
501
498
  # \c -fdiagnostics-show-category=name.
502
- #
503
- # @return [Array<Symbol>]
504
- def self.diagnostic_display_options_enum
505
- [:display_source_location, :display_column, :display_source_ranges, :display_option, :display_category_id, :display_category_name]
506
- end
499
+ #
500
+ # @method _enum_diagnostic_display_options_
501
+ # @return [Symbol]
502
+ # @scope class
507
503
  enum :diagnostic_display_options, [
508
504
  :display_source_location, 0x01,
509
505
  :display_column, 0x02,
@@ -512,7 +508,7 @@ module Clang
512
508
  :display_category_id, 0x10,
513
509
  :display_category_name, 0x20
514
510
  ]
515
-
511
+
516
512
  # Format the given diagnostic in a manner that is suitable for display.
517
513
  #
518
514
  # This routine will format the given diagnostic to a string, rendering
@@ -527,7 +523,7 @@ module Clang
527
523
  # @return [String] A new string containing for formatted diagnostic.
528
524
  # @scope class
529
525
  attach_function :format_diagnostic, :clang_formatDiagnostic, [:pointer, :uint], String.by_value
530
-
526
+
531
527
  # Retrieve the set of display options most similar to the
532
528
  # default behavior of the clang compiler.
533
529
  #
@@ -536,15 +532,15 @@ module Clang
536
532
  # clang_displayDiagnostic().
537
533
  # @scope class
538
534
  attach_function :default_diagnostic_display_options, :clang_defaultDiagnosticDisplayOptions, [], :uint
539
-
535
+
540
536
  # Determine the severity of the given diagnostic.
541
537
  #
542
538
  # @method get_diagnostic_severity(diagnostic)
543
539
  # @param [FFI::Pointer(Diagnostic)] diagnostic
544
- # @return [Symbol from diagnostic_severity_enum]
540
+ # @return [Symbol from _enum_diagnostic_severity_]
545
541
  # @scope class
546
542
  attach_function :get_diagnostic_severity, :clang_getDiagnosticSeverity, [:pointer], :diagnostic_severity
547
-
543
+
548
544
  # Retrieve the source location of the given diagnostic.
549
545
  #
550
546
  # This location is where Clang would print the caret ('^') when
@@ -555,7 +551,7 @@ module Clang
555
551
  # @return [SourceLocation]
556
552
  # @scope class
557
553
  attach_function :get_diagnostic_location, :clang_getDiagnosticLocation, [:pointer], SourceLocation.by_value
558
-
554
+
559
555
  # Retrieve the text of the given diagnostic.
560
556
  #
561
557
  # @method get_diagnostic_spelling(diagnostic)
@@ -563,7 +559,7 @@ module Clang
563
559
  # @return [String]
564
560
  # @scope class
565
561
  attach_function :get_diagnostic_spelling, :clang_getDiagnosticSpelling, [:pointer], String.by_value
566
-
562
+
567
563
  # Retrieve the name of the command-line option that enabled this
568
564
  # diagnostic.
569
565
  #
@@ -575,7 +571,7 @@ module Clang
575
571
  # warning, such as "-Wconversion" or "-pedantic".
576
572
  # @scope class
577
573
  attach_function :get_diagnostic_option, :clang_getDiagnosticOption, [:pointer, :pointer], String.by_value
578
-
574
+
579
575
  # Retrieve the category number for this diagnostic.
580
576
  #
581
577
  # Diagnostics can be categorized into groups along with other, related
@@ -588,7 +584,7 @@ module Clang
588
584
  # if this diagnostic is uncategorized.
589
585
  # @scope class
590
586
  attach_function :get_diagnostic_category, :clang_getDiagnosticCategory, [:pointer], :uint
591
-
587
+
592
588
  # Retrieve the name of a particular diagnostic category.
593
589
  #
594
590
  # @method get_diagnostic_category_name(category)
@@ -597,7 +593,7 @@ module Clang
597
593
  # @return [String] The name of the given diagnostic category.
598
594
  # @scope class
599
595
  attach_function :get_diagnostic_category_name, :clang_getDiagnosticCategoryName, [:uint], String.by_value
600
-
596
+
601
597
  # Determine the number of source ranges associated with the given
602
598
  # diagnostic.
603
599
  #
@@ -606,7 +602,7 @@ module Clang
606
602
  # @return [Integer]
607
603
  # @scope class
608
604
  attach_function :get_diagnostic_num_ranges, :clang_getDiagnosticNumRanges, [:pointer], :uint
609
-
605
+
610
606
  # Retrieve a source range associated with the diagnostic.
611
607
  #
612
608
  # A diagnostic's source ranges highlight important elements in the source
@@ -619,7 +615,7 @@ module Clang
619
615
  # @return [SourceRange] the requested source range.
620
616
  # @scope class
621
617
  attach_function :get_diagnostic_range, :clang_getDiagnosticRange, [:pointer, :uint], SourceRange.by_value
622
-
618
+
623
619
  # Determine the number of fix-it hints associated with the
624
620
  # given diagnostic.
625
621
  #
@@ -628,7 +624,7 @@ module Clang
628
624
  # @return [Integer]
629
625
  # @scope class
630
626
  attach_function :get_diagnostic_num_fix_its, :clang_getDiagnosticNumFixIts, [:pointer], :uint
631
-
627
+
632
628
  # Retrieve the replacement information for a given fix-it.
633
629
  #
634
630
  # Fix-its are described in terms of a source range whose contents
@@ -652,7 +648,7 @@ module Clang
652
648
  # code indicated by the \c ReplacementRange.
653
649
  # @scope class
654
650
  attach_function :get_diagnostic_fix_it, :clang_getDiagnosticFixIt, [:pointer, :uint, :pointer], String.by_value
655
-
651
+
656
652
  # Get the original translation unit source file name.
657
653
  #
658
654
  # @method get_translation_unit_spelling(ct_unit)
@@ -660,7 +656,7 @@ module Clang
660
656
  # @return [String]
661
657
  # @scope class
662
658
  attach_function :get_translation_unit_spelling, :clang_getTranslationUnitSpelling, [:pointer], String.by_value
663
-
659
+
664
660
  # Return the CXTranslationUnit for a given source file and the provided
665
661
  # command line arguments one would pass to the compiler.
666
662
  #
@@ -698,7 +694,7 @@ module Clang
698
694
  # @return [FFI::Pointer(TranslationUnit)]
699
695
  # @scope class
700
696
  attach_function :create_translation_unit_from_source_file, :clang_createTranslationUnitFromSourceFile, [:pointer, :string, :int, :pointer, :uint, :pointer], :pointer
701
-
697
+
702
698
  # Create a translation unit from an AST file (-emit-ast).
703
699
  #
704
700
  # @method create_translation_unit(index, ast_filename)
@@ -707,13 +703,15 @@ module Clang
707
703
  # @return [FFI::Pointer(TranslationUnit)]
708
704
  # @scope class
709
705
  attach_function :create_translation_unit, :clang_createTranslationUnit, [:pointer, :string], :pointer
710
-
706
+
711
707
  # Flags that control the creation of translation units.
712
708
  #
713
709
  # The enumerators in this enumeration type are meant to be bitwise
714
710
  # ORed together to specify which options should be used when
715
711
  # constructing the translation unit.
716
712
  #
713
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:translation_unit_flags).</em>
714
+ #
717
715
  # === Options:
718
716
  # :none ::
719
717
  # Used to indicate that no special translation-unit options are
@@ -775,11 +773,10 @@ module Clang
775
773
  # inside another macro expansion) can, in some code bases, require
776
774
  # a large amount of storage to due preprocessor metaprogramming. Moreover,
777
775
  # its fairly rare that this information is useful for libclang clients.
778
- #
779
- # @return [Array<Symbol>]
780
- def self.translation_unit_flags_enum
781
- [:none, :detailed_preprocessing_record, :incomplete, :precompiled_preamble, :cache_completion_results, :x_precompiled_preamble, :x_chained_pch, :nested_macro_expansions]
782
- end
776
+ #
777
+ # @method _enum_translation_unit_flags_
778
+ # @return [Symbol]
779
+ # @scope class
783
780
  enum :translation_unit_flags, [
784
781
  :none, 0x0,
785
782
  :detailed_preprocessing_record, 0x01,
@@ -790,7 +787,7 @@ module Clang
790
787
  :x_chained_pch, 0x20,
791
788
  :nested_macro_expansions, 0x40
792
789
  ]
793
-
790
+
794
791
  # Returns the set of flags that is suitable for parsing a translation
795
792
  # unit that is being edited.
796
793
  #
@@ -806,7 +803,7 @@ module Clang
806
803
  # @return [Integer]
807
804
  # @scope class
808
805
  attach_function :default_editing_translation_unit_options, :clang_defaultEditingTranslationUnitOptions, [], :uint
809
-
806
+
810
807
  # Parse the given source file and the translation unit corresponding
811
808
  # to that file.
812
809
  #
@@ -843,25 +840,26 @@ module Clang
843
840
  # the compiler cannot recover, returns NULL.
844
841
  # @scope class
845
842
  attach_function :parse_translation_unit, :clang_parseTranslationUnit, [:pointer, :string, :pointer, :int, :pointer, :uint, :uint], :pointer
846
-
843
+
847
844
  # Flags that control how translation units are saved.
848
845
  #
849
846
  # The enumerators in this enumeration type are meant to be bitwise
850
847
  # ORed together to specify which options should be used when
851
848
  # saving the translation unit.
852
849
  #
850
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:save_translation_unit_flags).</em>
851
+ #
853
852
  # === Options:
854
853
  # :save_translation_unit_none ::
855
854
  # Used to indicate that no special saving options are needed.
856
- #
857
- # @return [Array<Symbol>]
858
- def self.save_translation_unit_flags_enum
859
- [:save_translation_unit_none]
860
- end
855
+ #
856
+ # @method _enum_save_translation_unit_flags_
857
+ # @return [Symbol]
858
+ # @scope class
861
859
  enum :save_translation_unit_flags, [
862
860
  :save_translation_unit_none, 0x0
863
861
  ]
864
-
862
+
865
863
  # Returns the set of flags that is suitable for saving a translation
866
864
  # unit.
867
865
  #
@@ -875,10 +873,12 @@ module Clang
875
873
  # @return [Integer]
876
874
  # @scope class
877
875
  attach_function :default_save_options, :clang_defaultSaveOptions, [:pointer], :uint
878
-
876
+
879
877
  # Describes the kind of error that occurred (if any) in a call to
880
878
  # \c clang_saveTranslationUnit().
881
879
  #
880
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:save_error).</em>
881
+ #
882
882
  # === Options:
883
883
  # :none ::
884
884
  # Indicates that no error occurred while saving a translation unit.
@@ -897,18 +897,17 @@ module Clang
897
897
  # :invalid_tu ::
898
898
  # Indicates that the translation unit to be saved was somehow
899
899
  # invalid (e.g., NULL).
900
- #
901
- # @return [Array<Symbol>]
902
- def self.save_error_enum
903
- [:none, :unknown, :translation_errors, :invalid_tu]
904
- end
900
+ #
901
+ # @method _enum_save_error_
902
+ # @return [Symbol]
903
+ # @scope class
905
904
  enum :save_error, [
906
905
  :none, 0,
907
906
  :unknown, 1,
908
907
  :translation_errors, 2,
909
908
  :invalid_tu, 3
910
909
  ]
911
-
910
+
912
911
  # Saves a translation unit into a serialized representation of
913
912
  # that translation unit on disk.
914
913
  #
@@ -930,7 +929,7 @@ module Clang
930
929
  # saved successfully, while a non-zero value indicates that a problem occurred.
931
930
  # @scope class
932
931
  attach_function :save_translation_unit, :clang_saveTranslationUnit, [:pointer, :string, :uint], :int
933
-
932
+
934
933
  # Destroy the specified CXTranslationUnit object.
935
934
  #
936
935
  # @method dispose_translation_unit(translation_unit)
@@ -938,25 +937,26 @@ module Clang
938
937
  # @return [nil]
939
938
  # @scope class
940
939
  attach_function :dispose_translation_unit, :clang_disposeTranslationUnit, [:pointer], :void
941
-
940
+
942
941
  # Flags that control the reparsing of translation units.
943
942
  #
944
943
  # The enumerators in this enumeration type are meant to be bitwise
945
944
  # ORed together to specify which options should be used when
946
945
  # reparsing the translation unit.
947
946
  #
947
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:reparse_flags).</em>
948
+ #
948
949
  # === Options:
949
950
  # :reparse_none ::
950
951
  # Used to indicate that no special reparsing options are needed.
951
- #
952
- # @return [Array<Symbol>]
953
- def self.reparse_flags_enum
954
- [:reparse_none]
955
- end
952
+ #
953
+ # @method _enum_reparse_flags_
954
+ # @return [Symbol]
955
+ # @scope class
956
956
  enum :reparse_flags, [
957
957
  :reparse_none, 0x0
958
958
  ]
959
-
959
+
960
960
  # Returns the set of flags that is suitable for reparsing a translation
961
961
  # unit.
962
962
  #
@@ -971,7 +971,7 @@ module Clang
971
971
  # @return [Integer]
972
972
  # @scope class
973
973
  attach_function :default_reparse_options, :clang_defaultReparseOptions, [:pointer], :uint
974
-
974
+
975
975
  # Reparse the source files that produced this translation unit.
976
976
  #
977
977
  # This routine can be used to re-parse the source files that originally
@@ -1007,9 +1007,11 @@ module Clang
1007
1007
  # \c clang_disposeTranslationUnit(TU).
1008
1008
  # @scope class
1009
1009
  attach_function :reparse_translation_unit, :clang_reparseTranslationUnit, [:pointer, :uint, :pointer, :uint], :int
1010
-
1010
+
1011
1011
  # Categorizes how memory is being used by a translation unit.
1012
1012
  #
1013
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:tu_resource_usage_kind).</em>
1014
+ #
1013
1015
  # === Options:
1014
1016
  # :ast ::
1015
1017
  #
@@ -1039,11 +1041,10 @@ module Clang
1039
1041
  #
1040
1042
  # :preprocessor_header_search ::
1041
1043
  #
1042
- #
1043
- # @return [Array<Symbol>]
1044
- def self.tu_resource_usage_kind_enum
1045
- [:ast, :identifiers, :selectors, :global_completion_results, :source_manager_content_cache, :ast_side_tables, :source_manager_membuffer_malloc, :source_manager_membuffer_m_map, :external_ast_source_membuffer_malloc, :external_ast_source_membuffer_m_map, :preprocessor, :preprocessing_record, :source_manager_data_structures, :preprocessor_header_search]
1046
- end
1044
+ #
1045
+ # @method _enum_tu_resource_usage_kind_
1046
+ # @return [Symbol]
1047
+ # @scope class
1047
1048
  enum :tu_resource_usage_kind, [
1048
1049
  :ast, 1,
1049
1050
  :identifiers, 2,
@@ -1060,30 +1061,29 @@ module Clang
1060
1061
  :source_manager_data_structures, 13,
1061
1062
  :preprocessor_header_search, 14
1062
1063
  ]
1063
-
1064
+
1064
1065
  # Returns the human-readable null-terminated C string that represents
1065
1066
  # the name of the memory category. This string should never be freed.
1066
1067
  #
1067
1068
  # @method get_tu_resource_usage_name(kind)
1068
- # @param [Symbol from tu_resource_usage_kind_enum] kind
1069
+ # @param [Symbol from _enum_tu_resource_usage_kind_] kind
1069
1070
  # @return [String]
1070
1071
  # @scope class
1071
1072
  attach_function :get_tu_resource_usage_name, :clang_getTUResourceUsageName, [:tu_resource_usage_kind], :string
1072
-
1073
+
1073
1074
  # (Not documented)
1074
1075
  #
1075
1076
  # = Fields:
1076
1077
  # :kind ::
1077
- # (Symbol from tu_resource_usage_kind_enum) The memory usage category.
1078
+ # (Symbol from _enum_tu_resource_usage_kind_) The memory usage category.
1078
1079
  # :amount ::
1079
1080
  # (Integer) Amount of resources used.
1080
1081
  # The units will depend on the resource kind.
1081
- #
1082
1082
  class TUResourceUsageEntry < FFI::Struct
1083
1083
  layout :kind, :tu_resource_usage_kind,
1084
1084
  :amount, :ulong
1085
1085
  end
1086
-
1086
+
1087
1087
  # The memory usage of a CXTranslationUnit, broken into categories.
1088
1088
  #
1089
1089
  # = Fields:
@@ -1094,13 +1094,12 @@ module Clang
1094
1094
  # :entries ::
1095
1095
  # (FFI::Pointer(*TUResourceUsageEntry)) An array of key-value pairs, representing the breakdown of memory
1096
1096
  # usage.
1097
- #
1098
1097
  class TUResourceUsage < FFI::Struct
1099
1098
  layout :data, :pointer,
1100
1099
  :num_entries, :uint,
1101
1100
  :entries, :pointer
1102
1101
  end
1103
-
1102
+
1104
1103
  # Return the memory usage of a translation unit. This object
1105
1104
  # should be released with clang_disposeCXTUResourceUsage().
1106
1105
  #
@@ -1109,7 +1108,7 @@ module Clang
1109
1108
  # @return [TUResourceUsage]
1110
1109
  # @scope class
1111
1110
  attach_function :get_cxtu_resource_usage, :clang_getCXTUResourceUsage, [:pointer], TUResourceUsage.by_value
1112
-
1111
+
1113
1112
  # (Not documented)
1114
1113
  #
1115
1114
  # @method dispose_cxtu_resource_usage(usage)
@@ -1117,9 +1116,11 @@ module Clang
1117
1116
  # @return [nil]
1118
1117
  # @scope class
1119
1118
  attach_function :dispose_cxtu_resource_usage, :clang_disposeCXTUResourceUsage, [TUResourceUsage.by_value], :void
1120
-
1119
+
1121
1120
  # Describes the kind of entity that a cursor refers to.
1122
1121
  #
1122
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:cursor_kind).</em>
1123
+ #
1123
1124
  # === Options:
1124
1125
  # :unexposed_decl ::
1125
1126
  # A declaration whose specific kind is not exposed via this
@@ -1558,11 +1559,10 @@ module Clang
1558
1559
  #
1559
1560
  # :inclusion_directive ::
1560
1561
  #
1561
- #
1562
- # @return [Array<Symbol>]
1563
- def self.cursor_kind_enum
1564
- [:unexposed_decl, :struct_decl, :union_decl, :class_decl, :enum_decl, :field_decl, :enum_constant_decl, :function_decl, :var_decl, :parm_decl, :obj_c_interface_decl, :obj_c_category_decl, :obj_c_protocol_decl, :obj_c_property_decl, :obj_c_ivar_decl, :obj_c_instance_method_decl, :obj_c_class_method_decl, :obj_c_implementation_decl, :obj_c_category_impl_decl, :typedef_decl, :x_method, :namespace, :linkage_spec, :constructor, :destructor, :conversion_function, :template_type_parameter, :non_type_template_parameter, :template_template_parameter, :function_template, :class_template, :class_template_partial_specialization, :namespace_alias, :using_directive, :using_declaration, :type_alias_decl, :obj_c_synthesize_decl, :obj_c_dynamic_decl, :x_access_specifier, :first_ref, :obj_c_super_class_ref, :obj_c_protocol_ref, :obj_c_class_ref, :type_ref, :x_base_specifier, :template_ref, :namespace_ref, :member_ref, :label_ref, :overloaded_decl_ref, :first_invalid, :invalid_file, :no_decl_found, :not_implemented, :invalid_code, :first_expr, :unexposed_expr, :decl_ref_expr, :member_ref_expr, :call_expr, :obj_c_message_expr, :block_expr, :integer_literal, :floating_literal, :imaginary_literal, :string_literal, :character_literal, :paren_expr, :unary_operator, :array_subscript_expr, :binary_operator, :compound_assign_operator, :conditional_operator, :c_style_cast_expr, :compound_literal_expr, :init_list_expr, :addr_label_expr, :stmt_expr, :generic_selection_expr, :gnu_null_expr, :x_static_cast_expr, :x_dynamic_cast_expr, :x_reinterpret_cast_expr, :x_const_cast_expr, :x_functional_cast_expr, :x_typeid_expr, :x_bool_literal_expr, :x_null_ptr_literal_expr, :x_this_expr, :x_throw_expr, :x_new_expr, :x_delete_expr, :unary_expr, :obj_c_string_literal, :obj_c_encode_expr, :obj_c_selector_expr, :obj_c_protocol_expr, :obj_c_bridged_cast_expr, :pack_expansion_expr, :size_of_pack_expr, :first_stmt, :unexposed_stmt, :label_stmt, :compound_stmt, :case_stmt, :default_stmt, :if_stmt, :switch_stmt, :while_stmt, :do_stmt, :for_stmt, :goto_stmt, :indirect_goto_stmt, :continue_stmt, :break_stmt, :return_stmt, :asm_stmt, :obj_c_at_try_stmt, :obj_c_at_catch_stmt, :obj_c_at_finally_stmt, :obj_c_at_throw_stmt, :obj_c_at_synchronized_stmt, :obj_c_autorelease_pool_stmt, :obj_c_for_collection_stmt, :x_catch_stmt, :x_try_stmt, :x_for_range_stmt, :seh_try_stmt, :seh_except_stmt, :seh_finally_stmt, :null_stmt, :decl_stmt, :translation_unit, :first_attr, :unexposed_attr, :ib_action_attr, :ib_outlet_attr, :ib_outlet_collection_attr, :x_final_attr, :x_override_attr, :annotate_attr, :preprocessing_directive, :macro_definition, :macro_expansion, :inclusion_directive]
1565
- end
1562
+ #
1563
+ # @method _enum_cursor_kind_
1564
+ # @return [Symbol]
1565
+ # @scope class
1566
1566
  enum :cursor_kind, [
1567
1567
  :unexposed_decl, 1,
1568
1568
  :struct_decl, 2,
@@ -1710,7 +1710,7 @@ module Clang
1710
1710
  :macro_expansion, 502,
1711
1711
  :inclusion_directive, 503
1712
1712
  ]
1713
-
1713
+
1714
1714
  # A cursor representing some element in the abstract syntax tree for
1715
1715
  # a translation unit.
1716
1716
  #
@@ -1730,25 +1730,24 @@ module Clang
1730
1730
  #
1731
1731
  # = Fields:
1732
1732
  # :kind ::
1733
- # (Symbol from cursor_kind_enum)
1733
+ # (Symbol from _enum_cursor_kind_)
1734
1734
  # :xdata ::
1735
1735
  # (Integer)
1736
1736
  # :data ::
1737
1737
  # (Array<FFI::Pointer(*Void)>)
1738
- #
1739
1738
  class Cursor < FFI::Struct
1740
1739
  layout :kind, :cursor_kind,
1741
1740
  :xdata, :int,
1742
1741
  :data, [:pointer, 3]
1743
1742
  end
1744
-
1743
+
1745
1744
  # Retrieve the NULL cursor, which represents no entity.
1746
1745
  #
1747
1746
  # @method get_null_cursor()
1748
1747
  # @return [Cursor]
1749
1748
  # @scope class
1750
1749
  attach_function :get_null_cursor, :clang_getNullCursor, [], Cursor.by_value
1751
-
1750
+
1752
1751
  # Retrieve the cursor that represents the given translation unit.
1753
1752
  #
1754
1753
  # The translation unit cursor can be used to start traversing the
@@ -1759,7 +1758,7 @@ module Clang
1759
1758
  # @return [Cursor]
1760
1759
  # @scope class
1761
1760
  attach_function :get_translation_unit_cursor, :clang_getTranslationUnitCursor, [:pointer], Cursor.by_value
1762
-
1761
+
1763
1762
  # Determine whether two cursors are equivalent.
1764
1763
  #
1765
1764
  # @method equal_cursors(cursor, cursor)
@@ -1768,7 +1767,7 @@ module Clang
1768
1767
  # @return [Integer]
1769
1768
  # @scope class
1770
1769
  attach_function :equal_cursors, :clang_equalCursors, [Cursor.by_value, Cursor.by_value], :uint
1771
-
1770
+
1772
1771
  # Returns non-zero if \arg cursor is null.
1773
1772
  #
1774
1773
  # @method cursor_is_null(cursor)
@@ -1776,7 +1775,7 @@ module Clang
1776
1775
  # @return [Integer]
1777
1776
  # @scope class
1778
1777
  attach_function :cursor_is_null, :clang_Cursor_isNull, [Cursor.by_value], :int
1779
-
1778
+
1780
1779
  # Compute a hash value for the given cursor.
1781
1780
  #
1782
1781
  # @method hash_cursor(cursor)
@@ -1784,23 +1783,23 @@ module Clang
1784
1783
  # @return [Integer]
1785
1784
  # @scope class
1786
1785
  attach_function :hash_cursor, :clang_hashCursor, [Cursor.by_value], :uint
1787
-
1786
+
1788
1787
  # Retrieve the kind of the given cursor.
1789
1788
  #
1790
1789
  # @method get_cursor_kind(cursor)
1791
1790
  # @param [Cursor] cursor
1792
- # @return [Symbol from cursor_kind_enum]
1791
+ # @return [Symbol from _enum_cursor_kind_]
1793
1792
  # @scope class
1794
1793
  attach_function :get_cursor_kind, :clang_getCursorKind, [Cursor.by_value], :cursor_kind
1795
-
1794
+
1796
1795
  # Determine whether the given cursor kind represents a declaration.
1797
1796
  #
1798
1797
  # @method is_declaration(cursor_kind)
1799
- # @param [Symbol from cursor_kind_enum] cursor_kind
1798
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1800
1799
  # @return [Integer]
1801
1800
  # @scope class
1802
1801
  attach_function :is_declaration, :clang_isDeclaration, [:cursor_kind], :uint
1803
-
1802
+
1804
1803
  # Determine whether the given cursor kind represents a simple
1805
1804
  # reference.
1806
1805
  #
@@ -1809,73 +1808,75 @@ module Clang
1809
1808
  # particular cursor refers to another entity.
1810
1809
  #
1811
1810
  # @method is_reference(cursor_kind)
1812
- # @param [Symbol from cursor_kind_enum] cursor_kind
1811
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1813
1812
  # @return [Integer]
1814
1813
  # @scope class
1815
1814
  attach_function :is_reference, :clang_isReference, [:cursor_kind], :uint
1816
-
1815
+
1817
1816
  # Determine whether the given cursor kind represents an expression.
1818
1817
  #
1819
1818
  # @method is_expression(cursor_kind)
1820
- # @param [Symbol from cursor_kind_enum] cursor_kind
1819
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1821
1820
  # @return [Integer]
1822
1821
  # @scope class
1823
1822
  attach_function :is_expression, :clang_isExpression, [:cursor_kind], :uint
1824
-
1823
+
1825
1824
  # Determine whether the given cursor kind represents a statement.
1826
1825
  #
1827
1826
  # @method is_statement(cursor_kind)
1828
- # @param [Symbol from cursor_kind_enum] cursor_kind
1827
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1829
1828
  # @return [Integer]
1830
1829
  # @scope class
1831
1830
  attach_function :is_statement, :clang_isStatement, [:cursor_kind], :uint
1832
-
1831
+
1833
1832
  # Determine whether the given cursor kind represents an attribute.
1834
1833
  #
1835
1834
  # @method is_attribute(cursor_kind)
1836
- # @param [Symbol from cursor_kind_enum] cursor_kind
1835
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1837
1836
  # @return [Integer]
1838
1837
  # @scope class
1839
1838
  attach_function :is_attribute, :clang_isAttribute, [:cursor_kind], :uint
1840
-
1839
+
1841
1840
  # Determine whether the given cursor kind represents an invalid
1842
1841
  # cursor.
1843
1842
  #
1844
1843
  # @method is_invalid(cursor_kind)
1845
- # @param [Symbol from cursor_kind_enum] cursor_kind
1844
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1846
1845
  # @return [Integer]
1847
1846
  # @scope class
1848
1847
  attach_function :is_invalid, :clang_isInvalid, [:cursor_kind], :uint
1849
-
1848
+
1850
1849
  # Determine whether the given cursor kind represents a translation
1851
1850
  # unit.
1852
1851
  #
1853
1852
  # @method is_translation_unit(cursor_kind)
1854
- # @param [Symbol from cursor_kind_enum] cursor_kind
1853
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1855
1854
  # @return [Integer]
1856
1855
  # @scope class
1857
1856
  attach_function :is_translation_unit, :clang_isTranslationUnit, [:cursor_kind], :uint
1858
-
1857
+
1859
1858
  # Determine whether the given cursor represents a preprocessing
1860
1859
  # element, such as a preprocessor directive or macro instantiation.
1861
1860
  #
1862
1861
  # @method is_preprocessing(cursor_kind)
1863
- # @param [Symbol from cursor_kind_enum] cursor_kind
1862
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1864
1863
  # @return [Integer]
1865
1864
  # @scope class
1866
1865
  attach_function :is_preprocessing, :clang_isPreprocessing, [:cursor_kind], :uint
1867
-
1866
+
1868
1867
  # Determine whether the given cursor represents a currently
1869
1868
  # unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).
1870
1869
  #
1871
1870
  # @method is_unexposed(cursor_kind)
1872
- # @param [Symbol from cursor_kind_enum] cursor_kind
1871
+ # @param [Symbol from _enum_cursor_kind_] cursor_kind
1873
1872
  # @return [Integer]
1874
1873
  # @scope class
1875
1874
  attach_function :is_unexposed, :clang_isUnexposed, [:cursor_kind], :uint
1876
-
1875
+
1877
1876
  # Describe the linkage of the entity referred to by a cursor.
1878
1877
  #
1878
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:linkage_kind).</em>
1879
+ #
1879
1880
  # === Options:
1880
1881
  # :invalid ::
1881
1882
  # This value indicates that no linkage information is available
@@ -1890,11 +1891,10 @@ module Clang
1890
1891
  # in C++ anonymous namespaces.
1891
1892
  # :external ::
1892
1893
  # This is the linkage for entities with true, external linkage.
1893
- #
1894
- # @return [Array<Symbol>]
1895
- def self.linkage_kind_enum
1896
- [:invalid, :no_linkage, :internal, :unique_external, :external]
1897
- end
1894
+ #
1895
+ # @method _enum_linkage_kind_
1896
+ # @return [Symbol]
1897
+ # @scope class
1898
1898
  enum :linkage_kind, [
1899
1899
  :invalid,
1900
1900
  :no_linkage,
@@ -1902,25 +1902,27 @@ module Clang
1902
1902
  :unique_external,
1903
1903
  :external
1904
1904
  ]
1905
-
1905
+
1906
1906
  # Determine the linkage of the entity referred to by a given cursor.
1907
1907
  #
1908
1908
  # @method get_cursor_linkage(cursor)
1909
1909
  # @param [Cursor] cursor
1910
- # @return [Symbol from linkage_kind_enum]
1910
+ # @return [Symbol from _enum_linkage_kind_]
1911
1911
  # @scope class
1912
1912
  attach_function :get_cursor_linkage, :clang_getCursorLinkage, [Cursor.by_value], :linkage_kind
1913
-
1913
+
1914
1914
  # Determine the availability of the entity that this cursor refers to.
1915
1915
  #
1916
1916
  # @method get_cursor_availability(cursor)
1917
1917
  # @param [Cursor] cursor The cursor to query.
1918
- # @return [Symbol from availability_kind_enum] The availability of the cursor.
1918
+ # @return [Symbol from _enum_availability_kind_] The availability of the cursor.
1919
1919
  # @scope class
1920
1920
  attach_function :get_cursor_availability, :clang_getCursorAvailability, [Cursor.by_value], :availability_kind
1921
-
1921
+
1922
1922
  # Describe the "language" of the entity referred to by a cursor.
1923
1923
  #
1924
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:language_kind).</em>
1925
+ #
1924
1926
  # === Options:
1925
1927
  # :invalid ::
1926
1928
  #
@@ -1930,26 +1932,25 @@ module Clang
1930
1932
  #
1931
1933
  # :c_plus_plus ::
1932
1934
  #
1933
- #
1934
- # @return [Array<Symbol>]
1935
- def self.language_kind_enum
1936
- [:invalid, :c, :obj_c, :c_plus_plus]
1937
- end
1935
+ #
1936
+ # @method _enum_language_kind_
1937
+ # @return [Symbol]
1938
+ # @scope class
1938
1939
  enum :language_kind, [
1939
1940
  :invalid, 0,
1940
1941
  :c,
1941
1942
  :obj_c,
1942
1943
  :c_plus_plus
1943
1944
  ]
1944
-
1945
+
1945
1946
  # Determine the "language" of the entity referred to by a given cursor.
1946
1947
  #
1947
1948
  # @method get_cursor_language(cursor)
1948
1949
  # @param [Cursor] cursor
1949
- # @return [Symbol from language_kind_enum]
1950
+ # @return [Symbol from _enum_language_kind_]
1950
1951
  # @scope class
1951
1952
  attach_function :get_cursor_language, :clang_getCursorLanguage, [Cursor.by_value], :language_kind
1952
-
1953
+
1953
1954
  # Returns the translation unit that a cursor originated from.
1954
1955
  #
1955
1956
  # @method cursor_get_translation_unit(cursor)
@@ -1957,21 +1958,18 @@ module Clang
1957
1958
  # @return [FFI::Pointer(TranslationUnit)]
1958
1959
  # @scope class
1959
1960
  attach_function :cursor_get_translation_unit, :clang_Cursor_getTranslationUnit, [Cursor.by_value], :pointer
1960
-
1961
+
1961
1962
  # A fast container representing a set of CXCursors.
1962
- #
1963
- # = Fields:
1964
- #
1965
1963
  class CursorSetImpl < FFI::Struct
1966
1964
  end
1967
-
1965
+
1968
1966
  # Creates an empty CXCursorSet.
1969
1967
  #
1970
1968
  # @method create_cx_cursor_set()
1971
1969
  # @return [FFI::Pointer(CursorSet)]
1972
1970
  # @scope class
1973
1971
  attach_function :create_cx_cursor_set, :clang_createCXCursorSet, [], :pointer
1974
-
1972
+
1975
1973
  # Disposes a CXCursorSet and releases its associated memory.
1976
1974
  #
1977
1975
  # @method dispose_cx_cursor_set(cset)
@@ -1979,7 +1977,7 @@ module Clang
1979
1977
  # @return [nil]
1980
1978
  # @scope class
1981
1979
  attach_function :dispose_cx_cursor_set, :clang_disposeCXCursorSet, [:pointer], :void
1982
-
1980
+
1983
1981
  # Queries a CXCursorSet to see if it contains a specific CXCursor.
1984
1982
  #
1985
1983
  # @method cx_cursor_set_contains(cset, cursor)
@@ -1988,7 +1986,7 @@ module Clang
1988
1986
  # @return [Integer] non-zero if the set contains the specified cursor.
1989
1987
  # @scope class
1990
1988
  attach_function :cx_cursor_set_contains, :clang_CXCursorSet_contains, [:pointer, Cursor.by_value], :uint
1991
-
1989
+
1992
1990
  # Inserts a CXCursor into a CXCursorSet.
1993
1991
  #
1994
1992
  # @method cx_cursor_set_insert(cset, cursor)
@@ -1997,7 +1995,7 @@ module Clang
1997
1995
  # @return [Integer] zero if the CXCursor was already in the set, and non-zero otherwise.
1998
1996
  # @scope class
1999
1997
  attach_function :cx_cursor_set_insert, :clang_CXCursorSet_insert, [:pointer, Cursor.by_value], :uint
2000
-
1998
+
2001
1999
  # Determine the semantic parent of the given cursor.
2002
2000
  #
2003
2001
  # The semantic parent of a cursor is the cursor that semantically contains
@@ -2035,7 +2033,7 @@ module Clang
2035
2033
  # @return [Cursor]
2036
2034
  # @scope class
2037
2035
  attach_function :get_cursor_semantic_parent, :clang_getCursorSemanticParent, [Cursor.by_value], Cursor.by_value
2038
-
2036
+
2039
2037
  # Determine the lexical parent of the given cursor.
2040
2038
  #
2041
2039
  # The lexical parent of a cursor is the cursor in which the given \p cursor
@@ -2074,7 +2072,7 @@ module Clang
2074
2072
  # @return [Cursor]
2075
2073
  # @scope class
2076
2074
  attach_function :get_cursor_lexical_parent, :clang_getCursorLexicalParent, [Cursor.by_value], Cursor.by_value
2077
-
2075
+
2078
2076
  # Determine the set of methods that are overridden by the given
2079
2077
  # method.
2080
2078
  #
@@ -2117,7 +2115,7 @@ module Clang
2117
2115
  # @return [nil]
2118
2116
  # @scope class
2119
2117
  attach_function :get_overridden_cursors, :clang_getOverriddenCursors, [Cursor.by_value, :pointer, :pointer], :void
2120
-
2118
+
2121
2119
  # Free the set of overridden cursors returned by \c
2122
2120
  # clang_getOverriddenCursors().
2123
2121
  #
@@ -2126,7 +2124,7 @@ module Clang
2126
2124
  # @return [nil]
2127
2125
  # @scope class
2128
2126
  attach_function :dispose_overridden_cursors, :clang_disposeOverriddenCursors, [:pointer], :void
2129
-
2127
+
2130
2128
  # Retrieve the file that is included by the given inclusion directive
2131
2129
  # cursor.
2132
2130
  #
@@ -2135,7 +2133,7 @@ module Clang
2135
2133
  # @return [FFI::Pointer(File)]
2136
2134
  # @scope class
2137
2135
  attach_function :get_included_file, :clang_getIncludedFile, [Cursor.by_value], :pointer
2138
-
2136
+
2139
2137
  # Map a source location to the cursor that describes the entity at that
2140
2138
  # location in the source code.
2141
2139
  #
@@ -2154,7 +2152,7 @@ module Clang
2154
2152
  # a NULL cursor if no such entity can be found.
2155
2153
  # @scope class
2156
2154
  attach_function :get_cursor, :clang_getCursor, [:pointer, SourceLocation.by_value], Cursor.by_value
2157
-
2155
+
2158
2156
  # Retrieve the physical location of the source constructor referenced
2159
2157
  # by the given cursor.
2160
2158
  #
@@ -2169,7 +2167,7 @@ module Clang
2169
2167
  # @return [SourceLocation]
2170
2168
  # @scope class
2171
2169
  attach_function :get_cursor_location, :clang_getCursorLocation, [Cursor.by_value], SourceLocation.by_value
2172
-
2170
+
2173
2171
  # Retrieve the physical extent of the source construct referenced by
2174
2172
  # the given cursor.
2175
2173
  #
@@ -2185,9 +2183,11 @@ module Clang
2185
2183
  # @return [SourceRange]
2186
2184
  # @scope class
2187
2185
  attach_function :get_cursor_extent, :clang_getCursorExtent, [Cursor.by_value], SourceRange.by_value
2188
-
2186
+
2189
2187
  # Describes the kind of type
2190
2188
  #
2189
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:type_kind).</em>
2190
+ #
2191
2191
  # === Options:
2192
2192
  # :invalid ::
2193
2193
  # Reprents an invalid type (e.g., where no type is available).
@@ -2276,11 +2276,10 @@ module Clang
2276
2276
  #
2277
2277
  # :constant_array ::
2278
2278
  #
2279
- #
2280
- # @return [Array<Symbol>]
2281
- def self.type_kind_enum
2282
- [:invalid, :unexposed, :void, :bool, :char_u, :u_char, :char16, :char32, :u_short, :u_int, :u_long, :u_long_long, :u_int128, :char_s, :s_char, :w_char, :short, :int, :long, :long_long, :int128, :float, :double, :long_double, :null_ptr, :overload, :dependent, :obj_c_id, :obj_c_class, :obj_c_sel, :complex, :pointer, :block_pointer, :l_value_reference, :r_value_reference, :record, :enum, :typedef, :obj_c_interface, :obj_c_object_pointer, :function_no_proto, :function_proto, :constant_array]
2283
- end
2279
+ #
2280
+ # @method _enum_type_kind_
2281
+ # @return [Symbol]
2282
+ # @scope class
2284
2283
  enum :type_kind, [
2285
2284
  :invalid, 0,
2286
2285
  :unexposed, 1,
@@ -2326,20 +2325,19 @@ module Clang
2326
2325
  :function_proto, 111,
2327
2326
  :constant_array, 112
2328
2327
  ]
2329
-
2328
+
2330
2329
  # The type of an element in the abstract syntax tree.
2331
2330
  #
2332
2331
  # = Fields:
2333
2332
  # :kind ::
2334
- # (Symbol from type_kind_enum)
2333
+ # (Symbol from _enum_type_kind_)
2335
2334
  # :data ::
2336
2335
  # (Array<FFI::Pointer(*Void)>)
2337
- #
2338
2336
  class Type < FFI::Struct
2339
2337
  layout :kind, :type_kind,
2340
2338
  :data, [:pointer, 2]
2341
2339
  end
2342
-
2340
+
2343
2341
  # Retrieve the type of a CXCursor (if any).
2344
2342
  #
2345
2343
  # @method get_cursor_type(c)
@@ -2347,7 +2345,7 @@ module Clang
2347
2345
  # @return [Type]
2348
2346
  # @scope class
2349
2347
  attach_function :get_cursor_type, :clang_getCursorType, [Cursor.by_value], Type.by_value
2350
-
2348
+
2351
2349
  # Determine whether two CXTypes represent the same type.
2352
2350
  #
2353
2351
  # @method equal_types(a, b)
@@ -2357,7 +2355,7 @@ module Clang
2357
2355
  # zero otherwise.
2358
2356
  # @scope class
2359
2357
  attach_function :equal_types, :clang_equalTypes, [Type.by_value, Type.by_value], :uint
2360
-
2358
+
2361
2359
  # Return the canonical type for a CXType.
2362
2360
  #
2363
2361
  # Clang's type system explicitly models typedefs and all the ways
@@ -2370,7 +2368,7 @@ module Clang
2370
2368
  # @return [Type]
2371
2369
  # @scope class
2372
2370
  attach_function :get_canonical_type, :clang_getCanonicalType, [Type.by_value], Type.by_value
2373
-
2371
+
2374
2372
  # Determine whether a CXType has the "const" qualifier set,
2375
2373
  # without looking through typedefs that may have added "const" at a different level.
2376
2374
  #
@@ -2379,7 +2377,7 @@ module Clang
2379
2377
  # @return [Integer]
2380
2378
  # @scope class
2381
2379
  attach_function :is_const_qualified_type, :clang_isConstQualifiedType, [Type.by_value], :uint
2382
-
2380
+
2383
2381
  # Determine whether a CXType has the "volatile" qualifier set,
2384
2382
  # without looking through typedefs that may have added "volatile" at a different level.
2385
2383
  #
@@ -2388,7 +2386,7 @@ module Clang
2388
2386
  # @return [Integer]
2389
2387
  # @scope class
2390
2388
  attach_function :is_volatile_qualified_type, :clang_isVolatileQualifiedType, [Type.by_value], :uint
2391
-
2389
+
2392
2390
  # Determine whether a CXType has the "restrict" qualifier set,
2393
2391
  # without looking through typedefs that may have added "restrict" at a different level.
2394
2392
  #
@@ -2397,7 +2395,7 @@ module Clang
2397
2395
  # @return [Integer]
2398
2396
  # @scope class
2399
2397
  attach_function :is_restrict_qualified_type, :clang_isRestrictQualifiedType, [Type.by_value], :uint
2400
-
2398
+
2401
2399
  # For pointer types, returns the type of the pointee.
2402
2400
  #
2403
2401
  # @method get_pointee_type(t)
@@ -2405,7 +2403,7 @@ module Clang
2405
2403
  # @return [Type]
2406
2404
  # @scope class
2407
2405
  attach_function :get_pointee_type, :clang_getPointeeType, [Type.by_value], Type.by_value
2408
-
2406
+
2409
2407
  # Return the cursor for the declaration of the given type.
2410
2408
  #
2411
2409
  # @method get_type_declaration(t)
@@ -2413,7 +2411,7 @@ module Clang
2413
2411
  # @return [Cursor]
2414
2412
  # @scope class
2415
2413
  attach_function :get_type_declaration, :clang_getTypeDeclaration, [Type.by_value], Cursor.by_value
2416
-
2414
+
2417
2415
  # Returns the Objective-C type encoding for the specified declaration.
2418
2416
  #
2419
2417
  # @method get_decl_obj_c_type_encoding(c)
@@ -2421,15 +2419,15 @@ module Clang
2421
2419
  # @return [String]
2422
2420
  # @scope class
2423
2421
  attach_function :get_decl_obj_c_type_encoding, :clang_getDeclObjCTypeEncoding, [Cursor.by_value], String.by_value
2424
-
2422
+
2425
2423
  # Retrieve the spelling of a given CXTypeKind.
2426
2424
  #
2427
2425
  # @method get_type_kind_spelling(k)
2428
- # @param [Symbol from type_kind_enum] k
2426
+ # @param [Symbol from _enum_type_kind_] k
2429
2427
  # @return [String]
2430
2428
  # @scope class
2431
2429
  attach_function :get_type_kind_spelling, :clang_getTypeKindSpelling, [:type_kind], String.by_value
2432
-
2430
+
2433
2431
  # Retrieve the result type associated with a function type.
2434
2432
  #
2435
2433
  # @method get_result_type(t)
@@ -2437,7 +2435,7 @@ module Clang
2437
2435
  # @return [Type]
2438
2436
  # @scope class
2439
2437
  attach_function :get_result_type, :clang_getResultType, [Type.by_value], Type.by_value
2440
-
2438
+
2441
2439
  # Retrieve the result type associated with a given cursor. This only
2442
2440
  # returns a valid type of the cursor refers to a function or method.
2443
2441
  #
@@ -2446,7 +2444,7 @@ module Clang
2446
2444
  # @return [Type]
2447
2445
  # @scope class
2448
2446
  attach_function :get_cursor_result_type, :clang_getCursorResultType, [Cursor.by_value], Type.by_value
2449
-
2447
+
2450
2448
  # Return 1 if the CXType is a POD (plain old data) type, and 0
2451
2449
  # otherwise.
2452
2450
  #
@@ -2455,7 +2453,7 @@ module Clang
2455
2453
  # @return [Integer]
2456
2454
  # @scope class
2457
2455
  attach_function :is_pod_type, :clang_isPODType, [Type.by_value], :uint
2458
-
2456
+
2459
2457
  # Return the element type of an array type.
2460
2458
  #
2461
2459
  # If a non-array type is passed in, an invalid type is returned.
@@ -2465,7 +2463,7 @@ module Clang
2465
2463
  # @return [Type]
2466
2464
  # @scope class
2467
2465
  attach_function :get_array_element_type, :clang_getArrayElementType, [Type.by_value], Type.by_value
2468
-
2466
+
2469
2467
  # Return the the array size of a constant array.
2470
2468
  #
2471
2469
  # If a non-array type is passed in, -1 is returned.
@@ -2475,7 +2473,7 @@ module Clang
2475
2473
  # @return [Integer]
2476
2474
  # @scope class
2477
2475
  attach_function :get_array_size, :clang_getArraySize, [Type.by_value], :long_long
2478
-
2476
+
2479
2477
  # Returns 1 if the base class specified by the cursor with kind
2480
2478
  # CX_CXXBaseSpecifier is virtual.
2481
2479
  #
@@ -2484,10 +2482,12 @@ module Clang
2484
2482
  # @return [Integer]
2485
2483
  # @scope class
2486
2484
  attach_function :is_virtual_base, :clang_isVirtualBase, [Cursor.by_value], :uint
2487
-
2485
+
2488
2486
  # Represents the C++ access control level to a base class for a
2489
2487
  # cursor with kind CX_CXXBaseSpecifier.
2490
2488
  #
2489
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:cxx_access_specifier).</em>
2490
+ #
2491
2491
  # === Options:
2492
2492
  # :x_invalid_access_specifier ::
2493
2493
  #
@@ -2497,28 +2497,27 @@ module Clang
2497
2497
  #
2498
2498
  # :x_private ::
2499
2499
  #
2500
- #
2501
- # @return [Array<Symbol>]
2502
- def self.cxx_access_specifier_enum
2503
- [:x_invalid_access_specifier, :x_public, :x_protected, :x_private]
2504
- end
2500
+ #
2501
+ # @method _enum_cxx_access_specifier_
2502
+ # @return [Symbol]
2503
+ # @scope class
2505
2504
  enum :cxx_access_specifier, [
2506
2505
  :x_invalid_access_specifier,
2507
2506
  :x_public,
2508
2507
  :x_protected,
2509
2508
  :x_private
2510
2509
  ]
2511
-
2510
+
2512
2511
  # Returns the access control level for the C++ base specifier
2513
2512
  # represented by a cursor with kind CXCursor_CXXBaseSpecifier or
2514
2513
  # CXCursor_AccessSpecifier.
2515
2514
  #
2516
2515
  # @method get_cxx_access_specifier(cursor)
2517
2516
  # @param [Cursor] cursor
2518
- # @return [Symbol from cxx_access_specifier_enum]
2517
+ # @return [Symbol from _enum_cxx_access_specifier_]
2519
2518
  # @scope class
2520
2519
  attach_function :get_cxx_access_specifier, :clang_getCXXAccessSpecifier, [Cursor.by_value], :cxx_access_specifier
2521
-
2520
+
2522
2521
  # Determine the number of overloaded declarations referenced by a
2523
2522
  # \c CXCursor_OverloadedDeclRef cursor.
2524
2523
  #
@@ -2528,7 +2527,7 @@ module Clang
2528
2527
  # is not a \c CXCursor_OverloadedDeclRef cursor, returns 0.
2529
2528
  # @scope class
2530
2529
  attach_function :get_num_overloaded_decls, :clang_getNumOverloadedDecls, [Cursor.by_value], :uint
2531
-
2530
+
2532
2531
  # Retrieve a cursor for one of the overloaded declarations referenced
2533
2532
  # by a \c CXCursor_OverloadedDeclRef cursor.
2534
2533
  #
@@ -2542,7 +2541,7 @@ module Clang
2542
2541
  # returns \c clang_getNullCursor();
2543
2542
  # @scope class
2544
2543
  attach_function :get_overloaded_decl, :clang_getOverloadedDecl, [Cursor.by_value, :uint], Cursor.by_value
2545
-
2544
+
2546
2545
  # For cursors representing an iboutletcollection attribute,
2547
2546
  # this function returns the collection element type.
2548
2547
  #
@@ -2551,13 +2550,15 @@ module Clang
2551
2550
  # @return [Type]
2552
2551
  # @scope class
2553
2552
  attach_function :get_ib_outlet_collection_type, :clang_getIBOutletCollectionType, [Cursor.by_value], Type.by_value
2554
-
2553
+
2555
2554
  # Describes how the traversal of the children of a particular
2556
2555
  # cursor should proceed after visiting a particular child cursor.
2557
2556
  #
2558
2557
  # A value of this enumeration type should be returned by each
2559
2558
  # \c CXCursorVisitor to indicate how clang_visitChildren() proceed.
2560
2559
  #
2560
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:child_visit_result).</em>
2561
+ #
2561
2562
  # === Options:
2562
2563
  # :break ::
2563
2564
  # Terminates the cursor traversal.
@@ -2567,19 +2568,16 @@ module Clang
2567
2568
  # :recurse ::
2568
2569
  # Recursively traverse the children of this cursor, using
2569
2570
  # the same visitor and client data.
2570
- #
2571
- # @return [Array<Symbol>]
2572
- def self.child_visit_result_enum
2573
- [:break, :continue, :recurse]
2574
- end
2571
+ #
2572
+ # @method _enum_child_visit_result_
2573
+ # @return [Symbol]
2574
+ # @scope class
2575
2575
  enum :child_visit_result, [
2576
2576
  :break,
2577
2577
  :continue,
2578
2578
  :recurse
2579
2579
  ]
2580
-
2581
- # <em>This is no real method. This entry is only for documentation of the callback.</em>
2582
- #
2580
+
2583
2581
  # Visitor invoked for each cursor found by a traversal.
2584
2582
  #
2585
2583
  # This visitor function will be invoked for each cursor found by
@@ -2591,14 +2589,16 @@ module Clang
2591
2589
  # The visitor should return one of the \c CXChildVisitResult values
2592
2590
  # to direct clang_visitCursorChildren().
2593
2591
  #
2594
- # @method cursor_visitor_callback(cursor, parent, client_data)
2592
+ # <em>This entry is only for documentation and no real method.</em>
2593
+ #
2594
+ # @method _callback_cursor_visitor_(cursor, parent, client_data)
2595
2595
  # @param [Cursor] cursor
2596
2596
  # @param [Cursor] parent
2597
2597
  # @param [FFI::Pointer(ClientData)] client_data
2598
- # @return [Symbol from child_visit_result_enum]
2598
+ # @return [Symbol from _enum_child_visit_result_]
2599
2599
  # @scope class
2600
2600
  callback :cursor_visitor, [Cursor.by_value, Cursor.by_value, :pointer], :child_visit_result
2601
-
2601
+
2602
2602
  # Visit the children of a particular cursor.
2603
2603
  #
2604
2604
  # This function visits all the direct children of the given cursor,
@@ -2611,7 +2611,7 @@ module Clang
2611
2611
  # @param [Cursor] parent the cursor whose child may be visited. All kinds of
2612
2612
  # cursors can be visited, including invalid cursors (which, by
2613
2613
  # definition, have no children).
2614
- # @param [Proc(cursor_visitor_callback)] visitor the visitor function that will be invoked for each
2614
+ # @param [Proc(_callback_cursor_visitor_)] visitor the visitor function that will be invoked for each
2615
2615
  # child of \p parent.
2616
2616
  # @param [FFI::Pointer(ClientData)] client_data pointer data supplied by the client, which will
2617
2617
  # be passed to the visitor each time it is invoked.
@@ -2619,7 +2619,7 @@ module Clang
2619
2619
  # prematurely by the visitor returning \c CXChildVisit_Break.
2620
2620
  # @scope class
2621
2621
  attach_function :visit_children, :clang_visitChildren, [Cursor.by_value, :cursor_visitor, :pointer], :uint
2622
-
2622
+
2623
2623
  # Retrieve a Unified Symbol Resolution (USR) for the entity referenced
2624
2624
  # by the given cursor.
2625
2625
  #
@@ -2633,7 +2633,7 @@ module Clang
2633
2633
  # @return [String]
2634
2634
  # @scope class
2635
2635
  attach_function :get_cursor_usr, :clang_getCursorUSR, [Cursor.by_value], String.by_value
2636
-
2636
+
2637
2637
  # Construct a USR for a specified Objective-C class.
2638
2638
  #
2639
2639
  # @method construct_usr_obj_c_class(class_name)
@@ -2641,7 +2641,7 @@ module Clang
2641
2641
  # @return [String]
2642
2642
  # @scope class
2643
2643
  attach_function :construct_usr_obj_c_class, :clang_constructUSR_ObjCClass, [:string], String.by_value
2644
-
2644
+
2645
2645
  # Construct a USR for a specified Objective-C category.
2646
2646
  #
2647
2647
  # @method construct_usr_obj_c_category(class_name, category_name)
@@ -2650,7 +2650,7 @@ module Clang
2650
2650
  # @return [String]
2651
2651
  # @scope class
2652
2652
  attach_function :construct_usr_obj_c_category, :clang_constructUSR_ObjCCategory, [:string, :string], String.by_value
2653
-
2653
+
2654
2654
  # Construct a USR for a specified Objective-C protocol.
2655
2655
  #
2656
2656
  # @method construct_usr_obj_c_protocol(protocol_name)
@@ -2658,7 +2658,7 @@ module Clang
2658
2658
  # @return [String]
2659
2659
  # @scope class
2660
2660
  attach_function :construct_usr_obj_c_protocol, :clang_constructUSR_ObjCProtocol, [:string], String.by_value
2661
-
2661
+
2662
2662
  # Construct a USR for a specified Objective-C instance variable and
2663
2663
  # the USR for its containing class.
2664
2664
  #
@@ -2668,7 +2668,7 @@ module Clang
2668
2668
  # @return [String]
2669
2669
  # @scope class
2670
2670
  attach_function :construct_usr_obj_c_ivar, :clang_constructUSR_ObjCIvar, [:string, String.by_value], String.by_value
2671
-
2671
+
2672
2672
  # Construct a USR for a specified Objective-C method and
2673
2673
  # the USR for its containing class.
2674
2674
  #
@@ -2679,7 +2679,7 @@ module Clang
2679
2679
  # @return [String]
2680
2680
  # @scope class
2681
2681
  attach_function :construct_usr_obj_c_method, :clang_constructUSR_ObjCMethod, [:string, :uint, String.by_value], String.by_value
2682
-
2682
+
2683
2683
  # Construct a USR for a specified Objective-C property and the USR
2684
2684
  # for its containing class.
2685
2685
  #
@@ -2689,7 +2689,7 @@ module Clang
2689
2689
  # @return [String]
2690
2690
  # @scope class
2691
2691
  attach_function :construct_usr_obj_c_property, :clang_constructUSR_ObjCProperty, [:string, String.by_value], String.by_value
2692
-
2692
+
2693
2693
  # Retrieve a name for the entity referenced by this cursor.
2694
2694
  #
2695
2695
  # @method get_cursor_spelling(cursor)
@@ -2697,7 +2697,7 @@ module Clang
2697
2697
  # @return [String]
2698
2698
  # @scope class
2699
2699
  attach_function :get_cursor_spelling, :clang_getCursorSpelling, [Cursor.by_value], String.by_value
2700
-
2700
+
2701
2701
  # Retrieve the display name for the entity referenced by this cursor.
2702
2702
  #
2703
2703
  # The display name contains extra information that helps identify the cursor,
@@ -2709,7 +2709,7 @@ module Clang
2709
2709
  # @return [String]
2710
2710
  # @scope class
2711
2711
  attach_function :get_cursor_display_name, :clang_getCursorDisplayName, [Cursor.by_value], String.by_value
2712
-
2712
+
2713
2713
  # For a cursor that is a reference, retrieve a cursor representing the
2714
2714
  # entity that it references.
2715
2715
  #
@@ -2725,7 +2725,7 @@ module Clang
2725
2725
  # @return [Cursor]
2726
2726
  # @scope class
2727
2727
  attach_function :get_cursor_referenced, :clang_getCursorReferenced, [Cursor.by_value], Cursor.by_value
2728
-
2728
+
2729
2729
  # For a cursor that is either a reference to or a declaration
2730
2730
  # of some entity, retrieve a cursor that describes the definition of
2731
2731
  # that entity.
@@ -2758,7 +2758,7 @@ module Clang
2758
2758
  # @return [Cursor]
2759
2759
  # @scope class
2760
2760
  attach_function :get_cursor_definition, :clang_getCursorDefinition, [Cursor.by_value], Cursor.by_value
2761
-
2761
+
2762
2762
  # Determine whether the declaration pointed to by this cursor
2763
2763
  # is also a definition of that entity.
2764
2764
  #
@@ -2767,7 +2767,7 @@ module Clang
2767
2767
  # @return [Integer]
2768
2768
  # @scope class
2769
2769
  attach_function :is_cursor_definition, :clang_isCursorDefinition, [Cursor.by_value], :uint
2770
-
2770
+
2771
2771
  # Retrieve the canonical cursor corresponding to the given cursor.
2772
2772
  #
2773
2773
  # In the C family of languages, many kinds of entities can be declared several
@@ -2794,7 +2794,7 @@ module Clang
2794
2794
  # @return [Cursor] The canonical cursor for the entity referred to by the given cursor.
2795
2795
  # @scope class
2796
2796
  attach_function :get_canonical_cursor, :clang_getCanonicalCursor, [Cursor.by_value], Cursor.by_value
2797
-
2797
+
2798
2798
  # Determine if a C++ member function or member function template is
2799
2799
  # declared 'static'.
2800
2800
  #
@@ -2803,7 +2803,7 @@ module Clang
2803
2803
  # @return [Integer]
2804
2804
  # @scope class
2805
2805
  attach_function :cxx_method_is_static, :clang_CXXMethod_isStatic, [Cursor.by_value], :uint
2806
-
2806
+
2807
2807
  # Determine if a C++ member function or member function template is
2808
2808
  # explicitly declared 'virtual' or if it overrides a virtual method from
2809
2809
  # one of the base classes.
@@ -2813,7 +2813,7 @@ module Clang
2813
2813
  # @return [Integer]
2814
2814
  # @scope class
2815
2815
  attach_function :cxx_method_is_virtual, :clang_CXXMethod_isVirtual, [Cursor.by_value], :uint
2816
-
2816
+
2817
2817
  # Given a cursor that represents a template, determine
2818
2818
  # the cursor kind of the specializations would be generated by instantiating
2819
2819
  # the template.
@@ -2826,12 +2826,12 @@ module Clang
2826
2826
  # @method get_template_cursor_kind(c)
2827
2827
  # @param [Cursor] c The cursor to query. This cursor should represent a template
2828
2828
  # declaration.
2829
- # @return [Symbol from cursor_kind_enum] The cursor kind of the specializations that would be generated
2829
+ # @return [Symbol from _enum_cursor_kind_] The cursor kind of the specializations that would be generated
2830
2830
  # by instantiating the template \p C. If \p C is not a template, returns
2831
2831
  # \c CXCursor_NoDeclFound.
2832
2832
  # @scope class
2833
2833
  attach_function :get_template_cursor_kind, :clang_getTemplateCursorKind, [Cursor.by_value], :cursor_kind
2834
-
2834
+
2835
2835
  # Given a cursor that may represent a specialization or instantiation
2836
2836
  # of a template, retrieve the cursor that represents the template that it
2837
2837
  # specializes or from which it was instantiated.
@@ -2860,7 +2860,7 @@ module Clang
2860
2860
  # from which it was instantiated. Otherwise, returns a NULL cursor.
2861
2861
  # @scope class
2862
2862
  attach_function :get_specialized_cursor_template, :clang_getSpecializedCursorTemplate, [Cursor.by_value], Cursor.by_value
2863
-
2863
+
2864
2864
  # Given a cursor that references something else, return the source range
2865
2865
  # covering that reference.
2866
2866
  #
@@ -2879,9 +2879,11 @@ module Clang
2879
2879
  # name, or if the PieceIndex is out-of-range, a null-cursor will be returned.
2880
2880
  # @scope class
2881
2881
  attach_function :get_cursor_reference_name_range, :clang_getCursorReferenceNameRange, [Cursor.by_value, :uint, :uint], SourceRange.by_value
2882
-
2882
+
2883
2883
  # (Not documented)
2884
2884
  #
2885
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:name_ref_flags).</em>
2886
+ #
2885
2887
  # === Options:
2886
2888
  # :want_qualifier ::
2887
2889
  # Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the
@@ -2898,19 +2900,20 @@ module Clang
2898
2900
  # (object doSomething:here withValue:there); // ObjC
2899
2901
  # return some_vector(1); // C++
2900
2902
  # \endcode
2901
- #
2902
- # @return [Array<Symbol>]
2903
- def self.name_ref_flags_enum
2904
- [:want_qualifier, :want_template_args, :want_single_piece]
2905
- end
2903
+ #
2904
+ # @method _enum_name_ref_flags_
2905
+ # @return [Symbol]
2906
+ # @scope class
2906
2907
  enum :name_ref_flags, [
2907
2908
  :want_qualifier, 0x1,
2908
2909
  :want_template_args, 0x2,
2909
2910
  :want_single_piece, 0x4
2910
2911
  ]
2911
-
2912
+
2912
2913
  # Describes a kind of token.
2913
2914
  #
2915
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:token_kind).</em>
2916
+ #
2914
2917
  # === Options:
2915
2918
  # :punctuation ::
2916
2919
  # A token that contains some kind of punctuation.
@@ -2922,11 +2925,10 @@ module Clang
2922
2925
  # A numeric, string, or character literal.
2923
2926
  # :comment ::
2924
2927
  # A comment.
2925
- #
2926
- # @return [Array<Symbol>]
2927
- def self.token_kind_enum
2928
- [:punctuation, :keyword, :identifier, :literal, :comment]
2929
- end
2928
+ #
2929
+ # @method _enum_token_kind_
2930
+ # @return [Symbol]
2931
+ # @scope class
2930
2932
  enum :token_kind, [
2931
2933
  :punctuation,
2932
2934
  :keyword,
@@ -2934,7 +2936,7 @@ module Clang
2934
2936
  :literal,
2935
2937
  :comment
2936
2938
  ]
2937
-
2939
+
2938
2940
  # Describes a single preprocessing token.
2939
2941
  #
2940
2942
  # = Fields:
@@ -2942,20 +2944,19 @@ module Clang
2942
2944
  # (Array<Integer>)
2943
2945
  # :ptr_data ::
2944
2946
  # (FFI::Pointer(*Void))
2945
- #
2946
2947
  class Token < FFI::Struct
2947
2948
  layout :int_data, [:uint, 4],
2948
2949
  :ptr_data, :pointer
2949
2950
  end
2950
-
2951
+
2951
2952
  # Determine the kind of the given token.
2952
2953
  #
2953
2954
  # @method get_token_kind(token)
2954
2955
  # @param [Token] token
2955
- # @return [Symbol from token_kind_enum]
2956
+ # @return [Symbol from _enum_token_kind_]
2956
2957
  # @scope class
2957
2958
  attach_function :get_token_kind, :clang_getTokenKind, [Token.by_value], :token_kind
2958
-
2959
+
2959
2960
  # Determine the spelling of the given token.
2960
2961
  #
2961
2962
  # The spelling of a token is the textual representation of that token, e.g.,
@@ -2967,7 +2968,7 @@ module Clang
2967
2968
  # @return [String]
2968
2969
  # @scope class
2969
2970
  attach_function :get_token_spelling, :clang_getTokenSpelling, [:pointer, Token.by_value], String.by_value
2970
-
2971
+
2971
2972
  # Retrieve the source location of the given token.
2972
2973
  #
2973
2974
  # @method get_token_location(translation_unit, token)
@@ -2976,7 +2977,7 @@ module Clang
2976
2977
  # @return [SourceLocation]
2977
2978
  # @scope class
2978
2979
  attach_function :get_token_location, :clang_getTokenLocation, [:pointer, Token.by_value], SourceLocation.by_value
2979
-
2980
+
2980
2981
  # Retrieve a source range that covers the given token.
2981
2982
  #
2982
2983
  # @method get_token_extent(translation_unit, token)
@@ -2985,7 +2986,7 @@ module Clang
2985
2986
  # @return [SourceRange]
2986
2987
  # @scope class
2987
2988
  attach_function :get_token_extent, :clang_getTokenExtent, [:pointer, Token.by_value], SourceRange.by_value
2988
-
2989
+
2989
2990
  # Tokenize the source code described by the given range into raw
2990
2991
  # lexical tokens.
2991
2992
  #
@@ -3001,7 +3002,7 @@ module Clang
3001
3002
  # @return [nil]
3002
3003
  # @scope class
3003
3004
  attach_function :tokenize, :clang_tokenize, [:pointer, SourceRange.by_value, :pointer, :pointer], :void
3004
-
3005
+
3005
3006
  # Annotate the given set of tokens by providing cursors for each token
3006
3007
  # that can be mapped to a specific entity within the abstract syntax tree.
3007
3008
  #
@@ -3031,7 +3032,7 @@ module Clang
3031
3032
  # @return [nil]
3032
3033
  # @scope class
3033
3034
  attach_function :annotate_tokens, :clang_annotateTokens, [:pointer, :pointer, :uint, :pointer], :void
3034
-
3035
+
3035
3036
  # Free the given set of tokens.
3036
3037
  #
3037
3038
  # @method dispose_tokens(tu, tokens, num_tokens)
@@ -3041,15 +3042,15 @@ module Clang
3041
3042
  # @return [nil]
3042
3043
  # @scope class
3043
3044
  attach_function :dispose_tokens, :clang_disposeTokens, [:pointer, :pointer, :uint], :void
3044
-
3045
+
3045
3046
  # for debug/testing
3046
3047
  #
3047
3048
  # @method get_cursor_kind_spelling(kind)
3048
- # @param [Symbol from cursor_kind_enum] kind
3049
+ # @param [Symbol from _enum_cursor_kind_] kind
3049
3050
  # @return [String]
3050
3051
  # @scope class
3051
3052
  attach_function :get_cursor_kind_spelling, :clang_getCursorKindSpelling, [:cursor_kind], String.by_value
3052
-
3053
+
3053
3054
  # (Not documented)
3054
3055
  #
3055
3056
  # @method get_definition_spelling_and_extent(cursor, start_buf, end_buf, start_line, start_column, end_line, end_column)
@@ -3063,14 +3064,14 @@ module Clang
3063
3064
  # @return [nil]
3064
3065
  # @scope class
3065
3066
  attach_function :get_definition_spelling_and_extent, :clang_getDefinitionSpellingAndExtent, [Cursor.by_value, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :void
3066
-
3067
+
3067
3068
  # (Not documented)
3068
3069
  #
3069
3070
  # @method enable_stack_traces()
3070
3071
  # @return [nil]
3071
3072
  # @scope class
3072
3073
  attach_function :enable_stack_traces, :clang_enableStackTraces, [], :void
3073
-
3074
+
3074
3075
  # (Not documented)
3075
3076
  #
3076
3077
  # @method execute_on_thread(fn, user_data, stack_size)
@@ -3080,12 +3081,12 @@ module Clang
3080
3081
  # @return [nil]
3081
3082
  # @scope class
3082
3083
  attach_function :execute_on_thread, :clang_executeOnThread, [:pointer, :pointer, :uint], :void
3083
-
3084
+
3084
3085
  # A single result of code completion.
3085
3086
  #
3086
3087
  # = Fields:
3087
3088
  # :cursor_kind ::
3088
- # (Symbol from cursor_kind_enum) The kind of entity that this completion refers to.
3089
+ # (Symbol from _enum_cursor_kind_) The kind of entity that this completion refers to.
3089
3090
  #
3090
3091
  # The cursor kind will be a macro, keyword, or a declaration (one of the
3091
3092
  # *Decl cursor kinds), describing the entity that the completion is
@@ -3096,18 +3097,19 @@ module Clang
3096
3097
  # :completion_string ::
3097
3098
  # (FFI::Pointer(CompletionString)) The code-completion string that describes how to insert this
3098
3099
  # code-completion result into the editing buffer.
3099
- #
3100
3100
  class CompletionResult < FFI::Struct
3101
3101
  layout :cursor_kind, :cursor_kind,
3102
3102
  :completion_string, :pointer
3103
3103
  end
3104
-
3104
+
3105
3105
  # Describes a single piece of text within a code-completion string.
3106
3106
  #
3107
3107
  # Each "chunk" within a code-completion string (\c CXCompletionString) is
3108
3108
  # either a piece of text with a specific "kind" that describes how that text
3109
3109
  # should be interpreted by the client or is another completion string.
3110
3110
  #
3111
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:completion_chunk_kind).</em>
3112
+ #
3111
3113
  # === Options:
3112
3114
  # :optional ::
3113
3115
  # A code-completion string that describes "optional" text that
@@ -3228,11 +3230,10 @@ module Clang
3228
3230
  # :vertical_space ::
3229
3231
  # Vertical space ('\n'), after which it is generally a good idea to
3230
3232
  # perform indentation.
3231
- #
3232
- # @return [Array<Symbol>]
3233
- def self.completion_chunk_kind_enum
3234
- [:optional, :typed_text, :text, :placeholder, :informative, :current_parameter, :left_paren, :right_paren, :left_bracket, :right_bracket, :left_brace, :right_brace, :left_angle, :right_angle, :comma, :result_type, :colon, :semi_colon, :equal, :horizontal_space, :vertical_space]
3235
- end
3233
+ #
3234
+ # @method _enum_completion_chunk_kind_
3235
+ # @return [Symbol]
3236
+ # @scope class
3236
3237
  enum :completion_chunk_kind, [
3237
3238
  :optional,
3238
3239
  :typed_text,
@@ -3256,16 +3257,16 @@ module Clang
3256
3257
  :horizontal_space,
3257
3258
  :vertical_space
3258
3259
  ]
3259
-
3260
+
3260
3261
  # Determine the kind of a particular chunk within a completion string.
3261
3262
  #
3262
3263
  # @method get_completion_chunk_kind(completion_string, chunk_number)
3263
3264
  # @param [FFI::Pointer(CompletionString)] completion_string the completion string to query.
3264
3265
  # @param [Integer] chunk_number the 0-based index of the chunk in the completion string.
3265
- # @return [Symbol from completion_chunk_kind_enum] the kind of the chunk at the index \c chunk_number.
3266
+ # @return [Symbol from _enum_completion_chunk_kind_] the kind of the chunk at the index \c chunk_number.
3266
3267
  # @scope class
3267
3268
  attach_function :get_completion_chunk_kind, :clang_getCompletionChunkKind, [:pointer, :uint], :completion_chunk_kind
3268
-
3269
+
3269
3270
  # Retrieve the text associated with a particular chunk within a
3270
3271
  # completion string.
3271
3272
  #
@@ -3275,7 +3276,7 @@ module Clang
3275
3276
  # @return [String] the text associated with the chunk at index \c chunk_number.
3276
3277
  # @scope class
3277
3278
  attach_function :get_completion_chunk_text, :clang_getCompletionChunkText, [:pointer, :uint], String.by_value
3278
-
3279
+
3279
3280
  # Retrieve the completion string associated with a particular chunk
3280
3281
  # within a completion string.
3281
3282
  #
@@ -3286,7 +3287,7 @@ module Clang
3286
3287
  # \c chunk_number.
3287
3288
  # @scope class
3288
3289
  attach_function :get_completion_chunk_completion_string, :clang_getCompletionChunkCompletionString, [:pointer, :uint], :pointer
3289
-
3290
+
3290
3291
  # Retrieve the number of chunks in the given code-completion string.
3291
3292
  #
3292
3293
  # @method get_num_completion_chunks(completion_string)
@@ -3294,7 +3295,7 @@ module Clang
3294
3295
  # @return [Integer]
3295
3296
  # @scope class
3296
3297
  attach_function :get_num_completion_chunks, :clang_getNumCompletionChunks, [:pointer], :uint
3297
-
3298
+
3298
3299
  # Determine the priority of this code completion.
3299
3300
  #
3300
3301
  # The priority of a code completion indicates how likely it is that this
@@ -3307,16 +3308,16 @@ module Clang
3307
3308
  # higher-priority (more likely) completions.
3308
3309
  # @scope class
3309
3310
  attach_function :get_completion_priority, :clang_getCompletionPriority, [:pointer], :uint
3310
-
3311
+
3311
3312
  # Determine the availability of the entity that this code-completion
3312
3313
  # string refers to.
3313
3314
  #
3314
3315
  # @method get_completion_availability(completion_string)
3315
3316
  # @param [FFI::Pointer(CompletionString)] completion_string The completion string to query.
3316
- # @return [Symbol from availability_kind_enum] The availability of the completion string.
3317
+ # @return [Symbol from _enum_availability_kind_] The availability of the completion string.
3317
3318
  # @scope class
3318
3319
  attach_function :get_completion_availability, :clang_getCompletionAvailability, [:pointer], :availability_kind
3319
-
3320
+
3320
3321
  # Retrieve the number of annotations associated with the given
3321
3322
  # completion string.
3322
3323
  #
@@ -3326,7 +3327,7 @@ module Clang
3326
3327
  # string.
3327
3328
  # @scope class
3328
3329
  attach_function :get_completion_num_annotations, :clang_getCompletionNumAnnotations, [:pointer], :uint
3329
-
3330
+
3330
3331
  # Retrieve the annotation associated with the given completion string.
3331
3332
  #
3332
3333
  # @method get_completion_annotation(completion_string, annotation_number)
@@ -3337,7 +3338,7 @@ module Clang
3337
3338
  # \c annotation_number, or a NULL string if that annotation is not available.
3338
3339
  # @scope class
3339
3340
  attach_function :get_completion_annotation, :clang_getCompletionAnnotation, [:pointer, :uint], String.by_value
3340
-
3341
+
3341
3342
  # Retrieve a completion string for an arbitrary declaration or macro
3342
3343
  # definition cursor.
3343
3344
  #
@@ -3347,7 +3348,7 @@ module Clang
3347
3348
  # definition cursors, or NULL for other kinds of cursors.
3348
3349
  # @scope class
3349
3350
  attach_function :get_cursor_completion_string, :clang_getCursorCompletionString, [Cursor.by_value], :pointer
3350
-
3351
+
3351
3352
  # Contains the results of code-completion.
3352
3353
  #
3353
3354
  # This data structure contains the results of code completion, as
@@ -3360,18 +3361,19 @@ module Clang
3360
3361
  # :num_results ::
3361
3362
  # (Integer) The number of code-completion results stored in the
3362
3363
  # \c Results array.
3363
- #
3364
3364
  class CodeCompleteResults < FFI::Struct
3365
3365
  layout :results, :pointer,
3366
3366
  :num_results, :uint
3367
3367
  end
3368
-
3368
+
3369
3369
  # Flags that can be passed to \c clang_codeCompleteAt() to
3370
3370
  # modify its behavior.
3371
3371
  #
3372
3372
  # The enumerators in this enumeration can be bitwise-OR'd together to
3373
3373
  # provide multiple options to \c clang_codeCompleteAt().
3374
3374
  #
3375
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:code_complete_flags).</em>
3376
+ #
3375
3377
  # === Options:
3376
3378
  # :include_macros ::
3377
3379
  # Whether to include macros within the set of code
@@ -3379,34 +3381,34 @@ module Clang
3379
3381
  # :include_code_patterns ::
3380
3382
  # Whether to include code patterns for language constructs
3381
3383
  # within the set of code completions, e.g., for loops.
3382
- #
3383
- # @return [Array<Symbol>]
3384
- def self.code_complete_flags_enum
3385
- [:include_macros, :include_code_patterns]
3386
- end
3384
+ #
3385
+ # @method _enum_code_complete_flags_
3386
+ # @return [Symbol]
3387
+ # @scope class
3387
3388
  enum :code_complete_flags, [
3388
3389
  :include_macros, 0x01,
3389
3390
  :include_code_patterns, 0x02
3390
3391
  ]
3391
-
3392
+
3392
3393
  # Bits that represent the context under which completion is occurring.
3393
3394
  #
3394
3395
  # The enumerators in this enumeration may be bitwise-OR'd together if multiple
3395
3396
  # contexts are occurring simultaneously.
3396
3397
  #
3398
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:completion_context).</em>
3399
+ #
3397
3400
  # === Options:
3398
3401
  # :completion_context_unexposed ::
3399
3402
  # The context for completions is unexposed, as only Clang results
3400
3403
  # should be included. (This is equivalent to having no context bits set.)
3401
- #
3402
- # @return [Array<Symbol>]
3403
- def self.completion_context_enum
3404
- [:completion_context_unexposed]
3405
- end
3404
+ #
3405
+ # @method _enum_completion_context_
3406
+ # @return [Symbol]
3407
+ # @scope class
3406
3408
  enum :completion_context, [
3407
3409
  :completion_context_unexposed, 0
3408
3410
  ]
3409
-
3411
+
3410
3412
  # Returns a default set of code-completion options that can be
3411
3413
  # passed to\c clang_codeCompleteAt().
3412
3414
  #
@@ -3414,7 +3416,7 @@ module Clang
3414
3416
  # @return [Integer]
3415
3417
  # @scope class
3416
3418
  attach_function :default_code_complete_options, :clang_defaultCodeCompleteOptions, [], :uint
3417
-
3419
+
3418
3420
  # Perform code completion at a given location in a translation unit.
3419
3421
  #
3420
3422
  # This function performs code completion at a particular file, line, and
@@ -3477,7 +3479,7 @@ module Clang
3477
3479
  # completion fails, returns NULL.
3478
3480
  # @scope class
3479
3481
  attach_function :code_complete_at, :clang_codeCompleteAt, [:pointer, :string, :uint, :uint, :pointer, :uint, :uint], :pointer
3480
-
3482
+
3481
3483
  # Sort the code-completion results in case-insensitive alphabetical
3482
3484
  # order.
3483
3485
  #
@@ -3487,7 +3489,7 @@ module Clang
3487
3489
  # @return [nil]
3488
3490
  # @scope class
3489
3491
  attach_function :sort_code_completion_results, :clang_sortCodeCompletionResults, [:pointer, :uint], :void
3490
-
3492
+
3491
3493
  # Free the given set of code-completion results.
3492
3494
  #
3493
3495
  # @method dispose_code_complete_results(results)
@@ -3495,7 +3497,7 @@ module Clang
3495
3497
  # @return [nil]
3496
3498
  # @scope class
3497
3499
  attach_function :dispose_code_complete_results, :clang_disposeCodeCompleteResults, [:pointer], :void
3498
-
3500
+
3499
3501
  # Determine the number of diagnostics produced prior to the
3500
3502
  # location where code completion was performed.
3501
3503
  #
@@ -3504,7 +3506,7 @@ module Clang
3504
3506
  # @return [Integer]
3505
3507
  # @scope class
3506
3508
  attach_function :code_complete_get_num_diagnostics, :clang_codeCompleteGetNumDiagnostics, [:pointer], :uint
3507
-
3509
+
3508
3510
  # Retrieve a diagnostic associated with the given code completion.
3509
3511
  #
3510
3512
  # Result:
@@ -3517,7 +3519,7 @@ module Clang
3517
3519
  # via a call to \c clang_disposeDiagnostic().
3518
3520
  # @scope class
3519
3521
  attach_function :code_complete_get_diagnostic, :clang_codeCompleteGetDiagnostic, [:pointer, :uint], :pointer
3520
-
3522
+
3521
3523
  # Determines what compeltions are appropriate for the context
3522
3524
  # the given code completion.
3523
3525
  #
@@ -3527,7 +3529,7 @@ module Clang
3527
3529
  # along with the given code completion results.
3528
3530
  # @scope class
3529
3531
  attach_function :code_complete_get_contexts, :clang_codeCompleteGetContexts, [:pointer], :ulong_long
3530
-
3532
+
3531
3533
  # Returns the cursor kind for the container for the current code
3532
3534
  # completion context. The container is only guaranteed to be set for
3533
3535
  # contexts where a container exists (i.e. member accesses or Objective-C
@@ -3539,11 +3541,11 @@ module Clang
3539
3541
  # @param [FFI::Pointer(*UInt)] is_incomplete on return, this value will be false if Clang has complete
3540
3542
  # information about the container. If Clang does not have complete
3541
3543
  # information, this value will be true.
3542
- # @return [Symbol from cursor_kind_enum] the container kind, or CXCursor_InvalidCode if there is not a
3544
+ # @return [Symbol from _enum_cursor_kind_] the container kind, or CXCursor_InvalidCode if there is not a
3543
3545
  # container
3544
3546
  # @scope class
3545
3547
  attach_function :code_complete_get_container_kind, :clang_codeCompleteGetContainerKind, [:pointer, :pointer], :cursor_kind
3546
-
3548
+
3547
3549
  # Returns the USR for the container for the current code completion
3548
3550
  # context. If there is not a container for the current context, this
3549
3551
  # function will return the empty string.
@@ -3553,7 +3555,7 @@ module Clang
3553
3555
  # @return [String] the USR for the container
3554
3556
  # @scope class
3555
3557
  attach_function :code_complete_get_container_usr, :clang_codeCompleteGetContainerUSR, [:pointer], String.by_value
3556
-
3558
+
3557
3559
  # Returns the currently-entered selector for an Objective-C message
3558
3560
  # send, formatted like "initWithFoo:bar:". Only guaranteed to return a
3559
3561
  # non-empty string for CXCompletionContext_ObjCInstanceMessage and
@@ -3565,7 +3567,7 @@ module Clang
3565
3567
  # for an Objective-C message send.
3566
3568
  # @scope class
3567
3569
  attach_function :code_complete_get_obj_c_selector, :clang_codeCompleteGetObjCSelector, [:pointer], String.by_value
3568
-
3570
+
3569
3571
  # Return a version string, suitable for showing to a user, but not
3570
3572
  # intended to be parsed (the format is not guaranteed to be stable).
3571
3573
  #
@@ -3573,7 +3575,7 @@ module Clang
3573
3575
  # @return [String]
3574
3576
  # @scope class
3575
3577
  attach_function :get_clang_version, :clang_getClangVersion, [], String.by_value
3576
-
3578
+
3577
3579
  # Enable/disable crash recovery.
3578
3580
  #
3579
3581
  # Flag:
@@ -3585,9 +3587,7 @@ module Clang
3585
3587
  # @return [nil]
3586
3588
  # @scope class
3587
3589
  attach_function :toggle_crash_recovery, :clang_toggleCrashRecovery, [:uint], :void
3588
-
3589
- # <em>This is no real method. This entry is only for documentation of the callback.</em>
3590
- #
3590
+
3591
3591
  # Visitor invoked for each file in a translation unit
3592
3592
  # (used with clang_getInclusions()).
3593
3593
  #
@@ -3598,14 +3598,16 @@ module Clang
3598
3598
  # array is sorted in order of immediate inclusion. For example,
3599
3599
  # the first element refers to the location that included 'included_file'.
3600
3600
  #
3601
- # @method inclusion_visitor_callback(inclusion_stack, include_len, client_data)
3601
+ # <em>This entry is only for documentation and no real method.</em>
3602
+ #
3603
+ # @method _callback_inclusion_visitor_(inclusion_stack, include_len, client_data)
3602
3604
  # @param [FFI::Pointer(*SourceLocation)] inclusion_stack
3603
3605
  # @param [Integer] include_len
3604
3606
  # @param [FFI::Pointer(ClientData)] client_data
3605
3607
  # @return [FFI::Pointer(File)]
3606
3608
  # @scope class
3607
3609
  callback :inclusion_visitor, [:pointer, :uint, :pointer], :pointer
3608
-
3610
+
3609
3611
  # Visit the set of preprocessor inclusions in a translation unit.
3610
3612
  # The visitor function is called with the provided data for every included
3611
3613
  # file. This does not include headers included by the PCH file (unless one
@@ -3613,12 +3615,12 @@ module Clang
3613
3615
  #
3614
3616
  # @method get_inclusions(tu, visitor, client_data)
3615
3617
  # @param [FFI::Pointer(TranslationUnit)] tu
3616
- # @param [Proc(inclusion_visitor_callback)] visitor
3618
+ # @param [Proc(_callback_inclusion_visitor_)] visitor
3617
3619
  # @param [FFI::Pointer(ClientData)] client_data
3618
3620
  # @return [nil]
3619
3621
  # @scope class
3620
3622
  attach_function :get_inclusions, :clang_getInclusions, [:pointer, :inclusion_visitor, :pointer], :void
3621
-
3623
+
3622
3624
  # Retrieve a remapping.
3623
3625
  #
3624
3626
  # @method get_remappings(path)
@@ -3627,7 +3629,7 @@ module Clang
3627
3629
  # via a call to \c clang_remap_dispose(). Can return NULL if an error occurred.
3628
3630
  # @scope class
3629
3631
  attach_function :get_remappings, :clang_getRemappings, [:string], :pointer
3630
-
3632
+
3631
3633
  # Determine the number of remappings.
3632
3634
  #
3633
3635
  # @method remap_get_num_files(remapping)
@@ -3635,7 +3637,7 @@ module Clang
3635
3637
  # @return [Integer]
3636
3638
  # @scope class
3637
3639
  attach_function :remap_get_num_files, :clang_remap_getNumFiles, [:pointer], :uint
3638
-
3640
+
3639
3641
  # Get the original and the associated filename from the remapping.
3640
3642
  #
3641
3643
  # @method remap_get_filenames(remapping, index, original, transformed)
@@ -3647,7 +3649,7 @@ module Clang
3647
3649
  # @return [nil]
3648
3650
  # @scope class
3649
3651
  attach_function :remap_get_filenames, :clang_remap_getFilenames, [:pointer, :uint, :pointer, :pointer], :void
3650
-
3652
+
3651
3653
  # Dispose the remapping.
3652
3654
  #
3653
3655
  # @method remap_dispose(remapping)
@@ -3655,26 +3657,27 @@ module Clang
3655
3657
  # @return [nil]
3656
3658
  # @scope class
3657
3659
  attach_function :remap_dispose, :clang_remap_dispose, [:pointer], :void
3658
-
3660
+
3659
3661
  # \defgroup CINDEX_HIGH Higher level API functions
3660
3662
  #
3661
3663
  # @{
3662
3664
  #
3665
+ # <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:visitor_result).</em>
3666
+ #
3663
3667
  # === Options:
3664
3668
  # :break ::
3665
3669
  #
3666
3670
  # :continue ::
3667
3671
  #
3668
- #
3669
- # @return [Array<Symbol>]
3670
- def self.visitor_result_enum
3671
- [:break, :continue]
3672
- end
3672
+ #
3673
+ # @method _enum_visitor_result_
3674
+ # @return [Symbol]
3675
+ # @scope class
3673
3676
  enum :visitor_result, [
3674
3677
  :break,
3675
3678
  :continue
3676
3679
  ]
3677
-
3680
+
3678
3681
  # \defgroup CINDEX_HIGH Higher level API functions
3679
3682
  #
3680
3683
  # @{
@@ -3684,12 +3687,11 @@ module Clang
3684
3687
  # (FFI::Pointer(*Void))
3685
3688
  # :visit ::
3686
3689
  # (FFI::Pointer(*))
3687
- #
3688
3690
  class CursorAndRangeVisitor < FFI::Struct
3689
3691
  layout :context, :pointer,
3690
3692
  :visit, :pointer
3691
3693
  end
3692
-
3694
+
3693
3695
  # Find references of a declaration in a specific file.
3694
3696
  #
3695
3697
  # @method find_references_in_file(cursor, file, visitor)
@@ -3702,5 +3704,5 @@ module Clang
3702
3704
  # @return [nil]
3703
3705
  # @scope class
3704
3706
  attach_function :find_references_in_file, :clang_findReferencesInFile, [Cursor.by_value, :pointer, CursorAndRangeVisitor.by_value], :void
3705
-
3706
- end
3707
+
3708
+ end