diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab16155..67ad9482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-dev.1 +- Added support for passing and returning struct by value in functions. + # 2.0.0-dev.0 - Added support for Nested structs. diff --git a/README.md b/README.md index 3b56033b..2cd23d2d 100644 --- a/README.md +++ b/README.md @@ -377,8 +377,6 @@ class ArrayHelper_CXFileUniqueID_data_level0 { ## Limitations 1. Multi OS support for types such as long. [Issue #7](https://github.com/dart-lang/ffigen/issues/7) -2. Function's passing/returning structs by value are skipped. [Issue #3](https://github.com/dart-lang/ffigen/issues/3) -3. Structs containing structs will have all their members removed. [Issue #4](https://github.com/dart-lang/ffigen/issues/4) ## Trying out examples 1. `cd examples/`, Run `pub get`. diff --git a/example/libclang-example/generated_bindings.dart b/example/libclang-example/generated_bindings.dart index 616826f9..0edbcb91 100644 --- a/example/libclang-example/generated_bindings.dart +++ b/example/libclang-example/generated_bindings.dart @@ -16,6 +16,32 @@ class LibClang { /// The symbols are looked up in [dynamicLibrary]. LibClang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + /// Retrieve the character data associated with the given string. + ffi.Pointer clang_getCString( + CXString string, + ) { + return (_clang_getCString ??= + _dylib.lookupFunction<_c_clang_getCString, _dart_clang_getCString>( + 'clang_getCString'))( + string, + ); + } + + _dart_clang_getCString? _clang_getCString; + + /// Free the given string. + void clang_disposeString( + CXString string, + ) { + return (_clang_disposeString ??= _dylib.lookupFunction< + _c_clang_disposeString, + _dart_clang_disposeString>('clang_disposeString'))( + string, + ); + } + + _dart_clang_disposeString? _clang_disposeString; + /// Free the given string set. void clang_disposeStringSet( ffi.Pointer set_1, @@ -161,6 +187,19 @@ class LibClang { _dart_clang_CXIndex_setInvocationEmissionPathOption? _clang_CXIndex_setInvocationEmissionPathOption; + /// Retrieve the complete file and path name of the given file. + CXString clang_getFileName( + ffi.Pointer SFile, + ) { + return (_clang_getFileName ??= + _dylib.lookupFunction<_c_clang_getFileName, _dart_clang_getFileName>( + 'clang_getFileName'))( + SFile, + ); + } + + _dart_clang_getFileName? _clang_getFileName; + /// Retrieve the last modification time of the given file. int clang_getFileTime( ffi.Pointer SFile, @@ -276,6 +315,403 @@ class LibClang { _dart_clang_File_isEqual? _clang_File_isEqual; + /// Returns the real path name of \c file. + /// + /// An empty string may be returned. Use \c clang_getFileName() in that case. + CXString clang_File_tryGetRealPathName( + ffi.Pointer file, + ) { + return (_clang_File_tryGetRealPathName ??= _dylib.lookupFunction< + _c_clang_File_tryGetRealPathName, + _dart_clang_File_tryGetRealPathName>('clang_File_tryGetRealPathName'))( + file, + ); + } + + _dart_clang_File_tryGetRealPathName? _clang_File_tryGetRealPathName; + + /// Retrieve a NULL (invalid) source location. + CXSourceLocation clang_getNullLocation() { + return (_clang_getNullLocation ??= _dylib.lookupFunction< + _c_clang_getNullLocation, + _dart_clang_getNullLocation>('clang_getNullLocation'))(); + } + + _dart_clang_getNullLocation? _clang_getNullLocation; + + /// Determine whether two source locations, which must refer into + /// the same translation unit, refer to exactly the same point in the source + /// code. + /// + /// \returns non-zero if the source locations refer to the same location, zero + /// if they refer to different locations. + int clang_equalLocations( + CXSourceLocation loc1, + CXSourceLocation loc2, + ) { + return (_clang_equalLocations ??= _dylib.lookupFunction< + _c_clang_equalLocations, + _dart_clang_equalLocations>('clang_equalLocations'))( + loc1, + loc2, + ); + } + + _dart_clang_equalLocations? _clang_equalLocations; + + /// Retrieves the source location associated with a given file/line/column + /// in a particular translation unit. + CXSourceLocation clang_getLocation( + ffi.Pointer tu, + ffi.Pointer file, + int line, + int column, + ) { + return (_clang_getLocation ??= + _dylib.lookupFunction<_c_clang_getLocation, _dart_clang_getLocation>( + 'clang_getLocation'))( + tu, + file, + line, + column, + ); + } + + _dart_clang_getLocation? _clang_getLocation; + + /// Retrieves the source location associated with a given character offset + /// in a particular translation unit. + CXSourceLocation clang_getLocationForOffset( + ffi.Pointer tu, + ffi.Pointer file, + int offset, + ) { + return (_clang_getLocationForOffset ??= _dylib.lookupFunction< + _c_clang_getLocationForOffset, + _dart_clang_getLocationForOffset>('clang_getLocationForOffset'))( + tu, + file, + offset, + ); + } + + _dart_clang_getLocationForOffset? _clang_getLocationForOffset; + + /// Returns non-zero if the given source location is in a system header. + int clang_Location_isInSystemHeader( + CXSourceLocation location, + ) { + return (_clang_Location_isInSystemHeader ??= _dylib.lookupFunction< + _c_clang_Location_isInSystemHeader, + _dart_clang_Location_isInSystemHeader>( + 'clang_Location_isInSystemHeader'))( + location, + ); + } + + _dart_clang_Location_isInSystemHeader? _clang_Location_isInSystemHeader; + + /// Returns non-zero if the given source location is in the main file of + /// the corresponding translation unit. + int clang_Location_isFromMainFile( + CXSourceLocation location, + ) { + return (_clang_Location_isFromMainFile ??= _dylib.lookupFunction< + _c_clang_Location_isFromMainFile, + _dart_clang_Location_isFromMainFile>('clang_Location_isFromMainFile'))( + location, + ); + } + + _dart_clang_Location_isFromMainFile? _clang_Location_isFromMainFile; + + /// Retrieve a NULL (invalid) source range. + CXSourceRange clang_getNullRange() { + return (_clang_getNullRange ??= + _dylib.lookupFunction<_c_clang_getNullRange, _dart_clang_getNullRange>( + 'clang_getNullRange'))(); + } + + _dart_clang_getNullRange? _clang_getNullRange; + + /// Retrieve a source range given the beginning and ending source + /// locations. + CXSourceRange clang_getRange( + CXSourceLocation begin, + CXSourceLocation end, + ) { + return (_clang_getRange ??= + _dylib.lookupFunction<_c_clang_getRange, _dart_clang_getRange>( + 'clang_getRange'))( + begin, + end, + ); + } + + _dart_clang_getRange? _clang_getRange; + + /// Determine whether two ranges are equivalent. + /// + /// \returns non-zero if the ranges are the same, zero if they differ. + int clang_equalRanges( + CXSourceRange range1, + CXSourceRange range2, + ) { + return (_clang_equalRanges ??= + _dylib.lookupFunction<_c_clang_equalRanges, _dart_clang_equalRanges>( + 'clang_equalRanges'))( + range1, + range2, + ); + } + + _dart_clang_equalRanges? _clang_equalRanges; + + /// Returns non-zero if \p range is null. + int clang_Range_isNull( + CXSourceRange range, + ) { + return (_clang_Range_isNull ??= + _dylib.lookupFunction<_c_clang_Range_isNull, _dart_clang_Range_isNull>( + 'clang_Range_isNull'))( + range, + ); + } + + _dart_clang_Range_isNull? _clang_Range_isNull; + + /// Retrieve the file, line, column, and offset represented by + /// the given source location. + /// + /// If the location refers into a macro expansion, retrieves the + /// location of the macro expansion. + /// + /// \param location the location within a source file that will be decomposed + /// into its parts. + /// + /// \param file [out] if non-NULL, will be set to the file to which the given + /// source location points. + /// + /// \param line [out] if non-NULL, will be set to the line to which the given + /// source location points. + /// + /// \param column [out] if non-NULL, will be set to the column to which the given + /// source location points. + /// + /// \param offset [out] if non-NULL, will be set to the offset into the + /// buffer to which the given source location points. + void clang_getExpansionLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getExpansionLocation ??= _dylib.lookupFunction< + _c_clang_getExpansionLocation, + _dart_clang_getExpansionLocation>('clang_getExpansionLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getExpansionLocation? _clang_getExpansionLocation; + + /// Retrieve the file, line and column represented by the given source + /// location, as specified in a # line directive. + /// + /// Example: given the following source code in a file somefile.c + /// + /// \code + /// #123 "dummy.c" 1 + /// + /// static int func(void) + /// { + /// return 0; + /// } + /// \endcode + /// + /// the location information returned by this function would be + /// + /// File: dummy.c Line: 124 Column: 12 + /// + /// whereas clang_getExpansionLocation would have returned + /// + /// File: somefile.c Line: 3 Column: 12 + /// + /// \param location the location within a source file that will be decomposed + /// into its parts. + /// + /// \param filename [out] if non-NULL, will be set to the filename of the + /// source location. Note that filenames returned will be for "virtual" files, + /// which don't necessarily exist on the machine running clang - e.g. when + /// parsing preprocessed output obtained from a different environment. If + /// a non-NULL value is passed in, remember to dispose of the returned value + /// using \c clang_disposeString() once you've finished with it. For an invalid + /// source location, an empty string is returned. + /// + /// \param line [out] if non-NULL, will be set to the line number of the + /// source location. For an invalid source location, zero is returned. + /// + /// \param column [out] if non-NULL, will be set to the column number of the + /// source location. For an invalid source location, zero is returned. + void clang_getPresumedLocation( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column, + ) { + return (_clang_getPresumedLocation ??= _dylib.lookupFunction< + _c_clang_getPresumedLocation, + _dart_clang_getPresumedLocation>('clang_getPresumedLocation'))( + location, + filename, + line, + column, + ); + } + + _dart_clang_getPresumedLocation? _clang_getPresumedLocation; + + /// Legacy API to retrieve the file, line, column, and offset represented + /// by the given source location. + /// + /// This interface has been replaced by the newer interface + /// #clang_getExpansionLocation(). See that interface's documentation for + /// details. + void clang_getInstantiationLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getInstantiationLocation ??= _dylib.lookupFunction< + _c_clang_getInstantiationLocation, + _dart_clang_getInstantiationLocation>( + 'clang_getInstantiationLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getInstantiationLocation? _clang_getInstantiationLocation; + + /// Retrieve the file, line, column, and offset represented by + /// the given source location. + /// + /// If the location refers into a macro instantiation, return where the + /// location was originally spelled in the source file. + /// + /// \param location the location within a source file that will be decomposed + /// into its parts. + /// + /// \param file [out] if non-NULL, will be set to the file to which the given + /// source location points. + /// + /// \param line [out] if non-NULL, will be set to the line to which the given + /// source location points. + /// + /// \param column [out] if non-NULL, will be set to the column to which the given + /// source location points. + /// + /// \param offset [out] if non-NULL, will be set to the offset into the + /// buffer to which the given source location points. + void clang_getSpellingLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getSpellingLocation ??= _dylib.lookupFunction< + _c_clang_getSpellingLocation, + _dart_clang_getSpellingLocation>('clang_getSpellingLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getSpellingLocation? _clang_getSpellingLocation; + + /// Retrieve the file, line, column, and offset represented by + /// the given source location. + /// + /// If the location refers into a macro expansion, return where the macro was + /// expanded or where the macro argument was written, if the location points at + /// a macro argument. + /// + /// \param location the location within a source file that will be decomposed + /// into its parts. + /// + /// \param file [out] if non-NULL, will be set to the file to which the given + /// source location points. + /// + /// \param line [out] if non-NULL, will be set to the line to which the given + /// source location points. + /// + /// \param column [out] if non-NULL, will be set to the column to which the given + /// source location points. + /// + /// \param offset [out] if non-NULL, will be set to the offset into the + /// buffer to which the given source location points. + void clang_getFileLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getFileLocation ??= _dylib.lookupFunction< + _c_clang_getFileLocation, + _dart_clang_getFileLocation>('clang_getFileLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getFileLocation? _clang_getFileLocation; + + /// Retrieve a source location representing the first character within a + /// source range. + CXSourceLocation clang_getRangeStart( + CXSourceRange range, + ) { + return (_clang_getRangeStart ??= _dylib.lookupFunction< + _c_clang_getRangeStart, + _dart_clang_getRangeStart>('clang_getRangeStart'))( + range, + ); + } + + _dart_clang_getRangeStart? _clang_getRangeStart; + + /// Retrieve a source location representing the last character within a + /// source range. + CXSourceLocation clang_getRangeEnd( + CXSourceRange range, + ) { + return (_clang_getRangeEnd ??= + _dylib.lookupFunction<_c_clang_getRangeEnd, _dart_clang_getRangeEnd>( + 'clang_getRangeEnd'))( + range, + ); + } + + _dart_clang_getRangeEnd? _clang_getRangeEnd; + /// Retrieve all ranges that were skipped by the preprocessor. /// /// The preprocessor will skip lines when they are surrounded by an @@ -478,6 +914,33 @@ class LibClang { _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; + /// Format the given diagnostic in a manner that is suitable for display. + /// + /// This routine will format the given diagnostic to a string, rendering + /// the diagnostic according to the various options given. The + /// \c clang_defaultDiagnosticDisplayOptions() function returns the set of + /// options that most closely mimics the behavior of the clang compiler. + /// + /// \param Diagnostic The diagnostic to print. + /// + /// \param Options A set of options that control the diagnostic display, + /// created by combining \c CXDiagnosticDisplayOptions values. + /// + /// \returns A new string containing for formatted diagnostic. + CXString clang_formatDiagnostic( + ffi.Pointer Diagnostic, + int Options, + ) { + return (_clang_formatDiagnostic ??= _dylib.lookupFunction< + _c_clang_formatDiagnostic, + _dart_clang_formatDiagnostic>('clang_formatDiagnostic'))( + Diagnostic, + Options, + ); + } + + _dart_clang_formatDiagnostic? _clang_formatDiagnostic; + /// Retrieve the set of display options most similar to the /// default behavior of the clang compiler. /// @@ -506,6 +969,59 @@ class LibClang { _dart_clang_getDiagnosticSeverity? _clang_getDiagnosticSeverity; + /// Retrieve the source location of the given diagnostic. + /// + /// This location is where Clang would print the caret ('^') when + /// displaying the diagnostic on the command line. + CXSourceLocation clang_getDiagnosticLocation( + ffi.Pointer arg0, + ) { + return (_clang_getDiagnosticLocation ??= _dylib.lookupFunction< + _c_clang_getDiagnosticLocation, + _dart_clang_getDiagnosticLocation>('clang_getDiagnosticLocation'))( + arg0, + ); + } + + _dart_clang_getDiagnosticLocation? _clang_getDiagnosticLocation; + + /// Retrieve the text of the given diagnostic. + CXString clang_getDiagnosticSpelling( + ffi.Pointer arg0, + ) { + return (_clang_getDiagnosticSpelling ??= _dylib.lookupFunction< + _c_clang_getDiagnosticSpelling, + _dart_clang_getDiagnosticSpelling>('clang_getDiagnosticSpelling'))( + arg0, + ); + } + + _dart_clang_getDiagnosticSpelling? _clang_getDiagnosticSpelling; + + /// Retrieve the name of the command-line option that enabled this + /// diagnostic. + /// + /// \param Diag The diagnostic to be queried. + /// + /// \param Disable If non-NULL, will be set to the option that disables this + /// diagnostic (if any). + /// + /// \returns A string that contains the command-line option used to enable this + /// warning, such as "-Wconversion" or "-pedantic". + CXString clang_getDiagnosticOption( + ffi.Pointer Diag, + ffi.Pointer Disable, + ) { + return (_clang_getDiagnosticOption ??= _dylib.lookupFunction< + _c_clang_getDiagnosticOption, + _dart_clang_getDiagnosticOption>('clang_getDiagnosticOption'))( + Diag, + Disable, + ); + } + + _dart_clang_getDiagnosticOption? _clang_getDiagnosticOption; + /// Retrieve the category number for this diagnostic. /// /// Diagnostics can be categorized into groups along with other, related @@ -526,6 +1042,43 @@ class LibClang { _dart_clang_getDiagnosticCategory? _clang_getDiagnosticCategory; + /// Retrieve the name of a particular diagnostic category. This + /// is now deprecated. Use clang_getDiagnosticCategoryText() + /// instead. + /// + /// \param Category A diagnostic category number, as returned by + /// \c clang_getDiagnosticCategory(). + /// + /// \returns The name of the given diagnostic category. + CXString clang_getDiagnosticCategoryName( + int Category, + ) { + return (_clang_getDiagnosticCategoryName ??= _dylib.lookupFunction< + _c_clang_getDiagnosticCategoryName, + _dart_clang_getDiagnosticCategoryName>( + 'clang_getDiagnosticCategoryName'))( + Category, + ); + } + + _dart_clang_getDiagnosticCategoryName? _clang_getDiagnosticCategoryName; + + /// Retrieve the diagnostic category text for a given diagnostic. + /// + /// \returns The text of the given diagnostic category. + CXString clang_getDiagnosticCategoryText( + ffi.Pointer arg0, + ) { + return (_clang_getDiagnosticCategoryText ??= _dylib.lookupFunction< + _c_clang_getDiagnosticCategoryText, + _dart_clang_getDiagnosticCategoryText>( + 'clang_getDiagnosticCategoryText'))( + arg0, + ); + } + + _dart_clang_getDiagnosticCategoryText? _clang_getDiagnosticCategoryText; + /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( @@ -540,6 +1093,31 @@ class LibClang { _dart_clang_getDiagnosticNumRanges? _clang_getDiagnosticNumRanges; + /// Retrieve a source range associated with the diagnostic. + /// + /// A diagnostic's source ranges highlight important elements in the source + /// code. On the command line, Clang displays source ranges by + /// underlining them with '~' characters. + /// + /// \param Diagnostic the diagnostic whose range is being extracted. + /// + /// \param Range the zero-based index specifying which range to + /// + /// \returns the requested source range. + CXSourceRange clang_getDiagnosticRange( + ffi.Pointer Diagnostic, + int Range, + ) { + return (_clang_getDiagnosticRange ??= _dylib.lookupFunction< + _c_clang_getDiagnosticRange, + _dart_clang_getDiagnosticRange>('clang_getDiagnosticRange'))( + Diagnostic, + Range, + ); + } + + _dart_clang_getDiagnosticRange? _clang_getDiagnosticRange; + /// Determine the number of fix-it hints associated with the /// given diagnostic. int clang_getDiagnosticNumFixIts( @@ -554,6 +1132,59 @@ class LibClang { _dart_clang_getDiagnosticNumFixIts? _clang_getDiagnosticNumFixIts; + /// Retrieve the replacement information for a given fix-it. + /// + /// Fix-its are described in terms of a source range whose contents + /// should be replaced by a string. This approach generalizes over + /// three kinds of operations: removal of source code (the range covers + /// the code to be removed and the replacement string is empty), + /// replacement of source code (the range covers the code to be + /// replaced and the replacement string provides the new code), and + /// insertion (both the start and end of the range point at the + /// insertion location, and the replacement string provides the text to + /// insert). + /// + /// \param Diagnostic The diagnostic whose fix-its are being queried. + /// + /// \param FixIt The zero-based index of the fix-it. + /// + /// \param ReplacementRange The source range whose contents will be + /// replaced with the returned replacement string. Note that source + /// ranges are half-open ranges [a, b), so the source code should be + /// replaced from a and up to (but not including) b. + /// + /// \returns A string containing text that should be replace the source + /// code indicated by the \c ReplacementRange. + CXString clang_getDiagnosticFixIt( + ffi.Pointer Diagnostic, + int FixIt, + ffi.Pointer ReplacementRange, + ) { + return (_clang_getDiagnosticFixIt ??= _dylib.lookupFunction< + _c_clang_getDiagnosticFixIt, + _dart_clang_getDiagnosticFixIt>('clang_getDiagnosticFixIt'))( + Diagnostic, + FixIt, + ReplacementRange, + ); + } + + _dart_clang_getDiagnosticFixIt? _clang_getDiagnosticFixIt; + + /// Get the original translation unit source file name. + CXString clang_getTranslationUnitSpelling( + ffi.Pointer CTUnit, + ) { + return (_clang_getTranslationUnitSpelling ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitSpelling, + _dart_clang_getTranslationUnitSpelling>( + 'clang_getTranslationUnitSpelling'))( + CTUnit, + ); + } + + _dart_clang_getTranslationUnitSpelling? _clang_getTranslationUnitSpelling; + /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. /// @@ -978,6 +1609,33 @@ class LibClang { _dart_clang_getTUResourceUsageName? _clang_getTUResourceUsageName; + /// Return the memory usage of a translation unit. This object + /// should be released with clang_disposeCXTUResourceUsage(). + CXTUResourceUsage clang_getCXTUResourceUsage( + ffi.Pointer TU, + ) { + return (_clang_getCXTUResourceUsage ??= _dylib.lookupFunction< + _c_clang_getCXTUResourceUsage, + _dart_clang_getCXTUResourceUsage>('clang_getCXTUResourceUsage'))( + TU, + ); + } + + _dart_clang_getCXTUResourceUsage? _clang_getCXTUResourceUsage; + + void clang_disposeCXTUResourceUsage( + CXTUResourceUsage usage, + ) { + return (_clang_disposeCXTUResourceUsage ??= _dylib.lookupFunction< + _c_clang_disposeCXTUResourceUsage, + _dart_clang_disposeCXTUResourceUsage>( + 'clang_disposeCXTUResourceUsage'))( + usage, + ); + } + + _dart_clang_disposeCXTUResourceUsage? _clang_disposeCXTUResourceUsage; + /// Get target information for this translation unit. /// /// The CXTargetInfo object cannot outlive the CXTranslationUnit object. @@ -1007,6 +1665,21 @@ class LibClang { _dart_clang_TargetInfo_dispose? _clang_TargetInfo_dispose; + /// Get the normalized target triple as a string. + /// + /// Returns the empty string in case of any error. + CXString clang_TargetInfo_getTriple( + ffi.Pointer Info, + ) { + return (_clang_TargetInfo_getTriple ??= _dylib.lookupFunction< + _c_clang_TargetInfo_getTriple, + _dart_clang_TargetInfo_getTriple>('clang_TargetInfo_getTriple'))( + Info, + ); + } + + _dart_clang_TargetInfo_getTriple? _clang_TargetInfo_getTriple; + /// Get the pointer width of the target in bits. /// /// Returns -1 in case of error. @@ -1023,10 +1696,90 @@ class LibClang { _dart_clang_TargetInfo_getPointerWidth? _clang_TargetInfo_getPointerWidth; - /// Determine whether the given cursor kind represents a declaration. - int clang_isDeclaration( - int arg0, - ) { + /// Retrieve the NULL cursor, which represents no entity. + CXCursor clang_getNullCursor() { + return (_clang_getNullCursor ??= _dylib.lookupFunction< + _c_clang_getNullCursor, + _dart_clang_getNullCursor>('clang_getNullCursor'))(); + } + + _dart_clang_getNullCursor? _clang_getNullCursor; + + /// Retrieve the cursor that represents the given translation unit. + /// + /// The translation unit cursor can be used to start traversing the + /// various declarations within the given translation unit. + CXCursor clang_getTranslationUnitCursor( + ffi.Pointer arg0, + ) { + return (_clang_getTranslationUnitCursor ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitCursor, + _dart_clang_getTranslationUnitCursor>( + 'clang_getTranslationUnitCursor'))( + arg0, + ); + } + + _dart_clang_getTranslationUnitCursor? _clang_getTranslationUnitCursor; + + /// Determine whether two cursors are equivalent. + int clang_equalCursors( + CXCursor arg0, + CXCursor arg1, + ) { + return (_clang_equalCursors ??= + _dylib.lookupFunction<_c_clang_equalCursors, _dart_clang_equalCursors>( + 'clang_equalCursors'))( + arg0, + arg1, + ); + } + + _dart_clang_equalCursors? _clang_equalCursors; + + /// Returns non-zero if \p cursor is null. + int clang_Cursor_isNull( + CXCursor cursor, + ) { + return (_clang_Cursor_isNull ??= _dylib.lookupFunction< + _c_clang_Cursor_isNull, + _dart_clang_Cursor_isNull>('clang_Cursor_isNull'))( + cursor, + ); + } + + _dart_clang_Cursor_isNull? _clang_Cursor_isNull; + + /// Compute a hash value for the given cursor. + int clang_hashCursor( + CXCursor arg0, + ) { + return (_clang_hashCursor ??= + _dylib.lookupFunction<_c_clang_hashCursor, _dart_clang_hashCursor>( + 'clang_hashCursor'))( + arg0, + ); + } + + _dart_clang_hashCursor? _clang_hashCursor; + + /// Retrieve the kind of the given cursor. + int clang_getCursorKind( + CXCursor arg0, + ) { + return (_clang_getCursorKind ??= _dylib.lookupFunction< + _c_clang_getCursorKind, + _dart_clang_getCursorKind>('clang_getCursorKind'))( + arg0, + ); + } + + _dart_clang_getCursorKind? _clang_getCursorKind; + + /// Determine whether the given cursor kind represents a declaration. + int clang_isDeclaration( + int arg0, + ) { return (_clang_isDeclaration ??= _dylib.lookupFunction< _c_clang_isDeclaration, _dart_clang_isDeclaration>('clang_isDeclaration'))( @@ -1036,6 +1789,24 @@ class LibClang { _dart_clang_isDeclaration? _clang_isDeclaration; + /// Determine whether the given declaration is invalid. + /// + /// A declaration is invalid if it could not be parsed successfully. + /// + /// \returns non-zero if the cursor represents a declaration and it is + /// invalid, otherwise NULL. + int clang_isInvalidDeclaration( + CXCursor arg0, + ) { + return (_clang_isInvalidDeclaration ??= _dylib.lookupFunction< + _c_clang_isInvalidDeclaration, + _dart_clang_isInvalidDeclaration>('clang_isInvalidDeclaration'))( + arg0, + ); + } + + _dart_clang_isInvalidDeclaration? _clang_isInvalidDeclaration; + /// Determine whether the given cursor kind represents a simple /// reference. /// @@ -1093,6 +1864,19 @@ class LibClang { _dart_clang_isAttribute? _clang_isAttribute; + /// Determine whether the given cursor has any attributes. + int clang_Cursor_hasAttrs( + CXCursor C, + ) { + return (_clang_Cursor_hasAttrs ??= _dylib.lookupFunction< + _c_clang_Cursor_hasAttrs, + _dart_clang_Cursor_hasAttrs>('clang_Cursor_hasAttrs'))( + C, + ); + } + + _dart_clang_Cursor_hasAttrs? _clang_Cursor_hasAttrs; + /// Determine whether the given cursor kind represents an invalid /// cursor. int clang_isInvalid( @@ -1149,6 +1933,118 @@ class LibClang { _dart_clang_isUnexposed? _clang_isUnexposed; + /// Determine the linkage of the entity referred to by a given cursor. + int clang_getCursorLinkage( + CXCursor cursor, + ) { + return (_clang_getCursorLinkage ??= _dylib.lookupFunction< + _c_clang_getCursorLinkage, + _dart_clang_getCursorLinkage>('clang_getCursorLinkage'))( + cursor, + ); + } + + _dart_clang_getCursorLinkage? _clang_getCursorLinkage; + + /// Describe the visibility of the entity referred to by a cursor. + /// + /// This returns the default visibility if not explicitly specified by + /// a visibility attribute. The default visibility may be changed by + /// commandline arguments. + /// + /// \param cursor The cursor to query. + /// + /// \returns The visibility of the cursor. + int clang_getCursorVisibility( + CXCursor cursor, + ) { + return (_clang_getCursorVisibility ??= _dylib.lookupFunction< + _c_clang_getCursorVisibility, + _dart_clang_getCursorVisibility>('clang_getCursorVisibility'))( + cursor, + ); + } + + _dart_clang_getCursorVisibility? _clang_getCursorVisibility; + + /// Determine the availability of the entity that this cursor refers to, + /// taking the current target platform into account. + /// + /// \param cursor The cursor to query. + /// + /// \returns The availability of the cursor. + int clang_getCursorAvailability( + CXCursor cursor, + ) { + return (_clang_getCursorAvailability ??= _dylib.lookupFunction< + _c_clang_getCursorAvailability, + _dart_clang_getCursorAvailability>('clang_getCursorAvailability'))( + cursor, + ); + } + + _dart_clang_getCursorAvailability? _clang_getCursorAvailability; + + /// Determine the availability of the entity that this cursor refers to + /// on any platforms for which availability information is known. + /// + /// \param cursor The cursor to query. + /// + /// \param always_deprecated If non-NULL, will be set to indicate whether the + /// entity is deprecated on all platforms. + /// + /// \param deprecated_message If non-NULL, will be set to the message text + /// provided along with the unconditional deprecation of this entity. The client + /// is responsible for deallocating this string. + /// + /// \param always_unavailable If non-NULL, will be set to indicate whether the + /// entity is unavailable on all platforms. + /// + /// \param unavailable_message If non-NULL, will be set to the message text + /// provided along with the unconditional unavailability of this entity. The + /// client is responsible for deallocating this string. + /// + /// \param availability If non-NULL, an array of CXPlatformAvailability instances + /// that will be populated with platform availability information, up to either + /// the number of platforms for which availability information is available (as + /// returned by this function) or \c availability_size, whichever is smaller. + /// + /// \param availability_size The number of elements available in the + /// \c availability array. + /// + /// \returns The number of platforms (N) for which availability information is + /// available (which is unrelated to \c availability_size). + /// + /// Note that the client is responsible for calling + /// \c clang_disposeCXPlatformAvailability to free each of the + /// platform-availability structures returned. There are + /// \c min(N, availability_size) such structures. + int clang_getCursorPlatformAvailability( + CXCursor cursor, + ffi.Pointer always_deprecated, + ffi.Pointer deprecated_message, + ffi.Pointer always_unavailable, + ffi.Pointer unavailable_message, + ffi.Pointer availability, + int availability_size, + ) { + return (_clang_getCursorPlatformAvailability ??= _dylib.lookupFunction< + _c_clang_getCursorPlatformAvailability, + _dart_clang_getCursorPlatformAvailability>( + 'clang_getCursorPlatformAvailability'))( + cursor, + always_deprecated, + deprecated_message, + always_unavailable, + unavailable_message, + availability, + availability_size, + ); + } + + _dart_clang_getCursorPlatformAvailability? + _clang_getCursorPlatformAvailability; + /// Free the memory associated with a \c CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( ffi.Pointer availability, @@ -1164,6 +2060,47 @@ class LibClang { _dart_clang_disposeCXPlatformAvailability? _clang_disposeCXPlatformAvailability; + /// Determine the "language" of the entity referred to by a given cursor. + int clang_getCursorLanguage( + CXCursor cursor, + ) { + return (_clang_getCursorLanguage ??= _dylib.lookupFunction< + _c_clang_getCursorLanguage, + _dart_clang_getCursorLanguage>('clang_getCursorLanguage'))( + cursor, + ); + } + + _dart_clang_getCursorLanguage? _clang_getCursorLanguage; + + /// Determine the "thread-local storage (TLS) kind" of the declaration + /// referred to by a cursor. + int clang_getCursorTLSKind( + CXCursor cursor, + ) { + return (_clang_getCursorTLSKind ??= _dylib.lookupFunction< + _c_clang_getCursorTLSKind, + _dart_clang_getCursorTLSKind>('clang_getCursorTLSKind'))( + cursor, + ); + } + + _dart_clang_getCursorTLSKind? _clang_getCursorTLSKind; + + /// Returns the translation unit that a cursor originated from. + ffi.Pointer clang_Cursor_getTranslationUnit( + CXCursor arg0, + ) { + return (_clang_Cursor_getTranslationUnit ??= _dylib.lookupFunction< + _c_clang_Cursor_getTranslationUnit, + _dart_clang_Cursor_getTranslationUnit>( + 'clang_Cursor_getTranslationUnit'))( + arg0, + ); + } + + _dart_clang_Cursor_getTranslationUnit? _clang_Cursor_getTranslationUnit; + /// Creates an empty CXCursorSet. ffi.Pointer clang_createCXCursorSet() { return (_clang_createCXCursorSet ??= _dylib.lookupFunction< @@ -1186,6 +2123,184 @@ class LibClang { _dart_clang_disposeCXCursorSet? _clang_disposeCXCursorSet; + /// Queries a CXCursorSet to see if it contains a specific CXCursor. + /// + /// \returns non-zero if the set contains the specified cursor. + int clang_CXCursorSet_contains( + ffi.Pointer cset, + CXCursor cursor, + ) { + return (_clang_CXCursorSet_contains ??= _dylib.lookupFunction< + _c_clang_CXCursorSet_contains, + _dart_clang_CXCursorSet_contains>('clang_CXCursorSet_contains'))( + cset, + cursor, + ); + } + + _dart_clang_CXCursorSet_contains? _clang_CXCursorSet_contains; + + /// Inserts a CXCursor into a CXCursorSet. + /// + /// \returns zero if the CXCursor was already in the set, and non-zero otherwise. + int clang_CXCursorSet_insert( + ffi.Pointer cset, + CXCursor cursor, + ) { + return (_clang_CXCursorSet_insert ??= _dylib.lookupFunction< + _c_clang_CXCursorSet_insert, + _dart_clang_CXCursorSet_insert>('clang_CXCursorSet_insert'))( + cset, + cursor, + ); + } + + _dart_clang_CXCursorSet_insert? _clang_CXCursorSet_insert; + + /// Determine the semantic parent of the given cursor. + /// + /// The semantic parent of a cursor is the cursor that semantically contains + /// the given \p cursor. For many declarations, the lexical and semantic parents + /// are equivalent (the lexical parent is returned by + /// \c clang_getCursorLexicalParent()). They diverge when declarations or + /// definitions are provided out-of-line. For example: + /// + /// \code + /// class C { + /// void f(); + /// }; + /// + /// void C::f() { } + /// \endcode + /// + /// In the out-of-line definition of \c C::f, the semantic parent is + /// the class \c C, of which this function is a member. The lexical parent is + /// the place where the declaration actually occurs in the source code; in this + /// case, the definition occurs in the translation unit. In general, the + /// lexical parent for a given entity can change without affecting the semantics + /// of the program, and the lexical parent of different declarations of the + /// same entity may be different. Changing the semantic parent of a declaration, + /// on the other hand, can have a major impact on semantics, and redeclarations + /// of a particular entity should all have the same semantic context. + /// + /// In the example above, both declarations of \c C::f have \c C as their + /// semantic context, while the lexical context of the first \c C::f is \c C + /// and the lexical context of the second \c C::f is the translation unit. + /// + /// For global declarations, the semantic parent is the translation unit. + CXCursor clang_getCursorSemanticParent( + CXCursor cursor, + ) { + return (_clang_getCursorSemanticParent ??= _dylib.lookupFunction< + _c_clang_getCursorSemanticParent, + _dart_clang_getCursorSemanticParent>('clang_getCursorSemanticParent'))( + cursor, + ); + } + + _dart_clang_getCursorSemanticParent? _clang_getCursorSemanticParent; + + /// Determine the lexical parent of the given cursor. + /// + /// The lexical parent of a cursor is the cursor in which the given \p cursor + /// was actually written. For many declarations, the lexical and semantic parents + /// are equivalent (the semantic parent is returned by + /// \c clang_getCursorSemanticParent()). They diverge when declarations or + /// definitions are provided out-of-line. For example: + /// + /// \code + /// class C { + /// void f(); + /// }; + /// + /// void C::f() { } + /// \endcode + /// + /// In the out-of-line definition of \c C::f, the semantic parent is + /// the class \c C, of which this function is a member. The lexical parent is + /// the place where the declaration actually occurs in the source code; in this + /// case, the definition occurs in the translation unit. In general, the + /// lexical parent for a given entity can change without affecting the semantics + /// of the program, and the lexical parent of different declarations of the + /// same entity may be different. Changing the semantic parent of a declaration, + /// on the other hand, can have a major impact on semantics, and redeclarations + /// of a particular entity should all have the same semantic context. + /// + /// In the example above, both declarations of \c C::f have \c C as their + /// semantic context, while the lexical context of the first \c C::f is \c C + /// and the lexical context of the second \c C::f is the translation unit. + /// + /// For declarations written in the global scope, the lexical parent is + /// the translation unit. + CXCursor clang_getCursorLexicalParent( + CXCursor cursor, + ) { + return (_clang_getCursorLexicalParent ??= _dylib.lookupFunction< + _c_clang_getCursorLexicalParent, + _dart_clang_getCursorLexicalParent>('clang_getCursorLexicalParent'))( + cursor, + ); + } + + _dart_clang_getCursorLexicalParent? _clang_getCursorLexicalParent; + + /// Determine the set of methods that are overridden by the given + /// method. + /// + /// In both Objective-C and C++, a method (aka virtual member function, + /// in C++) can override a virtual method in a base class. For + /// Objective-C, a method is said to override any method in the class's + /// base class, its protocols, or its categories' protocols, that has the same + /// selector and is of the same kind (class or instance). + /// If no such method exists, the search continues to the class's superclass, + /// its protocols, and its categories, and so on. A method from an Objective-C + /// implementation is considered to override the same methods as its + /// corresponding method in the interface. + /// + /// For C++, a virtual member function overrides any virtual member + /// function with the same signature that occurs in its base + /// classes. With multiple inheritance, a virtual member function can + /// override several virtual member functions coming from different + /// base classes. + /// + /// In all cases, this function determines the immediate overridden + /// method, rather than all of the overridden methods. For example, if + /// a method is originally declared in a class A, then overridden in B + /// (which in inherits from A) and also in C (which inherited from B), + /// then the only overridden method returned from this function when + /// invoked on C's method will be B's method. The client may then + /// invoke this function again, given the previously-found overridden + /// methods, to map out the complete method-override set. + /// + /// \param cursor A cursor representing an Objective-C or C++ + /// method. This routine will compute the set of methods that this + /// method overrides. + /// + /// \param overridden A pointer whose pointee will be replaced with a + /// pointer to an array of cursors, representing the set of overridden + /// methods. If there are no overridden methods, the pointee will be + /// set to NULL. The pointee must be freed via a call to + /// \c clang_disposeOverriddenCursors(). + /// + /// \param num_overridden A pointer to the number of overridden + /// functions, will be set to the number of overridden functions in the + /// array pointed to by \p overridden. + void clang_getOverriddenCursors( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden, + ) { + return (_clang_getOverriddenCursors ??= _dylib.lookupFunction< + _c_clang_getOverriddenCursors, + _dart_clang_getOverriddenCursors>('clang_getOverriddenCursors'))( + cursor, + overridden, + num_overridden, + ); + } + + _dart_clang_getOverriddenCursors? _clang_getOverriddenCursors; + /// Free the set of overridden cursors returned by \c /// clang_getOverriddenCursors(). void clang_disposeOverriddenCursors( @@ -1201,2850 +2316,7205 @@ class LibClang { _dart_clang_disposeOverriddenCursors? _clang_disposeOverriddenCursors; - /// Get a property value for the given printing policy. - int clang_PrintingPolicy_getProperty( - ffi.Pointer Policy, - int Property, + /// Retrieve the file that is included by the given inclusion directive + /// cursor. + ffi.Pointer clang_getIncludedFile( + CXCursor cursor, ) { - return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_getProperty, - _dart_clang_PrintingPolicy_getProperty>( - 'clang_PrintingPolicy_getProperty'))( - Policy, - Property, + return (_clang_getIncludedFile ??= _dylib.lookupFunction< + _c_clang_getIncludedFile, + _dart_clang_getIncludedFile>('clang_getIncludedFile'))( + cursor, ); } - _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; + _dart_clang_getIncludedFile? _clang_getIncludedFile; - /// Set a property value for the given printing policy. - void clang_PrintingPolicy_setProperty( - ffi.Pointer Policy, - int Property, - int Value, + /// Map a source location to the cursor that describes the entity at that + /// location in the source code. + /// + /// clang_getCursor() maps an arbitrary source location within a translation + /// unit down to the most specific cursor that describes the entity at that + /// location. For example, given an expression \c x + y, invoking + /// clang_getCursor() with a source location pointing to "x" will return the + /// cursor for "x"; similarly for "y". If the cursor points anywhere between + /// "x" or "y" (e.g., on the + or the whitespace around it), clang_getCursor() + /// will return a cursor referring to the "+" expression. + /// + /// \returns a cursor representing the entity at the given source location, or + /// a NULL cursor if no such entity can be found. + CXCursor clang_getCursor( + ffi.Pointer arg0, + CXSourceLocation arg1, ) { - return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_setProperty, - _dart_clang_PrintingPolicy_setProperty>( - 'clang_PrintingPolicy_setProperty'))( - Policy, - Property, - Value, + return (_clang_getCursor ??= + _dylib.lookupFunction<_c_clang_getCursor, _dart_clang_getCursor>( + 'clang_getCursor'))( + arg0, + arg1, ); } - _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; + _dart_clang_getCursor? _clang_getCursor; - /// Release a printing policy. - void clang_PrintingPolicy_dispose( - ffi.Pointer Policy, + /// Retrieve the physical location of the source constructor referenced + /// by the given cursor. + /// + /// The location of a declaration is typically the location of the name of that + /// declaration, where the name of that declaration would occur if it is + /// unnamed, or some keyword that introduces that particular declaration. + /// The location of a reference is where that reference occurs within the + /// source code. + CXSourceLocation clang_getCursorLocation( + CXCursor arg0, ) { - return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_dispose, - _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( - Policy, + return (_clang_getCursorLocation ??= _dylib.lookupFunction< + _c_clang_getCursorLocation, + _dart_clang_getCursorLocation>('clang_getCursorLocation'))( + arg0, ); } - _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; + _dart_clang_getCursorLocation? _clang_getCursorLocation; - /// Given a CXFile header file, return the module that contains it, if one - /// exists. - ffi.Pointer clang_getModuleForFile( - ffi.Pointer arg0, - ffi.Pointer arg1, + /// Retrieve the physical extent of the source construct referenced by + /// the given cursor. + /// + /// The extent of a cursor starts with the file/line/column pointing at the + /// first character within the source construct that the cursor refers to and + /// ends with the last character within that source construct. For a + /// declaration, the extent covers the declaration itself. For a reference, + /// the extent covers the location of the reference (e.g., where the referenced + /// entity was actually used). + CXSourceRange clang_getCursorExtent( + CXCursor arg0, ) { - return (_clang_getModuleForFile ??= _dylib.lookupFunction< - _c_clang_getModuleForFile, - _dart_clang_getModuleForFile>('clang_getModuleForFile'))( + return (_clang_getCursorExtent ??= _dylib.lookupFunction< + _c_clang_getCursorExtent, + _dart_clang_getCursorExtent>('clang_getCursorExtent'))( arg0, - arg1, ); } - _dart_clang_getModuleForFile? _clang_getModuleForFile; + _dart_clang_getCursorExtent? _clang_getCursorExtent; - /// \param Module a module object. - /// - /// \returns the module file where the provided module object came from. - ffi.Pointer clang_Module_getASTFile( - ffi.Pointer Module, + /// Retrieve the type of a CXCursor (if any). + CXType clang_getCursorType( + CXCursor C, ) { - return (_clang_Module_getASTFile ??= _dylib.lookupFunction< - _c_clang_Module_getASTFile, - _dart_clang_Module_getASTFile>('clang_Module_getASTFile'))( - Module, + return (_clang_getCursorType ??= _dylib.lookupFunction< + _c_clang_getCursorType, + _dart_clang_getCursorType>('clang_getCursorType'))( + C, ); } - _dart_clang_Module_getASTFile? _clang_Module_getASTFile; + _dart_clang_getCursorType? _clang_getCursorType; - /// \param Module a module object. + /// Pretty-print the underlying type using the rules of the + /// language of the translation unit from which it came. /// - /// \returns the parent of a sub-module or NULL if the given module is top-level, - /// e.g. for 'std.vector' it will return the 'std' module. - ffi.Pointer clang_Module_getParent( - ffi.Pointer Module, + /// If the type is invalid, an empty string is returned. + CXString clang_getTypeSpelling( + CXType CT, ) { - return (_clang_Module_getParent ??= _dylib.lookupFunction< - _c_clang_Module_getParent, - _dart_clang_Module_getParent>('clang_Module_getParent'))( - Module, + return (_clang_getTypeSpelling ??= _dylib.lookupFunction< + _c_clang_getTypeSpelling, + _dart_clang_getTypeSpelling>('clang_getTypeSpelling'))( + CT, ); } - _dart_clang_Module_getParent? _clang_Module_getParent; + _dart_clang_getTypeSpelling? _clang_getTypeSpelling; - /// \param Module a module object. + /// Retrieve the underlying type of a typedef declaration. /// - /// \returns non-zero if the module is a system one. - int clang_Module_isSystem( - ffi.Pointer Module, + /// If the cursor does not reference a typedef declaration, an invalid type is + /// returned. + CXType clang_getTypedefDeclUnderlyingType( + CXCursor C, ) { - return (_clang_Module_isSystem ??= _dylib.lookupFunction< - _c_clang_Module_isSystem, - _dart_clang_Module_isSystem>('clang_Module_isSystem'))( - Module, + return (_clang_getTypedefDeclUnderlyingType ??= _dylib.lookupFunction< + _c_clang_getTypedefDeclUnderlyingType, + _dart_clang_getTypedefDeclUnderlyingType>( + 'clang_getTypedefDeclUnderlyingType'))( + C, ); } - _dart_clang_Module_isSystem? _clang_Module_isSystem; + _dart_clang_getTypedefDeclUnderlyingType? _clang_getTypedefDeclUnderlyingType; - /// \param Module a module object. + /// Retrieve the integer type of an enum declaration. /// - /// \returns the number of top level headers associated with this module. - int clang_Module_getNumTopLevelHeaders( - ffi.Pointer arg0, - ffi.Pointer Module, + /// If the cursor does not reference an enum declaration, an invalid type is + /// returned. + CXType clang_getEnumDeclIntegerType( + CXCursor C, ) { - return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< - _c_clang_Module_getNumTopLevelHeaders, - _dart_clang_Module_getNumTopLevelHeaders>( - 'clang_Module_getNumTopLevelHeaders'))( - arg0, - Module, + return (_clang_getEnumDeclIntegerType ??= _dylib.lookupFunction< + _c_clang_getEnumDeclIntegerType, + _dart_clang_getEnumDeclIntegerType>('clang_getEnumDeclIntegerType'))( + C, ); } - _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; + _dart_clang_getEnumDeclIntegerType? _clang_getEnumDeclIntegerType; - /// \param Module a module object. + /// Retrieve the integer value of an enum constant declaration as a signed + /// long long. /// - /// \param Index top level header index (zero-based). - /// - /// \returns the specified top level header associated with the module. - ffi.Pointer clang_Module_getTopLevelHeader( - ffi.Pointer arg0, - ffi.Pointer Module, - int Index, + /// If the cursor does not reference an enum constant declaration, LLONG_MIN is returned. + /// Since this is also potentially a valid constant value, the kind of the cursor + /// must be verified before calling this function. + int clang_getEnumConstantDeclValue( + CXCursor C, ) { - return (_clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< - _c_clang_Module_getTopLevelHeader, - _dart_clang_Module_getTopLevelHeader>( - 'clang_Module_getTopLevelHeader'))( - arg0, - Module, - Index, + return (_clang_getEnumConstantDeclValue ??= _dylib.lookupFunction< + _c_clang_getEnumConstantDeclValue, + _dart_clang_getEnumConstantDeclValue>( + 'clang_getEnumConstantDeclValue'))( + C, ); } - _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; + _dart_clang_getEnumConstantDeclValue? _clang_getEnumConstantDeclValue; - /// Annotate the given set of tokens by providing cursors for each token - /// that can be mapped to a specific entity within the abstract syntax tree. - /// - /// This token-annotation routine is equivalent to invoking - /// clang_getCursor() for the source locations of each of the - /// tokens. The cursors provided are filtered, so that only those - /// cursors that have a direct correspondence to the token are - /// accepted. For example, given a function call \c f(x), - /// clang_getCursor() would provide the following cursors: - /// - /// * when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'. - /// * when the cursor is over the '(' or the ')', a CallExpr referring to 'f'. - /// * when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'. - /// - /// Only the first and last of these cursors will occur within the - /// annotate, since the tokens "f" and "x' directly refer to a function - /// and a variable, respectively, but the parentheses are just a small - /// part of the full syntax of the function call expression, which is - /// not provided as an annotation. - /// - /// \param TU the translation unit that owns the given tokens. - /// - /// \param Tokens the set of tokens to annotate. - /// - /// \param NumTokens the number of tokens in \p Tokens. + /// Retrieve the integer value of an enum constant declaration as an unsigned + /// long long. /// - /// \param Cursors an array of \p NumTokens cursors, whose contents will be - /// replaced with the cursors corresponding to each token. - void clang_annotateTokens( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, - ffi.Pointer Cursors, + /// If the cursor does not reference an enum constant declaration, ULLONG_MAX is returned. + /// Since this is also potentially a valid constant value, the kind of the cursor + /// must be verified before calling this function. + int clang_getEnumConstantDeclUnsignedValue( + CXCursor C, ) { - return (_clang_annotateTokens ??= _dylib.lookupFunction< - _c_clang_annotateTokens, - _dart_clang_annotateTokens>('clang_annotateTokens'))( - TU, - Tokens, - NumTokens, - Cursors, + return (_clang_getEnumConstantDeclUnsignedValue ??= _dylib.lookupFunction< + _c_clang_getEnumConstantDeclUnsignedValue, + _dart_clang_getEnumConstantDeclUnsignedValue>( + 'clang_getEnumConstantDeclUnsignedValue'))( + C, ); } - _dart_clang_annotateTokens? _clang_annotateTokens; + _dart_clang_getEnumConstantDeclUnsignedValue? + _clang_getEnumConstantDeclUnsignedValue; - /// Free the given set of tokens. - void clang_disposeTokens( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, + /// Retrieve the bit width of a bit field declaration as an integer. + /// + /// If a cursor that is not a bit field declaration is passed in, -1 is returned. + int clang_getFieldDeclBitWidth( + CXCursor C, ) { - return (_clang_disposeTokens ??= _dylib.lookupFunction< - _c_clang_disposeTokens, - _dart_clang_disposeTokens>('clang_disposeTokens'))( - TU, - Tokens, - NumTokens, + return (_clang_getFieldDeclBitWidth ??= _dylib.lookupFunction< + _c_clang_getFieldDeclBitWidth, + _dart_clang_getFieldDeclBitWidth>('clang_getFieldDeclBitWidth'))( + C, ); } - _dart_clang_disposeTokens? _clang_disposeTokens; + _dart_clang_getFieldDeclBitWidth? _clang_getFieldDeclBitWidth; - void clang_enableStackTraces() { - return (_clang_enableStackTraces ??= _dylib.lookupFunction< - _c_clang_enableStackTraces, - _dart_clang_enableStackTraces>('clang_enableStackTraces'))(); + /// Retrieve the number of non-variadic arguments associated with a given + /// cursor. + /// + /// The number of arguments can be determined for calls as well as for + /// declarations of functions or methods. For other cursors -1 is returned. + int clang_Cursor_getNumArguments( + CXCursor C, + ) { + return (_clang_Cursor_getNumArguments ??= _dylib.lookupFunction< + _c_clang_Cursor_getNumArguments, + _dart_clang_Cursor_getNumArguments>('clang_Cursor_getNumArguments'))( + C, + ); } - _dart_clang_enableStackTraces? _clang_enableStackTraces; + _dart_clang_Cursor_getNumArguments? _clang_Cursor_getNumArguments; - void clang_executeOnThread( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, + /// Retrieve the argument cursor of a function or method. + /// + /// The argument cursor can be determined for calls as well as for declarations + /// of functions or methods. For other cursors and for invalid indices, an + /// invalid cursor is returned. + CXCursor clang_Cursor_getArgument( + CXCursor C, + int i, ) { - return (_clang_executeOnThread ??= _dylib.lookupFunction< - _c_clang_executeOnThread, - _dart_clang_executeOnThread>('clang_executeOnThread'))( - fn, - user_data, - stack_size, + return (_clang_Cursor_getArgument ??= _dylib.lookupFunction< + _c_clang_Cursor_getArgument, + _dart_clang_Cursor_getArgument>('clang_Cursor_getArgument'))( + C, + i, ); } - _dart_clang_executeOnThread? _clang_executeOnThread; + _dart_clang_Cursor_getArgument? _clang_Cursor_getArgument; - /// Determine the kind of a particular chunk within a completion string. + /// Returns the number of template args of a function decl representing a + /// template specialization. /// - /// \param completion_string the completion string to query. + /// If the argument cursor cannot be converted into a template function + /// declaration, -1 is returned. /// - /// \param chunk_number the 0-based index of the chunk in the completion string. + /// For example, for the following declaration and specialization: + /// template + /// void foo() { ... } /// - /// \returns the kind of the chunk at the index \c chunk_number. - int clang_getCompletionChunkKind( - ffi.Pointer completion_string, - int chunk_number, + /// template <> + /// void foo(); + /// + /// The value 3 would be returned from this call. + int clang_Cursor_getNumTemplateArguments( + CXCursor C, ) { - return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkKind, - _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( - completion_string, - chunk_number, + return (_clang_Cursor_getNumTemplateArguments ??= _dylib.lookupFunction< + _c_clang_Cursor_getNumTemplateArguments, + _dart_clang_Cursor_getNumTemplateArguments>( + 'clang_Cursor_getNumTemplateArguments'))( + C, ); } - _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; + _dart_clang_Cursor_getNumTemplateArguments? + _clang_Cursor_getNumTemplateArguments; - /// Retrieve the completion string associated with a particular chunk - /// within a completion string. + /// Retrieve the kind of the I'th template argument of the CXCursor C. /// - /// \param completion_string the completion string to query. + /// If the argument CXCursor does not represent a FunctionDecl, an invalid + /// template argument kind is returned. /// - /// \param chunk_number the 0-based index of the chunk in the completion string. + /// For example, for the following declaration and specialization: + /// template + /// void foo() { ... } /// - /// \returns the completion string associated with the chunk at index - /// \c chunk_number. - ffi.Pointer clang_getCompletionChunkCompletionString( - ffi.Pointer completion_string, - int chunk_number, + /// template <> + /// void foo(); + /// + /// For I = 0, 1, and 2, Type, Integral, and Integral will be returned, + /// respectively. + int clang_Cursor_getTemplateArgumentKind( + CXCursor C, + int I, ) { - return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkCompletionString, - _dart_clang_getCompletionChunkCompletionString>( - 'clang_getCompletionChunkCompletionString'))( - completion_string, - chunk_number, + return (_clang_Cursor_getTemplateArgumentKind ??= _dylib.lookupFunction< + _c_clang_Cursor_getTemplateArgumentKind, + _dart_clang_Cursor_getTemplateArgumentKind>( + 'clang_Cursor_getTemplateArgumentKind'))( + C, + I, ); } - _dart_clang_getCompletionChunkCompletionString? - _clang_getCompletionChunkCompletionString; + _dart_clang_Cursor_getTemplateArgumentKind? + _clang_Cursor_getTemplateArgumentKind; - /// Retrieve the number of chunks in the given code-completion string. - int clang_getNumCompletionChunks( - ffi.Pointer completion_string, + /// Retrieve a CXType representing the type of a TemplateArgument of a + /// function decl representing a template specialization. + /// + /// If the argument CXCursor does not represent a FunctionDecl whose I'th + /// template argument has a kind of CXTemplateArgKind_Integral, an invalid type + /// is returned. + /// + /// For example, for the following declaration and specialization: + /// template + /// void foo() { ... } + /// + /// template <> + /// void foo(); + /// + /// If called with I = 0, "float", will be returned. + /// Invalid types will be returned for I == 1 or 2. + CXType clang_Cursor_getTemplateArgumentType( + CXCursor C, + int I, ) { - return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< - _c_clang_getNumCompletionChunks, - _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( - completion_string, + return (_clang_Cursor_getTemplateArgumentType ??= _dylib.lookupFunction< + _c_clang_Cursor_getTemplateArgumentType, + _dart_clang_Cursor_getTemplateArgumentType>( + 'clang_Cursor_getTemplateArgumentType'))( + C, + I, ); } - _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; + _dart_clang_Cursor_getTemplateArgumentType? + _clang_Cursor_getTemplateArgumentType; - /// Determine the priority of this code completion. + /// Retrieve the value of an Integral TemplateArgument (of a function + /// decl representing a template specialization) as a signed long long. /// - /// The priority of a code completion indicates how likely it is that this - /// particular completion is the completion that the user will select. The - /// priority is selected by various internal heuristics. + /// It is undefined to call this function on a CXCursor that does not represent a + /// FunctionDecl or whose I'th template argument is not an integral value. /// - /// \param completion_string The completion string to query. + /// For example, for the following declaration and specialization: + /// template + /// void foo() { ... } /// - /// \returns The priority of this completion string. Smaller values indicate - /// higher-priority (more likely) completions. - int clang_getCompletionPriority( - ffi.Pointer completion_string, + /// template <> + /// void foo(); + /// + /// If called with I = 1 or 2, -7 or true will be returned, respectively. + /// For I == 0, this function's behavior is undefined. + int clang_Cursor_getTemplateArgumentValue( + CXCursor C, + int I, ) { - return (_clang_getCompletionPriority ??= _dylib.lookupFunction< - _c_clang_getCompletionPriority, - _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( - completion_string, + return (_clang_Cursor_getTemplateArgumentValue ??= _dylib.lookupFunction< + _c_clang_Cursor_getTemplateArgumentValue, + _dart_clang_Cursor_getTemplateArgumentValue>( + 'clang_Cursor_getTemplateArgumentValue'))( + C, + I, ); } - _dart_clang_getCompletionPriority? _clang_getCompletionPriority; + _dart_clang_Cursor_getTemplateArgumentValue? + _clang_Cursor_getTemplateArgumentValue; - /// Determine the availability of the entity that this code-completion - /// string refers to. + /// Retrieve the value of an Integral TemplateArgument (of a function + /// decl representing a template specialization) as an unsigned long long. /// - /// \param completion_string The completion string to query. + /// It is undefined to call this function on a CXCursor that does not represent a + /// FunctionDecl or whose I'th template argument is not an integral value. /// - /// \returns The availability of the completion string. - int clang_getCompletionAvailability( - ffi.Pointer completion_string, + /// For example, for the following declaration and specialization: + /// template + /// void foo() { ... } + /// + /// template <> + /// void foo(); + /// + /// If called with I = 1 or 2, 2147483649 or true will be returned, respectively. + /// For I == 0, this function's behavior is undefined. + int clang_Cursor_getTemplateArgumentUnsignedValue( + CXCursor C, + int I, ) { - return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< - _c_clang_getCompletionAvailability, - _dart_clang_getCompletionAvailability>( - 'clang_getCompletionAvailability'))( - completion_string, + return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= + _dylib.lookupFunction<_c_clang_Cursor_getTemplateArgumentUnsignedValue, + _dart_clang_Cursor_getTemplateArgumentUnsignedValue>( + 'clang_Cursor_getTemplateArgumentUnsignedValue'))( + C, + I, ); } - _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; + _dart_clang_Cursor_getTemplateArgumentUnsignedValue? + _clang_Cursor_getTemplateArgumentUnsignedValue; - /// Retrieve the number of annotations associated with the given - /// completion string. + /// Determine whether two CXTypes represent the same type. /// - /// \param completion_string the completion string to query. - /// - /// \returns the number of annotations associated with the given completion - /// string. - int clang_getCompletionNumAnnotations( - ffi.Pointer completion_string, + /// \returns non-zero if the CXTypes represent the same type and + /// zero otherwise. + int clang_equalTypes( + CXType A, + CXType B, ) { - return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< - _c_clang_getCompletionNumAnnotations, - _dart_clang_getCompletionNumAnnotations>( - 'clang_getCompletionNumAnnotations'))( - completion_string, + return (_clang_equalTypes ??= + _dylib.lookupFunction<_c_clang_equalTypes, _dart_clang_equalTypes>( + 'clang_equalTypes'))( + A, + B, ); } - _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; + _dart_clang_equalTypes? _clang_equalTypes; - /// Retrieve the number of fix-its for the given completion index. - /// - /// Calling this makes sense only if CXCodeComplete_IncludeCompletionsWithFixIts - /// option was set. - /// - /// \param results The structure keeping all completion results - /// - /// \param completion_index The index of the completion + /// Return the canonical type for a CXType. /// - /// \return The number of fix-its which must be applied before the completion at - /// completion_index can be applied - int clang_getCompletionNumFixIts( - ffi.Pointer results, - int completion_index, + /// Clang's type system explicitly models typedefs and all the ways + /// a specific type can be represented. The canonical type is the underlying + /// type with all the "sugar" removed. For example, if 'T' is a typedef + /// for 'int', the canonical type for 'T' would be 'int'. + CXType clang_getCanonicalType( + CXType T, ) { - return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< - _c_clang_getCompletionNumFixIts, - _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( - results, - completion_index, + return (_clang_getCanonicalType ??= _dylib.lookupFunction< + _c_clang_getCanonicalType, + _dart_clang_getCanonicalType>('clang_getCanonicalType'))( + T, ); } - _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; + _dart_clang_getCanonicalType? _clang_getCanonicalType; - /// Returns a default set of code-completion options that can be - /// passed to\c clang_codeCompleteAt(). - int clang_defaultCodeCompleteOptions() { - return (_clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< - _c_clang_defaultCodeCompleteOptions, - _dart_clang_defaultCodeCompleteOptions>( - 'clang_defaultCodeCompleteOptions'))(); + /// Determine whether a CXType has the "const" qualifier set, + /// without looking through typedefs that may have added "const" at a + /// different level. + int clang_isConstQualifiedType( + CXType T, + ) { + return (_clang_isConstQualifiedType ??= _dylib.lookupFunction< + _c_clang_isConstQualifiedType, + _dart_clang_isConstQualifiedType>('clang_isConstQualifiedType'))( + T, + ); } - _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; + _dart_clang_isConstQualifiedType? _clang_isConstQualifiedType; - /// Perform code completion at a given location in a translation unit. + /// Determine whether a CXCursor that is a macro, is + /// function like. + int clang_Cursor_isMacroFunctionLike( + CXCursor C, + ) { + return (_clang_Cursor_isMacroFunctionLike ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroFunctionLike, + _dart_clang_Cursor_isMacroFunctionLike>( + 'clang_Cursor_isMacroFunctionLike'))( + C, + ); + } + + _dart_clang_Cursor_isMacroFunctionLike? _clang_Cursor_isMacroFunctionLike; + + /// Determine whether a CXCursor that is a macro, is a + /// builtin one. + int clang_Cursor_isMacroBuiltin( + CXCursor C, + ) { + return (_clang_Cursor_isMacroBuiltin ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroBuiltin, + _dart_clang_Cursor_isMacroBuiltin>('clang_Cursor_isMacroBuiltin'))( + C, + ); + } + + _dart_clang_Cursor_isMacroBuiltin? _clang_Cursor_isMacroBuiltin; + + /// Determine whether a CXCursor that is a function declaration, is an + /// inline declaration. + int clang_Cursor_isFunctionInlined( + CXCursor C, + ) { + return (_clang_Cursor_isFunctionInlined ??= _dylib.lookupFunction< + _c_clang_Cursor_isFunctionInlined, + _dart_clang_Cursor_isFunctionInlined>( + 'clang_Cursor_isFunctionInlined'))( + C, + ); + } + + _dart_clang_Cursor_isFunctionInlined? _clang_Cursor_isFunctionInlined; + + /// Determine whether a CXType has the "volatile" qualifier set, + /// without looking through typedefs that may have added "volatile" at + /// a different level. + int clang_isVolatileQualifiedType( + CXType T, + ) { + return (_clang_isVolatileQualifiedType ??= _dylib.lookupFunction< + _c_clang_isVolatileQualifiedType, + _dart_clang_isVolatileQualifiedType>('clang_isVolatileQualifiedType'))( + T, + ); + } + + _dart_clang_isVolatileQualifiedType? _clang_isVolatileQualifiedType; + + /// Determine whether a CXType has the "restrict" qualifier set, + /// without looking through typedefs that may have added "restrict" at a + /// different level. + int clang_isRestrictQualifiedType( + CXType T, + ) { + return (_clang_isRestrictQualifiedType ??= _dylib.lookupFunction< + _c_clang_isRestrictQualifiedType, + _dart_clang_isRestrictQualifiedType>('clang_isRestrictQualifiedType'))( + T, + ); + } + + _dart_clang_isRestrictQualifiedType? _clang_isRestrictQualifiedType; + + /// Returns the address space of the given type. + int clang_getAddressSpace( + CXType T, + ) { + return (_clang_getAddressSpace ??= _dylib.lookupFunction< + _c_clang_getAddressSpace, + _dart_clang_getAddressSpace>('clang_getAddressSpace'))( + T, + ); + } + + _dart_clang_getAddressSpace? _clang_getAddressSpace; + + /// Returns the typedef name of the given type. + CXString clang_getTypedefName( + CXType CT, + ) { + return (_clang_getTypedefName ??= _dylib.lookupFunction< + _c_clang_getTypedefName, + _dart_clang_getTypedefName>('clang_getTypedefName'))( + CT, + ); + } + + _dart_clang_getTypedefName? _clang_getTypedefName; + + /// For pointer types, returns the type of the pointee. + CXType clang_getPointeeType( + CXType T, + ) { + return (_clang_getPointeeType ??= _dylib.lookupFunction< + _c_clang_getPointeeType, + _dart_clang_getPointeeType>('clang_getPointeeType'))( + T, + ); + } + + _dart_clang_getPointeeType? _clang_getPointeeType; + + /// Return the cursor for the declaration of the given type. + CXCursor clang_getTypeDeclaration( + CXType T, + ) { + return (_clang_getTypeDeclaration ??= _dylib.lookupFunction< + _c_clang_getTypeDeclaration, + _dart_clang_getTypeDeclaration>('clang_getTypeDeclaration'))( + T, + ); + } + + _dart_clang_getTypeDeclaration? _clang_getTypeDeclaration; + + /// Returns the Objective-C type encoding for the specified declaration. + CXString clang_getDeclObjCTypeEncoding( + CXCursor C, + ) { + return (_clang_getDeclObjCTypeEncoding ??= _dylib.lookupFunction< + _c_clang_getDeclObjCTypeEncoding, + _dart_clang_getDeclObjCTypeEncoding>('clang_getDeclObjCTypeEncoding'))( + C, + ); + } + + _dart_clang_getDeclObjCTypeEncoding? _clang_getDeclObjCTypeEncoding; + + /// Returns the Objective-C type encoding for the specified CXType. + CXString clang_Type_getObjCEncoding( + CXType type, + ) { + return (_clang_Type_getObjCEncoding ??= _dylib.lookupFunction< + _c_clang_Type_getObjCEncoding, + _dart_clang_Type_getObjCEncoding>('clang_Type_getObjCEncoding'))( + type, + ); + } + + _dart_clang_Type_getObjCEncoding? _clang_Type_getObjCEncoding; + + /// Retrieve the spelling of a given CXTypeKind. + CXString clang_getTypeKindSpelling( + int K, + ) { + return (_clang_getTypeKindSpelling ??= _dylib.lookupFunction< + _c_clang_getTypeKindSpelling, + _dart_clang_getTypeKindSpelling>('clang_getTypeKindSpelling'))( + K, + ); + } + + _dart_clang_getTypeKindSpelling? _clang_getTypeKindSpelling; + + /// Retrieve the calling convention associated with a function type. /// - /// This function performs code completion at a particular file, line, and - /// column within source code, providing results that suggest potential - /// code snippets based on the context of the completion. The basic model - /// for code completion is that Clang will parse a complete source file, - /// performing syntax checking up to the location where code-completion has - /// been requested. At that point, a special code-completion token is passed - /// to the parser, which recognizes this token and determines, based on the - /// current location in the C/Objective-C/C++ grammar and the state of - /// semantic analysis, what completions to provide. These completions are - /// returned via a new \c CXCodeCompleteResults structure. - /// - /// Code completion itself is meant to be triggered by the client when the - /// user types punctuation characters or whitespace, at which point the - /// code-completion location will coincide with the cursor. For example, if \c p - /// is a pointer, code-completion might be triggered after the "-" and then - /// after the ">" in \c p->. When the code-completion location is after the ">", - /// the completion results will provide, e.g., the members of the struct that - /// "p" points to. The client is responsible for placing the cursor at the - /// beginning of the token currently being typed, then filtering the results - /// based on the contents of the token. For example, when code-completing for - /// the expression \c p->get, the client should provide the location just after - /// the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the - /// client can filter the results based on the current token text ("get"), only - /// showing those results that start with "get". The intent of this interface - /// is to separate the relatively high-latency acquisition of code-completion - /// results from the filtering of results on a per-character basis, which must - /// have a lower latency. - /// - /// \param TU The translation unit in which code-completion should - /// occur. The source files for this translation unit need not be - /// completely up-to-date (and the contents of those source files may - /// be overridden via \p unsaved_files). Cursors referring into the - /// translation unit may be invalidated by this invocation. - /// - /// \param complete_filename The name of the source file where code - /// completion should be performed. This filename may be any file - /// included in the translation unit. - /// - /// \param complete_line The line at which code-completion should occur. - /// - /// \param complete_column The column at which code-completion should occur. - /// Note that the column should point just after the syntactic construct that - /// initiated code completion, and not in the middle of a lexical token. - /// - /// \param unsaved_files the Files that have not yet been saved to disk - /// but may be required for parsing or code completion, including the - /// contents of those files. The contents and name of these files (as - /// specified by CXUnsavedFile) are copied when necessary, so the - /// client only needs to guarantee their validity until the call to - /// this function returns. - /// - /// \param num_unsaved_files The number of unsaved file entries in \p - /// unsaved_files. - /// - /// \param options Extra options that control the behavior of code - /// completion, expressed as a bitwise OR of the enumerators of the - /// CXCodeComplete_Flags enumeration. The - /// \c clang_defaultCodeCompleteOptions() function returns a default set - /// of code-completion options. - /// - /// \returns If successful, a new \c CXCodeCompleteResults structure - /// containing code-completion results, which should eventually be - /// freed with \c clang_disposeCodeCompleteResults(). If code - /// completion fails, returns NULL. - ffi.Pointer clang_codeCompleteAt( - ffi.Pointer TU, - ffi.Pointer complete_filename, - int complete_line, - int complete_column, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, + /// If a non-function type is passed in, CXCallingConv_Invalid is returned. + int clang_getFunctionTypeCallingConv( + CXType T, ) { - return (_clang_codeCompleteAt ??= _dylib.lookupFunction< - _c_clang_codeCompleteAt, - _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( - TU, - complete_filename, - complete_line, - complete_column, - unsaved_files, - num_unsaved_files, - options, + return (_clang_getFunctionTypeCallingConv ??= _dylib.lookupFunction< + _c_clang_getFunctionTypeCallingConv, + _dart_clang_getFunctionTypeCallingConv>( + 'clang_getFunctionTypeCallingConv'))( + T, ); } - _dart_clang_codeCompleteAt? _clang_codeCompleteAt; + _dart_clang_getFunctionTypeCallingConv? _clang_getFunctionTypeCallingConv; - /// Sort the code-completion results in case-insensitive alphabetical - /// order. + /// Retrieve the return type associated with a function type. /// - /// \param Results The set of results to sort. - /// \param NumResults The number of results in \p Results. - void clang_sortCodeCompletionResults( - ffi.Pointer Results, - int NumResults, + /// If a non-function type is passed in, an invalid type is returned. + CXType clang_getResultType( + CXType T, ) { - return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< - _c_clang_sortCodeCompletionResults, - _dart_clang_sortCodeCompletionResults>( - 'clang_sortCodeCompletionResults'))( - Results, - NumResults, + return (_clang_getResultType ??= _dylib.lookupFunction< + _c_clang_getResultType, + _dart_clang_getResultType>('clang_getResultType'))( + T, ); } - _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; + _dart_clang_getResultType? _clang_getResultType; - /// Free the given set of code-completion results. - void clang_disposeCodeCompleteResults( - ffi.Pointer Results, + /// Retrieve the exception specification type associated with a function type. + /// This is a value of type CXCursor_ExceptionSpecificationKind. + /// + /// If a non-function type is passed in, an error code of -1 is returned. + int clang_getExceptionSpecificationType( + CXType T, ) { - return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< - _c_clang_disposeCodeCompleteResults, - _dart_clang_disposeCodeCompleteResults>( - 'clang_disposeCodeCompleteResults'))( - Results, + return (_clang_getExceptionSpecificationType ??= _dylib.lookupFunction< + _c_clang_getExceptionSpecificationType, + _dart_clang_getExceptionSpecificationType>( + 'clang_getExceptionSpecificationType'))( + T, ); } - _dart_clang_disposeCodeCompleteResults? _clang_disposeCodeCompleteResults; + _dart_clang_getExceptionSpecificationType? + _clang_getExceptionSpecificationType; - /// Determine the number of diagnostics produced prior to the - /// location where code completion was performed. - int clang_codeCompleteGetNumDiagnostics( - ffi.Pointer Results, + /// Retrieve the number of non-variadic parameters associated with a + /// function type. + /// + /// If a non-function type is passed in, -1 is returned. + int clang_getNumArgTypes( + CXType T, ) { - return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetNumDiagnostics, - _dart_clang_codeCompleteGetNumDiagnostics>( - 'clang_codeCompleteGetNumDiagnostics'))( - Results, + return (_clang_getNumArgTypes ??= _dylib.lookupFunction< + _c_clang_getNumArgTypes, + _dart_clang_getNumArgTypes>('clang_getNumArgTypes'))( + T, ); } - _dart_clang_codeCompleteGetNumDiagnostics? - _clang_codeCompleteGetNumDiagnostics; + _dart_clang_getNumArgTypes? _clang_getNumArgTypes; - /// Retrieve a diagnostic associated with the given code completion. - /// - /// \param Results the code completion results to query. - /// \param Index the zero-based diagnostic number to retrieve. + /// Retrieve the type of a parameter of a function type. /// - /// \returns the requested diagnostic. This diagnostic must be freed - /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_codeCompleteGetDiagnostic( - ffi.Pointer Results, - int Index, + /// If a non-function type is passed in or the function does not have enough + /// parameters, an invalid type is returned. + CXType clang_getArgType( + CXType T, + int i, ) { - return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetDiagnostic, - _dart_clang_codeCompleteGetDiagnostic>( - 'clang_codeCompleteGetDiagnostic'))( - Results, - Index, + return (_clang_getArgType ??= + _dylib.lookupFunction<_c_clang_getArgType, _dart_clang_getArgType>( + 'clang_getArgType'))( + T, + i, ); } - _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; + _dart_clang_getArgType? _clang_getArgType; - /// Determines what completions are appropriate for the context - /// the given code completion. - /// - /// \param Results the code completion results to query + /// Retrieves the base type of the ObjCObjectType. /// - /// \returns the kinds of completions that are appropriate for use - /// along with the given code completion results. - int clang_codeCompleteGetContexts( - ffi.Pointer Results, + /// If the type is not an ObjC object, an invalid type is returned. + CXType clang_Type_getObjCObjectBaseType( + CXType T, ) { - return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContexts, - _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( - Results, + return (_clang_Type_getObjCObjectBaseType ??= _dylib.lookupFunction< + _c_clang_Type_getObjCObjectBaseType, + _dart_clang_Type_getObjCObjectBaseType>( + 'clang_Type_getObjCObjectBaseType'))( + T, ); } - _dart_clang_codeCompleteGetContexts? _clang_codeCompleteGetContexts; + _dart_clang_Type_getObjCObjectBaseType? _clang_Type_getObjCObjectBaseType; - /// Returns the cursor kind for the container for the current code - /// completion context. The container is only guaranteed to be set for - /// contexts where a container exists (i.e. member accesses or Objective-C - /// message sends); if there is not a container, this function will return - /// CXCursor_InvalidCode. - /// - /// \param Results the code completion results to query + /// Retrieve the number of protocol references associated with an ObjC object/id. /// - /// \param IsIncomplete on return, this value will be false if Clang has complete - /// information about the container. If Clang does not have complete - /// information, this value will be true. + /// If the type is not an ObjC object, 0 is returned. + int clang_Type_getNumObjCProtocolRefs( + CXType T, + ) { + return (_clang_Type_getNumObjCProtocolRefs ??= _dylib.lookupFunction< + _c_clang_Type_getNumObjCProtocolRefs, + _dart_clang_Type_getNumObjCProtocolRefs>( + 'clang_Type_getNumObjCProtocolRefs'))( + T, + ); + } + + _dart_clang_Type_getNumObjCProtocolRefs? _clang_Type_getNumObjCProtocolRefs; + + /// Retrieve the decl for a protocol reference for an ObjC object/id. /// - /// \returns the container kind, or CXCursor_InvalidCode if there is not a - /// container - int clang_codeCompleteGetContainerKind( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, + /// If the type is not an ObjC object or there are not enough protocol + /// references, an invalid cursor is returned. + CXCursor clang_Type_getObjCProtocolDecl( + CXType T, + int i, ) { - return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContainerKind, - _dart_clang_codeCompleteGetContainerKind>( - 'clang_codeCompleteGetContainerKind'))( - Results, - IsIncomplete, + return (_clang_Type_getObjCProtocolDecl ??= _dylib.lookupFunction< + _c_clang_Type_getObjCProtocolDecl, + _dart_clang_Type_getObjCProtocolDecl>( + 'clang_Type_getObjCProtocolDecl'))( + T, + i, ); } - _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; + _dart_clang_Type_getObjCProtocolDecl? _clang_Type_getObjCProtocolDecl; - /// Enable/disable crash recovery. + /// Retreive the number of type arguments associated with an ObjC object. /// - /// \param isEnabled Flag to indicate if crash recovery is enabled. A non-zero - /// value enables crash recovery, while 0 disables it. - void clang_toggleCrashRecovery( - int isEnabled, + /// If the type is not an ObjC object, 0 is returned. + int clang_Type_getNumObjCTypeArgs( + CXType T, ) { - return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< - _c_clang_toggleCrashRecovery, - _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( - isEnabled, + return (_clang_Type_getNumObjCTypeArgs ??= _dylib.lookupFunction< + _c_clang_Type_getNumObjCTypeArgs, + _dart_clang_Type_getNumObjCTypeArgs>('clang_Type_getNumObjCTypeArgs'))( + T, ); } - _dart_clang_toggleCrashRecovery? _clang_toggleCrashRecovery; + _dart_clang_Type_getNumObjCTypeArgs? _clang_Type_getNumObjCTypeArgs; - /// Visit the set of preprocessor inclusions in a translation unit. - /// The visitor function is called with the provided data for every included - /// file. This does not include headers included by the PCH file (unless one - /// is inspecting the inclusions in the PCH file itself). - void clang_getInclusions( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, + /// Retrieve a type argument associated with an ObjC object. + /// + /// If the type is not an ObjC or the index is not valid, + /// an invalid type is returned. + CXType clang_Type_getObjCTypeArg( + CXType T, + int i, ) { - return (_clang_getInclusions ??= _dylib.lookupFunction< - _c_clang_getInclusions, - _dart_clang_getInclusions>('clang_getInclusions'))( - tu, - visitor, - client_data, + return (_clang_Type_getObjCTypeArg ??= _dylib.lookupFunction< + _c_clang_Type_getObjCTypeArg, + _dart_clang_Type_getObjCTypeArg>('clang_Type_getObjCTypeArg'))( + T, + i, ); } - _dart_clang_getInclusions? _clang_getInclusions; + _dart_clang_Type_getObjCTypeArg? _clang_Type_getObjCTypeArg; - /// Returns the kind of the evaluated result. - int clang_EvalResult_getKind( - ffi.Pointer E, + /// Return 1 if the CXType is a variadic function type, and 0 otherwise. + int clang_isFunctionTypeVariadic( + CXType T, ) { - return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< - _c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( - E, + return (_clang_isFunctionTypeVariadic ??= _dylib.lookupFunction< + _c_clang_isFunctionTypeVariadic, + _dart_clang_isFunctionTypeVariadic>('clang_isFunctionTypeVariadic'))( + T, ); } - _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; + _dart_clang_isFunctionTypeVariadic? _clang_isFunctionTypeVariadic; - /// Returns the evaluation result as integer if the - /// kind is Int. - int clang_EvalResult_getAsInt( - ffi.Pointer E, + /// Retrieve the return type associated with a given cursor. + /// + /// This only returns a valid type if the cursor refers to a function or method. + CXType clang_getCursorResultType( + CXCursor C, ) { - return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsInt, - _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( - E, + return (_clang_getCursorResultType ??= _dylib.lookupFunction< + _c_clang_getCursorResultType, + _dart_clang_getCursorResultType>('clang_getCursorResultType'))( + C, ); } - _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; + _dart_clang_getCursorResultType? _clang_getCursorResultType; - /// Returns the evaluation result as a long long integer if the - /// kind is Int. This prevents overflows that may happen if the result is - /// returned with clang_EvalResult_getAsInt. - int clang_EvalResult_getAsLongLong( - ffi.Pointer E, + /// Retrieve the exception specification type associated with a given cursor. + /// This is a value of type CXCursor_ExceptionSpecificationKind. + /// + /// This only returns a valid result if the cursor refers to a function or method. + int clang_getCursorExceptionSpecificationType( + CXCursor C, ) { - return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>( - 'clang_EvalResult_getAsLongLong'))( - E, + return (_clang_getCursorExceptionSpecificationType ??= + _dylib.lookupFunction<_c_clang_getCursorExceptionSpecificationType, + _dart_clang_getCursorExceptionSpecificationType>( + 'clang_getCursorExceptionSpecificationType'))( + C, ); } - _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; + _dart_clang_getCursorExceptionSpecificationType? + _clang_getCursorExceptionSpecificationType; - /// Returns a non-zero value if the kind is Int and the evaluation - /// result resulted in an unsigned integer. - int clang_EvalResult_isUnsignedInt( - ffi.Pointer E, + /// Return 1 if the CXType is a POD (plain old data) type, and 0 + /// otherwise. + int clang_isPODType( + CXType T, ) { - return (_clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_isUnsignedInt, - _dart_clang_EvalResult_isUnsignedInt>( - 'clang_EvalResult_isUnsignedInt'))( - E, + return (_clang_isPODType ??= + _dylib.lookupFunction<_c_clang_isPODType, _dart_clang_isPODType>( + 'clang_isPODType'))( + T, ); } - _dart_clang_EvalResult_isUnsignedInt? _clang_EvalResult_isUnsignedInt; + _dart_clang_isPODType? _clang_isPODType; - /// Returns the evaluation result as an unsigned integer if - /// the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. - int clang_EvalResult_getAsUnsigned( - ffi.Pointer E, + /// Return the element type of an array, complex, or vector type. + /// + /// If a type is passed in that is not an array, complex, or vector type, + /// an invalid type is returned. + CXType clang_getElementType( + CXType T, ) { - return (_clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsUnsigned, - _dart_clang_EvalResult_getAsUnsigned>( - 'clang_EvalResult_getAsUnsigned'))( - E, + return (_clang_getElementType ??= _dylib.lookupFunction< + _c_clang_getElementType, + _dart_clang_getElementType>('clang_getElementType'))( + T, ); } - _dart_clang_EvalResult_getAsUnsigned? _clang_EvalResult_getAsUnsigned; + _dart_clang_getElementType? _clang_getElementType; - /// Returns the evaluation result as double if the - /// kind is double. - double clang_EvalResult_getAsDouble( - ffi.Pointer E, + /// Return the number of elements of an array or vector type. + /// + /// If a type is passed in that is not an array or vector type, + /// -1 is returned. + int clang_getNumElements( + CXType T, ) { - return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( - E, + return (_clang_getNumElements ??= _dylib.lookupFunction< + _c_clang_getNumElements, + _dart_clang_getNumElements>('clang_getNumElements'))( + T, ); } - _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; + _dart_clang_getNumElements? _clang_getNumElements; - /// Returns the evaluation result as a constant string if the - /// kind is other than Int or float. User must not free this pointer, - /// instead call clang_EvalResult_dispose on the CXEvalResult returned - /// by clang_Cursor_Evaluate. - ffi.Pointer clang_EvalResult_getAsStr( - ffi.Pointer E, + /// Return the element type of an array type. + /// + /// If a non-array type is passed in, an invalid type is returned. + CXType clang_getArrayElementType( + CXType T, ) { - return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsStr, - _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( - E, + return (_clang_getArrayElementType ??= _dylib.lookupFunction< + _c_clang_getArrayElementType, + _dart_clang_getArrayElementType>('clang_getArrayElementType'))( + T, ); } - _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; + _dart_clang_getArrayElementType? _clang_getArrayElementType; - /// Disposes the created Eval memory. - void clang_EvalResult_dispose( - ffi.Pointer E, + /// Return the array size of a constant array. + /// + /// If a non-array type is passed in, -1 is returned. + int clang_getArraySize( + CXType T, ) { - return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< - _c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( - E, + return (_clang_getArraySize ??= + _dylib.lookupFunction<_c_clang_getArraySize, _dart_clang_getArraySize>( + 'clang_getArraySize'))( + T, ); } - _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; + _dart_clang_getArraySize? _clang_getArraySize; - /// Retrieve a remapping. - /// - /// \param path the path that contains metadata about remappings. + /// Retrieve the type named by the qualified-id. /// - /// \returns the requested remapping. This remapping must be freed - /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. - ffi.Pointer clang_getRemappings( - ffi.Pointer path, + /// If a non-elaborated type is passed in, an invalid type is returned. + CXType clang_Type_getNamedType( + CXType T, ) { - return (_clang_getRemappings ??= _dylib.lookupFunction< - _c_clang_getRemappings, - _dart_clang_getRemappings>('clang_getRemappings'))( - path, + return (_clang_Type_getNamedType ??= _dylib.lookupFunction< + _c_clang_Type_getNamedType, + _dart_clang_Type_getNamedType>('clang_Type_getNamedType'))( + T, ); } - _dart_clang_getRemappings? _clang_getRemappings; + _dart_clang_Type_getNamedType? _clang_Type_getNamedType; - /// Retrieve a remapping. - /// - /// \param filePaths pointer to an array of file paths containing remapping info. + /// Determine if a typedef is 'transparent' tag. /// - /// \param numFiles number of file paths. + /// A typedef is considered 'transparent' if it shares a name and spelling + /// location with its underlying tag type, as is the case with the NS_ENUM macro. /// - /// \returns the requested remapping. This remapping must be freed - /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. - ffi.Pointer clang_getRemappingsFromFileList( - ffi.Pointer> filePaths, - int numFiles, + /// \returns non-zero if transparent and zero otherwise. + int clang_Type_isTransparentTagTypedef( + CXType T, ) { - return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< - _c_clang_getRemappingsFromFileList, - _dart_clang_getRemappingsFromFileList>( - 'clang_getRemappingsFromFileList'))( - filePaths, - numFiles, + return (_clang_Type_isTransparentTagTypedef ??= _dylib.lookupFunction< + _c_clang_Type_isTransparentTagTypedef, + _dart_clang_Type_isTransparentTagTypedef>( + 'clang_Type_isTransparentTagTypedef'))( + T, ); } - _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; + _dart_clang_Type_isTransparentTagTypedef? _clang_Type_isTransparentTagTypedef; - /// Determine the number of remappings. - int clang_remap_getNumFiles( - ffi.Pointer arg0, + /// Retrieve the nullability kind of a pointer type. + int clang_Type_getNullability( + CXType T, ) { - return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< - _c_clang_remap_getNumFiles, - _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( - arg0, + return (_clang_Type_getNullability ??= _dylib.lookupFunction< + _c_clang_Type_getNullability, + _dart_clang_Type_getNullability>('clang_Type_getNullability'))( + T, ); } - _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; + _dart_clang_Type_getNullability? _clang_Type_getNullability; - /// Get the original and the associated filename from the remapping. + /// Return the alignment of a type in bytes as per C++[expr.alignof] + /// standard. /// - /// \param original If non-NULL, will be set to the original filename. + /// If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. + /// If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete + /// is returned. + /// If the type declaration is a dependent type, CXTypeLayoutError_Dependent is + /// returned. + /// If the type declaration is not a constant size type, + /// CXTypeLayoutError_NotConstantSize is returned. + int clang_Type_getAlignOf( + CXType T, + ) { + return (_clang_Type_getAlignOf ??= _dylib.lookupFunction< + _c_clang_Type_getAlignOf, + _dart_clang_Type_getAlignOf>('clang_Type_getAlignOf'))( + T, + ); + } + + _dart_clang_Type_getAlignOf? _clang_Type_getAlignOf; + + /// Return the class type of an member pointer type. /// - /// \param transformed If non-NULL, will be set to the filename that the original - /// is associated with. - void clang_remap_getFilenames( - ffi.Pointer arg0, - int index, - ffi.Pointer original, - ffi.Pointer transformed, + /// If a non-member-pointer type is passed in, an invalid type is returned. + CXType clang_Type_getClassType( + CXType T, ) { - return (_clang_remap_getFilenames ??= _dylib.lookupFunction< - _c_clang_remap_getFilenames, - _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( - arg0, - index, - original, - transformed, + return (_clang_Type_getClassType ??= _dylib.lookupFunction< + _c_clang_Type_getClassType, + _dart_clang_Type_getClassType>('clang_Type_getClassType'))( + T, ); } - _dart_clang_remap_getFilenames? _clang_remap_getFilenames; + _dart_clang_Type_getClassType? _clang_Type_getClassType; - /// Dispose the remapping. - void clang_remap_dispose( - ffi.Pointer arg0, + /// Return the size of a type in bytes as per C++[expr.sizeof] standard. + /// + /// If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. + /// If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete + /// is returned. + /// If the type declaration is a dependent type, CXTypeLayoutError_Dependent is + /// returned. + int clang_Type_getSizeOf( + CXType T, ) { - return (_clang_remap_dispose ??= _dylib.lookupFunction< - _c_clang_remap_dispose, - _dart_clang_remap_dispose>('clang_remap_dispose'))( - arg0, + return (_clang_Type_getSizeOf ??= _dylib.lookupFunction< + _c_clang_Type_getSizeOf, + _dart_clang_Type_getSizeOf>('clang_Type_getSizeOf'))( + T, ); } - _dart_clang_remap_dispose? _clang_remap_dispose; + _dart_clang_Type_getSizeOf? _clang_Type_getSizeOf; - int clang_index_isEntityObjCContainerKind( - int arg0, + /// Return the offset of a field named S in a record of type T in bits + /// as it would be returned by __offsetof__ as per C++11[18.2p4] + /// + /// If the cursor is not a record field declaration, CXTypeLayoutError_Invalid + /// is returned. + /// If the field's type declaration is an incomplete type, + /// CXTypeLayoutError_Incomplete is returned. + /// If the field's type declaration is a dependent type, + /// CXTypeLayoutError_Dependent is returned. + /// If the field's name S is not found, + /// CXTypeLayoutError_InvalidFieldName is returned. + int clang_Type_getOffsetOf( + CXType T, + ffi.Pointer S, ) { - return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< - _c_clang_index_isEntityObjCContainerKind, - _dart_clang_index_isEntityObjCContainerKind>( - 'clang_index_isEntityObjCContainerKind'))( - arg0, + return (_clang_Type_getOffsetOf ??= _dylib.lookupFunction< + _c_clang_Type_getOffsetOf, + _dart_clang_Type_getOffsetOf>('clang_Type_getOffsetOf'))( + T, + S, ); } - _dart_clang_index_isEntityObjCContainerKind? - _clang_index_isEntityObjCContainerKind; + _dart_clang_Type_getOffsetOf? _clang_Type_getOffsetOf; - ffi.Pointer clang_index_getObjCContainerDeclInfo( - ffi.Pointer arg0, + /// Return the type that was modified by this attributed type. + /// + /// If the type is not an attributed type, an invalid type is returned. + CXType clang_Type_getModifiedType( + CXType T, ) { - return (_clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCContainerDeclInfo, - _dart_clang_index_getObjCContainerDeclInfo>( - 'clang_index_getObjCContainerDeclInfo'))( - arg0, + return (_clang_Type_getModifiedType ??= _dylib.lookupFunction< + _c_clang_Type_getModifiedType, + _dart_clang_Type_getModifiedType>('clang_Type_getModifiedType'))( + T, ); } - _dart_clang_index_getObjCContainerDeclInfo? - _clang_index_getObjCContainerDeclInfo; + _dart_clang_Type_getModifiedType? _clang_Type_getModifiedType; - ffi.Pointer clang_index_getObjCInterfaceDeclInfo( - ffi.Pointer arg0, + /// Return the offset of the field represented by the Cursor. + /// + /// If the cursor is not a field declaration, -1 is returned. + /// If the cursor semantic parent is not a record field declaration, + /// CXTypeLayoutError_Invalid is returned. + /// If the field's type declaration is an incomplete type, + /// CXTypeLayoutError_Incomplete is returned. + /// If the field's type declaration is a dependent type, + /// CXTypeLayoutError_Dependent is returned. + /// If the field's name S is not found, + /// CXTypeLayoutError_InvalidFieldName is returned. + int clang_Cursor_getOffsetOfField( + CXCursor C, ) { - return (_clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCInterfaceDeclInfo, - _dart_clang_index_getObjCInterfaceDeclInfo>( - 'clang_index_getObjCInterfaceDeclInfo'))( - arg0, + return (_clang_Cursor_getOffsetOfField ??= _dylib.lookupFunction< + _c_clang_Cursor_getOffsetOfField, + _dart_clang_Cursor_getOffsetOfField>('clang_Cursor_getOffsetOfField'))( + C, ); } - _dart_clang_index_getObjCInterfaceDeclInfo? - _clang_index_getObjCInterfaceDeclInfo; + _dart_clang_Cursor_getOffsetOfField? _clang_Cursor_getOffsetOfField; - ffi.Pointer clang_index_getObjCCategoryDeclInfo( - ffi.Pointer arg0, + /// Determine whether the given cursor represents an anonymous + /// tag or namespace + int clang_Cursor_isAnonymous( + CXCursor C, ) { - return (_clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCCategoryDeclInfo, - _dart_clang_index_getObjCCategoryDeclInfo>( - 'clang_index_getObjCCategoryDeclInfo'))( - arg0, + return (_clang_Cursor_isAnonymous ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymous, + _dart_clang_Cursor_isAnonymous>('clang_Cursor_isAnonymous'))( + C, ); } - _dart_clang_index_getObjCCategoryDeclInfo? - _clang_index_getObjCCategoryDeclInfo; + _dart_clang_Cursor_isAnonymous? _clang_Cursor_isAnonymous; - ffi.Pointer - clang_index_getObjCProtocolRefListInfo( - ffi.Pointer arg0, + /// Determine whether the given cursor represents an anonymous record + /// declaration. + int clang_Cursor_isAnonymousRecordDecl( + CXCursor C, ) { - return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCProtocolRefListInfo, - _dart_clang_index_getObjCProtocolRefListInfo>( - 'clang_index_getObjCProtocolRefListInfo'))( - arg0, + return (_clang_Cursor_isAnonymousRecordDecl ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymousRecordDecl, + _dart_clang_Cursor_isAnonymousRecordDecl>( + 'clang_Cursor_isAnonymousRecordDecl'))( + C, ); } - _dart_clang_index_getObjCProtocolRefListInfo? - _clang_index_getObjCProtocolRefListInfo; + _dart_clang_Cursor_isAnonymousRecordDecl? _clang_Cursor_isAnonymousRecordDecl; - ffi.Pointer clang_index_getObjCPropertyDeclInfo( - ffi.Pointer arg0, + /// Determine whether the given cursor represents an inline namespace + /// declaration. + int clang_Cursor_isInlineNamespace( + CXCursor C, ) { - return (_clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCPropertyDeclInfo, - _dart_clang_index_getObjCPropertyDeclInfo>( - 'clang_index_getObjCPropertyDeclInfo'))( - arg0, + return (_clang_Cursor_isInlineNamespace ??= _dylib.lookupFunction< + _c_clang_Cursor_isInlineNamespace, + _dart_clang_Cursor_isInlineNamespace>( + 'clang_Cursor_isInlineNamespace'))( + C, ); } - _dart_clang_index_getObjCPropertyDeclInfo? - _clang_index_getObjCPropertyDeclInfo; + _dart_clang_Cursor_isInlineNamespace? _clang_Cursor_isInlineNamespace; - ffi.Pointer - clang_index_getIBOutletCollectionAttrInfo( - ffi.Pointer arg0, + /// Returns the number of template arguments for given template + /// specialization, or -1 if type \c T is not a template specialization. + int clang_Type_getNumTemplateArguments( + CXType T, ) { - return (_clang_index_getIBOutletCollectionAttrInfo ??= - _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, - _dart_clang_index_getIBOutletCollectionAttrInfo>( - 'clang_index_getIBOutletCollectionAttrInfo'))( - arg0, + return (_clang_Type_getNumTemplateArguments ??= _dylib.lookupFunction< + _c_clang_Type_getNumTemplateArguments, + _dart_clang_Type_getNumTemplateArguments>( + 'clang_Type_getNumTemplateArguments'))( + T, ); } - _dart_clang_index_getIBOutletCollectionAttrInfo? - _clang_index_getIBOutletCollectionAttrInfo; + _dart_clang_Type_getNumTemplateArguments? _clang_Type_getNumTemplateArguments; - ffi.Pointer clang_index_getCXXClassDeclInfo( - ffi.Pointer arg0, + /// Returns the type template argument of a template class specialization + /// at given index. + /// + /// This function only returns template type arguments and does not handle + /// template template arguments or variadic packs. + CXType clang_Type_getTemplateArgumentAsType( + CXType T, + int i, ) { - return (_clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getCXXClassDeclInfo, - _dart_clang_index_getCXXClassDeclInfo>( - 'clang_index_getCXXClassDeclInfo'))( - arg0, + return (_clang_Type_getTemplateArgumentAsType ??= _dylib.lookupFunction< + _c_clang_Type_getTemplateArgumentAsType, + _dart_clang_Type_getTemplateArgumentAsType>( + 'clang_Type_getTemplateArgumentAsType'))( + T, + i, ); } - _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; + _dart_clang_Type_getTemplateArgumentAsType? + _clang_Type_getTemplateArgumentAsType; - /// For retrieving a custom CXIdxClientContainer attached to a - /// container. - ffi.Pointer clang_index_getClientContainer( - ffi.Pointer arg0, + /// Retrieve the ref-qualifier kind of a function or method. + /// + /// The ref-qualifier is returned for C++ functions or methods. For other types + /// or non-C++ declarations, CXRefQualifier_None is returned. + int clang_Type_getCXXRefQualifier( + CXType T, ) { - return (_clang_index_getClientContainer ??= _dylib.lookupFunction< - _c_clang_index_getClientContainer, - _dart_clang_index_getClientContainer>( - 'clang_index_getClientContainer'))( - arg0, + return (_clang_Type_getCXXRefQualifier ??= _dylib.lookupFunction< + _c_clang_Type_getCXXRefQualifier, + _dart_clang_Type_getCXXRefQualifier>('clang_Type_getCXXRefQualifier'))( + T, ); } - _dart_clang_index_getClientContainer? _clang_index_getClientContainer; + _dart_clang_Type_getCXXRefQualifier? _clang_Type_getCXXRefQualifier; - /// For setting a custom CXIdxClientContainer attached to a - /// container. - void clang_index_setClientContainer( - ffi.Pointer arg0, - ffi.Pointer arg1, + /// Returns non-zero if the cursor specifies a Record member that is a + /// bitfield. + int clang_Cursor_isBitField( + CXCursor C, ) { - return (_clang_index_setClientContainer ??= _dylib.lookupFunction< - _c_clang_index_setClientContainer, - _dart_clang_index_setClientContainer>( - 'clang_index_setClientContainer'))( - arg0, - arg1, + return (_clang_Cursor_isBitField ??= _dylib.lookupFunction< + _c_clang_Cursor_isBitField, + _dart_clang_Cursor_isBitField>('clang_Cursor_isBitField'))( + C, ); } - _dart_clang_index_setClientContainer? _clang_index_setClientContainer; + _dart_clang_Cursor_isBitField? _clang_Cursor_isBitField; - /// For retrieving a custom CXIdxClientEntity attached to an entity. - ffi.Pointer clang_index_getClientEntity( - ffi.Pointer arg0, + /// Returns 1 if the base class specified by the cursor with kind + /// CX_CXXBaseSpecifier is virtual. + int clang_isVirtualBase( + CXCursor arg0, ) { - return (_clang_index_getClientEntity ??= _dylib.lookupFunction< - _c_clang_index_getClientEntity, - _dart_clang_index_getClientEntity>('clang_index_getClientEntity'))( + return (_clang_isVirtualBase ??= _dylib.lookupFunction< + _c_clang_isVirtualBase, + _dart_clang_isVirtualBase>('clang_isVirtualBase'))( arg0, ); } - _dart_clang_index_getClientEntity? _clang_index_getClientEntity; + _dart_clang_isVirtualBase? _clang_isVirtualBase; - /// For setting a custom CXIdxClientEntity attached to an entity. - void clang_index_setClientEntity( - ffi.Pointer arg0, - ffi.Pointer arg1, + /// Returns the access control level for the referenced object. + /// + /// If the cursor refers to a C++ declaration, its access control level within its + /// parent scope is returned. Otherwise, if the cursor refers to a base specifier or + /// access specifier, the specifier itself is returned. + int clang_getCXXAccessSpecifier( + CXCursor arg0, ) { - return (_clang_index_setClientEntity ??= _dylib.lookupFunction< - _c_clang_index_setClientEntity, - _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( + return (_clang_getCXXAccessSpecifier ??= _dylib.lookupFunction< + _c_clang_getCXXAccessSpecifier, + _dart_clang_getCXXAccessSpecifier>('clang_getCXXAccessSpecifier'))( arg0, - arg1, ); } - _dart_clang_index_setClientEntity? _clang_index_setClientEntity; + _dart_clang_getCXXAccessSpecifier? _clang_getCXXAccessSpecifier; - /// An indexing action/session, to be applied to one or multiple - /// translation units. + /// Returns the storage class for a function or variable declaration. /// - /// \param CIdx The index object with which the index action will be associated. - ffi.Pointer clang_IndexAction_create( - ffi.Pointer CIdx, + /// If the passed in Cursor is not a function or variable declaration, + /// CX_SC_Invalid is returned else the storage class. + int clang_Cursor_getStorageClass( + CXCursor arg0, ) { - return (_clang_IndexAction_create ??= _dylib.lookupFunction< - _c_clang_IndexAction_create, - _dart_clang_IndexAction_create>('clang_IndexAction_create'))( - CIdx, + return (_clang_Cursor_getStorageClass ??= _dylib.lookupFunction< + _c_clang_Cursor_getStorageClass, + _dart_clang_Cursor_getStorageClass>('clang_Cursor_getStorageClass'))( + arg0, ); } - _dart_clang_IndexAction_create? _clang_IndexAction_create; + _dart_clang_Cursor_getStorageClass? _clang_Cursor_getStorageClass; - /// Destroy the given index action. + /// Determine the number of overloaded declarations referenced by a + /// \c CXCursor_OverloadedDeclRef cursor. /// - /// The index action must not be destroyed until all of the translation units - /// created within that index action have been destroyed. - void clang_IndexAction_dispose( - ffi.Pointer arg0, + /// \param cursor The cursor whose overloaded declarations are being queried. + /// + /// \returns The number of overloaded declarations referenced by \c cursor. If it + /// is not a \c CXCursor_OverloadedDeclRef cursor, returns 0. + int clang_getNumOverloadedDecls( + CXCursor cursor, ) { - return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< - _c_clang_IndexAction_dispose, - _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( - arg0, + return (_clang_getNumOverloadedDecls ??= _dylib.lookupFunction< + _c_clang_getNumOverloadedDecls, + _dart_clang_getNumOverloadedDecls>('clang_getNumOverloadedDecls'))( + cursor, ); } - _dart_clang_IndexAction_dispose? _clang_IndexAction_dispose; + _dart_clang_getNumOverloadedDecls? _clang_getNumOverloadedDecls; - /// Index the given source file and the translation unit corresponding - /// to that file via callbacks implemented through #IndexerCallbacks. + /// Retrieve a cursor for one of the overloaded declarations referenced + /// by a \c CXCursor_OverloadedDeclRef cursor. /// - /// \param client_data pointer data supplied by the client, which will - /// be passed to the invoked callbacks. + /// \param cursor The cursor whose overloaded declarations are being queried. /// - /// \param index_callbacks Pointer to indexing callbacks that the client - /// implements. + /// \param index The zero-based index into the set of overloaded declarations in + /// the cursor. /// - /// \param index_callbacks_size Size of #IndexerCallbacks structure that gets - /// passed in index_callbacks. + /// \returns A cursor representing the declaration referenced by the given + /// \c cursor at the specified \c index. If the cursor does not have an + /// associated set of overloaded declarations, or if the index is out of bounds, + /// returns \c clang_getNullCursor(); + CXCursor clang_getOverloadedDecl( + CXCursor cursor, + int index, + ) { + return (_clang_getOverloadedDecl ??= _dylib.lookupFunction< + _c_clang_getOverloadedDecl, + _dart_clang_getOverloadedDecl>('clang_getOverloadedDecl'))( + cursor, + index, + ); + } + + _dart_clang_getOverloadedDecl? _clang_getOverloadedDecl; + + /// For cursors representing an iboutletcollection attribute, + /// this function returns the collection element type. + CXType clang_getIBOutletCollectionType( + CXCursor arg0, + ) { + return (_clang_getIBOutletCollectionType ??= _dylib.lookupFunction< + _c_clang_getIBOutletCollectionType, + _dart_clang_getIBOutletCollectionType>( + 'clang_getIBOutletCollectionType'))( + arg0, + ); + } + + _dart_clang_getIBOutletCollectionType? _clang_getIBOutletCollectionType; + + /// Visit the children of a particular cursor. /// - /// \param index_options A bitmask of options that affects how indexing is - /// performed. This should be a bitwise OR of the CXIndexOpt_XXX flags. + /// This function visits all the direct children of the given cursor, + /// invoking the given \p visitor function with the cursors of each + /// visited child. The traversal may be recursive, if the visitor returns + /// \c CXChildVisit_Recurse. The traversal may also be ended prematurely, if + /// the visitor returns \c CXChildVisit_Break. /// - /// \param[out] out_TU pointer to store a \c CXTranslationUnit that can be - /// reused after indexing is finished. Set to \c NULL if you do not require it. + /// \param parent the cursor whose child may be visited. All kinds of + /// cursors can be visited, including invalid cursors (which, by + /// definition, have no children). /// - /// \returns 0 on success or if there were errors from which the compiler could - /// recover. If there is a failure from which there is no recovery, returns - /// a non-zero \c CXErrorCode. + /// \param visitor the visitor function that will be invoked for each + /// child of \p parent. /// - /// The rest of the parameters are the same as #clang_parseTranslationUnit. - int clang_indexSourceFile( - ffi.Pointer arg0, + /// \param client_data pointer data supplied by the client, which will + /// be passed to the visitor each time it is invoked. + /// + /// \returns a non-zero value if the traversal was terminated + /// prematurely by the visitor returning \c CXChildVisit_Break. + int clang_visitChildren( + CXCursor parent, + ffi.Pointer> visitor, ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, ) { - return (_clang_indexSourceFile ??= _dylib.lookupFunction< - _c_clang_indexSourceFile, - _dart_clang_indexSourceFile>('clang_indexSourceFile'))( - arg0, + return (_clang_visitChildren ??= _dylib.lookupFunction< + _c_clang_visitChildren, + _dart_clang_visitChildren>('clang_visitChildren'))( + parent, + visitor, client_data, - index_callbacks, - index_callbacks_size, - index_options, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - out_TU, - TU_options, ); } - _dart_clang_indexSourceFile? _clang_indexSourceFile; + _dart_clang_visitChildren? _clang_visitChildren; - /// Same as clang_indexSourceFile but requires a full command line - /// for \c command_line_args including argv[0]. This is useful if the standard - /// library paths are relative to the binary. - int clang_indexSourceFileFullArgv( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, + /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced + /// by the given cursor. + /// + /// A Unified Symbol Resolution (USR) is a string that identifies a particular + /// entity (function, class, variable, etc.) within a program. USRs can be + /// compared across translation units to determine, e.g., when references in + /// one translation refer to an entity defined in another translation unit. + CXString clang_getCursorUSR( + CXCursor arg0, ) { - return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< - _c_clang_indexSourceFileFullArgv, - _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( + return (_clang_getCursorUSR ??= + _dylib.lookupFunction<_c_clang_getCursorUSR, _dart_clang_getCursorUSR>( + 'clang_getCursorUSR'))( arg0, - client_data, - index_callbacks, - index_callbacks_size, - index_options, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - out_TU, - TU_options, ); } - _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; + _dart_clang_getCursorUSR? _clang_getCursorUSR; - /// Index the given translation unit via callbacks implemented through - /// #IndexerCallbacks. - /// - /// The order of callback invocations is not guaranteed to be the same as - /// when indexing a source file. The high level order will be: - /// - /// -Preprocessor callbacks invocations - /// -Declaration/reference callbacks invocations - /// -Diagnostic callback invocations - /// - /// The parameters are the same as #clang_indexSourceFile. - /// - /// \returns If there is a failure from which there is no recovery, returns - /// non-zero, otherwise returns 0. - int clang_indexTranslationUnit( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer arg5, + /// Construct a USR for a specified Objective-C class. + CXString clang_constructUSR_ObjCClass( + ffi.Pointer class_name, ) { - return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< - _c_clang_indexTranslationUnit, - _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( - arg0, - client_data, - index_callbacks, - index_callbacks_size, - index_options, - arg5, + return (_clang_constructUSR_ObjCClass ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCClass, + _dart_clang_constructUSR_ObjCClass>('clang_constructUSR_ObjCClass'))( + class_name, ); } - _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; -} - -/// A character string. -/// -/// The \c CXString type is used to return strings from the interface when -/// the ownership of that string might differ from one call to the next. -/// Use \c clang_getCString() to retrieve the string data and, once finished -/// with the string data, call \c clang_disposeString() to free the string. -class CXString extends ffi.Struct { - external ffi.Pointer data; + _dart_clang_constructUSR_ObjCClass? _clang_constructUSR_ObjCClass; - @ffi.Uint32() - external int private_flags; -} + /// Construct a USR for a specified Objective-C category. + CXString clang_constructUSR_ObjCCategory( + ffi.Pointer class_name, + ffi.Pointer category_name, + ) { + return (_clang_constructUSR_ObjCCategory ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCCategory, + _dart_clang_constructUSR_ObjCCategory>( + 'clang_constructUSR_ObjCCategory'))( + class_name, + category_name, + ); + } -class CXStringSet extends ffi.Struct { - external ffi.Pointer Strings; + _dart_clang_constructUSR_ObjCCategory? _clang_constructUSR_ObjCCategory; - @ffi.Uint32() - external int Count; -} + /// Construct a USR for a specified Objective-C protocol. + CXString clang_constructUSR_ObjCProtocol( + ffi.Pointer protocol_name, + ) { + return (_clang_constructUSR_ObjCProtocol ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCProtocol, + _dart_clang_constructUSR_ObjCProtocol>( + 'clang_constructUSR_ObjCProtocol'))( + protocol_name, + ); + } -class CXTargetInfoImpl extends ffi.Struct {} + _dart_clang_constructUSR_ObjCProtocol? _clang_constructUSR_ObjCProtocol; -class CXTranslationUnitImpl extends ffi.Struct {} + /// Construct a USR for a specified Objective-C instance variable and + /// the USR for its containing class. + CXString clang_constructUSR_ObjCIvar( + ffi.Pointer name, + CXString classUSR, + ) { + return (_clang_constructUSR_ObjCIvar ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCIvar, + _dart_clang_constructUSR_ObjCIvar>('clang_constructUSR_ObjCIvar'))( + name, + classUSR, + ); + } -/// Provides the contents of a file that has not yet been saved to disk. -/// -/// Each CXUnsavedFile instance provides the name of a file on the -/// system along with the current contents of that file that have not -/// yet been saved to disk. -class CXUnsavedFile extends ffi.Struct { - /// The file whose contents have not yet been saved. - /// - /// This file must already exist in the file system. - external ffi.Pointer Filename; + _dart_clang_constructUSR_ObjCIvar? _clang_constructUSR_ObjCIvar; - /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + /// Construct a USR for a specified Objective-C method and + /// the USR for its containing class. + CXString clang_constructUSR_ObjCMethod( + ffi.Pointer name, + int isInstanceMethod, + CXString classUSR, + ) { + return (_clang_constructUSR_ObjCMethod ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCMethod, + _dart_clang_constructUSR_ObjCMethod>('clang_constructUSR_ObjCMethod'))( + name, + isInstanceMethod, + classUSR, + ); + } - /// The length of the unsaved contents of this buffer. - @ffi.Uint64() - external int Length; -} + _dart_clang_constructUSR_ObjCMethod? _clang_constructUSR_ObjCMethod; -/// Describes a version number of the form major.minor.subminor. -class CXVersion extends ffi.Struct { - /// The major version number, e.g., the '10' in '10.7.3'. A negative - /// value indicates that there is no version number at all. - @ffi.Int32() - external int Major; + /// Construct a USR for a specified Objective-C property and the USR + /// for its containing class. + CXString clang_constructUSR_ObjCProperty( + ffi.Pointer property, + CXString classUSR, + ) { + return (_clang_constructUSR_ObjCProperty ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCProperty, + _dart_clang_constructUSR_ObjCProperty>( + 'clang_constructUSR_ObjCProperty'))( + property, + classUSR, + ); + } - /// The minor version number, e.g., the '7' in '10.7.3'. This value - /// will be negative if no minor version number was provided, e.g., for - /// version '10'. - @ffi.Int32() - external int Minor; + _dart_clang_constructUSR_ObjCProperty? _clang_constructUSR_ObjCProperty; - /// The subminor version number, e.g., the '3' in '10.7.3'. This value - /// will be negative if no minor or subminor version number was provided, - /// e.g., in version '10' or '10.7'. - @ffi.Int32() - external int Subminor; -} + /// Retrieve a name for the entity referenced by this cursor. + CXString clang_getCursorSpelling( + CXCursor arg0, + ) { + return (_clang_getCursorSpelling ??= _dylib.lookupFunction< + _c_clang_getCursorSpelling, + _dart_clang_getCursorSpelling>('clang_getCursorSpelling'))( + arg0, + ); + } -abstract class CXGlobalOptFlags { - /// Used to indicate that no special CXIndex options are needed. - static const int CXGlobalOpt_None = 0; + _dart_clang_getCursorSpelling? _clang_getCursorSpelling; - /// Used to indicate that threads that libclang creates for indexing - /// purposes should use background priority. + /// Retrieve a range for a piece that forms the cursors spelling name. + /// Most of the times there is only one range for the complete spelling but for + /// Objective-C methods and Objective-C message expressions, there are multiple + /// pieces for each selector identifier. /// - /// Affects #clang_indexSourceFile, #clang_indexTranslationUnit, - /// #clang_parseTranslationUnit, #clang_saveTranslationUnit. - static const int CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1; - - /// Used to indicate that threads that libclang creates for editing - /// purposes should use background priority. + /// \param pieceIndex the index of the spelling name piece. If this is greater + /// than the actual number of pieces, it will return a NULL (invalid) range. /// - /// Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt, - /// #clang_annotateTokens - static const int CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2; + /// \param options Reserved. + CXSourceRange clang_Cursor_getSpellingNameRange( + CXCursor arg0, + int pieceIndex, + int options, + ) { + return (_clang_Cursor_getSpellingNameRange ??= _dylib.lookupFunction< + _c_clang_Cursor_getSpellingNameRange, + _dart_clang_Cursor_getSpellingNameRange>( + 'clang_Cursor_getSpellingNameRange'))( + arg0, + pieceIndex, + options, + ); + } - /// Used to indicate that all threads that libclang creates should use - /// background priority. - static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; -} + _dart_clang_Cursor_getSpellingNameRange? _clang_Cursor_getSpellingNameRange; -/// Uniquely identifies a CXFile, that refers to the same underlying file, -/// across an indexing session. -class CXFileUniqueID extends ffi.Struct { - @ffi.Uint64() - external int _unique_data_item_0; - @ffi.Uint64() - external int _unique_data_item_1; - @ffi.Uint64() - external int _unique_data_item_2; + /// Get a property value for the given printing policy. + int clang_PrintingPolicy_getProperty( + ffi.Pointer Policy, + int Property, + ) { + return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_getProperty, + _dart_clang_PrintingPolicy_getProperty>( + 'clang_PrintingPolicy_getProperty'))( + Policy, + Property, + ); + } - /// Helper for array `data`. - ArrayHelper_CXFileUniqueID_data_level0 get data => - ArrayHelper_CXFileUniqueID_data_level0(this, [3], 0, 0); -} + _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; -/// Helper for array `data` in struct `CXFileUniqueID`. -class ArrayHelper_CXFileUniqueID_data_level0 { - final CXFileUniqueID _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXFileUniqueID_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } + /// Set a property value for the given printing policy. + void clang_PrintingPolicy_setProperty( + ffi.Pointer Policy, + int Property, + int Value, + ) { + return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_setProperty, + _dart_clang_PrintingPolicy_setProperty>( + 'clang_PrintingPolicy_setProperty'))( + Policy, + Property, + Value, + ); } - int operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_data_item_0; - case 1: - return _struct._unique_data_item_1; - case 2: - return _struct._unique_data_item_2; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; + + /// Retrieve the default policy for the cursor. + /// + /// The policy should be released after use with \c + /// clang_PrintingPolicy_dispose. + ffi.Pointer clang_getCursorPrintingPolicy( + CXCursor arg0, + ) { + return (_clang_getCursorPrintingPolicy ??= _dylib.lookupFunction< + _c_clang_getCursorPrintingPolicy, + _dart_clang_getCursorPrintingPolicy>('clang_getCursorPrintingPolicy'))( + arg0, + ); } - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_data_item_0 = value; - break; - case 1: - _struct._unique_data_item_1 = value; - break; - case 2: - _struct._unique_data_item_2 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_getCursorPrintingPolicy? _clang_getCursorPrintingPolicy; + + /// Release a printing policy. + void clang_PrintingPolicy_dispose( + ffi.Pointer Policy, + ) { + return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_dispose, + _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( + Policy, + ); } -} -/// Identifies a specific source location within a translation -/// unit. -/// -/// Use clang_getExpansionLocation() or clang_getSpellingLocation() -/// to map a source location to a particular file, line, and column. -class CXSourceLocation extends ffi.Struct { - external ffi.Pointer _unique_ptr_data_item_0; - external ffi.Pointer _unique_ptr_data_item_1; + _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; - /// Helper for array `ptr_data`. - ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => - ArrayHelper_CXSourceLocation_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - external int int_data; -} + /// Pretty print declarations. + /// + /// \param Cursor The cursor representing a declaration. + /// + /// \param Policy The policy to control the entities being printed. If + /// NULL, a default policy is used. + /// + /// \returns The pretty printed declaration or the empty string for + /// other cursors. + CXString clang_getCursorPrettyPrinted( + CXCursor Cursor, + ffi.Pointer Policy, + ) { + return (_clang_getCursorPrettyPrinted ??= _dylib.lookupFunction< + _c_clang_getCursorPrettyPrinted, + _dart_clang_getCursorPrettyPrinted>('clang_getCursorPrettyPrinted'))( + Cursor, + Policy, + ); + } -/// Helper for array `ptr_data` in struct `CXSourceLocation`. -class ArrayHelper_CXSourceLocation_ptr_data_level0 { - final CXSourceLocation _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXSourceLocation_ptr_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } + _dart_clang_getCursorPrettyPrinted? _clang_getCursorPrettyPrinted; + + /// Retrieve the display name for the entity referenced by this cursor. + /// + /// The display name contains extra information that helps identify the cursor, + /// such as the parameters of a function or template or the arguments of a + /// class template specialization. + CXString clang_getCursorDisplayName( + CXCursor arg0, + ) { + return (_clang_getCursorDisplayName ??= _dylib.lookupFunction< + _c_clang_getCursorDisplayName, + _dart_clang_getCursorDisplayName>('clang_getCursorDisplayName'))( + arg0, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_ptr_data_item_0; - case 1: - return _struct._unique_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_getCursorDisplayName? _clang_getCursorDisplayName; + + /// For a cursor that is a reference, retrieve a cursor representing the + /// entity that it references. + /// + /// Reference cursors refer to other entities in the AST. For example, an + /// Objective-C superclass reference cursor refers to an Objective-C class. + /// This function produces the cursor for the Objective-C class from the + /// cursor for the superclass reference. If the input cursor is a declaration or + /// definition, it returns that declaration or definition unchanged. + /// Otherwise, returns the NULL cursor. + CXCursor clang_getCursorReferenced( + CXCursor arg0, + ) { + return (_clang_getCursorReferenced ??= _dylib.lookupFunction< + _c_clang_getCursorReferenced, + _dart_clang_getCursorReferenced>('clang_getCursorReferenced'))( + arg0, + ); } - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_ptr_data_item_0 = value; - break; - case 1: - _struct._unique_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_getCursorReferenced? _clang_getCursorReferenced; + + /// For a cursor that is either a reference to or a declaration + /// of some entity, retrieve a cursor that describes the definition of + /// that entity. + /// + /// Some entities can be declared multiple times within a translation + /// unit, but only one of those declarations can also be a + /// definition. For example, given: + /// + /// \code + /// int f(int, int); + /// int g(int x, int y) { return f(x, y); } + /// int f(int a, int b) { return a + b; } + /// int f(int, int); + /// \endcode + /// + /// there are three declarations of the function "f", but only the + /// second one is a definition. The clang_getCursorDefinition() + /// function will take any cursor pointing to a declaration of "f" + /// (the first or fourth lines of the example) or a cursor referenced + /// that uses "f" (the call to "f' inside "g") and will return a + /// declaration cursor pointing to the definition (the second "f" + /// declaration). + /// + /// If given a cursor for which there is no corresponding definition, + /// e.g., because there is no definition of that entity within this + /// translation unit, returns a NULL cursor. + CXCursor clang_getCursorDefinition( + CXCursor arg0, + ) { + return (_clang_getCursorDefinition ??= _dylib.lookupFunction< + _c_clang_getCursorDefinition, + _dart_clang_getCursorDefinition>('clang_getCursorDefinition'))( + arg0, + ); } -} -/// Identifies a half-open character range in the source code. -/// -/// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the -/// starting and end locations from a source range, respectively. -class CXSourceRange extends ffi.Struct { - external ffi.Pointer _unique_ptr_data_item_0; - external ffi.Pointer _unique_ptr_data_item_1; + _dart_clang_getCursorDefinition? _clang_getCursorDefinition; - /// Helper for array `ptr_data`. - ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => - ArrayHelper_CXSourceRange_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - external int begin_int_data; + /// Determine whether the declaration pointed to by this cursor + /// is also a definition of that entity. + int clang_isCursorDefinition( + CXCursor arg0, + ) { + return (_clang_isCursorDefinition ??= _dylib.lookupFunction< + _c_clang_isCursorDefinition, + _dart_clang_isCursorDefinition>('clang_isCursorDefinition'))( + arg0, + ); + } - @ffi.Uint32() - external int end_int_data; -} + _dart_clang_isCursorDefinition? _clang_isCursorDefinition; -/// Helper for array `ptr_data` in struct `CXSourceRange`. -class ArrayHelper_CXSourceRange_ptr_data_level0 { - final CXSourceRange _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXSourceRange_ptr_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } + /// Retrieve the canonical cursor corresponding to the given cursor. + /// + /// In the C family of languages, many kinds of entities can be declared several + /// times within a single translation unit. For example, a structure type can + /// be forward-declared (possibly multiple times) and later defined: + /// + /// \code + /// struct X; + /// struct X; + /// struct X { + /// int member; + /// }; + /// \endcode + /// + /// The declarations and the definition of \c X are represented by three + /// different cursors, all of which are declarations of the same underlying + /// entity. One of these cursor is considered the "canonical" cursor, which + /// is effectively the representative for the underlying entity. One can + /// determine if two cursors are declarations of the same underlying entity by + /// comparing their canonical cursors. + /// + /// \returns The canonical cursor for the entity referred to by the given cursor. + CXCursor clang_getCanonicalCursor( + CXCursor arg0, + ) { + return (_clang_getCanonicalCursor ??= _dylib.lookupFunction< + _c_clang_getCanonicalCursor, + _dart_clang_getCanonicalCursor>('clang_getCanonicalCursor'))( + arg0, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_ptr_data_item_0; - case 1: - return _struct._unique_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_getCanonicalCursor? _clang_getCanonicalCursor; + + /// If the cursor points to a selector identifier in an Objective-C + /// method or message expression, this returns the selector index. + /// + /// After getting a cursor with #clang_getCursor, this can be called to + /// determine if the location points to a selector identifier. + /// + /// \returns The selector index if the cursor is an Objective-C method or message + /// expression and the cursor is pointing to a selector identifier, or -1 + /// otherwise. + int clang_Cursor_getObjCSelectorIndex( + CXCursor arg0, + ) { + return (_clang_Cursor_getObjCSelectorIndex ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCSelectorIndex, + _dart_clang_Cursor_getObjCSelectorIndex>( + 'clang_Cursor_getObjCSelectorIndex'))( + arg0, + ); } - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_ptr_data_item_0 = value; - break; - case 1: - _struct._unique_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + _dart_clang_Cursor_getObjCSelectorIndex? _clang_Cursor_getObjCSelectorIndex; + + /// Given a cursor pointing to a C++ method call or an Objective-C + /// message, returns non-zero if the method/message is "dynamic", meaning: + /// + /// For a C++ method: the call is virtual. + /// For an Objective-C message: the receiver is an object instance, not 'super' + /// or a specific class. + /// + /// If the method/message is "static" or the cursor does not point to a + /// method/message, it will return zero. + int clang_Cursor_isDynamicCall( + CXCursor C, + ) { + return (_clang_Cursor_isDynamicCall ??= _dylib.lookupFunction< + _c_clang_Cursor_isDynamicCall, + _dart_clang_Cursor_isDynamicCall>('clang_Cursor_isDynamicCall'))( + C, + ); } -} -/// Identifies an array of ranges. -class CXSourceRangeList extends ffi.Struct { - /// The number of ranges in the \c ranges array. - @ffi.Uint32() - external int count; + _dart_clang_Cursor_isDynamicCall? _clang_Cursor_isDynamicCall; - /// An array of \c CXSourceRanges. - external ffi.Pointer ranges; -} + /// Given a cursor pointing to an Objective-C message or property + /// reference, or C++ method call, returns the CXType of the receiver. + CXType clang_Cursor_getReceiverType( + CXCursor C, + ) { + return (_clang_Cursor_getReceiverType ??= _dylib.lookupFunction< + _c_clang_Cursor_getReceiverType, + _dart_clang_Cursor_getReceiverType>('clang_Cursor_getReceiverType'))( + C, + ); + } -class CXTUResourceUsageEntry extends ffi.Struct { - @ffi.Int32() - external int kind; + _dart_clang_Cursor_getReceiverType? _clang_Cursor_getReceiverType; - @ffi.Uint64() - external int amount; -} + /// Given a cursor that represents a property declaration, return the + /// associated property attributes. The bits are formed from + /// \c CXObjCPropertyAttrKind. + /// + /// \param reserved Reserved for future use, pass 0. + int clang_Cursor_getObjCPropertyAttributes( + CXCursor C, + int reserved, + ) { + return (_clang_Cursor_getObjCPropertyAttributes ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCPropertyAttributes, + _dart_clang_Cursor_getObjCPropertyAttributes>( + 'clang_Cursor_getObjCPropertyAttributes'))( + C, + reserved, + ); + } -/// The memory usage of a CXTranslationUnit, broken into categories. -class CXTUResourceUsage extends ffi.Struct { - external ffi.Pointer data; + _dart_clang_Cursor_getObjCPropertyAttributes? + _clang_Cursor_getObjCPropertyAttributes; - @ffi.Uint32() - external int numEntries; + /// Given a cursor that represents a property declaration, return the + /// name of the method that implements the getter. + CXString clang_Cursor_getObjCPropertyGetterName( + CXCursor C, + ) { + return (_clang_Cursor_getObjCPropertyGetterName ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCPropertyGetterName, + _dart_clang_Cursor_getObjCPropertyGetterName>( + 'clang_Cursor_getObjCPropertyGetterName'))( + C, + ); + } - external ffi.Pointer entries; -} + _dart_clang_Cursor_getObjCPropertyGetterName? + _clang_Cursor_getObjCPropertyGetterName; -/// A cursor representing some element in the abstract syntax tree for -/// a translation unit. -/// -/// The cursor abstraction unifies the different kinds of entities in a -/// program--declaration, statements, expressions, references to declarations, -/// etc.--under a single "cursor" abstraction with a common set of operations. -/// Common operation for a cursor include: getting the physical location in -/// a source file where the cursor points, getting the name associated with a -/// cursor, and retrieving cursors for any child nodes of a particular cursor. -/// -/// Cursors can be produced in two specific ways. -/// clang_getTranslationUnitCursor() produces a cursor for a translation unit, -/// from which one can use clang_visitChildren() to explore the rest of the -/// translation unit. clang_getCursor() maps from a physical source location -/// to the entity that resides at that location, allowing one to map from the -/// source code into the AST. -class CXCursor extends ffi.Struct { - @ffi.Int32() - external int kind; + /// Given a cursor that represents a property declaration, return the + /// name of the method that implements the setter, if any. + CXString clang_Cursor_getObjCPropertySetterName( + CXCursor C, + ) { + return (_clang_Cursor_getObjCPropertySetterName ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCPropertySetterName, + _dart_clang_Cursor_getObjCPropertySetterName>( + 'clang_Cursor_getObjCPropertySetterName'))( + C, + ); + } - @ffi.Int32() - external int xdata; + _dart_clang_Cursor_getObjCPropertySetterName? + _clang_Cursor_getObjCPropertySetterName; - external ffi.Pointer _unique_data_item_0; - external ffi.Pointer _unique_data_item_1; - external ffi.Pointer _unique_data_item_2; + /// Given a cursor that represents an Objective-C method or parameter + /// declaration, return the associated Objective-C qualifiers for the return + /// type or the parameter respectively. The bits are formed from + /// CXObjCDeclQualifierKind. + int clang_Cursor_getObjCDeclQualifiers( + CXCursor C, + ) { + return (_clang_Cursor_getObjCDeclQualifiers ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCDeclQualifiers, + _dart_clang_Cursor_getObjCDeclQualifiers>( + 'clang_Cursor_getObjCDeclQualifiers'))( + C, + ); + } - /// Helper for array `data`. - ArrayHelper_CXCursor_data_level0 get data => - ArrayHelper_CXCursor_data_level0(this, [3], 0, 0); -} + _dart_clang_Cursor_getObjCDeclQualifiers? _clang_Cursor_getObjCDeclQualifiers; -/// Helper for array `data` in struct `CXCursor`. -class ArrayHelper_CXCursor_data_level0 { - final CXCursor _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXCursor_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } + /// Given a cursor that represents an Objective-C method or property + /// declaration, return non-zero if the declaration was affected by "\@optional". + /// Returns zero if the cursor is not such a declaration or it is "\@required". + int clang_Cursor_isObjCOptional( + CXCursor C, + ) { + return (_clang_Cursor_isObjCOptional ??= _dylib.lookupFunction< + _c_clang_Cursor_isObjCOptional, + _dart_clang_Cursor_isObjCOptional>('clang_Cursor_isObjCOptional'))( + C, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_data_item_0; - case 1: - return _struct._unique_data_item_1; - case 2: - return _struct._unique_data_item_2; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + _dart_clang_Cursor_isObjCOptional? _clang_Cursor_isObjCOptional; - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_data_item_0 = value; - break; - case 1: - _struct._unique_data_item_1 = value; - break; - case 2: - _struct._unique_data_item_2 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + /// Returns non-zero if the given cursor is a variadic function or method. + int clang_Cursor_isVariadic( + CXCursor C, + ) { + return (_clang_Cursor_isVariadic ??= _dylib.lookupFunction< + _c_clang_Cursor_isVariadic, + _dart_clang_Cursor_isVariadic>('clang_Cursor_isVariadic'))( + C, + ); } -} -/// Describes the availability of a given entity on a particular platform, e.g., -/// a particular class might only be available on Mac OS 10.7 or newer. -class CXPlatformAvailability extends ffi.Struct { - /// A string that describes the platform for which this structure - /// provides availability information. + _dart_clang_Cursor_isVariadic? _clang_Cursor_isVariadic; + + /// Returns non-zero if the given cursor points to a symbol marked with + /// external_source_symbol attribute. /// - /// Possible values are "ios" or "macos". - external CXString Platform; + /// \param language If non-NULL, and the attribute is present, will be set to + /// the 'language' string from the attribute. + /// + /// \param definedIn If non-NULL, and the attribute is present, will be set to + /// the 'definedIn' string from the attribute. + /// + /// \param isGenerated If non-NULL, and the attribute is present, will be set to + /// non-zero if the 'generated_declaration' is set in the attribute. + int clang_Cursor_isExternalSymbol( + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated, + ) { + return (_clang_Cursor_isExternalSymbol ??= _dylib.lookupFunction< + _c_clang_Cursor_isExternalSymbol, + _dart_clang_Cursor_isExternalSymbol>('clang_Cursor_isExternalSymbol'))( + C, + language, + definedIn, + isGenerated, + ); + } - /// The version number in which this entity was introduced. - external CXVersion Introduced; + _dart_clang_Cursor_isExternalSymbol? _clang_Cursor_isExternalSymbol; - /// The version number in which this entity was deprecated (but is - /// still available). - external CXVersion Deprecated; + /// Given a cursor that represents a declaration, return the associated + /// comment's source range. The range may include multiple consecutive comments + /// with whitespace in between. + CXSourceRange clang_Cursor_getCommentRange( + CXCursor C, + ) { + return (_clang_Cursor_getCommentRange ??= _dylib.lookupFunction< + _c_clang_Cursor_getCommentRange, + _dart_clang_Cursor_getCommentRange>('clang_Cursor_getCommentRange'))( + C, + ); + } - /// The version number in which this entity was obsoleted, and therefore - /// is no longer available. - external CXVersion Obsoleted; + _dart_clang_Cursor_getCommentRange? _clang_Cursor_getCommentRange; - /// Whether the entity is unconditionally unavailable on this platform. - @ffi.Int32() - external int Unavailable; + /// Given a cursor that represents a declaration, return the associated + /// comment text, including comment markers. + CXString clang_Cursor_getRawCommentText( + CXCursor C, + ) { + return (_clang_Cursor_getRawCommentText ??= _dylib.lookupFunction< + _c_clang_Cursor_getRawCommentText, + _dart_clang_Cursor_getRawCommentText>( + 'clang_Cursor_getRawCommentText'))( + C, + ); + } - /// An optional message to provide to a user of this API, e.g., to - /// suggest replacement APIs. - external CXString Message; -} + _dart_clang_Cursor_getRawCommentText? _clang_Cursor_getRawCommentText; -class CXCursorSetImpl extends ffi.Struct {} + /// Given a cursor that represents a documentable entity (e.g., + /// declaration), return the associated \paragraph; otherwise return the + /// first paragraph. + CXString clang_Cursor_getBriefCommentText( + CXCursor C, + ) { + return (_clang_Cursor_getBriefCommentText ??= _dylib.lookupFunction< + _c_clang_Cursor_getBriefCommentText, + _dart_clang_Cursor_getBriefCommentText>( + 'clang_Cursor_getBriefCommentText'))( + C, + ); + } -/// Describes the kind of type -abstract class CXTypeKind { - /// Represents an invalid type (e.g., where no type is available). - static const int CXType_Invalid = 0; + _dart_clang_Cursor_getBriefCommentText? _clang_Cursor_getBriefCommentText; - /// A type whose specific kind is not exposed via this - /// interface. - static const int CXType_Unexposed = 1; - static const int CXType_Void = 2; - static const int CXType_Bool = 3; - static const int CXType_Char_U = 4; - static const int CXType_UChar = 5; - static const int CXType_Char16 = 6; - static const int CXType_Char32 = 7; - static const int CXType_UShort = 8; - static const int CXType_UInt = 9; - static const int CXType_ULong = 10; - static const int CXType_ULongLong = 11; - static const int CXType_UInt128 = 12; - static const int CXType_Char_S = 13; - static const int CXType_SChar = 14; - static const int CXType_WChar = 15; - static const int CXType_Short = 16; - static const int CXType_Int = 17; - static const int CXType_Long = 18; - static const int CXType_LongLong = 19; - static const int CXType_Int128 = 20; - static const int CXType_Float = 21; - static const int CXType_Double = 22; - static const int CXType_LongDouble = 23; - static const int CXType_NullPtr = 24; - static const int CXType_Overload = 25; - static const int CXType_Dependent = 26; - static const int CXType_ObjCId = 27; - static const int CXType_ObjCClass = 28; - static const int CXType_ObjCSel = 29; - static const int CXType_Float128 = 30; - static const int CXType_Half = 31; - static const int CXType_Float16 = 32; - static const int CXType_ShortAccum = 33; - static const int CXType_Accum = 34; - static const int CXType_LongAccum = 35; - static const int CXType_UShortAccum = 36; - static const int CXType_UAccum = 37; - static const int CXType_ULongAccum = 38; - static const int CXType_FirstBuiltin = 2; - static const int CXType_LastBuiltin = 38; - static const int CXType_Complex = 100; - static const int CXType_Pointer = 101; - static const int CXType_BlockPointer = 102; - static const int CXType_LValueReference = 103; - static const int CXType_RValueReference = 104; - static const int CXType_Record = 105; - static const int CXType_Enum = 106; - static const int CXType_Typedef = 107; - static const int CXType_ObjCInterface = 108; - static const int CXType_ObjCObjectPointer = 109; - static const int CXType_FunctionNoProto = 110; - static const int CXType_FunctionProto = 111; - static const int CXType_ConstantArray = 112; - static const int CXType_Vector = 113; - static const int CXType_IncompleteArray = 114; - static const int CXType_VariableArray = 115; - static const int CXType_DependentSizedArray = 116; - static const int CXType_MemberPointer = 117; - static const int CXType_Auto = 118; + /// Retrieve the CXString representing the mangled name of the cursor. + CXString clang_Cursor_getMangling( + CXCursor arg0, + ) { + return (_clang_Cursor_getMangling ??= _dylib.lookupFunction< + _c_clang_Cursor_getMangling, + _dart_clang_Cursor_getMangling>('clang_Cursor_getMangling'))( + arg0, + ); + } - /// Represents a type that was referred to using an elaborated type keyword. - /// - /// E.g., struct S, or via a qualified name, e.g., N::M::type, or both. - static const int CXType_Elaborated = 119; - static const int CXType_Pipe = 120; - static const int CXType_OCLImage1dRO = 121; - static const int CXType_OCLImage1dArrayRO = 122; - static const int CXType_OCLImage1dBufferRO = 123; - static const int CXType_OCLImage2dRO = 124; - static const int CXType_OCLImage2dArrayRO = 125; - static const int CXType_OCLImage2dDepthRO = 126; - static const int CXType_OCLImage2dArrayDepthRO = 127; - static const int CXType_OCLImage2dMSAARO = 128; - static const int CXType_OCLImage2dArrayMSAARO = 129; - static const int CXType_OCLImage2dMSAADepthRO = 130; - static const int CXType_OCLImage2dArrayMSAADepthRO = 131; - static const int CXType_OCLImage3dRO = 132; - static const int CXType_OCLImage1dWO = 133; - static const int CXType_OCLImage1dArrayWO = 134; - static const int CXType_OCLImage1dBufferWO = 135; - static const int CXType_OCLImage2dWO = 136; - static const int CXType_OCLImage2dArrayWO = 137; - static const int CXType_OCLImage2dDepthWO = 138; - static const int CXType_OCLImage2dArrayDepthWO = 139; - static const int CXType_OCLImage2dMSAAWO = 140; - static const int CXType_OCLImage2dArrayMSAAWO = 141; - static const int CXType_OCLImage2dMSAADepthWO = 142; - static const int CXType_OCLImage2dArrayMSAADepthWO = 143; - static const int CXType_OCLImage3dWO = 144; - static const int CXType_OCLImage1dRW = 145; - static const int CXType_OCLImage1dArrayRW = 146; - static const int CXType_OCLImage1dBufferRW = 147; - static const int CXType_OCLImage2dRW = 148; - static const int CXType_OCLImage2dArrayRW = 149; - static const int CXType_OCLImage2dDepthRW = 150; - static const int CXType_OCLImage2dArrayDepthRW = 151; - static const int CXType_OCLImage2dMSAARW = 152; - static const int CXType_OCLImage2dArrayMSAARW = 153; - static const int CXType_OCLImage2dMSAADepthRW = 154; - static const int CXType_OCLImage2dArrayMSAADepthRW = 155; - static const int CXType_OCLImage3dRW = 156; - static const int CXType_OCLSampler = 157; - static const int CXType_OCLEvent = 158; - static const int CXType_OCLQueue = 159; - static const int CXType_OCLReserveID = 160; - static const int CXType_ObjCObject = 161; - static const int CXType_ObjCTypeParam = 162; - static const int CXType_Attributed = 163; - static const int CXType_OCLIntelSubgroupAVCMcePayload = 164; - static const int CXType_OCLIntelSubgroupAVCImePayload = 165; - static const int CXType_OCLIntelSubgroupAVCRefPayload = 166; - static const int CXType_OCLIntelSubgroupAVCSicPayload = 167; - static const int CXType_OCLIntelSubgroupAVCMceResult = 168; - static const int CXType_OCLIntelSubgroupAVCImeResult = 169; - static const int CXType_OCLIntelSubgroupAVCRefResult = 170; - static const int CXType_OCLIntelSubgroupAVCSicResult = 171; - static const int CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172; - static const int CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173; - static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; - static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; - static const int CXType_ExtVector = 176; -} + _dart_clang_Cursor_getMangling? _clang_Cursor_getMangling; -/// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { - @ffi.Int32() - external int kind; + /// Retrieve the CXStrings representing the mangled symbols of the C++ + /// constructor or destructor at the cursor. + ffi.Pointer clang_Cursor_getCXXManglings( + CXCursor arg0, + ) { + return (_clang_Cursor_getCXXManglings ??= _dylib.lookupFunction< + _c_clang_Cursor_getCXXManglings, + _dart_clang_Cursor_getCXXManglings>('clang_Cursor_getCXXManglings'))( + arg0, + ); + } - external ffi.Pointer _unique_data_item_0; - external ffi.Pointer _unique_data_item_1; + _dart_clang_Cursor_getCXXManglings? _clang_Cursor_getCXXManglings; - /// Helper for array `data`. - ArrayHelper_CXType_data_level0 get data => - ArrayHelper_CXType_data_level0(this, [2], 0, 0); -} + /// Retrieve the CXStrings representing the mangled symbols of the ObjC + /// class interface or implementation at the cursor. + ffi.Pointer clang_Cursor_getObjCManglings( + CXCursor arg0, + ) { + return (_clang_Cursor_getObjCManglings ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCManglings, + _dart_clang_Cursor_getObjCManglings>('clang_Cursor_getObjCManglings'))( + arg0, + ); + } + + _dart_clang_Cursor_getObjCManglings? _clang_Cursor_getObjCManglings; + + /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. + ffi.Pointer clang_Cursor_getModule( + CXCursor C, + ) { + return (_clang_Cursor_getModule ??= _dylib.lookupFunction< + _c_clang_Cursor_getModule, + _dart_clang_Cursor_getModule>('clang_Cursor_getModule'))( + C, + ); + } + + _dart_clang_Cursor_getModule? _clang_Cursor_getModule; + + /// Given a CXFile header file, return the module that contains it, if one + /// exists. + ffi.Pointer clang_getModuleForFile( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return (_clang_getModuleForFile ??= _dylib.lookupFunction< + _c_clang_getModuleForFile, + _dart_clang_getModuleForFile>('clang_getModuleForFile'))( + arg0, + arg1, + ); + } + + _dart_clang_getModuleForFile? _clang_getModuleForFile; + + /// \param Module a module object. + /// + /// \returns the module file where the provided module object came from. + ffi.Pointer clang_Module_getASTFile( + ffi.Pointer Module, + ) { + return (_clang_Module_getASTFile ??= _dylib.lookupFunction< + _c_clang_Module_getASTFile, + _dart_clang_Module_getASTFile>('clang_Module_getASTFile'))( + Module, + ); + } + + _dart_clang_Module_getASTFile? _clang_Module_getASTFile; + + /// \param Module a module object. + /// + /// \returns the parent of a sub-module or NULL if the given module is top-level, + /// e.g. for 'std.vector' it will return the 'std' module. + ffi.Pointer clang_Module_getParent( + ffi.Pointer Module, + ) { + return (_clang_Module_getParent ??= _dylib.lookupFunction< + _c_clang_Module_getParent, + _dart_clang_Module_getParent>('clang_Module_getParent'))( + Module, + ); + } + + _dart_clang_Module_getParent? _clang_Module_getParent; + + /// \param Module a module object. + /// + /// \returns the name of the module, e.g. for the 'std.vector' sub-module it + /// will return "vector". + CXString clang_Module_getName( + ffi.Pointer Module, + ) { + return (_clang_Module_getName ??= _dylib.lookupFunction< + _c_clang_Module_getName, + _dart_clang_Module_getName>('clang_Module_getName'))( + Module, + ); + } + + _dart_clang_Module_getName? _clang_Module_getName; + + /// \param Module a module object. + /// + /// \returns the full name of the module, e.g. "std.vector". + CXString clang_Module_getFullName( + ffi.Pointer Module, + ) { + return (_clang_Module_getFullName ??= _dylib.lookupFunction< + _c_clang_Module_getFullName, + _dart_clang_Module_getFullName>('clang_Module_getFullName'))( + Module, + ); + } + + _dart_clang_Module_getFullName? _clang_Module_getFullName; + + /// \param Module a module object. + /// + /// \returns non-zero if the module is a system one. + int clang_Module_isSystem( + ffi.Pointer Module, + ) { + return (_clang_Module_isSystem ??= _dylib.lookupFunction< + _c_clang_Module_isSystem, + _dart_clang_Module_isSystem>('clang_Module_isSystem'))( + Module, + ); + } + + _dart_clang_Module_isSystem? _clang_Module_isSystem; + + /// \param Module a module object. + /// + /// \returns the number of top level headers associated with this module. + int clang_Module_getNumTopLevelHeaders( + ffi.Pointer arg0, + ffi.Pointer Module, + ) { + return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< + _c_clang_Module_getNumTopLevelHeaders, + _dart_clang_Module_getNumTopLevelHeaders>( + 'clang_Module_getNumTopLevelHeaders'))( + arg0, + Module, + ); + } + + _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; + + /// \param Module a module object. + /// + /// \param Index top level header index (zero-based). + /// + /// \returns the specified top level header associated with the module. + ffi.Pointer clang_Module_getTopLevelHeader( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, + ) { + return (_clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< + _c_clang_Module_getTopLevelHeader, + _dart_clang_Module_getTopLevelHeader>( + 'clang_Module_getTopLevelHeader'))( + arg0, + Module, + Index, + ); + } + + _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; + + /// Determine if a C++ constructor is a converting constructor. + int clang_CXXConstructor_isConvertingConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isConvertingConstructor ??= + _dylib.lookupFunction<_c_clang_CXXConstructor_isConvertingConstructor, + _dart_clang_CXXConstructor_isConvertingConstructor>( + 'clang_CXXConstructor_isConvertingConstructor'))( + C, + ); + } + + _dart_clang_CXXConstructor_isConvertingConstructor? + _clang_CXXConstructor_isConvertingConstructor; + + /// Determine if a C++ constructor is a copy constructor. + int clang_CXXConstructor_isCopyConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isCopyConstructor ??= _dylib.lookupFunction< + _c_clang_CXXConstructor_isCopyConstructor, + _dart_clang_CXXConstructor_isCopyConstructor>( + 'clang_CXXConstructor_isCopyConstructor'))( + C, + ); + } + + _dart_clang_CXXConstructor_isCopyConstructor? + _clang_CXXConstructor_isCopyConstructor; + + /// Determine if a C++ constructor is the default constructor. + int clang_CXXConstructor_isDefaultConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isDefaultConstructor ??= + _dylib.lookupFunction<_c_clang_CXXConstructor_isDefaultConstructor, + _dart_clang_CXXConstructor_isDefaultConstructor>( + 'clang_CXXConstructor_isDefaultConstructor'))( + C, + ); + } + + _dart_clang_CXXConstructor_isDefaultConstructor? + _clang_CXXConstructor_isDefaultConstructor; + + /// Determine if a C++ constructor is a move constructor. + int clang_CXXConstructor_isMoveConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isMoveConstructor ??= _dylib.lookupFunction< + _c_clang_CXXConstructor_isMoveConstructor, + _dart_clang_CXXConstructor_isMoveConstructor>( + 'clang_CXXConstructor_isMoveConstructor'))( + C, + ); + } + + _dart_clang_CXXConstructor_isMoveConstructor? + _clang_CXXConstructor_isMoveConstructor; + + /// Determine if a C++ field is declared 'mutable'. + int clang_CXXField_isMutable( + CXCursor C, + ) { + return (_clang_CXXField_isMutable ??= _dylib.lookupFunction< + _c_clang_CXXField_isMutable, + _dart_clang_CXXField_isMutable>('clang_CXXField_isMutable'))( + C, + ); + } + + _dart_clang_CXXField_isMutable? _clang_CXXField_isMutable; + + /// Determine if a C++ method is declared '= default'. + int clang_CXXMethod_isDefaulted( + CXCursor C, + ) { + return (_clang_CXXMethod_isDefaulted ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isDefaulted, + _dart_clang_CXXMethod_isDefaulted>('clang_CXXMethod_isDefaulted'))( + C, + ); + } + + _dart_clang_CXXMethod_isDefaulted? _clang_CXXMethod_isDefaulted; + + /// Determine if a C++ member function or member function template is + /// pure virtual. + int clang_CXXMethod_isPureVirtual( + CXCursor C, + ) { + return (_clang_CXXMethod_isPureVirtual ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isPureVirtual, + _dart_clang_CXXMethod_isPureVirtual>('clang_CXXMethod_isPureVirtual'))( + C, + ); + } + + _dart_clang_CXXMethod_isPureVirtual? _clang_CXXMethod_isPureVirtual; + + /// Determine if a C++ member function or member function template is + /// declared 'static'. + int clang_CXXMethod_isStatic( + CXCursor C, + ) { + return (_clang_CXXMethod_isStatic ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isStatic, + _dart_clang_CXXMethod_isStatic>('clang_CXXMethod_isStatic'))( + C, + ); + } + + _dart_clang_CXXMethod_isStatic? _clang_CXXMethod_isStatic; + + /// Determine if a C++ member function or member function template is + /// explicitly declared 'virtual' or if it overrides a virtual method from + /// one of the base classes. + int clang_CXXMethod_isVirtual( + CXCursor C, + ) { + return (_clang_CXXMethod_isVirtual ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isVirtual, + _dart_clang_CXXMethod_isVirtual>('clang_CXXMethod_isVirtual'))( + C, + ); + } + + _dart_clang_CXXMethod_isVirtual? _clang_CXXMethod_isVirtual; + + /// Determine if a C++ record is abstract, i.e. whether a class or struct + /// has a pure virtual member function. + int clang_CXXRecord_isAbstract( + CXCursor C, + ) { + return (_clang_CXXRecord_isAbstract ??= _dylib.lookupFunction< + _c_clang_CXXRecord_isAbstract, + _dart_clang_CXXRecord_isAbstract>('clang_CXXRecord_isAbstract'))( + C, + ); + } + + _dart_clang_CXXRecord_isAbstract? _clang_CXXRecord_isAbstract; + + /// Determine if an enum declaration refers to a scoped enum. + int clang_EnumDecl_isScoped( + CXCursor C, + ) { + return (_clang_EnumDecl_isScoped ??= _dylib.lookupFunction< + _c_clang_EnumDecl_isScoped, + _dart_clang_EnumDecl_isScoped>('clang_EnumDecl_isScoped'))( + C, + ); + } + + _dart_clang_EnumDecl_isScoped? _clang_EnumDecl_isScoped; + + /// Determine if a C++ member function or member function template is + /// declared 'const'. + int clang_CXXMethod_isConst( + CXCursor C, + ) { + return (_clang_CXXMethod_isConst ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isConst, + _dart_clang_CXXMethod_isConst>('clang_CXXMethod_isConst'))( + C, + ); + } + + _dart_clang_CXXMethod_isConst? _clang_CXXMethod_isConst; + + /// Given a cursor that represents a template, determine + /// the cursor kind of the specializations would be generated by instantiating + /// the template. + /// + /// This routine can be used to determine what flavor of function template, + /// class template, or class template partial specialization is stored in the + /// cursor. For example, it can describe whether a class template cursor is + /// declared with "struct", "class" or "union". + /// + /// \param C The cursor to query. This cursor should represent a template + /// declaration. + /// + /// \returns The cursor kind of the specializations that would be generated + /// by instantiating the template \p C. If \p C is not a template, returns + /// \c CXCursor_NoDeclFound. + int clang_getTemplateCursorKind( + CXCursor C, + ) { + return (_clang_getTemplateCursorKind ??= _dylib.lookupFunction< + _c_clang_getTemplateCursorKind, + _dart_clang_getTemplateCursorKind>('clang_getTemplateCursorKind'))( + C, + ); + } + + _dart_clang_getTemplateCursorKind? _clang_getTemplateCursorKind; + + /// Given a cursor that may represent a specialization or instantiation + /// of a template, retrieve the cursor that represents the template that it + /// specializes or from which it was instantiated. + /// + /// This routine determines the template involved both for explicit + /// specializations of templates and for implicit instantiations of the template, + /// both of which are referred to as "specializations". For a class template + /// specialization (e.g., \c std::vector), this routine will return + /// either the primary template (\c std::vector) or, if the specialization was + /// instantiated from a class template partial specialization, the class template + /// partial specialization. For a class template partial specialization and a + /// function template specialization (including instantiations), this + /// this routine will return the specialized template. + /// + /// For members of a class template (e.g., member functions, member classes, or + /// static data members), returns the specialized or instantiated member. + /// Although not strictly "templates" in the C++ language, members of class + /// templates have the same notions of specializations and instantiations that + /// templates do, so this routine treats them similarly. + /// + /// \param C A cursor that may be a specialization of a template or a member + /// of a template. + /// + /// \returns If the given cursor is a specialization or instantiation of a + /// template or a member thereof, the template or member that it specializes or + /// from which it was instantiated. Otherwise, returns a NULL cursor. + CXCursor clang_getSpecializedCursorTemplate( + CXCursor C, + ) { + return (_clang_getSpecializedCursorTemplate ??= _dylib.lookupFunction< + _c_clang_getSpecializedCursorTemplate, + _dart_clang_getSpecializedCursorTemplate>( + 'clang_getSpecializedCursorTemplate'))( + C, + ); + } + + _dart_clang_getSpecializedCursorTemplate? _clang_getSpecializedCursorTemplate; + + /// Given a cursor that references something else, return the source range + /// covering that reference. + /// + /// \param C A cursor pointing to a member reference, a declaration reference, or + /// an operator call. + /// \param NameFlags A bitset with three independent flags: + /// CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and + /// CXNameRange_WantSinglePiece. + /// \param PieceIndex For contiguous names or when passing the flag + /// CXNameRange_WantSinglePiece, only one piece with index 0 is + /// available. When the CXNameRange_WantSinglePiece flag is not passed for a + /// non-contiguous names, this index can be used to retrieve the individual + /// pieces of the name. See also CXNameRange_WantSinglePiece. + /// + /// \returns The piece of the name pointed to by the given cursor. If there is no + /// name, or if the PieceIndex is out-of-range, a null-cursor will be returned. + CXSourceRange clang_getCursorReferenceNameRange( + CXCursor C, + int NameFlags, + int PieceIndex, + ) { + return (_clang_getCursorReferenceNameRange ??= _dylib.lookupFunction< + _c_clang_getCursorReferenceNameRange, + _dart_clang_getCursorReferenceNameRange>( + 'clang_getCursorReferenceNameRange'))( + C, + NameFlags, + PieceIndex, + ); + } + + _dart_clang_getCursorReferenceNameRange? _clang_getCursorReferenceNameRange; + + /// Get the raw lexical token starting with the given location. + /// + /// \param TU the translation unit whose text is being tokenized. + /// + /// \param Location the source location with which the token starts. + /// + /// \returns The token starting with the given location or NULL if no such token + /// exist. The returned pointer must be freed with clang_disposeTokens before the + /// translation unit is destroyed. + ffi.Pointer clang_getToken( + ffi.Pointer TU, + CXSourceLocation Location, + ) { + return (_clang_getToken ??= + _dylib.lookupFunction<_c_clang_getToken, _dart_clang_getToken>( + 'clang_getToken'))( + TU, + Location, + ); + } + + _dart_clang_getToken? _clang_getToken; + + /// Determine the kind of the given token. + int clang_getTokenKind( + CXToken arg0, + ) { + return (_clang_getTokenKind ??= + _dylib.lookupFunction<_c_clang_getTokenKind, _dart_clang_getTokenKind>( + 'clang_getTokenKind'))( + arg0, + ); + } + + _dart_clang_getTokenKind? _clang_getTokenKind; + + /// Determine the spelling of the given token. + /// + /// The spelling of a token is the textual representation of that token, e.g., + /// the text of an identifier or keyword. + CXString clang_getTokenSpelling( + ffi.Pointer arg0, + CXToken arg1, + ) { + return (_clang_getTokenSpelling ??= _dylib.lookupFunction< + _c_clang_getTokenSpelling, + _dart_clang_getTokenSpelling>('clang_getTokenSpelling'))( + arg0, + arg1, + ); + } + + _dart_clang_getTokenSpelling? _clang_getTokenSpelling; + + /// Retrieve the source location of the given token. + CXSourceLocation clang_getTokenLocation( + ffi.Pointer arg0, + CXToken arg1, + ) { + return (_clang_getTokenLocation ??= _dylib.lookupFunction< + _c_clang_getTokenLocation, + _dart_clang_getTokenLocation>('clang_getTokenLocation'))( + arg0, + arg1, + ); + } + + _dart_clang_getTokenLocation? _clang_getTokenLocation; + + /// Retrieve a source range that covers the given token. + CXSourceRange clang_getTokenExtent( + ffi.Pointer arg0, + CXToken arg1, + ) { + return (_clang_getTokenExtent ??= _dylib.lookupFunction< + _c_clang_getTokenExtent, + _dart_clang_getTokenExtent>('clang_getTokenExtent'))( + arg0, + arg1, + ); + } + + _dart_clang_getTokenExtent? _clang_getTokenExtent; + + /// Tokenize the source code described by the given range into raw + /// lexical tokens. + /// + /// \param TU the translation unit whose text is being tokenized. + /// + /// \param Range the source range in which text should be tokenized. All of the + /// tokens produced by tokenization will fall within this source range, + /// + /// \param Tokens this pointer will be set to point to the array of tokens + /// that occur within the given source range. The returned pointer must be + /// freed with clang_disposeTokens() before the translation unit is destroyed. + /// + /// \param NumTokens will be set to the number of tokens in the \c *Tokens + /// array. + void clang_tokenize( + ffi.Pointer TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens, + ) { + return (_clang_tokenize ??= + _dylib.lookupFunction<_c_clang_tokenize, _dart_clang_tokenize>( + 'clang_tokenize'))( + TU, + Range, + Tokens, + NumTokens, + ); + } + + _dart_clang_tokenize? _clang_tokenize; + + /// Annotate the given set of tokens by providing cursors for each token + /// that can be mapped to a specific entity within the abstract syntax tree. + /// + /// This token-annotation routine is equivalent to invoking + /// clang_getCursor() for the source locations of each of the + /// tokens. The cursors provided are filtered, so that only those + /// cursors that have a direct correspondence to the token are + /// accepted. For example, given a function call \c f(x), + /// clang_getCursor() would provide the following cursors: + /// + /// * when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'. + /// * when the cursor is over the '(' or the ')', a CallExpr referring to 'f'. + /// * when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'. + /// + /// Only the first and last of these cursors will occur within the + /// annotate, since the tokens "f" and "x' directly refer to a function + /// and a variable, respectively, but the parentheses are just a small + /// part of the full syntax of the function call expression, which is + /// not provided as an annotation. + /// + /// \param TU the translation unit that owns the given tokens. + /// + /// \param Tokens the set of tokens to annotate. + /// + /// \param NumTokens the number of tokens in \p Tokens. + /// + /// \param Cursors an array of \p NumTokens cursors, whose contents will be + /// replaced with the cursors corresponding to each token. + void clang_annotateTokens( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ffi.Pointer Cursors, + ) { + return (_clang_annotateTokens ??= _dylib.lookupFunction< + _c_clang_annotateTokens, + _dart_clang_annotateTokens>('clang_annotateTokens'))( + TU, + Tokens, + NumTokens, + Cursors, + ); + } + + _dart_clang_annotateTokens? _clang_annotateTokens; + + /// Free the given set of tokens. + void clang_disposeTokens( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ) { + return (_clang_disposeTokens ??= _dylib.lookupFunction< + _c_clang_disposeTokens, + _dart_clang_disposeTokens>('clang_disposeTokens'))( + TU, + Tokens, + NumTokens, + ); + } + + _dart_clang_disposeTokens? _clang_disposeTokens; + + /// \defgroup CINDEX_DEBUG Debugging facilities + /// + /// These routines are used for testing and debugging, only, and should not + /// be relied upon. + /// + /// @{ + CXString clang_getCursorKindSpelling( + int Kind, + ) { + return (_clang_getCursorKindSpelling ??= _dylib.lookupFunction< + _c_clang_getCursorKindSpelling, + _dart_clang_getCursorKindSpelling>('clang_getCursorKindSpelling'))( + Kind, + ); + } + + _dart_clang_getCursorKindSpelling? _clang_getCursorKindSpelling; + + void clang_getDefinitionSpellingAndExtent( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, + ) { + return (_clang_getDefinitionSpellingAndExtent ??= _dylib.lookupFunction< + _c_clang_getDefinitionSpellingAndExtent, + _dart_clang_getDefinitionSpellingAndExtent>( + 'clang_getDefinitionSpellingAndExtent'))( + arg0, + startBuf, + endBuf, + startLine, + startColumn, + endLine, + endColumn, + ); + } + + _dart_clang_getDefinitionSpellingAndExtent? + _clang_getDefinitionSpellingAndExtent; + + void clang_enableStackTraces() { + return (_clang_enableStackTraces ??= _dylib.lookupFunction< + _c_clang_enableStackTraces, + _dart_clang_enableStackTraces>('clang_enableStackTraces'))(); + } + + _dart_clang_enableStackTraces? _clang_enableStackTraces; + + void clang_executeOnThread( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, + ) { + return (_clang_executeOnThread ??= _dylib.lookupFunction< + _c_clang_executeOnThread, + _dart_clang_executeOnThread>('clang_executeOnThread'))( + fn, + user_data, + stack_size, + ); + } + + _dart_clang_executeOnThread? _clang_executeOnThread; + + /// Determine the kind of a particular chunk within a completion string. + /// + /// \param completion_string the completion string to query. + /// + /// \param chunk_number the 0-based index of the chunk in the completion string. + /// + /// \returns the kind of the chunk at the index \c chunk_number. + int clang_getCompletionChunkKind( + ffi.Pointer completion_string, + int chunk_number, + ) { + return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkKind, + _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( + completion_string, + chunk_number, + ); + } + + _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; + + /// Retrieve the text associated with a particular chunk within a + /// completion string. + /// + /// \param completion_string the completion string to query. + /// + /// \param chunk_number the 0-based index of the chunk in the completion string. + /// + /// \returns the text associated with the chunk at index \c chunk_number. + CXString clang_getCompletionChunkText( + ffi.Pointer completion_string, + int chunk_number, + ) { + return (_clang_getCompletionChunkText ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkText, + _dart_clang_getCompletionChunkText>('clang_getCompletionChunkText'))( + completion_string, + chunk_number, + ); + } + + _dart_clang_getCompletionChunkText? _clang_getCompletionChunkText; + + /// Retrieve the completion string associated with a particular chunk + /// within a completion string. + /// + /// \param completion_string the completion string to query. + /// + /// \param chunk_number the 0-based index of the chunk in the completion string. + /// + /// \returns the completion string associated with the chunk at index + /// \c chunk_number. + ffi.Pointer clang_getCompletionChunkCompletionString( + ffi.Pointer completion_string, + int chunk_number, + ) { + return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkCompletionString, + _dart_clang_getCompletionChunkCompletionString>( + 'clang_getCompletionChunkCompletionString'))( + completion_string, + chunk_number, + ); + } + + _dart_clang_getCompletionChunkCompletionString? + _clang_getCompletionChunkCompletionString; + + /// Retrieve the number of chunks in the given code-completion string. + int clang_getNumCompletionChunks( + ffi.Pointer completion_string, + ) { + return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< + _c_clang_getNumCompletionChunks, + _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( + completion_string, + ); + } + + _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; + + /// Determine the priority of this code completion. + /// + /// The priority of a code completion indicates how likely it is that this + /// particular completion is the completion that the user will select. The + /// priority is selected by various internal heuristics. + /// + /// \param completion_string The completion string to query. + /// + /// \returns The priority of this completion string. Smaller values indicate + /// higher-priority (more likely) completions. + int clang_getCompletionPriority( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionPriority ??= _dylib.lookupFunction< + _c_clang_getCompletionPriority, + _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( + completion_string, + ); + } + + _dart_clang_getCompletionPriority? _clang_getCompletionPriority; + + /// Determine the availability of the entity that this code-completion + /// string refers to. + /// + /// \param completion_string The completion string to query. + /// + /// \returns The availability of the completion string. + int clang_getCompletionAvailability( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< + _c_clang_getCompletionAvailability, + _dart_clang_getCompletionAvailability>( + 'clang_getCompletionAvailability'))( + completion_string, + ); + } + + _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; + + /// Retrieve the number of annotations associated with the given + /// completion string. + /// + /// \param completion_string the completion string to query. + /// + /// \returns the number of annotations associated with the given completion + /// string. + int clang_getCompletionNumAnnotations( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< + _c_clang_getCompletionNumAnnotations, + _dart_clang_getCompletionNumAnnotations>( + 'clang_getCompletionNumAnnotations'))( + completion_string, + ); + } + + _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; + + /// Retrieve the annotation associated with the given completion string. + /// + /// \param completion_string the completion string to query. + /// + /// \param annotation_number the 0-based index of the annotation of the + /// completion string. + /// + /// \returns annotation string associated with the completion at index + /// \c annotation_number, or a NULL string if that annotation is not available. + CXString clang_getCompletionAnnotation( + ffi.Pointer completion_string, + int annotation_number, + ) { + return (_clang_getCompletionAnnotation ??= _dylib.lookupFunction< + _c_clang_getCompletionAnnotation, + _dart_clang_getCompletionAnnotation>('clang_getCompletionAnnotation'))( + completion_string, + annotation_number, + ); + } + + _dart_clang_getCompletionAnnotation? _clang_getCompletionAnnotation; + + /// Retrieve the parent context of the given completion string. + /// + /// The parent context of a completion string is the semantic parent of + /// the declaration (if any) that the code completion represents. For example, + /// a code completion for an Objective-C method would have the method's class + /// or protocol as its context. + /// + /// \param completion_string The code completion string whose parent is + /// being queried. + /// + /// \param kind DEPRECATED: always set to CXCursor_NotImplemented if non-NULL. + /// + /// \returns The name of the completion parent, e.g., "NSObject" if + /// the completion string represents a method in the NSObject class. + CXString clang_getCompletionParent( + ffi.Pointer completion_string, + ffi.Pointer kind, + ) { + return (_clang_getCompletionParent ??= _dylib.lookupFunction< + _c_clang_getCompletionParent, + _dart_clang_getCompletionParent>('clang_getCompletionParent'))( + completion_string, + kind, + ); + } + + _dart_clang_getCompletionParent? _clang_getCompletionParent; + + /// Retrieve the brief documentation comment attached to the declaration + /// that corresponds to the given completion string. + CXString clang_getCompletionBriefComment( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionBriefComment ??= _dylib.lookupFunction< + _c_clang_getCompletionBriefComment, + _dart_clang_getCompletionBriefComment>( + 'clang_getCompletionBriefComment'))( + completion_string, + ); + } + + _dart_clang_getCompletionBriefComment? _clang_getCompletionBriefComment; + + /// Retrieve a completion string for an arbitrary declaration or macro + /// definition cursor. + /// + /// \param cursor The cursor to query. + /// + /// \returns A non-context-sensitive completion string for declaration and macro + /// definition cursors, or NULL for other kinds of cursors. + ffi.Pointer clang_getCursorCompletionString( + CXCursor cursor, + ) { + return (_clang_getCursorCompletionString ??= _dylib.lookupFunction< + _c_clang_getCursorCompletionString, + _dart_clang_getCursorCompletionString>( + 'clang_getCursorCompletionString'))( + cursor, + ); + } + + _dart_clang_getCursorCompletionString? _clang_getCursorCompletionString; + + /// Retrieve the number of fix-its for the given completion index. + /// + /// Calling this makes sense only if CXCodeComplete_IncludeCompletionsWithFixIts + /// option was set. + /// + /// \param results The structure keeping all completion results + /// + /// \param completion_index The index of the completion + /// + /// \return The number of fix-its which must be applied before the completion at + /// completion_index can be applied + int clang_getCompletionNumFixIts( + ffi.Pointer results, + int completion_index, + ) { + return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< + _c_clang_getCompletionNumFixIts, + _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( + results, + completion_index, + ); + } + + _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; + + /// Fix-its that *must* be applied before inserting the text for the + /// corresponding completion. + /// + /// By default, clang_codeCompleteAt() only returns completions with empty + /// fix-its. Extra completions with non-empty fix-its should be explicitly + /// requested by setting CXCodeComplete_IncludeCompletionsWithFixIts. + /// + /// For the clients to be able to compute position of the cursor after applying + /// fix-its, the following conditions are guaranteed to hold for + /// replacement_range of the stored fix-its: + /// - Ranges in the fix-its are guaranteed to never contain the completion + /// point (or identifier under completion point, if any) inside them, except + /// at the start or at the end of the range. + /// - If a fix-it range starts or ends with completion point (or starts or + /// ends after the identifier under completion point), it will contain at + /// least one character. It allows to unambiguously recompute completion + /// point after applying the fix-it. + /// + /// The intuition is that provided fix-its change code around the identifier we + /// complete, but are not allowed to touch the identifier itself or the + /// completion point. One example of completions with corrections are the ones + /// replacing '.' with '->' and vice versa: + /// + /// std::unique_ptr> vec_ptr; + /// In 'vec_ptr.^', one of the completions is 'push_back', it requires + /// replacing '.' with '->'. + /// In 'vec_ptr->^', one of the completions is 'release', it requires + /// replacing '->' with '.'. + /// + /// \param results The structure keeping all completion results + /// + /// \param completion_index The index of the completion + /// + /// \param fixit_index The index of the fix-it for the completion at + /// completion_index + /// + /// \param replacement_range The fix-it range that must be replaced before the + /// completion at completion_index can be applied + /// + /// \returns The fix-it string that must replace the code at replacement_range + /// before the completion at completion_index can be applied + CXString clang_getCompletionFixIt( + ffi.Pointer results, + int completion_index, + int fixit_index, + ffi.Pointer replacement_range, + ) { + return (_clang_getCompletionFixIt ??= _dylib.lookupFunction< + _c_clang_getCompletionFixIt, + _dart_clang_getCompletionFixIt>('clang_getCompletionFixIt'))( + results, + completion_index, + fixit_index, + replacement_range, + ); + } + + _dart_clang_getCompletionFixIt? _clang_getCompletionFixIt; + + /// Returns a default set of code-completion options that can be + /// passed to\c clang_codeCompleteAt(). + int clang_defaultCodeCompleteOptions() { + return (_clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< + _c_clang_defaultCodeCompleteOptions, + _dart_clang_defaultCodeCompleteOptions>( + 'clang_defaultCodeCompleteOptions'))(); + } + + _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; + + /// Perform code completion at a given location in a translation unit. + /// + /// This function performs code completion at a particular file, line, and + /// column within source code, providing results that suggest potential + /// code snippets based on the context of the completion. The basic model + /// for code completion is that Clang will parse a complete source file, + /// performing syntax checking up to the location where code-completion has + /// been requested. At that point, a special code-completion token is passed + /// to the parser, which recognizes this token and determines, based on the + /// current location in the C/Objective-C/C++ grammar and the state of + /// semantic analysis, what completions to provide. These completions are + /// returned via a new \c CXCodeCompleteResults structure. + /// + /// Code completion itself is meant to be triggered by the client when the + /// user types punctuation characters or whitespace, at which point the + /// code-completion location will coincide with the cursor. For example, if \c p + /// is a pointer, code-completion might be triggered after the "-" and then + /// after the ">" in \c p->. When the code-completion location is after the ">", + /// the completion results will provide, e.g., the members of the struct that + /// "p" points to. The client is responsible for placing the cursor at the + /// beginning of the token currently being typed, then filtering the results + /// based on the contents of the token. For example, when code-completing for + /// the expression \c p->get, the client should provide the location just after + /// the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the + /// client can filter the results based on the current token text ("get"), only + /// showing those results that start with "get". The intent of this interface + /// is to separate the relatively high-latency acquisition of code-completion + /// results from the filtering of results on a per-character basis, which must + /// have a lower latency. + /// + /// \param TU The translation unit in which code-completion should + /// occur. The source files for this translation unit need not be + /// completely up-to-date (and the contents of those source files may + /// be overridden via \p unsaved_files). Cursors referring into the + /// translation unit may be invalidated by this invocation. + /// + /// \param complete_filename The name of the source file where code + /// completion should be performed. This filename may be any file + /// included in the translation unit. + /// + /// \param complete_line The line at which code-completion should occur. + /// + /// \param complete_column The column at which code-completion should occur. + /// Note that the column should point just after the syntactic construct that + /// initiated code completion, and not in the middle of a lexical token. + /// + /// \param unsaved_files the Files that have not yet been saved to disk + /// but may be required for parsing or code completion, including the + /// contents of those files. The contents and name of these files (as + /// specified by CXUnsavedFile) are copied when necessary, so the + /// client only needs to guarantee their validity until the call to + /// this function returns. + /// + /// \param num_unsaved_files The number of unsaved file entries in \p + /// unsaved_files. + /// + /// \param options Extra options that control the behavior of code + /// completion, expressed as a bitwise OR of the enumerators of the + /// CXCodeComplete_Flags enumeration. The + /// \c clang_defaultCodeCompleteOptions() function returns a default set + /// of code-completion options. + /// + /// \returns If successful, a new \c CXCodeCompleteResults structure + /// containing code-completion results, which should eventually be + /// freed with \c clang_disposeCodeCompleteResults(). If code + /// completion fails, returns NULL. + ffi.Pointer clang_codeCompleteAt( + ffi.Pointer TU, + ffi.Pointer complete_filename, + int complete_line, + int complete_column, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, + ) { + return (_clang_codeCompleteAt ??= _dylib.lookupFunction< + _c_clang_codeCompleteAt, + _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( + TU, + complete_filename, + complete_line, + complete_column, + unsaved_files, + num_unsaved_files, + options, + ); + } + + _dart_clang_codeCompleteAt? _clang_codeCompleteAt; + + /// Sort the code-completion results in case-insensitive alphabetical + /// order. + /// + /// \param Results The set of results to sort. + /// \param NumResults The number of results in \p Results. + void clang_sortCodeCompletionResults( + ffi.Pointer Results, + int NumResults, + ) { + return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< + _c_clang_sortCodeCompletionResults, + _dart_clang_sortCodeCompletionResults>( + 'clang_sortCodeCompletionResults'))( + Results, + NumResults, + ); + } + + _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; + + /// Free the given set of code-completion results. + void clang_disposeCodeCompleteResults( + ffi.Pointer Results, + ) { + return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< + _c_clang_disposeCodeCompleteResults, + _dart_clang_disposeCodeCompleteResults>( + 'clang_disposeCodeCompleteResults'))( + Results, + ); + } + + _dart_clang_disposeCodeCompleteResults? _clang_disposeCodeCompleteResults; + + /// Determine the number of diagnostics produced prior to the + /// location where code completion was performed. + int clang_codeCompleteGetNumDiagnostics( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetNumDiagnostics, + _dart_clang_codeCompleteGetNumDiagnostics>( + 'clang_codeCompleteGetNumDiagnostics'))( + Results, + ); + } + + _dart_clang_codeCompleteGetNumDiagnostics? + _clang_codeCompleteGetNumDiagnostics; + + /// Retrieve a diagnostic associated with the given code completion. + /// + /// \param Results the code completion results to query. + /// \param Index the zero-based diagnostic number to retrieve. + /// + /// \returns the requested diagnostic. This diagnostic must be freed + /// via a call to \c clang_disposeDiagnostic(). + ffi.Pointer clang_codeCompleteGetDiagnostic( + ffi.Pointer Results, + int Index, + ) { + return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetDiagnostic, + _dart_clang_codeCompleteGetDiagnostic>( + 'clang_codeCompleteGetDiagnostic'))( + Results, + Index, + ); + } + + _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; + + /// Determines what completions are appropriate for the context + /// the given code completion. + /// + /// \param Results the code completion results to query + /// + /// \returns the kinds of completions that are appropriate for use + /// along with the given code completion results. + int clang_codeCompleteGetContexts( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContexts, + _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( + Results, + ); + } + + _dart_clang_codeCompleteGetContexts? _clang_codeCompleteGetContexts; + + /// Returns the cursor kind for the container for the current code + /// completion context. The container is only guaranteed to be set for + /// contexts where a container exists (i.e. member accesses or Objective-C + /// message sends); if there is not a container, this function will return + /// CXCursor_InvalidCode. + /// + /// \param Results the code completion results to query + /// + /// \param IsIncomplete on return, this value will be false if Clang has complete + /// information about the container. If Clang does not have complete + /// information, this value will be true. + /// + /// \returns the container kind, or CXCursor_InvalidCode if there is not a + /// container + int clang_codeCompleteGetContainerKind( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, + ) { + return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContainerKind, + _dart_clang_codeCompleteGetContainerKind>( + 'clang_codeCompleteGetContainerKind'))( + Results, + IsIncomplete, + ); + } + + _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; + + /// Returns the USR for the container for the current code completion + /// context. If there is not a container for the current context, this + /// function will return the empty string. + /// + /// \param Results the code completion results to query + /// + /// \returns the USR for the container + CXString clang_codeCompleteGetContainerUSR( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetContainerUSR ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContainerUSR, + _dart_clang_codeCompleteGetContainerUSR>( + 'clang_codeCompleteGetContainerUSR'))( + Results, + ); + } + + _dart_clang_codeCompleteGetContainerUSR? _clang_codeCompleteGetContainerUSR; + + /// Returns the currently-entered selector for an Objective-C message + /// send, formatted like "initWithFoo:bar:". Only guaranteed to return a + /// non-empty string for CXCompletionContext_ObjCInstanceMessage and + /// CXCompletionContext_ObjCClassMessage. + /// + /// \param Results the code completion results to query + /// + /// \returns the selector (or partial selector) that has been entered thus far + /// for an Objective-C message send. + CXString clang_codeCompleteGetObjCSelector( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetObjCSelector ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetObjCSelector, + _dart_clang_codeCompleteGetObjCSelector>( + 'clang_codeCompleteGetObjCSelector'))( + Results, + ); + } + + _dart_clang_codeCompleteGetObjCSelector? _clang_codeCompleteGetObjCSelector; + + /// Return a version string, suitable for showing to a user, but not + /// intended to be parsed (the format is not guaranteed to be stable). + CXString clang_getClangVersion() { + return (_clang_getClangVersion ??= _dylib.lookupFunction< + _c_clang_getClangVersion, + _dart_clang_getClangVersion>('clang_getClangVersion'))(); + } + + _dart_clang_getClangVersion? _clang_getClangVersion; + + /// Enable/disable crash recovery. + /// + /// \param isEnabled Flag to indicate if crash recovery is enabled. A non-zero + /// value enables crash recovery, while 0 disables it. + void clang_toggleCrashRecovery( + int isEnabled, + ) { + return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< + _c_clang_toggleCrashRecovery, + _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( + isEnabled, + ); + } + + _dart_clang_toggleCrashRecovery? _clang_toggleCrashRecovery; + + /// Visit the set of preprocessor inclusions in a translation unit. + /// The visitor function is called with the provided data for every included + /// file. This does not include headers included by the PCH file (unless one + /// is inspecting the inclusions in the PCH file itself). + void clang_getInclusions( + ffi.Pointer tu, + ffi.Pointer> visitor, + ffi.Pointer client_data, + ) { + return (_clang_getInclusions ??= _dylib.lookupFunction< + _c_clang_getInclusions, + _dart_clang_getInclusions>('clang_getInclusions'))( + tu, + visitor, + client_data, + ); + } + + _dart_clang_getInclusions? _clang_getInclusions; + + /// If cursor is a statement declaration tries to evaluate the + /// statement and if its variable, tries to evaluate its initializer, + /// into its corresponding type. + ffi.Pointer clang_Cursor_Evaluate( + CXCursor C, + ) { + return (_clang_Cursor_Evaluate ??= _dylib.lookupFunction< + _c_clang_Cursor_Evaluate, + _dart_clang_Cursor_Evaluate>('clang_Cursor_Evaluate'))( + C, + ); + } + + _dart_clang_Cursor_Evaluate? _clang_Cursor_Evaluate; + + /// Returns the kind of the evaluated result. + int clang_EvalResult_getKind( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< + _c_clang_EvalResult_getKind, + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( + E, + ); + } + + _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; + + /// Returns the evaluation result as integer if the + /// kind is Int. + int clang_EvalResult_getAsInt( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsInt, + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( + E, + ); + } + + _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; + + /// Returns the evaluation result as a long long integer if the + /// kind is Int. This prevents overflows that may happen if the result is + /// returned with clang_EvalResult_getAsInt. + int clang_EvalResult_getAsLongLong( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>( + 'clang_EvalResult_getAsLongLong'))( + E, + ); + } + + _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; + + /// Returns a non-zero value if the kind is Int and the evaluation + /// result resulted in an unsigned integer. + int clang_EvalResult_isUnsignedInt( + ffi.Pointer E, + ) { + return (_clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_isUnsignedInt, + _dart_clang_EvalResult_isUnsignedInt>( + 'clang_EvalResult_isUnsignedInt'))( + E, + ); + } + + _dart_clang_EvalResult_isUnsignedInt? _clang_EvalResult_isUnsignedInt; + + /// Returns the evaluation result as an unsigned integer if + /// the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. + int clang_EvalResult_getAsUnsigned( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsUnsigned, + _dart_clang_EvalResult_getAsUnsigned>( + 'clang_EvalResult_getAsUnsigned'))( + E, + ); + } + + _dart_clang_EvalResult_getAsUnsigned? _clang_EvalResult_getAsUnsigned; + + /// Returns the evaluation result as double if the + /// kind is double. + double clang_EvalResult_getAsDouble( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsDouble, + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( + E, + ); + } + + _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; + + /// Returns the evaluation result as a constant string if the + /// kind is other than Int or float. User must not free this pointer, + /// instead call clang_EvalResult_dispose on the CXEvalResult returned + /// by clang_Cursor_Evaluate. + ffi.Pointer clang_EvalResult_getAsStr( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsStr, + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( + E, + ); + } + + _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; + + /// Disposes the created Eval memory. + void clang_EvalResult_dispose( + ffi.Pointer E, + ) { + return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< + _c_clang_EvalResult_dispose, + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( + E, + ); + } + + _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; + + /// Retrieve a remapping. + /// + /// \param path the path that contains metadata about remappings. + /// + /// \returns the requested remapping. This remapping must be freed + /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. + ffi.Pointer clang_getRemappings( + ffi.Pointer path, + ) { + return (_clang_getRemappings ??= _dylib.lookupFunction< + _c_clang_getRemappings, + _dart_clang_getRemappings>('clang_getRemappings'))( + path, + ); + } + + _dart_clang_getRemappings? _clang_getRemappings; + + /// Retrieve a remapping. + /// + /// \param filePaths pointer to an array of file paths containing remapping info. + /// + /// \param numFiles number of file paths. + /// + /// \returns the requested remapping. This remapping must be freed + /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. + ffi.Pointer clang_getRemappingsFromFileList( + ffi.Pointer> filePaths, + int numFiles, + ) { + return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< + _c_clang_getRemappingsFromFileList, + _dart_clang_getRemappingsFromFileList>( + 'clang_getRemappingsFromFileList'))( + filePaths, + numFiles, + ); + } + + _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; + + /// Determine the number of remappings. + int clang_remap_getNumFiles( + ffi.Pointer arg0, + ) { + return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< + _c_clang_remap_getNumFiles, + _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( + arg0, + ); + } + + _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; + + /// Get the original and the associated filename from the remapping. + /// + /// \param original If non-NULL, will be set to the original filename. + /// + /// \param transformed If non-NULL, will be set to the filename that the original + /// is associated with. + void clang_remap_getFilenames( + ffi.Pointer arg0, + int index, + ffi.Pointer original, + ffi.Pointer transformed, + ) { + return (_clang_remap_getFilenames ??= _dylib.lookupFunction< + _c_clang_remap_getFilenames, + _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( + arg0, + index, + original, + transformed, + ); + } + + _dart_clang_remap_getFilenames? _clang_remap_getFilenames; + + /// Dispose the remapping. + void clang_remap_dispose( + ffi.Pointer arg0, + ) { + return (_clang_remap_dispose ??= _dylib.lookupFunction< + _c_clang_remap_dispose, + _dart_clang_remap_dispose>('clang_remap_dispose'))( + arg0, + ); + } + + _dart_clang_remap_dispose? _clang_remap_dispose; + + /// Find references of a declaration in a specific file. + /// + /// \param cursor pointing to a declaration or a reference of one. + /// + /// \param file to search for references. + /// + /// \param visitor callback that will receive pairs of CXCursor/CXSourceRange for + /// each reference found. + /// The CXSourceRange will point inside the file; if the reference is inside + /// a macro (and not a macro argument) the CXSourceRange will be invalid. + /// + /// \returns one of the CXResult enumerators. + int clang_findReferencesInFile( + CXCursor cursor, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, + ) { + return (_clang_findReferencesInFile ??= _dylib.lookupFunction< + _c_clang_findReferencesInFile, + _dart_clang_findReferencesInFile>('clang_findReferencesInFile'))( + cursor, + file, + visitor, + ); + } + + _dart_clang_findReferencesInFile? _clang_findReferencesInFile; + + /// Find #import/#include directives in a specific file. + /// + /// \param TU translation unit containing the file to query. + /// + /// \param file to search for #import/#include directives. + /// + /// \param visitor callback that will receive pairs of CXCursor/CXSourceRange for + /// each directive found. + /// + /// \returns one of the CXResult enumerators. + int clang_findIncludesInFile( + ffi.Pointer TU, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, + ) { + return (_clang_findIncludesInFile ??= _dylib.lookupFunction< + _c_clang_findIncludesInFile, + _dart_clang_findIncludesInFile>('clang_findIncludesInFile'))( + TU, + file, + visitor, + ); + } + + _dart_clang_findIncludesInFile? _clang_findIncludesInFile; + + int clang_index_isEntityObjCContainerKind( + int arg0, + ) { + return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< + _c_clang_index_isEntityObjCContainerKind, + _dart_clang_index_isEntityObjCContainerKind>( + 'clang_index_isEntityObjCContainerKind'))( + arg0, + ); + } + + _dart_clang_index_isEntityObjCContainerKind? + _clang_index_isEntityObjCContainerKind; + + ffi.Pointer clang_index_getObjCContainerDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCContainerDeclInfo, + _dart_clang_index_getObjCContainerDeclInfo>( + 'clang_index_getObjCContainerDeclInfo'))( + arg0, + ); + } + + _dart_clang_index_getObjCContainerDeclInfo? + _clang_index_getObjCContainerDeclInfo; + + ffi.Pointer clang_index_getObjCInterfaceDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCInterfaceDeclInfo, + _dart_clang_index_getObjCInterfaceDeclInfo>( + 'clang_index_getObjCInterfaceDeclInfo'))( + arg0, + ); + } + + _dart_clang_index_getObjCInterfaceDeclInfo? + _clang_index_getObjCInterfaceDeclInfo; + + ffi.Pointer clang_index_getObjCCategoryDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCCategoryDeclInfo, + _dart_clang_index_getObjCCategoryDeclInfo>( + 'clang_index_getObjCCategoryDeclInfo'))( + arg0, + ); + } + + _dart_clang_index_getObjCCategoryDeclInfo? + _clang_index_getObjCCategoryDeclInfo; + + ffi.Pointer + clang_index_getObjCProtocolRefListInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCProtocolRefListInfo, + _dart_clang_index_getObjCProtocolRefListInfo>( + 'clang_index_getObjCProtocolRefListInfo'))( + arg0, + ); + } + + _dart_clang_index_getObjCProtocolRefListInfo? + _clang_index_getObjCProtocolRefListInfo; + + ffi.Pointer clang_index_getObjCPropertyDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCPropertyDeclInfo, + _dart_clang_index_getObjCPropertyDeclInfo>( + 'clang_index_getObjCPropertyDeclInfo'))( + arg0, + ); + } + + _dart_clang_index_getObjCPropertyDeclInfo? + _clang_index_getObjCPropertyDeclInfo; + + ffi.Pointer + clang_index_getIBOutletCollectionAttrInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getIBOutletCollectionAttrInfo ??= + _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, + _dart_clang_index_getIBOutletCollectionAttrInfo>( + 'clang_index_getIBOutletCollectionAttrInfo'))( + arg0, + ); + } + + _dart_clang_index_getIBOutletCollectionAttrInfo? + _clang_index_getIBOutletCollectionAttrInfo; + + ffi.Pointer clang_index_getCXXClassDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getCXXClassDeclInfo, + _dart_clang_index_getCXXClassDeclInfo>( + 'clang_index_getCXXClassDeclInfo'))( + arg0, + ); + } + + _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; + + /// For retrieving a custom CXIdxClientContainer attached to a + /// container. + ffi.Pointer clang_index_getClientContainer( + ffi.Pointer arg0, + ) { + return (_clang_index_getClientContainer ??= _dylib.lookupFunction< + _c_clang_index_getClientContainer, + _dart_clang_index_getClientContainer>( + 'clang_index_getClientContainer'))( + arg0, + ); + } + + _dart_clang_index_getClientContainer? _clang_index_getClientContainer; + + /// For setting a custom CXIdxClientContainer attached to a + /// container. + void clang_index_setClientContainer( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return (_clang_index_setClientContainer ??= _dylib.lookupFunction< + _c_clang_index_setClientContainer, + _dart_clang_index_setClientContainer>( + 'clang_index_setClientContainer'))( + arg0, + arg1, + ); + } + + _dart_clang_index_setClientContainer? _clang_index_setClientContainer; + + /// For retrieving a custom CXIdxClientEntity attached to an entity. + ffi.Pointer clang_index_getClientEntity( + ffi.Pointer arg0, + ) { + return (_clang_index_getClientEntity ??= _dylib.lookupFunction< + _c_clang_index_getClientEntity, + _dart_clang_index_getClientEntity>('clang_index_getClientEntity'))( + arg0, + ); + } + + _dart_clang_index_getClientEntity? _clang_index_getClientEntity; + + /// For setting a custom CXIdxClientEntity attached to an entity. + void clang_index_setClientEntity( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return (_clang_index_setClientEntity ??= _dylib.lookupFunction< + _c_clang_index_setClientEntity, + _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( + arg0, + arg1, + ); + } + + _dart_clang_index_setClientEntity? _clang_index_setClientEntity; + + /// An indexing action/session, to be applied to one or multiple + /// translation units. + /// + /// \param CIdx The index object with which the index action will be associated. + ffi.Pointer clang_IndexAction_create( + ffi.Pointer CIdx, + ) { + return (_clang_IndexAction_create ??= _dylib.lookupFunction< + _c_clang_IndexAction_create, + _dart_clang_IndexAction_create>('clang_IndexAction_create'))( + CIdx, + ); + } + + _dart_clang_IndexAction_create? _clang_IndexAction_create; + + /// Destroy the given index action. + /// + /// The index action must not be destroyed until all of the translation units + /// created within that index action have been destroyed. + void clang_IndexAction_dispose( + ffi.Pointer arg0, + ) { + return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< + _c_clang_IndexAction_dispose, + _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( + arg0, + ); + } + + _dart_clang_IndexAction_dispose? _clang_IndexAction_dispose; + + /// Index the given source file and the translation unit corresponding + /// to that file via callbacks implemented through #IndexerCallbacks. + /// + /// \param client_data pointer data supplied by the client, which will + /// be passed to the invoked callbacks. + /// + /// \param index_callbacks Pointer to indexing callbacks that the client + /// implements. + /// + /// \param index_callbacks_size Size of #IndexerCallbacks structure that gets + /// passed in index_callbacks. + /// + /// \param index_options A bitmask of options that affects how indexing is + /// performed. This should be a bitwise OR of the CXIndexOpt_XXX flags. + /// + /// \param[out] out_TU pointer to store a \c CXTranslationUnit that can be + /// reused after indexing is finished. Set to \c NULL if you do not require it. + /// + /// \returns 0 on success or if there were errors from which the compiler could + /// recover. If there is a failure from which there is no recovery, returns + /// a non-zero \c CXErrorCode. + /// + /// The rest of the parameters are the same as #clang_parseTranslationUnit. + int clang_indexSourceFile( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + ffi.Pointer> out_TU, + int TU_options, + ) { + return (_clang_indexSourceFile ??= _dylib.lookupFunction< + _c_clang_indexSourceFile, + _dart_clang_indexSourceFile>('clang_indexSourceFile'))( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + out_TU, + TU_options, + ); + } + + _dart_clang_indexSourceFile? _clang_indexSourceFile; + + /// Same as clang_indexSourceFile but requires a full command line + /// for \c command_line_args including argv[0]. This is useful if the standard + /// library paths are relative to the binary. + int clang_indexSourceFileFullArgv( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + ffi.Pointer> out_TU, + int TU_options, + ) { + return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< + _c_clang_indexSourceFileFullArgv, + _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + out_TU, + TU_options, + ); + } + + _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; + + /// Index the given translation unit via callbacks implemented through + /// #IndexerCallbacks. + /// + /// The order of callback invocations is not guaranteed to be the same as + /// when indexing a source file. The high level order will be: + /// + /// -Preprocessor callbacks invocations + /// -Declaration/reference callbacks invocations + /// -Diagnostic callback invocations + /// + /// The parameters are the same as #clang_indexSourceFile. + /// + /// \returns If there is a failure from which there is no recovery, returns + /// non-zero, otherwise returns 0. + int clang_indexTranslationUnit( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer arg5, + ) { + return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< + _c_clang_indexTranslationUnit, + _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + arg5, + ); + } + + _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; + + /// Retrieve the CXIdxFile, file, line, column, and offset represented by + /// the given CXIdxLoc. + /// + /// If the location refers into a macro expansion, retrieves the + /// location of the macro expansion and if it refers into a macro argument + /// retrieves the location of the argument. + void clang_indexLoc_getFileLocation( + CXIdxLoc loc, + ffi.Pointer> indexFile, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_indexLoc_getFileLocation ??= _dylib.lookupFunction< + _c_clang_indexLoc_getFileLocation, + _dart_clang_indexLoc_getFileLocation>( + 'clang_indexLoc_getFileLocation'))( + loc, + indexFile, + file, + line, + column, + offset, + ); + } + + _dart_clang_indexLoc_getFileLocation? _clang_indexLoc_getFileLocation; + + /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. + CXSourceLocation clang_indexLoc_getCXSourceLocation( + CXIdxLoc loc, + ) { + return (_clang_indexLoc_getCXSourceLocation ??= _dylib.lookupFunction< + _c_clang_indexLoc_getCXSourceLocation, + _dart_clang_indexLoc_getCXSourceLocation>( + 'clang_indexLoc_getCXSourceLocation'))( + loc, + ); + } + + _dart_clang_indexLoc_getCXSourceLocation? _clang_indexLoc_getCXSourceLocation; + + /// Visit the fields of a particular type. + /// + /// This function visits all the direct fields of the given cursor, + /// invoking the given \p visitor function with the cursors of each + /// visited field. The traversal may be ended prematurely, if + /// the visitor returns \c CXFieldVisit_Break. + /// + /// \param T the record type whose field may be visited. + /// + /// \param visitor the visitor function that will be invoked for each + /// field of \p T. + /// + /// \param client_data pointer data supplied by the client, which will + /// be passed to the visitor each time it is invoked. + /// + /// \returns a non-zero value if the traversal was terminated + /// prematurely by the visitor returning \c CXFieldVisit_Break. + int clang_Type_visitFields( + CXType T, + ffi.Pointer> visitor, + ffi.Pointer client_data, + ) { + return (_clang_Type_visitFields ??= _dylib.lookupFunction< + _c_clang_Type_visitFields, + _dart_clang_Type_visitFields>('clang_Type_visitFields'))( + T, + visitor, + client_data, + ); + } + + _dart_clang_Type_visitFields? _clang_Type_visitFields; +} + +/// A character string. +/// +/// The \c CXString type is used to return strings from the interface when +/// the ownership of that string might differ from one call to the next. +/// Use \c clang_getCString() to retrieve the string data and, once finished +/// with the string data, call \c clang_disposeString() to free the string. +class CXString extends ffi.Struct { + external ffi.Pointer data; + + @ffi.Uint32() + external int private_flags; +} + +class CXStringSet extends ffi.Struct { + external ffi.Pointer Strings; + + @ffi.Uint32() + external int Count; +} + +class CXTargetInfoImpl extends ffi.Struct {} + +class CXTranslationUnitImpl extends ffi.Struct {} + +/// Provides the contents of a file that has not yet been saved to disk. +/// +/// Each CXUnsavedFile instance provides the name of a file on the +/// system along with the current contents of that file that have not +/// yet been saved to disk. +class CXUnsavedFile extends ffi.Struct { + /// The file whose contents have not yet been saved. + /// + /// This file must already exist in the file system. + external ffi.Pointer Filename; + + /// A buffer containing the unsaved contents of this file. + external ffi.Pointer Contents; + + /// The length of the unsaved contents of this buffer. + @ffi.Uint64() + external int Length; +} + +/// Describes a version number of the form major.minor.subminor. +class CXVersion extends ffi.Struct { + /// The major version number, e.g., the '10' in '10.7.3'. A negative + /// value indicates that there is no version number at all. + @ffi.Int32() + external int Major; + + /// The minor version number, e.g., the '7' in '10.7.3'. This value + /// will be negative if no minor version number was provided, e.g., for + /// version '10'. + @ffi.Int32() + external int Minor; + + /// The subminor version number, e.g., the '3' in '10.7.3'. This value + /// will be negative if no minor or subminor version number was provided, + /// e.g., in version '10' or '10.7'. + @ffi.Int32() + external int Subminor; +} + +abstract class CXGlobalOptFlags { + /// Used to indicate that no special CXIndex options are needed. + static const int CXGlobalOpt_None = 0; + + /// Used to indicate that threads that libclang creates for indexing + /// purposes should use background priority. + /// + /// Affects #clang_indexSourceFile, #clang_indexTranslationUnit, + /// #clang_parseTranslationUnit, #clang_saveTranslationUnit. + static const int CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1; + + /// Used to indicate that threads that libclang creates for editing + /// purposes should use background priority. + /// + /// Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt, + /// #clang_annotateTokens + static const int CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2; + + /// Used to indicate that all threads that libclang creates should use + /// background priority. + static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; +} + +/// Uniquely identifies a CXFile, that refers to the same underlying file, +/// across an indexing session. +class CXFileUniqueID extends ffi.Struct { + @ffi.Uint64() + external int _unique_data_item_0; + @ffi.Uint64() + external int _unique_data_item_1; + @ffi.Uint64() + external int _unique_data_item_2; + + /// Helper for array `data`. + ArrayHelper_CXFileUniqueID_data_level0 get data => + ArrayHelper_CXFileUniqueID_data_level0(this, [3], 0, 0); +} + +/// Helper for array `data` in struct `CXFileUniqueID`. +class ArrayHelper_CXFileUniqueID_data_level0 { + final CXFileUniqueID _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXFileUniqueID_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + int operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_data_item_0; + case 1: + return _struct._unique_data_item_1; + case 2: + return _struct._unique_data_item_2; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_data_item_0 = value; + break; + case 1: + _struct._unique_data_item_1 = value; + break; + case 2: + _struct._unique_data_item_2 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Identifies a specific source location within a translation +/// unit. +/// +/// Use clang_getExpansionLocation() or clang_getSpellingLocation() +/// to map a source location to a particular file, line, and column. +class CXSourceLocation extends ffi.Struct { + external ffi.Pointer _unique_ptr_data_item_0; + external ffi.Pointer _unique_ptr_data_item_1; + + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceLocation_ptr_data_level0(this, [2], 0, 0); + @ffi.Uint32() + external int int_data; +} + +/// Helper for array `ptr_data` in struct `CXSourceLocation`. +class ArrayHelper_CXSourceLocation_ptr_data_level0 { + final CXSourceLocation _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXSourceLocation_ptr_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_ptr_data_item_0; + case 1: + return _struct._unique_ptr_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_ptr_data_item_0 = value; + break; + case 1: + _struct._unique_ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Identifies a half-open character range in the source code. +/// +/// Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the +/// starting and end locations from a source range, respectively. +class CXSourceRange extends ffi.Struct { + external ffi.Pointer _unique_ptr_data_item_0; + external ffi.Pointer _unique_ptr_data_item_1; + + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceRange_ptr_data_level0(this, [2], 0, 0); + @ffi.Uint32() + external int begin_int_data; + + @ffi.Uint32() + external int end_int_data; +} + +/// Helper for array `ptr_data` in struct `CXSourceRange`. +class ArrayHelper_CXSourceRange_ptr_data_level0 { + final CXSourceRange _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXSourceRange_ptr_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_ptr_data_item_0; + case 1: + return _struct._unique_ptr_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_ptr_data_item_0 = value; + break; + case 1: + _struct._unique_ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Identifies an array of ranges. +class CXSourceRangeList extends ffi.Struct { + /// The number of ranges in the \c ranges array. + @ffi.Uint32() + external int count; + + /// An array of \c CXSourceRanges. + external ffi.Pointer ranges; +} + +class CXTUResourceUsageEntry extends ffi.Struct { + @ffi.Int32() + external int kind; + + @ffi.Uint64() + external int amount; +} + +/// The memory usage of a CXTranslationUnit, broken into categories. +class CXTUResourceUsage extends ffi.Struct { + external ffi.Pointer data; + + @ffi.Uint32() + external int numEntries; + + external ffi.Pointer entries; +} + +/// A cursor representing some element in the abstract syntax tree for +/// a translation unit. +/// +/// The cursor abstraction unifies the different kinds of entities in a +/// program--declaration, statements, expressions, references to declarations, +/// etc.--under a single "cursor" abstraction with a common set of operations. +/// Common operation for a cursor include: getting the physical location in +/// a source file where the cursor points, getting the name associated with a +/// cursor, and retrieving cursors for any child nodes of a particular cursor. +/// +/// Cursors can be produced in two specific ways. +/// clang_getTranslationUnitCursor() produces a cursor for a translation unit, +/// from which one can use clang_visitChildren() to explore the rest of the +/// translation unit. clang_getCursor() maps from a physical source location +/// to the entity that resides at that location, allowing one to map from the +/// source code into the AST. +class CXCursor extends ffi.Struct { + @ffi.Int32() + external int kind; + + @ffi.Int32() + external int xdata; + + external ffi.Pointer _unique_data_item_0; + external ffi.Pointer _unique_data_item_1; + external ffi.Pointer _unique_data_item_2; + + /// Helper for array `data`. + ArrayHelper_CXCursor_data_level0 get data => + ArrayHelper_CXCursor_data_level0(this, [3], 0, 0); +} + +/// Helper for array `data` in struct `CXCursor`. +class ArrayHelper_CXCursor_data_level0 { + final CXCursor _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXCursor_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_data_item_0; + case 1: + return _struct._unique_data_item_1; + case 2: + return _struct._unique_data_item_2; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_data_item_0 = value; + break; + case 1: + _struct._unique_data_item_1 = value; + break; + case 2: + _struct._unique_data_item_2 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Describes the availability of a given entity on a particular platform, e.g., +/// a particular class might only be available on Mac OS 10.7 or newer. +class CXPlatformAvailability extends ffi.Struct { + /// A string that describes the platform for which this structure + /// provides availability information. + /// + /// Possible values are "ios" or "macos". + external CXString Platform; + + /// The version number in which this entity was introduced. + external CXVersion Introduced; + + /// The version number in which this entity was deprecated (but is + /// still available). + external CXVersion Deprecated; + + /// The version number in which this entity was obsoleted, and therefore + /// is no longer available. + external CXVersion Obsoleted; + + /// Whether the entity is unconditionally unavailable on this platform. + @ffi.Int32() + external int Unavailable; + + /// An optional message to provide to a user of this API, e.g., to + /// suggest replacement APIs. + external CXString Message; +} + +class CXCursorSetImpl extends ffi.Struct {} + +/// Describes the kind of type +abstract class CXTypeKind { + /// Represents an invalid type (e.g., where no type is available). + static const int CXType_Invalid = 0; + + /// A type whose specific kind is not exposed via this + /// interface. + static const int CXType_Unexposed = 1; + static const int CXType_Void = 2; + static const int CXType_Bool = 3; + static const int CXType_Char_U = 4; + static const int CXType_UChar = 5; + static const int CXType_Char16 = 6; + static const int CXType_Char32 = 7; + static const int CXType_UShort = 8; + static const int CXType_UInt = 9; + static const int CXType_ULong = 10; + static const int CXType_ULongLong = 11; + static const int CXType_UInt128 = 12; + static const int CXType_Char_S = 13; + static const int CXType_SChar = 14; + static const int CXType_WChar = 15; + static const int CXType_Short = 16; + static const int CXType_Int = 17; + static const int CXType_Long = 18; + static const int CXType_LongLong = 19; + static const int CXType_Int128 = 20; + static const int CXType_Float = 21; + static const int CXType_Double = 22; + static const int CXType_LongDouble = 23; + static const int CXType_NullPtr = 24; + static const int CXType_Overload = 25; + static const int CXType_Dependent = 26; + static const int CXType_ObjCId = 27; + static const int CXType_ObjCClass = 28; + static const int CXType_ObjCSel = 29; + static const int CXType_Float128 = 30; + static const int CXType_Half = 31; + static const int CXType_Float16 = 32; + static const int CXType_ShortAccum = 33; + static const int CXType_Accum = 34; + static const int CXType_LongAccum = 35; + static const int CXType_UShortAccum = 36; + static const int CXType_UAccum = 37; + static const int CXType_ULongAccum = 38; + static const int CXType_FirstBuiltin = 2; + static const int CXType_LastBuiltin = 38; + static const int CXType_Complex = 100; + static const int CXType_Pointer = 101; + static const int CXType_BlockPointer = 102; + static const int CXType_LValueReference = 103; + static const int CXType_RValueReference = 104; + static const int CXType_Record = 105; + static const int CXType_Enum = 106; + static const int CXType_Typedef = 107; + static const int CXType_ObjCInterface = 108; + static const int CXType_ObjCObjectPointer = 109; + static const int CXType_FunctionNoProto = 110; + static const int CXType_FunctionProto = 111; + static const int CXType_ConstantArray = 112; + static const int CXType_Vector = 113; + static const int CXType_IncompleteArray = 114; + static const int CXType_VariableArray = 115; + static const int CXType_DependentSizedArray = 116; + static const int CXType_MemberPointer = 117; + static const int CXType_Auto = 118; + + /// Represents a type that was referred to using an elaborated type keyword. + /// + /// E.g., struct S, or via a qualified name, e.g., N::M::type, or both. + static const int CXType_Elaborated = 119; + static const int CXType_Pipe = 120; + static const int CXType_OCLImage1dRO = 121; + static const int CXType_OCLImage1dArrayRO = 122; + static const int CXType_OCLImage1dBufferRO = 123; + static const int CXType_OCLImage2dRO = 124; + static const int CXType_OCLImage2dArrayRO = 125; + static const int CXType_OCLImage2dDepthRO = 126; + static const int CXType_OCLImage2dArrayDepthRO = 127; + static const int CXType_OCLImage2dMSAARO = 128; + static const int CXType_OCLImage2dArrayMSAARO = 129; + static const int CXType_OCLImage2dMSAADepthRO = 130; + static const int CXType_OCLImage2dArrayMSAADepthRO = 131; + static const int CXType_OCLImage3dRO = 132; + static const int CXType_OCLImage1dWO = 133; + static const int CXType_OCLImage1dArrayWO = 134; + static const int CXType_OCLImage1dBufferWO = 135; + static const int CXType_OCLImage2dWO = 136; + static const int CXType_OCLImage2dArrayWO = 137; + static const int CXType_OCLImage2dDepthWO = 138; + static const int CXType_OCLImage2dArrayDepthWO = 139; + static const int CXType_OCLImage2dMSAAWO = 140; + static const int CXType_OCLImage2dArrayMSAAWO = 141; + static const int CXType_OCLImage2dMSAADepthWO = 142; + static const int CXType_OCLImage2dArrayMSAADepthWO = 143; + static const int CXType_OCLImage3dWO = 144; + static const int CXType_OCLImage1dRW = 145; + static const int CXType_OCLImage1dArrayRW = 146; + static const int CXType_OCLImage1dBufferRW = 147; + static const int CXType_OCLImage2dRW = 148; + static const int CXType_OCLImage2dArrayRW = 149; + static const int CXType_OCLImage2dDepthRW = 150; + static const int CXType_OCLImage2dArrayDepthRW = 151; + static const int CXType_OCLImage2dMSAARW = 152; + static const int CXType_OCLImage2dArrayMSAARW = 153; + static const int CXType_OCLImage2dMSAADepthRW = 154; + static const int CXType_OCLImage2dArrayMSAADepthRW = 155; + static const int CXType_OCLImage3dRW = 156; + static const int CXType_OCLSampler = 157; + static const int CXType_OCLEvent = 158; + static const int CXType_OCLQueue = 159; + static const int CXType_OCLReserveID = 160; + static const int CXType_ObjCObject = 161; + static const int CXType_ObjCTypeParam = 162; + static const int CXType_Attributed = 163; + static const int CXType_OCLIntelSubgroupAVCMcePayload = 164; + static const int CXType_OCLIntelSubgroupAVCImePayload = 165; + static const int CXType_OCLIntelSubgroupAVCRefPayload = 166; + static const int CXType_OCLIntelSubgroupAVCSicPayload = 167; + static const int CXType_OCLIntelSubgroupAVCMceResult = 168; + static const int CXType_OCLIntelSubgroupAVCImeResult = 169; + static const int CXType_OCLIntelSubgroupAVCRefResult = 170; + static const int CXType_OCLIntelSubgroupAVCSicResult = 171; + static const int CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172; + static const int CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173; + static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; + static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; + static const int CXType_ExtVector = 176; +} + +/// The type of an element in the abstract syntax tree. +class CXType extends ffi.Struct { + @ffi.Int32() + external int kind; + + external ffi.Pointer _unique_data_item_0; + external ffi.Pointer _unique_data_item_1; + + /// Helper for array `data`. + ArrayHelper_CXType_data_level0 get data => + ArrayHelper_CXType_data_level0(this, [2], 0, 0); +} + +/// Helper for array `data` in struct `CXType`. +class ArrayHelper_CXType_data_level0 { + final CXType _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXType_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_data_item_0; + case 1: + return _struct._unique_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_data_item_0 = value; + break; + case 1: + _struct._unique_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Describes a single preprocessing token. +class CXToken extends ffi.Struct { + @ffi.Uint32() + external int _unique_int_data_item_0; + @ffi.Uint32() + external int _unique_int_data_item_1; + @ffi.Uint32() + external int _unique_int_data_item_2; + @ffi.Uint32() + external int _unique_int_data_item_3; + + /// Helper for array `int_data`. + ArrayHelper_CXToken_int_data_level0 get int_data => + ArrayHelper_CXToken_int_data_level0(this, [4], 0, 0); + external ffi.Pointer ptr_data; +} + +/// Helper for array `int_data` in struct `CXToken`. +class ArrayHelper_CXToken_int_data_level0 { + final CXToken _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXToken_int_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + int operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_int_data_item_0; + case 1: + return _struct._unique_int_data_item_1; + case 2: + return _struct._unique_int_data_item_2; + case 3: + return _struct._unique_int_data_item_3; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_int_data_item_0 = value; + break; + case 1: + _struct._unique_int_data_item_1 = value; + break; + case 2: + _struct._unique_int_data_item_2 = value; + break; + case 3: + _struct._unique_int_data_item_3 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// A single result of code completion. +class CXCompletionResult extends ffi.Struct { + /// The kind of entity that this completion refers to. + /// + /// The cursor kind will be a macro, keyword, or a declaration (one of the + /// *Decl cursor kinds), describing the entity that the completion is + /// referring to. + /// + /// \todo In the future, we would like to provide a full cursor, to allow + /// the client to extract additional information from declaration. + @ffi.Int32() + external int CursorKind; + + /// The code-completion string that describes how to insert this + /// code-completion result into the editing buffer. + external ffi.Pointer CompletionString; +} + +/// Contains the results of code-completion. +/// +/// This data structure contains the results of code completion, as +/// produced by \c clang_codeCompleteAt(). Its contents must be freed by +/// \c clang_disposeCodeCompleteResults. +class CXCodeCompleteResults extends ffi.Struct { + /// The code-completion results. + external ffi.Pointer Results; + + /// The number of code-completion results stored in the + /// \c Results array. + @ffi.Uint32() + external int NumResults; +} + +class CXCursorAndRangeVisitor extends ffi.Struct { + external ffi.Pointer context; + + external ffi.Pointer> visit; +} + +/// Source location passed to index callbacks. +class CXIdxLoc extends ffi.Struct { + external ffi.Pointer _unique_ptr_data_item_0; + external ffi.Pointer _unique_ptr_data_item_1; + + /// Helper for array `ptr_data`. + ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => + ArrayHelper_CXIdxLoc_ptr_data_level0(this, [2], 0, 0); + @ffi.Uint32() + external int int_data; +} + +/// Helper for array `ptr_data` in struct `CXIdxLoc`. +class ArrayHelper_CXIdxLoc_ptr_data_level0 { + final CXIdxLoc _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXIdxLoc_ptr_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_ptr_data_item_0; + case 1: + return _struct._unique_ptr_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_ptr_data_item_0 = value; + break; + case 1: + _struct._unique_ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Data for ppIncludedFile callback. +class CXIdxIncludedFileInfo extends ffi.Struct { + /// Location of '#' in the \#include/\#import directive. + external CXIdxLoc hashLoc; + + /// Filename as written in the \#include/\#import directive. + external ffi.Pointer filename; + + /// The actual file that the \#include/\#import directive resolved to. + external ffi.Pointer file; + + @ffi.Int32() + external int isImport; + + @ffi.Int32() + external int isAngled; + + /// Non-zero if the directive was automatically turned into a module + /// import. + @ffi.Int32() + external int isModuleImport; +} + +/// Data for IndexerCallbacks#importedASTFile. +class CXIdxImportedASTFileInfo extends ffi.Struct { + /// Top level AST file containing the imported PCH, module or submodule. + external ffi.Pointer file; + + /// The imported module or NULL if the AST file is a PCH. + external ffi.Pointer module; + + /// Location where the file is imported. Applicable only for modules. + external CXIdxLoc loc; + + /// Non-zero if an inclusion directive was automatically turned into + /// a module import. Applicable only for modules. + @ffi.Int32() + external int isImplicit; +} + +class CXIdxAttrInfo extends ffi.Struct { + @ffi.Int32() + external int kind; + + external CXCursor cursor; + + external CXIdxLoc loc; +} + +class CXIdxEntityInfo extends ffi.Struct { + @ffi.Int32() + external int kind; + + @ffi.Int32() + external int templateKind; + + @ffi.Int32() + external int lang; + + external ffi.Pointer name; + + external ffi.Pointer USR; + + external CXCursor cursor; + + external ffi.Pointer> attributes; + + @ffi.Uint32() + external int numAttributes; +} + +class CXIdxContainerInfo extends ffi.Struct { + external CXCursor cursor; +} + +class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { + external ffi.Pointer attrInfo; + + external ffi.Pointer objcClass; + + external CXCursor classCursor; + + external CXIdxLoc classLoc; +} + +class CXIdxDeclInfo extends ffi.Struct { + external ffi.Pointer entityInfo; + + external CXCursor cursor; + + external CXIdxLoc loc; + + external ffi.Pointer semanticContainer; + + /// Generally same as #semanticContainer but can be different in + /// cases like out-of-line C++ member functions. + external ffi.Pointer lexicalContainer; + + @ffi.Int32() + external int isRedeclaration; + + @ffi.Int32() + external int isDefinition; + + @ffi.Int32() + external int isContainer; + + external ffi.Pointer declAsContainer; + + /// Whether the declaration exists in code or was created implicitly + /// by the compiler, e.g. implicit Objective-C methods for properties. + @ffi.Int32() + external int isImplicit; + + external ffi.Pointer> attributes; + + @ffi.Uint32() + external int numAttributes; + + @ffi.Uint32() + external int flags; +} + +class CXIdxObjCContainerDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; + + @ffi.Int32() + external int kind; +} + +class CXIdxBaseClassInfo extends ffi.Struct { + external ffi.Pointer base; + + external CXCursor cursor; + + external CXIdxLoc loc; +} + +class CXIdxObjCProtocolRefInfo extends ffi.Struct { + external ffi.Pointer protocol; + + external CXCursor cursor; + + external CXIdxLoc loc; +} + +class CXIdxObjCProtocolRefListInfo extends ffi.Struct { + external ffi.Pointer> protocols; + + @ffi.Uint32() + external int numProtocols; +} + +class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; + + external ffi.Pointer superInfo; + + external ffi.Pointer protocols; +} + +class CXIdxObjCCategoryDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; + + external ffi.Pointer objcClass; + + external CXCursor classCursor; + + external CXIdxLoc classLoc; + + external ffi.Pointer protocols; +} + +class CXIdxObjCPropertyDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; + + external ffi.Pointer getter; + + external ffi.Pointer setter; +} + +class CXIdxCXXClassDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; + + external ffi.Pointer> bases; + + @ffi.Uint32() + external int numBases; +} + +/// Data for IndexerCallbacks#indexEntityReference. +class CXIdxEntityRefInfo extends ffi.Struct { + @ffi.Int32() + external int kind; + + /// Reference cursor. + external CXCursor cursor; + + external CXIdxLoc loc; + + /// The entity that gets referenced. + external ffi.Pointer referencedEntity; + + /// Immediate "parent" of the reference. For example: + /// + /// \code + /// Foo *var; + /// \endcode + /// + /// The parent of reference of type 'Foo' is the variable 'var'. + /// For references inside statement bodies of functions/methods, + /// the parentEntity will be the function/method. + external ffi.Pointer parentEntity; + + /// Lexical container context of the reference. + external ffi.Pointer container; + + /// Sets of symbol roles of the reference. + @ffi.Int32() + external int role; +} + +/// A group of callbacks used by #clang_indexSourceFile and +/// #clang_indexTranslationUnit. +class IndexerCallbacks extends ffi.Struct { + /// Called periodically to check whether indexing should be aborted. + /// Should return 0 to continue, and non-zero to abort. + external ffi.Pointer> abortQuery; + + /// Called at the end of indexing; passes the complete diagnostic set. + external ffi.Pointer> diagnostic; + + external ffi.Pointer> enteredMainFile; + + /// Called when a file gets \#included/\#imported. + external ffi.Pointer> ppIncludedFile; + + /// Called when a AST file (PCH or module) gets imported. + /// + /// AST files will not get indexed (there will not be callbacks to index all + /// the entities in an AST file). The recommended action is that, if the AST + /// file is not already indexed, to initiate a new indexing job specific to + /// the AST file. + external ffi.Pointer> importedASTFile; + + /// Called at the beginning of indexing a translation unit. + external ffi.Pointer> startedTranslationUnit; + + external ffi.Pointer> indexDeclaration; + + /// Called to index a reference of an entity. + external ffi.Pointer> indexEntityReference; +} + +const int CINDEX_VERSION_MAJOR = 0; + +const int CINDEX_VERSION_MINOR = 59; + +const int CINDEX_VERSION = 59; + +const String CINDEX_VERSION_STRING = '0.59'; + +typedef _c_clang_getCString = ffi.Pointer Function( + CXString string, +); + +typedef _dart_clang_getCString = ffi.Pointer Function( + CXString string, +); + +typedef _c_clang_disposeString = ffi.Void Function( + CXString string, +); + +typedef _dart_clang_disposeString = void Function( + CXString string, +); + +typedef _c_clang_disposeStringSet = ffi.Void Function( + ffi.Pointer set_1, +); + +typedef _dart_clang_disposeStringSet = void Function( + ffi.Pointer set_1, +); + +typedef _c_clang_createIndex = ffi.Pointer Function( + ffi.Int32 excludeDeclarationsFromPCH, + ffi.Int32 displayDiagnostics, +); + +typedef _dart_clang_createIndex = ffi.Pointer Function( + int excludeDeclarationsFromPCH, + int displayDiagnostics, +); + +typedef _c_clang_disposeIndex = ffi.Void Function( + ffi.Pointer index, +); + +typedef _dart_clang_disposeIndex = void Function( + ffi.Pointer index, +); + +typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( + ffi.Pointer arg0, + ffi.Uint32 options, +); + +typedef _dart_clang_CXIndex_setGlobalOptions = void Function( + ffi.Pointer arg0, + int options, +); + +typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_CXIndex_getGlobalOptions = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer Path, +); + +typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( + ffi.Pointer arg0, + ffi.Pointer Path, +); + +typedef _c_clang_getFileName = CXString Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileName = CXString Function( + ffi.Pointer SFile, +); + +typedef _c_clang_getFileTime = ffi.Int64 Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileTime = int Function( + ffi.Pointer SFile, +); + +typedef _c_clang_getFileUniqueID = ffi.Int32 Function( + ffi.Pointer file, + ffi.Pointer outID, +); + +typedef _dart_clang_getFileUniqueID = int Function( + ffi.Pointer file, + ffi.Pointer outID, +); + +typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _c_clang_getFile = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file_name, +); + +typedef _dart_clang_getFile = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file_name, +); + +typedef _c_clang_getFileContents = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, +); + +typedef _dart_clang_getFileContents = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, +); + +typedef _c_clang_File_isEqual = ffi.Int32 Function( + ffi.Pointer file1, + ffi.Pointer file2, +); + +typedef _dart_clang_File_isEqual = int Function( + ffi.Pointer file1, + ffi.Pointer file2, +); + +typedef _c_clang_File_tryGetRealPathName = CXString Function( + ffi.Pointer file, +); + +typedef _dart_clang_File_tryGetRealPathName = CXString Function( + ffi.Pointer file, +); + +typedef _c_clang_getNullLocation = CXSourceLocation Function(); + +typedef _dart_clang_getNullLocation = CXSourceLocation Function(); + +typedef _c_clang_equalLocations = ffi.Uint32 Function( + CXSourceLocation loc1, + CXSourceLocation loc2, +); + +typedef _dart_clang_equalLocations = int Function( + CXSourceLocation loc1, + CXSourceLocation loc2, +); + +typedef _c_clang_getLocation = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Uint32 line, + ffi.Uint32 column, +); + +typedef _dart_clang_getLocation = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + int line, + int column, +); + +typedef _c_clang_getLocationForOffset = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Uint32 offset, +); + +typedef _dart_clang_getLocationForOffset = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + int offset, +); + +typedef _c_clang_Location_isInSystemHeader = ffi.Int32 Function( + CXSourceLocation location, +); + +typedef _dart_clang_Location_isInSystemHeader = int Function( + CXSourceLocation location, +); + +typedef _c_clang_Location_isFromMainFile = ffi.Int32 Function( + CXSourceLocation location, +); + +typedef _dart_clang_Location_isFromMainFile = int Function( + CXSourceLocation location, +); + +typedef _c_clang_getNullRange = CXSourceRange Function(); + +typedef _dart_clang_getNullRange = CXSourceRange Function(); + +typedef _c_clang_getRange = CXSourceRange Function( + CXSourceLocation begin, + CXSourceLocation end, +); + +typedef _dart_clang_getRange = CXSourceRange Function( + CXSourceLocation begin, + CXSourceLocation end, +); + +typedef _c_clang_equalRanges = ffi.Uint32 Function( + CXSourceRange range1, + CXSourceRange range2, +); + +typedef _dart_clang_equalRanges = int Function( + CXSourceRange range1, + CXSourceRange range2, +); + +typedef _c_clang_Range_isNull = ffi.Int32 Function( + CXSourceRange range, +); + +typedef _dart_clang_Range_isNull = int Function( + CXSourceRange range, +); + +typedef _c_clang_getExpansionLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getExpansionLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getPresumedLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column, +); + +typedef _dart_clang_getPresumedLocation = void Function( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column, +); + +typedef _c_clang_getInstantiationLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getInstantiationLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getSpellingLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getSpellingLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getFileLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getFileLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getRangeStart = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _dart_clang_getRangeStart = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _c_clang_getRangeEnd = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _dart_clang_getRangeEnd = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _c_clang_getSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, +); + +typedef _dart_clang_getAllSkippedRanges = ffi.Pointer + Function( + ffi.Pointer tu, +); + +typedef _c_clang_disposeSourceRangeList = ffi.Void Function( + ffi.Pointer ranges, +); + +typedef _dart_clang_disposeSourceRangeList = void Function( + ffi.Pointer ranges, +); + +typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( + ffi.Pointer Diags, +); + +typedef _dart_clang_getNumDiagnosticsInSet = int Function( + ffi.Pointer Diags, +); + +typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( + ffi.Pointer Diags, + ffi.Uint32 Index, +); + +typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( + ffi.Pointer Diags, + int Index, +); + +typedef _c_clang_loadDiagnostics = ffi.Pointer Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, +); + +typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, +); + +typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( + ffi.Pointer Diags, +); + +typedef _dart_clang_disposeDiagnosticSet = void Function( + ffi.Pointer Diags, +); + +typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, +); + +typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, +); + +typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Unit, +); + +typedef _dart_clang_getNumDiagnostics = int Function( + ffi.Pointer Unit, +); + +typedef _c_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + ffi.Uint32 Index, +); + +typedef _dart_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + int Index, +); + +typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); + +typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); + +typedef _c_clang_disposeDiagnostic = ffi.Void Function( + ffi.Pointer Diagnostic, +); + +typedef _dart_clang_disposeDiagnostic = void Function( + ffi.Pointer Diagnostic, +); + +typedef _c_clang_formatDiagnostic = CXString Function( + ffi.Pointer Diagnostic, + ffi.Uint32 Options, +); + +typedef _dart_clang_formatDiagnostic = CXString Function( + ffi.Pointer Diagnostic, + int Options, +); + +typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); + +typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); + +typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticSeverity = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticLocation = CXSourceLocation Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticLocation = CXSourceLocation Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticSpelling = CXString Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticSpelling = CXString Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticOption = CXString Function( + ffi.Pointer Diag, + ffi.Pointer Disable, +); + +typedef _dart_clang_getDiagnosticOption = CXString Function( + ffi.Pointer Diag, + ffi.Pointer Disable, +); + +typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticCategory = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticCategoryName = CXString Function( + ffi.Uint32 Category, +); + +typedef _dart_clang_getDiagnosticCategoryName = CXString Function( + int Category, +); + +typedef _c_clang_getDiagnosticCategoryText = CXString Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticCategoryText = CXString Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticNumRanges = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticRange = CXSourceRange Function( + ffi.Pointer Diagnostic, + ffi.Uint32 Range, +); + +typedef _dart_clang_getDiagnosticRange = CXSourceRange Function( + ffi.Pointer Diagnostic, + int Range, +); + +typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( + ffi.Pointer Diagnostic, +); + +typedef _dart_clang_getDiagnosticNumFixIts = int Function( + ffi.Pointer Diagnostic, +); + +typedef _c_clang_getDiagnosticFixIt = CXString Function( + ffi.Pointer Diagnostic, + ffi.Uint32 FixIt, + ffi.Pointer ReplacementRange, +); + +typedef _dart_clang_getDiagnosticFixIt = CXString Function( + ffi.Pointer Diagnostic, + int FixIt, + ffi.Pointer ReplacementRange, +); + +typedef _c_clang_getTranslationUnitSpelling = CXString Function( + ffi.Pointer CTUnit, +); + +typedef _dart_clang_getTranslationUnitSpelling = CXString Function( + ffi.Pointer CTUnit, +); + +typedef _c_clang_createTranslationUnitFromSourceFile + = ffi.Pointer Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Int32 num_clang_command_line_args, + ffi.Pointer> clang_command_line_args, + ffi.Uint32 num_unsaved_files, + ffi.Pointer unsaved_files, +); + +typedef _dart_clang_createTranslationUnitFromSourceFile + = ffi.Pointer Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + int num_clang_command_line_args, + ffi.Pointer> clang_command_line_args, + int num_unsaved_files, + ffi.Pointer unsaved_files, +); + +typedef _c_clang_createTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, +); + +typedef _dart_clang_createTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, +); + +typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, +); + +typedef _dart_clang_createTranslationUnit2 = int Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, +); + +typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); + +typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); + +typedef _c_clang_parseTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, +); + +typedef _dart_clang_parseTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, +); + +typedef _c_clang_parseTranslationUnit2 = ffi.Int32 Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, + ffi.Pointer> out_TU, +); + +typedef _dart_clang_parseTranslationUnit2 = int Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, + ffi.Pointer> out_TU, +); + +typedef _c_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, + ffi.Pointer> out_TU, +); + +typedef _dart_clang_parseTranslationUnit2FullArgv = int Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, + ffi.Pointer> out_TU, +); + +typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( + ffi.Pointer TU, +); + +typedef _dart_clang_defaultSaveOptions = int Function( + ffi.Pointer TU, +); + +typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( + ffi.Pointer TU, + ffi.Pointer FileName, + ffi.Uint32 options, +); + +typedef _dart_clang_saveTranslationUnit = int Function( + ffi.Pointer TU, + ffi.Pointer FileName, + int options, +); + +typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_suspendTranslationUnit = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_disposeTranslationUnit = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_disposeTranslationUnit = void Function( + ffi.Pointer arg0, +); + +typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( + ffi.Pointer TU, +); + +typedef _dart_clang_defaultReparseOptions = int Function( + ffi.Pointer TU, +); + +typedef _c_clang_reparseTranslationUnit = ffi.Int32 Function( + ffi.Pointer TU, + ffi.Uint32 num_unsaved_files, + ffi.Pointer unsaved_files, + ffi.Uint32 options, +); + +typedef _dart_clang_reparseTranslationUnit = int Function( + ffi.Pointer TU, + int num_unsaved_files, + ffi.Pointer unsaved_files, + int options, +); + +typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( + ffi.Int32 kind, +); + +typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( + int kind, +); + +typedef _c_clang_getCXTUResourceUsage = CXTUResourceUsage Function( + ffi.Pointer TU, +); + +typedef _dart_clang_getCXTUResourceUsage = CXTUResourceUsage Function( + ffi.Pointer TU, +); + +typedef _c_clang_disposeCXTUResourceUsage = ffi.Void Function( + CXTUResourceUsage usage, +); + +typedef _dart_clang_disposeCXTUResourceUsage = void Function( + CXTUResourceUsage usage, +); + +typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, +); + +typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, +); + +typedef _c_clang_TargetInfo_dispose = ffi.Void Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_dispose = void Function( + ffi.Pointer Info, +); + +typedef _c_clang_TargetInfo_getTriple = CXString Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_getTriple = CXString Function( + ffi.Pointer Info, +); + +typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_getPointerWidth = int Function( + ffi.Pointer Info, +); + +typedef _c_clang_getNullCursor = CXCursor Function(); + +typedef _dart_clang_getNullCursor = CXCursor Function(); + +typedef _c_clang_getTranslationUnitCursor = CXCursor Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( + ffi.Pointer arg0, +); + +typedef _c_clang_equalCursors = ffi.Uint32 Function( + CXCursor arg0, + CXCursor arg1, +); + +typedef _dart_clang_equalCursors = int Function( + CXCursor arg0, + CXCursor arg1, +); + +typedef _c_clang_Cursor_isNull = ffi.Int32 Function( + CXCursor cursor, +); + +typedef _dart_clang_Cursor_isNull = int Function( + CXCursor cursor, +); + +typedef _c_clang_hashCursor = ffi.Uint32 Function( + CXCursor arg0, +); + +typedef _dart_clang_hashCursor = int Function( + CXCursor arg0, +); + +typedef _c_clang_getCursorKind = ffi.Int32 Function( + CXCursor arg0, +); + +typedef _dart_clang_getCursorKind = int Function( + CXCursor arg0, +); + +typedef _c_clang_isDeclaration = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isDeclaration = int Function( + int arg0, +); + +typedef _c_clang_isInvalidDeclaration = ffi.Uint32 Function( + CXCursor arg0, +); + +typedef _dart_clang_isInvalidDeclaration = int Function( + CXCursor arg0, +); + +typedef _c_clang_isReference = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isReference = int Function( + int arg0, +); + +typedef _c_clang_isExpression = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isExpression = int Function( + int arg0, +); + +typedef _c_clang_isStatement = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isStatement = int Function( + int arg0, +); + +typedef _c_clang_isAttribute = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isAttribute = int Function( + int arg0, +); + +typedef _c_clang_Cursor_hasAttrs = ffi.Uint32 Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_hasAttrs = int Function( + CXCursor C, +); + +typedef _c_clang_isInvalid = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isInvalid = int Function( + int arg0, +); + +typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isTranslationUnit = int Function( + int arg0, +); + +typedef _c_clang_isPreprocessing = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isPreprocessing = int Function( + int arg0, +); + +typedef _c_clang_isUnexposed = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isUnexposed = int Function( + int arg0, +); + +typedef _c_clang_getCursorLinkage = ffi.Int32 Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorLinkage = int Function( + CXCursor cursor, +); + +typedef _c_clang_getCursorVisibility = ffi.Int32 Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorVisibility = int Function( + CXCursor cursor, +); + +typedef _c_clang_getCursorAvailability = ffi.Int32 Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorAvailability = int Function( + CXCursor cursor, +); + +typedef _c_clang_getCursorPlatformAvailability = ffi.Int32 Function( + CXCursor cursor, + ffi.Pointer always_deprecated, + ffi.Pointer deprecated_message, + ffi.Pointer always_unavailable, + ffi.Pointer unavailable_message, + ffi.Pointer availability, + ffi.Int32 availability_size, +); + +typedef _dart_clang_getCursorPlatformAvailability = int Function( + CXCursor cursor, + ffi.Pointer always_deprecated, + ffi.Pointer deprecated_message, + ffi.Pointer always_unavailable, + ffi.Pointer unavailable_message, + ffi.Pointer availability, + int availability_size, +); + +typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability, +); + +typedef _dart_clang_disposeCXPlatformAvailability = void Function( + ffi.Pointer availability, +); + +typedef _c_clang_getCursorLanguage = ffi.Int32 Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorLanguage = int Function( + CXCursor cursor, +); + +typedef _c_clang_getCursorTLSKind = ffi.Int32 Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorTLSKind = int Function( + CXCursor cursor, +); + +typedef _c_clang_Cursor_getTranslationUnit = ffi.Pointer + Function( + CXCursor arg0, +); + +typedef _dart_clang_Cursor_getTranslationUnit + = ffi.Pointer Function( + CXCursor arg0, +); + +typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); + +typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); + +typedef _c_clang_disposeCXCursorSet = ffi.Void Function( + ffi.Pointer cset, +); + +typedef _dart_clang_disposeCXCursorSet = void Function( + ffi.Pointer cset, +); + +typedef _c_clang_CXCursorSet_contains = ffi.Uint32 Function( + ffi.Pointer cset, + CXCursor cursor, +); + +typedef _dart_clang_CXCursorSet_contains = int Function( + ffi.Pointer cset, + CXCursor cursor, +); + +typedef _c_clang_CXCursorSet_insert = ffi.Uint32 Function( + ffi.Pointer cset, + CXCursor cursor, +); + +typedef _dart_clang_CXCursorSet_insert = int Function( + ffi.Pointer cset, + CXCursor cursor, +); + +typedef _c_clang_getCursorSemanticParent = CXCursor Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorSemanticParent = CXCursor Function( + CXCursor cursor, +); + +typedef _c_clang_getCursorLexicalParent = CXCursor Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorLexicalParent = CXCursor Function( + CXCursor cursor, +); + +typedef _c_clang_getOverriddenCursors = ffi.Void Function( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden, +); + +typedef _dart_clang_getOverriddenCursors = void Function( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden, +); + +typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden, +); + +typedef _dart_clang_disposeOverriddenCursors = void Function( + ffi.Pointer overridden, +); + +typedef _c_clang_getIncludedFile = ffi.Pointer Function( + CXCursor cursor, +); + +typedef _dart_clang_getIncludedFile = ffi.Pointer Function( + CXCursor cursor, +); + +typedef _c_clang_getCursor = CXCursor Function( + ffi.Pointer arg0, + CXSourceLocation arg1, +); + +typedef _dart_clang_getCursor = CXCursor Function( + ffi.Pointer arg0, + CXSourceLocation arg1, +); + +typedef _c_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0, +); + +typedef _dart_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0, +); + +typedef _c_clang_getCursorExtent = CXSourceRange Function( + CXCursor arg0, +); + +typedef _dart_clang_getCursorExtent = CXSourceRange Function( + CXCursor arg0, +); + +typedef _c_clang_getCursorType = CXType Function( + CXCursor C, +); + +typedef _dart_clang_getCursorType = CXType Function( + CXCursor C, +); + +typedef _c_clang_getTypeSpelling = CXString Function( + CXType CT, +); + +typedef _dart_clang_getTypeSpelling = CXString Function( + CXType CT, +); + +typedef _c_clang_getTypedefDeclUnderlyingType = CXType Function( + CXCursor C, +); + +typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( + CXCursor C, +); + +typedef _c_clang_getEnumDeclIntegerType = CXType Function( + CXCursor C, +); + +typedef _dart_clang_getEnumDeclIntegerType = CXType Function( + CXCursor C, +); + +typedef _c_clang_getEnumConstantDeclValue = ffi.Int64 Function( + CXCursor C, +); + +typedef _dart_clang_getEnumConstantDeclValue = int Function( + CXCursor C, +); + +typedef _c_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( + CXCursor C, +); + +typedef _dart_clang_getEnumConstantDeclUnsignedValue = int Function( + CXCursor C, +); + +typedef _c_clang_getFieldDeclBitWidth = ffi.Int32 Function( + CXCursor C, +); + +typedef _dart_clang_getFieldDeclBitWidth = int Function( + CXCursor C, +); + +typedef _c_clang_Cursor_getNumArguments = ffi.Int32 Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_getNumArguments = int Function( + CXCursor C, +); + +typedef _c_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, + ffi.Uint32 i, +); + +typedef _dart_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, + int i, +); + +typedef _c_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_getNumTemplateArguments = int Function( + CXCursor C, +); + +typedef _c_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( + CXCursor C, + ffi.Uint32 I, +); + +typedef _dart_clang_Cursor_getTemplateArgumentKind = int Function( + CXCursor C, + int I, +); + +typedef _c_clang_Cursor_getTemplateArgumentType = CXType Function( + CXCursor C, + ffi.Uint32 I, +); + +typedef _dart_clang_Cursor_getTemplateArgumentType = CXType Function( + CXCursor C, + int I, +); + +typedef _c_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( + CXCursor C, + ffi.Uint32 I, +); + +typedef _dart_clang_Cursor_getTemplateArgumentValue = int Function( + CXCursor C, + int I, +); + +typedef _c_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 Function( + CXCursor C, + ffi.Uint32 I, +); + +typedef _dart_clang_Cursor_getTemplateArgumentUnsignedValue = int Function( + CXCursor C, + int I, +); + +typedef _c_clang_equalTypes = ffi.Uint32 Function( + CXType A, + CXType B, +); + +typedef _dart_clang_equalTypes = int Function( + CXType A, + CXType B, +); + +typedef _c_clang_getCanonicalType = CXType Function( + CXType T, +); -/// Helper for array `data` in struct `CXType`. -class ArrayHelper_CXType_data_level0 { - final CXType _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXType_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } - } +typedef _dart_clang_getCanonicalType = CXType Function( + CXType T, +); - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_data_item_0; - case 1: - return _struct._unique_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } +typedef _c_clang_isConstQualifiedType = ffi.Uint32 Function( + CXType T, +); - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_data_item_0 = value; - break; - case 1: - _struct._unique_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} +typedef _dart_clang_isConstQualifiedType = int Function( + CXType T, +); -/// Describes a single preprocessing token. -class CXToken extends ffi.Struct { - @ffi.Uint32() - external int _unique_int_data_item_0; - @ffi.Uint32() - external int _unique_int_data_item_1; - @ffi.Uint32() - external int _unique_int_data_item_2; - @ffi.Uint32() - external int _unique_int_data_item_3; +typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( + CXCursor C, +); - /// Helper for array `int_data`. - ArrayHelper_CXToken_int_data_level0 get int_data => - ArrayHelper_CXToken_int_data_level0(this, [4], 0, 0); - external ffi.Pointer ptr_data; -} +typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( + CXCursor C, +); -/// Helper for array `int_data` in struct `CXToken`. -class ArrayHelper_CXToken_int_data_level0 { - final CXToken _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXToken_int_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } - } +typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( + CXCursor C, +); - int operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_int_data_item_0; - case 1: - return _struct._unique_int_data_item_1; - case 2: - return _struct._unique_int_data_item_2; - case 3: - return _struct._unique_int_data_item_3; - default: - throw Exception('Invalid Array Helper generated.'); - } - } +typedef _dart_clang_Cursor_isMacroBuiltin = int Function( + CXCursor C, +); - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_int_data_item_0 = value; - break; - case 1: - _struct._unique_int_data_item_1 = value; - break; - case 2: - _struct._unique_int_data_item_2 = value; - break; - case 3: - _struct._unique_int_data_item_3 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} +typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( + CXCursor C, +); -/// A single result of code completion. -class CXCompletionResult extends ffi.Struct { - /// The kind of entity that this completion refers to. - /// - /// The cursor kind will be a macro, keyword, or a declaration (one of the - /// *Decl cursor kinds), describing the entity that the completion is - /// referring to. - /// - /// \todo In the future, we would like to provide a full cursor, to allow - /// the client to extract additional information from declaration. - @ffi.Int32() - external int CursorKind; +typedef _dart_clang_Cursor_isFunctionInlined = int Function( + CXCursor C, +); - /// The code-completion string that describes how to insert this - /// code-completion result into the editing buffer. - external ffi.Pointer CompletionString; -} +typedef _c_clang_isVolatileQualifiedType = ffi.Uint32 Function( + CXType T, +); -/// Contains the results of code-completion. -/// -/// This data structure contains the results of code completion, as -/// produced by \c clang_codeCompleteAt(). Its contents must be freed by -/// \c clang_disposeCodeCompleteResults. -class CXCodeCompleteResults extends ffi.Struct { - /// The code-completion results. - external ffi.Pointer Results; +typedef _dart_clang_isVolatileQualifiedType = int Function( + CXType T, +); - /// The number of code-completion results stored in the - /// \c Results array. - @ffi.Uint32() - external int NumResults; -} +typedef _c_clang_isRestrictQualifiedType = ffi.Uint32 Function( + CXType T, +); -class CXCursorAndRangeVisitor extends ffi.Struct {} +typedef _dart_clang_isRestrictQualifiedType = int Function( + CXType T, +); -/// Source location passed to index callbacks. -class CXIdxLoc extends ffi.Struct { - external ffi.Pointer _unique_ptr_data_item_0; - external ffi.Pointer _unique_ptr_data_item_1; +typedef _c_clang_getAddressSpace = ffi.Uint32 Function( + CXType T, +); - /// Helper for array `ptr_data`. - ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => - ArrayHelper_CXIdxLoc_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - external int int_data; -} +typedef _dart_clang_getAddressSpace = int Function( + CXType T, +); -/// Helper for array `ptr_data` in struct `CXIdxLoc`. -class ArrayHelper_CXIdxLoc_ptr_data_level0 { - final CXIdxLoc _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXIdxLoc_ptr_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } - } +typedef _c_clang_getTypedefName = CXString Function( + CXType CT, +); - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_ptr_data_item_0; - case 1: - return _struct._unique_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } +typedef _dart_clang_getTypedefName = CXString Function( + CXType CT, +); - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_ptr_data_item_0 = value; - break; - case 1: - _struct._unique_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} +typedef _c_clang_getPointeeType = CXType Function( + CXType T, +); -/// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct { - /// Location of '#' in the \#include/\#import directive. - external CXIdxLoc hashLoc; +typedef _dart_clang_getPointeeType = CXType Function( + CXType T, +); - /// Filename as written in the \#include/\#import directive. - external ffi.Pointer filename; +typedef _c_clang_getTypeDeclaration = CXCursor Function( + CXType T, +); - /// The actual file that the \#include/\#import directive resolved to. - external ffi.Pointer file; +typedef _dart_clang_getTypeDeclaration = CXCursor Function( + CXType T, +); - @ffi.Int32() - external int isImport; +typedef _c_clang_getDeclObjCTypeEncoding = CXString Function( + CXCursor C, +); - @ffi.Int32() - external int isAngled; +typedef _dart_clang_getDeclObjCTypeEncoding = CXString Function( + CXCursor C, +); - /// Non-zero if the directive was automatically turned into a module - /// import. - @ffi.Int32() - external int isModuleImport; -} +typedef _c_clang_Type_getObjCEncoding = CXString Function( + CXType type, +); -/// Data for IndexerCallbacks#importedASTFile. -class CXIdxImportedASTFileInfo extends ffi.Struct { - /// Top level AST file containing the imported PCH, module or submodule. - external ffi.Pointer file; +typedef _dart_clang_Type_getObjCEncoding = CXString Function( + CXType type, +); - /// The imported module or NULL if the AST file is a PCH. - external ffi.Pointer module; +typedef _c_clang_getTypeKindSpelling = CXString Function( + ffi.Int32 K, +); - /// Location where the file is imported. Applicable only for modules. - external CXIdxLoc loc; +typedef _dart_clang_getTypeKindSpelling = CXString Function( + int K, +); - /// Non-zero if an inclusion directive was automatically turned into - /// a module import. Applicable only for modules. - @ffi.Int32() - external int isImplicit; -} +typedef _c_clang_getFunctionTypeCallingConv = ffi.Int32 Function( + CXType T, +); -class CXIdxAttrInfo extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _dart_clang_getFunctionTypeCallingConv = int Function( + CXType T, +); - external CXCursor cursor; +typedef _c_clang_getResultType = CXType Function( + CXType T, +); - external CXIdxLoc loc; -} +typedef _dart_clang_getResultType = CXType Function( + CXType T, +); -class CXIdxEntityInfo extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _c_clang_getExceptionSpecificationType = ffi.Int32 Function( + CXType T, +); + +typedef _dart_clang_getExceptionSpecificationType = int Function( + CXType T, +); - @ffi.Int32() - external int templateKind; +typedef _c_clang_getNumArgTypes = ffi.Int32 Function( + CXType T, +); - @ffi.Int32() - external int lang; +typedef _dart_clang_getNumArgTypes = int Function( + CXType T, +); - external ffi.Pointer name; +typedef _c_clang_getArgType = CXType Function( + CXType T, + ffi.Uint32 i, +); - external ffi.Pointer USR; +typedef _dart_clang_getArgType = CXType Function( + CXType T, + int i, +); - external CXCursor cursor; +typedef _c_clang_Type_getObjCObjectBaseType = CXType Function( + CXType T, +); - external ffi.Pointer> attributes; +typedef _dart_clang_Type_getObjCObjectBaseType = CXType Function( + CXType T, +); - @ffi.Uint32() - external int numAttributes; -} +typedef _c_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( + CXType T, +); -class CXIdxContainerInfo extends ffi.Struct { - external CXCursor cursor; -} +typedef _dart_clang_Type_getNumObjCProtocolRefs = int Function( + CXType T, +); -class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { - external ffi.Pointer attrInfo; +typedef _c_clang_Type_getObjCProtocolDecl = CXCursor Function( + CXType T, + ffi.Uint32 i, +); - external ffi.Pointer objcClass; +typedef _dart_clang_Type_getObjCProtocolDecl = CXCursor Function( + CXType T, + int i, +); - external CXCursor classCursor; +typedef _c_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( + CXType T, +); - external CXIdxLoc classLoc; -} +typedef _dart_clang_Type_getNumObjCTypeArgs = int Function( + CXType T, +); -class CXIdxDeclInfo extends ffi.Struct { - external ffi.Pointer entityInfo; +typedef _c_clang_Type_getObjCTypeArg = CXType Function( + CXType T, + ffi.Uint32 i, +); - external CXCursor cursor; +typedef _dart_clang_Type_getObjCTypeArg = CXType Function( + CXType T, + int i, +); - external CXIdxLoc loc; +typedef _c_clang_isFunctionTypeVariadic = ffi.Uint32 Function( + CXType T, +); - external ffi.Pointer semanticContainer; +typedef _dart_clang_isFunctionTypeVariadic = int Function( + CXType T, +); - /// Generally same as #semanticContainer but can be different in - /// cases like out-of-line C++ member functions. - external ffi.Pointer lexicalContainer; +typedef _c_clang_getCursorResultType = CXType Function( + CXCursor C, +); - @ffi.Int32() - external int isRedeclaration; +typedef _dart_clang_getCursorResultType = CXType Function( + CXCursor C, +); - @ffi.Int32() - external int isDefinition; +typedef _c_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( + CXCursor C, +); - @ffi.Int32() - external int isContainer; +typedef _dart_clang_getCursorExceptionSpecificationType = int Function( + CXCursor C, +); - external ffi.Pointer declAsContainer; +typedef _c_clang_isPODType = ffi.Uint32 Function( + CXType T, +); - /// Whether the declaration exists in code or was created implicitly - /// by the compiler, e.g. implicit Objective-C methods for properties. - @ffi.Int32() - external int isImplicit; +typedef _dart_clang_isPODType = int Function( + CXType T, +); - external ffi.Pointer> attributes; +typedef _c_clang_getElementType = CXType Function( + CXType T, +); - @ffi.Uint32() - external int numAttributes; +typedef _dart_clang_getElementType = CXType Function( + CXType T, +); - @ffi.Uint32() - external int flags; -} +typedef _c_clang_getNumElements = ffi.Int64 Function( + CXType T, +); -class CXIdxObjCContainerDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; +typedef _dart_clang_getNumElements = int Function( + CXType T, +); - @ffi.Int32() - external int kind; -} +typedef _c_clang_getArrayElementType = CXType Function( + CXType T, +); -class CXIdxBaseClassInfo extends ffi.Struct { - external ffi.Pointer base; +typedef _dart_clang_getArrayElementType = CXType Function( + CXType T, +); - external CXCursor cursor; +typedef _c_clang_getArraySize = ffi.Int64 Function( + CXType T, +); - external CXIdxLoc loc; -} +typedef _dart_clang_getArraySize = int Function( + CXType T, +); -class CXIdxObjCProtocolRefInfo extends ffi.Struct { - external ffi.Pointer protocol; +typedef _c_clang_Type_getNamedType = CXType Function( + CXType T, +); - external CXCursor cursor; +typedef _dart_clang_Type_getNamedType = CXType Function( + CXType T, +); - external CXIdxLoc loc; -} +typedef _c_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( + CXType T, +); -class CXIdxObjCProtocolRefListInfo extends ffi.Struct { - external ffi.Pointer> protocols; +typedef _dart_clang_Type_isTransparentTagTypedef = int Function( + CXType T, +); - @ffi.Uint32() - external int numProtocols; -} +typedef _c_clang_Type_getNullability = ffi.Int32 Function( + CXType T, +); -class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { - external ffi.Pointer containerInfo; +typedef _dart_clang_Type_getNullability = int Function( + CXType T, +); - external ffi.Pointer superInfo; +typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( + CXType T, +); - external ffi.Pointer protocols; -} +typedef _dart_clang_Type_getAlignOf = int Function( + CXType T, +); -class CXIdxObjCCategoryDeclInfo extends ffi.Struct { - external ffi.Pointer containerInfo; +typedef _c_clang_Type_getClassType = CXType Function( + CXType T, +); - external ffi.Pointer objcClass; +typedef _dart_clang_Type_getClassType = CXType Function( + CXType T, +); - external CXCursor classCursor; +typedef _c_clang_Type_getSizeOf = ffi.Int64 Function( + CXType T, +); - external CXIdxLoc classLoc; +typedef _dart_clang_Type_getSizeOf = int Function( + CXType T, +); - external ffi.Pointer protocols; -} +typedef _c_clang_Type_getOffsetOf = ffi.Int64 Function( + CXType T, + ffi.Pointer S, +); -class CXIdxObjCPropertyDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; +typedef _dart_clang_Type_getOffsetOf = int Function( + CXType T, + ffi.Pointer S, +); - external ffi.Pointer getter; +typedef _c_clang_Type_getModifiedType = CXType Function( + CXType T, +); - external ffi.Pointer setter; -} +typedef _dart_clang_Type_getModifiedType = CXType Function( + CXType T, +); -class CXIdxCXXClassDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; +typedef _c_clang_Cursor_getOffsetOfField = ffi.Int64 Function( + CXCursor C, +); - external ffi.Pointer> bases; +typedef _dart_clang_Cursor_getOffsetOfField = int Function( + CXCursor C, +); - @ffi.Uint32() - external int numBases; -} +typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( + CXCursor C, +); -/// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _dart_clang_Cursor_isAnonymous = int Function( + CXCursor C, +); - /// Reference cursor. - external CXCursor cursor; +typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( + CXCursor C, +); - external CXIdxLoc loc; +typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( + CXCursor C, +); - /// The entity that gets referenced. - external ffi.Pointer referencedEntity; +typedef _c_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( + CXCursor C, +); - /// Immediate "parent" of the reference. For example: - /// - /// \code - /// Foo *var; - /// \endcode - /// - /// The parent of reference of type 'Foo' is the variable 'var'. - /// For references inside statement bodies of functions/methods, - /// the parentEntity will be the function/method. - external ffi.Pointer parentEntity; +typedef _dart_clang_Cursor_isInlineNamespace = int Function( + CXCursor C, +); - /// Lexical container context of the reference. - external ffi.Pointer container; +typedef _c_clang_Type_getNumTemplateArguments = ffi.Int32 Function( + CXType T, +); - /// Sets of symbol roles of the reference. - @ffi.Int32() - external int role; -} +typedef _dart_clang_Type_getNumTemplateArguments = int Function( + CXType T, +); -/// A group of callbacks used by #clang_indexSourceFile and -/// #clang_indexTranslationUnit. -class IndexerCallbacks extends ffi.Struct { - /// Called periodically to check whether indexing should be aborted. - /// Should return 0 to continue, and non-zero to abort. - external ffi.Pointer> abortQuery; +typedef _c_clang_Type_getTemplateArgumentAsType = CXType Function( + CXType T, + ffi.Uint32 i, +); - /// Called at the end of indexing; passes the complete diagnostic set. - external ffi.Pointer> diagnostic; +typedef _dart_clang_Type_getTemplateArgumentAsType = CXType Function( + CXType T, + int i, +); - external ffi.Pointer> enteredMainFile; +typedef _c_clang_Type_getCXXRefQualifier = ffi.Int32 Function( + CXType T, +); - /// Called when a file gets \#included/\#imported. - external ffi.Pointer> ppIncludedFile; +typedef _dart_clang_Type_getCXXRefQualifier = int Function( + CXType T, +); - /// Called when a AST file (PCH or module) gets imported. - /// - /// AST files will not get indexed (there will not be callbacks to index all - /// the entities in an AST file). The recommended action is that, if the AST - /// file is not already indexed, to initiate a new indexing job specific to - /// the AST file. - external ffi.Pointer> importedASTFile; +typedef _c_clang_Cursor_isBitField = ffi.Uint32 Function( + CXCursor C, +); - /// Called at the beginning of indexing a translation unit. - external ffi.Pointer> startedTranslationUnit; +typedef _dart_clang_Cursor_isBitField = int Function( + CXCursor C, +); - external ffi.Pointer> indexDeclaration; +typedef _c_clang_isVirtualBase = ffi.Uint32 Function( + CXCursor arg0, +); - /// Called to index a reference of an entity. - external ffi.Pointer> indexEntityReference; -} +typedef _dart_clang_isVirtualBase = int Function( + CXCursor arg0, +); -const int CINDEX_VERSION_MAJOR = 0; +typedef _c_clang_getCXXAccessSpecifier = ffi.Int32 Function( + CXCursor arg0, +); -const int CINDEX_VERSION_MINOR = 59; +typedef _dart_clang_getCXXAccessSpecifier = int Function( + CXCursor arg0, +); -const int CINDEX_VERSION = 59; +typedef _c_clang_Cursor_getStorageClass = ffi.Int32 Function( + CXCursor arg0, +); -const String CINDEX_VERSION_STRING = '0.59'; +typedef _dart_clang_Cursor_getStorageClass = int Function( + CXCursor arg0, +); -typedef _c_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set_1, +typedef _c_clang_getNumOverloadedDecls = ffi.Uint32 Function( + CXCursor cursor, ); -typedef _dart_clang_disposeStringSet = void Function( - ffi.Pointer set_1, +typedef _dart_clang_getNumOverloadedDecls = int Function( + CXCursor cursor, ); -typedef _c_clang_createIndex = ffi.Pointer Function( - ffi.Int32 excludeDeclarationsFromPCH, - ffi.Int32 displayDiagnostics, +typedef _c_clang_getOverloadedDecl = CXCursor Function( + CXCursor cursor, + ffi.Uint32 index, ); -typedef _dart_clang_createIndex = ffi.Pointer Function( - int excludeDeclarationsFromPCH, - int displayDiagnostics, +typedef _dart_clang_getOverloadedDecl = CXCursor Function( + CXCursor cursor, + int index, ); -typedef _c_clang_disposeIndex = ffi.Void Function( - ffi.Pointer index, +typedef _c_clang_getIBOutletCollectionType = CXType Function( + CXCursor arg0, ); -typedef _dart_clang_disposeIndex = void Function( - ffi.Pointer index, +typedef _dart_clang_getIBOutletCollectionType = CXType Function( + CXCursor arg0, ); -typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 options, +typedef CXCursorVisitor = ffi.Int32 Function( + CXCursor, + CXCursor, + ffi.Pointer, ); -typedef _dart_clang_CXIndex_setGlobalOptions = void Function( - ffi.Pointer arg0, - int options, +typedef _c_clang_visitChildren = ffi.Uint32 Function( + CXCursor parent, + ffi.Pointer> visitor, + ffi.Pointer client_data, ); -typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_visitChildren = int Function( + CXCursor parent, + ffi.Pointer> visitor, + ffi.Pointer client_data, ); -typedef _dart_clang_CXIndex_getGlobalOptions = int Function( - ffi.Pointer arg0, +typedef _c_clang_getCursorUSR = CXString Function( + CXCursor arg0, ); -typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer Path, +typedef _dart_clang_getCursorUSR = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( - ffi.Pointer arg0, - ffi.Pointer Path, +typedef _c_clang_constructUSR_ObjCClass = CXString Function( + ffi.Pointer class_name, ); -typedef _c_clang_getFileTime = ffi.Int64 Function( - ffi.Pointer SFile, +typedef _dart_clang_constructUSR_ObjCClass = CXString Function( + ffi.Pointer class_name, ); -typedef _dart_clang_getFileTime = int Function( - ffi.Pointer SFile, +typedef _c_clang_constructUSR_ObjCCategory = CXString Function( + ffi.Pointer class_name, + ffi.Pointer category_name, ); -typedef _c_clang_getFileUniqueID = ffi.Int32 Function( - ffi.Pointer file, - ffi.Pointer outID, +typedef _dart_clang_constructUSR_ObjCCategory = CXString Function( + ffi.Pointer class_name, + ffi.Pointer category_name, ); -typedef _dart_clang_getFileUniqueID = int Function( - ffi.Pointer file, - ffi.Pointer outID, +typedef _c_clang_constructUSR_ObjCProtocol = CXString Function( + ffi.Pointer protocol_name, ); -typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _dart_clang_constructUSR_ObjCProtocol = CXString Function( + ffi.Pointer protocol_name, ); -typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _c_clang_constructUSR_ObjCIvar = CXString Function( + ffi.Pointer name, + CXString classUSR, +); + +typedef _dart_clang_constructUSR_ObjCIvar = CXString Function( + ffi.Pointer name, + CXString classUSR, +); + +typedef _c_clang_constructUSR_ObjCMethod = CXString Function( + ffi.Pointer name, + ffi.Uint32 isInstanceMethod, + CXString classUSR, ); -typedef _c_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, +typedef _dart_clang_constructUSR_ObjCMethod = CXString Function( + ffi.Pointer name, + int isInstanceMethod, + CXString classUSR, ); -typedef _dart_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, +typedef _c_clang_constructUSR_ObjCProperty = CXString Function( + ffi.Pointer property, + CXString classUSR, ); -typedef _c_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, +typedef _dart_clang_constructUSR_ObjCProperty = CXString Function( + ffi.Pointer property, + CXString classUSR, ); -typedef _dart_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, +typedef _c_clang_getCursorSpelling = CXString Function( + CXCursor arg0, ); -typedef _c_clang_File_isEqual = ffi.Int32 Function( - ffi.Pointer file1, - ffi.Pointer file2, +typedef _dart_clang_getCursorSpelling = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_File_isEqual = int Function( - ffi.Pointer file1, - ffi.Pointer file2, +typedef _c_clang_Cursor_getSpellingNameRange = CXSourceRange Function( + CXCursor arg0, + ffi.Uint32 pieceIndex, + ffi.Uint32 options, ); -typedef _c_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _dart_clang_Cursor_getSpellingNameRange = CXSourceRange Function( + CXCursor arg0, + int pieceIndex, + int options, ); -typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( + ffi.Pointer Policy, + ffi.Int32 Property, ); -typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, +typedef _dart_clang_PrintingPolicy_getProperty = int Function( + ffi.Pointer Policy, + int Property, ); -typedef _dart_clang_getAllSkippedRanges = ffi.Pointer - Function( - ffi.Pointer tu, +typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( + ffi.Pointer Policy, + ffi.Int32 Property, + ffi.Uint32 Value, ); -typedef _c_clang_disposeSourceRangeList = ffi.Void Function( - ffi.Pointer ranges, +typedef _dart_clang_PrintingPolicy_setProperty = void Function( + ffi.Pointer Policy, + int Property, + int Value, ); -typedef _dart_clang_disposeSourceRangeList = void Function( - ffi.Pointer ranges, +typedef _c_clang_getCursorPrintingPolicy = ffi.Pointer Function( + CXCursor arg0, ); -typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( - ffi.Pointer Diags, +typedef _dart_clang_getCursorPrintingPolicy = ffi.Pointer Function( + CXCursor arg0, ); -typedef _dart_clang_getNumDiagnosticsInSet = int Function( - ffi.Pointer Diags, +typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( + ffi.Pointer Policy, ); -typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - ffi.Uint32 Index, +typedef _dart_clang_PrintingPolicy_dispose = void Function( + ffi.Pointer Policy, ); -typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - int Index, +typedef _c_clang_getCursorPrettyPrinted = CXString Function( + CXCursor Cursor, + ffi.Pointer Policy, ); -typedef _c_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, +typedef _dart_clang_getCursorPrettyPrinted = CXString Function( + CXCursor Cursor, + ffi.Pointer Policy, ); -typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, +typedef _c_clang_getCursorDisplayName = CXString Function( + CXCursor arg0, ); -typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( - ffi.Pointer Diags, +typedef _dart_clang_getCursorDisplayName = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_disposeDiagnosticSet = void Function( - ffi.Pointer Diags, +typedef _c_clang_getCursorReferenced = CXCursor Function( + CXCursor arg0, ); -typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, +typedef _dart_clang_getCursorReferenced = CXCursor Function( + CXCursor arg0, ); -typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, +typedef _c_clang_getCursorDefinition = CXCursor Function( + CXCursor arg0, ); -typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, +typedef _dart_clang_getCursorDefinition = CXCursor Function( + CXCursor arg0, ); -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, +typedef _c_clang_isCursorDefinition = ffi.Uint32 Function( + CXCursor arg0, ); -typedef _c_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, +typedef _dart_clang_isCursorDefinition = int Function( + CXCursor arg0, ); -typedef _dart_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, +typedef _c_clang_getCanonicalCursor = CXCursor Function( + CXCursor arg0, ); -typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, +typedef _dart_clang_getCanonicalCursor = CXCursor Function( + CXCursor arg0, ); -typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, +typedef _c_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( + CXCursor arg0, ); -typedef _c_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, +typedef _dart_clang_Cursor_getObjCSelectorIndex = int Function( + CXCursor arg0, ); -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, +typedef _c_clang_Cursor_isDynamicCall = ffi.Int32 Function( + CXCursor C, ); -typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); +typedef _dart_clang_Cursor_isDynamicCall = int Function( + CXCursor C, +); -typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); +typedef _c_clang_Cursor_getReceiverType = CXType Function( + CXCursor C, +); -typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getReceiverType = CXType Function( + CXCursor C, ); -typedef _dart_clang_getDiagnosticSeverity = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( + CXCursor C, + ffi.Uint32 reserved, ); -typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getObjCPropertyAttributes = int Function( + CXCursor C, + int reserved, ); -typedef _dart_clang_getDiagnosticCategory = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getObjCPropertyGetterName = CXString Function( + CXCursor C, ); -typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getObjCPropertyGetterName = CXString Function( + CXCursor C, ); -typedef _dart_clang_getDiagnosticNumRanges = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getObjCPropertySetterName = CXString Function( + CXCursor C, ); -typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( - ffi.Pointer Diagnostic, +typedef _dart_clang_Cursor_getObjCPropertySetterName = CXString Function( + CXCursor C, ); -typedef _dart_clang_getDiagnosticNumFixIts = int Function( - ffi.Pointer Diagnostic, +typedef _c_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Int32 num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, +typedef _dart_clang_Cursor_getObjCDeclQualifiers = int Function( + CXCursor C, ); -typedef _dart_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - int num_unsaved_files, - ffi.Pointer unsaved_files, +typedef _c_clang_Cursor_isObjCOptional = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, +typedef _dart_clang_Cursor_isObjCOptional = int Function( + CXCursor C, ); -typedef _dart_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, +typedef _c_clang_Cursor_isVariadic = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, +typedef _dart_clang_Cursor_isVariadic = int Function( + CXCursor C, ); -typedef _dart_clang_createTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, +typedef _c_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated, ); -typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); +typedef _dart_clang_Cursor_isExternalSymbol = int Function( + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated, +); -typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); +typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( + CXCursor C, +); -typedef _c_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, +typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( + CXCursor C, ); -typedef _dart_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, +typedef _c_clang_Cursor_getRawCommentText = CXString Function( + CXCursor C, ); -typedef _c_clang_parseTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, +typedef _dart_clang_Cursor_getRawCommentText = CXString Function( + CXCursor C, ); -typedef _dart_clang_parseTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, +typedef _c_clang_Cursor_getBriefCommentText = CXString Function( + CXCursor C, ); -typedef _c_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, +typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( + CXCursor C, ); -typedef _dart_clang_parseTranslationUnit2FullArgv = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, +typedef _c_clang_Cursor_getMangling = CXString Function( + CXCursor arg0, ); -typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( - ffi.Pointer TU, +typedef _dart_clang_Cursor_getMangling = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_defaultSaveOptions = int Function( - ffi.Pointer TU, +typedef _c_clang_Cursor_getCXXManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer FileName, - ffi.Uint32 options, +typedef _dart_clang_Cursor_getCXXManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _dart_clang_saveTranslationUnit = int Function( - ffi.Pointer TU, - ffi.Pointer FileName, - int options, +typedef _c_clang_Cursor_getObjCManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getObjCManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _dart_clang_suspendTranslationUnit = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getModule = ffi.Pointer Function( + CXCursor C, ); -typedef _c_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getModule = ffi.Pointer Function( + CXCursor C, ); -typedef _dart_clang_disposeTranslationUnit = void Function( +typedef _c_clang_getModuleForFile = ffi.Pointer Function( ffi.Pointer arg0, + ffi.Pointer arg1, ); -typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( - ffi.Pointer TU, +typedef _dart_clang_getModuleForFile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, ); -typedef _dart_clang_defaultReparseOptions = int Function( - ffi.Pointer TU, +typedef _c_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _c_clang_reparseTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, - ffi.Uint32 options, +typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _dart_clang_reparseTranslationUnit = int Function( - ffi.Pointer TU, - int num_unsaved_files, - ffi.Pointer unsaved_files, - int options, +typedef _c_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( - ffi.Int32 kind, +typedef _dart_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( - int kind, +typedef _c_clang_Module_getName = CXString Function( + ffi.Pointer Module, ); -typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, +typedef _dart_clang_Module_getName = CXString Function( + ffi.Pointer Module, ); -typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, +typedef _c_clang_Module_getFullName = CXString Function( + ffi.Pointer Module, ); -typedef _c_clang_TargetInfo_dispose = ffi.Void Function( - ffi.Pointer Info, +typedef _dart_clang_Module_getFullName = CXString Function( + ffi.Pointer Module, ); -typedef _dart_clang_TargetInfo_dispose = void Function( - ffi.Pointer Info, +typedef _c_clang_Module_isSystem = ffi.Int32 Function( + ffi.Pointer Module, ); -typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( - ffi.Pointer Info, +typedef _dart_clang_Module_isSystem = int Function( + ffi.Pointer Module, ); -typedef _dart_clang_TargetInfo_getPointerWidth = int Function( - ffi.Pointer Info, +typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( + ffi.Pointer arg0, + ffi.Pointer Module, ); -typedef _c_clang_isDeclaration = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( + ffi.Pointer arg0, + ffi.Pointer Module, ); -typedef _dart_clang_isDeclaration = int Function( - int arg0, +typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + ffi.Uint32 Index, ); -typedef _c_clang_isReference = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, ); -typedef _dart_clang_isReference = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isExpression = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isConvertingConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isExpression = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isStatement = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isCopyConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isStatement = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isAttribute = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isDefaultConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isAttribute = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isInvalid = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isMoveConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isInvalid = int Function( - int arg0, +typedef _c_clang_CXXField_isMutable = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXField_isMutable = int Function( + CXCursor C, ); -typedef _dart_clang_isTranslationUnit = int Function( - int arg0, +typedef _c_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isPreprocessing = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXMethod_isDefaulted = int Function( + CXCursor C, ); -typedef _dart_clang_isPreprocessing = int Function( - int arg0, +typedef _c_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isUnexposed = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXMethod_isPureVirtual = int Function( + CXCursor C, ); -typedef _dart_clang_isUnexposed = int Function( - int arg0, +typedef _c_clang_CXXMethod_isStatic = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( - ffi.Pointer availability, +typedef _dart_clang_CXXMethod_isStatic = int Function( + CXCursor C, ); -typedef _dart_clang_disposeCXPlatformAvailability = void Function( - ffi.Pointer availability, +typedef _c_clang_CXXMethod_isVirtual = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); - -typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); +typedef _dart_clang_CXXMethod_isVirtual = int Function( + CXCursor C, +); -typedef _c_clang_disposeCXCursorSet = ffi.Void Function( - ffi.Pointer cset, +typedef _c_clang_CXXRecord_isAbstract = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_disposeCXCursorSet = void Function( - ffi.Pointer cset, +typedef _dart_clang_CXXRecord_isAbstract = int Function( + CXCursor C, ); -typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( - ffi.Pointer overridden, +typedef _c_clang_EnumDecl_isScoped = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_disposeOverriddenCursors = void Function( - ffi.Pointer overridden, +typedef _dart_clang_EnumDecl_isScoped = int Function( + CXCursor C, ); -typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - ffi.Pointer Policy, - ffi.Int32 Property, +typedef _c_clang_CXXMethod_isConst = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_PrintingPolicy_getProperty = int Function( - ffi.Pointer Policy, - int Property, +typedef _dart_clang_CXXMethod_isConst = int Function( + CXCursor C, ); -typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( - ffi.Pointer Policy, - ffi.Int32 Property, - ffi.Uint32 Value, +typedef _c_clang_getTemplateCursorKind = ffi.Int32 Function( + CXCursor C, ); -typedef _dart_clang_PrintingPolicy_setProperty = void Function( - ffi.Pointer Policy, - int Property, - int Value, +typedef _dart_clang_getTemplateCursorKind = int Function( + CXCursor C, ); -typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( - ffi.Pointer Policy, +typedef _c_clang_getSpecializedCursorTemplate = CXCursor Function( + CXCursor C, ); -typedef _dart_clang_PrintingPolicy_dispose = void Function( - ffi.Pointer Policy, +typedef _dart_clang_getSpecializedCursorTemplate = CXCursor Function( + CXCursor C, ); -typedef _c_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, +typedef _c_clang_getCursorReferenceNameRange = CXSourceRange Function( + CXCursor C, + ffi.Uint32 NameFlags, + ffi.Uint32 PieceIndex, ); -typedef _dart_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, +typedef _dart_clang_getCursorReferenceNameRange = CXSourceRange Function( + CXCursor C, + int NameFlags, + int PieceIndex, ); -typedef _c_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, +typedef _c_clang_getToken = ffi.Pointer Function( + ffi.Pointer TU, + CXSourceLocation Location, ); -typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, +typedef _dart_clang_getToken = ffi.Pointer Function( + ffi.Pointer TU, + CXSourceLocation Location, ); -typedef _c_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, +typedef _c_clang_getTokenKind = ffi.Int32 Function( + CXToken arg0, ); -typedef _dart_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, +typedef _dart_clang_getTokenKind = int Function( + CXToken arg0, ); -typedef _c_clang_Module_isSystem = ffi.Int32 Function( - ffi.Pointer Module, +typedef _c_clang_getTokenSpelling = CXString Function( + ffi.Pointer arg0, + CXToken arg1, ); -typedef _dart_clang_Module_isSystem = int Function( - ffi.Pointer Module, +typedef _dart_clang_getTokenSpelling = CXString Function( + ffi.Pointer arg0, + CXToken arg1, ); -typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( +typedef _c_clang_getTokenLocation = CXSourceLocation Function( ffi.Pointer arg0, - ffi.Pointer Module, + CXToken arg1, ); -typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( +typedef _dart_clang_getTokenLocation = CXSourceLocation Function( ffi.Pointer arg0, - ffi.Pointer Module, + CXToken arg1, ); -typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( +typedef _c_clang_getTokenExtent = CXSourceRange Function( ffi.Pointer arg0, - ffi.Pointer Module, - ffi.Uint32 Index, + CXToken arg1, ); -typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( +typedef _dart_clang_getTokenExtent = CXSourceRange Function( ffi.Pointer arg0, - ffi.Pointer Module, - int Index, + CXToken arg1, +); + +typedef _c_clang_tokenize = ffi.Void Function( + ffi.Pointer TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens, +); + +typedef _dart_clang_tokenize = void Function( + ffi.Pointer TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens, ); typedef _c_clang_annotateTokens = ffi.Void Function( @@ -4073,6 +9543,34 @@ typedef _dart_clang_disposeTokens = void Function( int NumTokens, ); +typedef _c_clang_getCursorKindSpelling = CXString Function( + ffi.Int32 Kind, +); + +typedef _dart_clang_getCursorKindSpelling = CXString Function( + int Kind, +); + +typedef _c_clang_getDefinitionSpellingAndExtent = ffi.Void Function( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, +); + +typedef _dart_clang_getDefinitionSpellingAndExtent = void Function( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, +); + typedef _c_clang_enableStackTraces = ffi.Void Function(); typedef _dart_clang_enableStackTraces = void Function(); @@ -4103,6 +9601,16 @@ typedef _dart_clang_getCompletionChunkKind = int Function( int chunk_number, ); +typedef _c_clang_getCompletionChunkText = CXString Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, +); + +typedef _dart_clang_getCompletionChunkText = CXString Function( + ffi.Pointer completion_string, + int chunk_number, +); + typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer Function( ffi.Pointer completion_string, @@ -4147,6 +9655,42 @@ typedef _dart_clang_getCompletionNumAnnotations = int Function( ffi.Pointer completion_string, ); +typedef _c_clang_getCompletionAnnotation = CXString Function( + ffi.Pointer completion_string, + ffi.Uint32 annotation_number, +); + +typedef _dart_clang_getCompletionAnnotation = CXString Function( + ffi.Pointer completion_string, + int annotation_number, +); + +typedef _c_clang_getCompletionParent = CXString Function( + ffi.Pointer completion_string, + ffi.Pointer kind, +); + +typedef _dart_clang_getCompletionParent = CXString Function( + ffi.Pointer completion_string, + ffi.Pointer kind, +); + +typedef _c_clang_getCompletionBriefComment = CXString Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionBriefComment = CXString Function( + ffi.Pointer completion_string, +); + +typedef _c_clang_getCursorCompletionString = ffi.Pointer Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorCompletionString = ffi.Pointer Function( + CXCursor cursor, +); + typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( ffi.Pointer results, ffi.Uint32 completion_index, @@ -4157,6 +9701,20 @@ typedef _dart_clang_getCompletionNumFixIts = int Function( int completion_index, ); +typedef _c_clang_getCompletionFixIt = CXString Function( + ffi.Pointer results, + ffi.Uint32 completion_index, + ffi.Uint32 fixit_index, + ffi.Pointer replacement_range, +); + +typedef _dart_clang_getCompletionFixIt = CXString Function( + ffi.Pointer results, + int completion_index, + int fixit_index, + ffi.Pointer replacement_range, +); + typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); typedef _dart_clang_defaultCodeCompleteOptions = int Function(); @@ -4236,6 +9794,26 @@ typedef _dart_clang_codeCompleteGetContainerKind = int Function( ffi.Pointer IsIncomplete, ); +typedef _c_clang_codeCompleteGetContainerUSR = CXString Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetContainerUSR = CXString Function( + ffi.Pointer Results, +); + +typedef _c_clang_codeCompleteGetObjCSelector = CXString Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetObjCSelector = CXString Function( + ffi.Pointer Results, +); + +typedef _c_clang_getClangVersion = CXString Function(); + +typedef _dart_clang_getClangVersion = CXString Function(); + typedef _c_clang_toggleCrashRecovery = ffi.Void Function( ffi.Uint32 isEnabled, ); @@ -4263,6 +9841,14 @@ typedef _dart_clang_getInclusions = void Function( ffi.Pointer client_data, ); +typedef _c_clang_Cursor_Evaluate = ffi.Pointer Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( + CXCursor C, +); + typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( ffi.Pointer E, ); @@ -4375,6 +9961,30 @@ typedef _dart_clang_remap_dispose = void Function( ffi.Pointer arg0, ); +typedef _c_clang_findReferencesInFile = ffi.Int32 Function( + CXCursor cursor, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + +typedef _dart_clang_findReferencesInFile = int Function( + CXCursor cursor, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + +typedef _c_clang_findIncludesInFile = ffi.Int32 Function( + ffi.Pointer TU, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + +typedef _dart_clang_findIncludesInFile = int Function( + ffi.Pointer TU, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( ffi.Int32 arg0, ); @@ -4583,44 +10193,93 @@ typedef _dart_clang_indexTranslationUnit = int Function( ffi.Pointer arg5, ); +typedef _c_clang_indexLoc_getFileLocation = ffi.Void Function( + CXIdxLoc loc, + ffi.Pointer> indexFile, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_indexLoc_getFileLocation = void Function( + CXIdxLoc loc, + ffi.Pointer> indexFile, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( + CXIdxLoc loc, +); + +typedef _dart_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( + CXIdxLoc loc, +); + +typedef CXFieldVisitor = ffi.Int32 Function( + CXCursor, + ffi.Pointer, +); + +typedef _c_clang_Type_visitFields = ffi.Uint32 Function( + CXType T, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + +typedef _dart_clang_Type_visitFields = int Function( + CXType T, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + typedef _typedefC_2 = ffi.Int32 Function( + ffi.Pointer, + CXCursor, + CXSourceRange, +); + +typedef _typedefC_3 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_3 = ffi.Void Function( +typedef _typedefC_4 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_4 = ffi.Pointer Function( +typedef _typedefC_5 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_5 = ffi.Pointer Function( +typedef _typedefC_6 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_6 = ffi.Pointer Function( +typedef _typedefC_7 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_7 = ffi.Pointer Function( +typedef _typedefC_8 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_8 = ffi.Void Function( +typedef _typedefC_9 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_9 = ffi.Void Function( +typedef _typedefC_10 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); diff --git a/lib/src/code_generator/struc.dart b/lib/src/code_generator/struc.dart index ee8a5232..89581395 100644 --- a/lib/src/code_generator/struc.dart +++ b/lib/src/code_generator/struc.dart @@ -35,12 +35,18 @@ import 'writer.dart'; /// } /// ``` class Struc extends NoLookUpBinding { + /// Marker for if a struct definition is complete. + /// + /// A function can be safely pass this struct by value if it's complete. + bool isInComplete; + List members; Struc({ String? usr, String? originalName, required String name, + this.isInComplete = false, String? dartDoc, List? members, }) : members = members ?? [], diff --git a/lib/src/code_generator/type.dart b/lib/src/code_generator/type.dart index 014413ae..f6e5001f 100644 --- a/lib/src/code_generator/type.dart +++ b/lib/src/code_generator/type.dart @@ -162,6 +162,10 @@ class Type { bool get isPrimitive => (broadType == BroadType.NativeType || broadType == BroadType.Boolean); + /// Returns true if the type is a [Struc] and is incomplete. + bool get isIncompleteStruct => + broadType == BroadType.Struct && struc!.isInComplete; + String getCType(Writer w) { switch (broadType) { case BroadType.NativeType: diff --git a/lib/src/header_parser/sub_parsers/functiondecl_parser.dart b/lib/src/header_parser/sub_parsers/functiondecl_parser.dart index 2b005d81..acb223a3 100644 --- a/lib/src/header_parser/sub_parsers/functiondecl_parser.dart +++ b/lib/src/header_parser/sub_parsers/functiondecl_parser.dart @@ -18,7 +18,7 @@ final _logger = Logger('ffigen.header_parser.functiondecl_parser'); /// Holds temporary information regarding [Func] while parsing. class _ParserFunc { Func? func; - bool structByValueParameter = false; + bool incompleteStructParameter = false; bool unimplementedParameterType = false; _ParserFunc(); } @@ -28,8 +28,6 @@ final _stack = Stack<_ParserFunc>(); /// Parses a function declaration. Func? parseFunctionDeclaration(Pointer cursor) { _stack.push(_ParserFunc()); - _stack.top.structByValueParameter = false; - _stack.top.unimplementedParameterType = false; final funcUsr = cursor.usr(); final funcName = cursor.spelling(); @@ -39,12 +37,11 @@ Func? parseFunctionDeclaration(Pointer cursor) { final rt = _getFunctionReturnType(cursor); final parameters = _getParameters(cursor, funcName); - //TODO(3): Remove this when support for Structs by value arrives. - if (rt.broadType == BroadType.Struct || _stack.top.structByValueParameter) { + if (rt.isIncompleteStruct || _stack.top.incompleteStructParameter) { _logger.fine( - '---- Removed Function, reason: struct pass/return by value: ${cursor.completeStringRepr()}'); + '---- Removed Function, reason: Incomplete struct pass/return by value: ${cursor.completeStringRepr()}'); _logger.warning( - "Skipped Function '$funcName', struct pass/return by value not supported."); + "Skipped Function '$funcName', Incomplete struct pass/return by value not supported."); return _stack .pop() .func; // Returning null so that [addToBindings] function excludes this. @@ -95,10 +92,11 @@ List _getParameters( _logger.finer('===== parameter: ${paramCursor.completeStringRepr()}'); final pt = _getParameterType(paramCursor); - //TODO(3): Remove this when support for Structs by value arrives. - if (pt.broadType == BroadType.Struct) { - _stack.top.structByValueParameter = true; + if (pt.isIncompleteStruct) { + _stack.top.incompleteStructParameter = true; } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { + _logger + .finer('Unimplemented type: ${pt.getBaseType().unimplementedReason}'); _stack.top.unimplementedParameterType = true; } diff --git a/lib/src/header_parser/sub_parsers/structdecl_parser.dart b/lib/src/header_parser/sub_parsers/structdecl_parser.dart index 0c014d76..ffa4109d 100644 --- a/lib/src/header_parser/sub_parsers/structdecl_parser.dart +++ b/lib/src/header_parser/sub_parsers/structdecl_parser.dart @@ -5,6 +5,7 @@ import 'dart:ffi'; import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/strings.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; @@ -22,6 +23,16 @@ class _ParsedStruc { bool arrayMember = false; bool bitFieldMember = false; bool dartHandleMember = false; + bool incompleteStructMember = false; + + bool get isInComplete => + unimplementedMemberType || + flexibleArrayMember || + (arrayMember && !config.arrayWorkaround) || + bitFieldMember || + (dartHandleMember && config.useDartHandle) || + incompleteStructMember; + _ParsedStruc(); } @@ -83,38 +94,44 @@ void _setStructMembers(Pointer cursor) { visitChildrenResultChecker(resultCode); - // Returning null to exclude the struct members as it has a struct by value field. if (_stack.top.arrayMember && !config.arrayWorkaround) { _logger.fine( '---- Removed Struct members, reason: struct has array members ${cursor.completeStringRepr()}'); _logger.warning( 'Removed All Struct Members from: ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Array members not supported'); - return _stack.top.struc!.members.clear(); } else if (_stack.top.unimplementedMemberType) { _logger.fine( '---- Removed Struct members, reason: member with unimplementedtype ${cursor.completeStringRepr()}'); _logger.warning( 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), struct member has an unsupported type.'); - return _stack.top.struc!.members.clear(); } else if (_stack.top.flexibleArrayMember) { _logger.fine( '---- Removed Struct members, reason: incomplete array member ${cursor.completeStringRepr()}'); _logger.warning( 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Flexible array members not supported.'); - return _stack.top.struc!.members.clear(); } else if (_stack.top.bitFieldMember) { _logger.fine( '---- Removed Struct members, reason: bitfield members ${cursor.completeStringRepr()}'); _logger.warning( 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Bit Field members not supported.'); - return _stack.top.struc!.members.clear(); - } else if (_stack.top.dartHandleMember) { + } else if (_stack.top.dartHandleMember && config.useDartHandle) { _logger.fine( '---- Removed Struct members, reason: Dart_Handle member. ${cursor.completeStringRepr()}'); _logger.warning( 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Dart_Handle member not supported.'); - return _stack.top.struc!.members.clear(); + } else if (_stack.top.incompleteStructMember) { + _logger.fine( + '---- Removed Struct members, reason: Incomplete Nested Struct member. ${cursor.completeStringRepr()}'); + _logger.warning( + 'Removed All Struct Members from ${_stack.top.struc!.name}(${_stack.top.struc!.originalName}), Incomplete Nested Struct member not supported.'); } + + // Clear all struct members if struct is incomplete. + if (_stack.top.isInComplete) { + _stack.top.struc!.members.clear(); + } + + _stack.top.struc!.isInComplete = _stack.top.isInComplete; } /// Visitor for the struct cursor [CXCursorKind.CXCursor_StructDecl]. @@ -137,6 +154,8 @@ int _structMembersVisitor(Pointer cursor, _stack.top.bitFieldMember = true; } else if (mt.broadType == BroadType.Handle) { _stack.top.dartHandleMember = true; + } else if (mt.isIncompleteStruct) { + _stack.top.incompleteStructMember = true; } if (mt.getBaseType().broadType == BroadType.Unimplemented) { diff --git a/lib/src/header_parser/type_extractor/extractor.dart b/lib/src/header_parser/type_extractor/extractor.dart index defa1d38..d1a7883b 100644 --- a/lib/src/header_parser/type_extractor/extractor.dart +++ b/lib/src/header_parser/type_extractor/extractor.dart @@ -158,8 +158,9 @@ Type _extractFromFunctionProto( final t = clang.clang_getArgType_wrap(cxtype, i); final pt = t.toCodeGenTypeAndDispose(); - if (pt.broadType == BroadType.Struct) { - return Type.unimplemented('Struct by value in function parameter.'); + if (pt.isIncompleteStruct) { + return Type.unimplemented( + 'Incomplete Struct by value in function parameter.'); } else if (pt.getBaseType().broadType == BroadType.Unimplemented) { return Type.unimplemented('Function parameter has an unsupported type.'); } diff --git a/pubspec.yaml b/pubspec.yaml index 44f1f1cf..d3c8da00 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 2.0.0-dev.0 +version: 2.0.0-dev.1 homepage: https://github.com/dart-lang/ffigen description: Experimental generator for FFI bindings, using LibClang to parse C header files. diff --git a/test/header_parser_tests/function_n_struct.h b/test/header_parser_tests/function_n_struct.h index 629c0ba8..bae5f401 100644 --- a/test/header_parser_tests/function_n_struct.h +++ b/test/header_parser_tests/function_n_struct.h @@ -12,6 +12,7 @@ struct Struct2 struct Struct1 a; }; +// All members should be removed, Flexible array members are not supported. struct Struct3 { int a; @@ -21,8 +22,15 @@ struct Struct3 // All members should be removed, Bit fields are not supported. struct Struct4 { - int a:3; - int :2; // Unnamed bit field. + int a : 3; + int : 2; // Unnamed bit field. +}; + +// All members should be removed, Incomplete struct members are not supported. +struct Struct5 +{ + int a; + struct Struct3 s; // Incomplete nested struct. }; void func1(struct Struct2 *s); diff --git a/test/header_parser_tests/function_n_struct_test.dart b/test/header_parser_tests/function_n_struct_test.dart index f8852d5b..aec45027 100644 --- a/test/header_parser_tests/function_n_struct_test.dart +++ b/test/header_parser_tests/function_n_struct_test.dart @@ -32,6 +32,9 @@ ${strings.headers}: ); }); + test('Total bindings count', () { + expect(actual.bindings.length, expected.bindings.length); + }); test('func1 struct pointer parameter', () { expect(actual.getBindingAsString('func1'), expected.getBindingAsString('func1')); @@ -50,6 +53,9 @@ ${strings.headers}: test('Struct4 bit field member', () { expect((actual.getBinding('Struct4') as Struc).members.isEmpty, true); }); + test('Struct5 incompleted struct member', () { + expect((actual.getBinding('Struct5') as Struc).members.isEmpty, true); + }); }); } @@ -97,6 +103,7 @@ Library expectedLibrary() { type: Type.struct(struc1), ), ]), + Struc(name: 'Struct5'), ], ); } diff --git a/test/large_integration_tests/_expected_libclang_bindings.dart b/test/large_integration_tests/_expected_libclang_bindings.dart index 60698fca..e0abce7c 100644 --- a/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/test/large_integration_tests/_expected_libclang_bindings.dart @@ -11,6 +11,32 @@ class LibClang { /// The symbols are looked up in [dynamicLibrary]. LibClang(ffi.DynamicLibrary dynamicLibrary) : _dylib = dynamicLibrary; + /// Retrieve the character data associated with the given string. + ffi.Pointer clang_getCString( + CXString string, + ) { + return (_clang_getCString ??= + _dylib.lookupFunction<_c_clang_getCString, _dart_clang_getCString>( + 'clang_getCString'))( + string, + ); + } + + _dart_clang_getCString? _clang_getCString; + + /// Free the given string. + void clang_disposeString( + CXString string, + ) { + return (_clang_disposeString ??= _dylib.lookupFunction< + _c_clang_disposeString, + _dart_clang_disposeString>('clang_disposeString'))( + string, + ); + } + + _dart_clang_disposeString? _clang_disposeString; + /// Free the given string set. void clang_disposeStringSet( ffi.Pointer set_1, @@ -297,6 +323,19 @@ class LibClang { _dart_clang_CXIndex_setInvocationEmissionPathOption? _clang_CXIndex_setInvocationEmissionPathOption; + /// Retrieve the complete file and path name of the given file. + CXString clang_getFileName( + ffi.Pointer SFile, + ) { + return (_clang_getFileName ??= + _dylib.lookupFunction<_c_clang_getFileName, _dart_clang_getFileName>( + 'clang_getFileName'))( + SFile, + ); + } + + _dart_clang_getFileName? _clang_getFileName; + /// Retrieve the last modification time of the given file. int clang_getFileTime( ffi.Pointer SFile, @@ -391,6 +430,299 @@ class LibClang { _dart_clang_File_isEqual? _clang_File_isEqual; + /// Returns the real path name of file. + CXString clang_File_tryGetRealPathName( + ffi.Pointer file, + ) { + return (_clang_File_tryGetRealPathName ??= _dylib.lookupFunction< + _c_clang_File_tryGetRealPathName, + _dart_clang_File_tryGetRealPathName>('clang_File_tryGetRealPathName'))( + file, + ); + } + + _dart_clang_File_tryGetRealPathName? _clang_File_tryGetRealPathName; + + /// Retrieve a NULL (invalid) source location. + CXSourceLocation clang_getNullLocation() { + return (_clang_getNullLocation ??= _dylib.lookupFunction< + _c_clang_getNullLocation, + _dart_clang_getNullLocation>('clang_getNullLocation'))(); + } + + _dart_clang_getNullLocation? _clang_getNullLocation; + + /// Determine whether two source locations, which must refer into the same + /// translation unit, refer to exactly the same point in the source code. + int clang_equalLocations( + CXSourceLocation loc1, + CXSourceLocation loc2, + ) { + return (_clang_equalLocations ??= _dylib.lookupFunction< + _c_clang_equalLocations, + _dart_clang_equalLocations>('clang_equalLocations'))( + loc1, + loc2, + ); + } + + _dart_clang_equalLocations? _clang_equalLocations; + + /// Retrieves the source location associated with a given file/line/column in + /// a particular translation unit. + CXSourceLocation clang_getLocation( + ffi.Pointer tu, + ffi.Pointer file, + int line, + int column, + ) { + return (_clang_getLocation ??= + _dylib.lookupFunction<_c_clang_getLocation, _dart_clang_getLocation>( + 'clang_getLocation'))( + tu, + file, + line, + column, + ); + } + + _dart_clang_getLocation? _clang_getLocation; + + /// Retrieves the source location associated with a given character offset in + /// a particular translation unit. + CXSourceLocation clang_getLocationForOffset( + ffi.Pointer tu, + ffi.Pointer file, + int offset, + ) { + return (_clang_getLocationForOffset ??= _dylib.lookupFunction< + _c_clang_getLocationForOffset, + _dart_clang_getLocationForOffset>('clang_getLocationForOffset'))( + tu, + file, + offset, + ); + } + + _dart_clang_getLocationForOffset? _clang_getLocationForOffset; + + /// Returns non-zero if the given source location is in a system header. + int clang_Location_isInSystemHeader( + CXSourceLocation location, + ) { + return (_clang_Location_isInSystemHeader ??= _dylib.lookupFunction< + _c_clang_Location_isInSystemHeader, + _dart_clang_Location_isInSystemHeader>( + 'clang_Location_isInSystemHeader'))( + location, + ); + } + + _dart_clang_Location_isInSystemHeader? _clang_Location_isInSystemHeader; + + /// Returns non-zero if the given source location is in the main file of the + /// corresponding translation unit. + int clang_Location_isFromMainFile( + CXSourceLocation location, + ) { + return (_clang_Location_isFromMainFile ??= _dylib.lookupFunction< + _c_clang_Location_isFromMainFile, + _dart_clang_Location_isFromMainFile>('clang_Location_isFromMainFile'))( + location, + ); + } + + _dart_clang_Location_isFromMainFile? _clang_Location_isFromMainFile; + + /// Retrieve a NULL (invalid) source range. + CXSourceRange clang_getNullRange() { + return (_clang_getNullRange ??= + _dylib.lookupFunction<_c_clang_getNullRange, _dart_clang_getNullRange>( + 'clang_getNullRange'))(); + } + + _dart_clang_getNullRange? _clang_getNullRange; + + /// Retrieve a source range given the beginning and ending source locations. + CXSourceRange clang_getRange( + CXSourceLocation begin, + CXSourceLocation end, + ) { + return (_clang_getRange ??= + _dylib.lookupFunction<_c_clang_getRange, _dart_clang_getRange>( + 'clang_getRange'))( + begin, + end, + ); + } + + _dart_clang_getRange? _clang_getRange; + + /// Determine whether two ranges are equivalent. + int clang_equalRanges( + CXSourceRange range1, + CXSourceRange range2, + ) { + return (_clang_equalRanges ??= + _dylib.lookupFunction<_c_clang_equalRanges, _dart_clang_equalRanges>( + 'clang_equalRanges'))( + range1, + range2, + ); + } + + _dart_clang_equalRanges? _clang_equalRanges; + + /// Returns non-zero if range is null. + int clang_Range_isNull( + CXSourceRange range, + ) { + return (_clang_Range_isNull ??= + _dylib.lookupFunction<_c_clang_Range_isNull, _dart_clang_Range_isNull>( + 'clang_Range_isNull'))( + range, + ); + } + + _dart_clang_Range_isNull? _clang_Range_isNull; + + /// Retrieve the file, line, column, and offset represented by the given + /// source location. + void clang_getExpansionLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getExpansionLocation ??= _dylib.lookupFunction< + _c_clang_getExpansionLocation, + _dart_clang_getExpansionLocation>('clang_getExpansionLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getExpansionLocation? _clang_getExpansionLocation; + + /// Retrieve the file, line and column represented by the given source + /// location, as specified in a # line directive. + void clang_getPresumedLocation( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column, + ) { + return (_clang_getPresumedLocation ??= _dylib.lookupFunction< + _c_clang_getPresumedLocation, + _dart_clang_getPresumedLocation>('clang_getPresumedLocation'))( + location, + filename, + line, + column, + ); + } + + _dart_clang_getPresumedLocation? _clang_getPresumedLocation; + + /// Legacy API to retrieve the file, line, column, and offset represented by + /// the given source location. + void clang_getInstantiationLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getInstantiationLocation ??= _dylib.lookupFunction< + _c_clang_getInstantiationLocation, + _dart_clang_getInstantiationLocation>( + 'clang_getInstantiationLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getInstantiationLocation? _clang_getInstantiationLocation; + + /// Retrieve the file, line, column, and offset represented by the given + /// source location. + void clang_getSpellingLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getSpellingLocation ??= _dylib.lookupFunction< + _c_clang_getSpellingLocation, + _dart_clang_getSpellingLocation>('clang_getSpellingLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getSpellingLocation? _clang_getSpellingLocation; + + /// Retrieve the file, line, column, and offset represented by the given + /// source location. + void clang_getFileLocation( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_getFileLocation ??= _dylib.lookupFunction< + _c_clang_getFileLocation, + _dart_clang_getFileLocation>('clang_getFileLocation'))( + location, + file, + line, + column, + offset, + ); + } + + _dart_clang_getFileLocation? _clang_getFileLocation; + + /// Retrieve a source location representing the first character within a + /// source range. + CXSourceLocation clang_getRangeStart( + CXSourceRange range, + ) { + return (_clang_getRangeStart ??= _dylib.lookupFunction< + _c_clang_getRangeStart, + _dart_clang_getRangeStart>('clang_getRangeStart'))( + range, + ); + } + + _dart_clang_getRangeStart? _clang_getRangeStart; + + /// Retrieve a source location representing the last character within a source + /// range. + CXSourceLocation clang_getRangeEnd( + CXSourceRange range, + ) { + return (_clang_getRangeEnd ??= + _dylib.lookupFunction<_c_clang_getRangeEnd, _dart_clang_getRangeEnd>( + 'clang_getRangeEnd'))( + range, + ); + } + + _dart_clang_getRangeEnd? _clang_getRangeEnd; + /// Retrieve all ranges that were skipped by the preprocessor. ffi.Pointer clang_getSkippedRanges( ffi.Pointer tu, @@ -559,6 +891,21 @@ class LibClang { _dart_clang_disposeDiagnostic? _clang_disposeDiagnostic; + /// Format the given diagnostic in a manner that is suitable for display. + CXString clang_formatDiagnostic( + ffi.Pointer Diagnostic, + int Options, + ) { + return (_clang_formatDiagnostic ??= _dylib.lookupFunction< + _c_clang_formatDiagnostic, + _dart_clang_formatDiagnostic>('clang_formatDiagnostic'))( + Diagnostic, + Options, + ); + } + + _dart_clang_formatDiagnostic? _clang_formatDiagnostic; + /// Retrieve the set of display options most similar to the default behavior /// of the clang compiler. int clang_defaultDiagnosticDisplayOptions() { @@ -584,6 +931,47 @@ class LibClang { _dart_clang_getDiagnosticSeverity? _clang_getDiagnosticSeverity; + /// Retrieve the source location of the given diagnostic. + CXSourceLocation clang_getDiagnosticLocation( + ffi.Pointer arg0, + ) { + return (_clang_getDiagnosticLocation ??= _dylib.lookupFunction< + _c_clang_getDiagnosticLocation, + _dart_clang_getDiagnosticLocation>('clang_getDiagnosticLocation'))( + arg0, + ); + } + + _dart_clang_getDiagnosticLocation? _clang_getDiagnosticLocation; + + /// Retrieve the text of the given diagnostic. + CXString clang_getDiagnosticSpelling( + ffi.Pointer arg0, + ) { + return (_clang_getDiagnosticSpelling ??= _dylib.lookupFunction< + _c_clang_getDiagnosticSpelling, + _dart_clang_getDiagnosticSpelling>('clang_getDiagnosticSpelling'))( + arg0, + ); + } + + _dart_clang_getDiagnosticSpelling? _clang_getDiagnosticSpelling; + + /// Retrieve the name of the command-line option that enabled this diagnostic. + CXString clang_getDiagnosticOption( + ffi.Pointer Diag, + ffi.Pointer Disable, + ) { + return (_clang_getDiagnosticOption ??= _dylib.lookupFunction< + _c_clang_getDiagnosticOption, + _dart_clang_getDiagnosticOption>('clang_getDiagnosticOption'))( + Diag, + Disable, + ); + } + + _dart_clang_getDiagnosticOption? _clang_getDiagnosticOption; + /// Retrieve the category number for this diagnostic. int clang_getDiagnosticCategory( ffi.Pointer arg0, @@ -597,6 +985,35 @@ class LibClang { _dart_clang_getDiagnosticCategory? _clang_getDiagnosticCategory; + /// Retrieve the name of a particular diagnostic category. This is now + /// deprecated. Use clang_getDiagnosticCategoryText() instead. + CXString clang_getDiagnosticCategoryName( + int Category, + ) { + return (_clang_getDiagnosticCategoryName ??= _dylib.lookupFunction< + _c_clang_getDiagnosticCategoryName, + _dart_clang_getDiagnosticCategoryName>( + 'clang_getDiagnosticCategoryName'))( + Category, + ); + } + + _dart_clang_getDiagnosticCategoryName? _clang_getDiagnosticCategoryName; + + /// Retrieve the diagnostic category text for a given diagnostic. + CXString clang_getDiagnosticCategoryText( + ffi.Pointer arg0, + ) { + return (_clang_getDiagnosticCategoryText ??= _dylib.lookupFunction< + _c_clang_getDiagnosticCategoryText, + _dart_clang_getDiagnosticCategoryText>( + 'clang_getDiagnosticCategoryText'))( + arg0, + ); + } + + _dart_clang_getDiagnosticCategoryText? _clang_getDiagnosticCategoryText; + /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( @@ -611,6 +1028,21 @@ class LibClang { _dart_clang_getDiagnosticNumRanges? _clang_getDiagnosticNumRanges; + /// Retrieve a source range associated with the diagnostic. + CXSourceRange clang_getDiagnosticRange( + ffi.Pointer Diagnostic, + int Range, + ) { + return (_clang_getDiagnosticRange ??= _dylib.lookupFunction< + _c_clang_getDiagnosticRange, + _dart_clang_getDiagnosticRange>('clang_getDiagnosticRange'))( + Diagnostic, + Range, + ); + } + + _dart_clang_getDiagnosticRange? _clang_getDiagnosticRange; + /// Determine the number of fix-it hints associated with the given diagnostic. int clang_getDiagnosticNumFixIts( ffi.Pointer Diagnostic, @@ -624,6 +1056,37 @@ class LibClang { _dart_clang_getDiagnosticNumFixIts? _clang_getDiagnosticNumFixIts; + /// Retrieve the replacement information for a given fix-it. + CXString clang_getDiagnosticFixIt( + ffi.Pointer Diagnostic, + int FixIt, + ffi.Pointer ReplacementRange, + ) { + return (_clang_getDiagnosticFixIt ??= _dylib.lookupFunction< + _c_clang_getDiagnosticFixIt, + _dart_clang_getDiagnosticFixIt>('clang_getDiagnosticFixIt'))( + Diagnostic, + FixIt, + ReplacementRange, + ); + } + + _dart_clang_getDiagnosticFixIt? _clang_getDiagnosticFixIt; + + /// Get the original translation unit source file name. + CXString clang_getTranslationUnitSpelling( + ffi.Pointer CTUnit, + ) { + return (_clang_getTranslationUnitSpelling ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitSpelling, + _dart_clang_getTranslationUnitSpelling>( + 'clang_getTranslationUnitSpelling'))( + CTUnit, + ); + } + + _dart_clang_getTranslationUnitSpelling? _clang_getTranslationUnitSpelling; + /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. ffi.Pointer clang_createTranslationUnitFromSourceFile( @@ -886,6 +1349,33 @@ class LibClang { _dart_clang_getTUResourceUsageName? _clang_getTUResourceUsageName; + /// Return the memory usage of a translation unit. This object should be + /// released with clang_disposeCXTUResourceUsage(). + CXTUResourceUsage clang_getCXTUResourceUsage( + ffi.Pointer TU, + ) { + return (_clang_getCXTUResourceUsage ??= _dylib.lookupFunction< + _c_clang_getCXTUResourceUsage, + _dart_clang_getCXTUResourceUsage>('clang_getCXTUResourceUsage'))( + TU, + ); + } + + _dart_clang_getCXTUResourceUsage? _clang_getCXTUResourceUsage; + + void clang_disposeCXTUResourceUsage( + CXTUResourceUsage usage, + ) { + return (_clang_disposeCXTUResourceUsage ??= _dylib.lookupFunction< + _c_clang_disposeCXTUResourceUsage, + _dart_clang_disposeCXTUResourceUsage>( + 'clang_disposeCXTUResourceUsage'))( + usage, + ); + } + + _dart_clang_disposeCXTUResourceUsage? _clang_disposeCXTUResourceUsage; + /// Get target information for this translation unit. ffi.Pointer clang_getTranslationUnitTargetInfo( ffi.Pointer CTUnit, @@ -913,6 +1403,19 @@ class LibClang { _dart_clang_TargetInfo_dispose? _clang_TargetInfo_dispose; + /// Get the normalized target triple as a string. + CXString clang_TargetInfo_getTriple( + ffi.Pointer Info, + ) { + return (_clang_TargetInfo_getTriple ??= _dylib.lookupFunction< + _c_clang_TargetInfo_getTriple, + _dart_clang_TargetInfo_getTriple>('clang_TargetInfo_getTriple'))( + Info, + ); + } + + _dart_clang_TargetInfo_getTriple? _clang_TargetInfo_getTriple; + /// Get the pointer width of the target in bits. int clang_TargetInfo_getPointerWidth( ffi.Pointer Info, @@ -927,6 +1430,83 @@ class LibClang { _dart_clang_TargetInfo_getPointerWidth? _clang_TargetInfo_getPointerWidth; + /// Retrieve the NULL cursor, which represents no entity. + CXCursor clang_getNullCursor() { + return (_clang_getNullCursor ??= _dylib.lookupFunction< + _c_clang_getNullCursor, + _dart_clang_getNullCursor>('clang_getNullCursor'))(); + } + + _dart_clang_getNullCursor? _clang_getNullCursor; + + /// Retrieve the cursor that represents the given translation unit. + CXCursor clang_getTranslationUnitCursor( + ffi.Pointer arg0, + ) { + return (_clang_getTranslationUnitCursor ??= _dylib.lookupFunction< + _c_clang_getTranslationUnitCursor, + _dart_clang_getTranslationUnitCursor>( + 'clang_getTranslationUnitCursor'))( + arg0, + ); + } + + _dart_clang_getTranslationUnitCursor? _clang_getTranslationUnitCursor; + + /// Determine whether two cursors are equivalent. + int clang_equalCursors( + CXCursor arg0, + CXCursor arg1, + ) { + return (_clang_equalCursors ??= + _dylib.lookupFunction<_c_clang_equalCursors, _dart_clang_equalCursors>( + 'clang_equalCursors'))( + arg0, + arg1, + ); + } + + _dart_clang_equalCursors? _clang_equalCursors; + + /// Returns non-zero if cursor is null. + int clang_Cursor_isNull( + CXCursor cursor, + ) { + return (_clang_Cursor_isNull ??= _dylib.lookupFunction< + _c_clang_Cursor_isNull, + _dart_clang_Cursor_isNull>('clang_Cursor_isNull'))( + cursor, + ); + } + + _dart_clang_Cursor_isNull? _clang_Cursor_isNull; + + /// Compute a hash value for the given cursor. + int clang_hashCursor( + CXCursor arg0, + ) { + return (_clang_hashCursor ??= + _dylib.lookupFunction<_c_clang_hashCursor, _dart_clang_hashCursor>( + 'clang_hashCursor'))( + arg0, + ); + } + + _dart_clang_hashCursor? _clang_hashCursor; + + /// Retrieve the kind of the given cursor. + int clang_getCursorKind( + CXCursor arg0, + ) { + return (_clang_getCursorKind ??= _dylib.lookupFunction< + _c_clang_getCursorKind, + _dart_clang_getCursorKind>('clang_getCursorKind'))( + arg0, + ); + } + + _dart_clang_getCursorKind? _clang_getCursorKind; + /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( int arg0, @@ -940,6 +1520,19 @@ class LibClang { _dart_clang_isDeclaration? _clang_isDeclaration; + /// Determine whether the given declaration is invalid. + int clang_isInvalidDeclaration( + CXCursor arg0, + ) { + return (_clang_isInvalidDeclaration ??= _dylib.lookupFunction< + _c_clang_isInvalidDeclaration, + _dart_clang_isInvalidDeclaration>('clang_isInvalidDeclaration'))( + arg0, + ); + } + + _dart_clang_isInvalidDeclaration? _clang_isInvalidDeclaration; + /// Determine whether the given cursor kind represents a simple reference. int clang_isReference( int arg0, @@ -992,6 +1585,19 @@ class LibClang { _dart_clang_isAttribute? _clang_isAttribute; + /// Determine whether the given cursor has any attributes. + int clang_Cursor_hasAttrs( + CXCursor C, + ) { + return (_clang_Cursor_hasAttrs ??= _dylib.lookupFunction< + _c_clang_Cursor_hasAttrs, + _dart_clang_Cursor_hasAttrs>('clang_Cursor_hasAttrs'))( + C, + ); + } + + _dart_clang_Cursor_hasAttrs? _clang_Cursor_hasAttrs; + /// Determine whether the given cursor kind represents an invalid cursor. int clang_isInvalid( int arg0, @@ -1046,26 +1652,135 @@ class LibClang { _dart_clang_isUnexposed? _clang_isUnexposed; - /// Free the memory associated with a CXPlatformAvailability structure. - void clang_disposeCXPlatformAvailability( - ffi.Pointer availability, + /// Determine the linkage of the entity referred to by a given cursor. + int clang_getCursorLinkage( + CXCursor cursor, ) { - return (_clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< - _c_clang_disposeCXPlatformAvailability, - _dart_clang_disposeCXPlatformAvailability>( - 'clang_disposeCXPlatformAvailability'))( - availability, + return (_clang_getCursorLinkage ??= _dylib.lookupFunction< + _c_clang_getCursorLinkage, + _dart_clang_getCursorLinkage>('clang_getCursorLinkage'))( + cursor, ); } - _dart_clang_disposeCXPlatformAvailability? - _clang_disposeCXPlatformAvailability; + _dart_clang_getCursorLinkage? _clang_getCursorLinkage; - /// Creates an empty CXCursorSet. - ffi.Pointer clang_createCXCursorSet() { - return (_clang_createCXCursorSet ??= _dylib.lookupFunction< - _c_clang_createCXCursorSet, - _dart_clang_createCXCursorSet>('clang_createCXCursorSet'))(); + /// Describe the visibility of the entity referred to by a cursor. + int clang_getCursorVisibility( + CXCursor cursor, + ) { + return (_clang_getCursorVisibility ??= _dylib.lookupFunction< + _c_clang_getCursorVisibility, + _dart_clang_getCursorVisibility>('clang_getCursorVisibility'))( + cursor, + ); + } + + _dart_clang_getCursorVisibility? _clang_getCursorVisibility; + + /// Determine the availability of the entity that this cursor refers to, + /// taking the current target platform into account. + int clang_getCursorAvailability( + CXCursor cursor, + ) { + return (_clang_getCursorAvailability ??= _dylib.lookupFunction< + _c_clang_getCursorAvailability, + _dart_clang_getCursorAvailability>('clang_getCursorAvailability'))( + cursor, + ); + } + + _dart_clang_getCursorAvailability? _clang_getCursorAvailability; + + /// Determine the availability of the entity that this cursor refers to on any + /// platforms for which availability information is known. + int clang_getCursorPlatformAvailability( + CXCursor cursor, + ffi.Pointer always_deprecated, + ffi.Pointer deprecated_message, + ffi.Pointer always_unavailable, + ffi.Pointer unavailable_message, + ffi.Pointer availability, + int availability_size, + ) { + return (_clang_getCursorPlatformAvailability ??= _dylib.lookupFunction< + _c_clang_getCursorPlatformAvailability, + _dart_clang_getCursorPlatformAvailability>( + 'clang_getCursorPlatformAvailability'))( + cursor, + always_deprecated, + deprecated_message, + always_unavailable, + unavailable_message, + availability, + availability_size, + ); + } + + _dart_clang_getCursorPlatformAvailability? + _clang_getCursorPlatformAvailability; + + /// Free the memory associated with a CXPlatformAvailability structure. + void clang_disposeCXPlatformAvailability( + ffi.Pointer availability, + ) { + return (_clang_disposeCXPlatformAvailability ??= _dylib.lookupFunction< + _c_clang_disposeCXPlatformAvailability, + _dart_clang_disposeCXPlatformAvailability>( + 'clang_disposeCXPlatformAvailability'))( + availability, + ); + } + + _dart_clang_disposeCXPlatformAvailability? + _clang_disposeCXPlatformAvailability; + + /// Determine the "language" of the entity referred to by a given cursor. + int clang_getCursorLanguage( + CXCursor cursor, + ) { + return (_clang_getCursorLanguage ??= _dylib.lookupFunction< + _c_clang_getCursorLanguage, + _dart_clang_getCursorLanguage>('clang_getCursorLanguage'))( + cursor, + ); + } + + _dart_clang_getCursorLanguage? _clang_getCursorLanguage; + + /// Determine the "thread-local storage (TLS) kind" of the declaration + /// referred to by a cursor. + int clang_getCursorTLSKind( + CXCursor cursor, + ) { + return (_clang_getCursorTLSKind ??= _dylib.lookupFunction< + _c_clang_getCursorTLSKind, + _dart_clang_getCursorTLSKind>('clang_getCursorTLSKind'))( + cursor, + ); + } + + _dart_clang_getCursorTLSKind? _clang_getCursorTLSKind; + + /// Returns the translation unit that a cursor originated from. + ffi.Pointer clang_Cursor_getTranslationUnit( + CXCursor arg0, + ) { + return (_clang_Cursor_getTranslationUnit ??= _dylib.lookupFunction< + _c_clang_Cursor_getTranslationUnit, + _dart_clang_Cursor_getTranslationUnit>( + 'clang_Cursor_getTranslationUnit'))( + arg0, + ); + } + + _dart_clang_Cursor_getTranslationUnit? _clang_Cursor_getTranslationUnit; + + /// Creates an empty CXCursorSet. + ffi.Pointer clang_createCXCursorSet() { + return (_clang_createCXCursorSet ??= _dylib.lookupFunction< + _c_clang_createCXCursorSet, + _dart_clang_createCXCursorSet>('clang_createCXCursorSet'))(); } _dart_clang_createCXCursorSet? _clang_createCXCursorSet; @@ -1083,6 +1798,79 @@ class LibClang { _dart_clang_disposeCXCursorSet? _clang_disposeCXCursorSet; + /// Queries a CXCursorSet to see if it contains a specific CXCursor. + int clang_CXCursorSet_contains( + ffi.Pointer cset, + CXCursor cursor, + ) { + return (_clang_CXCursorSet_contains ??= _dylib.lookupFunction< + _c_clang_CXCursorSet_contains, + _dart_clang_CXCursorSet_contains>('clang_CXCursorSet_contains'))( + cset, + cursor, + ); + } + + _dart_clang_CXCursorSet_contains? _clang_CXCursorSet_contains; + + /// Inserts a CXCursor into a CXCursorSet. + int clang_CXCursorSet_insert( + ffi.Pointer cset, + CXCursor cursor, + ) { + return (_clang_CXCursorSet_insert ??= _dylib.lookupFunction< + _c_clang_CXCursorSet_insert, + _dart_clang_CXCursorSet_insert>('clang_CXCursorSet_insert'))( + cset, + cursor, + ); + } + + _dart_clang_CXCursorSet_insert? _clang_CXCursorSet_insert; + + /// Determine the semantic parent of the given cursor. + CXCursor clang_getCursorSemanticParent( + CXCursor cursor, + ) { + return (_clang_getCursorSemanticParent ??= _dylib.lookupFunction< + _c_clang_getCursorSemanticParent, + _dart_clang_getCursorSemanticParent>('clang_getCursorSemanticParent'))( + cursor, + ); + } + + _dart_clang_getCursorSemanticParent? _clang_getCursorSemanticParent; + + /// Determine the lexical parent of the given cursor. + CXCursor clang_getCursorLexicalParent( + CXCursor cursor, + ) { + return (_clang_getCursorLexicalParent ??= _dylib.lookupFunction< + _c_clang_getCursorLexicalParent, + _dart_clang_getCursorLexicalParent>('clang_getCursorLexicalParent'))( + cursor, + ); + } + + _dart_clang_getCursorLexicalParent? _clang_getCursorLexicalParent; + + /// Determine the set of methods that are overridden by the given method. + void clang_getOverriddenCursors( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden, + ) { + return (_clang_getOverriddenCursors ??= _dylib.lookupFunction< + _c_clang_getOverriddenCursors, + _dart_clang_getOverriddenCursors>('clang_getOverriddenCursors'))( + cursor, + overridden, + num_overridden, + ); + } + + _dart_clang_getOverriddenCursors? _clang_getOverriddenCursors; + /// Free the set of overridden cursors returned by /// clang_getOverriddenCursors(). void clang_disposeOverriddenCursors( @@ -1098,4172 +1886,7970 @@ class LibClang { _dart_clang_disposeOverriddenCursors? _clang_disposeOverriddenCursors; - /// Get a property value for the given printing policy. - int clang_PrintingPolicy_getProperty( - ffi.Pointer Policy, - int Property, + /// Retrieve the file that is included by the given inclusion directive + /// cursor. + ffi.Pointer clang_getIncludedFile( + CXCursor cursor, ) { - return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_getProperty, - _dart_clang_PrintingPolicy_getProperty>( - 'clang_PrintingPolicy_getProperty'))( - Policy, - Property, + return (_clang_getIncludedFile ??= _dylib.lookupFunction< + _c_clang_getIncludedFile, + _dart_clang_getIncludedFile>('clang_getIncludedFile'))( + cursor, ); } - _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; + _dart_clang_getIncludedFile? _clang_getIncludedFile; - /// Set a property value for the given printing policy. - void clang_PrintingPolicy_setProperty( - ffi.Pointer Policy, - int Property, - int Value, + /// Map a source location to the cursor that describes the entity at that + /// location in the source code. + CXCursor clang_getCursor( + ffi.Pointer arg0, + CXSourceLocation arg1, ) { - return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_setProperty, - _dart_clang_PrintingPolicy_setProperty>( - 'clang_PrintingPolicy_setProperty'))( - Policy, - Property, - Value, + return (_clang_getCursor ??= + _dylib.lookupFunction<_c_clang_getCursor, _dart_clang_getCursor>( + 'clang_getCursor'))( + arg0, + arg1, ); } - _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; + _dart_clang_getCursor? _clang_getCursor; - /// Release a printing policy. - void clang_PrintingPolicy_dispose( - ffi.Pointer Policy, + /// Retrieve the physical location of the source constructor referenced by the + /// given cursor. + CXSourceLocation clang_getCursorLocation( + CXCursor arg0, ) { - return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< - _c_clang_PrintingPolicy_dispose, - _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( - Policy, + return (_clang_getCursorLocation ??= _dylib.lookupFunction< + _c_clang_getCursorLocation, + _dart_clang_getCursorLocation>('clang_getCursorLocation'))( + arg0, ); } - _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; + _dart_clang_getCursorLocation? _clang_getCursorLocation; - /// Given a CXFile header file, return the module that contains it, if one - /// exists. - ffi.Pointer clang_getModuleForFile( - ffi.Pointer arg0, - ffi.Pointer arg1, + /// Retrieve the physical extent of the source construct referenced by the + /// given cursor. + CXSourceRange clang_getCursorExtent( + CXCursor arg0, ) { - return (_clang_getModuleForFile ??= _dylib.lookupFunction< - _c_clang_getModuleForFile, - _dart_clang_getModuleForFile>('clang_getModuleForFile'))( + return (_clang_getCursorExtent ??= _dylib.lookupFunction< + _c_clang_getCursorExtent, + _dart_clang_getCursorExtent>('clang_getCursorExtent'))( arg0, - arg1, ); } - _dart_clang_getModuleForFile? _clang_getModuleForFile; + _dart_clang_getCursorExtent? _clang_getCursorExtent; - /// Returns the module file where the provided module object came from. - ffi.Pointer clang_Module_getASTFile( - ffi.Pointer Module, + /// Retrieve the type of a CXCursor (if any). + CXType clang_getCursorType( + CXCursor C, ) { - return (_clang_Module_getASTFile ??= _dylib.lookupFunction< - _c_clang_Module_getASTFile, - _dart_clang_Module_getASTFile>('clang_Module_getASTFile'))( - Module, + return (_clang_getCursorType ??= _dylib.lookupFunction< + _c_clang_getCursorType, + _dart_clang_getCursorType>('clang_getCursorType'))( + C, ); } - _dart_clang_Module_getASTFile? _clang_Module_getASTFile; + _dart_clang_getCursorType? _clang_getCursorType; - /// Returns the parent of a sub-module or NULL if the given module is - /// top-level, e.g. for 'std.vector' it will return the 'std' module. - ffi.Pointer clang_Module_getParent( - ffi.Pointer Module, + /// Pretty-print the underlying type using the rules of the language of the + /// translation unit from which it came. + CXString clang_getTypeSpelling( + CXType CT, ) { - return (_clang_Module_getParent ??= _dylib.lookupFunction< - _c_clang_Module_getParent, - _dart_clang_Module_getParent>('clang_Module_getParent'))( - Module, + return (_clang_getTypeSpelling ??= _dylib.lookupFunction< + _c_clang_getTypeSpelling, + _dart_clang_getTypeSpelling>('clang_getTypeSpelling'))( + CT, ); } - _dart_clang_Module_getParent? _clang_Module_getParent; + _dart_clang_getTypeSpelling? _clang_getTypeSpelling; - /// Returns non-zero if the module is a system one. - int clang_Module_isSystem( - ffi.Pointer Module, + /// Retrieve the underlying type of a typedef declaration. + CXType clang_getTypedefDeclUnderlyingType( + CXCursor C, ) { - return (_clang_Module_isSystem ??= _dylib.lookupFunction< - _c_clang_Module_isSystem, - _dart_clang_Module_isSystem>('clang_Module_isSystem'))( - Module, + return (_clang_getTypedefDeclUnderlyingType ??= _dylib.lookupFunction< + _c_clang_getTypedefDeclUnderlyingType, + _dart_clang_getTypedefDeclUnderlyingType>( + 'clang_getTypedefDeclUnderlyingType'))( + C, ); } - _dart_clang_Module_isSystem? _clang_Module_isSystem; + _dart_clang_getTypedefDeclUnderlyingType? _clang_getTypedefDeclUnderlyingType; - /// Returns the number of top level headers associated with this module. - int clang_Module_getNumTopLevelHeaders( - ffi.Pointer arg0, - ffi.Pointer Module, + /// Retrieve the integer type of an enum declaration. + CXType clang_getEnumDeclIntegerType( + CXCursor C, ) { - return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< - _c_clang_Module_getNumTopLevelHeaders, - _dart_clang_Module_getNumTopLevelHeaders>( - 'clang_Module_getNumTopLevelHeaders'))( - arg0, - Module, + return (_clang_getEnumDeclIntegerType ??= _dylib.lookupFunction< + _c_clang_getEnumDeclIntegerType, + _dart_clang_getEnumDeclIntegerType>('clang_getEnumDeclIntegerType'))( + C, ); } - _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; + _dart_clang_getEnumDeclIntegerType? _clang_getEnumDeclIntegerType; - /// Returns the specified top level header associated with the module. - ffi.Pointer clang_Module_getTopLevelHeader( - ffi.Pointer arg0, - ffi.Pointer Module, - int Index, + /// Retrieve the integer value of an enum constant declaration as a signed + /// long long. + int clang_getEnumConstantDeclValue( + CXCursor C, ) { - return (_clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< - _c_clang_Module_getTopLevelHeader, - _dart_clang_Module_getTopLevelHeader>( - 'clang_Module_getTopLevelHeader'))( - arg0, - Module, - Index, + return (_clang_getEnumConstantDeclValue ??= _dylib.lookupFunction< + _c_clang_getEnumConstantDeclValue, + _dart_clang_getEnumConstantDeclValue>( + 'clang_getEnumConstantDeclValue'))( + C, ); } - _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; + _dart_clang_getEnumConstantDeclValue? _clang_getEnumConstantDeclValue; - /// Annotate the given set of tokens by providing cursors for each token that - /// can be mapped to a specific entity within the abstract syntax tree. - void clang_annotateTokens( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, - ffi.Pointer Cursors, + /// Retrieve the integer value of an enum constant declaration as an unsigned + /// long long. + int clang_getEnumConstantDeclUnsignedValue( + CXCursor C, ) { - return (_clang_annotateTokens ??= _dylib.lookupFunction< - _c_clang_annotateTokens, - _dart_clang_annotateTokens>('clang_annotateTokens'))( - TU, - Tokens, - NumTokens, - Cursors, + return (_clang_getEnumConstantDeclUnsignedValue ??= _dylib.lookupFunction< + _c_clang_getEnumConstantDeclUnsignedValue, + _dart_clang_getEnumConstantDeclUnsignedValue>( + 'clang_getEnumConstantDeclUnsignedValue'))( + C, ); } - _dart_clang_annotateTokens? _clang_annotateTokens; + _dart_clang_getEnumConstantDeclUnsignedValue? + _clang_getEnumConstantDeclUnsignedValue; - /// Free the given set of tokens. - void clang_disposeTokens( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, + /// Retrieve the bit width of a bit field declaration as an integer. + int clang_getFieldDeclBitWidth( + CXCursor C, ) { - return (_clang_disposeTokens ??= _dylib.lookupFunction< - _c_clang_disposeTokens, - _dart_clang_disposeTokens>('clang_disposeTokens'))( - TU, - Tokens, - NumTokens, + return (_clang_getFieldDeclBitWidth ??= _dylib.lookupFunction< + _c_clang_getFieldDeclBitWidth, + _dart_clang_getFieldDeclBitWidth>('clang_getFieldDeclBitWidth'))( + C, ); } - _dart_clang_disposeTokens? _clang_disposeTokens; + _dart_clang_getFieldDeclBitWidth? _clang_getFieldDeclBitWidth; - void clang_enableStackTraces() { - return (_clang_enableStackTraces ??= _dylib.lookupFunction< - _c_clang_enableStackTraces, - _dart_clang_enableStackTraces>('clang_enableStackTraces'))(); + /// Retrieve the number of non-variadic arguments associated with a given + /// cursor. + int clang_Cursor_getNumArguments( + CXCursor C, + ) { + return (_clang_Cursor_getNumArguments ??= _dylib.lookupFunction< + _c_clang_Cursor_getNumArguments, + _dart_clang_Cursor_getNumArguments>('clang_Cursor_getNumArguments'))( + C, + ); } - _dart_clang_enableStackTraces? _clang_enableStackTraces; + _dart_clang_Cursor_getNumArguments? _clang_Cursor_getNumArguments; - void clang_executeOnThread( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, + /// Retrieve the argument cursor of a function or method. + CXCursor clang_Cursor_getArgument( + CXCursor C, + int i, ) { - return (_clang_executeOnThread ??= _dylib.lookupFunction< - _c_clang_executeOnThread, - _dart_clang_executeOnThread>('clang_executeOnThread'))( - fn, - user_data, - stack_size, + return (_clang_Cursor_getArgument ??= _dylib.lookupFunction< + _c_clang_Cursor_getArgument, + _dart_clang_Cursor_getArgument>('clang_Cursor_getArgument'))( + C, + i, ); } - _dart_clang_executeOnThread? _clang_executeOnThread; + _dart_clang_Cursor_getArgument? _clang_Cursor_getArgument; - /// Determine the kind of a particular chunk within a completion string. - int clang_getCompletionChunkKind( - ffi.Pointer completion_string, - int chunk_number, + /// Returns the number of template args of a function decl representing a + /// template specialization. + int clang_Cursor_getNumTemplateArguments( + CXCursor C, ) { - return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkKind, - _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( - completion_string, - chunk_number, + return (_clang_Cursor_getNumTemplateArguments ??= _dylib.lookupFunction< + _c_clang_Cursor_getNumTemplateArguments, + _dart_clang_Cursor_getNumTemplateArguments>( + 'clang_Cursor_getNumTemplateArguments'))( + C, ); } - _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; + _dart_clang_Cursor_getNumTemplateArguments? + _clang_Cursor_getNumTemplateArguments; - /// Retrieve the completion string associated with a particular chunk within a - /// completion string. - ffi.Pointer clang_getCompletionChunkCompletionString( - ffi.Pointer completion_string, - int chunk_number, + /// Retrieve the kind of the I'th template argument of the CXCursor C. + int clang_Cursor_getTemplateArgumentKind( + CXCursor C, + int I, ) { - return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< - _c_clang_getCompletionChunkCompletionString, - _dart_clang_getCompletionChunkCompletionString>( - 'clang_getCompletionChunkCompletionString'))( - completion_string, - chunk_number, + return (_clang_Cursor_getTemplateArgumentKind ??= _dylib.lookupFunction< + _c_clang_Cursor_getTemplateArgumentKind, + _dart_clang_Cursor_getTemplateArgumentKind>( + 'clang_Cursor_getTemplateArgumentKind'))( + C, + I, ); } - _dart_clang_getCompletionChunkCompletionString? - _clang_getCompletionChunkCompletionString; + _dart_clang_Cursor_getTemplateArgumentKind? + _clang_Cursor_getTemplateArgumentKind; - /// Retrieve the number of chunks in the given code-completion string. - int clang_getNumCompletionChunks( - ffi.Pointer completion_string, + /// Retrieve a CXType representing the type of a TemplateArgument of a + /// function decl representing a template specialization. + CXType clang_Cursor_getTemplateArgumentType( + CXCursor C, + int I, ) { - return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< - _c_clang_getNumCompletionChunks, - _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( - completion_string, + return (_clang_Cursor_getTemplateArgumentType ??= _dylib.lookupFunction< + _c_clang_Cursor_getTemplateArgumentType, + _dart_clang_Cursor_getTemplateArgumentType>( + 'clang_Cursor_getTemplateArgumentType'))( + C, + I, ); } - _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; + _dart_clang_Cursor_getTemplateArgumentType? + _clang_Cursor_getTemplateArgumentType; - /// Determine the priority of this code completion. - int clang_getCompletionPriority( - ffi.Pointer completion_string, + /// Retrieve the value of an Integral TemplateArgument (of a function decl + /// representing a template specialization) as a signed long long. + int clang_Cursor_getTemplateArgumentValue( + CXCursor C, + int I, ) { - return (_clang_getCompletionPriority ??= _dylib.lookupFunction< - _c_clang_getCompletionPriority, - _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( - completion_string, + return (_clang_Cursor_getTemplateArgumentValue ??= _dylib.lookupFunction< + _c_clang_Cursor_getTemplateArgumentValue, + _dart_clang_Cursor_getTemplateArgumentValue>( + 'clang_Cursor_getTemplateArgumentValue'))( + C, + I, ); } - _dart_clang_getCompletionPriority? _clang_getCompletionPriority; + _dart_clang_Cursor_getTemplateArgumentValue? + _clang_Cursor_getTemplateArgumentValue; - /// Determine the availability of the entity that this code-completion string - /// refers to. - int clang_getCompletionAvailability( - ffi.Pointer completion_string, + /// Retrieve the value of an Integral TemplateArgument (of a function decl + /// representing a template specialization) as an unsigned long long. + int clang_Cursor_getTemplateArgumentUnsignedValue( + CXCursor C, + int I, ) { - return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< - _c_clang_getCompletionAvailability, - _dart_clang_getCompletionAvailability>( - 'clang_getCompletionAvailability'))( - completion_string, + return (_clang_Cursor_getTemplateArgumentUnsignedValue ??= + _dylib.lookupFunction<_c_clang_Cursor_getTemplateArgumentUnsignedValue, + _dart_clang_Cursor_getTemplateArgumentUnsignedValue>( + 'clang_Cursor_getTemplateArgumentUnsignedValue'))( + C, + I, ); } - _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; + _dart_clang_Cursor_getTemplateArgumentUnsignedValue? + _clang_Cursor_getTemplateArgumentUnsignedValue; - /// Retrieve the number of annotations associated with the given completion - /// string. - int clang_getCompletionNumAnnotations( - ffi.Pointer completion_string, + /// Determine whether two CXTypes represent the same type. + int clang_equalTypes( + CXType A, + CXType B, ) { - return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< - _c_clang_getCompletionNumAnnotations, - _dart_clang_getCompletionNumAnnotations>( - 'clang_getCompletionNumAnnotations'))( - completion_string, + return (_clang_equalTypes ??= + _dylib.lookupFunction<_c_clang_equalTypes, _dart_clang_equalTypes>( + 'clang_equalTypes'))( + A, + B, ); } - _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; + _dart_clang_equalTypes? _clang_equalTypes; - /// Retrieve the number of fix-its for the given completion index. - int clang_getCompletionNumFixIts( - ffi.Pointer results, - int completion_index, + /// Return the canonical type for a CXType. + CXType clang_getCanonicalType( + CXType T, ) { - return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< - _c_clang_getCompletionNumFixIts, - _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( - results, - completion_index, + return (_clang_getCanonicalType ??= _dylib.lookupFunction< + _c_clang_getCanonicalType, + _dart_clang_getCanonicalType>('clang_getCanonicalType'))( + T, ); } - _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; + _dart_clang_getCanonicalType? _clang_getCanonicalType; - /// Returns a default set of code-completion options that can be passed to - /// clang_codeCompleteAt(). - int clang_defaultCodeCompleteOptions() { - return (_clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< - _c_clang_defaultCodeCompleteOptions, - _dart_clang_defaultCodeCompleteOptions>( - 'clang_defaultCodeCompleteOptions'))(); + /// Determine whether a CXType has the "const" qualifier set, without looking + /// through typedefs that may have added "const" at a different level. + int clang_isConstQualifiedType( + CXType T, + ) { + return (_clang_isConstQualifiedType ??= _dylib.lookupFunction< + _c_clang_isConstQualifiedType, + _dart_clang_isConstQualifiedType>('clang_isConstQualifiedType'))( + T, + ); } - _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; + _dart_clang_isConstQualifiedType? _clang_isConstQualifiedType; - /// Perform code completion at a given location in a translation unit. - ffi.Pointer clang_codeCompleteAt( - ffi.Pointer TU, - ffi.Pointer complete_filename, - int complete_line, - int complete_column, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, + /// Determine whether a CXCursor that is a macro, is function like. + int clang_Cursor_isMacroFunctionLike( + CXCursor C, ) { - return (_clang_codeCompleteAt ??= _dylib.lookupFunction< - _c_clang_codeCompleteAt, - _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( - TU, - complete_filename, - complete_line, - complete_column, - unsaved_files, - num_unsaved_files, - options, + return (_clang_Cursor_isMacroFunctionLike ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroFunctionLike, + _dart_clang_Cursor_isMacroFunctionLike>( + 'clang_Cursor_isMacroFunctionLike'))( + C, ); } - _dart_clang_codeCompleteAt? _clang_codeCompleteAt; + _dart_clang_Cursor_isMacroFunctionLike? _clang_Cursor_isMacroFunctionLike; - /// Sort the code-completion results in case-insensitive alphabetical order. - void clang_sortCodeCompletionResults( - ffi.Pointer Results, - int NumResults, + /// Determine whether a CXCursor that is a macro, is a builtin one. + int clang_Cursor_isMacroBuiltin( + CXCursor C, ) { - return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< - _c_clang_sortCodeCompletionResults, - _dart_clang_sortCodeCompletionResults>( - 'clang_sortCodeCompletionResults'))( - Results, - NumResults, + return (_clang_Cursor_isMacroBuiltin ??= _dylib.lookupFunction< + _c_clang_Cursor_isMacroBuiltin, + _dart_clang_Cursor_isMacroBuiltin>('clang_Cursor_isMacroBuiltin'))( + C, ); } - _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; + _dart_clang_Cursor_isMacroBuiltin? _clang_Cursor_isMacroBuiltin; - /// Free the given set of code-completion results. - void clang_disposeCodeCompleteResults( - ffi.Pointer Results, + /// Determine whether a CXCursor that is a function declaration, is an inline + /// declaration. + int clang_Cursor_isFunctionInlined( + CXCursor C, ) { - return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< - _c_clang_disposeCodeCompleteResults, - _dart_clang_disposeCodeCompleteResults>( - 'clang_disposeCodeCompleteResults'))( - Results, + return (_clang_Cursor_isFunctionInlined ??= _dylib.lookupFunction< + _c_clang_Cursor_isFunctionInlined, + _dart_clang_Cursor_isFunctionInlined>( + 'clang_Cursor_isFunctionInlined'))( + C, ); } - _dart_clang_disposeCodeCompleteResults? _clang_disposeCodeCompleteResults; + _dart_clang_Cursor_isFunctionInlined? _clang_Cursor_isFunctionInlined; - /// Determine the number of diagnostics produced prior to the location where - /// code completion was performed. - int clang_codeCompleteGetNumDiagnostics( - ffi.Pointer Results, + /// Determine whether a CXType has the "volatile" qualifier set, without + /// looking through typedefs that may have added "volatile" at a different + /// level. + int clang_isVolatileQualifiedType( + CXType T, ) { - return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetNumDiagnostics, - _dart_clang_codeCompleteGetNumDiagnostics>( - 'clang_codeCompleteGetNumDiagnostics'))( - Results, + return (_clang_isVolatileQualifiedType ??= _dylib.lookupFunction< + _c_clang_isVolatileQualifiedType, + _dart_clang_isVolatileQualifiedType>('clang_isVolatileQualifiedType'))( + T, ); } - _dart_clang_codeCompleteGetNumDiagnostics? - _clang_codeCompleteGetNumDiagnostics; + _dart_clang_isVolatileQualifiedType? _clang_isVolatileQualifiedType; - /// Retrieve a diagnostic associated with the given code completion. - ffi.Pointer clang_codeCompleteGetDiagnostic( - ffi.Pointer Results, - int Index, + /// Determine whether a CXType has the "restrict" qualifier set, without + /// looking through typedefs that may have added "restrict" at a different + /// level. + int clang_isRestrictQualifiedType( + CXType T, ) { - return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetDiagnostic, - _dart_clang_codeCompleteGetDiagnostic>( - 'clang_codeCompleteGetDiagnostic'))( - Results, - Index, + return (_clang_isRestrictQualifiedType ??= _dylib.lookupFunction< + _c_clang_isRestrictQualifiedType, + _dart_clang_isRestrictQualifiedType>('clang_isRestrictQualifiedType'))( + T, ); } - _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; + _dart_clang_isRestrictQualifiedType? _clang_isRestrictQualifiedType; - /// Determines what completions are appropriate for the context the given code - /// completion. - int clang_codeCompleteGetContexts( - ffi.Pointer Results, + /// Returns the address space of the given type. + int clang_getAddressSpace( + CXType T, ) { - return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContexts, - _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( - Results, + return (_clang_getAddressSpace ??= _dylib.lookupFunction< + _c_clang_getAddressSpace, + _dart_clang_getAddressSpace>('clang_getAddressSpace'))( + T, ); } - _dart_clang_codeCompleteGetContexts? _clang_codeCompleteGetContexts; + _dart_clang_getAddressSpace? _clang_getAddressSpace; - /// Returns the cursor kind for the container for the current code completion - /// context. The container is only guaranteed to be set for contexts where a - /// container exists (i.e. member accesses or Objective-C message sends); if - /// there is not a container, this function will return CXCursor_InvalidCode. - int clang_codeCompleteGetContainerKind( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, + /// Returns the typedef name of the given type. + CXString clang_getTypedefName( + CXType CT, ) { - return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< - _c_clang_codeCompleteGetContainerKind, - _dart_clang_codeCompleteGetContainerKind>( - 'clang_codeCompleteGetContainerKind'))( - Results, - IsIncomplete, + return (_clang_getTypedefName ??= _dylib.lookupFunction< + _c_clang_getTypedefName, + _dart_clang_getTypedefName>('clang_getTypedefName'))( + CT, ); } - _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; + _dart_clang_getTypedefName? _clang_getTypedefName; - /// Enable/disable crash recovery. - void clang_toggleCrashRecovery( - int isEnabled, + /// For pointer types, returns the type of the pointee. + CXType clang_getPointeeType( + CXType T, ) { - return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< - _c_clang_toggleCrashRecovery, - _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( - isEnabled, + return (_clang_getPointeeType ??= _dylib.lookupFunction< + _c_clang_getPointeeType, + _dart_clang_getPointeeType>('clang_getPointeeType'))( + T, ); } - _dart_clang_toggleCrashRecovery? _clang_toggleCrashRecovery; + _dart_clang_getPointeeType? _clang_getPointeeType; - /// Visit the set of preprocessor inclusions in a translation unit. The - /// visitor function is called with the provided data for every included file. - /// This does not include headers included by the PCH file (unless one is - /// inspecting the inclusions in the PCH file itself). - void clang_getInclusions( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, + /// Return the cursor for the declaration of the given type. + CXCursor clang_getTypeDeclaration( + CXType T, ) { - return (_clang_getInclusions ??= _dylib.lookupFunction< - _c_clang_getInclusions, - _dart_clang_getInclusions>('clang_getInclusions'))( - tu, - visitor, - client_data, + return (_clang_getTypeDeclaration ??= _dylib.lookupFunction< + _c_clang_getTypeDeclaration, + _dart_clang_getTypeDeclaration>('clang_getTypeDeclaration'))( + T, ); } - _dart_clang_getInclusions? _clang_getInclusions; + _dart_clang_getTypeDeclaration? _clang_getTypeDeclaration; - /// Returns the kind of the evaluated result. - int clang_EvalResult_getKind( - ffi.Pointer E, + /// Returns the Objective-C type encoding for the specified declaration. + CXString clang_getDeclObjCTypeEncoding( + CXCursor C, ) { - return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< - _c_clang_EvalResult_getKind, - _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( - E, + return (_clang_getDeclObjCTypeEncoding ??= _dylib.lookupFunction< + _c_clang_getDeclObjCTypeEncoding, + _dart_clang_getDeclObjCTypeEncoding>('clang_getDeclObjCTypeEncoding'))( + C, ); } - _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; + _dart_clang_getDeclObjCTypeEncoding? _clang_getDeclObjCTypeEncoding; - /// Returns the evaluation result as integer if the kind is Int. - int clang_EvalResult_getAsInt( - ffi.Pointer E, + /// Returns the Objective-C type encoding for the specified CXType. + CXString clang_Type_getObjCEncoding( + CXType type, ) { - return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsInt, - _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( - E, + return (_clang_Type_getObjCEncoding ??= _dylib.lookupFunction< + _c_clang_Type_getObjCEncoding, + _dart_clang_Type_getObjCEncoding>('clang_Type_getObjCEncoding'))( + type, ); } - _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; + _dart_clang_Type_getObjCEncoding? _clang_Type_getObjCEncoding; - /// Returns the evaluation result as a long long integer if the kind is Int. - /// This prevents overflows that may happen if the result is returned with - /// clang_EvalResult_getAsInt. - int clang_EvalResult_getAsLongLong( - ffi.Pointer E, + /// Retrieve the spelling of a given CXTypeKind. + CXString clang_getTypeKindSpelling( + int K, ) { - return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsLongLong, - _dart_clang_EvalResult_getAsLongLong>( - 'clang_EvalResult_getAsLongLong'))( - E, + return (_clang_getTypeKindSpelling ??= _dylib.lookupFunction< + _c_clang_getTypeKindSpelling, + _dart_clang_getTypeKindSpelling>('clang_getTypeKindSpelling'))( + K, ); } - _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; + _dart_clang_getTypeKindSpelling? _clang_getTypeKindSpelling; - /// Returns a non-zero value if the kind is Int and the evaluation result - /// resulted in an unsigned integer. - int clang_EvalResult_isUnsignedInt( - ffi.Pointer E, + /// Retrieve the calling convention associated with a function type. + int clang_getFunctionTypeCallingConv( + CXType T, ) { - return (_clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< - _c_clang_EvalResult_isUnsignedInt, - _dart_clang_EvalResult_isUnsignedInt>( - 'clang_EvalResult_isUnsignedInt'))( - E, + return (_clang_getFunctionTypeCallingConv ??= _dylib.lookupFunction< + _c_clang_getFunctionTypeCallingConv, + _dart_clang_getFunctionTypeCallingConv>( + 'clang_getFunctionTypeCallingConv'))( + T, ); } - _dart_clang_EvalResult_isUnsignedInt? _clang_EvalResult_isUnsignedInt; + _dart_clang_getFunctionTypeCallingConv? _clang_getFunctionTypeCallingConv; - /// Returns the evaluation result as an unsigned integer if the kind is Int - /// and clang_EvalResult_isUnsignedInt is non-zero. - int clang_EvalResult_getAsUnsigned( - ffi.Pointer E, + /// Retrieve the return type associated with a function type. + CXType clang_getResultType( + CXType T, ) { - return (_clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsUnsigned, - _dart_clang_EvalResult_getAsUnsigned>( - 'clang_EvalResult_getAsUnsigned'))( - E, + return (_clang_getResultType ??= _dylib.lookupFunction< + _c_clang_getResultType, + _dart_clang_getResultType>('clang_getResultType'))( + T, ); } - _dart_clang_EvalResult_getAsUnsigned? _clang_EvalResult_getAsUnsigned; + _dart_clang_getResultType? _clang_getResultType; - /// Returns the evaluation result as double if the kind is double. - double clang_EvalResult_getAsDouble( - ffi.Pointer E, + /// Retrieve the exception specification type associated with a function type. + /// This is a value of type CXCursor_ExceptionSpecificationKind. + int clang_getExceptionSpecificationType( + CXType T, ) { - return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsDouble, - _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( - E, + return (_clang_getExceptionSpecificationType ??= _dylib.lookupFunction< + _c_clang_getExceptionSpecificationType, + _dart_clang_getExceptionSpecificationType>( + 'clang_getExceptionSpecificationType'))( + T, ); } - _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; + _dart_clang_getExceptionSpecificationType? + _clang_getExceptionSpecificationType; - /// Returns the evaluation result as a constant string if the kind is other - /// than Int or float. User must not free this pointer, instead call - /// clang_EvalResult_dispose on the CXEvalResult returned by - /// clang_Cursor_Evaluate. - ffi.Pointer clang_EvalResult_getAsStr( - ffi.Pointer E, + /// Retrieve the number of non-variadic parameters associated with a function + /// type. + int clang_getNumArgTypes( + CXType T, ) { - return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< - _c_clang_EvalResult_getAsStr, - _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( - E, + return (_clang_getNumArgTypes ??= _dylib.lookupFunction< + _c_clang_getNumArgTypes, + _dart_clang_getNumArgTypes>('clang_getNumArgTypes'))( + T, ); } - _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; + _dart_clang_getNumArgTypes? _clang_getNumArgTypes; - /// Disposes the created Eval memory. - void clang_EvalResult_dispose( - ffi.Pointer E, + /// Retrieve the type of a parameter of a function type. + CXType clang_getArgType( + CXType T, + int i, ) { - return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< - _c_clang_EvalResult_dispose, - _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( - E, + return (_clang_getArgType ??= + _dylib.lookupFunction<_c_clang_getArgType, _dart_clang_getArgType>( + 'clang_getArgType'))( + T, + i, ); } - _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; + _dart_clang_getArgType? _clang_getArgType; - /// Retrieve a remapping. - ffi.Pointer clang_getRemappings( - ffi.Pointer path, + /// Retrieves the base type of the ObjCObjectType. + CXType clang_Type_getObjCObjectBaseType( + CXType T, ) { - return (_clang_getRemappings ??= _dylib.lookupFunction< - _c_clang_getRemappings, - _dart_clang_getRemappings>('clang_getRemappings'))( - path, + return (_clang_Type_getObjCObjectBaseType ??= _dylib.lookupFunction< + _c_clang_Type_getObjCObjectBaseType, + _dart_clang_Type_getObjCObjectBaseType>( + 'clang_Type_getObjCObjectBaseType'))( + T, ); } - _dart_clang_getRemappings? _clang_getRemappings; + _dart_clang_Type_getObjCObjectBaseType? _clang_Type_getObjCObjectBaseType; - /// Retrieve a remapping. - ffi.Pointer clang_getRemappingsFromFileList( - ffi.Pointer> filePaths, - int numFiles, + /// Retrieve the number of protocol references associated with an ObjC + /// object/id. + int clang_Type_getNumObjCProtocolRefs( + CXType T, ) { - return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< - _c_clang_getRemappingsFromFileList, - _dart_clang_getRemappingsFromFileList>( - 'clang_getRemappingsFromFileList'))( - filePaths, - numFiles, + return (_clang_Type_getNumObjCProtocolRefs ??= _dylib.lookupFunction< + _c_clang_Type_getNumObjCProtocolRefs, + _dart_clang_Type_getNumObjCProtocolRefs>( + 'clang_Type_getNumObjCProtocolRefs'))( + T, ); } - _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; + _dart_clang_Type_getNumObjCProtocolRefs? _clang_Type_getNumObjCProtocolRefs; - /// Determine the number of remappings. - int clang_remap_getNumFiles( - ffi.Pointer arg0, + /// Retrieve the decl for a protocol reference for an ObjC object/id. + CXCursor clang_Type_getObjCProtocolDecl( + CXType T, + int i, ) { - return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< - _c_clang_remap_getNumFiles, - _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( - arg0, + return (_clang_Type_getObjCProtocolDecl ??= _dylib.lookupFunction< + _c_clang_Type_getObjCProtocolDecl, + _dart_clang_Type_getObjCProtocolDecl>( + 'clang_Type_getObjCProtocolDecl'))( + T, + i, ); } - _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; + _dart_clang_Type_getObjCProtocolDecl? _clang_Type_getObjCProtocolDecl; - /// Get the original and the associated filename from the remapping. - void clang_remap_getFilenames( - ffi.Pointer arg0, - int index, - ffi.Pointer original, - ffi.Pointer transformed, + /// Retreive the number of type arguments associated with an ObjC object. + int clang_Type_getNumObjCTypeArgs( + CXType T, ) { - return (_clang_remap_getFilenames ??= _dylib.lookupFunction< - _c_clang_remap_getFilenames, - _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( - arg0, - index, - original, - transformed, + return (_clang_Type_getNumObjCTypeArgs ??= _dylib.lookupFunction< + _c_clang_Type_getNumObjCTypeArgs, + _dart_clang_Type_getNumObjCTypeArgs>('clang_Type_getNumObjCTypeArgs'))( + T, ); } - _dart_clang_remap_getFilenames? _clang_remap_getFilenames; + _dart_clang_Type_getNumObjCTypeArgs? _clang_Type_getNumObjCTypeArgs; - /// Dispose the remapping. - void clang_remap_dispose( - ffi.Pointer arg0, + /// Retrieve a type argument associated with an ObjC object. + CXType clang_Type_getObjCTypeArg( + CXType T, + int i, ) { - return (_clang_remap_dispose ??= _dylib.lookupFunction< - _c_clang_remap_dispose, - _dart_clang_remap_dispose>('clang_remap_dispose'))( - arg0, + return (_clang_Type_getObjCTypeArg ??= _dylib.lookupFunction< + _c_clang_Type_getObjCTypeArg, + _dart_clang_Type_getObjCTypeArg>('clang_Type_getObjCTypeArg'))( + T, + i, ); } - _dart_clang_remap_dispose? _clang_remap_dispose; + _dart_clang_Type_getObjCTypeArg? _clang_Type_getObjCTypeArg; - int clang_index_isEntityObjCContainerKind( - int arg0, + /// Return 1 if the CXType is a variadic function type, and 0 otherwise. + int clang_isFunctionTypeVariadic( + CXType T, ) { - return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< - _c_clang_index_isEntityObjCContainerKind, - _dart_clang_index_isEntityObjCContainerKind>( - 'clang_index_isEntityObjCContainerKind'))( - arg0, + return (_clang_isFunctionTypeVariadic ??= _dylib.lookupFunction< + _c_clang_isFunctionTypeVariadic, + _dart_clang_isFunctionTypeVariadic>('clang_isFunctionTypeVariadic'))( + T, ); } - _dart_clang_index_isEntityObjCContainerKind? - _clang_index_isEntityObjCContainerKind; + _dart_clang_isFunctionTypeVariadic? _clang_isFunctionTypeVariadic; - ffi.Pointer clang_index_getObjCContainerDeclInfo( - ffi.Pointer arg0, + /// Retrieve the return type associated with a given cursor. + CXType clang_getCursorResultType( + CXCursor C, ) { - return (_clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCContainerDeclInfo, - _dart_clang_index_getObjCContainerDeclInfo>( - 'clang_index_getObjCContainerDeclInfo'))( - arg0, + return (_clang_getCursorResultType ??= _dylib.lookupFunction< + _c_clang_getCursorResultType, + _dart_clang_getCursorResultType>('clang_getCursorResultType'))( + C, ); } - _dart_clang_index_getObjCContainerDeclInfo? - _clang_index_getObjCContainerDeclInfo; + _dart_clang_getCursorResultType? _clang_getCursorResultType; - ffi.Pointer clang_index_getObjCInterfaceDeclInfo( - ffi.Pointer arg0, + /// Retrieve the exception specification type associated with a given cursor. + /// This is a value of type CXCursor_ExceptionSpecificationKind. + int clang_getCursorExceptionSpecificationType( + CXCursor C, ) { - return (_clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCInterfaceDeclInfo, - _dart_clang_index_getObjCInterfaceDeclInfo>( - 'clang_index_getObjCInterfaceDeclInfo'))( - arg0, + return (_clang_getCursorExceptionSpecificationType ??= + _dylib.lookupFunction<_c_clang_getCursorExceptionSpecificationType, + _dart_clang_getCursorExceptionSpecificationType>( + 'clang_getCursorExceptionSpecificationType'))( + C, ); } - _dart_clang_index_getObjCInterfaceDeclInfo? - _clang_index_getObjCInterfaceDeclInfo; + _dart_clang_getCursorExceptionSpecificationType? + _clang_getCursorExceptionSpecificationType; - ffi.Pointer clang_index_getObjCCategoryDeclInfo( - ffi.Pointer arg0, + /// Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise. + int clang_isPODType( + CXType T, ) { - return (_clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCCategoryDeclInfo, - _dart_clang_index_getObjCCategoryDeclInfo>( - 'clang_index_getObjCCategoryDeclInfo'))( - arg0, + return (_clang_isPODType ??= + _dylib.lookupFunction<_c_clang_isPODType, _dart_clang_isPODType>( + 'clang_isPODType'))( + T, ); } - _dart_clang_index_getObjCCategoryDeclInfo? - _clang_index_getObjCCategoryDeclInfo; + _dart_clang_isPODType? _clang_isPODType; - ffi.Pointer - clang_index_getObjCProtocolRefListInfo( - ffi.Pointer arg0, + /// Return the element type of an array, complex, or vector type. + CXType clang_getElementType( + CXType T, ) { - return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCProtocolRefListInfo, - _dart_clang_index_getObjCProtocolRefListInfo>( - 'clang_index_getObjCProtocolRefListInfo'))( - arg0, + return (_clang_getElementType ??= _dylib.lookupFunction< + _c_clang_getElementType, + _dart_clang_getElementType>('clang_getElementType'))( + T, ); } - _dart_clang_index_getObjCProtocolRefListInfo? - _clang_index_getObjCProtocolRefListInfo; + _dart_clang_getElementType? _clang_getElementType; - ffi.Pointer clang_index_getObjCPropertyDeclInfo( - ffi.Pointer arg0, + /// Return the number of elements of an array or vector type. + int clang_getNumElements( + CXType T, ) { - return (_clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getObjCPropertyDeclInfo, - _dart_clang_index_getObjCPropertyDeclInfo>( - 'clang_index_getObjCPropertyDeclInfo'))( - arg0, + return (_clang_getNumElements ??= _dylib.lookupFunction< + _c_clang_getNumElements, + _dart_clang_getNumElements>('clang_getNumElements'))( + T, ); } - _dart_clang_index_getObjCPropertyDeclInfo? - _clang_index_getObjCPropertyDeclInfo; + _dart_clang_getNumElements? _clang_getNumElements; - ffi.Pointer - clang_index_getIBOutletCollectionAttrInfo( - ffi.Pointer arg0, + /// Return the element type of an array type. + CXType clang_getArrayElementType( + CXType T, ) { - return (_clang_index_getIBOutletCollectionAttrInfo ??= - _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, - _dart_clang_index_getIBOutletCollectionAttrInfo>( - 'clang_index_getIBOutletCollectionAttrInfo'))( - arg0, + return (_clang_getArrayElementType ??= _dylib.lookupFunction< + _c_clang_getArrayElementType, + _dart_clang_getArrayElementType>('clang_getArrayElementType'))( + T, ); } - _dart_clang_index_getIBOutletCollectionAttrInfo? - _clang_index_getIBOutletCollectionAttrInfo; + _dart_clang_getArrayElementType? _clang_getArrayElementType; - ffi.Pointer clang_index_getCXXClassDeclInfo( - ffi.Pointer arg0, + /// Return the array size of a constant array. + int clang_getArraySize( + CXType T, ) { - return (_clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< - _c_clang_index_getCXXClassDeclInfo, - _dart_clang_index_getCXXClassDeclInfo>( - 'clang_index_getCXXClassDeclInfo'))( - arg0, + return (_clang_getArraySize ??= + _dylib.lookupFunction<_c_clang_getArraySize, _dart_clang_getArraySize>( + 'clang_getArraySize'))( + T, ); } - _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; + _dart_clang_getArraySize? _clang_getArraySize; - /// For retrieving a custom CXIdxClientContainer attached to a container. - ffi.Pointer clang_index_getClientContainer( - ffi.Pointer arg0, + /// Retrieve the type named by the qualified-id. + CXType clang_Type_getNamedType( + CXType T, ) { - return (_clang_index_getClientContainer ??= _dylib.lookupFunction< - _c_clang_index_getClientContainer, - _dart_clang_index_getClientContainer>( - 'clang_index_getClientContainer'))( - arg0, + return (_clang_Type_getNamedType ??= _dylib.lookupFunction< + _c_clang_Type_getNamedType, + _dart_clang_Type_getNamedType>('clang_Type_getNamedType'))( + T, ); } - _dart_clang_index_getClientContainer? _clang_index_getClientContainer; + _dart_clang_Type_getNamedType? _clang_Type_getNamedType; - /// For setting a custom CXIdxClientContainer attached to a container. - void clang_index_setClientContainer( - ffi.Pointer arg0, - ffi.Pointer arg1, + /// Determine if a typedef is 'transparent' tag. + int clang_Type_isTransparentTagTypedef( + CXType T, ) { - return (_clang_index_setClientContainer ??= _dylib.lookupFunction< - _c_clang_index_setClientContainer, - _dart_clang_index_setClientContainer>( - 'clang_index_setClientContainer'))( - arg0, - arg1, + return (_clang_Type_isTransparentTagTypedef ??= _dylib.lookupFunction< + _c_clang_Type_isTransparentTagTypedef, + _dart_clang_Type_isTransparentTagTypedef>( + 'clang_Type_isTransparentTagTypedef'))( + T, ); } - _dart_clang_index_setClientContainer? _clang_index_setClientContainer; + _dart_clang_Type_isTransparentTagTypedef? _clang_Type_isTransparentTagTypedef; - /// For retrieving a custom CXIdxClientEntity attached to an entity. - ffi.Pointer clang_index_getClientEntity( - ffi.Pointer arg0, + /// Retrieve the nullability kind of a pointer type. + int clang_Type_getNullability( + CXType T, ) { - return (_clang_index_getClientEntity ??= _dylib.lookupFunction< - _c_clang_index_getClientEntity, - _dart_clang_index_getClientEntity>('clang_index_getClientEntity'))( - arg0, + return (_clang_Type_getNullability ??= _dylib.lookupFunction< + _c_clang_Type_getNullability, + _dart_clang_Type_getNullability>('clang_Type_getNullability'))( + T, ); } - _dart_clang_index_getClientEntity? _clang_index_getClientEntity; + _dart_clang_Type_getNullability? _clang_Type_getNullability; - /// For setting a custom CXIdxClientEntity attached to an entity. - void clang_index_setClientEntity( - ffi.Pointer arg0, - ffi.Pointer arg1, + /// Return the alignment of a type in bytes as per C++[expr.alignof] standard. + int clang_Type_getAlignOf( + CXType T, ) { - return (_clang_index_setClientEntity ??= _dylib.lookupFunction< - _c_clang_index_setClientEntity, - _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( - arg0, - arg1, + return (_clang_Type_getAlignOf ??= _dylib.lookupFunction< + _c_clang_Type_getAlignOf, + _dart_clang_Type_getAlignOf>('clang_Type_getAlignOf'))( + T, ); } - _dart_clang_index_setClientEntity? _clang_index_setClientEntity; + _dart_clang_Type_getAlignOf? _clang_Type_getAlignOf; - /// An indexing action/session, to be applied to one or multiple translation - /// units. - ffi.Pointer clang_IndexAction_create( - ffi.Pointer CIdx, + /// Return the class type of an member pointer type. + CXType clang_Type_getClassType( + CXType T, ) { - return (_clang_IndexAction_create ??= _dylib.lookupFunction< - _c_clang_IndexAction_create, - _dart_clang_IndexAction_create>('clang_IndexAction_create'))( - CIdx, + return (_clang_Type_getClassType ??= _dylib.lookupFunction< + _c_clang_Type_getClassType, + _dart_clang_Type_getClassType>('clang_Type_getClassType'))( + T, ); } - _dart_clang_IndexAction_create? _clang_IndexAction_create; + _dart_clang_Type_getClassType? _clang_Type_getClassType; - /// Destroy the given index action. - void clang_IndexAction_dispose( - ffi.Pointer arg0, + /// Return the size of a type in bytes as per C++[expr.sizeof] standard. + int clang_Type_getSizeOf( + CXType T, ) { - return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< - _c_clang_IndexAction_dispose, - _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( - arg0, + return (_clang_Type_getSizeOf ??= _dylib.lookupFunction< + _c_clang_Type_getSizeOf, + _dart_clang_Type_getSizeOf>('clang_Type_getSizeOf'))( + T, ); } - _dart_clang_IndexAction_dispose? _clang_IndexAction_dispose; + _dart_clang_Type_getSizeOf? _clang_Type_getSizeOf; - /// Index the given source file and the translation unit corresponding to that - /// file via callbacks implemented through #IndexerCallbacks. - int clang_indexSourceFile( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, + /// Return the offset of a field named S in a record of type T in bits as it + /// would be returned by __offsetof__ as per C++11[18.2p4] + int clang_Type_getOffsetOf( + CXType T, + ffi.Pointer S, ) { - return (_clang_indexSourceFile ??= _dylib.lookupFunction< - _c_clang_indexSourceFile, - _dart_clang_indexSourceFile>('clang_indexSourceFile'))( - arg0, - client_data, - index_callbacks, - index_callbacks_size, - index_options, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - out_TU, - TU_options, + return (_clang_Type_getOffsetOf ??= _dylib.lookupFunction< + _c_clang_Type_getOffsetOf, + _dart_clang_Type_getOffsetOf>('clang_Type_getOffsetOf'))( + T, + S, ); } - _dart_clang_indexSourceFile? _clang_indexSourceFile; + _dart_clang_Type_getOffsetOf? _clang_Type_getOffsetOf; - /// Same as clang_indexSourceFile but requires a full command line for - /// command_line_args including argv[0]. This is useful if the standard - /// library paths are relative to the binary. - int clang_indexSourceFileFullArgv( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, + /// Return the type that was modified by this attributed type. + CXType clang_Type_getModifiedType( + CXType T, ) { - return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< - _c_clang_indexSourceFileFullArgv, - _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( - arg0, - client_data, - index_callbacks, - index_callbacks_size, - index_options, - source_filename, - command_line_args, - num_command_line_args, - unsaved_files, - num_unsaved_files, - out_TU, - TU_options, + return (_clang_Type_getModifiedType ??= _dylib.lookupFunction< + _c_clang_Type_getModifiedType, + _dart_clang_Type_getModifiedType>('clang_Type_getModifiedType'))( + T, ); } - _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; + _dart_clang_Type_getModifiedType? _clang_Type_getModifiedType; - /// Index the given translation unit via callbacks implemented through - /// #IndexerCallbacks. - int clang_indexTranslationUnit( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer arg5, + /// Return the offset of the field represented by the Cursor. + int clang_Cursor_getOffsetOfField( + CXCursor C, ) { - return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< - _c_clang_indexTranslationUnit, - _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( - arg0, - client_data, - index_callbacks, - index_callbacks_size, - index_options, - arg5, + return (_clang_Cursor_getOffsetOfField ??= _dylib.lookupFunction< + _c_clang_Cursor_getOffsetOfField, + _dart_clang_Cursor_getOffsetOfField>('clang_Cursor_getOffsetOfField'))( + C, ); } - _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; -} + _dart_clang_Cursor_getOffsetOfField? _clang_Cursor_getOffsetOfField; -/// Error codes returned by libclang routines. -abstract class CXErrorCode { - /// No error. - static const int CXError_Success = 0; + /// Determine whether the given cursor represents an anonymous tag or + /// namespace + int clang_Cursor_isAnonymous( + CXCursor C, + ) { + return (_clang_Cursor_isAnonymous ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymous, + _dart_clang_Cursor_isAnonymous>('clang_Cursor_isAnonymous'))( + C, + ); + } - /// A generic error code, no further details are available. - static const int CXError_Failure = 1; + _dart_clang_Cursor_isAnonymous? _clang_Cursor_isAnonymous; - /// libclang crashed while performing the requested operation. - static const int CXError_Crashed = 2; + /// Determine whether the given cursor represents an anonymous record + /// declaration. + int clang_Cursor_isAnonymousRecordDecl( + CXCursor C, + ) { + return (_clang_Cursor_isAnonymousRecordDecl ??= _dylib.lookupFunction< + _c_clang_Cursor_isAnonymousRecordDecl, + _dart_clang_Cursor_isAnonymousRecordDecl>( + 'clang_Cursor_isAnonymousRecordDecl'))( + C, + ); + } - /// The function detected that the arguments violate the function contract. - static const int CXError_InvalidArguments = 3; + _dart_clang_Cursor_isAnonymousRecordDecl? _clang_Cursor_isAnonymousRecordDecl; - /// An AST deserialization error has occurred. - static const int CXError_ASTReadError = 4; -} + /// Determine whether the given cursor represents an inline namespace + /// declaration. + int clang_Cursor_isInlineNamespace( + CXCursor C, + ) { + return (_clang_Cursor_isInlineNamespace ??= _dylib.lookupFunction< + _c_clang_Cursor_isInlineNamespace, + _dart_clang_Cursor_isInlineNamespace>( + 'clang_Cursor_isInlineNamespace'))( + C, + ); + } -/// A character string. -class CXString extends ffi.Struct { - external ffi.Pointer data; - - @ffi.Uint32() - external int private_flags; -} + _dart_clang_Cursor_isInlineNamespace? _clang_Cursor_isInlineNamespace; -class CXStringSet extends ffi.Struct { - external ffi.Pointer Strings; + /// Returns the number of template arguments for given template + /// specialization, or -1 if type T is not a template specialization. + int clang_Type_getNumTemplateArguments( + CXType T, + ) { + return (_clang_Type_getNumTemplateArguments ??= _dylib.lookupFunction< + _c_clang_Type_getNumTemplateArguments, + _dart_clang_Type_getNumTemplateArguments>( + 'clang_Type_getNumTemplateArguments'))( + T, + ); + } - @ffi.Uint32() - external int Count; -} + _dart_clang_Type_getNumTemplateArguments? _clang_Type_getNumTemplateArguments; -class CXVirtualFileOverlayImpl extends ffi.Struct {} + /// Returns the type template argument of a template class specialization at + /// given index. + CXType clang_Type_getTemplateArgumentAsType( + CXType T, + int i, + ) { + return (_clang_Type_getTemplateArgumentAsType ??= _dylib.lookupFunction< + _c_clang_Type_getTemplateArgumentAsType, + _dart_clang_Type_getTemplateArgumentAsType>( + 'clang_Type_getTemplateArgumentAsType'))( + T, + i, + ); + } -class CXModuleMapDescriptorImpl extends ffi.Struct {} + _dart_clang_Type_getTemplateArgumentAsType? + _clang_Type_getTemplateArgumentAsType; -class CXTargetInfoImpl extends ffi.Struct {} + /// Retrieve the ref-qualifier kind of a function or method. + int clang_Type_getCXXRefQualifier( + CXType T, + ) { + return (_clang_Type_getCXXRefQualifier ??= _dylib.lookupFunction< + _c_clang_Type_getCXXRefQualifier, + _dart_clang_Type_getCXXRefQualifier>('clang_Type_getCXXRefQualifier'))( + T, + ); + } -class CXTranslationUnitImpl extends ffi.Struct {} + _dart_clang_Type_getCXXRefQualifier? _clang_Type_getCXXRefQualifier; -/// Provides the contents of a file that has not yet been saved to disk. -class CXUnsavedFile extends ffi.Struct { - /// The file whose contents have not yet been saved. - external ffi.Pointer Filename; + /// Returns non-zero if the cursor specifies a Record member that is a + /// bitfield. + int clang_Cursor_isBitField( + CXCursor C, + ) { + return (_clang_Cursor_isBitField ??= _dylib.lookupFunction< + _c_clang_Cursor_isBitField, + _dart_clang_Cursor_isBitField>('clang_Cursor_isBitField'))( + C, + ); + } - /// A buffer containing the unsaved contents of this file. - external ffi.Pointer Contents; + _dart_clang_Cursor_isBitField? _clang_Cursor_isBitField; - /// The length of the unsaved contents of this buffer. - @ffi.Uint64() - external int Length; -} + /// Returns 1 if the base class specified by the cursor with kind + /// CX_CXXBaseSpecifier is virtual. + int clang_isVirtualBase( + CXCursor arg0, + ) { + return (_clang_isVirtualBase ??= _dylib.lookupFunction< + _c_clang_isVirtualBase, + _dart_clang_isVirtualBase>('clang_isVirtualBase'))( + arg0, + ); + } -/// Describes the availability of a particular entity, which indicates whether -/// the use of this entity will result in a warning or error due to it being -/// deprecated or unavailable. -abstract class CXAvailabilityKind { - /// The entity is available. - static const int CXAvailability_Available = 0; + _dart_clang_isVirtualBase? _clang_isVirtualBase; - /// The entity is available, but has been deprecated (and its use is not - /// recommended). - static const int CXAvailability_Deprecated = 1; + /// Returns the access control level for the referenced object. + int clang_getCXXAccessSpecifier( + CXCursor arg0, + ) { + return (_clang_getCXXAccessSpecifier ??= _dylib.lookupFunction< + _c_clang_getCXXAccessSpecifier, + _dart_clang_getCXXAccessSpecifier>('clang_getCXXAccessSpecifier'))( + arg0, + ); + } - /// The entity is not available; any use of it will be an error. - static const int CXAvailability_NotAvailable = 2; + _dart_clang_getCXXAccessSpecifier? _clang_getCXXAccessSpecifier; - /// The entity is available, but not accessible; any use of it will be an - /// error. - static const int CXAvailability_NotAccessible = 3; -} + /// Returns the storage class for a function or variable declaration. + int clang_Cursor_getStorageClass( + CXCursor arg0, + ) { + return (_clang_Cursor_getStorageClass ??= _dylib.lookupFunction< + _c_clang_Cursor_getStorageClass, + _dart_clang_Cursor_getStorageClass>('clang_Cursor_getStorageClass'))( + arg0, + ); + } -/// Describes a version number of the form major.minor.subminor. -class CXVersion extends ffi.Struct { - /// The major version number, e.g., the '10' in '10.7.3'. A negative value - /// indicates that there is no version number at all. - @ffi.Int32() - external int Major; + _dart_clang_Cursor_getStorageClass? _clang_Cursor_getStorageClass; - /// The minor version number, e.g., the '7' in '10.7.3'. This value will be - /// negative if no minor version number was provided, e.g., for version '10'. - @ffi.Int32() - external int Minor; + /// Determine the number of overloaded declarations referenced by a + /// CXCursor_OverloadedDeclRef cursor. + int clang_getNumOverloadedDecls( + CXCursor cursor, + ) { + return (_clang_getNumOverloadedDecls ??= _dylib.lookupFunction< + _c_clang_getNumOverloadedDecls, + _dart_clang_getNumOverloadedDecls>('clang_getNumOverloadedDecls'))( + cursor, + ); + } - /// The subminor version number, e.g., the '3' in '10.7.3'. This value will be - /// negative if no minor or subminor version number was provided, e.g., in - /// version '10' or '10.7'. - @ffi.Int32() - external int Subminor; -} + _dart_clang_getNumOverloadedDecls? _clang_getNumOverloadedDecls; -/// Describes the exception specification of a cursor. -abstract class CXCursor_ExceptionSpecificationKind { - /// The cursor has no exception specification. - static const int CXCursor_ExceptionSpecificationKind_None = 0; + /// Retrieve a cursor for one of the overloaded declarations referenced by a + /// CXCursor_OverloadedDeclRef cursor. + CXCursor clang_getOverloadedDecl( + CXCursor cursor, + int index, + ) { + return (_clang_getOverloadedDecl ??= _dylib.lookupFunction< + _c_clang_getOverloadedDecl, + _dart_clang_getOverloadedDecl>('clang_getOverloadedDecl'))( + cursor, + index, + ); + } - /// The cursor has exception specification throw() - static const int CXCursor_ExceptionSpecificationKind_DynamicNone = 1; + _dart_clang_getOverloadedDecl? _clang_getOverloadedDecl; - /// The cursor has exception specification throw(T1, T2) - static const int CXCursor_ExceptionSpecificationKind_Dynamic = 2; + /// For cursors representing an iboutletcollection attribute, this function + /// returns the collection element type. + CXType clang_getIBOutletCollectionType( + CXCursor arg0, + ) { + return (_clang_getIBOutletCollectionType ??= _dylib.lookupFunction< + _c_clang_getIBOutletCollectionType, + _dart_clang_getIBOutletCollectionType>( + 'clang_getIBOutletCollectionType'))( + arg0, + ); + } - /// The cursor has exception specification throw(...). - static const int CXCursor_ExceptionSpecificationKind_MSAny = 3; + _dart_clang_getIBOutletCollectionType? _clang_getIBOutletCollectionType; - /// The cursor has exception specification basic noexcept. - static const int CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4; + /// Visit the children of a particular cursor. + int clang_visitChildren( + CXCursor parent, + ffi.Pointer> visitor, + ffi.Pointer client_data, + ) { + return (_clang_visitChildren ??= _dylib.lookupFunction< + _c_clang_visitChildren, + _dart_clang_visitChildren>('clang_visitChildren'))( + parent, + visitor, + client_data, + ); + } - /// The cursor has exception specification computed noexcept. - static const int CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5; + _dart_clang_visitChildren? _clang_visitChildren; - /// The exception specification has not yet been evaluated. - static const int CXCursor_ExceptionSpecificationKind_Unevaluated = 6; + /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced by + /// the given cursor. + CXString clang_getCursorUSR( + CXCursor arg0, + ) { + return (_clang_getCursorUSR ??= + _dylib.lookupFunction<_c_clang_getCursorUSR, _dart_clang_getCursorUSR>( + 'clang_getCursorUSR'))( + arg0, + ); + } - /// The exception specification has not yet been instantiated. - static const int CXCursor_ExceptionSpecificationKind_Uninstantiated = 7; + _dart_clang_getCursorUSR? _clang_getCursorUSR; - /// The exception specification has not been parsed yet. - static const int CXCursor_ExceptionSpecificationKind_Unparsed = 8; + /// Construct a USR for a specified Objective-C class. + CXString clang_constructUSR_ObjCClass( + ffi.Pointer class_name, + ) { + return (_clang_constructUSR_ObjCClass ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCClass, + _dart_clang_constructUSR_ObjCClass>('clang_constructUSR_ObjCClass'))( + class_name, + ); + } - /// The cursor has a __declspec(nothrow) exception specification. - static const int CXCursor_ExceptionSpecificationKind_NoThrow = 9; -} + _dart_clang_constructUSR_ObjCClass? _clang_constructUSR_ObjCClass; -abstract class CXGlobalOptFlags { - /// Used to indicate that no special CXIndex options are needed. - static const int CXGlobalOpt_None = 0; + /// Construct a USR for a specified Objective-C category. + CXString clang_constructUSR_ObjCCategory( + ffi.Pointer class_name, + ffi.Pointer category_name, + ) { + return (_clang_constructUSR_ObjCCategory ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCCategory, + _dart_clang_constructUSR_ObjCCategory>( + 'clang_constructUSR_ObjCCategory'))( + class_name, + category_name, + ); + } - /// Used to indicate that threads that libclang creates for indexing purposes - /// should use background priority. - static const int CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1; + _dart_clang_constructUSR_ObjCCategory? _clang_constructUSR_ObjCCategory; - /// Used to indicate that threads that libclang creates for editing purposes - /// should use background priority. - static const int CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2; + /// Construct a USR for a specified Objective-C protocol. + CXString clang_constructUSR_ObjCProtocol( + ffi.Pointer protocol_name, + ) { + return (_clang_constructUSR_ObjCProtocol ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCProtocol, + _dart_clang_constructUSR_ObjCProtocol>( + 'clang_constructUSR_ObjCProtocol'))( + protocol_name, + ); + } - /// Used to indicate that all threads that libclang creates should use - /// background priority. - static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; -} + _dart_clang_constructUSR_ObjCProtocol? _clang_constructUSR_ObjCProtocol; -/// Uniquely identifies a CXFile, that refers to the same underlying file, -/// across an indexing session. -class CXFileUniqueID extends ffi.Struct { - @ffi.Uint64() - external int _unique_data_item_0; - @ffi.Uint64() - external int _unique_data_item_1; - @ffi.Uint64() - external int _unique_data_item_2; + /// Construct a USR for a specified Objective-C instance variable and the USR + /// for its containing class. + CXString clang_constructUSR_ObjCIvar( + ffi.Pointer name, + CXString classUSR, + ) { + return (_clang_constructUSR_ObjCIvar ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCIvar, + _dart_clang_constructUSR_ObjCIvar>('clang_constructUSR_ObjCIvar'))( + name, + classUSR, + ); + } - /// Helper for array `data`. - ArrayHelper_CXFileUniqueID_data_level0 get data => - ArrayHelper_CXFileUniqueID_data_level0(this, [3], 0, 0); -} + _dart_clang_constructUSR_ObjCIvar? _clang_constructUSR_ObjCIvar; -/// Helper for array `data` in struct `CXFileUniqueID`. -class ArrayHelper_CXFileUniqueID_data_level0 { - final CXFileUniqueID _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXFileUniqueID_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } + /// Construct a USR for a specified Objective-C method and the USR for its + /// containing class. + CXString clang_constructUSR_ObjCMethod( + ffi.Pointer name, + int isInstanceMethod, + CXString classUSR, + ) { + return (_clang_constructUSR_ObjCMethod ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCMethod, + _dart_clang_constructUSR_ObjCMethod>('clang_constructUSR_ObjCMethod'))( + name, + isInstanceMethod, + classUSR, + ); } - int operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_data_item_0; - case 1: - return _struct._unique_data_item_1; - case 2: - return _struct._unique_data_item_2; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + _dart_clang_constructUSR_ObjCMethod? _clang_constructUSR_ObjCMethod; - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_data_item_0 = value; - break; - case 1: - _struct._unique_data_item_1 = value; - break; - case 2: - _struct._unique_data_item_2 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + /// Construct a USR for a specified Objective-C property and the USR for its + /// containing class. + CXString clang_constructUSR_ObjCProperty( + ffi.Pointer property, + CXString classUSR, + ) { + return (_clang_constructUSR_ObjCProperty ??= _dylib.lookupFunction< + _c_clang_constructUSR_ObjCProperty, + _dart_clang_constructUSR_ObjCProperty>( + 'clang_constructUSR_ObjCProperty'))( + property, + classUSR, + ); } -} - -/// Identifies a specific source location within a translation unit. -class CXSourceLocation extends ffi.Struct { - external ffi.Pointer _unique_ptr_data_item_0; - external ffi.Pointer _unique_ptr_data_item_1; - /// Helper for array `ptr_data`. - ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => - ArrayHelper_CXSourceLocation_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - external int int_data; -} + _dart_clang_constructUSR_ObjCProperty? _clang_constructUSR_ObjCProperty; -/// Helper for array `ptr_data` in struct `CXSourceLocation`. -class ArrayHelper_CXSourceLocation_ptr_data_level0 { - final CXSourceLocation _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXSourceLocation_ptr_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } + /// Retrieve a name for the entity referenced by this cursor. + CXString clang_getCursorSpelling( + CXCursor arg0, + ) { + return (_clang_getCursorSpelling ??= _dylib.lookupFunction< + _c_clang_getCursorSpelling, + _dart_clang_getCursorSpelling>('clang_getCursorSpelling'))( + arg0, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_ptr_data_item_0; - case 1: - return _struct._unique_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + _dart_clang_getCursorSpelling? _clang_getCursorSpelling; - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_ptr_data_item_0 = value; - break; - case 1: - _struct._unique_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + /// Retrieve a range for a piece that forms the cursors spelling name. Most of + /// the times there is only one range for the complete spelling but for + /// Objective-C methods and Objective-C message expressions, there are + /// multiple pieces for each selector identifier. + CXSourceRange clang_Cursor_getSpellingNameRange( + CXCursor arg0, + int pieceIndex, + int options, + ) { + return (_clang_Cursor_getSpellingNameRange ??= _dylib.lookupFunction< + _c_clang_Cursor_getSpellingNameRange, + _dart_clang_Cursor_getSpellingNameRange>( + 'clang_Cursor_getSpellingNameRange'))( + arg0, + pieceIndex, + options, + ); } -} -/// Identifies a half-open character range in the source code. -class CXSourceRange extends ffi.Struct { - external ffi.Pointer _unique_ptr_data_item_0; - external ffi.Pointer _unique_ptr_data_item_1; + _dart_clang_Cursor_getSpellingNameRange? _clang_Cursor_getSpellingNameRange; - /// Helper for array `ptr_data`. - ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => - ArrayHelper_CXSourceRange_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - external int begin_int_data; + /// Get a property value for the given printing policy. + int clang_PrintingPolicy_getProperty( + ffi.Pointer Policy, + int Property, + ) { + return (_clang_PrintingPolicy_getProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_getProperty, + _dart_clang_PrintingPolicy_getProperty>( + 'clang_PrintingPolicy_getProperty'))( + Policy, + Property, + ); + } - @ffi.Uint32() - external int end_int_data; -} + _dart_clang_PrintingPolicy_getProperty? _clang_PrintingPolicy_getProperty; -/// Helper for array `ptr_data` in struct `CXSourceRange`. -class ArrayHelper_CXSourceRange_ptr_data_level0 { - final CXSourceRange _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXSourceRange_ptr_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } + /// Set a property value for the given printing policy. + void clang_PrintingPolicy_setProperty( + ffi.Pointer Policy, + int Property, + int Value, + ) { + return (_clang_PrintingPolicy_setProperty ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_setProperty, + _dart_clang_PrintingPolicy_setProperty>( + 'clang_PrintingPolicy_setProperty'))( + Policy, + Property, + Value, + ); } - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_ptr_data_item_0; - case 1: - return _struct._unique_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } + _dart_clang_PrintingPolicy_setProperty? _clang_PrintingPolicy_setProperty; - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_ptr_data_item_0 = value; - break; - case 1: - _struct._unique_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } + /// Retrieve the default policy for the cursor. + ffi.Pointer clang_getCursorPrintingPolicy( + CXCursor arg0, + ) { + return (_clang_getCursorPrintingPolicy ??= _dylib.lookupFunction< + _c_clang_getCursorPrintingPolicy, + _dart_clang_getCursorPrintingPolicy>('clang_getCursorPrintingPolicy'))( + arg0, + ); } -} -/// Identifies an array of ranges. -class CXSourceRangeList extends ffi.Struct { - /// The number of ranges in the ranges array. - @ffi.Uint32() - external int count; + _dart_clang_getCursorPrintingPolicy? _clang_getCursorPrintingPolicy; - /// An array of CXSourceRanges. - external ffi.Pointer ranges; -} + /// Release a printing policy. + void clang_PrintingPolicy_dispose( + ffi.Pointer Policy, + ) { + return (_clang_PrintingPolicy_dispose ??= _dylib.lookupFunction< + _c_clang_PrintingPolicy_dispose, + _dart_clang_PrintingPolicy_dispose>('clang_PrintingPolicy_dispose'))( + Policy, + ); + } -/// Describes the severity of a particular diagnostic. -abstract class CXDiagnosticSeverity { - /// A diagnostic that has been suppressed, e.g., by a command-line option. - static const int CXDiagnostic_Ignored = 0; + _dart_clang_PrintingPolicy_dispose? _clang_PrintingPolicy_dispose; - /// This diagnostic is a note that should be attached to the previous - /// (non-note) diagnostic. - static const int CXDiagnostic_Note = 1; + /// Pretty print declarations. + CXString clang_getCursorPrettyPrinted( + CXCursor Cursor, + ffi.Pointer Policy, + ) { + return (_clang_getCursorPrettyPrinted ??= _dylib.lookupFunction< + _c_clang_getCursorPrettyPrinted, + _dart_clang_getCursorPrettyPrinted>('clang_getCursorPrettyPrinted'))( + Cursor, + Policy, + ); + } - /// This diagnostic indicates suspicious code that may not be wrong. - static const int CXDiagnostic_Warning = 2; + _dart_clang_getCursorPrettyPrinted? _clang_getCursorPrettyPrinted; - /// This diagnostic indicates that the code is ill-formed. - static const int CXDiagnostic_Error = 3; + /// Retrieve the display name for the entity referenced by this cursor. + CXString clang_getCursorDisplayName( + CXCursor arg0, + ) { + return (_clang_getCursorDisplayName ??= _dylib.lookupFunction< + _c_clang_getCursorDisplayName, + _dart_clang_getCursorDisplayName>('clang_getCursorDisplayName'))( + arg0, + ); + } - /// This diagnostic indicates that the code is ill-formed such that future - /// parser recovery is unlikely to produce useful results. - static const int CXDiagnostic_Fatal = 4; -} + _dart_clang_getCursorDisplayName? _clang_getCursorDisplayName; -/// Describes the kind of error that occurred (if any) in a call to -/// clang_loadDiagnostics. -abstract class CXLoadDiag_Error { - /// Indicates that no error occurred. - static const int CXLoadDiag_None = 0; + /// For a cursor that is a reference, retrieve a cursor representing the + /// entity that it references. + CXCursor clang_getCursorReferenced( + CXCursor arg0, + ) { + return (_clang_getCursorReferenced ??= _dylib.lookupFunction< + _c_clang_getCursorReferenced, + _dart_clang_getCursorReferenced>('clang_getCursorReferenced'))( + arg0, + ); + } - /// Indicates that an unknown error occurred while attempting to deserialize - /// diagnostics. - static const int CXLoadDiag_Unknown = 1; + _dart_clang_getCursorReferenced? _clang_getCursorReferenced; - /// Indicates that the file containing the serialized diagnostics could not be - /// opened. - static const int CXLoadDiag_CannotLoad = 2; + /// For a cursor that is either a reference to or a declaration of some + /// entity, retrieve a cursor that describes the definition of that entity. + CXCursor clang_getCursorDefinition( + CXCursor arg0, + ) { + return (_clang_getCursorDefinition ??= _dylib.lookupFunction< + _c_clang_getCursorDefinition, + _dart_clang_getCursorDefinition>('clang_getCursorDefinition'))( + arg0, + ); + } - /// Indicates that the serialized diagnostics file is invalid or corrupt. - static const int CXLoadDiag_InvalidFile = 3; -} + _dart_clang_getCursorDefinition? _clang_getCursorDefinition; -/// Options to control the display of diagnostics. -abstract class CXDiagnosticDisplayOptions { - /// Display the source-location information where the diagnostic was located. - static const int CXDiagnostic_DisplaySourceLocation = 1; + /// Determine whether the declaration pointed to by this cursor is also a + /// definition of that entity. + int clang_isCursorDefinition( + CXCursor arg0, + ) { + return (_clang_isCursorDefinition ??= _dylib.lookupFunction< + _c_clang_isCursorDefinition, + _dart_clang_isCursorDefinition>('clang_isCursorDefinition'))( + arg0, + ); + } - /// If displaying the source-location information of the diagnostic, also - /// include the column number. - static const int CXDiagnostic_DisplayColumn = 2; + _dart_clang_isCursorDefinition? _clang_isCursorDefinition; - /// If displaying the source-location information of the diagnostic, also - /// include information about source ranges in a machine-parsable format. - static const int CXDiagnostic_DisplaySourceRanges = 4; + /// Retrieve the canonical cursor corresponding to the given cursor. + CXCursor clang_getCanonicalCursor( + CXCursor arg0, + ) { + return (_clang_getCanonicalCursor ??= _dylib.lookupFunction< + _c_clang_getCanonicalCursor, + _dart_clang_getCanonicalCursor>('clang_getCanonicalCursor'))( + arg0, + ); + } - /// Display the option name associated with this diagnostic, if any. - static const int CXDiagnostic_DisplayOption = 8; + _dart_clang_getCanonicalCursor? _clang_getCanonicalCursor; - /// Display the category number associated with this diagnostic, if any. - static const int CXDiagnostic_DisplayCategoryId = 16; + /// If the cursor points to a selector identifier in an Objective-C method or + /// message expression, this returns the selector index. + int clang_Cursor_getObjCSelectorIndex( + CXCursor arg0, + ) { + return (_clang_Cursor_getObjCSelectorIndex ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCSelectorIndex, + _dart_clang_Cursor_getObjCSelectorIndex>( + 'clang_Cursor_getObjCSelectorIndex'))( + arg0, + ); + } - /// Display the category name associated with this diagnostic, if any. - static const int CXDiagnostic_DisplayCategoryName = 32; -} + _dart_clang_Cursor_getObjCSelectorIndex? _clang_Cursor_getObjCSelectorIndex; -/// Flags that control the creation of translation units. -abstract class CXTranslationUnit_Flags { - /// Used to indicate that no special translation-unit options are needed. - static const int CXTranslationUnit_None = 0; + /// Given a cursor pointing to a C++ method call or an Objective-C message, + /// returns non-zero if the method/message is "dynamic", meaning: + int clang_Cursor_isDynamicCall( + CXCursor C, + ) { + return (_clang_Cursor_isDynamicCall ??= _dylib.lookupFunction< + _c_clang_Cursor_isDynamicCall, + _dart_clang_Cursor_isDynamicCall>('clang_Cursor_isDynamicCall'))( + C, + ); + } - /// Used to indicate that the parser should construct a "detailed" - /// preprocessing record, including all macro definitions and instantiations. - static const int CXTranslationUnit_DetailedPreprocessingRecord = 1; + _dart_clang_Cursor_isDynamicCall? _clang_Cursor_isDynamicCall; - /// Used to indicate that the translation unit is incomplete. - static const int CXTranslationUnit_Incomplete = 2; + /// Given a cursor pointing to an Objective-C message or property reference, + /// or C++ method call, returns the CXType of the receiver. + CXType clang_Cursor_getReceiverType( + CXCursor C, + ) { + return (_clang_Cursor_getReceiverType ??= _dylib.lookupFunction< + _c_clang_Cursor_getReceiverType, + _dart_clang_Cursor_getReceiverType>('clang_Cursor_getReceiverType'))( + C, + ); + } - /// Used to indicate that the translation unit should be built with an - /// implicit precompiled header for the preamble. - static const int CXTranslationUnit_PrecompiledPreamble = 4; + _dart_clang_Cursor_getReceiverType? _clang_Cursor_getReceiverType; - /// Used to indicate that the translation unit should cache some - /// code-completion results with each reparse of the source file. - static const int CXTranslationUnit_CacheCompletionResults = 8; + /// Given a cursor that represents a property declaration, return the + /// associated property attributes. The bits are formed from + /// CXObjCPropertyAttrKind. + int clang_Cursor_getObjCPropertyAttributes( + CXCursor C, + int reserved, + ) { + return (_clang_Cursor_getObjCPropertyAttributes ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCPropertyAttributes, + _dart_clang_Cursor_getObjCPropertyAttributes>( + 'clang_Cursor_getObjCPropertyAttributes'))( + C, + reserved, + ); + } - /// Used to indicate that the translation unit will be serialized with - /// clang_saveTranslationUnit. - static const int CXTranslationUnit_ForSerialization = 16; + _dart_clang_Cursor_getObjCPropertyAttributes? + _clang_Cursor_getObjCPropertyAttributes; - /// DEPRECATED: Enabled chained precompiled preambles in C++. - static const int CXTranslationUnit_CXXChainedPCH = 32; + /// Given a cursor that represents a property declaration, return the name of + /// the method that implements the getter. + CXString clang_Cursor_getObjCPropertyGetterName( + CXCursor C, + ) { + return (_clang_Cursor_getObjCPropertyGetterName ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCPropertyGetterName, + _dart_clang_Cursor_getObjCPropertyGetterName>( + 'clang_Cursor_getObjCPropertyGetterName'))( + C, + ); + } - /// Used to indicate that function/method bodies should be skipped while - /// parsing. - static const int CXTranslationUnit_SkipFunctionBodies = 64; + _dart_clang_Cursor_getObjCPropertyGetterName? + _clang_Cursor_getObjCPropertyGetterName; - /// Used to indicate that brief documentation comments should be included into - /// the set of code completions returned from this translation unit. - static const int CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128; + /// Given a cursor that represents a property declaration, return the name of + /// the method that implements the setter, if any. + CXString clang_Cursor_getObjCPropertySetterName( + CXCursor C, + ) { + return (_clang_Cursor_getObjCPropertySetterName ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCPropertySetterName, + _dart_clang_Cursor_getObjCPropertySetterName>( + 'clang_Cursor_getObjCPropertySetterName'))( + C, + ); + } - /// Used to indicate that the precompiled preamble should be created on the - /// first parse. Otherwise it will be created on the first reparse. This - /// trades runtime on the first parse (serializing the preamble takes time) - /// for reduced runtime on the second parse (can now reuse the preamble). - static const int CXTranslationUnit_CreatePreambleOnFirstParse = 256; + _dart_clang_Cursor_getObjCPropertySetterName? + _clang_Cursor_getObjCPropertySetterName; - /// Do not stop processing when fatal errors are encountered. - static const int CXTranslationUnit_KeepGoing = 512; + /// Given a cursor that represents an Objective-C method or parameter + /// declaration, return the associated Objective-C qualifiers for the return + /// type or the parameter respectively. The bits are formed from + /// CXObjCDeclQualifierKind. + int clang_Cursor_getObjCDeclQualifiers( + CXCursor C, + ) { + return (_clang_Cursor_getObjCDeclQualifiers ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCDeclQualifiers, + _dart_clang_Cursor_getObjCDeclQualifiers>( + 'clang_Cursor_getObjCDeclQualifiers'))( + C, + ); + } - /// Sets the preprocessor in a mode for parsing a single file only. - static const int CXTranslationUnit_SingleFileParse = 1024; + _dart_clang_Cursor_getObjCDeclQualifiers? _clang_Cursor_getObjCDeclQualifiers; - /// Used in combination with CXTranslationUnit_SkipFunctionBodies to constrain - /// the skipping of function bodies to the preamble. - static const int CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048; + /// Given a cursor that represents an Objective-C method or property + /// declaration, return non-zero if the declaration was affected by + /// "@optional". Returns zero if the cursor is not such a declaration or it is + /// "@required". + int clang_Cursor_isObjCOptional( + CXCursor C, + ) { + return (_clang_Cursor_isObjCOptional ??= _dylib.lookupFunction< + _c_clang_Cursor_isObjCOptional, + _dart_clang_Cursor_isObjCOptional>('clang_Cursor_isObjCOptional'))( + C, + ); + } - /// Used to indicate that attributed types should be included in CXType. - static const int CXTranslationUnit_IncludeAttributedTypes = 4096; + _dart_clang_Cursor_isObjCOptional? _clang_Cursor_isObjCOptional; - /// Used to indicate that implicit attributes should be visited. - static const int CXTranslationUnit_VisitImplicitAttributes = 8192; + /// Returns non-zero if the given cursor is a variadic function or method. + int clang_Cursor_isVariadic( + CXCursor C, + ) { + return (_clang_Cursor_isVariadic ??= _dylib.lookupFunction< + _c_clang_Cursor_isVariadic, + _dart_clang_Cursor_isVariadic>('clang_Cursor_isVariadic'))( + C, + ); + } - /// Used to indicate that non-errors from included files should be ignored. - static const int CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384; + _dart_clang_Cursor_isVariadic? _clang_Cursor_isVariadic; - /// Tells the preprocessor not to skip excluded conditional blocks. - static const int CXTranslationUnit_RetainExcludedConditionalBlocks = 32768; -} + /// Returns non-zero if the given cursor points to a symbol marked with + /// external_source_symbol attribute. + int clang_Cursor_isExternalSymbol( + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated, + ) { + return (_clang_Cursor_isExternalSymbol ??= _dylib.lookupFunction< + _c_clang_Cursor_isExternalSymbol, + _dart_clang_Cursor_isExternalSymbol>('clang_Cursor_isExternalSymbol'))( + C, + language, + definedIn, + isGenerated, + ); + } -/// Flags that control how translation units are saved. -abstract class CXSaveTranslationUnit_Flags { - /// Used to indicate that no special saving options are needed. - static const int CXSaveTranslationUnit_None = 0; -} + _dart_clang_Cursor_isExternalSymbol? _clang_Cursor_isExternalSymbol; -/// Describes the kind of error that occurred (if any) in a call to -/// clang_saveTranslationUnit(). -abstract class CXSaveError { - /// Indicates that no error occurred while saving a translation unit. - static const int CXSaveError_None = 0; + /// Given a cursor that represents a declaration, return the associated + /// comment's source range. The range may include multiple consecutive + /// comments with whitespace in between. + CXSourceRange clang_Cursor_getCommentRange( + CXCursor C, + ) { + return (_clang_Cursor_getCommentRange ??= _dylib.lookupFunction< + _c_clang_Cursor_getCommentRange, + _dart_clang_Cursor_getCommentRange>('clang_Cursor_getCommentRange'))( + C, + ); + } - /// Indicates that an unknown error occurred while attempting to save the - /// file. - static const int CXSaveError_Unknown = 1; + _dart_clang_Cursor_getCommentRange? _clang_Cursor_getCommentRange; - /// Indicates that errors during translation prevented this attempt to save - /// the translation unit. - static const int CXSaveError_TranslationErrors = 2; + /// Given a cursor that represents a declaration, return the associated + /// comment text, including comment markers. + CXString clang_Cursor_getRawCommentText( + CXCursor C, + ) { + return (_clang_Cursor_getRawCommentText ??= _dylib.lookupFunction< + _c_clang_Cursor_getRawCommentText, + _dart_clang_Cursor_getRawCommentText>( + 'clang_Cursor_getRawCommentText'))( + C, + ); + } - /// Indicates that the translation unit to be saved was somehow invalid (e.g., - /// NULL). - static const int CXSaveError_InvalidTU = 3; -} + _dart_clang_Cursor_getRawCommentText? _clang_Cursor_getRawCommentText; -/// Flags that control the reparsing of translation units. -abstract class CXReparse_Flags { - /// Used to indicate that no special reparsing options are needed. - static const int CXReparse_None = 0; -} + /// Given a cursor that represents a documentable entity (e.g., declaration), + /// return the associated first paragraph. + CXString clang_Cursor_getBriefCommentText( + CXCursor C, + ) { + return (_clang_Cursor_getBriefCommentText ??= _dylib.lookupFunction< + _c_clang_Cursor_getBriefCommentText, + _dart_clang_Cursor_getBriefCommentText>( + 'clang_Cursor_getBriefCommentText'))( + C, + ); + } -/// Categorizes how memory is being used by a translation unit. -abstract class CXTUResourceUsageKind { - static const int CXTUResourceUsage_AST = 1; - static const int CXTUResourceUsage_Identifiers = 2; - static const int CXTUResourceUsage_Selectors = 3; - static const int CXTUResourceUsage_GlobalCompletionResults = 4; - static const int CXTUResourceUsage_SourceManagerContentCache = 5; - static const int CXTUResourceUsage_AST_SideTables = 6; - static const int CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7; - static const int CXTUResourceUsage_SourceManager_Membuffer_MMap = 8; - static const int CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9; - static const int CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10; - static const int CXTUResourceUsage_Preprocessor = 11; - static const int CXTUResourceUsage_PreprocessingRecord = 12; - static const int CXTUResourceUsage_SourceManager_DataStructures = 13; - static const int CXTUResourceUsage_Preprocessor_HeaderSearch = 14; - static const int CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = 1; - static const int CXTUResourceUsage_MEMORY_IN_BYTES_END = 14; - static const int CXTUResourceUsage_First = 1; - static const int CXTUResourceUsage_Last = 14; -} + _dart_clang_Cursor_getBriefCommentText? _clang_Cursor_getBriefCommentText; -class CXTUResourceUsageEntry extends ffi.Struct { - @ffi.Int32() - external int kind; + /// Retrieve the CXString representing the mangled name of the cursor. + CXString clang_Cursor_getMangling( + CXCursor arg0, + ) { + return (_clang_Cursor_getMangling ??= _dylib.lookupFunction< + _c_clang_Cursor_getMangling, + _dart_clang_Cursor_getMangling>('clang_Cursor_getMangling'))( + arg0, + ); + } - @ffi.Uint64() - external int amount; -} + _dart_clang_Cursor_getMangling? _clang_Cursor_getMangling; -/// The memory usage of a CXTranslationUnit, broken into categories. -class CXTUResourceUsage extends ffi.Struct { - external ffi.Pointer data; + /// Retrieve the CXStrings representing the mangled symbols of the C++ + /// constructor or destructor at the cursor. + ffi.Pointer clang_Cursor_getCXXManglings( + CXCursor arg0, + ) { + return (_clang_Cursor_getCXXManglings ??= _dylib.lookupFunction< + _c_clang_Cursor_getCXXManglings, + _dart_clang_Cursor_getCXXManglings>('clang_Cursor_getCXXManglings'))( + arg0, + ); + } - @ffi.Uint32() - external int numEntries; + _dart_clang_Cursor_getCXXManglings? _clang_Cursor_getCXXManglings; - external ffi.Pointer entries; -} + /// Retrieve the CXStrings representing the mangled symbols of the ObjC class + /// interface or implementation at the cursor. + ffi.Pointer clang_Cursor_getObjCManglings( + CXCursor arg0, + ) { + return (_clang_Cursor_getObjCManglings ??= _dylib.lookupFunction< + _c_clang_Cursor_getObjCManglings, + _dart_clang_Cursor_getObjCManglings>('clang_Cursor_getObjCManglings'))( + arg0, + ); + } -/// Describes the kind of entity that a cursor refers to. -abstract class CXCursorKind { - /// A declaration whose specific kind is not exposed via this interface. - static const int CXCursor_UnexposedDecl = 1; + _dart_clang_Cursor_getObjCManglings? _clang_Cursor_getObjCManglings; - /// A C or C++ struct. - static const int CXCursor_StructDecl = 2; + /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. + ffi.Pointer clang_Cursor_getModule( + CXCursor C, + ) { + return (_clang_Cursor_getModule ??= _dylib.lookupFunction< + _c_clang_Cursor_getModule, + _dart_clang_Cursor_getModule>('clang_Cursor_getModule'))( + C, + ); + } - /// A C or C++ union. - static const int CXCursor_UnionDecl = 3; + _dart_clang_Cursor_getModule? _clang_Cursor_getModule; - /// A C++ class. - static const int CXCursor_ClassDecl = 4; + /// Given a CXFile header file, return the module that contains it, if one + /// exists. + ffi.Pointer clang_getModuleForFile( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return (_clang_getModuleForFile ??= _dylib.lookupFunction< + _c_clang_getModuleForFile, + _dart_clang_getModuleForFile>('clang_getModuleForFile'))( + arg0, + arg1, + ); + } - /// An enumeration. - static const int CXCursor_EnumDecl = 5; + _dart_clang_getModuleForFile? _clang_getModuleForFile; - /// A field (in C) or non-static data member (in C++) in a struct, union, or - /// C++ class. - static const int CXCursor_FieldDecl = 6; + /// Returns the module file where the provided module object came from. + ffi.Pointer clang_Module_getASTFile( + ffi.Pointer Module, + ) { + return (_clang_Module_getASTFile ??= _dylib.lookupFunction< + _c_clang_Module_getASTFile, + _dart_clang_Module_getASTFile>('clang_Module_getASTFile'))( + Module, + ); + } - /// An enumerator constant. - static const int CXCursor_EnumConstantDecl = 7; + _dart_clang_Module_getASTFile? _clang_Module_getASTFile; - /// A function. - static const int CXCursor_FunctionDecl = 8; + /// Returns the parent of a sub-module or NULL if the given module is + /// top-level, e.g. for 'std.vector' it will return the 'std' module. + ffi.Pointer clang_Module_getParent( + ffi.Pointer Module, + ) { + return (_clang_Module_getParent ??= _dylib.lookupFunction< + _c_clang_Module_getParent, + _dart_clang_Module_getParent>('clang_Module_getParent'))( + Module, + ); + } - /// A variable. - static const int CXCursor_VarDecl = 9; + _dart_clang_Module_getParent? _clang_Module_getParent; - /// A function or method parameter. - static const int CXCursor_ParmDecl = 10; + /// Returns the name of the module, e.g. for the 'std.vector' sub-module it + /// will return "vector". + CXString clang_Module_getName( + ffi.Pointer Module, + ) { + return (_clang_Module_getName ??= _dylib.lookupFunction< + _c_clang_Module_getName, + _dart_clang_Module_getName>('clang_Module_getName'))( + Module, + ); + } - /// An Objective-C @interface. - static const int CXCursor_ObjCInterfaceDecl = 11; + _dart_clang_Module_getName? _clang_Module_getName; - /// An Objective-C @interface for a category. - static const int CXCursor_ObjCCategoryDecl = 12; + /// Returns the full name of the module, e.g. "std.vector". + CXString clang_Module_getFullName( + ffi.Pointer Module, + ) { + return (_clang_Module_getFullName ??= _dylib.lookupFunction< + _c_clang_Module_getFullName, + _dart_clang_Module_getFullName>('clang_Module_getFullName'))( + Module, + ); + } - /// An Objective-C @protocol declaration. - static const int CXCursor_ObjCProtocolDecl = 13; + _dart_clang_Module_getFullName? _clang_Module_getFullName; - /// An Objective-C @property declaration. - static const int CXCursor_ObjCPropertyDecl = 14; + /// Returns non-zero if the module is a system one. + int clang_Module_isSystem( + ffi.Pointer Module, + ) { + return (_clang_Module_isSystem ??= _dylib.lookupFunction< + _c_clang_Module_isSystem, + _dart_clang_Module_isSystem>('clang_Module_isSystem'))( + Module, + ); + } - /// An Objective-C instance variable. - static const int CXCursor_ObjCIvarDecl = 15; + _dart_clang_Module_isSystem? _clang_Module_isSystem; - /// An Objective-C instance method. - static const int CXCursor_ObjCInstanceMethodDecl = 16; + /// Returns the number of top level headers associated with this module. + int clang_Module_getNumTopLevelHeaders( + ffi.Pointer arg0, + ffi.Pointer Module, + ) { + return (_clang_Module_getNumTopLevelHeaders ??= _dylib.lookupFunction< + _c_clang_Module_getNumTopLevelHeaders, + _dart_clang_Module_getNumTopLevelHeaders>( + 'clang_Module_getNumTopLevelHeaders'))( + arg0, + Module, + ); + } - /// An Objective-C class method. - static const int CXCursor_ObjCClassMethodDecl = 17; + _dart_clang_Module_getNumTopLevelHeaders? _clang_Module_getNumTopLevelHeaders; - /// An Objective-C @implementation. - static const int CXCursor_ObjCImplementationDecl = 18; + /// Returns the specified top level header associated with the module. + ffi.Pointer clang_Module_getTopLevelHeader( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, + ) { + return (_clang_Module_getTopLevelHeader ??= _dylib.lookupFunction< + _c_clang_Module_getTopLevelHeader, + _dart_clang_Module_getTopLevelHeader>( + 'clang_Module_getTopLevelHeader'))( + arg0, + Module, + Index, + ); + } - /// An Objective-C @implementation for a category. - static const int CXCursor_ObjCCategoryImplDecl = 19; + _dart_clang_Module_getTopLevelHeader? _clang_Module_getTopLevelHeader; - /// A typedef. - static const int CXCursor_TypedefDecl = 20; + /// Determine if a C++ constructor is a converting constructor. + int clang_CXXConstructor_isConvertingConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isConvertingConstructor ??= + _dylib.lookupFunction<_c_clang_CXXConstructor_isConvertingConstructor, + _dart_clang_CXXConstructor_isConvertingConstructor>( + 'clang_CXXConstructor_isConvertingConstructor'))( + C, + ); + } - /// A C++ class method. - static const int CXCursor_CXXMethod = 21; + _dart_clang_CXXConstructor_isConvertingConstructor? + _clang_CXXConstructor_isConvertingConstructor; - /// A C++ namespace. - static const int CXCursor_Namespace = 22; + /// Determine if a C++ constructor is a copy constructor. + int clang_CXXConstructor_isCopyConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isCopyConstructor ??= _dylib.lookupFunction< + _c_clang_CXXConstructor_isCopyConstructor, + _dart_clang_CXXConstructor_isCopyConstructor>( + 'clang_CXXConstructor_isCopyConstructor'))( + C, + ); + } - /// A linkage specification, e.g. 'extern "C"'. - static const int CXCursor_LinkageSpec = 23; + _dart_clang_CXXConstructor_isCopyConstructor? + _clang_CXXConstructor_isCopyConstructor; - /// A C++ constructor. - static const int CXCursor_Constructor = 24; + /// Determine if a C++ constructor is the default constructor. + int clang_CXXConstructor_isDefaultConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isDefaultConstructor ??= + _dylib.lookupFunction<_c_clang_CXXConstructor_isDefaultConstructor, + _dart_clang_CXXConstructor_isDefaultConstructor>( + 'clang_CXXConstructor_isDefaultConstructor'))( + C, + ); + } - /// A C++ destructor. - static const int CXCursor_Destructor = 25; + _dart_clang_CXXConstructor_isDefaultConstructor? + _clang_CXXConstructor_isDefaultConstructor; - /// A C++ conversion function. - static const int CXCursor_ConversionFunction = 26; + /// Determine if a C++ constructor is a move constructor. + int clang_CXXConstructor_isMoveConstructor( + CXCursor C, + ) { + return (_clang_CXXConstructor_isMoveConstructor ??= _dylib.lookupFunction< + _c_clang_CXXConstructor_isMoveConstructor, + _dart_clang_CXXConstructor_isMoveConstructor>( + 'clang_CXXConstructor_isMoveConstructor'))( + C, + ); + } - /// A C++ template type parameter. - static const int CXCursor_TemplateTypeParameter = 27; + _dart_clang_CXXConstructor_isMoveConstructor? + _clang_CXXConstructor_isMoveConstructor; - /// A C++ non-type template parameter. - static const int CXCursor_NonTypeTemplateParameter = 28; + /// Determine if a C++ field is declared 'mutable'. + int clang_CXXField_isMutable( + CXCursor C, + ) { + return (_clang_CXXField_isMutable ??= _dylib.lookupFunction< + _c_clang_CXXField_isMutable, + _dart_clang_CXXField_isMutable>('clang_CXXField_isMutable'))( + C, + ); + } - /// A C++ template template parameter. - static const int CXCursor_TemplateTemplateParameter = 29; + _dart_clang_CXXField_isMutable? _clang_CXXField_isMutable; - /// A C++ function template. - static const int CXCursor_FunctionTemplate = 30; - - /// A C++ class template. - static const int CXCursor_ClassTemplate = 31; + /// Determine if a C++ method is declared '= default'. + int clang_CXXMethod_isDefaulted( + CXCursor C, + ) { + return (_clang_CXXMethod_isDefaulted ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isDefaulted, + _dart_clang_CXXMethod_isDefaulted>('clang_CXXMethod_isDefaulted'))( + C, + ); + } - /// A C++ class template partial specialization. - static const int CXCursor_ClassTemplatePartialSpecialization = 32; + _dart_clang_CXXMethod_isDefaulted? _clang_CXXMethod_isDefaulted; - /// A C++ namespace alias declaration. - static const int CXCursor_NamespaceAlias = 33; + /// Determine if a C++ member function or member function template is pure + /// virtual. + int clang_CXXMethod_isPureVirtual( + CXCursor C, + ) { + return (_clang_CXXMethod_isPureVirtual ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isPureVirtual, + _dart_clang_CXXMethod_isPureVirtual>('clang_CXXMethod_isPureVirtual'))( + C, + ); + } - /// A C++ using directive. - static const int CXCursor_UsingDirective = 34; + _dart_clang_CXXMethod_isPureVirtual? _clang_CXXMethod_isPureVirtual; - /// A C++ using declaration. - static const int CXCursor_UsingDeclaration = 35; + /// Determine if a C++ member function or member function template is declared + /// 'static'. + int clang_CXXMethod_isStatic( + CXCursor C, + ) { + return (_clang_CXXMethod_isStatic ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isStatic, + _dart_clang_CXXMethod_isStatic>('clang_CXXMethod_isStatic'))( + C, + ); + } - /// A C++ alias declaration - static const int CXCursor_TypeAliasDecl = 36; + _dart_clang_CXXMethod_isStatic? _clang_CXXMethod_isStatic; - /// An Objective-C @synthesize definition. - static const int CXCursor_ObjCSynthesizeDecl = 37; + /// Determine if a C++ member function or member function template is + /// explicitly declared 'virtual' or if it overrides a virtual method from one + /// of the base classes. + int clang_CXXMethod_isVirtual( + CXCursor C, + ) { + return (_clang_CXXMethod_isVirtual ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isVirtual, + _dart_clang_CXXMethod_isVirtual>('clang_CXXMethod_isVirtual'))( + C, + ); + } - /// An Objective-C @dynamic definition. - static const int CXCursor_ObjCDynamicDecl = 38; + _dart_clang_CXXMethod_isVirtual? _clang_CXXMethod_isVirtual; - /// An access specifier. - static const int CXCursor_CXXAccessSpecifier = 39; - static const int CXCursor_FirstDecl = 1; - static const int CXCursor_LastDecl = 39; - static const int CXCursor_FirstRef = 40; - static const int CXCursor_ObjCSuperClassRef = 40; - static const int CXCursor_ObjCProtocolRef = 41; - static const int CXCursor_ObjCClassRef = 42; + /// Determine if a C++ record is abstract, i.e. whether a class or struct has + /// a pure virtual member function. + int clang_CXXRecord_isAbstract( + CXCursor C, + ) { + return (_clang_CXXRecord_isAbstract ??= _dylib.lookupFunction< + _c_clang_CXXRecord_isAbstract, + _dart_clang_CXXRecord_isAbstract>('clang_CXXRecord_isAbstract'))( + C, + ); + } - /// A reference to a type declaration. - static const int CXCursor_TypeRef = 43; - static const int CXCursor_CXXBaseSpecifier = 44; + _dart_clang_CXXRecord_isAbstract? _clang_CXXRecord_isAbstract; - /// A reference to a class template, function template, template template - /// parameter, or class template partial specialization. - static const int CXCursor_TemplateRef = 45; + /// Determine if an enum declaration refers to a scoped enum. + int clang_EnumDecl_isScoped( + CXCursor C, + ) { + return (_clang_EnumDecl_isScoped ??= _dylib.lookupFunction< + _c_clang_EnumDecl_isScoped, + _dart_clang_EnumDecl_isScoped>('clang_EnumDecl_isScoped'))( + C, + ); + } - /// A reference to a namespace or namespace alias. - static const int CXCursor_NamespaceRef = 46; + _dart_clang_EnumDecl_isScoped? _clang_EnumDecl_isScoped; - /// A reference to a member of a struct, union, or class that occurs in some - /// non-expression context, e.g., a designated initializer. - static const int CXCursor_MemberRef = 47; + /// Determine if a C++ member function or member function template is declared + /// 'const'. + int clang_CXXMethod_isConst( + CXCursor C, + ) { + return (_clang_CXXMethod_isConst ??= _dylib.lookupFunction< + _c_clang_CXXMethod_isConst, + _dart_clang_CXXMethod_isConst>('clang_CXXMethod_isConst'))( + C, + ); + } - /// A reference to a labeled statement. - static const int CXCursor_LabelRef = 48; + _dart_clang_CXXMethod_isConst? _clang_CXXMethod_isConst; - /// A reference to a set of overloaded functions or function templates that - /// has not yet been resolved to a specific function or function template. - static const int CXCursor_OverloadedDeclRef = 49; + /// Given a cursor that represents a template, determine the cursor kind of + /// the specializations would be generated by instantiating the template. + int clang_getTemplateCursorKind( + CXCursor C, + ) { + return (_clang_getTemplateCursorKind ??= _dylib.lookupFunction< + _c_clang_getTemplateCursorKind, + _dart_clang_getTemplateCursorKind>('clang_getTemplateCursorKind'))( + C, + ); + } - /// A reference to a variable that occurs in some non-expression context, - /// e.g., a C++ lambda capture list. - static const int CXCursor_VariableRef = 50; - static const int CXCursor_LastRef = 50; - static const int CXCursor_FirstInvalid = 70; - static const int CXCursor_InvalidFile = 70; - static const int CXCursor_NoDeclFound = 71; - static const int CXCursor_NotImplemented = 72; - static const int CXCursor_InvalidCode = 73; - static const int CXCursor_LastInvalid = 73; - static const int CXCursor_FirstExpr = 100; + _dart_clang_getTemplateCursorKind? _clang_getTemplateCursorKind; - /// An expression whose specific kind is not exposed via this interface. - static const int CXCursor_UnexposedExpr = 100; + /// Given a cursor that may represent a specialization or instantiation of a + /// template, retrieve the cursor that represents the template that it + /// specializes or from which it was instantiated. + CXCursor clang_getSpecializedCursorTemplate( + CXCursor C, + ) { + return (_clang_getSpecializedCursorTemplate ??= _dylib.lookupFunction< + _c_clang_getSpecializedCursorTemplate, + _dart_clang_getSpecializedCursorTemplate>( + 'clang_getSpecializedCursorTemplate'))( + C, + ); + } - /// An expression that refers to some value declaration, such as a function, - /// variable, or enumerator. - static const int CXCursor_DeclRefExpr = 101; + _dart_clang_getSpecializedCursorTemplate? _clang_getSpecializedCursorTemplate; - /// An expression that refers to a member of a struct, union, class, - /// Objective-C class, etc. - static const int CXCursor_MemberRefExpr = 102; + /// Given a cursor that references something else, return the source range + /// covering that reference. + CXSourceRange clang_getCursorReferenceNameRange( + CXCursor C, + int NameFlags, + int PieceIndex, + ) { + return (_clang_getCursorReferenceNameRange ??= _dylib.lookupFunction< + _c_clang_getCursorReferenceNameRange, + _dart_clang_getCursorReferenceNameRange>( + 'clang_getCursorReferenceNameRange'))( + C, + NameFlags, + PieceIndex, + ); + } - /// An expression that calls a function. - static const int CXCursor_CallExpr = 103; + _dart_clang_getCursorReferenceNameRange? _clang_getCursorReferenceNameRange; - /// An expression that sends a message to an Objective-C object or class. - static const int CXCursor_ObjCMessageExpr = 104; + /// Get the raw lexical token starting with the given location. + ffi.Pointer clang_getToken( + ffi.Pointer TU, + CXSourceLocation Location, + ) { + return (_clang_getToken ??= + _dylib.lookupFunction<_c_clang_getToken, _dart_clang_getToken>( + 'clang_getToken'))( + TU, + Location, + ); + } - /// An expression that represents a block literal. - static const int CXCursor_BlockExpr = 105; + _dart_clang_getToken? _clang_getToken; - /// An integer literal. - static const int CXCursor_IntegerLiteral = 106; + /// Determine the kind of the given token. + int clang_getTokenKind( + CXToken arg0, + ) { + return (_clang_getTokenKind ??= + _dylib.lookupFunction<_c_clang_getTokenKind, _dart_clang_getTokenKind>( + 'clang_getTokenKind'))( + arg0, + ); + } - /// A floating point number literal. - static const int CXCursor_FloatingLiteral = 107; + _dart_clang_getTokenKind? _clang_getTokenKind; - /// An imaginary number literal. - static const int CXCursor_ImaginaryLiteral = 108; + /// Determine the spelling of the given token. + CXString clang_getTokenSpelling( + ffi.Pointer arg0, + CXToken arg1, + ) { + return (_clang_getTokenSpelling ??= _dylib.lookupFunction< + _c_clang_getTokenSpelling, + _dart_clang_getTokenSpelling>('clang_getTokenSpelling'))( + arg0, + arg1, + ); + } - /// A string literal. - static const int CXCursor_StringLiteral = 109; + _dart_clang_getTokenSpelling? _clang_getTokenSpelling; - /// A character literal. - static const int CXCursor_CharacterLiteral = 110; + /// Retrieve the source location of the given token. + CXSourceLocation clang_getTokenLocation( + ffi.Pointer arg0, + CXToken arg1, + ) { + return (_clang_getTokenLocation ??= _dylib.lookupFunction< + _c_clang_getTokenLocation, + _dart_clang_getTokenLocation>('clang_getTokenLocation'))( + arg0, + arg1, + ); + } - /// A parenthesized expression, e.g. "(1)". - static const int CXCursor_ParenExpr = 111; + _dart_clang_getTokenLocation? _clang_getTokenLocation; - /// This represents the unary-expression's (except sizeof and alignof). - static const int CXCursor_UnaryOperator = 112; + /// Retrieve a source range that covers the given token. + CXSourceRange clang_getTokenExtent( + ffi.Pointer arg0, + CXToken arg1, + ) { + return (_clang_getTokenExtent ??= _dylib.lookupFunction< + _c_clang_getTokenExtent, + _dart_clang_getTokenExtent>('clang_getTokenExtent'))( + arg0, + arg1, + ); + } - /// [C99 6.5.2.1] Array Subscripting. - static const int CXCursor_ArraySubscriptExpr = 113; + _dart_clang_getTokenExtent? _clang_getTokenExtent; - /// A builtin binary operation expression such as "x + y" or "x <= y". - static const int CXCursor_BinaryOperator = 114; + /// Tokenize the source code described by the given range into raw lexical + /// tokens. + void clang_tokenize( + ffi.Pointer TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens, + ) { + return (_clang_tokenize ??= + _dylib.lookupFunction<_c_clang_tokenize, _dart_clang_tokenize>( + 'clang_tokenize'))( + TU, + Range, + Tokens, + NumTokens, + ); + } - /// Compound assignment such as "+=". - static const int CXCursor_CompoundAssignOperator = 115; + _dart_clang_tokenize? _clang_tokenize; - /// The ?: ternary operator. - static const int CXCursor_ConditionalOperator = 116; + /// Annotate the given set of tokens by providing cursors for each token that + /// can be mapped to a specific entity within the abstract syntax tree. + void clang_annotateTokens( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ffi.Pointer Cursors, + ) { + return (_clang_annotateTokens ??= _dylib.lookupFunction< + _c_clang_annotateTokens, + _dart_clang_annotateTokens>('clang_annotateTokens'))( + TU, + Tokens, + NumTokens, + Cursors, + ); + } - /// An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ - /// [expr.cast]), which uses the syntax (Type)expr. - static const int CXCursor_CStyleCastExpr = 117; + _dart_clang_annotateTokens? _clang_annotateTokens; - /// [C99 6.5.2.5] - static const int CXCursor_CompoundLiteralExpr = 118; + /// Free the given set of tokens. + void clang_disposeTokens( + ffi.Pointer TU, + ffi.Pointer Tokens, + int NumTokens, + ) { + return (_clang_disposeTokens ??= _dylib.lookupFunction< + _c_clang_disposeTokens, + _dart_clang_disposeTokens>('clang_disposeTokens'))( + TU, + Tokens, + NumTokens, + ); + } - /// Describes an C or C++ initializer list. - static const int CXCursor_InitListExpr = 119; + _dart_clang_disposeTokens? _clang_disposeTokens; - /// The GNU address of label extension, representing &&label. - static const int CXCursor_AddrLabelExpr = 120; + /// These routines are used for testing and debugging, only, and should not be + /// relied upon. + CXString clang_getCursorKindSpelling( + int Kind, + ) { + return (_clang_getCursorKindSpelling ??= _dylib.lookupFunction< + _c_clang_getCursorKindSpelling, + _dart_clang_getCursorKindSpelling>('clang_getCursorKindSpelling'))( + Kind, + ); + } - /// This is the GNU Statement Expression extension: ({int X=4; X;}) - static const int CXCursor_StmtExpr = 121; + _dart_clang_getCursorKindSpelling? _clang_getCursorKindSpelling; - /// Represents a C11 generic selection. - static const int CXCursor_GenericSelectionExpr = 122; + void clang_getDefinitionSpellingAndExtent( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, + ) { + return (_clang_getDefinitionSpellingAndExtent ??= _dylib.lookupFunction< + _c_clang_getDefinitionSpellingAndExtent, + _dart_clang_getDefinitionSpellingAndExtent>( + 'clang_getDefinitionSpellingAndExtent'))( + arg0, + startBuf, + endBuf, + startLine, + startColumn, + endLine, + endColumn, + ); + } - /// Implements the GNU __null extension, which is a name for a null pointer - /// constant that has integral type (e.g., int or long) and is the same size - /// and alignment as a pointer. - static const int CXCursor_GNUNullExpr = 123; + _dart_clang_getDefinitionSpellingAndExtent? + _clang_getDefinitionSpellingAndExtent; - /// C++'s static_cast<> expression. - static const int CXCursor_CXXStaticCastExpr = 124; + void clang_enableStackTraces() { + return (_clang_enableStackTraces ??= _dylib.lookupFunction< + _c_clang_enableStackTraces, + _dart_clang_enableStackTraces>('clang_enableStackTraces'))(); + } - /// C++'s dynamic_cast<> expression. - static const int CXCursor_CXXDynamicCastExpr = 125; + _dart_clang_enableStackTraces? _clang_enableStackTraces; - /// C++'s reinterpret_cast<> expression. - static const int CXCursor_CXXReinterpretCastExpr = 126; + void clang_executeOnThread( + ffi.Pointer> fn, + ffi.Pointer user_data, + int stack_size, + ) { + return (_clang_executeOnThread ??= _dylib.lookupFunction< + _c_clang_executeOnThread, + _dart_clang_executeOnThread>('clang_executeOnThread'))( + fn, + user_data, + stack_size, + ); + } - /// C++'s const_cast<> expression. - static const int CXCursor_CXXConstCastExpr = 127; + _dart_clang_executeOnThread? _clang_executeOnThread; - /// Represents an explicit C++ type conversion that uses "functional" notion - /// (C++ [expr.type.conv]). - static const int CXCursor_CXXFunctionalCastExpr = 128; + /// Determine the kind of a particular chunk within a completion string. + int clang_getCompletionChunkKind( + ffi.Pointer completion_string, + int chunk_number, + ) { + return (_clang_getCompletionChunkKind ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkKind, + _dart_clang_getCompletionChunkKind>('clang_getCompletionChunkKind'))( + completion_string, + chunk_number, + ); + } - /// A C++ typeid expression (C++ [expr.typeid]). - static const int CXCursor_CXXTypeidExpr = 129; + _dart_clang_getCompletionChunkKind? _clang_getCompletionChunkKind; - /// [C++ 2.13.5] C++ Boolean Literal. - static const int CXCursor_CXXBoolLiteralExpr = 130; - - /// [C++0x 2.14.7] C++ Pointer Literal. - static const int CXCursor_CXXNullPtrLiteralExpr = 131; + /// Retrieve the text associated with a particular chunk within a completion + /// string. + CXString clang_getCompletionChunkText( + ffi.Pointer completion_string, + int chunk_number, + ) { + return (_clang_getCompletionChunkText ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkText, + _dart_clang_getCompletionChunkText>('clang_getCompletionChunkText'))( + completion_string, + chunk_number, + ); + } - /// Represents the "this" expression in C++ - static const int CXCursor_CXXThisExpr = 132; + _dart_clang_getCompletionChunkText? _clang_getCompletionChunkText; - /// [C++ 15] C++ Throw Expression. - static const int CXCursor_CXXThrowExpr = 133; + /// Retrieve the completion string associated with a particular chunk within a + /// completion string. + ffi.Pointer clang_getCompletionChunkCompletionString( + ffi.Pointer completion_string, + int chunk_number, + ) { + return (_clang_getCompletionChunkCompletionString ??= _dylib.lookupFunction< + _c_clang_getCompletionChunkCompletionString, + _dart_clang_getCompletionChunkCompletionString>( + 'clang_getCompletionChunkCompletionString'))( + completion_string, + chunk_number, + ); + } - /// A new expression for memory allocation and constructor calls, e.g: "new - /// CXXNewExpr(foo)". - static const int CXCursor_CXXNewExpr = 134; + _dart_clang_getCompletionChunkCompletionString? + _clang_getCompletionChunkCompletionString; - /// A delete expression for memory deallocation and destructor calls, e.g. - /// "delete[] pArray". - static const int CXCursor_CXXDeleteExpr = 135; + /// Retrieve the number of chunks in the given code-completion string. + int clang_getNumCompletionChunks( + ffi.Pointer completion_string, + ) { + return (_clang_getNumCompletionChunks ??= _dylib.lookupFunction< + _c_clang_getNumCompletionChunks, + _dart_clang_getNumCompletionChunks>('clang_getNumCompletionChunks'))( + completion_string, + ); + } - /// A unary expression. (noexcept, sizeof, or other traits) - static const int CXCursor_UnaryExpr = 136; + _dart_clang_getNumCompletionChunks? _clang_getNumCompletionChunks; - /// An Objective-C string literal i.e. "foo". - static const int CXCursor_ObjCStringLiteral = 137; + /// Determine the priority of this code completion. + int clang_getCompletionPriority( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionPriority ??= _dylib.lookupFunction< + _c_clang_getCompletionPriority, + _dart_clang_getCompletionPriority>('clang_getCompletionPriority'))( + completion_string, + ); + } - /// An Objective-C @encode expression. - static const int CXCursor_ObjCEncodeExpr = 138; + _dart_clang_getCompletionPriority? _clang_getCompletionPriority; - /// An Objective-C @selector expression. - static const int CXCursor_ObjCSelectorExpr = 139; + /// Determine the availability of the entity that this code-completion string + /// refers to. + int clang_getCompletionAvailability( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionAvailability ??= _dylib.lookupFunction< + _c_clang_getCompletionAvailability, + _dart_clang_getCompletionAvailability>( + 'clang_getCompletionAvailability'))( + completion_string, + ); + } - /// An Objective-C @protocol expression. - static const int CXCursor_ObjCProtocolExpr = 140; + _dart_clang_getCompletionAvailability? _clang_getCompletionAvailability; - /// An Objective-C "bridged" cast expression, which casts between Objective-C - /// pointers and C pointers, transferring ownership in the process. - static const int CXCursor_ObjCBridgedCastExpr = 141; + /// Retrieve the number of annotations associated with the given completion + /// string. + int clang_getCompletionNumAnnotations( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionNumAnnotations ??= _dylib.lookupFunction< + _c_clang_getCompletionNumAnnotations, + _dart_clang_getCompletionNumAnnotations>( + 'clang_getCompletionNumAnnotations'))( + completion_string, + ); + } - /// Represents a C++0x pack expansion that produces a sequence of expressions. - static const int CXCursor_PackExpansionExpr = 142; + _dart_clang_getCompletionNumAnnotations? _clang_getCompletionNumAnnotations; - /// Represents an expression that computes the length of a parameter pack. - static const int CXCursor_SizeOfPackExpr = 143; - static const int CXCursor_LambdaExpr = 144; + /// Retrieve the annotation associated with the given completion string. + CXString clang_getCompletionAnnotation( + ffi.Pointer completion_string, + int annotation_number, + ) { + return (_clang_getCompletionAnnotation ??= _dylib.lookupFunction< + _c_clang_getCompletionAnnotation, + _dart_clang_getCompletionAnnotation>('clang_getCompletionAnnotation'))( + completion_string, + annotation_number, + ); + } - /// Objective-c Boolean Literal. - static const int CXCursor_ObjCBoolLiteralExpr = 145; + _dart_clang_getCompletionAnnotation? _clang_getCompletionAnnotation; - /// Represents the "self" expression in an Objective-C method. - static const int CXCursor_ObjCSelfExpr = 146; + /// Retrieve the parent context of the given completion string. + CXString clang_getCompletionParent( + ffi.Pointer completion_string, + ffi.Pointer kind, + ) { + return (_clang_getCompletionParent ??= _dylib.lookupFunction< + _c_clang_getCompletionParent, + _dart_clang_getCompletionParent>('clang_getCompletionParent'))( + completion_string, + kind, + ); + } - /// OpenMP 4.0 [2.4, Array Section]. - static const int CXCursor_OMPArraySectionExpr = 147; + _dart_clang_getCompletionParent? _clang_getCompletionParent; - /// Represents an (...) check. - static const int CXCursor_ObjCAvailabilityCheckExpr = 148; + /// Retrieve the brief documentation comment attached to the declaration that + /// corresponds to the given completion string. + CXString clang_getCompletionBriefComment( + ffi.Pointer completion_string, + ) { + return (_clang_getCompletionBriefComment ??= _dylib.lookupFunction< + _c_clang_getCompletionBriefComment, + _dart_clang_getCompletionBriefComment>( + 'clang_getCompletionBriefComment'))( + completion_string, + ); + } - /// Fixed point literal - static const int CXCursor_FixedPointLiteral = 149; - static const int CXCursor_LastExpr = 149; - static const int CXCursor_FirstStmt = 200; + _dart_clang_getCompletionBriefComment? _clang_getCompletionBriefComment; - /// A statement whose specific kind is not exposed via this interface. - static const int CXCursor_UnexposedStmt = 200; + /// Retrieve a completion string for an arbitrary declaration or macro + /// definition cursor. + ffi.Pointer clang_getCursorCompletionString( + CXCursor cursor, + ) { + return (_clang_getCursorCompletionString ??= _dylib.lookupFunction< + _c_clang_getCursorCompletionString, + _dart_clang_getCursorCompletionString>( + 'clang_getCursorCompletionString'))( + cursor, + ); + } - /// A labelled statement in a function. - static const int CXCursor_LabelStmt = 201; + _dart_clang_getCursorCompletionString? _clang_getCursorCompletionString; - /// A group of statements like { stmt stmt }. - static const int CXCursor_CompoundStmt = 202; + /// Retrieve the number of fix-its for the given completion index. + int clang_getCompletionNumFixIts( + ffi.Pointer results, + int completion_index, + ) { + return (_clang_getCompletionNumFixIts ??= _dylib.lookupFunction< + _c_clang_getCompletionNumFixIts, + _dart_clang_getCompletionNumFixIts>('clang_getCompletionNumFixIts'))( + results, + completion_index, + ); + } - /// A case statement. - static const int CXCursor_CaseStmt = 203; + _dart_clang_getCompletionNumFixIts? _clang_getCompletionNumFixIts; - /// A default statement. - static const int CXCursor_DefaultStmt = 204; + /// Fix-its that *must* be applied before inserting the text for the + /// corresponding completion. + CXString clang_getCompletionFixIt( + ffi.Pointer results, + int completion_index, + int fixit_index, + ffi.Pointer replacement_range, + ) { + return (_clang_getCompletionFixIt ??= _dylib.lookupFunction< + _c_clang_getCompletionFixIt, + _dart_clang_getCompletionFixIt>('clang_getCompletionFixIt'))( + results, + completion_index, + fixit_index, + replacement_range, + ); + } - /// An if statement - static const int CXCursor_IfStmt = 205; + _dart_clang_getCompletionFixIt? _clang_getCompletionFixIt; - /// A switch statement. - static const int CXCursor_SwitchStmt = 206; + /// Returns a default set of code-completion options that can be passed to + /// clang_codeCompleteAt(). + int clang_defaultCodeCompleteOptions() { + return (_clang_defaultCodeCompleteOptions ??= _dylib.lookupFunction< + _c_clang_defaultCodeCompleteOptions, + _dart_clang_defaultCodeCompleteOptions>( + 'clang_defaultCodeCompleteOptions'))(); + } - /// A while statement. - static const int CXCursor_WhileStmt = 207; + _dart_clang_defaultCodeCompleteOptions? _clang_defaultCodeCompleteOptions; - /// A do statement. - static const int CXCursor_DoStmt = 208; + /// Perform code completion at a given location in a translation unit. + ffi.Pointer clang_codeCompleteAt( + ffi.Pointer TU, + ffi.Pointer complete_filename, + int complete_line, + int complete_column, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, + ) { + return (_clang_codeCompleteAt ??= _dylib.lookupFunction< + _c_clang_codeCompleteAt, + _dart_clang_codeCompleteAt>('clang_codeCompleteAt'))( + TU, + complete_filename, + complete_line, + complete_column, + unsaved_files, + num_unsaved_files, + options, + ); + } - /// A for statement. - static const int CXCursor_ForStmt = 209; + _dart_clang_codeCompleteAt? _clang_codeCompleteAt; - /// A goto statement. - static const int CXCursor_GotoStmt = 210; + /// Sort the code-completion results in case-insensitive alphabetical order. + void clang_sortCodeCompletionResults( + ffi.Pointer Results, + int NumResults, + ) { + return (_clang_sortCodeCompletionResults ??= _dylib.lookupFunction< + _c_clang_sortCodeCompletionResults, + _dart_clang_sortCodeCompletionResults>( + 'clang_sortCodeCompletionResults'))( + Results, + NumResults, + ); + } - /// An indirect goto statement. - static const int CXCursor_IndirectGotoStmt = 211; + _dart_clang_sortCodeCompletionResults? _clang_sortCodeCompletionResults; - /// A continue statement. - static const int CXCursor_ContinueStmt = 212; + /// Free the given set of code-completion results. + void clang_disposeCodeCompleteResults( + ffi.Pointer Results, + ) { + return (_clang_disposeCodeCompleteResults ??= _dylib.lookupFunction< + _c_clang_disposeCodeCompleteResults, + _dart_clang_disposeCodeCompleteResults>( + 'clang_disposeCodeCompleteResults'))( + Results, + ); + } - /// A break statement. - static const int CXCursor_BreakStmt = 213; + _dart_clang_disposeCodeCompleteResults? _clang_disposeCodeCompleteResults; - /// A return statement. - static const int CXCursor_ReturnStmt = 214; + /// Determine the number of diagnostics produced prior to the location where + /// code completion was performed. + int clang_codeCompleteGetNumDiagnostics( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetNumDiagnostics ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetNumDiagnostics, + _dart_clang_codeCompleteGetNumDiagnostics>( + 'clang_codeCompleteGetNumDiagnostics'))( + Results, + ); + } - /// A GCC inline assembly statement extension. - static const int CXCursor_GCCAsmStmt = 215; - static const int CXCursor_AsmStmt = 215; + _dart_clang_codeCompleteGetNumDiagnostics? + _clang_codeCompleteGetNumDiagnostics; - /// Objective-C's overall @try-@catch-@finally statement. - static const int CXCursor_ObjCAtTryStmt = 216; + /// Retrieve a diagnostic associated with the given code completion. + ffi.Pointer clang_codeCompleteGetDiagnostic( + ffi.Pointer Results, + int Index, + ) { + return (_clang_codeCompleteGetDiagnostic ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetDiagnostic, + _dart_clang_codeCompleteGetDiagnostic>( + 'clang_codeCompleteGetDiagnostic'))( + Results, + Index, + ); + } - /// Objective-C's @catch statement. - static const int CXCursor_ObjCAtCatchStmt = 217; + _dart_clang_codeCompleteGetDiagnostic? _clang_codeCompleteGetDiagnostic; - /// Objective-C's @finally statement. - static const int CXCursor_ObjCAtFinallyStmt = 218; + /// Determines what completions are appropriate for the context the given code + /// completion. + int clang_codeCompleteGetContexts( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetContexts ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContexts, + _dart_clang_codeCompleteGetContexts>('clang_codeCompleteGetContexts'))( + Results, + ); + } - /// Objective-C's @throw statement. - static const int CXCursor_ObjCAtThrowStmt = 219; + _dart_clang_codeCompleteGetContexts? _clang_codeCompleteGetContexts; - /// Objective-C's @synchronized statement. - static const int CXCursor_ObjCAtSynchronizedStmt = 220; + /// Returns the cursor kind for the container for the current code completion + /// context. The container is only guaranteed to be set for contexts where a + /// container exists (i.e. member accesses or Objective-C message sends); if + /// there is not a container, this function will return CXCursor_InvalidCode. + int clang_codeCompleteGetContainerKind( + ffi.Pointer Results, + ffi.Pointer IsIncomplete, + ) { + return (_clang_codeCompleteGetContainerKind ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContainerKind, + _dart_clang_codeCompleteGetContainerKind>( + 'clang_codeCompleteGetContainerKind'))( + Results, + IsIncomplete, + ); + } - /// Objective-C's autorelease pool statement. - static const int CXCursor_ObjCAutoreleasePoolStmt = 221; + _dart_clang_codeCompleteGetContainerKind? _clang_codeCompleteGetContainerKind; - /// Objective-C's collection statement. - static const int CXCursor_ObjCForCollectionStmt = 222; + /// Returns the USR for the container for the current code completion context. + /// If there is not a container for the current context, this function will + /// return the empty string. + CXString clang_codeCompleteGetContainerUSR( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetContainerUSR ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetContainerUSR, + _dart_clang_codeCompleteGetContainerUSR>( + 'clang_codeCompleteGetContainerUSR'))( + Results, + ); + } - /// C++'s catch statement. - static const int CXCursor_CXXCatchStmt = 223; + _dart_clang_codeCompleteGetContainerUSR? _clang_codeCompleteGetContainerUSR; - /// C++'s try statement. - static const int CXCursor_CXXTryStmt = 224; + /// Returns the currently-entered selector for an Objective-C message send, + /// formatted like "initWithFoo:bar:". Only guaranteed to return a non-empty + /// string for CXCompletionContext_ObjCInstanceMessage and + /// CXCompletionContext_ObjCClassMessage. + CXString clang_codeCompleteGetObjCSelector( + ffi.Pointer Results, + ) { + return (_clang_codeCompleteGetObjCSelector ??= _dylib.lookupFunction< + _c_clang_codeCompleteGetObjCSelector, + _dart_clang_codeCompleteGetObjCSelector>( + 'clang_codeCompleteGetObjCSelector'))( + Results, + ); + } - /// C++'s for (* : *) statement. - static const int CXCursor_CXXForRangeStmt = 225; + _dart_clang_codeCompleteGetObjCSelector? _clang_codeCompleteGetObjCSelector; - /// Windows Structured Exception Handling's try statement. - static const int CXCursor_SEHTryStmt = 226; + /// Return a version string, suitable for showing to a user, but not intended + /// to be parsed (the format is not guaranteed to be stable). + CXString clang_getClangVersion() { + return (_clang_getClangVersion ??= _dylib.lookupFunction< + _c_clang_getClangVersion, + _dart_clang_getClangVersion>('clang_getClangVersion'))(); + } - /// Windows Structured Exception Handling's except statement. - static const int CXCursor_SEHExceptStmt = 227; + _dart_clang_getClangVersion? _clang_getClangVersion; - /// Windows Structured Exception Handling's finally statement. - static const int CXCursor_SEHFinallyStmt = 228; + /// Enable/disable crash recovery. + void clang_toggleCrashRecovery( + int isEnabled, + ) { + return (_clang_toggleCrashRecovery ??= _dylib.lookupFunction< + _c_clang_toggleCrashRecovery, + _dart_clang_toggleCrashRecovery>('clang_toggleCrashRecovery'))( + isEnabled, + ); + } - /// A MS inline assembly statement extension. - static const int CXCursor_MSAsmStmt = 229; + _dart_clang_toggleCrashRecovery? _clang_toggleCrashRecovery; - /// The null statement ";": C99 6.8.3p3. - static const int CXCursor_NullStmt = 230; + /// Visit the set of preprocessor inclusions in a translation unit. The + /// visitor function is called with the provided data for every included file. + /// This does not include headers included by the PCH file (unless one is + /// inspecting the inclusions in the PCH file itself). + void clang_getInclusions( + ffi.Pointer tu, + ffi.Pointer> visitor, + ffi.Pointer client_data, + ) { + return (_clang_getInclusions ??= _dylib.lookupFunction< + _c_clang_getInclusions, + _dart_clang_getInclusions>('clang_getInclusions'))( + tu, + visitor, + client_data, + ); + } - /// Adaptor class for mixing declarations with statements and expressions. - static const int CXCursor_DeclStmt = 231; + _dart_clang_getInclusions? _clang_getInclusions; - /// OpenMP parallel directive. - static const int CXCursor_OMPParallelDirective = 232; + /// If cursor is a statement declaration tries to evaluate the statement and + /// if its variable, tries to evaluate its initializer, into its corresponding + /// type. + ffi.Pointer clang_Cursor_Evaluate( + CXCursor C, + ) { + return (_clang_Cursor_Evaluate ??= _dylib.lookupFunction< + _c_clang_Cursor_Evaluate, + _dart_clang_Cursor_Evaluate>('clang_Cursor_Evaluate'))( + C, + ); + } - /// OpenMP SIMD directive. - static const int CXCursor_OMPSimdDirective = 233; + _dart_clang_Cursor_Evaluate? _clang_Cursor_Evaluate; - /// OpenMP for directive. - static const int CXCursor_OMPForDirective = 234; + /// Returns the kind of the evaluated result. + int clang_EvalResult_getKind( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getKind ??= _dylib.lookupFunction< + _c_clang_EvalResult_getKind, + _dart_clang_EvalResult_getKind>('clang_EvalResult_getKind'))( + E, + ); + } - /// OpenMP sections directive. - static const int CXCursor_OMPSectionsDirective = 235; + _dart_clang_EvalResult_getKind? _clang_EvalResult_getKind; - /// OpenMP section directive. - static const int CXCursor_OMPSectionDirective = 236; + /// Returns the evaluation result as integer if the kind is Int. + int clang_EvalResult_getAsInt( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsInt, + _dart_clang_EvalResult_getAsInt>('clang_EvalResult_getAsInt'))( + E, + ); + } - /// OpenMP single directive. - static const int CXCursor_OMPSingleDirective = 237; + _dart_clang_EvalResult_getAsInt? _clang_EvalResult_getAsInt; - /// OpenMP parallel for directive. - static const int CXCursor_OMPParallelForDirective = 238; + /// Returns the evaluation result as a long long integer if the kind is Int. + /// This prevents overflows that may happen if the result is returned with + /// clang_EvalResult_getAsInt. + int clang_EvalResult_getAsLongLong( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsLongLong ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsLongLong, + _dart_clang_EvalResult_getAsLongLong>( + 'clang_EvalResult_getAsLongLong'))( + E, + ); + } - /// OpenMP parallel sections directive. - static const int CXCursor_OMPParallelSectionsDirective = 239; + _dart_clang_EvalResult_getAsLongLong? _clang_EvalResult_getAsLongLong; - /// OpenMP task directive. - static const int CXCursor_OMPTaskDirective = 240; + /// Returns a non-zero value if the kind is Int and the evaluation result + /// resulted in an unsigned integer. + int clang_EvalResult_isUnsignedInt( + ffi.Pointer E, + ) { + return (_clang_EvalResult_isUnsignedInt ??= _dylib.lookupFunction< + _c_clang_EvalResult_isUnsignedInt, + _dart_clang_EvalResult_isUnsignedInt>( + 'clang_EvalResult_isUnsignedInt'))( + E, + ); + } - /// OpenMP master directive. - static const int CXCursor_OMPMasterDirective = 241; + _dart_clang_EvalResult_isUnsignedInt? _clang_EvalResult_isUnsignedInt; - /// OpenMP critical directive. - static const int CXCursor_OMPCriticalDirective = 242; + /// Returns the evaluation result as an unsigned integer if the kind is Int + /// and clang_EvalResult_isUnsignedInt is non-zero. + int clang_EvalResult_getAsUnsigned( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsUnsigned ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsUnsigned, + _dart_clang_EvalResult_getAsUnsigned>( + 'clang_EvalResult_getAsUnsigned'))( + E, + ); + } - /// OpenMP taskyield directive. - static const int CXCursor_OMPTaskyieldDirective = 243; + _dart_clang_EvalResult_getAsUnsigned? _clang_EvalResult_getAsUnsigned; - /// OpenMP barrier directive. - static const int CXCursor_OMPBarrierDirective = 244; + /// Returns the evaluation result as double if the kind is double. + double clang_EvalResult_getAsDouble( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsDouble ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsDouble, + _dart_clang_EvalResult_getAsDouble>('clang_EvalResult_getAsDouble'))( + E, + ); + } - /// OpenMP taskwait directive. - static const int CXCursor_OMPTaskwaitDirective = 245; + _dart_clang_EvalResult_getAsDouble? _clang_EvalResult_getAsDouble; - /// OpenMP flush directive. - static const int CXCursor_OMPFlushDirective = 246; + /// Returns the evaluation result as a constant string if the kind is other + /// than Int or float. User must not free this pointer, instead call + /// clang_EvalResult_dispose on the CXEvalResult returned by + /// clang_Cursor_Evaluate. + ffi.Pointer clang_EvalResult_getAsStr( + ffi.Pointer E, + ) { + return (_clang_EvalResult_getAsStr ??= _dylib.lookupFunction< + _c_clang_EvalResult_getAsStr, + _dart_clang_EvalResult_getAsStr>('clang_EvalResult_getAsStr'))( + E, + ); + } - /// Windows Structured Exception Handling's leave statement. - static const int CXCursor_SEHLeaveStmt = 247; + _dart_clang_EvalResult_getAsStr? _clang_EvalResult_getAsStr; - /// OpenMP ordered directive. - static const int CXCursor_OMPOrderedDirective = 248; + /// Disposes the created Eval memory. + void clang_EvalResult_dispose( + ffi.Pointer E, + ) { + return (_clang_EvalResult_dispose ??= _dylib.lookupFunction< + _c_clang_EvalResult_dispose, + _dart_clang_EvalResult_dispose>('clang_EvalResult_dispose'))( + E, + ); + } - /// OpenMP atomic directive. - static const int CXCursor_OMPAtomicDirective = 249; - - /// OpenMP for SIMD directive. - static const int CXCursor_OMPForSimdDirective = 250; + _dart_clang_EvalResult_dispose? _clang_EvalResult_dispose; - /// OpenMP parallel for SIMD directive. - static const int CXCursor_OMPParallelForSimdDirective = 251; + /// Retrieve a remapping. + ffi.Pointer clang_getRemappings( + ffi.Pointer path, + ) { + return (_clang_getRemappings ??= _dylib.lookupFunction< + _c_clang_getRemappings, + _dart_clang_getRemappings>('clang_getRemappings'))( + path, + ); + } - /// OpenMP target directive. - static const int CXCursor_OMPTargetDirective = 252; + _dart_clang_getRemappings? _clang_getRemappings; - /// OpenMP teams directive. - static const int CXCursor_OMPTeamsDirective = 253; + /// Retrieve a remapping. + ffi.Pointer clang_getRemappingsFromFileList( + ffi.Pointer> filePaths, + int numFiles, + ) { + return (_clang_getRemappingsFromFileList ??= _dylib.lookupFunction< + _c_clang_getRemappingsFromFileList, + _dart_clang_getRemappingsFromFileList>( + 'clang_getRemappingsFromFileList'))( + filePaths, + numFiles, + ); + } - /// OpenMP taskgroup directive. - static const int CXCursor_OMPTaskgroupDirective = 254; + _dart_clang_getRemappingsFromFileList? _clang_getRemappingsFromFileList; - /// OpenMP cancellation point directive. - static const int CXCursor_OMPCancellationPointDirective = 255; + /// Determine the number of remappings. + int clang_remap_getNumFiles( + ffi.Pointer arg0, + ) { + return (_clang_remap_getNumFiles ??= _dylib.lookupFunction< + _c_clang_remap_getNumFiles, + _dart_clang_remap_getNumFiles>('clang_remap_getNumFiles'))( + arg0, + ); + } - /// OpenMP cancel directive. - static const int CXCursor_OMPCancelDirective = 256; + _dart_clang_remap_getNumFiles? _clang_remap_getNumFiles; - /// OpenMP target data directive. - static const int CXCursor_OMPTargetDataDirective = 257; + /// Get the original and the associated filename from the remapping. + void clang_remap_getFilenames( + ffi.Pointer arg0, + int index, + ffi.Pointer original, + ffi.Pointer transformed, + ) { + return (_clang_remap_getFilenames ??= _dylib.lookupFunction< + _c_clang_remap_getFilenames, + _dart_clang_remap_getFilenames>('clang_remap_getFilenames'))( + arg0, + index, + original, + transformed, + ); + } - /// OpenMP taskloop directive. - static const int CXCursor_OMPTaskLoopDirective = 258; + _dart_clang_remap_getFilenames? _clang_remap_getFilenames; - /// OpenMP taskloop simd directive. - static const int CXCursor_OMPTaskLoopSimdDirective = 259; + /// Dispose the remapping. + void clang_remap_dispose( + ffi.Pointer arg0, + ) { + return (_clang_remap_dispose ??= _dylib.lookupFunction< + _c_clang_remap_dispose, + _dart_clang_remap_dispose>('clang_remap_dispose'))( + arg0, + ); + } - /// OpenMP distribute directive. - static const int CXCursor_OMPDistributeDirective = 260; + _dart_clang_remap_dispose? _clang_remap_dispose; - /// OpenMP target enter data directive. - static const int CXCursor_OMPTargetEnterDataDirective = 261; + /// Find references of a declaration in a specific file. + int clang_findReferencesInFile( + CXCursor cursor, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, + ) { + return (_clang_findReferencesInFile ??= _dylib.lookupFunction< + _c_clang_findReferencesInFile, + _dart_clang_findReferencesInFile>('clang_findReferencesInFile'))( + cursor, + file, + visitor, + ); + } - /// OpenMP target exit data directive. - static const int CXCursor_OMPTargetExitDataDirective = 262; + _dart_clang_findReferencesInFile? _clang_findReferencesInFile; - /// OpenMP target parallel directive. - static const int CXCursor_OMPTargetParallelDirective = 263; + /// Find #import/#include directives in a specific file. + int clang_findIncludesInFile( + ffi.Pointer TU, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, + ) { + return (_clang_findIncludesInFile ??= _dylib.lookupFunction< + _c_clang_findIncludesInFile, + _dart_clang_findIncludesInFile>('clang_findIncludesInFile'))( + TU, + file, + visitor, + ); + } - /// OpenMP target parallel for directive. - static const int CXCursor_OMPTargetParallelForDirective = 264; + _dart_clang_findIncludesInFile? _clang_findIncludesInFile; - /// OpenMP target update directive. - static const int CXCursor_OMPTargetUpdateDirective = 265; + int clang_index_isEntityObjCContainerKind( + int arg0, + ) { + return (_clang_index_isEntityObjCContainerKind ??= _dylib.lookupFunction< + _c_clang_index_isEntityObjCContainerKind, + _dart_clang_index_isEntityObjCContainerKind>( + 'clang_index_isEntityObjCContainerKind'))( + arg0, + ); + } - /// OpenMP distribute parallel for directive. - static const int CXCursor_OMPDistributeParallelForDirective = 266; + _dart_clang_index_isEntityObjCContainerKind? + _clang_index_isEntityObjCContainerKind; - /// OpenMP distribute parallel for simd directive. - static const int CXCursor_OMPDistributeParallelForSimdDirective = 267; + ffi.Pointer clang_index_getObjCContainerDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCContainerDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCContainerDeclInfo, + _dart_clang_index_getObjCContainerDeclInfo>( + 'clang_index_getObjCContainerDeclInfo'))( + arg0, + ); + } - /// OpenMP distribute simd directive. - static const int CXCursor_OMPDistributeSimdDirective = 268; + _dart_clang_index_getObjCContainerDeclInfo? + _clang_index_getObjCContainerDeclInfo; - /// OpenMP target parallel for simd directive. - static const int CXCursor_OMPTargetParallelForSimdDirective = 269; + ffi.Pointer clang_index_getObjCInterfaceDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCInterfaceDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCInterfaceDeclInfo, + _dart_clang_index_getObjCInterfaceDeclInfo>( + 'clang_index_getObjCInterfaceDeclInfo'))( + arg0, + ); + } - /// OpenMP target simd directive. - static const int CXCursor_OMPTargetSimdDirective = 270; + _dart_clang_index_getObjCInterfaceDeclInfo? + _clang_index_getObjCInterfaceDeclInfo; - /// OpenMP teams distribute directive. - static const int CXCursor_OMPTeamsDistributeDirective = 271; + ffi.Pointer clang_index_getObjCCategoryDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCCategoryDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCCategoryDeclInfo, + _dart_clang_index_getObjCCategoryDeclInfo>( + 'clang_index_getObjCCategoryDeclInfo'))( + arg0, + ); + } - /// OpenMP teams distribute simd directive. - static const int CXCursor_OMPTeamsDistributeSimdDirective = 272; + _dart_clang_index_getObjCCategoryDeclInfo? + _clang_index_getObjCCategoryDeclInfo; - /// OpenMP teams distribute parallel for simd directive. - static const int CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273; + ffi.Pointer + clang_index_getObjCProtocolRefListInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCProtocolRefListInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCProtocolRefListInfo, + _dart_clang_index_getObjCProtocolRefListInfo>( + 'clang_index_getObjCProtocolRefListInfo'))( + arg0, + ); + } - /// OpenMP teams distribute parallel for directive. - static const int CXCursor_OMPTeamsDistributeParallelForDirective = 274; + _dart_clang_index_getObjCProtocolRefListInfo? + _clang_index_getObjCProtocolRefListInfo; - /// OpenMP target teams directive. - static const int CXCursor_OMPTargetTeamsDirective = 275; + ffi.Pointer clang_index_getObjCPropertyDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getObjCPropertyDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getObjCPropertyDeclInfo, + _dart_clang_index_getObjCPropertyDeclInfo>( + 'clang_index_getObjCPropertyDeclInfo'))( + arg0, + ); + } - /// OpenMP target teams distribute directive. - static const int CXCursor_OMPTargetTeamsDistributeDirective = 276; + _dart_clang_index_getObjCPropertyDeclInfo? + _clang_index_getObjCPropertyDeclInfo; - /// OpenMP target teams distribute parallel for directive. - static const int CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277; + ffi.Pointer + clang_index_getIBOutletCollectionAttrInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getIBOutletCollectionAttrInfo ??= + _dylib.lookupFunction<_c_clang_index_getIBOutletCollectionAttrInfo, + _dart_clang_index_getIBOutletCollectionAttrInfo>( + 'clang_index_getIBOutletCollectionAttrInfo'))( + arg0, + ); + } - /// OpenMP target teams distribute parallel for simd directive. - static const int CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = - 278; + _dart_clang_index_getIBOutletCollectionAttrInfo? + _clang_index_getIBOutletCollectionAttrInfo; - /// OpenMP target teams distribute simd directive. - static const int CXCursor_OMPTargetTeamsDistributeSimdDirective = 279; + ffi.Pointer clang_index_getCXXClassDeclInfo( + ffi.Pointer arg0, + ) { + return (_clang_index_getCXXClassDeclInfo ??= _dylib.lookupFunction< + _c_clang_index_getCXXClassDeclInfo, + _dart_clang_index_getCXXClassDeclInfo>( + 'clang_index_getCXXClassDeclInfo'))( + arg0, + ); + } - /// C++2a std::bit_cast expression. - static const int CXCursor_BuiltinBitCastExpr = 280; + _dart_clang_index_getCXXClassDeclInfo? _clang_index_getCXXClassDeclInfo; - /// OpenMP master taskloop directive. - static const int CXCursor_OMPMasterTaskLoopDirective = 281; + /// For retrieving a custom CXIdxClientContainer attached to a container. + ffi.Pointer clang_index_getClientContainer( + ffi.Pointer arg0, + ) { + return (_clang_index_getClientContainer ??= _dylib.lookupFunction< + _c_clang_index_getClientContainer, + _dart_clang_index_getClientContainer>( + 'clang_index_getClientContainer'))( + arg0, + ); + } - /// OpenMP parallel master taskloop directive. - static const int CXCursor_OMPParallelMasterTaskLoopDirective = 282; + _dart_clang_index_getClientContainer? _clang_index_getClientContainer; + + /// For setting a custom CXIdxClientContainer attached to a container. + void clang_index_setClientContainer( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return (_clang_index_setClientContainer ??= _dylib.lookupFunction< + _c_clang_index_setClientContainer, + _dart_clang_index_setClientContainer>( + 'clang_index_setClientContainer'))( + arg0, + arg1, + ); + } + + _dart_clang_index_setClientContainer? _clang_index_setClientContainer; + + /// For retrieving a custom CXIdxClientEntity attached to an entity. + ffi.Pointer clang_index_getClientEntity( + ffi.Pointer arg0, + ) { + return (_clang_index_getClientEntity ??= _dylib.lookupFunction< + _c_clang_index_getClientEntity, + _dart_clang_index_getClientEntity>('clang_index_getClientEntity'))( + arg0, + ); + } + + _dart_clang_index_getClientEntity? _clang_index_getClientEntity; + + /// For setting a custom CXIdxClientEntity attached to an entity. + void clang_index_setClientEntity( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return (_clang_index_setClientEntity ??= _dylib.lookupFunction< + _c_clang_index_setClientEntity, + _dart_clang_index_setClientEntity>('clang_index_setClientEntity'))( + arg0, + arg1, + ); + } + + _dart_clang_index_setClientEntity? _clang_index_setClientEntity; + + /// An indexing action/session, to be applied to one or multiple translation + /// units. + ffi.Pointer clang_IndexAction_create( + ffi.Pointer CIdx, + ) { + return (_clang_IndexAction_create ??= _dylib.lookupFunction< + _c_clang_IndexAction_create, + _dart_clang_IndexAction_create>('clang_IndexAction_create'))( + CIdx, + ); + } + + _dart_clang_IndexAction_create? _clang_IndexAction_create; + + /// Destroy the given index action. + void clang_IndexAction_dispose( + ffi.Pointer arg0, + ) { + return (_clang_IndexAction_dispose ??= _dylib.lookupFunction< + _c_clang_IndexAction_dispose, + _dart_clang_IndexAction_dispose>('clang_IndexAction_dispose'))( + arg0, + ); + } + + _dart_clang_IndexAction_dispose? _clang_IndexAction_dispose; + + /// Index the given source file and the translation unit corresponding to that + /// file via callbacks implemented through #IndexerCallbacks. + int clang_indexSourceFile( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + ffi.Pointer> out_TU, + int TU_options, + ) { + return (_clang_indexSourceFile ??= _dylib.lookupFunction< + _c_clang_indexSourceFile, + _dart_clang_indexSourceFile>('clang_indexSourceFile'))( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + out_TU, + TU_options, + ); + } + + _dart_clang_indexSourceFile? _clang_indexSourceFile; + + /// Same as clang_indexSourceFile but requires a full command line for + /// command_line_args including argv[0]. This is useful if the standard + /// library paths are relative to the binary. + int clang_indexSourceFileFullArgv( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + ffi.Pointer> out_TU, + int TU_options, + ) { + return (_clang_indexSourceFileFullArgv ??= _dylib.lookupFunction< + _c_clang_indexSourceFileFullArgv, + _dart_clang_indexSourceFileFullArgv>('clang_indexSourceFileFullArgv'))( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + source_filename, + command_line_args, + num_command_line_args, + unsaved_files, + num_unsaved_files, + out_TU, + TU_options, + ); + } + + _dart_clang_indexSourceFileFullArgv? _clang_indexSourceFileFullArgv; + + /// Index the given translation unit via callbacks implemented through + /// #IndexerCallbacks. + int clang_indexTranslationUnit( + ffi.Pointer arg0, + ffi.Pointer client_data, + ffi.Pointer index_callbacks, + int index_callbacks_size, + int index_options, + ffi.Pointer arg5, + ) { + return (_clang_indexTranslationUnit ??= _dylib.lookupFunction< + _c_clang_indexTranslationUnit, + _dart_clang_indexTranslationUnit>('clang_indexTranslationUnit'))( + arg0, + client_data, + index_callbacks, + index_callbacks_size, + index_options, + arg5, + ); + } + + _dart_clang_indexTranslationUnit? _clang_indexTranslationUnit; + + /// Retrieve the CXIdxFile, file, line, column, and offset represented by the + /// given CXIdxLoc. + void clang_indexLoc_getFileLocation( + CXIdxLoc loc, + ffi.Pointer> indexFile, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, + ) { + return (_clang_indexLoc_getFileLocation ??= _dylib.lookupFunction< + _c_clang_indexLoc_getFileLocation, + _dart_clang_indexLoc_getFileLocation>( + 'clang_indexLoc_getFileLocation'))( + loc, + indexFile, + file, + line, + column, + offset, + ); + } + + _dart_clang_indexLoc_getFileLocation? _clang_indexLoc_getFileLocation; + + /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. + CXSourceLocation clang_indexLoc_getCXSourceLocation( + CXIdxLoc loc, + ) { + return (_clang_indexLoc_getCXSourceLocation ??= _dylib.lookupFunction< + _c_clang_indexLoc_getCXSourceLocation, + _dart_clang_indexLoc_getCXSourceLocation>( + 'clang_indexLoc_getCXSourceLocation'))( + loc, + ); + } + + _dart_clang_indexLoc_getCXSourceLocation? _clang_indexLoc_getCXSourceLocation; + + /// Visit the fields of a particular type. + int clang_Type_visitFields( + CXType T, + ffi.Pointer> visitor, + ffi.Pointer client_data, + ) { + return (_clang_Type_visitFields ??= _dylib.lookupFunction< + _c_clang_Type_visitFields, + _dart_clang_Type_visitFields>('clang_Type_visitFields'))( + T, + visitor, + client_data, + ); + } + + _dart_clang_Type_visitFields? _clang_Type_visitFields; +} + +/// Error codes returned by libclang routines. +abstract class CXErrorCode { + /// No error. + static const int CXError_Success = 0; + + /// A generic error code, no further details are available. + static const int CXError_Failure = 1; + + /// libclang crashed while performing the requested operation. + static const int CXError_Crashed = 2; + + /// The function detected that the arguments violate the function contract. + static const int CXError_InvalidArguments = 3; + + /// An AST deserialization error has occurred. + static const int CXError_ASTReadError = 4; +} + +/// A character string. +class CXString extends ffi.Struct { + external ffi.Pointer data; + + @ffi.Uint32() + external int private_flags; +} + +class CXStringSet extends ffi.Struct { + external ffi.Pointer Strings; + + @ffi.Uint32() + external int Count; +} + +class CXVirtualFileOverlayImpl extends ffi.Struct {} + +class CXModuleMapDescriptorImpl extends ffi.Struct {} + +class CXTargetInfoImpl extends ffi.Struct {} + +class CXTranslationUnitImpl extends ffi.Struct {} + +/// Provides the contents of a file that has not yet been saved to disk. +class CXUnsavedFile extends ffi.Struct { + /// The file whose contents have not yet been saved. + external ffi.Pointer Filename; + + /// A buffer containing the unsaved contents of this file. + external ffi.Pointer Contents; + + /// The length of the unsaved contents of this buffer. + @ffi.Uint64() + external int Length; +} + +/// Describes the availability of a particular entity, which indicates whether +/// the use of this entity will result in a warning or error due to it being +/// deprecated or unavailable. +abstract class CXAvailabilityKind { + /// The entity is available. + static const int CXAvailability_Available = 0; + + /// The entity is available, but has been deprecated (and its use is not + /// recommended). + static const int CXAvailability_Deprecated = 1; + + /// The entity is not available; any use of it will be an error. + static const int CXAvailability_NotAvailable = 2; + + /// The entity is available, but not accessible; any use of it will be an + /// error. + static const int CXAvailability_NotAccessible = 3; +} + +/// Describes a version number of the form major.minor.subminor. +class CXVersion extends ffi.Struct { + /// The major version number, e.g., the '10' in '10.7.3'. A negative value + /// indicates that there is no version number at all. + @ffi.Int32() + external int Major; + + /// The minor version number, e.g., the '7' in '10.7.3'. This value will be + /// negative if no minor version number was provided, e.g., for version '10'. + @ffi.Int32() + external int Minor; + + /// The subminor version number, e.g., the '3' in '10.7.3'. This value will be + /// negative if no minor or subminor version number was provided, e.g., in + /// version '10' or '10.7'. + @ffi.Int32() + external int Subminor; +} + +/// Describes the exception specification of a cursor. +abstract class CXCursor_ExceptionSpecificationKind { + /// The cursor has no exception specification. + static const int CXCursor_ExceptionSpecificationKind_None = 0; + + /// The cursor has exception specification throw() + static const int CXCursor_ExceptionSpecificationKind_DynamicNone = 1; + + /// The cursor has exception specification throw(T1, T2) + static const int CXCursor_ExceptionSpecificationKind_Dynamic = 2; + + /// The cursor has exception specification throw(...). + static const int CXCursor_ExceptionSpecificationKind_MSAny = 3; + + /// The cursor has exception specification basic noexcept. + static const int CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4; + + /// The cursor has exception specification computed noexcept. + static const int CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5; + + /// The exception specification has not yet been evaluated. + static const int CXCursor_ExceptionSpecificationKind_Unevaluated = 6; + + /// The exception specification has not yet been instantiated. + static const int CXCursor_ExceptionSpecificationKind_Uninstantiated = 7; + + /// The exception specification has not been parsed yet. + static const int CXCursor_ExceptionSpecificationKind_Unparsed = 8; + + /// The cursor has a __declspec(nothrow) exception specification. + static const int CXCursor_ExceptionSpecificationKind_NoThrow = 9; +} + +abstract class CXGlobalOptFlags { + /// Used to indicate that no special CXIndex options are needed. + static const int CXGlobalOpt_None = 0; + + /// Used to indicate that threads that libclang creates for indexing purposes + /// should use background priority. + static const int CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1; + + /// Used to indicate that threads that libclang creates for editing purposes + /// should use background priority. + static const int CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2; + + /// Used to indicate that all threads that libclang creates should use + /// background priority. + static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; +} + +/// Uniquely identifies a CXFile, that refers to the same underlying file, +/// across an indexing session. +class CXFileUniqueID extends ffi.Struct { + @ffi.Uint64() + external int _unique_data_item_0; + @ffi.Uint64() + external int _unique_data_item_1; + @ffi.Uint64() + external int _unique_data_item_2; + + /// Helper for array `data`. + ArrayHelper_CXFileUniqueID_data_level0 get data => + ArrayHelper_CXFileUniqueID_data_level0(this, [3], 0, 0); +} + +/// Helper for array `data` in struct `CXFileUniqueID`. +class ArrayHelper_CXFileUniqueID_data_level0 { + final CXFileUniqueID _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXFileUniqueID_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + int operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_data_item_0; + case 1: + return _struct._unique_data_item_1; + case 2: + return _struct._unique_data_item_2; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_data_item_0 = value; + break; + case 1: + _struct._unique_data_item_1 = value; + break; + case 2: + _struct._unique_data_item_2 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Identifies a specific source location within a translation unit. +class CXSourceLocation extends ffi.Struct { + external ffi.Pointer _unique_ptr_data_item_0; + external ffi.Pointer _unique_ptr_data_item_1; + + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceLocation_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceLocation_ptr_data_level0(this, [2], 0, 0); + @ffi.Uint32() + external int int_data; +} + +/// Helper for array `ptr_data` in struct `CXSourceLocation`. +class ArrayHelper_CXSourceLocation_ptr_data_level0 { + final CXSourceLocation _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXSourceLocation_ptr_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_ptr_data_item_0; + case 1: + return _struct._unique_ptr_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_ptr_data_item_0 = value; + break; + case 1: + _struct._unique_ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Identifies a half-open character range in the source code. +class CXSourceRange extends ffi.Struct { + external ffi.Pointer _unique_ptr_data_item_0; + external ffi.Pointer _unique_ptr_data_item_1; + + /// Helper for array `ptr_data`. + ArrayHelper_CXSourceRange_ptr_data_level0 get ptr_data => + ArrayHelper_CXSourceRange_ptr_data_level0(this, [2], 0, 0); + @ffi.Uint32() + external int begin_int_data; + + @ffi.Uint32() + external int end_int_data; +} + +/// Helper for array `ptr_data` in struct `CXSourceRange`. +class ArrayHelper_CXSourceRange_ptr_data_level0 { + final CXSourceRange _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXSourceRange_ptr_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_ptr_data_item_0; + case 1: + return _struct._unique_ptr_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_ptr_data_item_0 = value; + break; + case 1: + _struct._unique_ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Identifies an array of ranges. +class CXSourceRangeList extends ffi.Struct { + /// The number of ranges in the ranges array. + @ffi.Uint32() + external int count; + + /// An array of CXSourceRanges. + external ffi.Pointer ranges; +} + +/// Describes the severity of a particular diagnostic. +abstract class CXDiagnosticSeverity { + /// A diagnostic that has been suppressed, e.g., by a command-line option. + static const int CXDiagnostic_Ignored = 0; + + /// This diagnostic is a note that should be attached to the previous + /// (non-note) diagnostic. + static const int CXDiagnostic_Note = 1; + + /// This diagnostic indicates suspicious code that may not be wrong. + static const int CXDiagnostic_Warning = 2; + + /// This diagnostic indicates that the code is ill-formed. + static const int CXDiagnostic_Error = 3; + + /// This diagnostic indicates that the code is ill-formed such that future + /// parser recovery is unlikely to produce useful results. + static const int CXDiagnostic_Fatal = 4; +} + +/// Describes the kind of error that occurred (if any) in a call to +/// clang_loadDiagnostics. +abstract class CXLoadDiag_Error { + /// Indicates that no error occurred. + static const int CXLoadDiag_None = 0; + + /// Indicates that an unknown error occurred while attempting to deserialize + /// diagnostics. + static const int CXLoadDiag_Unknown = 1; + + /// Indicates that the file containing the serialized diagnostics could not be + /// opened. + static const int CXLoadDiag_CannotLoad = 2; + + /// Indicates that the serialized diagnostics file is invalid or corrupt. + static const int CXLoadDiag_InvalidFile = 3; +} + +/// Options to control the display of diagnostics. +abstract class CXDiagnosticDisplayOptions { + /// Display the source-location information where the diagnostic was located. + static const int CXDiagnostic_DisplaySourceLocation = 1; + + /// If displaying the source-location information of the diagnostic, also + /// include the column number. + static const int CXDiagnostic_DisplayColumn = 2; + + /// If displaying the source-location information of the diagnostic, also + /// include information about source ranges in a machine-parsable format. + static const int CXDiagnostic_DisplaySourceRanges = 4; + + /// Display the option name associated with this diagnostic, if any. + static const int CXDiagnostic_DisplayOption = 8; + + /// Display the category number associated with this diagnostic, if any. + static const int CXDiagnostic_DisplayCategoryId = 16; + + /// Display the category name associated with this diagnostic, if any. + static const int CXDiagnostic_DisplayCategoryName = 32; +} + +/// Flags that control the creation of translation units. +abstract class CXTranslationUnit_Flags { + /// Used to indicate that no special translation-unit options are needed. + static const int CXTranslationUnit_None = 0; + + /// Used to indicate that the parser should construct a "detailed" + /// preprocessing record, including all macro definitions and instantiations. + static const int CXTranslationUnit_DetailedPreprocessingRecord = 1; + + /// Used to indicate that the translation unit is incomplete. + static const int CXTranslationUnit_Incomplete = 2; + + /// Used to indicate that the translation unit should be built with an + /// implicit precompiled header for the preamble. + static const int CXTranslationUnit_PrecompiledPreamble = 4; + + /// Used to indicate that the translation unit should cache some + /// code-completion results with each reparse of the source file. + static const int CXTranslationUnit_CacheCompletionResults = 8; + + /// Used to indicate that the translation unit will be serialized with + /// clang_saveTranslationUnit. + static const int CXTranslationUnit_ForSerialization = 16; + + /// DEPRECATED: Enabled chained precompiled preambles in C++. + static const int CXTranslationUnit_CXXChainedPCH = 32; + + /// Used to indicate that function/method bodies should be skipped while + /// parsing. + static const int CXTranslationUnit_SkipFunctionBodies = 64; + + /// Used to indicate that brief documentation comments should be included into + /// the set of code completions returned from this translation unit. + static const int CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128; + + /// Used to indicate that the precompiled preamble should be created on the + /// first parse. Otherwise it will be created on the first reparse. This + /// trades runtime on the first parse (serializing the preamble takes time) + /// for reduced runtime on the second parse (can now reuse the preamble). + static const int CXTranslationUnit_CreatePreambleOnFirstParse = 256; + + /// Do not stop processing when fatal errors are encountered. + static const int CXTranslationUnit_KeepGoing = 512; + + /// Sets the preprocessor in a mode for parsing a single file only. + static const int CXTranslationUnit_SingleFileParse = 1024; + + /// Used in combination with CXTranslationUnit_SkipFunctionBodies to constrain + /// the skipping of function bodies to the preamble. + static const int CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048; + + /// Used to indicate that attributed types should be included in CXType. + static const int CXTranslationUnit_IncludeAttributedTypes = 4096; + + /// Used to indicate that implicit attributes should be visited. + static const int CXTranslationUnit_VisitImplicitAttributes = 8192; + + /// Used to indicate that non-errors from included files should be ignored. + static const int CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384; + + /// Tells the preprocessor not to skip excluded conditional blocks. + static const int CXTranslationUnit_RetainExcludedConditionalBlocks = 32768; +} + +/// Flags that control how translation units are saved. +abstract class CXSaveTranslationUnit_Flags { + /// Used to indicate that no special saving options are needed. + static const int CXSaveTranslationUnit_None = 0; +} + +/// Describes the kind of error that occurred (if any) in a call to +/// clang_saveTranslationUnit(). +abstract class CXSaveError { + /// Indicates that no error occurred while saving a translation unit. + static const int CXSaveError_None = 0; + + /// Indicates that an unknown error occurred while attempting to save the + /// file. + static const int CXSaveError_Unknown = 1; + + /// Indicates that errors during translation prevented this attempt to save + /// the translation unit. + static const int CXSaveError_TranslationErrors = 2; + + /// Indicates that the translation unit to be saved was somehow invalid (e.g., + /// NULL). + static const int CXSaveError_InvalidTU = 3; +} + +/// Flags that control the reparsing of translation units. +abstract class CXReparse_Flags { + /// Used to indicate that no special reparsing options are needed. + static const int CXReparse_None = 0; +} + +/// Categorizes how memory is being used by a translation unit. +abstract class CXTUResourceUsageKind { + static const int CXTUResourceUsage_AST = 1; + static const int CXTUResourceUsage_Identifiers = 2; + static const int CXTUResourceUsage_Selectors = 3; + static const int CXTUResourceUsage_GlobalCompletionResults = 4; + static const int CXTUResourceUsage_SourceManagerContentCache = 5; + static const int CXTUResourceUsage_AST_SideTables = 6; + static const int CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7; + static const int CXTUResourceUsage_SourceManager_Membuffer_MMap = 8; + static const int CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9; + static const int CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10; + static const int CXTUResourceUsage_Preprocessor = 11; + static const int CXTUResourceUsage_PreprocessingRecord = 12; + static const int CXTUResourceUsage_SourceManager_DataStructures = 13; + static const int CXTUResourceUsage_Preprocessor_HeaderSearch = 14; + static const int CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = 1; + static const int CXTUResourceUsage_MEMORY_IN_BYTES_END = 14; + static const int CXTUResourceUsage_First = 1; + static const int CXTUResourceUsage_Last = 14; +} + +class CXTUResourceUsageEntry extends ffi.Struct { + @ffi.Int32() + external int kind; + + @ffi.Uint64() + external int amount; +} + +/// The memory usage of a CXTranslationUnit, broken into categories. +class CXTUResourceUsage extends ffi.Struct { + external ffi.Pointer data; + + @ffi.Uint32() + external int numEntries; + + external ffi.Pointer entries; +} + +/// Describes the kind of entity that a cursor refers to. +abstract class CXCursorKind { + /// A declaration whose specific kind is not exposed via this interface. + static const int CXCursor_UnexposedDecl = 1; + + /// A C or C++ struct. + static const int CXCursor_StructDecl = 2; + + /// A C or C++ union. + static const int CXCursor_UnionDecl = 3; + + /// A C++ class. + static const int CXCursor_ClassDecl = 4; + + /// An enumeration. + static const int CXCursor_EnumDecl = 5; + + /// A field (in C) or non-static data member (in C++) in a struct, union, or + /// C++ class. + static const int CXCursor_FieldDecl = 6; + + /// An enumerator constant. + static const int CXCursor_EnumConstantDecl = 7; + + /// A function. + static const int CXCursor_FunctionDecl = 8; + + /// A variable. + static const int CXCursor_VarDecl = 9; + + /// A function or method parameter. + static const int CXCursor_ParmDecl = 10; + + /// An Objective-C @interface. + static const int CXCursor_ObjCInterfaceDecl = 11; + + /// An Objective-C @interface for a category. + static const int CXCursor_ObjCCategoryDecl = 12; + + /// An Objective-C @protocol declaration. + static const int CXCursor_ObjCProtocolDecl = 13; + + /// An Objective-C @property declaration. + static const int CXCursor_ObjCPropertyDecl = 14; + + /// An Objective-C instance variable. + static const int CXCursor_ObjCIvarDecl = 15; + + /// An Objective-C instance method. + static const int CXCursor_ObjCInstanceMethodDecl = 16; + + /// An Objective-C class method. + static const int CXCursor_ObjCClassMethodDecl = 17; + + /// An Objective-C @implementation. + static const int CXCursor_ObjCImplementationDecl = 18; + + /// An Objective-C @implementation for a category. + static const int CXCursor_ObjCCategoryImplDecl = 19; + + /// A typedef. + static const int CXCursor_TypedefDecl = 20; + + /// A C++ class method. + static const int CXCursor_CXXMethod = 21; + + /// A C++ namespace. + static const int CXCursor_Namespace = 22; + + /// A linkage specification, e.g. 'extern "C"'. + static const int CXCursor_LinkageSpec = 23; + + /// A C++ constructor. + static const int CXCursor_Constructor = 24; + + /// A C++ destructor. + static const int CXCursor_Destructor = 25; + + /// A C++ conversion function. + static const int CXCursor_ConversionFunction = 26; + + /// A C++ template type parameter. + static const int CXCursor_TemplateTypeParameter = 27; + + /// A C++ non-type template parameter. + static const int CXCursor_NonTypeTemplateParameter = 28; + + /// A C++ template template parameter. + static const int CXCursor_TemplateTemplateParameter = 29; + + /// A C++ function template. + static const int CXCursor_FunctionTemplate = 30; + + /// A C++ class template. + static const int CXCursor_ClassTemplate = 31; + + /// A C++ class template partial specialization. + static const int CXCursor_ClassTemplatePartialSpecialization = 32; + + /// A C++ namespace alias declaration. + static const int CXCursor_NamespaceAlias = 33; + + /// A C++ using directive. + static const int CXCursor_UsingDirective = 34; + + /// A C++ using declaration. + static const int CXCursor_UsingDeclaration = 35; + + /// A C++ alias declaration + static const int CXCursor_TypeAliasDecl = 36; + + /// An Objective-C @synthesize definition. + static const int CXCursor_ObjCSynthesizeDecl = 37; + + /// An Objective-C @dynamic definition. + static const int CXCursor_ObjCDynamicDecl = 38; + + /// An access specifier. + static const int CXCursor_CXXAccessSpecifier = 39; + static const int CXCursor_FirstDecl = 1; + static const int CXCursor_LastDecl = 39; + static const int CXCursor_FirstRef = 40; + static const int CXCursor_ObjCSuperClassRef = 40; + static const int CXCursor_ObjCProtocolRef = 41; + static const int CXCursor_ObjCClassRef = 42; + + /// A reference to a type declaration. + static const int CXCursor_TypeRef = 43; + static const int CXCursor_CXXBaseSpecifier = 44; + + /// A reference to a class template, function template, template template + /// parameter, or class template partial specialization. + static const int CXCursor_TemplateRef = 45; + + /// A reference to a namespace or namespace alias. + static const int CXCursor_NamespaceRef = 46; + + /// A reference to a member of a struct, union, or class that occurs in some + /// non-expression context, e.g., a designated initializer. + static const int CXCursor_MemberRef = 47; + + /// A reference to a labeled statement. + static const int CXCursor_LabelRef = 48; + + /// A reference to a set of overloaded functions or function templates that + /// has not yet been resolved to a specific function or function template. + static const int CXCursor_OverloadedDeclRef = 49; + + /// A reference to a variable that occurs in some non-expression context, + /// e.g., a C++ lambda capture list. + static const int CXCursor_VariableRef = 50; + static const int CXCursor_LastRef = 50; + static const int CXCursor_FirstInvalid = 70; + static const int CXCursor_InvalidFile = 70; + static const int CXCursor_NoDeclFound = 71; + static const int CXCursor_NotImplemented = 72; + static const int CXCursor_InvalidCode = 73; + static const int CXCursor_LastInvalid = 73; + static const int CXCursor_FirstExpr = 100; + + /// An expression whose specific kind is not exposed via this interface. + static const int CXCursor_UnexposedExpr = 100; + + /// An expression that refers to some value declaration, such as a function, + /// variable, or enumerator. + static const int CXCursor_DeclRefExpr = 101; + + /// An expression that refers to a member of a struct, union, class, + /// Objective-C class, etc. + static const int CXCursor_MemberRefExpr = 102; + + /// An expression that calls a function. + static const int CXCursor_CallExpr = 103; + + /// An expression that sends a message to an Objective-C object or class. + static const int CXCursor_ObjCMessageExpr = 104; + + /// An expression that represents a block literal. + static const int CXCursor_BlockExpr = 105; + + /// An integer literal. + static const int CXCursor_IntegerLiteral = 106; + + /// A floating point number literal. + static const int CXCursor_FloatingLiteral = 107; + + /// An imaginary number literal. + static const int CXCursor_ImaginaryLiteral = 108; + + /// A string literal. + static const int CXCursor_StringLiteral = 109; + + /// A character literal. + static const int CXCursor_CharacterLiteral = 110; + + /// A parenthesized expression, e.g. "(1)". + static const int CXCursor_ParenExpr = 111; + + /// This represents the unary-expression's (except sizeof and alignof). + static const int CXCursor_UnaryOperator = 112; + + /// [C99 6.5.2.1] Array Subscripting. + static const int CXCursor_ArraySubscriptExpr = 113; + + /// A builtin binary operation expression such as "x + y" or "x <= y". + static const int CXCursor_BinaryOperator = 114; + + /// Compound assignment such as "+=". + static const int CXCursor_CompoundAssignOperator = 115; + + /// The ?: ternary operator. + static const int CXCursor_ConditionalOperator = 116; + + /// An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ + /// [expr.cast]), which uses the syntax (Type)expr. + static const int CXCursor_CStyleCastExpr = 117; + + /// [C99 6.5.2.5] + static const int CXCursor_CompoundLiteralExpr = 118; + + /// Describes an C or C++ initializer list. + static const int CXCursor_InitListExpr = 119; + + /// The GNU address of label extension, representing &&label. + static const int CXCursor_AddrLabelExpr = 120; + + /// This is the GNU Statement Expression extension: ({int X=4; X;}) + static const int CXCursor_StmtExpr = 121; + + /// Represents a C11 generic selection. + static const int CXCursor_GenericSelectionExpr = 122; + + /// Implements the GNU __null extension, which is a name for a null pointer + /// constant that has integral type (e.g., int or long) and is the same size + /// and alignment as a pointer. + static const int CXCursor_GNUNullExpr = 123; + + /// C++'s static_cast<> expression. + static const int CXCursor_CXXStaticCastExpr = 124; + + /// C++'s dynamic_cast<> expression. + static const int CXCursor_CXXDynamicCastExpr = 125; + + /// C++'s reinterpret_cast<> expression. + static const int CXCursor_CXXReinterpretCastExpr = 126; + + /// C++'s const_cast<> expression. + static const int CXCursor_CXXConstCastExpr = 127; + + /// Represents an explicit C++ type conversion that uses "functional" notion + /// (C++ [expr.type.conv]). + static const int CXCursor_CXXFunctionalCastExpr = 128; + + /// A C++ typeid expression (C++ [expr.typeid]). + static const int CXCursor_CXXTypeidExpr = 129; + + /// [C++ 2.13.5] C++ Boolean Literal. + static const int CXCursor_CXXBoolLiteralExpr = 130; + + /// [C++0x 2.14.7] C++ Pointer Literal. + static const int CXCursor_CXXNullPtrLiteralExpr = 131; + + /// Represents the "this" expression in C++ + static const int CXCursor_CXXThisExpr = 132; + + /// [C++ 15] C++ Throw Expression. + static const int CXCursor_CXXThrowExpr = 133; + + /// A new expression for memory allocation and constructor calls, e.g: "new + /// CXXNewExpr(foo)". + static const int CXCursor_CXXNewExpr = 134; + + /// A delete expression for memory deallocation and destructor calls, e.g. + /// "delete[] pArray". + static const int CXCursor_CXXDeleteExpr = 135; + + /// A unary expression. (noexcept, sizeof, or other traits) + static const int CXCursor_UnaryExpr = 136; + + /// An Objective-C string literal i.e. "foo". + static const int CXCursor_ObjCStringLiteral = 137; + + /// An Objective-C @encode expression. + static const int CXCursor_ObjCEncodeExpr = 138; + + /// An Objective-C @selector expression. + static const int CXCursor_ObjCSelectorExpr = 139; + + /// An Objective-C @protocol expression. + static const int CXCursor_ObjCProtocolExpr = 140; + + /// An Objective-C "bridged" cast expression, which casts between Objective-C + /// pointers and C pointers, transferring ownership in the process. + static const int CXCursor_ObjCBridgedCastExpr = 141; + + /// Represents a C++0x pack expansion that produces a sequence of expressions. + static const int CXCursor_PackExpansionExpr = 142; + + /// Represents an expression that computes the length of a parameter pack. + static const int CXCursor_SizeOfPackExpr = 143; + static const int CXCursor_LambdaExpr = 144; + + /// Objective-c Boolean Literal. + static const int CXCursor_ObjCBoolLiteralExpr = 145; + + /// Represents the "self" expression in an Objective-C method. + static const int CXCursor_ObjCSelfExpr = 146; + + /// OpenMP 4.0 [2.4, Array Section]. + static const int CXCursor_OMPArraySectionExpr = 147; + + /// Represents an (...) check. + static const int CXCursor_ObjCAvailabilityCheckExpr = 148; + + /// Fixed point literal + static const int CXCursor_FixedPointLiteral = 149; + static const int CXCursor_LastExpr = 149; + static const int CXCursor_FirstStmt = 200; + + /// A statement whose specific kind is not exposed via this interface. + static const int CXCursor_UnexposedStmt = 200; + + /// A labelled statement in a function. + static const int CXCursor_LabelStmt = 201; + + /// A group of statements like { stmt stmt }. + static const int CXCursor_CompoundStmt = 202; + + /// A case statement. + static const int CXCursor_CaseStmt = 203; + + /// A default statement. + static const int CXCursor_DefaultStmt = 204; + + /// An if statement + static const int CXCursor_IfStmt = 205; + + /// A switch statement. + static const int CXCursor_SwitchStmt = 206; + + /// A while statement. + static const int CXCursor_WhileStmt = 207; + + /// A do statement. + static const int CXCursor_DoStmt = 208; + + /// A for statement. + static const int CXCursor_ForStmt = 209; + + /// A goto statement. + static const int CXCursor_GotoStmt = 210; + + /// An indirect goto statement. + static const int CXCursor_IndirectGotoStmt = 211; + + /// A continue statement. + static const int CXCursor_ContinueStmt = 212; + + /// A break statement. + static const int CXCursor_BreakStmt = 213; + + /// A return statement. + static const int CXCursor_ReturnStmt = 214; + + /// A GCC inline assembly statement extension. + static const int CXCursor_GCCAsmStmt = 215; + static const int CXCursor_AsmStmt = 215; + + /// Objective-C's overall @try-@catch-@finally statement. + static const int CXCursor_ObjCAtTryStmt = 216; + + /// Objective-C's @catch statement. + static const int CXCursor_ObjCAtCatchStmt = 217; + + /// Objective-C's @finally statement. + static const int CXCursor_ObjCAtFinallyStmt = 218; + + /// Objective-C's @throw statement. + static const int CXCursor_ObjCAtThrowStmt = 219; + + /// Objective-C's @synchronized statement. + static const int CXCursor_ObjCAtSynchronizedStmt = 220; + + /// Objective-C's autorelease pool statement. + static const int CXCursor_ObjCAutoreleasePoolStmt = 221; + + /// Objective-C's collection statement. + static const int CXCursor_ObjCForCollectionStmt = 222; + + /// C++'s catch statement. + static const int CXCursor_CXXCatchStmt = 223; + + /// C++'s try statement. + static const int CXCursor_CXXTryStmt = 224; + + /// C++'s for (* : *) statement. + static const int CXCursor_CXXForRangeStmt = 225; + + /// Windows Structured Exception Handling's try statement. + static const int CXCursor_SEHTryStmt = 226; + + /// Windows Structured Exception Handling's except statement. + static const int CXCursor_SEHExceptStmt = 227; + + /// Windows Structured Exception Handling's finally statement. + static const int CXCursor_SEHFinallyStmt = 228; + + /// A MS inline assembly statement extension. + static const int CXCursor_MSAsmStmt = 229; + + /// The null statement ";": C99 6.8.3p3. + static const int CXCursor_NullStmt = 230; + + /// Adaptor class for mixing declarations with statements and expressions. + static const int CXCursor_DeclStmt = 231; + + /// OpenMP parallel directive. + static const int CXCursor_OMPParallelDirective = 232; + + /// OpenMP SIMD directive. + static const int CXCursor_OMPSimdDirective = 233; + + /// OpenMP for directive. + static const int CXCursor_OMPForDirective = 234; + + /// OpenMP sections directive. + static const int CXCursor_OMPSectionsDirective = 235; + + /// OpenMP section directive. + static const int CXCursor_OMPSectionDirective = 236; + + /// OpenMP single directive. + static const int CXCursor_OMPSingleDirective = 237; + + /// OpenMP parallel for directive. + static const int CXCursor_OMPParallelForDirective = 238; + + /// OpenMP parallel sections directive. + static const int CXCursor_OMPParallelSectionsDirective = 239; + + /// OpenMP task directive. + static const int CXCursor_OMPTaskDirective = 240; + + /// OpenMP master directive. + static const int CXCursor_OMPMasterDirective = 241; + + /// OpenMP critical directive. + static const int CXCursor_OMPCriticalDirective = 242; + + /// OpenMP taskyield directive. + static const int CXCursor_OMPTaskyieldDirective = 243; + + /// OpenMP barrier directive. + static const int CXCursor_OMPBarrierDirective = 244; + + /// OpenMP taskwait directive. + static const int CXCursor_OMPTaskwaitDirective = 245; + + /// OpenMP flush directive. + static const int CXCursor_OMPFlushDirective = 246; + + /// Windows Structured Exception Handling's leave statement. + static const int CXCursor_SEHLeaveStmt = 247; + + /// OpenMP ordered directive. + static const int CXCursor_OMPOrderedDirective = 248; + + /// OpenMP atomic directive. + static const int CXCursor_OMPAtomicDirective = 249; + + /// OpenMP for SIMD directive. + static const int CXCursor_OMPForSimdDirective = 250; + + /// OpenMP parallel for SIMD directive. + static const int CXCursor_OMPParallelForSimdDirective = 251; + + /// OpenMP target directive. + static const int CXCursor_OMPTargetDirective = 252; + + /// OpenMP teams directive. + static const int CXCursor_OMPTeamsDirective = 253; + + /// OpenMP taskgroup directive. + static const int CXCursor_OMPTaskgroupDirective = 254; + + /// OpenMP cancellation point directive. + static const int CXCursor_OMPCancellationPointDirective = 255; + + /// OpenMP cancel directive. + static const int CXCursor_OMPCancelDirective = 256; + + /// OpenMP target data directive. + static const int CXCursor_OMPTargetDataDirective = 257; + + /// OpenMP taskloop directive. + static const int CXCursor_OMPTaskLoopDirective = 258; + + /// OpenMP taskloop simd directive. + static const int CXCursor_OMPTaskLoopSimdDirective = 259; + + /// OpenMP distribute directive. + static const int CXCursor_OMPDistributeDirective = 260; + + /// OpenMP target enter data directive. + static const int CXCursor_OMPTargetEnterDataDirective = 261; + + /// OpenMP target exit data directive. + static const int CXCursor_OMPTargetExitDataDirective = 262; + + /// OpenMP target parallel directive. + static const int CXCursor_OMPTargetParallelDirective = 263; + + /// OpenMP target parallel for directive. + static const int CXCursor_OMPTargetParallelForDirective = 264; + + /// OpenMP target update directive. + static const int CXCursor_OMPTargetUpdateDirective = 265; + + /// OpenMP distribute parallel for directive. + static const int CXCursor_OMPDistributeParallelForDirective = 266; + + /// OpenMP distribute parallel for simd directive. + static const int CXCursor_OMPDistributeParallelForSimdDirective = 267; + + /// OpenMP distribute simd directive. + static const int CXCursor_OMPDistributeSimdDirective = 268; + + /// OpenMP target parallel for simd directive. + static const int CXCursor_OMPTargetParallelForSimdDirective = 269; + + /// OpenMP target simd directive. + static const int CXCursor_OMPTargetSimdDirective = 270; + + /// OpenMP teams distribute directive. + static const int CXCursor_OMPTeamsDistributeDirective = 271; + + /// OpenMP teams distribute simd directive. + static const int CXCursor_OMPTeamsDistributeSimdDirective = 272; + + /// OpenMP teams distribute parallel for simd directive. + static const int CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273; + + /// OpenMP teams distribute parallel for directive. + static const int CXCursor_OMPTeamsDistributeParallelForDirective = 274; + + /// OpenMP target teams directive. + static const int CXCursor_OMPTargetTeamsDirective = 275; + + /// OpenMP target teams distribute directive. + static const int CXCursor_OMPTargetTeamsDistributeDirective = 276; + + /// OpenMP target teams distribute parallel for directive. + static const int CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277; + + /// OpenMP target teams distribute parallel for simd directive. + static const int CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = + 278; + + /// OpenMP target teams distribute simd directive. + static const int CXCursor_OMPTargetTeamsDistributeSimdDirective = 279; + + /// C++2a std::bit_cast expression. + static const int CXCursor_BuiltinBitCastExpr = 280; + + /// OpenMP master taskloop directive. + static const int CXCursor_OMPMasterTaskLoopDirective = 281; + + /// OpenMP parallel master taskloop directive. + static const int CXCursor_OMPParallelMasterTaskLoopDirective = 282; /// OpenMP master taskloop simd directive. static const int CXCursor_OMPMasterTaskLoopSimdDirective = 283; - /// OpenMP parallel master taskloop simd directive. - static const int CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284; + /// OpenMP parallel master taskloop simd directive. + static const int CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284; + + /// OpenMP parallel master directive. + static const int CXCursor_OMPParallelMasterDirective = 285; + static const int CXCursor_LastStmt = 285; + + /// Cursor that represents the translation unit itself. + static const int CXCursor_TranslationUnit = 300; + static const int CXCursor_FirstAttr = 400; + + /// An attribute whose specific kind is not exposed via this interface. + static const int CXCursor_UnexposedAttr = 400; + static const int CXCursor_IBActionAttr = 401; + static const int CXCursor_IBOutletAttr = 402; + static const int CXCursor_IBOutletCollectionAttr = 403; + static const int CXCursor_CXXFinalAttr = 404; + static const int CXCursor_CXXOverrideAttr = 405; + static const int CXCursor_AnnotateAttr = 406; + static const int CXCursor_AsmLabelAttr = 407; + static const int CXCursor_PackedAttr = 408; + static const int CXCursor_PureAttr = 409; + static const int CXCursor_ConstAttr = 410; + static const int CXCursor_NoDuplicateAttr = 411; + static const int CXCursor_CUDAConstantAttr = 412; + static const int CXCursor_CUDADeviceAttr = 413; + static const int CXCursor_CUDAGlobalAttr = 414; + static const int CXCursor_CUDAHostAttr = 415; + static const int CXCursor_CUDASharedAttr = 416; + static const int CXCursor_VisibilityAttr = 417; + static const int CXCursor_DLLExport = 418; + static const int CXCursor_DLLImport = 419; + static const int CXCursor_NSReturnsRetained = 420; + static const int CXCursor_NSReturnsNotRetained = 421; + static const int CXCursor_NSReturnsAutoreleased = 422; + static const int CXCursor_NSConsumesSelf = 423; + static const int CXCursor_NSConsumed = 424; + static const int CXCursor_ObjCException = 425; + static const int CXCursor_ObjCNSObject = 426; + static const int CXCursor_ObjCIndependentClass = 427; + static const int CXCursor_ObjCPreciseLifetime = 428; + static const int CXCursor_ObjCReturnsInnerPointer = 429; + static const int CXCursor_ObjCRequiresSuper = 430; + static const int CXCursor_ObjCRootClass = 431; + static const int CXCursor_ObjCSubclassingRestricted = 432; + static const int CXCursor_ObjCExplicitProtocolImpl = 433; + static const int CXCursor_ObjCDesignatedInitializer = 434; + static const int CXCursor_ObjCRuntimeVisible = 435; + static const int CXCursor_ObjCBoxable = 436; + static const int CXCursor_FlagEnum = 437; + static const int CXCursor_ConvergentAttr = 438; + static const int CXCursor_WarnUnusedAttr = 439; + static const int CXCursor_WarnUnusedResultAttr = 440; + static const int CXCursor_AlignedAttr = 441; + static const int CXCursor_LastAttr = 441; + static const int CXCursor_PreprocessingDirective = 500; + static const int CXCursor_MacroDefinition = 501; + static const int CXCursor_MacroExpansion = 502; + static const int CXCursor_MacroInstantiation = 502; + static const int CXCursor_InclusionDirective = 503; + static const int CXCursor_FirstPreprocessing = 500; + static const int CXCursor_LastPreprocessing = 503; + + /// A module import declaration. + static const int CXCursor_ModuleImportDecl = 600; + static const int CXCursor_TypeAliasTemplateDecl = 601; + + /// A static_assert or _Static_assert node + static const int CXCursor_StaticAssert = 602; + + /// a friend declaration. + static const int CXCursor_FriendDecl = 603; + static const int CXCursor_FirstExtraDecl = 600; + static const int CXCursor_LastExtraDecl = 603; + + /// A code completion overload candidate. + static const int CXCursor_OverloadCandidate = 700; +} + +/// A cursor representing some element in the abstract syntax tree for a +/// translation unit. +class CXCursor extends ffi.Struct { + @ffi.Int32() + external int kind; + + @ffi.Int32() + external int xdata; + + external ffi.Pointer _unique_data_item_0; + external ffi.Pointer _unique_data_item_1; + external ffi.Pointer _unique_data_item_2; + + /// Helper for array `data`. + ArrayHelper_CXCursor_data_level0 get data => + ArrayHelper_CXCursor_data_level0(this, [3], 0, 0); +} + +/// Helper for array `data` in struct `CXCursor`. +class ArrayHelper_CXCursor_data_level0 { + final CXCursor _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXCursor_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_data_item_0; + case 1: + return _struct._unique_data_item_1; + case 2: + return _struct._unique_data_item_2; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_data_item_0 = value; + break; + case 1: + _struct._unique_data_item_1 = value; + break; + case 2: + _struct._unique_data_item_2 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Describe the linkage of the entity referred to by a cursor. +abstract class CXLinkageKind { + /// This value indicates that no linkage information is available for a + /// provided CXCursor. + static const int CXLinkage_Invalid = 0; + + /// This is the linkage for variables, parameters, and so on that have + /// automatic storage. This covers normal (non-extern) local variables. + static const int CXLinkage_NoLinkage = 1; + + /// This is the linkage for static variables and static functions. + static const int CXLinkage_Internal = 2; + + /// This is the linkage for entities with external linkage that live in C++ + /// anonymous namespaces. + static const int CXLinkage_UniqueExternal = 3; + + /// This is the linkage for entities with true, external linkage. + static const int CXLinkage_External = 4; +} + +abstract class CXVisibilityKind { + /// This value indicates that no visibility information is available for a + /// provided CXCursor. + static const int CXVisibility_Invalid = 0; + + /// Symbol not seen by the linker. + static const int CXVisibility_Hidden = 1; + + /// Symbol seen by the linker but resolves to a symbol inside this object. + static const int CXVisibility_Protected = 2; + + /// Symbol seen by the linker and acts like a normal symbol. + static const int CXVisibility_Default = 3; +} + +/// Describes the availability of a given entity on a particular platform, e.g., +/// a particular class might only be available on Mac OS 10.7 or newer. +class CXPlatformAvailability extends ffi.Struct { + /// A string that describes the platform for which this structure provides + /// availability information. + external CXString Platform; + + /// The version number in which this entity was introduced. + external CXVersion Introduced; + + /// The version number in which this entity was deprecated (but is still + /// available). + external CXVersion Deprecated; + + /// The version number in which this entity was obsoleted, and therefore is no + /// longer available. + external CXVersion Obsoleted; + + /// Whether the entity is unconditionally unavailable on this platform. + @ffi.Int32() + external int Unavailable; + + /// An optional message to provide to a user of this API, e.g., to suggest + /// replacement APIs. + external CXString Message; +} + +/// Describe the "language" of the entity referred to by a cursor. +abstract class CXLanguageKind { + static const int CXLanguage_Invalid = 0; + static const int CXLanguage_C = 1; + static const int CXLanguage_ObjC = 2; + static const int CXLanguage_CPlusPlus = 3; +} + +/// Describe the "thread-local storage (TLS) kind" of the declaration referred +/// to by a cursor. +abstract class CXTLSKind { + static const int CXTLS_None = 0; + static const int CXTLS_Dynamic = 1; + static const int CXTLS_Static = 2; +} + +class CXCursorSetImpl extends ffi.Struct {} + +/// Describes the kind of type +abstract class CXTypeKind { + /// Represents an invalid type (e.g., where no type is available). + static const int CXType_Invalid = 0; + + /// A type whose specific kind is not exposed via this interface. + static const int CXType_Unexposed = 1; + static const int CXType_Void = 2; + static const int CXType_Bool = 3; + static const int CXType_Char_U = 4; + static const int CXType_UChar = 5; + static const int CXType_Char16 = 6; + static const int CXType_Char32 = 7; + static const int CXType_UShort = 8; + static const int CXType_UInt = 9; + static const int CXType_ULong = 10; + static const int CXType_ULongLong = 11; + static const int CXType_UInt128 = 12; + static const int CXType_Char_S = 13; + static const int CXType_SChar = 14; + static const int CXType_WChar = 15; + static const int CXType_Short = 16; + static const int CXType_Int = 17; + static const int CXType_Long = 18; + static const int CXType_LongLong = 19; + static const int CXType_Int128 = 20; + static const int CXType_Float = 21; + static const int CXType_Double = 22; + static const int CXType_LongDouble = 23; + static const int CXType_NullPtr = 24; + static const int CXType_Overload = 25; + static const int CXType_Dependent = 26; + static const int CXType_ObjCId = 27; + static const int CXType_ObjCClass = 28; + static const int CXType_ObjCSel = 29; + static const int CXType_Float128 = 30; + static const int CXType_Half = 31; + static const int CXType_Float16 = 32; + static const int CXType_ShortAccum = 33; + static const int CXType_Accum = 34; + static const int CXType_LongAccum = 35; + static const int CXType_UShortAccum = 36; + static const int CXType_UAccum = 37; + static const int CXType_ULongAccum = 38; + static const int CXType_FirstBuiltin = 2; + static const int CXType_LastBuiltin = 38; + static const int CXType_Complex = 100; + static const int CXType_Pointer = 101; + static const int CXType_BlockPointer = 102; + static const int CXType_LValueReference = 103; + static const int CXType_RValueReference = 104; + static const int CXType_Record = 105; + static const int CXType_Enum = 106; + static const int CXType_Typedef = 107; + static const int CXType_ObjCInterface = 108; + static const int CXType_ObjCObjectPointer = 109; + static const int CXType_FunctionNoProto = 110; + static const int CXType_FunctionProto = 111; + static const int CXType_ConstantArray = 112; + static const int CXType_Vector = 113; + static const int CXType_IncompleteArray = 114; + static const int CXType_VariableArray = 115; + static const int CXType_DependentSizedArray = 116; + static const int CXType_MemberPointer = 117; + static const int CXType_Auto = 118; + + /// Represents a type that was referred to using an elaborated type keyword. + static const int CXType_Elaborated = 119; + static const int CXType_Pipe = 120; + static const int CXType_OCLImage1dRO = 121; + static const int CXType_OCLImage1dArrayRO = 122; + static const int CXType_OCLImage1dBufferRO = 123; + static const int CXType_OCLImage2dRO = 124; + static const int CXType_OCLImage2dArrayRO = 125; + static const int CXType_OCLImage2dDepthRO = 126; + static const int CXType_OCLImage2dArrayDepthRO = 127; + static const int CXType_OCLImage2dMSAARO = 128; + static const int CXType_OCLImage2dArrayMSAARO = 129; + static const int CXType_OCLImage2dMSAADepthRO = 130; + static const int CXType_OCLImage2dArrayMSAADepthRO = 131; + static const int CXType_OCLImage3dRO = 132; + static const int CXType_OCLImage1dWO = 133; + static const int CXType_OCLImage1dArrayWO = 134; + static const int CXType_OCLImage1dBufferWO = 135; + static const int CXType_OCLImage2dWO = 136; + static const int CXType_OCLImage2dArrayWO = 137; + static const int CXType_OCLImage2dDepthWO = 138; + static const int CXType_OCLImage2dArrayDepthWO = 139; + static const int CXType_OCLImage2dMSAAWO = 140; + static const int CXType_OCLImage2dArrayMSAAWO = 141; + static const int CXType_OCLImage2dMSAADepthWO = 142; + static const int CXType_OCLImage2dArrayMSAADepthWO = 143; + static const int CXType_OCLImage3dWO = 144; + static const int CXType_OCLImage1dRW = 145; + static const int CXType_OCLImage1dArrayRW = 146; + static const int CXType_OCLImage1dBufferRW = 147; + static const int CXType_OCLImage2dRW = 148; + static const int CXType_OCLImage2dArrayRW = 149; + static const int CXType_OCLImage2dDepthRW = 150; + static const int CXType_OCLImage2dArrayDepthRW = 151; + static const int CXType_OCLImage2dMSAARW = 152; + static const int CXType_OCLImage2dArrayMSAARW = 153; + static const int CXType_OCLImage2dMSAADepthRW = 154; + static const int CXType_OCLImage2dArrayMSAADepthRW = 155; + static const int CXType_OCLImage3dRW = 156; + static const int CXType_OCLSampler = 157; + static const int CXType_OCLEvent = 158; + static const int CXType_OCLQueue = 159; + static const int CXType_OCLReserveID = 160; + static const int CXType_ObjCObject = 161; + static const int CXType_ObjCTypeParam = 162; + static const int CXType_Attributed = 163; + static const int CXType_OCLIntelSubgroupAVCMcePayload = 164; + static const int CXType_OCLIntelSubgroupAVCImePayload = 165; + static const int CXType_OCLIntelSubgroupAVCRefPayload = 166; + static const int CXType_OCLIntelSubgroupAVCSicPayload = 167; + static const int CXType_OCLIntelSubgroupAVCMceResult = 168; + static const int CXType_OCLIntelSubgroupAVCImeResult = 169; + static const int CXType_OCLIntelSubgroupAVCRefResult = 170; + static const int CXType_OCLIntelSubgroupAVCSicResult = 171; + static const int CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172; + static const int CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173; + static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; + static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; + static const int CXType_ExtVector = 176; +} + +/// Describes the calling convention of a function type +abstract class CXCallingConv { + static const int CXCallingConv_Default = 0; + static const int CXCallingConv_C = 1; + static const int CXCallingConv_X86StdCall = 2; + static const int CXCallingConv_X86FastCall = 3; + static const int CXCallingConv_X86ThisCall = 4; + static const int CXCallingConv_X86Pascal = 5; + static const int CXCallingConv_AAPCS = 6; + static const int CXCallingConv_AAPCS_VFP = 7; + static const int CXCallingConv_X86RegCall = 8; + static const int CXCallingConv_IntelOclBicc = 9; + static const int CXCallingConv_Win64 = 10; + static const int CXCallingConv_X86_64Win64 = 10; + static const int CXCallingConv_X86_64SysV = 11; + static const int CXCallingConv_X86VectorCall = 12; + static const int CXCallingConv_Swift = 13; + static const int CXCallingConv_PreserveMost = 14; + static const int CXCallingConv_PreserveAll = 15; + static const int CXCallingConv_AArch64VectorCall = 16; + static const int CXCallingConv_Invalid = 100; + static const int CXCallingConv_Unexposed = 200; +} + +/// The type of an element in the abstract syntax tree. +class CXType extends ffi.Struct { + @ffi.Int32() + external int kind; + + external ffi.Pointer _unique_data_item_0; + external ffi.Pointer _unique_data_item_1; + + /// Helper for array `data`. + ArrayHelper_CXType_data_level0 get data => + ArrayHelper_CXType_data_level0(this, [2], 0, 0); +} + +/// Helper for array `data` in struct `CXType`. +class ArrayHelper_CXType_data_level0 { + final CXType _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXType_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_data_item_0; + case 1: + return _struct._unique_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_data_item_0 = value; + break; + case 1: + _struct._unique_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Describes the kind of a template argument. +abstract class CXTemplateArgumentKind { + static const int CXTemplateArgumentKind_Null = 0; + static const int CXTemplateArgumentKind_Type = 1; + static const int CXTemplateArgumentKind_Declaration = 2; + static const int CXTemplateArgumentKind_NullPtr = 3; + static const int CXTemplateArgumentKind_Integral = 4; + static const int CXTemplateArgumentKind_Template = 5; + static const int CXTemplateArgumentKind_TemplateExpansion = 6; + static const int CXTemplateArgumentKind_Expression = 7; + static const int CXTemplateArgumentKind_Pack = 8; + static const int CXTemplateArgumentKind_Invalid = 9; +} + +abstract class CXTypeNullabilityKind { + /// Values of this type can never be null. + static const int CXTypeNullability_NonNull = 0; + + /// Values of this type can be null. + static const int CXTypeNullability_Nullable = 1; + + /// Whether values of this type can be null is (explicitly) unspecified. This + /// captures a (fairly rare) case where we can't conclude anything about the + /// nullability of the type even though it has been considered. + static const int CXTypeNullability_Unspecified = 2; + + /// Nullability is not applicable to this type. + static const int CXTypeNullability_Invalid = 3; +} + +/// List the possible error codes for clang_Type_getSizeOf, +/// clang_Type_getAlignOf, clang_Type_getOffsetOf and clang_Cursor_getOffsetOf. +abstract class CXTypeLayoutError { + /// Type is of kind CXType_Invalid. + static const int CXTypeLayoutError_Invalid = -1; + + /// The type is an incomplete Type. + static const int CXTypeLayoutError_Incomplete = -2; + + /// The type is a dependent Type. + static const int CXTypeLayoutError_Dependent = -3; + + /// The type is not a constant size type. + static const int CXTypeLayoutError_NotConstantSize = -4; + + /// The Field name is not valid for this record. + static const int CXTypeLayoutError_InvalidFieldName = -5; + + /// The type is undeduced. + static const int CXTypeLayoutError_Undeduced = -6; +} + +abstract class CXRefQualifierKind { + /// No ref-qualifier was provided. + static const int CXRefQualifier_None = 0; + + /// An lvalue ref-qualifier was provided ( &). + static const int CXRefQualifier_LValue = 1; + + /// An rvalue ref-qualifier was provided ( &&). + static const int CXRefQualifier_RValue = 2; +} + +/// Represents the C++ access control level to a base class for a cursor with +/// kind CX_CXXBaseSpecifier. +abstract class CX_CXXAccessSpecifier { + static const int CX_CXXInvalidAccessSpecifier = 0; + static const int CX_CXXPublic = 1; + static const int CX_CXXProtected = 2; + static const int CX_CXXPrivate = 3; +} + +/// Represents the storage classes as declared in the source. CX_SC_Invalid was +/// added for the case that the passed cursor in not a declaration. +abstract class CX_StorageClass { + static const int CX_SC_Invalid = 0; + static const int CX_SC_None = 1; + static const int CX_SC_Extern = 2; + static const int CX_SC_Static = 3; + static const int CX_SC_PrivateExtern = 4; + static const int CX_SC_OpenCLWorkGroupLocal = 5; + static const int CX_SC_Auto = 6; + static const int CX_SC_Register = 7; +} + +/// Describes how the traversal of the children of a particular cursor should +/// proceed after visiting a particular child cursor. +abstract class CXChildVisitResult { + /// Terminates the cursor traversal. + static const int CXChildVisit_Break = 0; + + /// Continues the cursor traversal with the next sibling of the cursor just + /// visited, without visiting its children. + static const int CXChildVisit_Continue = 1; + + /// Recursively traverse the children of this cursor, using the same visitor + /// and client data. + static const int CXChildVisit_Recurse = 2; +} + +/// Properties for the printing policy. +abstract class CXPrintingPolicyProperty { + static const int CXPrintingPolicy_Indentation = 0; + static const int CXPrintingPolicy_SuppressSpecifiers = 1; + static const int CXPrintingPolicy_SuppressTagKeyword = 2; + static const int CXPrintingPolicy_IncludeTagDefinition = 3; + static const int CXPrintingPolicy_SuppressScope = 4; + static const int CXPrintingPolicy_SuppressUnwrittenScope = 5; + static const int CXPrintingPolicy_SuppressInitializers = 6; + static const int CXPrintingPolicy_ConstantArraySizeAsWritten = 7; + static const int CXPrintingPolicy_AnonymousTagLocations = 8; + static const int CXPrintingPolicy_SuppressStrongLifetime = 9; + static const int CXPrintingPolicy_SuppressLifetimeQualifiers = 10; + static const int CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11; + static const int CXPrintingPolicy_Bool = 12; + static const int CXPrintingPolicy_Restrict = 13; + static const int CXPrintingPolicy_Alignof = 14; + static const int CXPrintingPolicy_UnderscoreAlignof = 15; + static const int CXPrintingPolicy_UseVoidForZeroParams = 16; + static const int CXPrintingPolicy_TerseOutput = 17; + static const int CXPrintingPolicy_PolishForDeclaration = 18; + static const int CXPrintingPolicy_Half = 19; + static const int CXPrintingPolicy_MSWChar = 20; + static const int CXPrintingPolicy_IncludeNewlines = 21; + static const int CXPrintingPolicy_MSVCFormatting = 22; + static const int CXPrintingPolicy_ConstantsAsWritten = 23; + static const int CXPrintingPolicy_SuppressImplicitBase = 24; + static const int CXPrintingPolicy_FullyQualifiedName = 25; + static const int CXPrintingPolicy_LastProperty = 25; +} + +/// Property attributes for a CXCursor_ObjCPropertyDecl. +abstract class CXObjCPropertyAttrKind { + static const int CXObjCPropertyAttr_noattr = 0; + static const int CXObjCPropertyAttr_readonly = 1; + static const int CXObjCPropertyAttr_getter = 2; + static const int CXObjCPropertyAttr_assign = 4; + static const int CXObjCPropertyAttr_readwrite = 8; + static const int CXObjCPropertyAttr_retain = 16; + static const int CXObjCPropertyAttr_copy = 32; + static const int CXObjCPropertyAttr_nonatomic = 64; + static const int CXObjCPropertyAttr_setter = 128; + static const int CXObjCPropertyAttr_atomic = 256; + static const int CXObjCPropertyAttr_weak = 512; + static const int CXObjCPropertyAttr_strong = 1024; + static const int CXObjCPropertyAttr_unsafe_unretained = 2048; + static const int CXObjCPropertyAttr_class = 4096; +} + +/// 'Qualifiers' written next to the return and parameter types in Objective-C +/// method declarations. +abstract class CXObjCDeclQualifierKind { + static const int CXObjCDeclQualifier_None = 0; + static const int CXObjCDeclQualifier_In = 1; + static const int CXObjCDeclQualifier_Inout = 2; + static const int CXObjCDeclQualifier_Out = 4; + static const int CXObjCDeclQualifier_Bycopy = 8; + static const int CXObjCDeclQualifier_Byref = 16; + static const int CXObjCDeclQualifier_Oneway = 32; +} + +abstract class CXNameRefFlags { + /// Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the range. + static const int CXNameRange_WantQualifier = 1; + + /// Include the explicit template arguments, e.g. in x.f, in the + /// range. + static const int CXNameRange_WantTemplateArgs = 2; + + /// If the name is non-contiguous, return the full spanning range. + static const int CXNameRange_WantSinglePiece = 4; +} + +/// Describes a kind of token. +abstract class CXTokenKind { + /// A token that contains some kind of punctuation. + static const int CXToken_Punctuation = 0; + + /// A language keyword. + static const int CXToken_Keyword = 1; + + /// An identifier (that is not a keyword). + static const int CXToken_Identifier = 2; + + /// A numeric, string, or character literal. + static const int CXToken_Literal = 3; + + /// A comment. + static const int CXToken_Comment = 4; +} + +/// Describes a single preprocessing token. +class CXToken extends ffi.Struct { + @ffi.Uint32() + external int _unique_int_data_item_0; + @ffi.Uint32() + external int _unique_int_data_item_1; + @ffi.Uint32() + external int _unique_int_data_item_2; + @ffi.Uint32() + external int _unique_int_data_item_3; + + /// Helper for array `int_data`. + ArrayHelper_CXToken_int_data_level0 get int_data => + ArrayHelper_CXToken_int_data_level0(this, [4], 0, 0); + external ffi.Pointer ptr_data; +} + +/// Helper for array `int_data` in struct `CXToken`. +class ArrayHelper_CXToken_int_data_level0 { + final CXToken _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXToken_int_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + int operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_int_data_item_0; + case 1: + return _struct._unique_int_data_item_1; + case 2: + return _struct._unique_int_data_item_2; + case 3: + return _struct._unique_int_data_item_3; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, int value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_int_data_item_0 = value; + break; + case 1: + _struct._unique_int_data_item_1 = value; + break; + case 2: + _struct._unique_int_data_item_2 = value; + break; + case 3: + _struct._unique_int_data_item_3 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// A single result of code completion. +class CXCompletionResult extends ffi.Struct { + /// The kind of entity that this completion refers to. + @ffi.Int32() + external int CursorKind; + + /// The code-completion string that describes how to insert this + /// code-completion result into the editing buffer. + external ffi.Pointer CompletionString; +} + +/// Describes a single piece of text within a code-completion string. +abstract class CXCompletionChunkKind { + /// A code-completion string that describes "optional" text that could be a + /// part of the template (but is not required). + static const int CXCompletionChunk_Optional = 0; + + /// Text that a user would be expected to type to get this code-completion + /// result. + static const int CXCompletionChunk_TypedText = 1; + + /// Text that should be inserted as part of a code-completion result. + static const int CXCompletionChunk_Text = 2; + + /// Placeholder text that should be replaced by the user. + static const int CXCompletionChunk_Placeholder = 3; + + /// Informative text that should be displayed but never inserted as part of + /// the template. + static const int CXCompletionChunk_Informative = 4; + + /// Text that describes the current parameter when code-completion is + /// referring to function call, message send, or template specialization. + static const int CXCompletionChunk_CurrentParameter = 5; + + /// A left parenthesis ('('), used to initiate a function call or signal the + /// beginning of a function parameter list. + static const int CXCompletionChunk_LeftParen = 6; + + /// A right parenthesis (')'), used to finish a function call or signal the + /// end of a function parameter list. + static const int CXCompletionChunk_RightParen = 7; + + /// A left bracket ('['). + static const int CXCompletionChunk_LeftBracket = 8; + + /// A right bracket (']'). + static const int CXCompletionChunk_RightBracket = 9; + + /// A left brace ('{'). + static const int CXCompletionChunk_LeftBrace = 10; + + /// A right brace ('}'). + static const int CXCompletionChunk_RightBrace = 11; + + /// A left angle bracket ('<'). + static const int CXCompletionChunk_LeftAngle = 12; + + /// A right angle bracket ('>'). + static const int CXCompletionChunk_RightAngle = 13; + + /// A comma separator (','). + static const int CXCompletionChunk_Comma = 14; + + /// Text that specifies the result type of a given result. + static const int CXCompletionChunk_ResultType = 15; + + /// A colon (':'). + static const int CXCompletionChunk_Colon = 16; + + /// A semicolon (';'). + static const int CXCompletionChunk_SemiColon = 17; + + /// An '=' sign. + static const int CXCompletionChunk_Equal = 18; + + /// Horizontal space (' '). + static const int CXCompletionChunk_HorizontalSpace = 19; + + /// Vertical space ('\n'), after which it is generally a good idea to perform + /// indentation. + static const int CXCompletionChunk_VerticalSpace = 20; +} + +/// Contains the results of code-completion. +class CXCodeCompleteResults extends ffi.Struct { + /// The code-completion results. + external ffi.Pointer Results; + + /// The number of code-completion results stored in the Results array. + @ffi.Uint32() + external int NumResults; +} + +/// Flags that can be passed to clang_codeCompleteAt() to modify its behavior. +abstract class CXCodeComplete_Flags { + /// Whether to include macros within the set of code completions returned. + static const int CXCodeComplete_IncludeMacros = 1; + + /// Whether to include code patterns for language constructs within the set of + /// code completions, e.g., for loops. + static const int CXCodeComplete_IncludeCodePatterns = 2; + + /// Whether to include brief documentation within the set of code completions + /// returned. + static const int CXCodeComplete_IncludeBriefComments = 4; + + /// Whether to speed up completion by omitting top- or namespace-level + /// entities defined in the preamble. There's no guarantee any particular + /// entity is omitted. This may be useful if the headers are indexed + /// externally. + static const int CXCodeComplete_SkipPreamble = 8; + + /// Whether to include completions with small fix-its, e.g. change '.' to '->' + /// on member access, etc. + static const int CXCodeComplete_IncludeCompletionsWithFixIts = 16; +} + +/// Bits that represent the context under which completion is occurring. +abstract class CXCompletionContext { + /// The context for completions is unexposed, as only Clang results should be + /// included. (This is equivalent to having no context bits set.) + static const int CXCompletionContext_Unexposed = 0; + + /// Completions for any possible type should be included in the results. + static const int CXCompletionContext_AnyType = 1; + + /// Completions for any possible value (variables, function calls, etc.) + /// should be included in the results. + static const int CXCompletionContext_AnyValue = 2; + + /// Completions for values that resolve to an Objective-C object should be + /// included in the results. + static const int CXCompletionContext_ObjCObjectValue = 4; + + /// Completions for values that resolve to an Objective-C selector should be + /// included in the results. + static const int CXCompletionContext_ObjCSelectorValue = 8; + + /// Completions for values that resolve to a C++ class type should be included + /// in the results. + static const int CXCompletionContext_CXXClassTypeValue = 16; + + /// Completions for fields of the member being accessed using the dot operator + /// should be included in the results. + static const int CXCompletionContext_DotMemberAccess = 32; + + /// Completions for fields of the member being accessed using the arrow + /// operator should be included in the results. + static const int CXCompletionContext_ArrowMemberAccess = 64; + + /// Completions for properties of the Objective-C object being accessed using + /// the dot operator should be included in the results. + static const int CXCompletionContext_ObjCPropertyAccess = 128; + + /// Completions for enum tags should be included in the results. + static const int CXCompletionContext_EnumTag = 256; + + /// Completions for union tags should be included in the results. + static const int CXCompletionContext_UnionTag = 512; + + /// Completions for struct tags should be included in the results. + static const int CXCompletionContext_StructTag = 1024; + + /// Completions for C++ class names should be included in the results. + static const int CXCompletionContext_ClassTag = 2048; + + /// Completions for C++ namespaces and namespace aliases should be included in + /// the results. + static const int CXCompletionContext_Namespace = 4096; + + /// Completions for C++ nested name specifiers should be included in the + /// results. + static const int CXCompletionContext_NestedNameSpecifier = 8192; + + /// Completions for Objective-C interfaces (classes) should be included in the + /// results. + static const int CXCompletionContext_ObjCInterface = 16384; + + /// Completions for Objective-C protocols should be included in the results. + static const int CXCompletionContext_ObjCProtocol = 32768; + + /// Completions for Objective-C categories should be included in the results. + static const int CXCompletionContext_ObjCCategory = 65536; + + /// Completions for Objective-C instance messages should be included in the + /// results. + static const int CXCompletionContext_ObjCInstanceMessage = 131072; + + /// Completions for Objective-C class messages should be included in the + /// results. + static const int CXCompletionContext_ObjCClassMessage = 262144; + + /// Completions for Objective-C selector names should be included in the + /// results. + static const int CXCompletionContext_ObjCSelectorName = 524288; + + /// Completions for preprocessor macro names should be included in the + /// results. + static const int CXCompletionContext_MacroName = 1048576; + + /// Natural language completions should be included in the results. + static const int CXCompletionContext_NaturalLanguage = 2097152; + + /// #include file completions should be included in the results. + static const int CXCompletionContext_IncludedFile = 4194304; + + /// The current context is unknown, so set all contexts. + static const int CXCompletionContext_Unknown = 8388607; +} + +abstract class CXEvalResultKind { + static const int CXEval_Int = 1; + static const int CXEval_Float = 2; + static const int CXEval_ObjCStrLiteral = 3; + static const int CXEval_StrLiteral = 4; + static const int CXEval_CFStr = 5; + static const int CXEval_Other = 6; + static const int CXEval_UnExposed = 0; +} + +/// @{ +abstract class CXVisitorResult { + static const int CXVisit_Break = 0; + static const int CXVisit_Continue = 1; +} + +class CXCursorAndRangeVisitor extends ffi.Struct { + external ffi.Pointer context; + + external ffi.Pointer> visit; +} + +abstract class CXResult { + /// Function returned successfully. + static const int CXResult_Success = 0; + + /// One of the parameters was invalid for the function. + static const int CXResult_Invalid = 1; + + /// The function was terminated by a callback (e.g. it returned CXVisit_Break) + static const int CXResult_VisitBreak = 2; +} + +/// Source location passed to index callbacks. +class CXIdxLoc extends ffi.Struct { + external ffi.Pointer _unique_ptr_data_item_0; + external ffi.Pointer _unique_ptr_data_item_1; + + /// Helper for array `ptr_data`. + ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => + ArrayHelper_CXIdxLoc_ptr_data_level0(this, [2], 0, 0); + @ffi.Uint32() + external int int_data; +} + +/// Helper for array `ptr_data` in struct `CXIdxLoc`. +class ArrayHelper_CXIdxLoc_ptr_data_level0 { + final CXIdxLoc _struct; + final List dimensions; + final int level; + final int _absoluteIndex; + int get length => dimensions[level]; + ArrayHelper_CXIdxLoc_ptr_data_level0( + this._struct, this.dimensions, this.level, this._absoluteIndex); + void _checkBounds(int index) { + if (index >= length || index < 0) { + throw RangeError( + 'Dimension $level: index not in range 0..${length} exclusive.'); + } + } + + ffi.Pointer operator [](int index) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + return _struct._unique_ptr_data_item_0; + case 1: + return _struct._unique_ptr_data_item_1; + default: + throw Exception('Invalid Array Helper generated.'); + } + } + + void operator []=(int index, ffi.Pointer value) { + _checkBounds(index); + switch (_absoluteIndex + index) { + case 0: + _struct._unique_ptr_data_item_0 = value; + break; + case 1: + _struct._unique_ptr_data_item_1 = value; + break; + default: + throw Exception('Invalid Array Helper generated.'); + } + } +} + +/// Data for ppIncludedFile callback. +class CXIdxIncludedFileInfo extends ffi.Struct { + /// Location of '#' in the #include/#import directive. + external CXIdxLoc hashLoc; + + /// Filename as written in the #include/#import directive. + external ffi.Pointer filename; + + /// The actual file that the #include/#import directive resolved to. + external ffi.Pointer file; + + @ffi.Int32() + external int isImport; + + @ffi.Int32() + external int isAngled; + + /// Non-zero if the directive was automatically turned into a module import. + @ffi.Int32() + external int isModuleImport; +} + +/// Data for IndexerCallbacks#importedASTFile. +class CXIdxImportedASTFileInfo extends ffi.Struct { + /// Top level AST file containing the imported PCH, module or submodule. + external ffi.Pointer file; + + /// The imported module or NULL if the AST file is a PCH. + external ffi.Pointer module; + + /// Location where the file is imported. Applicable only for modules. + external CXIdxLoc loc; + + /// Non-zero if an inclusion directive was automatically turned into a module + /// import. Applicable only for modules. + @ffi.Int32() + external int isImplicit; +} + +abstract class CXIdxEntityKind { + static const int CXIdxEntity_Unexposed = 0; + static const int CXIdxEntity_Typedef = 1; + static const int CXIdxEntity_Function = 2; + static const int CXIdxEntity_Variable = 3; + static const int CXIdxEntity_Field = 4; + static const int CXIdxEntity_EnumConstant = 5; + static const int CXIdxEntity_ObjCClass = 6; + static const int CXIdxEntity_ObjCProtocol = 7; + static const int CXIdxEntity_ObjCCategory = 8; + static const int CXIdxEntity_ObjCInstanceMethod = 9; + static const int CXIdxEntity_ObjCClassMethod = 10; + static const int CXIdxEntity_ObjCProperty = 11; + static const int CXIdxEntity_ObjCIvar = 12; + static const int CXIdxEntity_Enum = 13; + static const int CXIdxEntity_Struct = 14; + static const int CXIdxEntity_Union = 15; + static const int CXIdxEntity_CXXClass = 16; + static const int CXIdxEntity_CXXNamespace = 17; + static const int CXIdxEntity_CXXNamespaceAlias = 18; + static const int CXIdxEntity_CXXStaticVariable = 19; + static const int CXIdxEntity_CXXStaticMethod = 20; + static const int CXIdxEntity_CXXInstanceMethod = 21; + static const int CXIdxEntity_CXXConstructor = 22; + static const int CXIdxEntity_CXXDestructor = 23; + static const int CXIdxEntity_CXXConversionFunction = 24; + static const int CXIdxEntity_CXXTypeAlias = 25; + static const int CXIdxEntity_CXXInterface = 26; +} + +abstract class CXIdxEntityLanguage { + static const int CXIdxEntityLang_None = 0; + static const int CXIdxEntityLang_C = 1; + static const int CXIdxEntityLang_ObjC = 2; + static const int CXIdxEntityLang_CXX = 3; + static const int CXIdxEntityLang_Swift = 4; +} + +/// Extra C++ template information for an entity. This can apply to: +/// CXIdxEntity_Function CXIdxEntity_CXXClass CXIdxEntity_CXXStaticMethod +/// CXIdxEntity_CXXInstanceMethod CXIdxEntity_CXXConstructor +/// CXIdxEntity_CXXConversionFunction CXIdxEntity_CXXTypeAlias +abstract class CXIdxEntityCXXTemplateKind { + static const int CXIdxEntity_NonTemplate = 0; + static const int CXIdxEntity_Template = 1; + static const int CXIdxEntity_TemplatePartialSpecialization = 2; + static const int CXIdxEntity_TemplateSpecialization = 3; +} + +abstract class CXIdxAttrKind { + static const int CXIdxAttr_Unexposed = 0; + static const int CXIdxAttr_IBAction = 1; + static const int CXIdxAttr_IBOutlet = 2; + static const int CXIdxAttr_IBOutletCollection = 3; +} + +class CXIdxAttrInfo extends ffi.Struct { + @ffi.Int32() + external int kind; + + external CXCursor cursor; + + external CXIdxLoc loc; +} + +class CXIdxEntityInfo extends ffi.Struct { + @ffi.Int32() + external int kind; + + @ffi.Int32() + external int templateKind; + + @ffi.Int32() + external int lang; + + external ffi.Pointer name; + + external ffi.Pointer USR; + + external CXCursor cursor; + + external ffi.Pointer> attributes; + + @ffi.Uint32() + external int numAttributes; +} + +class CXIdxContainerInfo extends ffi.Struct { + external CXCursor cursor; +} + +class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { + external ffi.Pointer attrInfo; + + external ffi.Pointer objcClass; + + external CXCursor classCursor; + + external CXIdxLoc classLoc; +} + +abstract class CXIdxDeclInfoFlags { + static const int CXIdxDeclFlag_Skipped = 1; +} + +class CXIdxDeclInfo extends ffi.Struct { + external ffi.Pointer entityInfo; + + external CXCursor cursor; + + external CXIdxLoc loc; + + external ffi.Pointer semanticContainer; + + /// Generally same as #semanticContainer but can be different in cases like + /// out-of-line C++ member functions. + external ffi.Pointer lexicalContainer; + + @ffi.Int32() + external int isRedeclaration; + + @ffi.Int32() + external int isDefinition; + + @ffi.Int32() + external int isContainer; + + external ffi.Pointer declAsContainer; + + /// Whether the declaration exists in code or was created implicitly by the + /// compiler, e.g. implicit Objective-C methods for properties. + @ffi.Int32() + external int isImplicit; + + external ffi.Pointer> attributes; + + @ffi.Uint32() + external int numAttributes; + + @ffi.Uint32() + external int flags; +} + +abstract class CXIdxObjCContainerKind { + static const int CXIdxObjCContainer_ForwardRef = 0; + static const int CXIdxObjCContainer_Interface = 1; + static const int CXIdxObjCContainer_Implementation = 2; +} + +class CXIdxObjCContainerDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; + + @ffi.Int32() + external int kind; +} + +class CXIdxBaseClassInfo extends ffi.Struct { + external ffi.Pointer base; + + external CXCursor cursor; + + external CXIdxLoc loc; +} + +class CXIdxObjCProtocolRefInfo extends ffi.Struct { + external ffi.Pointer protocol; + + external CXCursor cursor; + + external CXIdxLoc loc; +} + +class CXIdxObjCProtocolRefListInfo extends ffi.Struct { + external ffi.Pointer> protocols; + + @ffi.Uint32() + external int numProtocols; +} + +class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; + + external ffi.Pointer superInfo; + + external ffi.Pointer protocols; +} + +class CXIdxObjCCategoryDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; + + external ffi.Pointer objcClass; + + external CXCursor classCursor; + + external CXIdxLoc classLoc; + + external ffi.Pointer protocols; +} + +class CXIdxObjCPropertyDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; + + external ffi.Pointer getter; + + external ffi.Pointer setter; +} + +class CXIdxCXXClassDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; + + external ffi.Pointer> bases; + + @ffi.Uint32() + external int numBases; +} + +/// Data for IndexerCallbacks#indexEntityReference. +abstract class CXIdxEntityRefKind { + /// The entity is referenced directly in user's code. + static const int CXIdxEntityRef_Direct = 1; + + /// An implicit reference, e.g. a reference of an Objective-C method via the + /// dot syntax. + static const int CXIdxEntityRef_Implicit = 2; +} + +/// Roles that are attributed to symbol occurrences. +abstract class CXSymbolRole { + static const int CXSymbolRole_None = 0; + static const int CXSymbolRole_Declaration = 1; + static const int CXSymbolRole_Definition = 2; + static const int CXSymbolRole_Reference = 4; + static const int CXSymbolRole_Read = 8; + static const int CXSymbolRole_Write = 16; + static const int CXSymbolRole_Call = 32; + static const int CXSymbolRole_Dynamic = 64; + static const int CXSymbolRole_AddressOf = 128; + static const int CXSymbolRole_Implicit = 256; +} + +/// Data for IndexerCallbacks#indexEntityReference. +class CXIdxEntityRefInfo extends ffi.Struct { + @ffi.Int32() + external int kind; + + /// Reference cursor. + external CXCursor cursor; + + external CXIdxLoc loc; + + /// The entity that gets referenced. + external ffi.Pointer referencedEntity; + + /// Immediate "parent" of the reference. For example: + external ffi.Pointer parentEntity; + + /// Lexical container context of the reference. + external ffi.Pointer container; + + /// Sets of symbol roles of the reference. + @ffi.Int32() + external int role; +} + +/// A group of callbacks used by #clang_indexSourceFile and +/// #clang_indexTranslationUnit. +class IndexerCallbacks extends ffi.Struct { + /// Called periodically to check whether indexing should be aborted. Should + /// return 0 to continue, and non-zero to abort. + external ffi.Pointer> abortQuery; + + /// Called at the end of indexing; passes the complete diagnostic set. + external ffi.Pointer> diagnostic; + + external ffi.Pointer> enteredMainFile; + + /// Called when a file gets #included/#imported. + external ffi.Pointer> ppIncludedFile; + + /// Called when a AST file (PCH or module) gets imported. + external ffi.Pointer> importedASTFile; + + /// Called at the beginning of indexing a translation unit. + external ffi.Pointer> startedTranslationUnit; + + external ffi.Pointer> indexDeclaration; + + /// Called to index a reference of an entity. + external ffi.Pointer> indexEntityReference; +} + +abstract class CXIndexOptFlags { + /// Used to indicate that no special indexing options are needed. + static const int CXIndexOpt_None = 0; + + /// Used to indicate that IndexerCallbacks#indexEntityReference should be + /// invoked for only one reference of an entity per source file that does not + /// also include a declaration/definition of the entity. + static const int CXIndexOpt_SuppressRedundantRefs = 1; + + /// Function-local symbols should be indexed. If this is not set + /// function-local symbols will be ignored. + static const int CXIndexOpt_IndexFunctionLocalSymbols = 2; + + /// Implicit function/class template instantiations should be indexed. If this + /// is not set, implicit instantiations will be ignored. + static const int CXIndexOpt_IndexImplicitTemplateInstantiations = 4; + + /// Suppress all compiler warnings when parsing for indexing. + static const int CXIndexOpt_SuppressWarnings = 8; + + /// Skip a function/method body that was already parsed during an indexing + /// session associated with a CXIndexAction object. Bodies in system headers + /// are always skipped. + static const int CXIndexOpt_SkipParsedBodiesInSession = 16; +} + +const int CINDEX_VERSION_MAJOR = 0; + +const int CINDEX_VERSION_MINOR = 59; + +const int CINDEX_VERSION = 59; + +const String CINDEX_VERSION_STRING = '0.59'; + +typedef _c_clang_getCString = ffi.Pointer Function( + CXString string, +); + +typedef _dart_clang_getCString = ffi.Pointer Function( + CXString string, +); + +typedef _c_clang_disposeString = ffi.Void Function( + CXString string, +); + +typedef _dart_clang_disposeString = void Function( + CXString string, +); + +typedef _c_clang_disposeStringSet = ffi.Void Function( + ffi.Pointer set_1, +); + +typedef _dart_clang_disposeStringSet = void Function( + ffi.Pointer set_1, +); + +typedef _c_clang_getBuildSessionTimestamp = ffi.Uint64 Function(); + +typedef _dart_clang_getBuildSessionTimestamp = int Function(); + +typedef _c_clang_VirtualFileOverlay_create + = ffi.Pointer Function( + ffi.Uint32 options, +); + +typedef _dart_clang_VirtualFileOverlay_create + = ffi.Pointer Function( + int options, +); + +typedef _c_clang_VirtualFileOverlay_addFileMapping = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer virtualPath, + ffi.Pointer realPath, +); + +typedef _dart_clang_VirtualFileOverlay_addFileMapping = int Function( + ffi.Pointer arg0, + ffi.Pointer virtualPath, + ffi.Pointer realPath, +); + +typedef _c_clang_VirtualFileOverlay_setCaseSensitivity = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Int32 caseSensitive, +); + +typedef _dart_clang_VirtualFileOverlay_setCaseSensitivity = int Function( + ffi.Pointer arg0, + int caseSensitive, +); + +typedef _c_clang_VirtualFileOverlay_writeToBuffer = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Uint32 options, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, +); + +typedef _dart_clang_VirtualFileOverlay_writeToBuffer = int Function( + ffi.Pointer arg0, + int options, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, +); + +typedef _c_clang_free = ffi.Void Function( + ffi.Pointer buffer, +); + +typedef _dart_clang_free = void Function( + ffi.Pointer buffer, +); + +typedef _c_clang_VirtualFileOverlay_dispose = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_VirtualFileOverlay_dispose = void Function( + ffi.Pointer arg0, +); + +typedef _c_clang_ModuleMapDescriptor_create + = ffi.Pointer Function( + ffi.Uint32 options, +); + +typedef _dart_clang_ModuleMapDescriptor_create + = ffi.Pointer Function( + int options, +); + +typedef _c_clang_ModuleMapDescriptor_setFrameworkModuleName = ffi.Int32 + Function( + ffi.Pointer arg0, + ffi.Pointer name, +); + +typedef _dart_clang_ModuleMapDescriptor_setFrameworkModuleName = int Function( + ffi.Pointer arg0, + ffi.Pointer name, +); + +typedef _c_clang_ModuleMapDescriptor_setUmbrellaHeader = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Pointer name, +); + +typedef _dart_clang_ModuleMapDescriptor_setUmbrellaHeader = int Function( + ffi.Pointer arg0, + ffi.Pointer name, +); + +typedef _c_clang_ModuleMapDescriptor_writeToBuffer = ffi.Int32 Function( + ffi.Pointer arg0, + ffi.Uint32 options, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, +); + +typedef _dart_clang_ModuleMapDescriptor_writeToBuffer = int Function( + ffi.Pointer arg0, + int options, + ffi.Pointer> out_buffer_ptr, + ffi.Pointer out_buffer_size, +); + +typedef _c_clang_ModuleMapDescriptor_dispose = ffi.Void Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_ModuleMapDescriptor_dispose = void Function( + ffi.Pointer arg0, +); + +typedef _c_clang_createIndex = ffi.Pointer Function( + ffi.Int32 excludeDeclarationsFromPCH, + ffi.Int32 displayDiagnostics, +); + +typedef _dart_clang_createIndex = ffi.Pointer Function( + int excludeDeclarationsFromPCH, + int displayDiagnostics, +); + +typedef _c_clang_disposeIndex = ffi.Void Function( + ffi.Pointer index, +); + +typedef _dart_clang_disposeIndex = void Function( + ffi.Pointer index, +); + +typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( + ffi.Pointer arg0, + ffi.Uint32 options, +); + +typedef _dart_clang_CXIndex_setGlobalOptions = void Function( + ffi.Pointer arg0, + int options, +); + +typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_CXIndex_getGlobalOptions = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer Path, +); + +typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( + ffi.Pointer arg0, + ffi.Pointer Path, +); + +typedef _c_clang_getFileName = CXString Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileName = CXString Function( + ffi.Pointer SFile, +); + +typedef _c_clang_getFileTime = ffi.Int64 Function( + ffi.Pointer SFile, +); + +typedef _dart_clang_getFileTime = int Function( + ffi.Pointer SFile, +); + +typedef _c_clang_getFileUniqueID = ffi.Int32 Function( + ffi.Pointer file, + ffi.Pointer outID, +); + +typedef _dart_clang_getFileUniqueID = int Function( + ffi.Pointer file, + ffi.Pointer outID, +); + +typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _c_clang_getFile = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file_name, +); + +typedef _dart_clang_getFile = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file_name, +); + +typedef _c_clang_getFileContents = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, +); + +typedef _dart_clang_getFileContents = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Pointer size, +); + +typedef _c_clang_File_isEqual = ffi.Int32 Function( + ffi.Pointer file1, + ffi.Pointer file2, +); + +typedef _dart_clang_File_isEqual = int Function( + ffi.Pointer file1, + ffi.Pointer file2, +); + +typedef _c_clang_File_tryGetRealPathName = CXString Function( + ffi.Pointer file, +); + +typedef _dart_clang_File_tryGetRealPathName = CXString Function( + ffi.Pointer file, +); + +typedef _c_clang_getNullLocation = CXSourceLocation Function(); + +typedef _dart_clang_getNullLocation = CXSourceLocation Function(); + +typedef _c_clang_equalLocations = ffi.Uint32 Function( + CXSourceLocation loc1, + CXSourceLocation loc2, +); + +typedef _dart_clang_equalLocations = int Function( + CXSourceLocation loc1, + CXSourceLocation loc2, +); + +typedef _c_clang_getLocation = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Uint32 line, + ffi.Uint32 column, +); + +typedef _dart_clang_getLocation = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + int line, + int column, +); + +typedef _c_clang_getLocationForOffset = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + ffi.Uint32 offset, +); + +typedef _dart_clang_getLocationForOffset = CXSourceLocation Function( + ffi.Pointer tu, + ffi.Pointer file, + int offset, +); + +typedef _c_clang_Location_isInSystemHeader = ffi.Int32 Function( + CXSourceLocation location, +); + +typedef _dart_clang_Location_isInSystemHeader = int Function( + CXSourceLocation location, +); + +typedef _c_clang_Location_isFromMainFile = ffi.Int32 Function( + CXSourceLocation location, +); + +typedef _dart_clang_Location_isFromMainFile = int Function( + CXSourceLocation location, +); + +typedef _c_clang_getNullRange = CXSourceRange Function(); + +typedef _dart_clang_getNullRange = CXSourceRange Function(); + +typedef _c_clang_getRange = CXSourceRange Function( + CXSourceLocation begin, + CXSourceLocation end, +); + +typedef _dart_clang_getRange = CXSourceRange Function( + CXSourceLocation begin, + CXSourceLocation end, +); + +typedef _c_clang_equalRanges = ffi.Uint32 Function( + CXSourceRange range1, + CXSourceRange range2, +); + +typedef _dart_clang_equalRanges = int Function( + CXSourceRange range1, + CXSourceRange range2, +); + +typedef _c_clang_Range_isNull = ffi.Int32 Function( + CXSourceRange range, +); + +typedef _dart_clang_Range_isNull = int Function( + CXSourceRange range, +); + +typedef _c_clang_getExpansionLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getExpansionLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getPresumedLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column, +); + +typedef _dart_clang_getPresumedLocation = void Function( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column, +); + +typedef _c_clang_getInstantiationLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getInstantiationLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getSpellingLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getSpellingLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getFileLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_getFileLocation = void Function( + CXSourceLocation location, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_getRangeStart = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _dart_clang_getRangeStart = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _c_clang_getRangeEnd = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _dart_clang_getRangeEnd = CXSourceLocation Function( + CXSourceRange range, +); + +typedef _c_clang_getSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, + ffi.Pointer file, +); + +typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( + ffi.Pointer tu, +); + +typedef _dart_clang_getAllSkippedRanges = ffi.Pointer + Function( + ffi.Pointer tu, +); + +typedef _c_clang_disposeSourceRangeList = ffi.Void Function( + ffi.Pointer ranges, +); + +typedef _dart_clang_disposeSourceRangeList = void Function( + ffi.Pointer ranges, +); + +typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( + ffi.Pointer Diags, +); + +typedef _dart_clang_getNumDiagnosticsInSet = int Function( + ffi.Pointer Diags, +); + +typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( + ffi.Pointer Diags, + ffi.Uint32 Index, +); + +typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( + ffi.Pointer Diags, + int Index, +); - /// OpenMP parallel master directive. - static const int CXCursor_OMPParallelMasterDirective = 285; - static const int CXCursor_LastStmt = 285; +typedef _c_clang_loadDiagnostics = ffi.Pointer Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, +); - /// Cursor that represents the translation unit itself. - static const int CXCursor_TranslationUnit = 300; - static const int CXCursor_FirstAttr = 400; +typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString, +); - /// An attribute whose specific kind is not exposed via this interface. - static const int CXCursor_UnexposedAttr = 400; - static const int CXCursor_IBActionAttr = 401; - static const int CXCursor_IBOutletAttr = 402; - static const int CXCursor_IBOutletCollectionAttr = 403; - static const int CXCursor_CXXFinalAttr = 404; - static const int CXCursor_CXXOverrideAttr = 405; - static const int CXCursor_AnnotateAttr = 406; - static const int CXCursor_AsmLabelAttr = 407; - static const int CXCursor_PackedAttr = 408; - static const int CXCursor_PureAttr = 409; - static const int CXCursor_ConstAttr = 410; - static const int CXCursor_NoDuplicateAttr = 411; - static const int CXCursor_CUDAConstantAttr = 412; - static const int CXCursor_CUDADeviceAttr = 413; - static const int CXCursor_CUDAGlobalAttr = 414; - static const int CXCursor_CUDAHostAttr = 415; - static const int CXCursor_CUDASharedAttr = 416; - static const int CXCursor_VisibilityAttr = 417; - static const int CXCursor_DLLExport = 418; - static const int CXCursor_DLLImport = 419; - static const int CXCursor_NSReturnsRetained = 420; - static const int CXCursor_NSReturnsNotRetained = 421; - static const int CXCursor_NSReturnsAutoreleased = 422; - static const int CXCursor_NSConsumesSelf = 423; - static const int CXCursor_NSConsumed = 424; - static const int CXCursor_ObjCException = 425; - static const int CXCursor_ObjCNSObject = 426; - static const int CXCursor_ObjCIndependentClass = 427; - static const int CXCursor_ObjCPreciseLifetime = 428; - static const int CXCursor_ObjCReturnsInnerPointer = 429; - static const int CXCursor_ObjCRequiresSuper = 430; - static const int CXCursor_ObjCRootClass = 431; - static const int CXCursor_ObjCSubclassingRestricted = 432; - static const int CXCursor_ObjCExplicitProtocolImpl = 433; - static const int CXCursor_ObjCDesignatedInitializer = 434; - static const int CXCursor_ObjCRuntimeVisible = 435; - static const int CXCursor_ObjCBoxable = 436; - static const int CXCursor_FlagEnum = 437; - static const int CXCursor_ConvergentAttr = 438; - static const int CXCursor_WarnUnusedAttr = 439; - static const int CXCursor_WarnUnusedResultAttr = 440; - static const int CXCursor_AlignedAttr = 441; - static const int CXCursor_LastAttr = 441; - static const int CXCursor_PreprocessingDirective = 500; - static const int CXCursor_MacroDefinition = 501; - static const int CXCursor_MacroExpansion = 502; - static const int CXCursor_MacroInstantiation = 502; - static const int CXCursor_InclusionDirective = 503; - static const int CXCursor_FirstPreprocessing = 500; - static const int CXCursor_LastPreprocessing = 503; +typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( + ffi.Pointer Diags, +); - /// A module import declaration. - static const int CXCursor_ModuleImportDecl = 600; - static const int CXCursor_TypeAliasTemplateDecl = 601; +typedef _dart_clang_disposeDiagnosticSet = void Function( + ffi.Pointer Diags, +); - /// A static_assert or _Static_assert node - static const int CXCursor_StaticAssert = 602; +typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, +); - /// a friend declaration. - static const int CXCursor_FriendDecl = 603; - static const int CXCursor_FirstExtraDecl = 600; - static const int CXCursor_LastExtraDecl = 603; +typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( + ffi.Pointer D, +); - /// A code completion overload candidate. - static const int CXCursor_OverloadCandidate = 700; -} +typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Unit, +); -/// A cursor representing some element in the abstract syntax tree for a -/// translation unit. -class CXCursor extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _dart_clang_getNumDiagnostics = int Function( + ffi.Pointer Unit, +); - @ffi.Int32() - external int xdata; +typedef _c_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + ffi.Uint32 Index, +); - external ffi.Pointer _unique_data_item_0; - external ffi.Pointer _unique_data_item_1; - external ffi.Pointer _unique_data_item_2; +typedef _dart_clang_getDiagnostic = ffi.Pointer Function( + ffi.Pointer Unit, + int Index, +); - /// Helper for array `data`. - ArrayHelper_CXCursor_data_level0 get data => - ArrayHelper_CXCursor_data_level0(this, [3], 0, 0); -} +typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); -/// Helper for array `data` in struct `CXCursor`. -class ArrayHelper_CXCursor_data_level0 { - final CXCursor _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXCursor_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } - } +typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( + ffi.Pointer Unit, +); - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_data_item_0; - case 1: - return _struct._unique_data_item_1; - case 2: - return _struct._unique_data_item_2; - default: - throw Exception('Invalid Array Helper generated.'); - } - } +typedef _c_clang_disposeDiagnostic = ffi.Void Function( + ffi.Pointer Diagnostic, +); - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_data_item_0 = value; - break; - case 1: - _struct._unique_data_item_1 = value; - break; - case 2: - _struct._unique_data_item_2 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} +typedef _dart_clang_disposeDiagnostic = void Function( + ffi.Pointer Diagnostic, +); -/// Describe the linkage of the entity referred to by a cursor. -abstract class CXLinkageKind { - /// This value indicates that no linkage information is available for a - /// provided CXCursor. - static const int CXLinkage_Invalid = 0; +typedef _c_clang_formatDiagnostic = CXString Function( + ffi.Pointer Diagnostic, + ffi.Uint32 Options, +); - /// This is the linkage for variables, parameters, and so on that have - /// automatic storage. This covers normal (non-extern) local variables. - static const int CXLinkage_NoLinkage = 1; +typedef _dart_clang_formatDiagnostic = CXString Function( + ffi.Pointer Diagnostic, + int Options, +); - /// This is the linkage for static variables and static functions. - static const int CXLinkage_Internal = 2; +typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); - /// This is the linkage for entities with external linkage that live in C++ - /// anonymous namespaces. - static const int CXLinkage_UniqueExternal = 3; +typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); + +typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticSeverity = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticLocation = CXSourceLocation Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticLocation = CXSourceLocation Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticSpelling = CXString Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticSpelling = CXString Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticOption = CXString Function( + ffi.Pointer Diag, + ffi.Pointer Disable, +); + +typedef _dart_clang_getDiagnosticOption = CXString Function( + ffi.Pointer Diag, + ffi.Pointer Disable, +); + +typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticCategory = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticCategoryName = CXString Function( + ffi.Uint32 Category, +); + +typedef _dart_clang_getDiagnosticCategoryName = CXString Function( + int Category, +); + +typedef _c_clang_getDiagnosticCategoryText = CXString Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticCategoryText = CXString Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( + ffi.Pointer arg0, +); + +typedef _dart_clang_getDiagnosticNumRanges = int Function( + ffi.Pointer arg0, +); + +typedef _c_clang_getDiagnosticRange = CXSourceRange Function( + ffi.Pointer Diagnostic, + ffi.Uint32 Range, +); + +typedef _dart_clang_getDiagnosticRange = CXSourceRange Function( + ffi.Pointer Diagnostic, + int Range, +); - /// This is the linkage for entities with true, external linkage. - static const int CXLinkage_External = 4; -} +typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( + ffi.Pointer Diagnostic, +); -abstract class CXVisibilityKind { - /// This value indicates that no visibility information is available for a - /// provided CXCursor. - static const int CXVisibility_Invalid = 0; +typedef _dart_clang_getDiagnosticNumFixIts = int Function( + ffi.Pointer Diagnostic, +); - /// Symbol not seen by the linker. - static const int CXVisibility_Hidden = 1; +typedef _c_clang_getDiagnosticFixIt = CXString Function( + ffi.Pointer Diagnostic, + ffi.Uint32 FixIt, + ffi.Pointer ReplacementRange, +); - /// Symbol seen by the linker but resolves to a symbol inside this object. - static const int CXVisibility_Protected = 2; +typedef _dart_clang_getDiagnosticFixIt = CXString Function( + ffi.Pointer Diagnostic, + int FixIt, + ffi.Pointer ReplacementRange, +); - /// Symbol seen by the linker and acts like a normal symbol. - static const int CXVisibility_Default = 3; -} +typedef _c_clang_getTranslationUnitSpelling = CXString Function( + ffi.Pointer CTUnit, +); -/// Describes the availability of a given entity on a particular platform, e.g., -/// a particular class might only be available on Mac OS 10.7 or newer. -class CXPlatformAvailability extends ffi.Struct { - /// A string that describes the platform for which this structure provides - /// availability information. - external CXString Platform; +typedef _dart_clang_getTranslationUnitSpelling = CXString Function( + ffi.Pointer CTUnit, +); - /// The version number in which this entity was introduced. - external CXVersion Introduced; +typedef _c_clang_createTranslationUnitFromSourceFile + = ffi.Pointer Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Int32 num_clang_command_line_args, + ffi.Pointer> clang_command_line_args, + ffi.Uint32 num_unsaved_files, + ffi.Pointer unsaved_files, +); - /// The version number in which this entity was deprecated (but is still - /// available). - external CXVersion Deprecated; +typedef _dart_clang_createTranslationUnitFromSourceFile + = ffi.Pointer Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + int num_clang_command_line_args, + ffi.Pointer> clang_command_line_args, + int num_unsaved_files, + ffi.Pointer unsaved_files, +); - /// The version number in which this entity was obsoleted, and therefore is no - /// longer available. - external CXVersion Obsoleted; +typedef _c_clang_createTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, +); - /// Whether the entity is unconditionally unavailable on this platform. - @ffi.Int32() - external int Unavailable; +typedef _dart_clang_createTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, +); - /// An optional message to provide to a user of this API, e.g., to suggest - /// replacement APIs. - external CXString Message; -} +typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, +); -/// Describe the "language" of the entity referred to by a cursor. -abstract class CXLanguageKind { - static const int CXLanguage_Invalid = 0; - static const int CXLanguage_C = 1; - static const int CXLanguage_ObjC = 2; - static const int CXLanguage_CPlusPlus = 3; -} +typedef _dart_clang_createTranslationUnit2 = int Function( + ffi.Pointer CIdx, + ffi.Pointer ast_filename, + ffi.Pointer> out_TU, +); -/// Describe the "thread-local storage (TLS) kind" of the declaration referred -/// to by a cursor. -abstract class CXTLSKind { - static const int CXTLS_None = 0; - static const int CXTLS_Dynamic = 1; - static const int CXTLS_Static = 2; -} +typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); -class CXCursorSetImpl extends ffi.Struct {} +typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); -/// Describes the kind of type -abstract class CXTypeKind { - /// Represents an invalid type (e.g., where no type is available). - static const int CXType_Invalid = 0; +typedef _c_clang_parseTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, +); - /// A type whose specific kind is not exposed via this interface. - static const int CXType_Unexposed = 1; - static const int CXType_Void = 2; - static const int CXType_Bool = 3; - static const int CXType_Char_U = 4; - static const int CXType_UChar = 5; - static const int CXType_Char16 = 6; - static const int CXType_Char32 = 7; - static const int CXType_UShort = 8; - static const int CXType_UInt = 9; - static const int CXType_ULong = 10; - static const int CXType_ULongLong = 11; - static const int CXType_UInt128 = 12; - static const int CXType_Char_S = 13; - static const int CXType_SChar = 14; - static const int CXType_WChar = 15; - static const int CXType_Short = 16; - static const int CXType_Int = 17; - static const int CXType_Long = 18; - static const int CXType_LongLong = 19; - static const int CXType_Int128 = 20; - static const int CXType_Float = 21; - static const int CXType_Double = 22; - static const int CXType_LongDouble = 23; - static const int CXType_NullPtr = 24; - static const int CXType_Overload = 25; - static const int CXType_Dependent = 26; - static const int CXType_ObjCId = 27; - static const int CXType_ObjCClass = 28; - static const int CXType_ObjCSel = 29; - static const int CXType_Float128 = 30; - static const int CXType_Half = 31; - static const int CXType_Float16 = 32; - static const int CXType_ShortAccum = 33; - static const int CXType_Accum = 34; - static const int CXType_LongAccum = 35; - static const int CXType_UShortAccum = 36; - static const int CXType_UAccum = 37; - static const int CXType_ULongAccum = 38; - static const int CXType_FirstBuiltin = 2; - static const int CXType_LastBuiltin = 38; - static const int CXType_Complex = 100; - static const int CXType_Pointer = 101; - static const int CXType_BlockPointer = 102; - static const int CXType_LValueReference = 103; - static const int CXType_RValueReference = 104; - static const int CXType_Record = 105; - static const int CXType_Enum = 106; - static const int CXType_Typedef = 107; - static const int CXType_ObjCInterface = 108; - static const int CXType_ObjCObjectPointer = 109; - static const int CXType_FunctionNoProto = 110; - static const int CXType_FunctionProto = 111; - static const int CXType_ConstantArray = 112; - static const int CXType_Vector = 113; - static const int CXType_IncompleteArray = 114; - static const int CXType_VariableArray = 115; - static const int CXType_DependentSizedArray = 116; - static const int CXType_MemberPointer = 117; - static const int CXType_Auto = 118; +typedef _dart_clang_parseTranslationUnit = ffi.Pointer + Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, +); - /// Represents a type that was referred to using an elaborated type keyword. - static const int CXType_Elaborated = 119; - static const int CXType_Pipe = 120; - static const int CXType_OCLImage1dRO = 121; - static const int CXType_OCLImage1dArrayRO = 122; - static const int CXType_OCLImage1dBufferRO = 123; - static const int CXType_OCLImage2dRO = 124; - static const int CXType_OCLImage2dArrayRO = 125; - static const int CXType_OCLImage2dDepthRO = 126; - static const int CXType_OCLImage2dArrayDepthRO = 127; - static const int CXType_OCLImage2dMSAARO = 128; - static const int CXType_OCLImage2dArrayMSAARO = 129; - static const int CXType_OCLImage2dMSAADepthRO = 130; - static const int CXType_OCLImage2dArrayMSAADepthRO = 131; - static const int CXType_OCLImage3dRO = 132; - static const int CXType_OCLImage1dWO = 133; - static const int CXType_OCLImage1dArrayWO = 134; - static const int CXType_OCLImage1dBufferWO = 135; - static const int CXType_OCLImage2dWO = 136; - static const int CXType_OCLImage2dArrayWO = 137; - static const int CXType_OCLImage2dDepthWO = 138; - static const int CXType_OCLImage2dArrayDepthWO = 139; - static const int CXType_OCLImage2dMSAAWO = 140; - static const int CXType_OCLImage2dArrayMSAAWO = 141; - static const int CXType_OCLImage2dMSAADepthWO = 142; - static const int CXType_OCLImage2dArrayMSAADepthWO = 143; - static const int CXType_OCLImage3dWO = 144; - static const int CXType_OCLImage1dRW = 145; - static const int CXType_OCLImage1dArrayRW = 146; - static const int CXType_OCLImage1dBufferRW = 147; - static const int CXType_OCLImage2dRW = 148; - static const int CXType_OCLImage2dArrayRW = 149; - static const int CXType_OCLImage2dDepthRW = 150; - static const int CXType_OCLImage2dArrayDepthRW = 151; - static const int CXType_OCLImage2dMSAARW = 152; - static const int CXType_OCLImage2dArrayMSAARW = 153; - static const int CXType_OCLImage2dMSAADepthRW = 154; - static const int CXType_OCLImage2dArrayMSAADepthRW = 155; - static const int CXType_OCLImage3dRW = 156; - static const int CXType_OCLSampler = 157; - static const int CXType_OCLEvent = 158; - static const int CXType_OCLQueue = 159; - static const int CXType_OCLReserveID = 160; - static const int CXType_ObjCObject = 161; - static const int CXType_ObjCTypeParam = 162; - static const int CXType_Attributed = 163; - static const int CXType_OCLIntelSubgroupAVCMcePayload = 164; - static const int CXType_OCLIntelSubgroupAVCImePayload = 165; - static const int CXType_OCLIntelSubgroupAVCRefPayload = 166; - static const int CXType_OCLIntelSubgroupAVCSicPayload = 167; - static const int CXType_OCLIntelSubgroupAVCMceResult = 168; - static const int CXType_OCLIntelSubgroupAVCImeResult = 169; - static const int CXType_OCLIntelSubgroupAVCRefResult = 170; - static const int CXType_OCLIntelSubgroupAVCSicResult = 171; - static const int CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172; - static const int CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173; - static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; - static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; - static const int CXType_ExtVector = 176; -} +typedef _c_clang_parseTranslationUnit2 = ffi.Int32 Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, + ffi.Pointer> out_TU, +); -/// Describes the calling convention of a function type -abstract class CXCallingConv { - static const int CXCallingConv_Default = 0; - static const int CXCallingConv_C = 1; - static const int CXCallingConv_X86StdCall = 2; - static const int CXCallingConv_X86FastCall = 3; - static const int CXCallingConv_X86ThisCall = 4; - static const int CXCallingConv_X86Pascal = 5; - static const int CXCallingConv_AAPCS = 6; - static const int CXCallingConv_AAPCS_VFP = 7; - static const int CXCallingConv_X86RegCall = 8; - static const int CXCallingConv_IntelOclBicc = 9; - static const int CXCallingConv_Win64 = 10; - static const int CXCallingConv_X86_64Win64 = 10; - static const int CXCallingConv_X86_64SysV = 11; - static const int CXCallingConv_X86VectorCall = 12; - static const int CXCallingConv_Swift = 13; - static const int CXCallingConv_PreserveMost = 14; - static const int CXCallingConv_PreserveAll = 15; - static const int CXCallingConv_AArch64VectorCall = 16; - static const int CXCallingConv_Invalid = 100; - static const int CXCallingConv_Unexposed = 200; -} +typedef _dart_clang_parseTranslationUnit2 = int Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, + ffi.Pointer> out_TU, +); -/// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _c_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, + ffi.Pointer> out_TU, +); - external ffi.Pointer _unique_data_item_0; - external ffi.Pointer _unique_data_item_1; +typedef _dart_clang_parseTranslationUnit2FullArgv = int Function( + ffi.Pointer CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + int num_command_line_args, + ffi.Pointer unsaved_files, + int num_unsaved_files, + int options, + ffi.Pointer> out_TU, +); - /// Helper for array `data`. - ArrayHelper_CXType_data_level0 get data => - ArrayHelper_CXType_data_level0(this, [2], 0, 0); -} +typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( + ffi.Pointer TU, +); -/// Helper for array `data` in struct `CXType`. -class ArrayHelper_CXType_data_level0 { - final CXType _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXType_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } - } +typedef _dart_clang_defaultSaveOptions = int Function( + ffi.Pointer TU, +); - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_data_item_0; - case 1: - return _struct._unique_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } +typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( + ffi.Pointer TU, + ffi.Pointer FileName, + ffi.Uint32 options, +); - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_data_item_0 = value; - break; - case 1: - _struct._unique_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} +typedef _dart_clang_saveTranslationUnit = int Function( + ffi.Pointer TU, + ffi.Pointer FileName, + int options, +); -/// Describes the kind of a template argument. -abstract class CXTemplateArgumentKind { - static const int CXTemplateArgumentKind_Null = 0; - static const int CXTemplateArgumentKind_Type = 1; - static const int CXTemplateArgumentKind_Declaration = 2; - static const int CXTemplateArgumentKind_NullPtr = 3; - static const int CXTemplateArgumentKind_Integral = 4; - static const int CXTemplateArgumentKind_Template = 5; - static const int CXTemplateArgumentKind_TemplateExpansion = 6; - static const int CXTemplateArgumentKind_Expression = 7; - static const int CXTemplateArgumentKind_Pack = 8; - static const int CXTemplateArgumentKind_Invalid = 9; -} +typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( + ffi.Pointer arg0, +); -abstract class CXTypeNullabilityKind { - /// Values of this type can never be null. - static const int CXTypeNullability_NonNull = 0; +typedef _dart_clang_suspendTranslationUnit = int Function( + ffi.Pointer arg0, +); - /// Values of this type can be null. - static const int CXTypeNullability_Nullable = 1; +typedef _c_clang_disposeTranslationUnit = ffi.Void Function( + ffi.Pointer arg0, +); - /// Whether values of this type can be null is (explicitly) unspecified. This - /// captures a (fairly rare) case where we can't conclude anything about the - /// nullability of the type even though it has been considered. - static const int CXTypeNullability_Unspecified = 2; +typedef _dart_clang_disposeTranslationUnit = void Function( + ffi.Pointer arg0, +); - /// Nullability is not applicable to this type. - static const int CXTypeNullability_Invalid = 3; -} +typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( + ffi.Pointer TU, +); -/// List the possible error codes for clang_Type_getSizeOf, -/// clang_Type_getAlignOf, clang_Type_getOffsetOf and clang_Cursor_getOffsetOf. -abstract class CXTypeLayoutError { - /// Type is of kind CXType_Invalid. - static const int CXTypeLayoutError_Invalid = -1; +typedef _dart_clang_defaultReparseOptions = int Function( + ffi.Pointer TU, +); - /// The type is an incomplete Type. - static const int CXTypeLayoutError_Incomplete = -2; +typedef _c_clang_reparseTranslationUnit = ffi.Int32 Function( + ffi.Pointer TU, + ffi.Uint32 num_unsaved_files, + ffi.Pointer unsaved_files, + ffi.Uint32 options, +); - /// The type is a dependent Type. - static const int CXTypeLayoutError_Dependent = -3; +typedef _dart_clang_reparseTranslationUnit = int Function( + ffi.Pointer TU, + int num_unsaved_files, + ffi.Pointer unsaved_files, + int options, +); - /// The type is not a constant size type. - static const int CXTypeLayoutError_NotConstantSize = -4; +typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( + ffi.Int32 kind, +); - /// The Field name is not valid for this record. - static const int CXTypeLayoutError_InvalidFieldName = -5; +typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( + int kind, +); - /// The type is undeduced. - static const int CXTypeLayoutError_Undeduced = -6; -} +typedef _c_clang_getCXTUResourceUsage = CXTUResourceUsage Function( + ffi.Pointer TU, +); -abstract class CXRefQualifierKind { - /// No ref-qualifier was provided. - static const int CXRefQualifier_None = 0; +typedef _dart_clang_getCXTUResourceUsage = CXTUResourceUsage Function( + ffi.Pointer TU, +); - /// An lvalue ref-qualifier was provided ( &). - static const int CXRefQualifier_LValue = 1; +typedef _c_clang_disposeCXTUResourceUsage = ffi.Void Function( + CXTUResourceUsage usage, +); - /// An rvalue ref-qualifier was provided ( &&). - static const int CXRefQualifier_RValue = 2; -} +typedef _dart_clang_disposeCXTUResourceUsage = void Function( + CXTUResourceUsage usage, +); -/// Represents the C++ access control level to a base class for a cursor with -/// kind CX_CXXBaseSpecifier. -abstract class CX_CXXAccessSpecifier { - static const int CX_CXXInvalidAccessSpecifier = 0; - static const int CX_CXXPublic = 1; - static const int CX_CXXProtected = 2; - static const int CX_CXXPrivate = 3; -} +typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, +); -/// Represents the storage classes as declared in the source. CX_SC_Invalid was -/// added for the case that the passed cursor in not a declaration. -abstract class CX_StorageClass { - static const int CX_SC_Invalid = 0; - static const int CX_SC_None = 1; - static const int CX_SC_Extern = 2; - static const int CX_SC_Static = 3; - static const int CX_SC_PrivateExtern = 4; - static const int CX_SC_OpenCLWorkGroupLocal = 5; - static const int CX_SC_Auto = 6; - static const int CX_SC_Register = 7; -} +typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer + Function( + ffi.Pointer CTUnit, +); + +typedef _c_clang_TargetInfo_dispose = ffi.Void Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_dispose = void Function( + ffi.Pointer Info, +); + +typedef _c_clang_TargetInfo_getTriple = CXString Function( + ffi.Pointer Info, +); + +typedef _dart_clang_TargetInfo_getTriple = CXString Function( + ffi.Pointer Info, +); + +typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( + ffi.Pointer Info, +); -/// Describes how the traversal of the children of a particular cursor should -/// proceed after visiting a particular child cursor. -abstract class CXChildVisitResult { - /// Terminates the cursor traversal. - static const int CXChildVisit_Break = 0; +typedef _dart_clang_TargetInfo_getPointerWidth = int Function( + ffi.Pointer Info, +); - /// Continues the cursor traversal with the next sibling of the cursor just - /// visited, without visiting its children. - static const int CXChildVisit_Continue = 1; +typedef _c_clang_getNullCursor = CXCursor Function(); - /// Recursively traverse the children of this cursor, using the same visitor - /// and client data. - static const int CXChildVisit_Recurse = 2; -} +typedef _dart_clang_getNullCursor = CXCursor Function(); -/// Properties for the printing policy. -abstract class CXPrintingPolicyProperty { - static const int CXPrintingPolicy_Indentation = 0; - static const int CXPrintingPolicy_SuppressSpecifiers = 1; - static const int CXPrintingPolicy_SuppressTagKeyword = 2; - static const int CXPrintingPolicy_IncludeTagDefinition = 3; - static const int CXPrintingPolicy_SuppressScope = 4; - static const int CXPrintingPolicy_SuppressUnwrittenScope = 5; - static const int CXPrintingPolicy_SuppressInitializers = 6; - static const int CXPrintingPolicy_ConstantArraySizeAsWritten = 7; - static const int CXPrintingPolicy_AnonymousTagLocations = 8; - static const int CXPrintingPolicy_SuppressStrongLifetime = 9; - static const int CXPrintingPolicy_SuppressLifetimeQualifiers = 10; - static const int CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11; - static const int CXPrintingPolicy_Bool = 12; - static const int CXPrintingPolicy_Restrict = 13; - static const int CXPrintingPolicy_Alignof = 14; - static const int CXPrintingPolicy_UnderscoreAlignof = 15; - static const int CXPrintingPolicy_UseVoidForZeroParams = 16; - static const int CXPrintingPolicy_TerseOutput = 17; - static const int CXPrintingPolicy_PolishForDeclaration = 18; - static const int CXPrintingPolicy_Half = 19; - static const int CXPrintingPolicy_MSWChar = 20; - static const int CXPrintingPolicy_IncludeNewlines = 21; - static const int CXPrintingPolicy_MSVCFormatting = 22; - static const int CXPrintingPolicy_ConstantsAsWritten = 23; - static const int CXPrintingPolicy_SuppressImplicitBase = 24; - static const int CXPrintingPolicy_FullyQualifiedName = 25; - static const int CXPrintingPolicy_LastProperty = 25; -} +typedef _c_clang_getTranslationUnitCursor = CXCursor Function( + ffi.Pointer arg0, +); -/// Property attributes for a CXCursor_ObjCPropertyDecl. -abstract class CXObjCPropertyAttrKind { - static const int CXObjCPropertyAttr_noattr = 0; - static const int CXObjCPropertyAttr_readonly = 1; - static const int CXObjCPropertyAttr_getter = 2; - static const int CXObjCPropertyAttr_assign = 4; - static const int CXObjCPropertyAttr_readwrite = 8; - static const int CXObjCPropertyAttr_retain = 16; - static const int CXObjCPropertyAttr_copy = 32; - static const int CXObjCPropertyAttr_nonatomic = 64; - static const int CXObjCPropertyAttr_setter = 128; - static const int CXObjCPropertyAttr_atomic = 256; - static const int CXObjCPropertyAttr_weak = 512; - static const int CXObjCPropertyAttr_strong = 1024; - static const int CXObjCPropertyAttr_unsafe_unretained = 2048; - static const int CXObjCPropertyAttr_class = 4096; -} +typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( + ffi.Pointer arg0, +); -/// 'Qualifiers' written next to the return and parameter types in Objective-C -/// method declarations. -abstract class CXObjCDeclQualifierKind { - static const int CXObjCDeclQualifier_None = 0; - static const int CXObjCDeclQualifier_In = 1; - static const int CXObjCDeclQualifier_Inout = 2; - static const int CXObjCDeclQualifier_Out = 4; - static const int CXObjCDeclQualifier_Bycopy = 8; - static const int CXObjCDeclQualifier_Byref = 16; - static const int CXObjCDeclQualifier_Oneway = 32; -} +typedef _c_clang_equalCursors = ffi.Uint32 Function( + CXCursor arg0, + CXCursor arg1, +); -abstract class CXNameRefFlags { - /// Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the range. - static const int CXNameRange_WantQualifier = 1; +typedef _dart_clang_equalCursors = int Function( + CXCursor arg0, + CXCursor arg1, +); - /// Include the explicit template arguments, e.g. in x.f, in the - /// range. - static const int CXNameRange_WantTemplateArgs = 2; +typedef _c_clang_Cursor_isNull = ffi.Int32 Function( + CXCursor cursor, +); - /// If the name is non-contiguous, return the full spanning range. - static const int CXNameRange_WantSinglePiece = 4; -} +typedef _dart_clang_Cursor_isNull = int Function( + CXCursor cursor, +); -/// Describes a kind of token. -abstract class CXTokenKind { - /// A token that contains some kind of punctuation. - static const int CXToken_Punctuation = 0; +typedef _c_clang_hashCursor = ffi.Uint32 Function( + CXCursor arg0, +); - /// A language keyword. - static const int CXToken_Keyword = 1; +typedef _dart_clang_hashCursor = int Function( + CXCursor arg0, +); - /// An identifier (that is not a keyword). - static const int CXToken_Identifier = 2; +typedef _c_clang_getCursorKind = ffi.Int32 Function( + CXCursor arg0, +); - /// A numeric, string, or character literal. - static const int CXToken_Literal = 3; +typedef _dart_clang_getCursorKind = int Function( + CXCursor arg0, +); - /// A comment. - static const int CXToken_Comment = 4; -} +typedef _c_clang_isDeclaration = ffi.Uint32 Function( + ffi.Int32 arg0, +); -/// Describes a single preprocessing token. -class CXToken extends ffi.Struct { - @ffi.Uint32() - external int _unique_int_data_item_0; - @ffi.Uint32() - external int _unique_int_data_item_1; - @ffi.Uint32() - external int _unique_int_data_item_2; - @ffi.Uint32() - external int _unique_int_data_item_3; +typedef _dart_clang_isDeclaration = int Function( + int arg0, +); - /// Helper for array `int_data`. - ArrayHelper_CXToken_int_data_level0 get int_data => - ArrayHelper_CXToken_int_data_level0(this, [4], 0, 0); - external ffi.Pointer ptr_data; -} +typedef _c_clang_isInvalidDeclaration = ffi.Uint32 Function( + CXCursor arg0, +); -/// Helper for array `int_data` in struct `CXToken`. -class ArrayHelper_CXToken_int_data_level0 { - final CXToken _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXToken_int_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } - } +typedef _dart_clang_isInvalidDeclaration = int Function( + CXCursor arg0, +); - int operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_int_data_item_0; - case 1: - return _struct._unique_int_data_item_1; - case 2: - return _struct._unique_int_data_item_2; - case 3: - return _struct._unique_int_data_item_3; - default: - throw Exception('Invalid Array Helper generated.'); - } - } +typedef _c_clang_isReference = ffi.Uint32 Function( + ffi.Int32 arg0, +); - void operator []=(int index, int value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_int_data_item_0 = value; - break; - case 1: - _struct._unique_int_data_item_1 = value; - break; - case 2: - _struct._unique_int_data_item_2 = value; - break; - case 3: - _struct._unique_int_data_item_3 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} +typedef _dart_clang_isReference = int Function( + int arg0, +); -/// A single result of code completion. -class CXCompletionResult extends ffi.Struct { - /// The kind of entity that this completion refers to. - @ffi.Int32() - external int CursorKind; +typedef _c_clang_isExpression = ffi.Uint32 Function( + ffi.Int32 arg0, +); - /// The code-completion string that describes how to insert this - /// code-completion result into the editing buffer. - external ffi.Pointer CompletionString; -} +typedef _dart_clang_isExpression = int Function( + int arg0, +); -/// Describes a single piece of text within a code-completion string. -abstract class CXCompletionChunkKind { - /// A code-completion string that describes "optional" text that could be a - /// part of the template (but is not required). - static const int CXCompletionChunk_Optional = 0; +typedef _c_clang_isStatement = ffi.Uint32 Function( + ffi.Int32 arg0, +); - /// Text that a user would be expected to type to get this code-completion - /// result. - static const int CXCompletionChunk_TypedText = 1; +typedef _dart_clang_isStatement = int Function( + int arg0, +); - /// Text that should be inserted as part of a code-completion result. - static const int CXCompletionChunk_Text = 2; +typedef _c_clang_isAttribute = ffi.Uint32 Function( + ffi.Int32 arg0, +); - /// Placeholder text that should be replaced by the user. - static const int CXCompletionChunk_Placeholder = 3; +typedef _dart_clang_isAttribute = int Function( + int arg0, +); - /// Informative text that should be displayed but never inserted as part of - /// the template. - static const int CXCompletionChunk_Informative = 4; +typedef _c_clang_Cursor_hasAttrs = ffi.Uint32 Function( + CXCursor C, +); - /// Text that describes the current parameter when code-completion is - /// referring to function call, message send, or template specialization. - static const int CXCompletionChunk_CurrentParameter = 5; +typedef _dart_clang_Cursor_hasAttrs = int Function( + CXCursor C, +); - /// A left parenthesis ('('), used to initiate a function call or signal the - /// beginning of a function parameter list. - static const int CXCompletionChunk_LeftParen = 6; +typedef _c_clang_isInvalid = ffi.Uint32 Function( + ffi.Int32 arg0, +); - /// A right parenthesis (')'), used to finish a function call or signal the - /// end of a function parameter list. - static const int CXCompletionChunk_RightParen = 7; +typedef _dart_clang_isInvalid = int Function( + int arg0, +); + +typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( + ffi.Int32 arg0, +); + +typedef _dart_clang_isTranslationUnit = int Function( + int arg0, +); - /// A left bracket ('['). - static const int CXCompletionChunk_LeftBracket = 8; +typedef _c_clang_isPreprocessing = ffi.Uint32 Function( + ffi.Int32 arg0, +); - /// A right bracket (']'). - static const int CXCompletionChunk_RightBracket = 9; +typedef _dart_clang_isPreprocessing = int Function( + int arg0, +); - /// A left brace ('{'). - static const int CXCompletionChunk_LeftBrace = 10; +typedef _c_clang_isUnexposed = ffi.Uint32 Function( + ffi.Int32 arg0, +); - /// A right brace ('}'). - static const int CXCompletionChunk_RightBrace = 11; +typedef _dart_clang_isUnexposed = int Function( + int arg0, +); - /// A left angle bracket ('<'). - static const int CXCompletionChunk_LeftAngle = 12; +typedef _c_clang_getCursorLinkage = ffi.Int32 Function( + CXCursor cursor, +); - /// A right angle bracket ('>'). - static const int CXCompletionChunk_RightAngle = 13; +typedef _dart_clang_getCursorLinkage = int Function( + CXCursor cursor, +); - /// A comma separator (','). - static const int CXCompletionChunk_Comma = 14; +typedef _c_clang_getCursorVisibility = ffi.Int32 Function( + CXCursor cursor, +); - /// Text that specifies the result type of a given result. - static const int CXCompletionChunk_ResultType = 15; +typedef _dart_clang_getCursorVisibility = int Function( + CXCursor cursor, +); - /// A colon (':'). - static const int CXCompletionChunk_Colon = 16; +typedef _c_clang_getCursorAvailability = ffi.Int32 Function( + CXCursor cursor, +); - /// A semicolon (';'). - static const int CXCompletionChunk_SemiColon = 17; +typedef _dart_clang_getCursorAvailability = int Function( + CXCursor cursor, +); - /// An '=' sign. - static const int CXCompletionChunk_Equal = 18; +typedef _c_clang_getCursorPlatformAvailability = ffi.Int32 Function( + CXCursor cursor, + ffi.Pointer always_deprecated, + ffi.Pointer deprecated_message, + ffi.Pointer always_unavailable, + ffi.Pointer unavailable_message, + ffi.Pointer availability, + ffi.Int32 availability_size, +); - /// Horizontal space (' '). - static const int CXCompletionChunk_HorizontalSpace = 19; +typedef _dart_clang_getCursorPlatformAvailability = int Function( + CXCursor cursor, + ffi.Pointer always_deprecated, + ffi.Pointer deprecated_message, + ffi.Pointer always_unavailable, + ffi.Pointer unavailable_message, + ffi.Pointer availability, + int availability_size, +); - /// Vertical space ('\n'), after which it is generally a good idea to perform - /// indentation. - static const int CXCompletionChunk_VerticalSpace = 20; -} +typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability, +); -/// Contains the results of code-completion. -class CXCodeCompleteResults extends ffi.Struct { - /// The code-completion results. - external ffi.Pointer Results; +typedef _dart_clang_disposeCXPlatformAvailability = void Function( + ffi.Pointer availability, +); - /// The number of code-completion results stored in the Results array. - @ffi.Uint32() - external int NumResults; -} +typedef _c_clang_getCursorLanguage = ffi.Int32 Function( + CXCursor cursor, +); -/// Flags that can be passed to clang_codeCompleteAt() to modify its behavior. -abstract class CXCodeComplete_Flags { - /// Whether to include macros within the set of code completions returned. - static const int CXCodeComplete_IncludeMacros = 1; +typedef _dart_clang_getCursorLanguage = int Function( + CXCursor cursor, +); - /// Whether to include code patterns for language constructs within the set of - /// code completions, e.g., for loops. - static const int CXCodeComplete_IncludeCodePatterns = 2; +typedef _c_clang_getCursorTLSKind = ffi.Int32 Function( + CXCursor cursor, +); - /// Whether to include brief documentation within the set of code completions - /// returned. - static const int CXCodeComplete_IncludeBriefComments = 4; +typedef _dart_clang_getCursorTLSKind = int Function( + CXCursor cursor, +); - /// Whether to speed up completion by omitting top- or namespace-level - /// entities defined in the preamble. There's no guarantee any particular - /// entity is omitted. This may be useful if the headers are indexed - /// externally. - static const int CXCodeComplete_SkipPreamble = 8; +typedef _c_clang_Cursor_getTranslationUnit = ffi.Pointer + Function( + CXCursor arg0, +); - /// Whether to include completions with small fix-its, e.g. change '.' to '->' - /// on member access, etc. - static const int CXCodeComplete_IncludeCompletionsWithFixIts = 16; -} +typedef _dart_clang_Cursor_getTranslationUnit + = ffi.Pointer Function( + CXCursor arg0, +); -/// Bits that represent the context under which completion is occurring. -abstract class CXCompletionContext { - /// The context for completions is unexposed, as only Clang results should be - /// included. (This is equivalent to having no context bits set.) - static const int CXCompletionContext_Unexposed = 0; +typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); - /// Completions for any possible type should be included in the results. - static const int CXCompletionContext_AnyType = 1; +typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); - /// Completions for any possible value (variables, function calls, etc.) - /// should be included in the results. - static const int CXCompletionContext_AnyValue = 2; +typedef _c_clang_disposeCXCursorSet = ffi.Void Function( + ffi.Pointer cset, +); - /// Completions for values that resolve to an Objective-C object should be - /// included in the results. - static const int CXCompletionContext_ObjCObjectValue = 4; +typedef _dart_clang_disposeCXCursorSet = void Function( + ffi.Pointer cset, +); - /// Completions for values that resolve to an Objective-C selector should be - /// included in the results. - static const int CXCompletionContext_ObjCSelectorValue = 8; +typedef _c_clang_CXCursorSet_contains = ffi.Uint32 Function( + ffi.Pointer cset, + CXCursor cursor, +); - /// Completions for values that resolve to a C++ class type should be included - /// in the results. - static const int CXCompletionContext_CXXClassTypeValue = 16; +typedef _dart_clang_CXCursorSet_contains = int Function( + ffi.Pointer cset, + CXCursor cursor, +); - /// Completions for fields of the member being accessed using the dot operator - /// should be included in the results. - static const int CXCompletionContext_DotMemberAccess = 32; +typedef _c_clang_CXCursorSet_insert = ffi.Uint32 Function( + ffi.Pointer cset, + CXCursor cursor, +); - /// Completions for fields of the member being accessed using the arrow - /// operator should be included in the results. - static const int CXCompletionContext_ArrowMemberAccess = 64; +typedef _dart_clang_CXCursorSet_insert = int Function( + ffi.Pointer cset, + CXCursor cursor, +); - /// Completions for properties of the Objective-C object being accessed using - /// the dot operator should be included in the results. - static const int CXCompletionContext_ObjCPropertyAccess = 128; +typedef _c_clang_getCursorSemanticParent = CXCursor Function( + CXCursor cursor, +); - /// Completions for enum tags should be included in the results. - static const int CXCompletionContext_EnumTag = 256; +typedef _dart_clang_getCursorSemanticParent = CXCursor Function( + CXCursor cursor, +); - /// Completions for union tags should be included in the results. - static const int CXCompletionContext_UnionTag = 512; +typedef _c_clang_getCursorLexicalParent = CXCursor Function( + CXCursor cursor, +); - /// Completions for struct tags should be included in the results. - static const int CXCompletionContext_StructTag = 1024; +typedef _dart_clang_getCursorLexicalParent = CXCursor Function( + CXCursor cursor, +); - /// Completions for C++ class names should be included in the results. - static const int CXCompletionContext_ClassTag = 2048; +typedef _c_clang_getOverriddenCursors = ffi.Void Function( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden, +); - /// Completions for C++ namespaces and namespace aliases should be included in - /// the results. - static const int CXCompletionContext_Namespace = 4096; +typedef _dart_clang_getOverriddenCursors = void Function( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden, +); - /// Completions for C++ nested name specifiers should be included in the - /// results. - static const int CXCompletionContext_NestedNameSpecifier = 8192; +typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden, +); - /// Completions for Objective-C interfaces (classes) should be included in the - /// results. - static const int CXCompletionContext_ObjCInterface = 16384; +typedef _dart_clang_disposeOverriddenCursors = void Function( + ffi.Pointer overridden, +); - /// Completions for Objective-C protocols should be included in the results. - static const int CXCompletionContext_ObjCProtocol = 32768; +typedef _c_clang_getIncludedFile = ffi.Pointer Function( + CXCursor cursor, +); - /// Completions for Objective-C categories should be included in the results. - static const int CXCompletionContext_ObjCCategory = 65536; +typedef _dart_clang_getIncludedFile = ffi.Pointer Function( + CXCursor cursor, +); - /// Completions for Objective-C instance messages should be included in the - /// results. - static const int CXCompletionContext_ObjCInstanceMessage = 131072; +typedef _c_clang_getCursor = CXCursor Function( + ffi.Pointer arg0, + CXSourceLocation arg1, +); - /// Completions for Objective-C class messages should be included in the - /// results. - static const int CXCompletionContext_ObjCClassMessage = 262144; +typedef _dart_clang_getCursor = CXCursor Function( + ffi.Pointer arg0, + CXSourceLocation arg1, +); - /// Completions for Objective-C selector names should be included in the - /// results. - static const int CXCompletionContext_ObjCSelectorName = 524288; +typedef _c_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0, +); - /// Completions for preprocessor macro names should be included in the - /// results. - static const int CXCompletionContext_MacroName = 1048576; +typedef _dart_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0, +); - /// Natural language completions should be included in the results. - static const int CXCompletionContext_NaturalLanguage = 2097152; +typedef _c_clang_getCursorExtent = CXSourceRange Function( + CXCursor arg0, +); - /// #include file completions should be included in the results. - static const int CXCompletionContext_IncludedFile = 4194304; +typedef _dart_clang_getCursorExtent = CXSourceRange Function( + CXCursor arg0, +); - /// The current context is unknown, so set all contexts. - static const int CXCompletionContext_Unknown = 8388607; -} +typedef _c_clang_getCursorType = CXType Function( + CXCursor C, +); -abstract class CXEvalResultKind { - static const int CXEval_Int = 1; - static const int CXEval_Float = 2; - static const int CXEval_ObjCStrLiteral = 3; - static const int CXEval_StrLiteral = 4; - static const int CXEval_CFStr = 5; - static const int CXEval_Other = 6; - static const int CXEval_UnExposed = 0; -} +typedef _dart_clang_getCursorType = CXType Function( + CXCursor C, +); -/// @{ -abstract class CXVisitorResult { - static const int CXVisit_Break = 0; - static const int CXVisit_Continue = 1; -} +typedef _c_clang_getTypeSpelling = CXString Function( + CXType CT, +); -class CXCursorAndRangeVisitor extends ffi.Struct {} +typedef _dart_clang_getTypeSpelling = CXString Function( + CXType CT, +); -abstract class CXResult { - /// Function returned successfully. - static const int CXResult_Success = 0; +typedef _c_clang_getTypedefDeclUnderlyingType = CXType Function( + CXCursor C, +); - /// One of the parameters was invalid for the function. - static const int CXResult_Invalid = 1; +typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( + CXCursor C, +); - /// The function was terminated by a callback (e.g. it returned CXVisit_Break) - static const int CXResult_VisitBreak = 2; -} +typedef _c_clang_getEnumDeclIntegerType = CXType Function( + CXCursor C, +); -/// Source location passed to index callbacks. -class CXIdxLoc extends ffi.Struct { - external ffi.Pointer _unique_ptr_data_item_0; - external ffi.Pointer _unique_ptr_data_item_1; +typedef _dart_clang_getEnumDeclIntegerType = CXType Function( + CXCursor C, +); - /// Helper for array `ptr_data`. - ArrayHelper_CXIdxLoc_ptr_data_level0 get ptr_data => - ArrayHelper_CXIdxLoc_ptr_data_level0(this, [2], 0, 0); - @ffi.Uint32() - external int int_data; -} +typedef _c_clang_getEnumConstantDeclValue = ffi.Int64 Function( + CXCursor C, +); -/// Helper for array `ptr_data` in struct `CXIdxLoc`. -class ArrayHelper_CXIdxLoc_ptr_data_level0 { - final CXIdxLoc _struct; - final List dimensions; - final int level; - final int _absoluteIndex; - int get length => dimensions[level]; - ArrayHelper_CXIdxLoc_ptr_data_level0( - this._struct, this.dimensions, this.level, this._absoluteIndex); - void _checkBounds(int index) { - if (index >= length || index < 0) { - throw RangeError( - 'Dimension $level: index not in range 0..${length} exclusive.'); - } - } +typedef _dart_clang_getEnumConstantDeclValue = int Function( + CXCursor C, +); + +typedef _c_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( + CXCursor C, +); - ffi.Pointer operator [](int index) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - return _struct._unique_ptr_data_item_0; - case 1: - return _struct._unique_ptr_data_item_1; - default: - throw Exception('Invalid Array Helper generated.'); - } - } +typedef _dart_clang_getEnumConstantDeclUnsignedValue = int Function( + CXCursor C, +); - void operator []=(int index, ffi.Pointer value) { - _checkBounds(index); - switch (_absoluteIndex + index) { - case 0: - _struct._unique_ptr_data_item_0 = value; - break; - case 1: - _struct._unique_ptr_data_item_1 = value; - break; - default: - throw Exception('Invalid Array Helper generated.'); - } - } -} +typedef _c_clang_getFieldDeclBitWidth = ffi.Int32 Function( + CXCursor C, +); -/// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct { - /// Location of '#' in the #include/#import directive. - external CXIdxLoc hashLoc; +typedef _dart_clang_getFieldDeclBitWidth = int Function( + CXCursor C, +); - /// Filename as written in the #include/#import directive. - external ffi.Pointer filename; +typedef _c_clang_Cursor_getNumArguments = ffi.Int32 Function( + CXCursor C, +); - /// The actual file that the #include/#import directive resolved to. - external ffi.Pointer file; +typedef _dart_clang_Cursor_getNumArguments = int Function( + CXCursor C, +); - @ffi.Int32() - external int isImport; +typedef _c_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, + ffi.Uint32 i, +); - @ffi.Int32() - external int isAngled; +typedef _dart_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, + int i, +); - /// Non-zero if the directive was automatically turned into a module import. - @ffi.Int32() - external int isModuleImport; -} +typedef _c_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( + CXCursor C, +); -/// Data for IndexerCallbacks#importedASTFile. -class CXIdxImportedASTFileInfo extends ffi.Struct { - /// Top level AST file containing the imported PCH, module or submodule. - external ffi.Pointer file; +typedef _dart_clang_Cursor_getNumTemplateArguments = int Function( + CXCursor C, +); - /// The imported module or NULL if the AST file is a PCH. - external ffi.Pointer module; +typedef _c_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( + CXCursor C, + ffi.Uint32 I, +); - /// Location where the file is imported. Applicable only for modules. - external CXIdxLoc loc; +typedef _dart_clang_Cursor_getTemplateArgumentKind = int Function( + CXCursor C, + int I, +); - /// Non-zero if an inclusion directive was automatically turned into a module - /// import. Applicable only for modules. - @ffi.Int32() - external int isImplicit; -} +typedef _c_clang_Cursor_getTemplateArgumentType = CXType Function( + CXCursor C, + ffi.Uint32 I, +); -abstract class CXIdxEntityKind { - static const int CXIdxEntity_Unexposed = 0; - static const int CXIdxEntity_Typedef = 1; - static const int CXIdxEntity_Function = 2; - static const int CXIdxEntity_Variable = 3; - static const int CXIdxEntity_Field = 4; - static const int CXIdxEntity_EnumConstant = 5; - static const int CXIdxEntity_ObjCClass = 6; - static const int CXIdxEntity_ObjCProtocol = 7; - static const int CXIdxEntity_ObjCCategory = 8; - static const int CXIdxEntity_ObjCInstanceMethod = 9; - static const int CXIdxEntity_ObjCClassMethod = 10; - static const int CXIdxEntity_ObjCProperty = 11; - static const int CXIdxEntity_ObjCIvar = 12; - static const int CXIdxEntity_Enum = 13; - static const int CXIdxEntity_Struct = 14; - static const int CXIdxEntity_Union = 15; - static const int CXIdxEntity_CXXClass = 16; - static const int CXIdxEntity_CXXNamespace = 17; - static const int CXIdxEntity_CXXNamespaceAlias = 18; - static const int CXIdxEntity_CXXStaticVariable = 19; - static const int CXIdxEntity_CXXStaticMethod = 20; - static const int CXIdxEntity_CXXInstanceMethod = 21; - static const int CXIdxEntity_CXXConstructor = 22; - static const int CXIdxEntity_CXXDestructor = 23; - static const int CXIdxEntity_CXXConversionFunction = 24; - static const int CXIdxEntity_CXXTypeAlias = 25; - static const int CXIdxEntity_CXXInterface = 26; -} +typedef _dart_clang_Cursor_getTemplateArgumentType = CXType Function( + CXCursor C, + int I, +); -abstract class CXIdxEntityLanguage { - static const int CXIdxEntityLang_None = 0; - static const int CXIdxEntityLang_C = 1; - static const int CXIdxEntityLang_ObjC = 2; - static const int CXIdxEntityLang_CXX = 3; - static const int CXIdxEntityLang_Swift = 4; -} +typedef _c_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( + CXCursor C, + ffi.Uint32 I, +); -/// Extra C++ template information for an entity. This can apply to: -/// CXIdxEntity_Function CXIdxEntity_CXXClass CXIdxEntity_CXXStaticMethod -/// CXIdxEntity_CXXInstanceMethod CXIdxEntity_CXXConstructor -/// CXIdxEntity_CXXConversionFunction CXIdxEntity_CXXTypeAlias -abstract class CXIdxEntityCXXTemplateKind { - static const int CXIdxEntity_NonTemplate = 0; - static const int CXIdxEntity_Template = 1; - static const int CXIdxEntity_TemplatePartialSpecialization = 2; - static const int CXIdxEntity_TemplateSpecialization = 3; -} +typedef _dart_clang_Cursor_getTemplateArgumentValue = int Function( + CXCursor C, + int I, +); -abstract class CXIdxAttrKind { - static const int CXIdxAttr_Unexposed = 0; - static const int CXIdxAttr_IBAction = 1; - static const int CXIdxAttr_IBOutlet = 2; - static const int CXIdxAttr_IBOutletCollection = 3; -} +typedef _c_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 Function( + CXCursor C, + ffi.Uint32 I, +); -class CXIdxAttrInfo extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _dart_clang_Cursor_getTemplateArgumentUnsignedValue = int Function( + CXCursor C, + int I, +); - external CXCursor cursor; +typedef _c_clang_equalTypes = ffi.Uint32 Function( + CXType A, + CXType B, +); - external CXIdxLoc loc; -} +typedef _dart_clang_equalTypes = int Function( + CXType A, + CXType B, +); -class CXIdxEntityInfo extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _c_clang_getCanonicalType = CXType Function( + CXType T, +); - @ffi.Int32() - external int templateKind; +typedef _dart_clang_getCanonicalType = CXType Function( + CXType T, +); - @ffi.Int32() - external int lang; +typedef _c_clang_isConstQualifiedType = ffi.Uint32 Function( + CXType T, +); - external ffi.Pointer name; +typedef _dart_clang_isConstQualifiedType = int Function( + CXType T, +); - external ffi.Pointer USR; +typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( + CXCursor C, +); - external CXCursor cursor; +typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( + CXCursor C, +); - external ffi.Pointer> attributes; +typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( + CXCursor C, +); - @ffi.Uint32() - external int numAttributes; -} +typedef _dart_clang_Cursor_isMacroBuiltin = int Function( + CXCursor C, +); -class CXIdxContainerInfo extends ffi.Struct { - external CXCursor cursor; -} +typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( + CXCursor C, +); -class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { - external ffi.Pointer attrInfo; +typedef _dart_clang_Cursor_isFunctionInlined = int Function( + CXCursor C, +); - external ffi.Pointer objcClass; +typedef _c_clang_isVolatileQualifiedType = ffi.Uint32 Function( + CXType T, +); - external CXCursor classCursor; +typedef _dart_clang_isVolatileQualifiedType = int Function( + CXType T, +); - external CXIdxLoc classLoc; -} +typedef _c_clang_isRestrictQualifiedType = ffi.Uint32 Function( + CXType T, +); -abstract class CXIdxDeclInfoFlags { - static const int CXIdxDeclFlag_Skipped = 1; -} +typedef _dart_clang_isRestrictQualifiedType = int Function( + CXType T, +); -class CXIdxDeclInfo extends ffi.Struct { - external ffi.Pointer entityInfo; +typedef _c_clang_getAddressSpace = ffi.Uint32 Function( + CXType T, +); - external CXCursor cursor; +typedef _dart_clang_getAddressSpace = int Function( + CXType T, +); - external CXIdxLoc loc; +typedef _c_clang_getTypedefName = CXString Function( + CXType CT, +); - external ffi.Pointer semanticContainer; +typedef _dart_clang_getTypedefName = CXString Function( + CXType CT, +); - /// Generally same as #semanticContainer but can be different in cases like - /// out-of-line C++ member functions. - external ffi.Pointer lexicalContainer; +typedef _c_clang_getPointeeType = CXType Function( + CXType T, +); - @ffi.Int32() - external int isRedeclaration; +typedef _dart_clang_getPointeeType = CXType Function( + CXType T, +); - @ffi.Int32() - external int isDefinition; +typedef _c_clang_getTypeDeclaration = CXCursor Function( + CXType T, +); - @ffi.Int32() - external int isContainer; +typedef _dart_clang_getTypeDeclaration = CXCursor Function( + CXType T, +); - external ffi.Pointer declAsContainer; +typedef _c_clang_getDeclObjCTypeEncoding = CXString Function( + CXCursor C, +); - /// Whether the declaration exists in code or was created implicitly by the - /// compiler, e.g. implicit Objective-C methods for properties. - @ffi.Int32() - external int isImplicit; +typedef _dart_clang_getDeclObjCTypeEncoding = CXString Function( + CXCursor C, +); - external ffi.Pointer> attributes; +typedef _c_clang_Type_getObjCEncoding = CXString Function( + CXType type, +); - @ffi.Uint32() - external int numAttributes; +typedef _dart_clang_Type_getObjCEncoding = CXString Function( + CXType type, +); - @ffi.Uint32() - external int flags; -} +typedef _c_clang_getTypeKindSpelling = CXString Function( + ffi.Int32 K, +); -abstract class CXIdxObjCContainerKind { - static const int CXIdxObjCContainer_ForwardRef = 0; - static const int CXIdxObjCContainer_Interface = 1; - static const int CXIdxObjCContainer_Implementation = 2; -} +typedef _dart_clang_getTypeKindSpelling = CXString Function( + int K, +); -class CXIdxObjCContainerDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; +typedef _c_clang_getFunctionTypeCallingConv = ffi.Int32 Function( + CXType T, +); - @ffi.Int32() - external int kind; -} +typedef _dart_clang_getFunctionTypeCallingConv = int Function( + CXType T, +); -class CXIdxBaseClassInfo extends ffi.Struct { - external ffi.Pointer base; +typedef _c_clang_getResultType = CXType Function( + CXType T, +); - external CXCursor cursor; +typedef _dart_clang_getResultType = CXType Function( + CXType T, +); - external CXIdxLoc loc; -} +typedef _c_clang_getExceptionSpecificationType = ffi.Int32 Function( + CXType T, +); -class CXIdxObjCProtocolRefInfo extends ffi.Struct { - external ffi.Pointer protocol; +typedef _dart_clang_getExceptionSpecificationType = int Function( + CXType T, +); - external CXCursor cursor; +typedef _c_clang_getNumArgTypes = ffi.Int32 Function( + CXType T, +); - external CXIdxLoc loc; -} +typedef _dart_clang_getNumArgTypes = int Function( + CXType T, +); -class CXIdxObjCProtocolRefListInfo extends ffi.Struct { - external ffi.Pointer> protocols; +typedef _c_clang_getArgType = CXType Function( + CXType T, + ffi.Uint32 i, +); - @ffi.Uint32() - external int numProtocols; -} +typedef _dart_clang_getArgType = CXType Function( + CXType T, + int i, +); -class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { - external ffi.Pointer containerInfo; +typedef _c_clang_Type_getObjCObjectBaseType = CXType Function( + CXType T, +); - external ffi.Pointer superInfo; +typedef _dart_clang_Type_getObjCObjectBaseType = CXType Function( + CXType T, +); - external ffi.Pointer protocols; -} +typedef _c_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( + CXType T, +); -class CXIdxObjCCategoryDeclInfo extends ffi.Struct { - external ffi.Pointer containerInfo; +typedef _dart_clang_Type_getNumObjCProtocolRefs = int Function( + CXType T, +); - external ffi.Pointer objcClass; +typedef _c_clang_Type_getObjCProtocolDecl = CXCursor Function( + CXType T, + ffi.Uint32 i, +); - external CXCursor classCursor; +typedef _dart_clang_Type_getObjCProtocolDecl = CXCursor Function( + CXType T, + int i, +); - external CXIdxLoc classLoc; +typedef _c_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( + CXType T, +); - external ffi.Pointer protocols; -} +typedef _dart_clang_Type_getNumObjCTypeArgs = int Function( + CXType T, +); -class CXIdxObjCPropertyDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; +typedef _c_clang_Type_getObjCTypeArg = CXType Function( + CXType T, + ffi.Uint32 i, +); - external ffi.Pointer getter; +typedef _dart_clang_Type_getObjCTypeArg = CXType Function( + CXType T, + int i, +); - external ffi.Pointer setter; -} +typedef _c_clang_isFunctionTypeVariadic = ffi.Uint32 Function( + CXType T, +); -class CXIdxCXXClassDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; +typedef _dart_clang_isFunctionTypeVariadic = int Function( + CXType T, +); - external ffi.Pointer> bases; +typedef _c_clang_getCursorResultType = CXType Function( + CXCursor C, +); - @ffi.Uint32() - external int numBases; -} +typedef _dart_clang_getCursorResultType = CXType Function( + CXCursor C, +); -/// Data for IndexerCallbacks#indexEntityReference. -abstract class CXIdxEntityRefKind { - /// The entity is referenced directly in user's code. - static const int CXIdxEntityRef_Direct = 1; +typedef _c_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( + CXCursor C, +); - /// An implicit reference, e.g. a reference of an Objective-C method via the - /// dot syntax. - static const int CXIdxEntityRef_Implicit = 2; -} +typedef _dart_clang_getCursorExceptionSpecificationType = int Function( + CXCursor C, +); -/// Roles that are attributed to symbol occurrences. -abstract class CXSymbolRole { - static const int CXSymbolRole_None = 0; - static const int CXSymbolRole_Declaration = 1; - static const int CXSymbolRole_Definition = 2; - static const int CXSymbolRole_Reference = 4; - static const int CXSymbolRole_Read = 8; - static const int CXSymbolRole_Write = 16; - static const int CXSymbolRole_Call = 32; - static const int CXSymbolRole_Dynamic = 64; - static const int CXSymbolRole_AddressOf = 128; - static const int CXSymbolRole_Implicit = 256; -} +typedef _c_clang_isPODType = ffi.Uint32 Function( + CXType T, +); -/// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct { - @ffi.Int32() - external int kind; +typedef _dart_clang_isPODType = int Function( + CXType T, +); - /// Reference cursor. - external CXCursor cursor; +typedef _c_clang_getElementType = CXType Function( + CXType T, +); - external CXIdxLoc loc; +typedef _dart_clang_getElementType = CXType Function( + CXType T, +); - /// The entity that gets referenced. - external ffi.Pointer referencedEntity; +typedef _c_clang_getNumElements = ffi.Int64 Function( + CXType T, +); - /// Immediate "parent" of the reference. For example: - external ffi.Pointer parentEntity; +typedef _dart_clang_getNumElements = int Function( + CXType T, +); - /// Lexical container context of the reference. - external ffi.Pointer container; +typedef _c_clang_getArrayElementType = CXType Function( + CXType T, +); - /// Sets of symbol roles of the reference. - @ffi.Int32() - external int role; -} +typedef _dart_clang_getArrayElementType = CXType Function( + CXType T, +); -/// A group of callbacks used by #clang_indexSourceFile and -/// #clang_indexTranslationUnit. -class IndexerCallbacks extends ffi.Struct { - /// Called periodically to check whether indexing should be aborted. Should - /// return 0 to continue, and non-zero to abort. - external ffi.Pointer> abortQuery; +typedef _c_clang_getArraySize = ffi.Int64 Function( + CXType T, +); - /// Called at the end of indexing; passes the complete diagnostic set. - external ffi.Pointer> diagnostic; +typedef _dart_clang_getArraySize = int Function( + CXType T, +); - external ffi.Pointer> enteredMainFile; +typedef _c_clang_Type_getNamedType = CXType Function( + CXType T, +); - /// Called when a file gets #included/#imported. - external ffi.Pointer> ppIncludedFile; +typedef _dart_clang_Type_getNamedType = CXType Function( + CXType T, +); - /// Called when a AST file (PCH or module) gets imported. - external ffi.Pointer> importedASTFile; +typedef _c_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( + CXType T, +); - /// Called at the beginning of indexing a translation unit. - external ffi.Pointer> startedTranslationUnit; +typedef _dart_clang_Type_isTransparentTagTypedef = int Function( + CXType T, +); - external ffi.Pointer> indexDeclaration; +typedef _c_clang_Type_getNullability = ffi.Int32 Function( + CXType T, +); - /// Called to index a reference of an entity. - external ffi.Pointer> indexEntityReference; -} +typedef _dart_clang_Type_getNullability = int Function( + CXType T, +); -abstract class CXIndexOptFlags { - /// Used to indicate that no special indexing options are needed. - static const int CXIndexOpt_None = 0; +typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( + CXType T, +); - /// Used to indicate that IndexerCallbacks#indexEntityReference should be - /// invoked for only one reference of an entity per source file that does not - /// also include a declaration/definition of the entity. - static const int CXIndexOpt_SuppressRedundantRefs = 1; +typedef _dart_clang_Type_getAlignOf = int Function( + CXType T, +); - /// Function-local symbols should be indexed. If this is not set - /// function-local symbols will be ignored. - static const int CXIndexOpt_IndexFunctionLocalSymbols = 2; +typedef _c_clang_Type_getClassType = CXType Function( + CXType T, +); - /// Implicit function/class template instantiations should be indexed. If this - /// is not set, implicit instantiations will be ignored. - static const int CXIndexOpt_IndexImplicitTemplateInstantiations = 4; +typedef _dart_clang_Type_getClassType = CXType Function( + CXType T, +); - /// Suppress all compiler warnings when parsing for indexing. - static const int CXIndexOpt_SuppressWarnings = 8; +typedef _c_clang_Type_getSizeOf = ffi.Int64 Function( + CXType T, +); - /// Skip a function/method body that was already parsed during an indexing - /// session associated with a CXIndexAction object. Bodies in system headers - /// are always skipped. - static const int CXIndexOpt_SkipParsedBodiesInSession = 16; -} +typedef _dart_clang_Type_getSizeOf = int Function( + CXType T, +); -const int CINDEX_VERSION_MAJOR = 0; +typedef _c_clang_Type_getOffsetOf = ffi.Int64 Function( + CXType T, + ffi.Pointer S, +); -const int CINDEX_VERSION_MINOR = 59; +typedef _dart_clang_Type_getOffsetOf = int Function( + CXType T, + ffi.Pointer S, +); -const int CINDEX_VERSION = 59; +typedef _c_clang_Type_getModifiedType = CXType Function( + CXType T, +); -const String CINDEX_VERSION_STRING = '0.59'; +typedef _dart_clang_Type_getModifiedType = CXType Function( + CXType T, +); -typedef _c_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set_1, +typedef _c_clang_Cursor_getOffsetOfField = ffi.Int64 Function( + CXCursor C, ); -typedef _dart_clang_disposeStringSet = void Function( - ffi.Pointer set_1, +typedef _dart_clang_Cursor_getOffsetOfField = int Function( + CXCursor C, ); -typedef _c_clang_getBuildSessionTimestamp = ffi.Uint64 Function(); +typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( + CXCursor C, +); -typedef _dart_clang_getBuildSessionTimestamp = int Function(); +typedef _dart_clang_Cursor_isAnonymous = int Function( + CXCursor C, +); -typedef _c_clang_VirtualFileOverlay_create - = ffi.Pointer Function( - ffi.Uint32 options, +typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_VirtualFileOverlay_create - = ffi.Pointer Function( - int options, +typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( + CXCursor C, ); -typedef _c_clang_VirtualFileOverlay_addFileMapping = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer virtualPath, - ffi.Pointer realPath, +typedef _c_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_VirtualFileOverlay_addFileMapping = int Function( - ffi.Pointer arg0, - ffi.Pointer virtualPath, - ffi.Pointer realPath, +typedef _dart_clang_Cursor_isInlineNamespace = int Function( + CXCursor C, ); -typedef _c_clang_VirtualFileOverlay_setCaseSensitivity = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 caseSensitive, +typedef _c_clang_Type_getNumTemplateArguments = ffi.Int32 Function( + CXType T, ); -typedef _dart_clang_VirtualFileOverlay_setCaseSensitivity = int Function( - ffi.Pointer arg0, - int caseSensitive, +typedef _dart_clang_Type_getNumTemplateArguments = int Function( + CXType T, ); -typedef _c_clang_VirtualFileOverlay_writeToBuffer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint32 options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, +typedef _c_clang_Type_getTemplateArgumentAsType = CXType Function( + CXType T, + ffi.Uint32 i, ); -typedef _dart_clang_VirtualFileOverlay_writeToBuffer = int Function( - ffi.Pointer arg0, - int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, +typedef _dart_clang_Type_getTemplateArgumentAsType = CXType Function( + CXType T, + int i, ); -typedef _c_clang_free = ffi.Void Function( - ffi.Pointer buffer, +typedef _c_clang_Type_getCXXRefQualifier = ffi.Int32 Function( + CXType T, ); -typedef _dart_clang_free = void Function( - ffi.Pointer buffer, +typedef _dart_clang_Type_getCXXRefQualifier = int Function( + CXType T, ); -typedef _c_clang_VirtualFileOverlay_dispose = ffi.Void Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_isBitField = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_VirtualFileOverlay_dispose = void Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_isBitField = int Function( + CXCursor C, ); -typedef _c_clang_ModuleMapDescriptor_create - = ffi.Pointer Function( - ffi.Uint32 options, +typedef _c_clang_isVirtualBase = ffi.Uint32 Function( + CXCursor arg0, ); -typedef _dart_clang_ModuleMapDescriptor_create - = ffi.Pointer Function( - int options, +typedef _dart_clang_isVirtualBase = int Function( + CXCursor arg0, ); -typedef _c_clang_ModuleMapDescriptor_setFrameworkModuleName = ffi.Int32 - Function( - ffi.Pointer arg0, - ffi.Pointer name, +typedef _c_clang_getCXXAccessSpecifier = ffi.Int32 Function( + CXCursor arg0, ); -typedef _dart_clang_ModuleMapDescriptor_setFrameworkModuleName = int Function( - ffi.Pointer arg0, - ffi.Pointer name, +typedef _dart_clang_getCXXAccessSpecifier = int Function( + CXCursor arg0, ); -typedef _c_clang_ModuleMapDescriptor_setUmbrellaHeader = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer name, +typedef _c_clang_Cursor_getStorageClass = ffi.Int32 Function( + CXCursor arg0, ); -typedef _dart_clang_ModuleMapDescriptor_setUmbrellaHeader = int Function( - ffi.Pointer arg0, - ffi.Pointer name, +typedef _dart_clang_Cursor_getStorageClass = int Function( + CXCursor arg0, ); -typedef _c_clang_ModuleMapDescriptor_writeToBuffer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint32 options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, +typedef _c_clang_getNumOverloadedDecls = ffi.Uint32 Function( + CXCursor cursor, ); -typedef _dart_clang_ModuleMapDescriptor_writeToBuffer = int Function( - ffi.Pointer arg0, - int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, +typedef _dart_clang_getNumOverloadedDecls = int Function( + CXCursor cursor, ); -typedef _c_clang_ModuleMapDescriptor_dispose = ffi.Void Function( - ffi.Pointer arg0, +typedef _c_clang_getOverloadedDecl = CXCursor Function( + CXCursor cursor, + ffi.Uint32 index, ); -typedef _dart_clang_ModuleMapDescriptor_dispose = void Function( - ffi.Pointer arg0, +typedef _dart_clang_getOverloadedDecl = CXCursor Function( + CXCursor cursor, + int index, ); -typedef _c_clang_createIndex = ffi.Pointer Function( - ffi.Int32 excludeDeclarationsFromPCH, - ffi.Int32 displayDiagnostics, +typedef _c_clang_getIBOutletCollectionType = CXType Function( + CXCursor arg0, ); -typedef _dart_clang_createIndex = ffi.Pointer Function( - int excludeDeclarationsFromPCH, - int displayDiagnostics, +typedef _dart_clang_getIBOutletCollectionType = CXType Function( + CXCursor arg0, ); -typedef _c_clang_disposeIndex = ffi.Void Function( - ffi.Pointer index, +typedef CXCursorVisitor = ffi.Int32 Function( + CXCursor, + CXCursor, + ffi.Pointer, ); -typedef _dart_clang_disposeIndex = void Function( - ffi.Pointer index, +typedef _c_clang_visitChildren = ffi.Uint32 Function( + CXCursor parent, + ffi.Pointer> visitor, + ffi.Pointer client_data, ); -typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 options, +typedef _dart_clang_visitChildren = int Function( + CXCursor parent, + ffi.Pointer> visitor, + ffi.Pointer client_data, ); -typedef _dart_clang_CXIndex_setGlobalOptions = void Function( - ffi.Pointer arg0, - int options, +typedef _c_clang_getCursorUSR = CXString Function( + CXCursor arg0, ); -typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_getCursorUSR = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_CXIndex_getGlobalOptions = int Function( - ffi.Pointer arg0, +typedef _c_clang_constructUSR_ObjCClass = CXString Function( + ffi.Pointer class_name, ); -typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer Path, +typedef _dart_clang_constructUSR_ObjCClass = CXString Function( + ffi.Pointer class_name, ); -typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( - ffi.Pointer arg0, - ffi.Pointer Path, +typedef _c_clang_constructUSR_ObjCCategory = CXString Function( + ffi.Pointer class_name, + ffi.Pointer category_name, ); -typedef _c_clang_getFileTime = ffi.Int64 Function( - ffi.Pointer SFile, +typedef _dart_clang_constructUSR_ObjCCategory = CXString Function( + ffi.Pointer class_name, + ffi.Pointer category_name, ); -typedef _dart_clang_getFileTime = int Function( - ffi.Pointer SFile, +typedef _c_clang_constructUSR_ObjCProtocol = CXString Function( + ffi.Pointer protocol_name, ); -typedef _c_clang_getFileUniqueID = ffi.Int32 Function( - ffi.Pointer file, - ffi.Pointer outID, +typedef _dart_clang_constructUSR_ObjCProtocol = CXString Function( + ffi.Pointer protocol_name, ); -typedef _dart_clang_getFileUniqueID = int Function( - ffi.Pointer file, - ffi.Pointer outID, +typedef _c_clang_constructUSR_ObjCIvar = CXString Function( + ffi.Pointer name, + CXString classUSR, ); -typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _dart_clang_constructUSR_ObjCIvar = CXString Function( + ffi.Pointer name, + CXString classUSR, ); -typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _c_clang_constructUSR_ObjCMethod = CXString Function( + ffi.Pointer name, + ffi.Uint32 isInstanceMethod, + CXString classUSR, ); -typedef _c_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, +typedef _dart_clang_constructUSR_ObjCMethod = CXString Function( + ffi.Pointer name, + int isInstanceMethod, + CXString classUSR, ); -typedef _dart_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, +typedef _c_clang_constructUSR_ObjCProperty = CXString Function( + ffi.Pointer property, + CXString classUSR, ); -typedef _c_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, +typedef _dart_clang_constructUSR_ObjCProperty = CXString Function( + ffi.Pointer property, + CXString classUSR, ); -typedef _dart_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, +typedef _c_clang_getCursorSpelling = CXString Function( + CXCursor arg0, ); -typedef _c_clang_File_isEqual = ffi.Int32 Function( - ffi.Pointer file1, - ffi.Pointer file2, +typedef _dart_clang_getCursorSpelling = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_File_isEqual = int Function( - ffi.Pointer file1, - ffi.Pointer file2, +typedef _c_clang_Cursor_getSpellingNameRange = CXSourceRange Function( + CXCursor arg0, + ffi.Uint32 pieceIndex, + ffi.Uint32 options, ); -typedef _c_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _dart_clang_Cursor_getSpellingNameRange = CXSourceRange Function( + CXCursor arg0, + int pieceIndex, + int options, ); -typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, +typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( + ffi.Pointer Policy, + ffi.Int32 Property, ); -typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, +typedef _dart_clang_PrintingPolicy_getProperty = int Function( + ffi.Pointer Policy, + int Property, ); -typedef _dart_clang_getAllSkippedRanges = ffi.Pointer - Function( - ffi.Pointer tu, +typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( + ffi.Pointer Policy, + ffi.Int32 Property, + ffi.Uint32 Value, ); -typedef _c_clang_disposeSourceRangeList = ffi.Void Function( - ffi.Pointer ranges, +typedef _dart_clang_PrintingPolicy_setProperty = void Function( + ffi.Pointer Policy, + int Property, + int Value, ); -typedef _dart_clang_disposeSourceRangeList = void Function( - ffi.Pointer ranges, +typedef _c_clang_getCursorPrintingPolicy = ffi.Pointer Function( + CXCursor arg0, ); -typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( - ffi.Pointer Diags, +typedef _dart_clang_getCursorPrintingPolicy = ffi.Pointer Function( + CXCursor arg0, ); -typedef _dart_clang_getNumDiagnosticsInSet = int Function( - ffi.Pointer Diags, +typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( + ffi.Pointer Policy, ); -typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - ffi.Uint32 Index, +typedef _dart_clang_PrintingPolicy_dispose = void Function( + ffi.Pointer Policy, ); -typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - int Index, +typedef _c_clang_getCursorPrettyPrinted = CXString Function( + CXCursor Cursor, + ffi.Pointer Policy, ); -typedef _c_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, +typedef _dart_clang_getCursorPrettyPrinted = CXString Function( + CXCursor Cursor, + ffi.Pointer Policy, ); -typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, +typedef _c_clang_getCursorDisplayName = CXString Function( + CXCursor arg0, ); -typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( - ffi.Pointer Diags, +typedef _dart_clang_getCursorDisplayName = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_disposeDiagnosticSet = void Function( - ffi.Pointer Diags, +typedef _c_clang_getCursorReferenced = CXCursor Function( + CXCursor arg0, ); -typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, +typedef _dart_clang_getCursorReferenced = CXCursor Function( + CXCursor arg0, ); -typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, +typedef _c_clang_getCursorDefinition = CXCursor Function( + CXCursor arg0, ); -typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, +typedef _dart_clang_getCursorDefinition = CXCursor Function( + CXCursor arg0, ); -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, +typedef _c_clang_isCursorDefinition = ffi.Uint32 Function( + CXCursor arg0, ); -typedef _c_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, +typedef _dart_clang_isCursorDefinition = int Function( + CXCursor arg0, ); -typedef _dart_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, +typedef _c_clang_getCanonicalCursor = CXCursor Function( + CXCursor arg0, ); -typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, +typedef _dart_clang_getCanonicalCursor = CXCursor Function( + CXCursor arg0, ); -typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, +typedef _c_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( + CXCursor arg0, ); -typedef _c_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, +typedef _dart_clang_Cursor_getObjCSelectorIndex = int Function( + CXCursor arg0, ); -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, +typedef _c_clang_Cursor_isDynamicCall = ffi.Int32 Function( + CXCursor C, ); -typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); +typedef _dart_clang_Cursor_isDynamicCall = int Function( + CXCursor C, +); -typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); +typedef _c_clang_Cursor_getReceiverType = CXType Function( + CXCursor C, +); -typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getReceiverType = CXType Function( + CXCursor C, ); -typedef _dart_clang_getDiagnosticSeverity = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( + CXCursor C, + ffi.Uint32 reserved, ); -typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getObjCPropertyAttributes = int Function( + CXCursor C, + int reserved, ); -typedef _dart_clang_getDiagnosticCategory = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getObjCPropertyGetterName = CXString Function( + CXCursor C, ); -typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getObjCPropertyGetterName = CXString Function( + CXCursor C, ); -typedef _dart_clang_getDiagnosticNumRanges = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getObjCPropertySetterName = CXString Function( + CXCursor C, ); -typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( - ffi.Pointer Diagnostic, +typedef _dart_clang_Cursor_getObjCPropertySetterName = CXString Function( + CXCursor C, ); -typedef _dart_clang_getDiagnosticNumFixIts = int Function( - ffi.Pointer Diagnostic, +typedef _c_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Int32 num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, +typedef _dart_clang_Cursor_getObjCDeclQualifiers = int Function( + CXCursor C, ); -typedef _dart_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - int num_unsaved_files, - ffi.Pointer unsaved_files, +typedef _c_clang_Cursor_isObjCOptional = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, +typedef _dart_clang_Cursor_isObjCOptional = int Function( + CXCursor C, ); -typedef _dart_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, +typedef _c_clang_Cursor_isVariadic = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, +typedef _dart_clang_Cursor_isVariadic = int Function( + CXCursor C, ); -typedef _dart_clang_createTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, +typedef _c_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated, ); -typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); +typedef _dart_clang_Cursor_isExternalSymbol = int Function( + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated, +); -typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); +typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( + CXCursor C, +); -typedef _c_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, +typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( + CXCursor C, ); -typedef _dart_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, +typedef _c_clang_Cursor_getRawCommentText = CXString Function( + CXCursor C, ); -typedef _c_clang_parseTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, +typedef _dart_clang_Cursor_getRawCommentText = CXString Function( + CXCursor C, ); -typedef _dart_clang_parseTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, +typedef _c_clang_Cursor_getBriefCommentText = CXString Function( + CXCursor C, ); -typedef _c_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, +typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( + CXCursor C, ); -typedef _dart_clang_parseTranslationUnit2FullArgv = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, +typedef _c_clang_Cursor_getMangling = CXString Function( + CXCursor arg0, ); -typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( - ffi.Pointer TU, +typedef _dart_clang_Cursor_getMangling = CXString Function( + CXCursor arg0, ); -typedef _dart_clang_defaultSaveOptions = int Function( - ffi.Pointer TU, +typedef _c_clang_Cursor_getCXXManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer FileName, - ffi.Uint32 options, +typedef _dart_clang_Cursor_getCXXManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _dart_clang_saveTranslationUnit = int Function( - ffi.Pointer TU, - ffi.Pointer FileName, - int options, +typedef _c_clang_Cursor_getObjCManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getObjCManglings = ffi.Pointer Function( + CXCursor arg0, ); -typedef _dart_clang_suspendTranslationUnit = int Function( - ffi.Pointer arg0, +typedef _c_clang_Cursor_getModule = ffi.Pointer Function( + CXCursor C, ); -typedef _c_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, +typedef _dart_clang_Cursor_getModule = ffi.Pointer Function( + CXCursor C, ); -typedef _dart_clang_disposeTranslationUnit = void Function( +typedef _c_clang_getModuleForFile = ffi.Pointer Function( ffi.Pointer arg0, + ffi.Pointer arg1, ); -typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( - ffi.Pointer TU, +typedef _dart_clang_getModuleForFile = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, ); -typedef _dart_clang_defaultReparseOptions = int Function( - ffi.Pointer TU, +typedef _c_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _c_clang_reparseTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, - ffi.Uint32 options, +typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _dart_clang_reparseTranslationUnit = int Function( - ffi.Pointer TU, - int num_unsaved_files, - ffi.Pointer unsaved_files, - int options, +typedef _c_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( - ffi.Int32 kind, +typedef _dart_clang_Module_getParent = ffi.Pointer Function( + ffi.Pointer Module, ); -typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( - int kind, +typedef _c_clang_Module_getName = CXString Function( + ffi.Pointer Module, ); -typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, +typedef _dart_clang_Module_getName = CXString Function( + ffi.Pointer Module, ); -typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, +typedef _c_clang_Module_getFullName = CXString Function( + ffi.Pointer Module, ); -typedef _c_clang_TargetInfo_dispose = ffi.Void Function( - ffi.Pointer Info, +typedef _dart_clang_Module_getFullName = CXString Function( + ffi.Pointer Module, ); -typedef _dart_clang_TargetInfo_dispose = void Function( - ffi.Pointer Info, +typedef _c_clang_Module_isSystem = ffi.Int32 Function( + ffi.Pointer Module, ); -typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( - ffi.Pointer Info, +typedef _dart_clang_Module_isSystem = int Function( + ffi.Pointer Module, ); -typedef _dart_clang_TargetInfo_getPointerWidth = int Function( - ffi.Pointer Info, +typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( + ffi.Pointer arg0, + ffi.Pointer Module, ); -typedef _c_clang_isDeclaration = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( + ffi.Pointer arg0, + ffi.Pointer Module, ); -typedef _dart_clang_isDeclaration = int Function( - int arg0, +typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + ffi.Uint32 Index, ); -typedef _c_clang_isReference = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer Module, + int Index, ); -typedef _dart_clang_isReference = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isExpression = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isConvertingConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isExpression = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isStatement = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isCopyConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isStatement = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isAttribute = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isDefaultConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isAttribute = int Function( - int arg0, +typedef _c_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isInvalid = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXConstructor_isMoveConstructor = int Function( + CXCursor C, ); -typedef _dart_clang_isInvalid = int Function( - int arg0, +typedef _c_clang_CXXField_isMutable = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXField_isMutable = int Function( + CXCursor C, ); -typedef _dart_clang_isTranslationUnit = int Function( - int arg0, +typedef _c_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isPreprocessing = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXMethod_isDefaulted = int Function( + CXCursor C, ); -typedef _dart_clang_isPreprocessing = int Function( - int arg0, +typedef _c_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_isUnexposed = ffi.Uint32 Function( - ffi.Int32 arg0, +typedef _dart_clang_CXXMethod_isPureVirtual = int Function( + CXCursor C, ); -typedef _dart_clang_isUnexposed = int Function( - int arg0, +typedef _c_clang_CXXMethod_isStatic = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( - ffi.Pointer availability, +typedef _dart_clang_CXXMethod_isStatic = int Function( + CXCursor C, ); -typedef _dart_clang_disposeCXPlatformAvailability = void Function( - ffi.Pointer availability, +typedef _c_clang_CXXMethod_isVirtual = ffi.Uint32 Function( + CXCursor C, ); -typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); - -typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); +typedef _dart_clang_CXXMethod_isVirtual = int Function( + CXCursor C, +); -typedef _c_clang_disposeCXCursorSet = ffi.Void Function( - ffi.Pointer cset, +typedef _c_clang_CXXRecord_isAbstract = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_disposeCXCursorSet = void Function( - ffi.Pointer cset, +typedef _dart_clang_CXXRecord_isAbstract = int Function( + CXCursor C, ); -typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( - ffi.Pointer overridden, +typedef _c_clang_EnumDecl_isScoped = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_disposeOverriddenCursors = void Function( - ffi.Pointer overridden, +typedef _dart_clang_EnumDecl_isScoped = int Function( + CXCursor C, ); -typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - ffi.Pointer Policy, - ffi.Int32 Property, +typedef _c_clang_CXXMethod_isConst = ffi.Uint32 Function( + CXCursor C, ); -typedef _dart_clang_PrintingPolicy_getProperty = int Function( - ffi.Pointer Policy, - int Property, +typedef _dart_clang_CXXMethod_isConst = int Function( + CXCursor C, ); -typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( - ffi.Pointer Policy, - ffi.Int32 Property, - ffi.Uint32 Value, +typedef _c_clang_getTemplateCursorKind = ffi.Int32 Function( + CXCursor C, ); -typedef _dart_clang_PrintingPolicy_setProperty = void Function( - ffi.Pointer Policy, - int Property, - int Value, +typedef _dart_clang_getTemplateCursorKind = int Function( + CXCursor C, ); -typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( - ffi.Pointer Policy, +typedef _c_clang_getSpecializedCursorTemplate = CXCursor Function( + CXCursor C, ); -typedef _dart_clang_PrintingPolicy_dispose = void Function( - ffi.Pointer Policy, +typedef _dart_clang_getSpecializedCursorTemplate = CXCursor Function( + CXCursor C, ); -typedef _c_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, +typedef _c_clang_getCursorReferenceNameRange = CXSourceRange Function( + CXCursor C, + ffi.Uint32 NameFlags, + ffi.Uint32 PieceIndex, ); -typedef _dart_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, +typedef _dart_clang_getCursorReferenceNameRange = CXSourceRange Function( + CXCursor C, + int NameFlags, + int PieceIndex, ); -typedef _c_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, +typedef _c_clang_getToken = ffi.Pointer Function( + ffi.Pointer TU, + CXSourceLocation Location, ); -typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, +typedef _dart_clang_getToken = ffi.Pointer Function( + ffi.Pointer TU, + CXSourceLocation Location, ); -typedef _c_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, +typedef _c_clang_getTokenKind = ffi.Int32 Function( + CXToken arg0, ); -typedef _dart_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, +typedef _dart_clang_getTokenKind = int Function( + CXToken arg0, ); -typedef _c_clang_Module_isSystem = ffi.Int32 Function( - ffi.Pointer Module, +typedef _c_clang_getTokenSpelling = CXString Function( + ffi.Pointer arg0, + CXToken arg1, ); -typedef _dart_clang_Module_isSystem = int Function( - ffi.Pointer Module, +typedef _dart_clang_getTokenSpelling = CXString Function( + ffi.Pointer arg0, + CXToken arg1, ); -typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( +typedef _c_clang_getTokenLocation = CXSourceLocation Function( ffi.Pointer arg0, - ffi.Pointer Module, + CXToken arg1, ); -typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( +typedef _dart_clang_getTokenLocation = CXSourceLocation Function( ffi.Pointer arg0, - ffi.Pointer Module, + CXToken arg1, ); -typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( +typedef _c_clang_getTokenExtent = CXSourceRange Function( ffi.Pointer arg0, - ffi.Pointer Module, - ffi.Uint32 Index, + CXToken arg1, ); -typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( +typedef _dart_clang_getTokenExtent = CXSourceRange Function( ffi.Pointer arg0, - ffi.Pointer Module, - int Index, + CXToken arg1, +); + +typedef _c_clang_tokenize = ffi.Void Function( + ffi.Pointer TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens, +); + +typedef _dart_clang_tokenize = void Function( + ffi.Pointer TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens, ); typedef _c_clang_annotateTokens = ffi.Void Function( @@ -5292,6 +9878,34 @@ typedef _dart_clang_disposeTokens = void Function( int NumTokens, ); +typedef _c_clang_getCursorKindSpelling = CXString Function( + ffi.Int32 Kind, +); + +typedef _dart_clang_getCursorKindSpelling = CXString Function( + int Kind, +); + +typedef _c_clang_getDefinitionSpellingAndExtent = ffi.Void Function( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, +); + +typedef _dart_clang_getDefinitionSpellingAndExtent = void Function( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn, +); + typedef _c_clang_enableStackTraces = ffi.Void Function(); typedef _dart_clang_enableStackTraces = void Function(); @@ -5322,6 +9936,16 @@ typedef _dart_clang_getCompletionChunkKind = int Function( int chunk_number, ); +typedef _c_clang_getCompletionChunkText = CXString Function( + ffi.Pointer completion_string, + ffi.Uint32 chunk_number, +); + +typedef _dart_clang_getCompletionChunkText = CXString Function( + ffi.Pointer completion_string, + int chunk_number, +); + typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer Function( ffi.Pointer completion_string, @@ -5366,6 +9990,42 @@ typedef _dart_clang_getCompletionNumAnnotations = int Function( ffi.Pointer completion_string, ); +typedef _c_clang_getCompletionAnnotation = CXString Function( + ffi.Pointer completion_string, + ffi.Uint32 annotation_number, +); + +typedef _dart_clang_getCompletionAnnotation = CXString Function( + ffi.Pointer completion_string, + int annotation_number, +); + +typedef _c_clang_getCompletionParent = CXString Function( + ffi.Pointer completion_string, + ffi.Pointer kind, +); + +typedef _dart_clang_getCompletionParent = CXString Function( + ffi.Pointer completion_string, + ffi.Pointer kind, +); + +typedef _c_clang_getCompletionBriefComment = CXString Function( + ffi.Pointer completion_string, +); + +typedef _dart_clang_getCompletionBriefComment = CXString Function( + ffi.Pointer completion_string, +); + +typedef _c_clang_getCursorCompletionString = ffi.Pointer Function( + CXCursor cursor, +); + +typedef _dart_clang_getCursorCompletionString = ffi.Pointer Function( + CXCursor cursor, +); + typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( ffi.Pointer results, ffi.Uint32 completion_index, @@ -5376,6 +10036,20 @@ typedef _dart_clang_getCompletionNumFixIts = int Function( int completion_index, ); +typedef _c_clang_getCompletionFixIt = CXString Function( + ffi.Pointer results, + ffi.Uint32 completion_index, + ffi.Uint32 fixit_index, + ffi.Pointer replacement_range, +); + +typedef _dart_clang_getCompletionFixIt = CXString Function( + ffi.Pointer results, + int completion_index, + int fixit_index, + ffi.Pointer replacement_range, +); + typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); typedef _dart_clang_defaultCodeCompleteOptions = int Function(); @@ -5455,6 +10129,26 @@ typedef _dart_clang_codeCompleteGetContainerKind = int Function( ffi.Pointer IsIncomplete, ); +typedef _c_clang_codeCompleteGetContainerUSR = CXString Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetContainerUSR = CXString Function( + ffi.Pointer Results, +); + +typedef _c_clang_codeCompleteGetObjCSelector = CXString Function( + ffi.Pointer Results, +); + +typedef _dart_clang_codeCompleteGetObjCSelector = CXString Function( + ffi.Pointer Results, +); + +typedef _c_clang_getClangVersion = CXString Function(); + +typedef _dart_clang_getClangVersion = CXString Function(); + typedef _c_clang_toggleCrashRecovery = ffi.Void Function( ffi.Uint32 isEnabled, ); @@ -5482,6 +10176,14 @@ typedef _dart_clang_getInclusions = void Function( ffi.Pointer client_data, ); +typedef _c_clang_Cursor_Evaluate = ffi.Pointer Function( + CXCursor C, +); + +typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( + CXCursor C, +); + typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( ffi.Pointer E, ); @@ -5594,6 +10296,30 @@ typedef _dart_clang_remap_dispose = void Function( ffi.Pointer arg0, ); +typedef _c_clang_findReferencesInFile = ffi.Int32 Function( + CXCursor cursor, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + +typedef _dart_clang_findReferencesInFile = int Function( + CXCursor cursor, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + +typedef _c_clang_findIncludesInFile = ffi.Int32 Function( + ffi.Pointer TU, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + +typedef _dart_clang_findIncludesInFile = int Function( + ffi.Pointer TU, + ffi.Pointer file, + CXCursorAndRangeVisitor visitor, +); + typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( ffi.Int32 arg0, ); @@ -5802,44 +10528,93 @@ typedef _dart_clang_indexTranslationUnit = int Function( ffi.Pointer arg5, ); +typedef _c_clang_indexLoc_getFileLocation = ffi.Void Function( + CXIdxLoc loc, + ffi.Pointer> indexFile, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _dart_clang_indexLoc_getFileLocation = void Function( + CXIdxLoc loc, + ffi.Pointer> indexFile, + ffi.Pointer> file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset, +); + +typedef _c_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( + CXIdxLoc loc, +); + +typedef _dart_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( + CXIdxLoc loc, +); + +typedef CXFieldVisitor = ffi.Int32 Function( + CXCursor, + ffi.Pointer, +); + +typedef _c_clang_Type_visitFields = ffi.Uint32 Function( + CXType T, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + +typedef _dart_clang_Type_visitFields = int Function( + CXType T, + ffi.Pointer> visitor, + ffi.Pointer client_data, +); + typedef _typedefC_2 = ffi.Int32 Function( + ffi.Pointer, + CXCursor, + CXSourceRange, +); + +typedef _typedefC_3 = ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_3 = ffi.Void Function( +typedef _typedefC_4 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_4 = ffi.Pointer Function( +typedef _typedefC_5 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_5 = ffi.Pointer Function( +typedef _typedefC_6 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_6 = ffi.Pointer Function( +typedef _typedefC_7 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_7 = ffi.Pointer Function( +typedef _typedefC_8 = ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_8 = ffi.Void Function( +typedef _typedefC_9 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); -typedef _typedefC_9 = ffi.Void Function( +typedef _typedefC_10 = ffi.Void Function( ffi.Pointer, ffi.Pointer, ); diff --git a/test/native_test/native_test.c b/test/native_test/native_test.c index 57b23c02..037a73b1 100644 --- a/test/native_test/native_test.c +++ b/test/native_test/native_test.c @@ -49,3 +49,24 @@ struct Struct1 *getStruct1() s->data[2][0][1] = 6; return s; } + +struct Struct3 +{ + int a; + int b; + int c; +}; + +struct Struct3 Function1StructReturnByValue(int a, int b, int c) +{ + struct Struct3 s; + s.a = a; + s.b = b; + s.c = c; + return s; +} + +int Function1StructPassByValue(struct Struct3 sum_a_b_c) +{ + return sum_a_b_c.a + sum_a_b_c.b + sum_a_b_c.c; +} diff --git a/test/native_test/native_test.dart b/test/native_test/native_test.dart index 479b9102..5e90a0ba 100644 --- a/test/native_test/native_test.dart +++ b/test/native_test/native_test.dart @@ -135,5 +135,11 @@ void main() { expect(() => struct1.ref.data[0][0][-1] = 0, throwsA(TypeMatcher())); }); + test('Struct By Value', () { + final r = Random(); + final a = r.nextInt(100), b = r.nextInt(100), c = r.nextInt(100); + final s = bindings.Function1StructReturnByValue(a, b, c); + expect(bindings.Function1StructPassByValue(s), a + b + c); + }); }); } diff --git a/test/native_test/native_test_bindings.dart b/test/native_test/native_test_bindings.dart index 60825f14..a4ae36f9 100644 --- a/test/native_test/native_test_bindings.dart +++ b/test/native_test/native_test_bindings.dart @@ -162,6 +162,34 @@ class NativeLibrary { } _dart_getStruct1? _getStruct1; + + Struct3 Function1StructReturnByValue( + int a, + int b, + int c, + ) { + return (_Function1StructReturnByValue ??= _dylib.lookupFunction< + _c_Function1StructReturnByValue, + _dart_Function1StructReturnByValue>('Function1StructReturnByValue'))( + a, + b, + c, + ); + } + + _dart_Function1StructReturnByValue? _Function1StructReturnByValue; + + int Function1StructPassByValue( + Struct3 sum_a_b_c, + ) { + return (_Function1StructPassByValue ??= _dylib.lookupFunction< + _c_Function1StructPassByValue, + _dart_Function1StructPassByValue>('Function1StructPassByValue'))( + sum_a_b_c, + ); + } + + _dart_Function1StructPassByValue? _Function1StructPassByValue; } class Struct1 extends ffi.Struct { @@ -303,6 +331,17 @@ class ArrayHelper_Struct1_data_level2 { } } +class Struct3 extends ffi.Struct { + @ffi.Int32() + external int a; + + @ffi.Int32() + external int b; + + @ffi.Int32() + external int c; +} + typedef _c_Function1Bool = ffi.Uint8 Function( ffi.Uint8 x, ); @@ -402,3 +441,23 @@ typedef _dart_Function1Double = double Function( typedef _c_getStruct1 = ffi.Pointer Function(); typedef _dart_getStruct1 = ffi.Pointer Function(); + +typedef _c_Function1StructReturnByValue = Struct3 Function( + ffi.Int32 a, + ffi.Int32 b, + ffi.Int32 c, +); + +typedef _dart_Function1StructReturnByValue = Struct3 Function( + int a, + int b, + int c, +); + +typedef _c_Function1StructPassByValue = ffi.Int32 Function( + Struct3 sum_a_b_c, +); + +typedef _dart_Function1StructPassByValue = int Function( + Struct3 sum_a_b_c, +);